[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
This commit is contained in:
Quentin (OpenERP) 2012-09-21 11:35:20 +02:00
parent eabcb8b14f
commit 69abb48428
2 changed files with 8 additions and 8 deletions

View File

@ -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,

View File

@ -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)