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)