diff --git a/accounting_update/__init__.py b/accounting_update/__init__.py new file mode 100644 index 00000000000..0650744f6bc --- /dev/null +++ b/accounting_update/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/accounting_update/__manifest__.py b/accounting_update/__manifest__.py new file mode 100644 index 00000000000..7263f18288c --- /dev/null +++ b/accounting_update/__manifest__.py @@ -0,0 +1,9 @@ +{ + "name": "Account Update", + "author": "Shrey Patel", + "depends": ["l10n_in_edi"], + "license": "LGPL-3", + "data": [ + "views/accounting_move_views.xml", + ], +} diff --git a/accounting_update/models/__init__.py b/accounting_update/models/__init__.py new file mode 100644 index 00000000000..0d5ab6a2fc6 --- /dev/null +++ b/accounting_update/models/__init__.py @@ -0,0 +1,2 @@ +from . import account_move +from . import account_move_line diff --git a/accounting_update/models/account_move.py b/accounting_update/models/account_move.py new file mode 100644 index 00000000000..1d2a5b7c240 --- /dev/null +++ b/accounting_update/models/account_move.py @@ -0,0 +1,13 @@ +from odoo import models + + +class AccountMove(models.Model): + _inherit = "account.move" + + def _get_l10n_in_edi_line_details(self, index, line, line_tax_details): + line_details = super()._get_l10n_in_edi_line_details( + index, line, line_tax_details + ) + if line.is_zero_qty: + line_details["Qty"] = 0.0 + return line_details diff --git a/accounting_update/models/account_move_line.py b/accounting_update/models/account_move_line.py new file mode 100644 index 00000000000..391b265311b --- /dev/null +++ b/accounting_update/models/account_move_line.py @@ -0,0 +1,7 @@ +from odoo import models, fields + + +class AccountMoveLine(models.Model): + _inherit = "account.move.line" + + is_zero_qty = fields.Boolean() diff --git a/accounting_update/views/accounting_move_views.xml b/accounting_update/views/accounting_move_views.xml new file mode 100644 index 00000000000..5c23ad22551 --- /dev/null +++ b/accounting_update/views/accounting_move_views.xml @@ -0,0 +1,15 @@ + + + account.move.form.inherit.accounting_update + account.move + + + + + + + + + + +