-
-
Notifications
You must be signed in to change notification settings - Fork 619
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ADD] account_financial_report_partner_name_history
- Loading branch information
1 parent
9f3c12b
commit 5be2d70
Showing
13 changed files
with
659 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
=================================================== | ||
Account Financial Reports with partner name history | ||
=================================================== | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:20a5677f41831297fb88dd7b6c9d061f5c6f747d015c8a8eb064c0ab0ae807eb | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
.. |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 <https://github.com/OCA/account-financial-reporting/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 <https://github.com/OCA/account-financial-reporting/issues/new?body=module:%20account_financial_report_partner_name_history%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
||
Do not contact contributors directly about support or help with technical issues. | ||
|
||
Credits | ||
======= | ||
|
||
Authors | ||
------- | ||
|
||
* Aion Tech | ||
|
||
Contributors | ||
------------ | ||
|
||
- `Aion Tech <https://aiontech.company/>`__: | ||
|
||
- Simone Rubino \\<[email protected]\\> | ||
|
||
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 <https://github.com/OCA/account-financial-reporting/tree/16.0/account_financial_report_partner_name_history>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from . import reports |
15 changes: 15 additions & 0 deletions
15
account_financial_report_partner_name_history/__manifest__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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", | ||
], | ||
} |
2 changes: 2 additions & 0 deletions
2
account_financial_report_partner_name_history/readme/CONTRIBUTORS.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- [Aion Tech](https://aiontech.company/): | ||
- Simone Rubino \\<<[email protected]>\\> |
1 change: 1 addition & 0 deletions
1
account_financial_report_partner_name_history/readme/DESCRIPTION.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Show name of partners at the date of the invoice in General ledger report. |
3 changes: 3 additions & 0 deletions
3
account_financial_report_partner_name_history/reports/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from . import general_ledger |
30 changes: 30 additions & 0 deletions
30
account_financial_report_partner_name_history/reports/general_ledger.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Oops, something went wrong.