[FIX] account_edi_ubl_cii: traceback on billed_qty 0
Try to Upload a Vendor Bill xml having an invoice line with billed_qty 0 Issue: Traceback caused by ZeroDivisionError opw-3497841 closes odoo/odoo#138843 X-original-commit: 0b3387390539e7379f1794c16f8ebf59fd4af9f8 Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com> Signed-off-by: Andrea Grazioso (agr) <agr@odoo.com>
This commit is contained in:
@@ -599,7 +599,7 @@ class AccountEdiCommon(models.AbstractModel):
|
||||
elif net_price_unit is not None:
|
||||
price_unit = (net_price_unit + rebate) / basis_qty
|
||||
elif price_subtotal is not None:
|
||||
price_unit = (price_subtotal + allow_charge_amount) / billed_qty
|
||||
price_unit = (price_subtotal + allow_charge_amount) / (billed_qty or 1)
|
||||
else:
|
||||
raise UserError(_("No gross price, net price nor line subtotal amount found for line in xml"))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user