diff --git a/account_compensate_advance_unlock_reconcile/README.rst b/account_compensate_advance_unlock_reconcile/README.rst new file mode 100644 index 0000000..4793f3b --- /dev/null +++ b/account_compensate_advance_unlock_reconcile/README.rst @@ -0,0 +1,81 @@ +======================================== +Account Compensate Advance Closed Period +======================================== +.. |badge1| image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +|badge1| + +This module extends the functionality of account_compensate_advance by allowing reconciliation in closed accounting periods + +**Table of contents** + +.. contents:: + :local: + +Configuration +============= + +To Configure... + +Usage +===== + +To usage... + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smash it by providing detailed and welcomed feedback. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Escodoo + +Contributors +~~~~~~~~~~~~ + +* Marcel Savegnago + +Other credits +~~~~~~~~~~~~~ + +The development of this module has been financially supported by: + +* Escodoo - `https://www.escodoo.com.br `_ + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the Escodoo. + +.. |maintainer-escodoo| image:: https://github.com/escodoo.png?size=80px + :target: https://github.com/Escodoo + :alt: escodoo + +|maintainer-escodoo| + +We at Escodoo are exclusively dedicated to deploying the Odoo Platform and are +focused on providing solutions that make our customers more competitive, lowering +costs, making technology more accessible and ensuring it is used strategically to +add even more value to the business. + +.. |maintainer-marcelsavegnago| image:: https://github.com/marcelsavegnago.png?size=40px + :target: https://github.com/marcelsavegnago + :alt: marcelsavegnago + +Current `maintainer `__: + +|maintainer-marcelsavegnago| + +To contribute to this module, please visit https://www.escodoo.com.br. diff --git a/account_compensate_advance_unlock_reconcile/__init__.py b/account_compensate_advance_unlock_reconcile/__init__.py new file mode 100644 index 0000000..9b42961 --- /dev/null +++ b/account_compensate_advance_unlock_reconcile/__init__.py @@ -0,0 +1,2 @@ +from . import models +from . import wizard diff --git a/account_compensate_advance_unlock_reconcile/__manifest__.py b/account_compensate_advance_unlock_reconcile/__manifest__.py new file mode 100644 index 0000000..fd05ccf --- /dev/null +++ b/account_compensate_advance_unlock_reconcile/__manifest__.py @@ -0,0 +1,16 @@ +# Copyright 2024 - TODAY, Escodoo +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +{ + "name": "Account Compensate Advance - Unlock Reconcile in compensate", + "summary": """ + This module allowing reconciliation in lock accounting periods""", + "version": "16.0.1.0.0", + "license": "AGPL-3", + "author": "Escodoo", + "website": "https://github.com/Escodoo/account-addons", + "depends": [ + "account_invoice_advance_compensation", + "account_lock_to_date", + ], +} diff --git a/account_compensate_advance_unlock_reconcile/i18n/account_compensate_advance_unlock_reconcile.pot b/account_compensate_advance_unlock_reconcile/i18n/account_compensate_advance_unlock_reconcile.pot new file mode 100644 index 0000000..e79d3ec --- /dev/null +++ b/account_compensate_advance_unlock_reconcile/i18n/account_compensate_advance_unlock_reconcile.pot @@ -0,0 +1,42 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_compensate_advance_unlock_reconcile +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: account_compensate_advance_unlock_reconcile +#: model:ir.model.fields,field_description:account_compensate_advance_unlock_reconcile.field_account_compensate_advance_journal__display_name +#: model:ir.model.fields,field_description:account_compensate_advance_unlock_reconcile.field_account_move__display_name +msgid "Display Name" +msgstr "" + +#. module: account_compensate_advance_unlock_reconcile +#: model:ir.model.fields,field_description:account_compensate_advance_unlock_reconcile.field_account_compensate_advance_journal__id +#: model:ir.model.fields,field_description:account_compensate_advance_unlock_reconcile.field_account_move__id +msgid "ID" +msgstr "" + +#. module: account_compensate_advance_unlock_reconcile +#: model:ir.model,name:account_compensate_advance_unlock_reconcile.model_account_move +msgid "Journal Entry" +msgstr "" + +#. module: account_compensate_advance_unlock_reconcile +#: model:ir.model.fields,field_description:account_compensate_advance_unlock_reconcile.field_account_compensate_advance_journal____last_update +#: model:ir.model.fields,field_description:account_compensate_advance_unlock_reconcile.field_account_move____last_update +msgid "Last Modified on" +msgstr "" + +#. module: account_compensate_advance_unlock_reconcile +#: model:ir.model,name:account_compensate_advance_unlock_reconcile.model_account_compensate_advance_journal +msgid "account.compensate.advance.journal" +msgstr "" diff --git a/account_compensate_advance_unlock_reconcile/models/__init__.py b/account_compensate_advance_unlock_reconcile/models/__init__.py new file mode 100644 index 0000000..9c0a421 --- /dev/null +++ b/account_compensate_advance_unlock_reconcile/models/__init__.py @@ -0,0 +1 @@ +from . import account_move diff --git a/account_compensate_advance_unlock_reconcile/models/account_move.py b/account_compensate_advance_unlock_reconcile/models/account_move.py new file mode 100644 index 0000000..1e96388 --- /dev/null +++ b/account_compensate_advance_unlock_reconcile/models/account_move.py @@ -0,0 +1,20 @@ +# Copyright 2024 - TODAY, Kaynnan Lemes +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import models + + +class AccountMove(models.Model): + _inherit = "account.move" + + def _check_lock_to_dates(self): + """ + Prevent moves that are on or after the lock to date, unless the context + allows bypass. + """ + # Check if the context allows bypassing the lock to date + if self.env.context.get("bypass_account_lock_to_date"): + return + + # Call the parent method to enforce lock checks if no bypass + return super()._check_lock_to_dates() diff --git a/account_compensate_advance_unlock_reconcile/readme/CONTRIBUTORS.rst b/account_compensate_advance_unlock_reconcile/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000..c7fe690 --- /dev/null +++ b/account_compensate_advance_unlock_reconcile/readme/CONTRIBUTORS.rst @@ -0,0 +1,4 @@ +* `Escodoo `_: + + * Marcel Savegnago + * Kaynnan Lemes diff --git a/account_compensate_advance_unlock_reconcile/static/description/icon.png b/account_compensate_advance_unlock_reconcile/static/description/icon.png new file mode 100644 index 0000000..12ab005 Binary files /dev/null and b/account_compensate_advance_unlock_reconcile/static/description/icon.png differ diff --git a/account_compensate_advance_unlock_reconcile/wizard/__init__.py b/account_compensate_advance_unlock_reconcile/wizard/__init__.py new file mode 100644 index 0000000..960cbaa --- /dev/null +++ b/account_compensate_advance_unlock_reconcile/wizard/__init__.py @@ -0,0 +1 @@ +from . import compensation_wizard diff --git a/account_compensate_advance_unlock_reconcile/wizard/compensation_wizard.py b/account_compensate_advance_unlock_reconcile/wizard/compensation_wizard.py new file mode 100644 index 0000000..f4b5d0b --- /dev/null +++ b/account_compensate_advance_unlock_reconcile/wizard/compensation_wizard.py @@ -0,0 +1,13 @@ +# Copyright 2024 - TODAY, Kaynnan Lemes +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + + +from odoo import models + + +class AccountInvoiceAdvanceCompensationWizard(models.TransientModel): + _inherit = "account.invoice.advance.compensation.wizard" + + def _create_compensation_move(self): + self = self.with_context(bypass_account_lock_to_date=True) + return super()._create_compensation_move() diff --git a/setup/account_compensate_advance_unlock_reconcile/odoo/addons/account_compensate_advance_unlock_reconcile b/setup/account_compensate_advance_unlock_reconcile/odoo/addons/account_compensate_advance_unlock_reconcile new file mode 120000 index 0000000..48ec8ba --- /dev/null +++ b/setup/account_compensate_advance_unlock_reconcile/odoo/addons/account_compensate_advance_unlock_reconcile @@ -0,0 +1 @@ +../../../../account_compensate_advance_unlock_reconcile \ No newline at end of file diff --git a/setup/account_compensate_advance_unlock_reconcile/setup.py b/setup/account_compensate_advance_unlock_reconcile/setup.py new file mode 100644 index 0000000..28c57bb --- /dev/null +++ b/setup/account_compensate_advance_unlock_reconcile/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +) diff --git a/test-requirements.txt b/test-requirements.txt new file mode 100644 index 0000000..58cb01a --- /dev/null +++ b/test-requirements.txt @@ -0,0 +1 @@ +odoo-addon-account_invoice_advance_compensation @ git+https://github.com/OCA/account-invoicing.git@refs/pull/1964/head#subdirectory=setup/account_invoice_advance_compensation