[Trunk]Problem in product on_change method in sale_margin

Bug #809751 reported by Amit Parik
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Medium
OpenERP R&D Addons Team 3

Bug Description

Steps to reproduce:
1) Install sale_margin module
2) Create a SO Open the So line you have faced the following traceback.

Traceback (most recent call last):
  File "/home/amp/workspace/trunk6/server/openerp/osv/osv.py", line 118, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/home/amp/workspace/trunk6/server/openerp/osv/osv.py", line 172, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/home/amp/workspace/trunk6/server/openerp/osv/osv.py", line 163, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
TypeError: product_id_change() takes at most 18 arguments (19 given)

Solution : the context is missing in product_id_change method is sale.order.line object.

=== modified file 'sale_margin/sale_margin.py'
--- sale_margin/sale_margin.py 2011-07-01 23:41:24 +0000
+++ sale_margin/sale_margin.py 2011-07-13 07:33:37 +0000
@@ -25,7 +25,7 @@

     def product_id_change(self, cr, uid, ids, pricelist, product, qty=0,
             uom=False, qty_uos=0, uos=False, name='', partner_id=False,
- lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False, flag=False):
+ lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False, flag=False, context=None):
         res = super(sale_order_line, self).product_id_change(cr, uid, ids, pricelist, product, qty=qty,
             uom=uom, qty_uos=qty_uos, uos=uos, name=name, partner_id=partner_id,
             lang=lang, update_tax=update_tax, date_order=date_order, packaging=packaging, fiscal_position=fiscal_position, flag=flag)

Related branches

Amit Parik (amit-parik)
Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 3 (openerp-dev-addons3)
importance: Undecided → Medium
status: New → Confirmed
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Bharat Devnani (Open ERP) (bde-openerp) wrote :

Hello Amit Parik,

Thanks for Reporting this issue. i have checked your solution and its working fine. Following are the Revision ID and Number of the bug :

Revision ID : <email address hidden>
Revision Number : 4883

The solution will be merged in addons soon.

Thanks & Regards,
Devnani Bharat R.

Changed in openobject-addons:
status: In Progress → Fix Committed
Revision history for this message
qdp (OpenERP) (qdp) wrote :

fix released in revision 5083

Changed in openobject-addons:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.