[FIX] delivery: fix functional field for corerctiong weight calculation
authorRifakat (OpenERP) <rha@tinyerp.com>
Tue, 27 Sep 2011 06:10:46 +0000 (11:40 +0530)
committerRifakat (OpenERP) <rha@tinyerp.com>
Tue, 27 Sep 2011 06:10:46 +0000 (11:40 +0530)
lp bug: https://launchpad.net/bugs/857067 fixed

bzr revid: rha@tinyerp.com-20110927061046-p52r0v9i3y64uv3j

1  2 
addons/delivery/stock.py

@@@ -54,15 -66,15 +54,15 @@@ class stock_picking(osv.osv)
      _columns = {
          'carrier_id':fields.many2one("delivery.carrier","Carrier"),
          'volume': fields.float('Volume'),
-         'weight': fields.function(_cal_weight, method=True, type='float', string='Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_weight',
 -        'weight': fields.function(_cal_weight, fnct_inv=set_weight, method=True, type='float', string='Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_weight', 
++        'weight': fields.function(_cal_weight, method=True, type='float', string='Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_weight', 
                    store={
                   'stock.picking': (lambda self, cr, uid, ids, c={}: ids, ['move_lines'], 20),
--                 'stock.move': (_get_picking_line, ['product_id','product_qty','product_uom','product_uos_qty'], 20),
++                 'stock.move': (_get_picking_line, ['product_id','product_qty','product_uom','product_uos_qty','picking_id'], 20),
                   }),
-         'weight_net': fields.function(_cal_weight, method=True, type='float', string='Net Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_weight',
 -        'weight_net': fields.function(_cal_weight, fnct_inv=set_weight_net, method=True, type='float', string='Net Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_weight', 
++        'weight_net': fields.function(_cal_weight, method=True, type='float', string='Net Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_weight', 
                    store={
                   'stock.picking': (lambda self, cr, uid, ids, c={}: ids, ['move_lines'], 20),
--                 'stock.move': (_get_picking_line, ['product_id','product_qty','product_uom','product_uos_qty'], 20),
++                 'stock.move': (_get_picking_line, ['product_id','product_qty','product_uom','product_uos_qty','picking_id'], 20),
                   }),
          'carrier_tracking_ref': fields.char('Carrier Tracking Ref', size=32),
          'number_of_packages': fields.integer('Number of Packages'),