Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][IMP] sale_force_invoiced: update untaxed_amount_to_invoice #3101

Merged
merged 1 commit into from
May 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions sale_force_invoiced/models/sale_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,14 @@ def _compute_invoice_status(self):
lambda so: so.force_invoiced and so.state in ("sale", "done")
).update({"invoice_status": "invoiced"})
return res


class SaleOrderLine(models.Model):
pedrobaeza marked this conversation as resolved.
Show resolved Hide resolved
_inherit = "sale.order.line"

@api.depends("order_id.force_invoiced")
alessandro-fiorino marked this conversation as resolved.
Show resolved Hide resolved
def _compute_untaxed_amount_to_invoice(self):
force_invoiced = self.filtered(lambda x: x.order_id.force_invoiced)
force_invoiced.update({"untaxed_amount_to_invoice": 0.0})
not_forced = self - force_invoiced
return super(SaleOrderLine, not_forced)._compute_untaxed_amount_to_invoice()
Loading