diff --git a/account_financial_report_partner_name_history/README.rst b/account_financial_report_partner_name_history/README.rst new file mode 100644 index 000000000000..9f6523fb1a63 --- /dev/null +++ b/account_financial_report_partner_name_history/README.rst @@ -0,0 +1,72 @@ +=================================================== +Account Financial Reports with partner name history +=================================================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:fc18725a9a560c74c2fcbfc8f732e4b29c3c3bdc5e8eb9733f40f686178a6f72 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--financial--reporting-lightgray.png?logo=github + :target: https://github.com/OCA/account-financial-reporting/tree/16.0/account_financial_report_partner_name_history + :alt: OCA/account-financial-reporting +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/account-financial-reporting-16-0/account-financial-reporting-16-0-account_financial_report_partner_name_history + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/account-financial-reporting&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Show name of partners at the date of the invoice in General ledger +report. + +**Table of contents** + +.. contents:: + :local: + +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 to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Aion Tech + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/account-financial-reporting `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_financial_report_partner_name_history/__init__.py b/account_financial_report_partner_name_history/__init__.py new file mode 100644 index 000000000000..026c61c6c8aa --- /dev/null +++ b/account_financial_report_partner_name_history/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import reports diff --git a/account_financial_report_partner_name_history/__manifest__.py b/account_financial_report_partner_name_history/__manifest__.py new file mode 100644 index 000000000000..c8f94d108e80 --- /dev/null +++ b/account_financial_report_partner_name_history/__manifest__.py @@ -0,0 +1,15 @@ +# Copyright 2024 Simone Rubino - Aion Tech +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + "name": "Account Financial Reports with partner name history", + "version": "16.0.1.0.0", + "license": "AGPL-3", + "category": "Reporting", + "summary": "OCA Financial Reports with partner name history", + "author": "Aion Tech, Odoo Community Association (OCA)", + "website": "https://github.com/OCA/account-financial-reporting", + "depends": [ + "account_financial_report", + "account_move_partner_name_history", + ], +} diff --git a/account_financial_report_partner_name_history/readme/DESCRIPTION.md b/account_financial_report_partner_name_history/readme/DESCRIPTION.md new file mode 100644 index 000000000000..179b92758be1 --- /dev/null +++ b/account_financial_report_partner_name_history/readme/DESCRIPTION.md @@ -0,0 +1 @@ +Show name of partners at the date of the invoice in General ledger report. diff --git a/account_financial_report_partner_name_history/reports/__init__.py b/account_financial_report_partner_name_history/reports/__init__.py new file mode 100644 index 000000000000..762d09a4dcc7 --- /dev/null +++ b/account_financial_report_partner_name_history/reports/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import general_ledger diff --git a/account_financial_report_partner_name_history/reports/general_ledger.py b/account_financial_report_partner_name_history/reports/general_ledger.py new file mode 100644 index 000000000000..92dcd69f8a54 --- /dev/null +++ b/account_financial_report_partner_name_history/reports/general_ledger.py @@ -0,0 +1,30 @@ +# Copyright 2024 Simone Rubino - Aion Tech +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import api, models + + +class GeneralLedgerReport(models.AbstractModel): + _inherit = "report.account_financial_report.general_ledger" + + def _get_report_values(self, docids, data): + return super( + GeneralLedgerReport, + self.with_context( + use_partner_name_history=True, + ), + )._get_report_values(docids, data) + + @api.model + def _get_move_line_data(self, move_line): + move_line_data = super()._get_move_line_data(move_line) + # `partner_name` comes from the `display_name` used by `search_read`, + # it is rightfully not affected by history name + # because it is a stored field: + # a value stored in database should not depend on + # context or user that is seeing it. + # That is why it has to be overwritten + # with the move line's partner `name`. + move_line = self.env["account.move.line"].browse(move_line_data["id"]) + move_line_data["partner_name"] = move_line.partner_id.name + return move_line_data diff --git a/account_financial_report_partner_name_history/static/description/index.html b/account_financial_report_partner_name_history/static/description/index.html new file mode 100644 index 000000000000..85244ab20cdc --- /dev/null +++ b/account_financial_report_partner_name_history/static/description/index.html @@ -0,0 +1,415 @@ + + + + + + +Account Financial Reports with partner name history + + + +
+

Account Financial Reports with partner name history

+ + +

Beta License: AGPL-3 OCA/account-financial-reporting Translate me on Weblate Try me on Runboat

+

Show name of partners at the date of the invoice in General ledger +report.

+

Table of contents

+ +
+

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 to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Aion Tech
  • +
+
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/account-financial-reporting project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/setup/account_financial_report_partner_name_history/odoo/addons/account_financial_report_partner_name_history b/setup/account_financial_report_partner_name_history/odoo/addons/account_financial_report_partner_name_history new file mode 120000 index 000000000000..ede78478d5ec --- /dev/null +++ b/setup/account_financial_report_partner_name_history/odoo/addons/account_financial_report_partner_name_history @@ -0,0 +1 @@ +../../../../account_financial_report_partner_name_history \ No newline at end of file diff --git a/setup/account_financial_report_partner_name_history/setup.py b/setup/account_financial_report_partner_name_history/setup.py new file mode 100644 index 000000000000..28c57bb64031 --- /dev/null +++ b/setup/account_financial_report_partner_name_history/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)