Skip to content

Commit

Permalink
Corrected the property of the force invoiced field when both sale_for…
Browse files Browse the repository at this point in the history
…ce_invoiced and sale_order_invoice_amount are installed
  • Loading branch information
Wvven committed Feb 7, 2025
1 parent 28332aa commit 419c4b6
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
1 change: 1 addition & 0 deletions sale_force_invoice_amount/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
13 changes: 13 additions & 0 deletions sale_force_invoice_amount/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "Sale Force Invoiced Amount",
"summary": "When the Force Invoiced is checked, the invoiced amount is updated.",
"version": "16.0.1.0.0",
"author": "Innovyou, Odoo Community Association (OCA)",
"category": "sale",
"license": "AGPL-3",
"website": "https://github.com/OCA/sale-workflow",
"depends": ["sale_force_invoiced", "sale_order_invoice_amount"],
"data": [
],
"installable": True,
}
1 change: 1 addition & 0 deletions sale_force_invoice_amount/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import sale_order
18 changes: 18 additions & 0 deletions sale_force_invoice_amount/models/sale_order.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from odoo import api, fields, models
from odoo.tools.misc import formatLang


class SaleOrder(models.Model):
_inherit = "sale.order"

@api.depends("force_invoiced")
def _compute_invoice_status(self):
res = super()._compute_invoice_amount()

if (self.force_invoiced):
self.invoiced_amount = self.uninvoiced_amount
self.uninvoiced_amount = 0.0

return res


0 comments on commit 419c4b6

Please sign in to comment.