You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error when editing or adding new line in sale order if invoices are generated from invoice plan.
To Reproduce
Affected versions: 15.0, and not sure if other versions have same issue.
Steps to reproduce the behavior:
Create a sale order with 1 line item.
Create invoice plan.
Confirm sale order.
Generate all invoices using button "Create invoice by Plan" and create all invoices.
Edit the description of sale order line, or add new line in sale order.
Expected behavior
Edit should of description of line of sale order should be possible.
Adding new line to sale order should be possible.
Error message
File "/sale_invoice_plan/models/sale_invoice_plan.py", line 100, in _compute_amount
rec.percent = rec.amount / rec.sale_id.amount_untaxed * 100
....
ZeroDivisionError: float division by zero
Potential solution
in _compute_amount here, code could be:
@api.depends("percent")def_compute_amount(self):
forrecinself:
# With invoice already created, no recomputeifrec.invoiced:
#rec.amount = rec.amount_invoiced#rec.percent = rec.amount / rec.sale_id.amount_untaxed * 100continue
based on my understanding, if the invoice is created for this invoice plan line, then no need to recompute. So, why assigning any value, it should be continue without any assignments.
If this is correct, I'll create a PR.
The text was updated successfully, but these errors were encountered:
Module
sale_invoice_plan
Describe the bug
Error when editing or adding new line in sale order if invoices are generated from invoice plan.
To Reproduce
Affected versions: 15.0, and not sure if other versions have same issue.
Steps to reproduce the behavior:
Expected behavior
Edit should of description of line of sale order should be possible.
Adding new line to sale order should be possible.
Error message
Potential solution
in
_compute_amount
here, code could be:based on my understanding, if the invoice is created for this invoice plan line, then no need to recompute. So, why assigning any value, it should be
continue
without any assignments.If this is correct, I'll create a PR.
The text was updated successfully, but these errors were encountered: