Skip to content

Commit

Permalink
Add currency column to general_ledger excel export file
Browse files Browse the repository at this point in the history
  • Loading branch information
RaoufJabriCamptocamp committed Jan 22, 2024
1 parent 6687c0b commit 86cbf55
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
5 changes: 5 additions & 0 deletions account_financial_report/i18n/fr.po
Original file line number Diff line number Diff line change
Expand Up @@ -1467,6 +1467,11 @@ msgstr "Afficher le détail des écritures"
msgid "Show Partner Details"
msgstr "Afficher le détail du partenaire"

#. module: account_financial_report
#: model:ir.model.fields,field_description:account_financial_report.field_general_ledger_report_wizard__show_currency_name
msgid "Show currency name"
msgstr "Afficher le nom de la devise"

#. module: account_financial_report
#. odoo-python
#: code:addons/account_financial_report/report/general_ledger_xlsx.py:0
Expand Down
10 changes: 10 additions & 0 deletions account_financial_report/report/general_ledger_xlsx.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,16 @@ def _get_report_columns(self, report):
"width": 14,
},
]
if report.foreign_currency and report.show_cost_center:
res += [

Check warning on line 71 in account_financial_report/report/general_ledger_xlsx.py

View check run for this annotation

Codecov / codecov/patch

account_financial_report/report/general_ledger_xlsx.py#L71

Added line #L71 was not covered by tests
{
"header": _("Cur."),
"field": "currency_name",
"field_currency_balance": "currency_name",
"type": "currency_name",
"width": 7,
},
]
if report.foreign_currency:
res += [
{
Expand Down
4 changes: 4 additions & 0 deletions account_financial_report/wizard/general_ledger_wizard.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ class GeneralLedgerReportWizard(models.TransientModel):
"will display initial and final balance in that currency.",
default=lambda self: self._default_foreign_currency(),
)
show_currency_name = fields.Boolean(
string="Show currency name",
help="Display foreign currency name for move lines",
)
account_code_from = fields.Many2one(
comodel_name="account.account",
help="Starting account in a range",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@
<field name="centralize" />
<field name="hide_account_at_0" />
<field name="foreign_currency" />
<field
name="show_currency_name"
attrs="{'invisible': [('foreign_currency', '=', False)]}"
/>
<field name="show_cost_center" />
</group>
</group>
Expand Down

0 comments on commit 86cbf55

Please sign in to comment.