Skip to content

Commit

Permalink
[FIX] More changes, actually undoing one change, after review.
Browse files Browse the repository at this point in the history
  • Loading branch information
NL66278 committed May 4, 2017
1 parent e18b6e1 commit b5fb0a5
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions account_invoice_pricelist/model/account_invoice_line.py
Expand Up @@ -10,22 +10,17 @@ class AccountInvoiceLine(models.Model):

@api.multi
def product_id_change(
self, product_id, uom_id, qty=0, name='', type='out_invoice',
self, product, uom_id, qty=0, name='', type='out_invoice',
partner_id=False, fposition_id=False, price_unit=False,
currency_id=False, company_id=None):
"""Make sure pricelist is used on product.
NB: On original method argument product_id is confusingly called
product, although it is an id, not an object, even though the field
in account.invoice.line and on the view is properly called product_id.
"""
"""Make sure pricelist is used on product."""
res = super(AccountInvoiceLine, self).product_id_change(
product_id, uom_id, qty=qty, name=name, type=type,
product, uom_id, qty=qty, name=name, type=type,
partner_id=partner_id, fposition_id=fposition_id,
price_unit=price_unit, currency_id=currency_id,
company_id=company_id
)
if not product_id:
if not product:
return res
context = self._context
partner = self.env['res.partner'].browse(partner_id)
Expand All @@ -39,7 +34,7 @@ def product_id_change(
)
pricelist_model = self.env['product.pricelist']
product_model = self.env['product.product']
product = product_model.browse(product_id)
product = product_model.browse(product)
pricelist = pricelist_model.browse(pricelist_id)
values = res['value']
if ('uos_id' in values and values['uos_id'] and
Expand Down

0 comments on commit b5fb0a5

Please sign in to comment.