[FIX] stock_account: Cannot validate some invoices

Steps to reproduce the bug:

- create an invoice
- add one line without product but with a uom
- validate it

Bug:

A traceback was raised because no product was set on the invoice line.

opw:1825464
This commit is contained in:
Goffin Simon
2018-03-21 14:19:09 +01:00
parent c17170b9c1
commit c2b3ad1899
@@ -44,6 +44,8 @@ class AccountInvoiceLine(models.Model):
def _get_anglo_saxon_price_unit(self):
self.ensure_one()
if not self.product_id:
return self.price_unit
return self.product_id._get_anglo_saxon_price_unit(uom=self.uom_id)
def _get_price(self, company_currency, price_unit):