[FIX] stock_account: compute price if no product
- Activate anglo-saxon accounting - Create an invoice with a line without product but a UOM - Validate A traceback arises since `_compute_price` is called on an empty recorset. opw-1830042
This commit is contained in:
committed by
Nicolas Martinelli
parent
9aa1b7ba12
commit
048539732d
@@ -201,8 +201,8 @@ class ProductProduct(models.Model):
|
||||
@api.model
|
||||
def _get_anglo_saxon_price_unit(self, uom=False):
|
||||
price = self.standard_price
|
||||
if not uom or self.uom_id.id == uom.id:
|
||||
return price
|
||||
if not self or not uom or self.uom_id.id == uom.id:
|
||||
return price or 0.0
|
||||
return self.uom_id._compute_price(price, uom)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user