Merge lp:~openerp-dev/openobject-addons/6.1-opw-581791-rgo into lp:openobject-addons/6.1

Proposed by Ravi Gohil (OpenERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openobject-addons/6.1-opw-581791-rgo
Merge into: lp:openobject-addons/6.1
Diff against target: 21 lines (+2/-2)
1 file modified
warning/ (+2/-2)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/6.1-opw-581791-rgo
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email:

Description of the change

Steps to reproduce(From Web-Client):
1) Create a db with demo data and install module `warning`,
2) Create a product and set it's default UoM to `PCE` and Purchase UoM to `Dozen`,
3) Edit an RFQ which has a order line for `PCE` and select the product created in step 2,

On changing the product, UoM expected to be set to `Dozen`, instead, it stays `PCE`.

This is due to context not passed when called `product_id_change()` with `super` because purchase UoM being set on the basis of context.

This branch also contains fix for the traceback faced saying, TypeError: onchange_product_id() got an unexpected keyword argument 'fiscal_position_id'" when changing the product in purchase order line.

Kindly review the fix.


To post a comment you must log in.

Unmerged revisions

7076. By Ravi Gohil (OpenERP)

[FIX] warning: Purchase UoM is not being set when changing the product in purchase order line : (Maintenance Case : 581791)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'warning/'
2--- warning/ 2012-09-06 10:32:09 +0000
3+++ warning/ 2012-11-21 10:27:34 +0000
4@@ -231,7 +231,7 @@
5 class purchase_order_line(osv.osv):
6 _inherit = 'purchase.order.line'
7 def onchange_product_id(self,cr, uid, ids, pricelist, product, qty, uom,
8- partner_id, date_order=False, fiscal_position=False, date_planned=False,
9+ partner_id, date_order=False, fiscal_position_id=False, date_planned=False,
10 name=False, price_unit=False, notes=False, context=None):
11 warning = {}
12 if not product:
13@@ -250,7 +250,7 @@
14 warning['message'] = message
16 result = super(purchase_order_line, self).product_id_change(cr, uid, ids, pricelist, product, qty, uom,
17- partner_id, date_order, fiscal_position)
18+ partner_id, date_order, fiscal_position_id, context=context)
20 if result.get('warning',False):
21 warning['title'] = title and title +' & '+result['warning']['title'] or result['warning']['title']