From e3224df8c047e17e90ea6c09bfdd07936439885d Mon Sep 17 00:00:00 2001 From: patsh-odoo Date: Tue, 2 Jun 2026 10:20:49 +0530 Subject: [PATCH] [ADD] accounting_update: allow zero quantity on invoice lines for tax reporting Added a checkbox called 'Is Zero Quantity' on the invoice line items. When a user checks this box, the official Indian E-invoicing (l10n_in_edi) system will force the item's quantity to be sent as zero to the government portal, while keeping the monetary value intact. This is needed for commercial edge cases like customer rejections. For example, if a customer rejects a delivery of low-quality coal, the company issues a Credit Note. Because the rejected scrap coal is left with the customer and not returned to inventory, the net physical quantity transferred is zero, but the financial adjustment must still be reported to the government. project - [PSIM] INTERNSHIP ONBOARDING task - [accounting/l10n_in] Add zero quantity on move line --- accounting_update/__init__.py | 1 + accounting_update/__manifest__.py | 9 +++++++++ accounting_update/models/__init__.py | 2 ++ accounting_update/models/account_move.py | 13 +++++++++++++ accounting_update/models/account_move_line.py | 7 +++++++ accounting_update/views/accounting_move_views.xml | 15 +++++++++++++++ 6 files changed, 47 insertions(+) create mode 100644 accounting_update/__init__.py create mode 100644 accounting_update/__manifest__.py create mode 100644 accounting_update/models/__init__.py create mode 100644 accounting_update/models/account_move.py create mode 100644 accounting_update/models/account_move_line.py create mode 100644 accounting_update/views/accounting_move_views.xml 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 + + + + + + + + + + +