From dd9cc6237ba04a30aa89ba7bf41801b2a8da63b4 Mon Sep 17 00:00:00 2001 From: eLBati Date: Thu, 22 Feb 2024 16:07:25 +0100 Subject: [PATCH] ADD l10n_it_withholding_tax_payment_order: Integrazione Ritenute d'acconto e Ordini di pagamento --- .../__init__.py | 1 + .../__manifest__.py | 21 +++++++++++++++++++ .../models/__init__.py | 1 + .../models/account_move_line.py | 11 ++++++++++ .../readme/CONTRIBUTORS.md | 1 + .../readme/DESCRIPTION.md | 2 ++ .../l10n_it_withholding_tax_payment_order | 1 + .../setup.py | 6 ++++++ 8 files changed, 44 insertions(+) create mode 100644 l10n_it_withholding_tax_payment_order/__init__.py create mode 100644 l10n_it_withholding_tax_payment_order/__manifest__.py create mode 100644 l10n_it_withholding_tax_payment_order/models/__init__.py create mode 100644 l10n_it_withholding_tax_payment_order/models/account_move_line.py create mode 100644 l10n_it_withholding_tax_payment_order/readme/CONTRIBUTORS.md create mode 100644 l10n_it_withholding_tax_payment_order/readme/DESCRIPTION.md create mode 120000 setup/l10n_it_withholding_tax_payment_order/odoo/addons/l10n_it_withholding_tax_payment_order create mode 100644 setup/l10n_it_withholding_tax_payment_order/setup.py diff --git a/l10n_it_withholding_tax_payment_order/__init__.py b/l10n_it_withholding_tax_payment_order/__init__.py new file mode 100644 index 000000000000..0650744f6bc6 --- /dev/null +++ b/l10n_it_withholding_tax_payment_order/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/l10n_it_withholding_tax_payment_order/__manifest__.py b/l10n_it_withholding_tax_payment_order/__manifest__.py new file mode 100644 index 000000000000..f32df9d1a0d6 --- /dev/null +++ b/l10n_it_withholding_tax_payment_order/__manifest__.py @@ -0,0 +1,21 @@ +# Copyright 2024 Lorenzo Battistini +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + "name": "ITA - Ritenute d'acconto - Ordini di pagamento", + "summary": "Integrazione Ritenute d'acconto e Ordini di pagamento", + "version": "16.0.1.0.0", + "development_status": "Beta", + "category": "Hidden", + "website": "https://github.com/OCA/l10n-italy", + "author": "Innovyou, Odoo Community Association (OCA)", + "maintainers": ["eLBati"], + "license": "AGPL-3", + "application": False, + "installable": True, + "auto_install": True, + "depends": [ + "l10n_it_withholding_tax", + "account_payment_order", + ], + "data": [], +} diff --git a/l10n_it_withholding_tax_payment_order/models/__init__.py b/l10n_it_withholding_tax_payment_order/models/__init__.py new file mode 100644 index 000000000000..8795b3bea648 --- /dev/null +++ b/l10n_it_withholding_tax_payment_order/models/__init__.py @@ -0,0 +1 @@ +from . import account_move_line diff --git a/l10n_it_withholding_tax_payment_order/models/account_move_line.py b/l10n_it_withholding_tax_payment_order/models/account_move_line.py new file mode 100644 index 000000000000..83d35a9dfb51 --- /dev/null +++ b/l10n_it_withholding_tax_payment_order/models/account_move_line.py @@ -0,0 +1,11 @@ +from odoo import models + + +class MoveLine(models.Model): + _inherit = "account.move.line" + + def _prepare_payment_line_vals(self, payment_order): + vals = super()._prepare_payment_line_vals(payment_order) + if self.withholding_tax_amount: + vals["amount_currency"] -= self.withholding_tax_amount + return vals diff --git a/l10n_it_withholding_tax_payment_order/readme/CONTRIBUTORS.md b/l10n_it_withholding_tax_payment_order/readme/CONTRIBUTORS.md new file mode 100644 index 000000000000..aec38611cf30 --- /dev/null +++ b/l10n_it_withholding_tax_payment_order/readme/CONTRIBUTORS.md @@ -0,0 +1 @@ +- Lorenzo Battistini https://www.innovyou.co/ diff --git a/l10n_it_withholding_tax_payment_order/readme/DESCRIPTION.md b/l10n_it_withholding_tax_payment_order/readme/DESCRIPTION.md new file mode 100644 index 000000000000..82f4ca0bd733 --- /dev/null +++ b/l10n_it_withholding_tax_payment_order/readme/DESCRIPTION.md @@ -0,0 +1,2 @@ +Make `l10n_it_withholding_tax` and `account_payment_order` work together, setting the +correct amount (Net To Pay) in payment order lines. diff --git a/setup/l10n_it_withholding_tax_payment_order/odoo/addons/l10n_it_withholding_tax_payment_order b/setup/l10n_it_withholding_tax_payment_order/odoo/addons/l10n_it_withholding_tax_payment_order new file mode 120000 index 000000000000..bc4ee06abb8f --- /dev/null +++ b/setup/l10n_it_withholding_tax_payment_order/odoo/addons/l10n_it_withholding_tax_payment_order @@ -0,0 +1 @@ +../../../../l10n_it_withholding_tax_payment_order \ No newline at end of file diff --git a/setup/l10n_it_withholding_tax_payment_order/setup.py b/setup/l10n_it_withholding_tax_payment_order/setup.py new file mode 100644 index 000000000000..28c57bb64031 --- /dev/null +++ b/setup/l10n_it_withholding_tax_payment_order/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)