Merge lp:~openerp-dev/openobject-addons/trunk-bug-794412-ron into lp:openobject-addons

Proposed by Rohan Nayani(Open ERP)
Status: Rejected
Rejected by: Fabien (Open ERP)
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-794412-ron
Merge into: lp:openobject-addons
Diff against target: 16 lines (+5/-1)
1 file modified
sale/sale.py (+5/-1)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-794412-ron
Reviewer Review Type Date Requested Status
Fabien (Open ERP) Disapprove
Rucha (Open ERP) (community) Approve
qdp (OpenERP) Pending
Review via email: mp+65479@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Rucha (Open ERP) (rpa-openerp) wrote :

thanks for the fix, it fixes the problem in the "bug reported".

review: Approve
Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

This creates another problem.
You have to fix the shipped function field. This shipped function field must work on procurement order, not on pickings otherwise it will not work for services.

review: Disapprove
Revision history for this message
qdp (OpenERP) (qdp) wrote :

i don't understand your comment, fabien; the case of services is already handled by the project_mrp module which overwrites the function _picked_rate of the sale_order. Although it's maybe not the best solution from a design point of view, it seems working just fine currently.

So this patch should be tested but at first sight i don't see any reason not to consider it.

Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

if order.shipped:
   this is generic as it check if the products or services (or other future type of product) are delivered.

for picking in order.picking_ids:
   this only works for stockable products which is not good.

Several modules can inherit and enhance the order.shipped.

Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

You must fix in the order.shipped (so the condition of the workflow)

Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

@qdp the patch may fix the picking ratio, but it does not fixes the main issue: order.shipped is wrong. (this can generate others side effects, like invoice after delivery)

Revision history for this message
Fabien (Open ERP) (fp-tinyerp) wrote :

I reject this patch, please do another one that fixes the issue correctly.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'sale/sale.py'
2--- sale/sale.py 2011-09-18 13:41:16 +0000
3+++ sale/sale.py 2011-09-20 10:10:13 +0000
4@@ -120,7 +120,11 @@
5 tmp[item['sale_order_id']]['picked'] += item['nbr'] or 0.0
6
7 for order in self.browse(cr, uid, ids, context=context):
8- if order.shipped:
9+ for picking in order.picking_ids:
10+ if picking.state not in ('done', 'cancel'):
11+ pick_state = False
12+ break
13+ if pick_state and order.shipped:
14 res[order.id] = 100.0
15 else:
16 res[order.id] = tmp[order.id]['total'] and (100.0 * tmp[order.id]['picked'] / tmp[order.id]['total']) or 0.0

Subscribers

People subscribed via source and target branches

to all changes: