From 69abb48428eef627ab70809fc9f0835aaff47c06 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Fri, 21 Sep 2012 11:35:20 +0200 Subject: [PATCH] [FIX] sale_stock: added missing argument 'context' to the signature of methods _get_line_uom() and _get_line_qty() bzr revid: qdp-launchpad@openerp.com-20120921093520-q3awtbrzeqf1jfgb --- addons/sale/sale.py | 8 ++++---- addons/sale_stock/sale_stock.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 8e298ab084c..96f44d353d6 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -730,13 +730,13 @@ class sale_order_line(osv.osv): 'price_unit': 0.0, } - def _get_line_qty(self, cr, uid, line): + def _get_line_qty(self, cr, uid, line, context=None): if (line.order_id.invoice_quantity=='order'): if line.product_uos: return line.product_uos_qty or 0.0 return line.product_uom_qty - def _get_line_uom(self, cr, uid, line): + def _get_line_uom(self, cr, uid, line, context=None): if (line.order_id.invoice_quantity=='order'): if line.product_uos: return line.product_uos.id @@ -769,8 +769,8 @@ class sale_order_line(osv.osv): 'property_account_income_categ', 'product.category', context=context) account_id = prop and prop.id or False - uosqty = self._get_line_qty(cr, uid, line) - uos_id = self._get_line_uom(cr, uid, line) + uosqty = self._get_line_qty(cr, uid, line, context=context) + uos_id = self._get_line_uom(cr, uid, line, context=context) pu = 0.0 if uosqty: pu = round(line.price_unit * line.product_uom_qty / uosqty, diff --git a/addons/sale_stock/sale_stock.py b/addons/sale_stock/sale_stock.py index 806efea48ff..a48b766f3bb 100644 --- a/addons/sale_stock/sale_stock.py +++ b/addons/sale_stock/sale_stock.py @@ -519,20 +519,20 @@ class sale_order_line(osv.osv): 'product_packaging': False, } - def _get_line_qty(self, cr, uid, line): + def _get_line_qty(self, cr, uid, line, context=None): if line.procurement_id and not (line.order_id.invoice_quantity=='order'): return self.pool.get('procurement.order').quantity_get(cr, uid, line.procurement_id.id, context=context) else: - return super(sale_order_line, self)._get_line_qty(cr, uid, line) + return super(sale_order_line, self)._get_line_qty(cr, uid, line, context=context) - def _get_line_uom(self, cr, uid, line): + def _get_line_uom(self, cr, uid, line, context=None): if line.procurement_id and not (line.order_id.invoice_quantity=='order'): return self.pool.get('procurement.order').uom_get(cr, uid, line.procurement_id.id, context=context) else: - return super(sale_order_line, self)._get_line_uom(cr, uid, line) + return super(sale_order_line, self)._get_line_uom(cr, uid, line, context=context) def button_cancel(self, cr, uid, ids, context=None): res = super(sale_order_line, self).button_cancel(cr, uid, ids, context=context)