Merge lp:~openerp-dev/openobject-addons/trunk-bug-782168-uco into lp:openobject-addons

Proposed by Ujjvala Collins
Status: Rejected
Rejected by: Fabien (Open ERP)
Proposed branch: lp:~openerp-dev/openobject-addons/trunk-bug-782168-uco
Merge into: lp:openobject-addons
Diff against target: 22 lines (+12/-0)
1 file modified
sale/sale.py (+12/-0)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/trunk-bug-782168-uco
Reviewer Review Type Date Requested Status
Mustufa Rangwala (Open ERP) (community) Disapprove
Olivier Dony (Odoo) Disapprove
qdp (OpenERP) Pending
Review via email: mp+61537@code.launchpad.net

Description of the change

[FIX] sale: Corrected compute button functionality for different pricelist using different currencies.

To post a comment you must log in.
Revision history for this message
Graeme Gellatly (gdgellatly) wrote :

Hi,

I am so glad you went this way to fixing it, much more sensible, enforcing one pricelist per order.

However, there is a major bug in your code. What if the user changed the price manually? You will overwrite all his manual changes. I think you would be better implementing this in an onchange pricelist function.

Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

I agree with Graeme Gellatly comment.

review: Needs Fixing
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

I agree that this patch is incorrect, but I'm afraid the other suggestions are not correct either.
In fact, after discussing with R&D management, we are more inclined to close the bug as invalid, because it is really an exception case.
As always with OpenERP, we don't want or plan to handle automatically all exception cases, because there is no safe way of doing that. If we enforce one behavior (e.g. automatic recompute), there will be other users who will need the opposite behavior, and will have more trouble *after the fix* than before. See more details in the bug comments.

review: Disapprove
Revision history for this message
Mustufa Rangwala (Open ERP) (mra-tinyerp) wrote :

As we are making the solution for this bug with tooltips or on change on price list with warning message so for now we are not considering changes from this merge proposal.

Thanks,
mra

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

I made another fix in r5114

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-05-18 16:45:45 +0000
3+++ sale/sale.py 2011-06-20 11:36:02 +0000
4@@ -370,6 +370,18 @@
5 return super(sale_order, self).create(cr, uid, vals, context=context)
6
7 def button_dummy(self, cr, uid, ids, context=None):
8+ sale_obj = self.browse(cr, uid, ids[0], context=context)
9+ sale_line_obj = self.pool.get('sale.order.line')
10+ pricelist_obj = self.pool.get('product.pricelist')
11+ pricelist = sale_obj.pricelist_id.id
12+ for line in sale_obj.order_line:
13+ if line.product_id:
14+ price = pricelist_obj.price_get(cr, uid, [pricelist],
15+ line.product_id.id, line.product_uom_qty or 1.0, sale_obj.partner_id.id, {
16+ 'uom': line.product_uom.id,
17+ 'date': sale_obj.date_order,
18+ })[pricelist]
19+ sale_line_obj.write(cr, uid, line.id, {'price_unit': price}, context=context)
20 return True
21
22 #FIXME: the method should return the list of invoices created (invoice_ids)

Subscribers

People subscribed via source and target branches

to all changes: