← Back to team overview

credativ team mailing list archive

[Bug 907701] [NEW] Standard cost settings are ignored for purchases

 

Public bug reported:

I want to value my stock moves based on standard cost with realtime inventory.
Purchase module do override the standard cost with the purchasing value if they find one (purchase/stock.py).

Nevertheless the code v6.0 says the contrary (purchase/stock.py):
    def _get_reference_accounting_values_for_valuation(self, cr, uid, move, context=None):
        """
        Overrides the default stock valuation to take into account the currency that was specified
        on the purchase order in case the valuation data was not directly specified during picking
        confirmation.
        """
        reference_amount, reference_currency_id = super(stock_move, self)._get_reference_accounting_values_for_valuation(cr, uid, move, context=context)
        if move.product_id.cost_method != 'average' or not move.price_unit:
            # no average price costing or cost not specified during picking validation, we will
            # plug the purchase line values if they are found.
            if move.purchase_line_id and move.picking_id.purchase_id.pricelist_id:
                reference_amount, reference_currency_id = move.purchase_line_id.price_unit * move.product_qty, move.picking_id.purchase_id.pricelist_id.currency_id.id
        return reference_amount, reference_currency_id

If the product is set up as "standard cost" it replaces the SC value by
the PO value.

I would have expected OE to get all the time the SC for stock move
evaluation even if there is a purchase value.

** Affects: openobject-addons
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of OpenERP
Framework Experts, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/907701

Title:
  Standard cost settings are ignored for purchases

Status in OpenERP Addons (modules):
  New

Bug description:
  I want to value my stock moves based on standard cost with realtime inventory.
  Purchase module do override the standard cost with the purchasing value if they find one (purchase/stock.py).

  Nevertheless the code v6.0 says the contrary (purchase/stock.py):
      def _get_reference_accounting_values_for_valuation(self, cr, uid, move, context=None):
          """
          Overrides the default stock valuation to take into account the currency that was specified
          on the purchase order in case the valuation data was not directly specified during picking
          confirmation.
          """
          reference_amount, reference_currency_id = super(stock_move, self)._get_reference_accounting_values_for_valuation(cr, uid, move, context=context)
          if move.product_id.cost_method != 'average' or not move.price_unit:
              # no average price costing or cost not specified during picking validation, we will
              # plug the purchase line values if they are found.
              if move.purchase_line_id and move.picking_id.purchase_id.pricelist_id:
                  reference_amount, reference_currency_id = move.purchase_line_id.price_unit * move.product_qty, move.picking_id.purchase_id.pricelist_id.currency_id.id
          return reference_amount, reference_currency_id

  If the product is set up as "standard cost" it replaces the SC value
  by the PO value.

  I would have expected OE to get all the time the SC for stock move
  evaluation even if there is a purchase value.

To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/907701/+subscriptions


Follow ups

References