[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:
Andrea Grazioso (agr-odoo)
2023-10-17 03:27:53 +00:00
parent e0b739168d
commit ce8ffec2f9
@@ -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"))