Merge lp:~openerp-dev/openobject-addons/6.0-bug-857067-rha into lp:openobject-addons/6.0

Proposed by Rifakat Husen (OpenERP)
Status: Merged
Merged at revision: 4856
Proposed branch: lp:~openerp-dev/openobject-addons/6.0-bug-857067-rha
Merge into: lp:openobject-addons/6.0
Diff against target: 32 lines (+5/-5)
1 file modified
delivery/stock.py (+5/-5)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.0-bug-857067-rha
Reviewer Review Type Date Requested Status
Raphael Collet (OpenERP) (community) Approve
Rifakat Husen (OpenERP) (community) Needs Resubmitting
Review via email: mp+76736@code.launchpad.net

Description of the change

Hello,

Incorrect values for weight and net weight for backorder and delivery order while doing partial delivery.

Fix solves problem.

Regards.

To post a comment you must log in.
Revision history for this message
Raphael Collet (OpenERP) (rco-openerp) wrote :

This is the wrong approach. Don't override do_partial().

The values of weight and weight_net are probably wrong because their stored value is not recomputed after some data change. Please fix the 'store' argument in the function fields! What is the change in the data that requires those fields to be recomputed?

review: Needs Fixing
Revision history for this message
Rifakat Husen (OpenERP) (rha-openerp) wrote :

When ever we try to process the delivery order, weight should be calculated with respect to remaining quantity.

I have corrected functional fields and its fixed without overriding do_partial()

Thanks.

review: Needs Resubmitting
Revision history for this message
Raphael Collet (OpenERP) (rco-openerp) wrote :

Excellent!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'delivery/stock.py'
2--- delivery/stock.py 2011-01-14 00:11:01 +0000
3+++ delivery/stock.py 2011-09-27 06:13:24 +0000
4@@ -43,7 +43,7 @@
5 'weight_net': total_weight_net,
6 }
7 return res
8-
9+
10
11 def _get_picking_line(self, cr, uid, ids, context=None):
12 result = {}
13@@ -54,15 +54,15 @@
14 _columns = {
15 'carrier_id':fields.many2one("delivery.carrier","Carrier"),
16 'volume': fields.float('Volume'),
17- 'weight': fields.function(_cal_weight, method=True, type='float', string='Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_weight',
18+ 'weight': fields.function(_cal_weight, method=True, type='float', string='Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_weight',
19 store={
20 'stock.picking': (lambda self, cr, uid, ids, c={}: ids, ['move_lines'], 20),
21- 'stock.move': (_get_picking_line, ['product_id','product_qty','product_uom','product_uos_qty'], 20),
22+ 'stock.move': (_get_picking_line, ['product_id','product_qty','product_uom','product_uos_qty','picking_id'], 20),
23 }),
24- 'weight_net': fields.function(_cal_weight, method=True, type='float', string='Net Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_weight',
25+ 'weight_net': fields.function(_cal_weight, method=True, type='float', string='Net Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_weight',
26 store={
27 'stock.picking': (lambda self, cr, uid, ids, c={}: ids, ['move_lines'], 20),
28- 'stock.move': (_get_picking_line, ['product_id','product_qty','product_uom','product_uos_qty'], 20),
29+ 'stock.move': (_get_picking_line, ['product_id','product_qty','product_uom','product_uos_qty','picking_id'], 20),
30 }),
31 'carrier_tracking_ref': fields.char('Carrier Tracking Ref', size=32),
32 'number_of_packages': fields.integer('Number of Packages'),