-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TA#70529 [14.0][ADD] aged_payables_receivables_foreign_currency
- Loading branch information
1 parent
38c1b30
commit 8e5a028
Showing
13 changed files
with
647 additions
and
1 deletion.
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
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
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,14 @@ | ||
========================================== | ||
AGED PAYABLES RECEIVABLES FOREIGN CURRENCY | ||
========================================== | ||
This module helps to : | ||
- View and print the aged balance of third parties with the amounts | ||
in foreign currency (according to the currency of the receivable and payable account configured on the partner) | ||
and in the functional currency of the company. | ||
- View partners in alphabetical order | ||
|
||
Available in html, pdf and xlsx format. | ||
|
||
Contributors | ||
------------ | ||
* Numigi (tm) and all its contributors (https://bit.ly/numigiens) |
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,4 @@ | ||
# Copyright 2024 Numigi (tm) and all its contributors (https://bit.ly/numigiens) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import report | ||
18 changes: 18 additions & 0 deletions
18
aged_payables_receivables_foreign_currency/__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,18 @@ | ||
# Copyright 2024 Numigi (tm) and all its contributors (https://bit.ly/numigiens) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
{ | ||
"name": "Aged Payables and Receivables in Foreign Currency", | ||
"version": "1.0.0", | ||
"author": "Numigi", | ||
"maintainer": "Numigi", | ||
"website": "https://bit.ly/numigi-com", | ||
"license": "AGPL-3", | ||
"category": "project", | ||
"depends": ["account_financial_report"], | ||
"summary": "Shows the original currency on receivable/payable account.", | ||
"data": [ | ||
"report/templates/aged_partner_balance.xml", | ||
], | ||
"installable": True, | ||
} |
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,85 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * aged_payables_receivables_foreign_currency | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 14.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"POT-Creation-Date: 2024-11-21 03:09+0000\n" | ||
"PO-Revision-Date: 2024-11-21 03:09+0000\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: aged_payables_receivables_foreign_currency | ||
#: model:ir.model,name:aged_payables_receivables_foreign_currency.model_report_account_financial_report_aged_partner_balance | ||
msgid "Aged Partner Balance Report" | ||
msgstr "Balance âgée des tiers" | ||
|
||
#. module: aged_payables_receivables_foreign_currency | ||
#: model:ir.model,name:aged_payables_receivables_foreign_currency.model_report_a_f_r_report_aged_partner_balance_xlsx | ||
msgid "Aged Partner Balance XLSL Report" | ||
msgstr "Balance âgée des tiers XLSX" | ||
|
||
#. module: aged_payables_receivables_foreign_currency | ||
#: code:addons/aged_payables_receivables_foreign_currency/report/aged_partner_balance_xlsx.py:0 | ||
#: code:addons/aged_payables_receivables_foreign_currency/report/aged_partner_balance_xlsx.py:0 | ||
#: model_terms:ir.ui.view,arch_db:aged_payables_receivables_foreign_currency.report_aged_partner_balance_lines_header | ||
#: model_terms:ir.ui.view,arch_db:aged_payables_receivables_foreign_currency.report_aged_partner_balance_move_lines | ||
#, python-format | ||
msgid "Amount Currency" | ||
msgstr "Montant en devise" | ||
|
||
#. module: aged_payables_receivables_foreign_currency | ||
#: code:addons/aged_payables_receivables_foreign_currency/report/aged_partner_balance_xlsx.py:0 | ||
#: code:addons/aged_payables_receivables_foreign_currency/report/aged_partner_balance_xlsx.py:0 | ||
#: model_terms:ir.ui.view,arch_db:aged_payables_receivables_foreign_currency.report_aged_partner_balance_lines_header | ||
#: model_terms:ir.ui.view,arch_db:aged_payables_receivables_foreign_currency.report_aged_partner_balance_move_lines | ||
#, python-format | ||
msgid "Currency" | ||
msgstr "Devise" | ||
|
||
#. module: aged_payables_receivables_foreign_currency | ||
#: model:ir.model.fields,field_description:aged_payables_receivables_foreign_currency.field_report_a_f_r_report_aged_partner_balance_xlsx__display_name | ||
#: model:ir.model.fields,field_description:aged_payables_receivables_foreign_currency.field_report_account_financial_report_aged_partner_balance__display_name | ||
msgid "Display Name" | ||
msgstr "Nom affiché" | ||
|
||
#. module: aged_payables_receivables_foreign_currency | ||
#: model_terms:ir.ui.view,arch_db:aged_payables_receivables_foreign_currency.report_aged_partner_balance_move_lines | ||
msgid "" | ||
"Due\n" | ||
" date" | ||
msgstr "" | ||
"Échéance\n" | ||
" date" | ||
|
||
#. module: aged_payables_receivables_foreign_currency | ||
#: model:ir.model.fields,field_description:aged_payables_receivables_foreign_currency.field_report_a_f_r_report_aged_partner_balance_xlsx__id | ||
#: model:ir.model.fields,field_description:aged_payables_receivables_foreign_currency.field_report_account_financial_report_aged_partner_balance__id | ||
msgid "ID" | ||
msgstr "" | ||
|
||
#. module: aged_payables_receivables_foreign_currency | ||
#: model:ir.model.fields,field_description:aged_payables_receivables_foreign_currency.field_report_a_f_r_report_aged_partner_balance_xlsx____last_update | ||
#: model:ir.model.fields,field_description:aged_payables_receivables_foreign_currency.field_report_account_financial_report_aged_partner_balance____last_update | ||
msgid "Last Modified on" | ||
msgstr "Dernière modification le" | ||
|
||
#. module: aged_payables_receivables_foreign_currency | ||
#: model_terms:ir.ui.view,arch_db:aged_payables_receivables_foreign_currency.report_aged_partner_balance_lines_header | ||
msgid "Partner" | ||
msgstr "Partenaire" | ||
|
||
#. module: aged_payables_receivables_foreign_currency | ||
#: model_terms:ir.ui.view,arch_db:aged_payables_receivables_foreign_currency.report_aged_partner_balance_move_lines | ||
msgid "" | ||
"Ref -\n" | ||
" Label" | ||
msgstr "" | ||
"Ref -\n" | ||
" Libellé" |
6 changes: 6 additions & 0 deletions
6
aged_payables_receivables_foreign_currency/report/__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,6 @@ | ||
# Copyright 2024 Numigi (tm) and all its contributors (https://bit.ly/numigiens) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import abstract_report_xlsx | ||
from . import aged_partner_balance | ||
from . import aged_partner_balance_xlsx | ||
71 changes: 71 additions & 0 deletions
71
aged_payables_receivables_foreign_currency/report/abstract_report_xlsx.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,71 @@ | ||
# Copyright 2024 Numigi (tm) and all its contributors (https://bit.ly/numigiens) | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo.addons.account_financial_report.report.abstract_report_xlsx import ( | ||
AbstractReportXslx as AbstractReportXslxOriginal, | ||
) | ||
|
||
|
||
class AbstractReportXslx(AbstractReportXslxOriginal): | ||
def write_line_from_dict(self, line_dict, report_data): | ||
"""Write a line on current line""" | ||
for col_pos, column in report_data["columns"].items(): | ||
value = line_dict.get(column["field"], False) | ||
cell_type = column.get("type", "string") | ||
|
||
# If the column is a currency column, we need to get the currency name | ||
if column["field"] == "currency_id": | ||
if isinstance(value, tuple): | ||
value = value[0] | ||
currency = self.env["res.currency"].browse(value).name | ||
line_dict["currency_id"] = value = currency | ||
|
||
if cell_type == "string": | ||
if line_dict.get("type", "") == "group_type": | ||
report_data["sheet"].write_string( | ||
report_data["row_pos"], | ||
col_pos, | ||
value or "", | ||
report_data["formats"]["format_bold"], | ||
) | ||
else: | ||
if ( | ||
not isinstance(value, str) | ||
and not isinstance(value, bool) | ||
and not isinstance(value, int) | ||
): | ||
value = value and value.strftime("%d/%m/%Y") | ||
report_data["sheet"].write_string( | ||
report_data["row_pos"], col_pos, value or "" | ||
) | ||
elif cell_type == "amount": | ||
if ( | ||
line_dict.get("account_group_id", False) | ||
and line_dict["account_group_id"] | ||
): | ||
cell_format = report_data["formats"]["format_amount_bold"] | ||
else: | ||
cell_format = report_data["formats"]["format_amount"] | ||
report_data["sheet"].write_number( | ||
report_data["row_pos"], col_pos, float(value), cell_format | ||
) | ||
elif cell_type == "amount_currency": | ||
if line_dict.get("currency_name", False): | ||
format_amt = self._get_currency_amt_format_dict( | ||
line_dict, report_data | ||
) | ||
report_data["sheet"].write_number( | ||
report_data["row_pos"], col_pos, float(value), format_amt | ||
) | ||
elif cell_type == "currency_name": | ||
report_data["sheet"].write_string( | ||
report_data["row_pos"], | ||
col_pos, | ||
value or "", | ||
report_data["formats"]["format_right"], | ||
) | ||
else: | ||
self.write_non_standard_column(cell_type, col_pos, value) | ||
report_data["row_pos"] += 1 | ||
|
||
AbstractReportXslxOriginal.write_line_from_dict = write_line_from_dict |
Oops, something went wrong.