← Back to team overview

c2c-oerpscenario team mailing list archive

[Bug 778152] Re: [stable 6.0] stock/wizard/stock_partial_picking.py has bad currency determination as uses optional field to determine value with no failsafe

 

Hello Greme,

Thanks for your reply and nice explanation.
It is already fixed in latest trunk version But the problem also exist in latest stable version.

So I am confirming this for stable version.

Thanks again!

** Changed in: openobject-addons
   Importance: Undecided => Low

** Changed in: openobject-addons
       Status: Incomplete => Confirmed

** Changed in: openobject-addons
     Assignee: (unassigned) => OpenERP Publisher's Warranty Team (openerp-opw)

-- 
You received this bug notification because you are a member of C2C
OERPScenario, which is subscribed to the OpenERP Project Group.
https://bugs.launchpad.net/bugs/778152

Title:
  [stable 6.0] stock/wizard/stock_partial_picking.py has bad currency
  determination as uses optional field to determine value with no
  failsafe

Status in OpenERP Modules (addons):
  Confirmed

Bug description:
  The offending function is this one

      def __create_partial_picking_memory(self, picking, pick_type):
          move_memory = {
              'product_id' : picking.product_id.id, 
              'quantity' : picking.product_qty, 
              'product_uom' : picking.product_uom.id, 
              'prodlot_id' : picking.prodlot_id.id, 
              'move_id' : picking.id, 
          }
      
          if pick_type == 'in':
              move_memory.update({
                  'cost' : picking.product_id.standard_price, 
                  'currency' : picking.product_id.company_id.currency_id.id, 
              })

  When creating a product company is an optional field.  Especially
  useful in multicompany, however when looking for currency it uses this
  field to find it.  Moreover this is incorrect anyhow as new security
  rules introduced to share partners and products means that it is
  looking potentially at the wrong company to determine currency for the
  move.

  If a company is not set, you receive a NoneType error.


References