Skip to content

Commit

Permalink
[ADD] account_financial_report_partner_name_history
Browse files Browse the repository at this point in the history
  • Loading branch information
SirAionTech committed Oct 7, 2024
1 parent c171203 commit fbc005e
Show file tree
Hide file tree
Showing 12 changed files with 658 additions and 0 deletions.
79 changes: 79 additions & 0 deletions account_financial_report_partner_name_history/README.rst
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.
3 changes: 3 additions & 0 deletions account_financial_report_partner_name_history/__init__.py
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 account_financial_report_partner_name_history/__manifest__.py
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",
],
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- [Aion Tech](https://aiontech.company/):
- Simone Rubino \\<<[email protected]>\\>
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.
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
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
Loading

0 comments on commit fbc005e

Please sign in to comment.