From 4bbeab107ace00aa3c5a7e93265851dcfc096104 Mon Sep 17 00:00:00 2001 From: Luc De Meyer Date: Mon, 16 Sep 2024 20:59:47 +0200 Subject: [PATCH] [MIG] account_move_line_report_xls: Migration to 16.0 --- account_move_line_report_xls/README.rst | 15 ++- account_move_line_report_xls/__manifest__.py | 2 +- .../models/account_move_line.py | 1 - .../readme/ROADMAP.rst | 1 + .../report/account_move_line_xlsx.py | 94 +++++++------------ .../static/description/index.html | 33 ++++--- 6 files changed, 64 insertions(+), 82 deletions(-) create mode 100644 account_move_line_report_xls/readme/ROADMAP.rst diff --git a/account_move_line_report_xls/README.rst b/account_move_line_report_xls/README.rst index ead57c11dce6..99d3fb552311 100644 --- a/account_move_line_report_xls/README.rst +++ b/account_move_line_report_xls/README.rst @@ -17,13 +17,13 @@ Account Move Line XLSX export :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/15.0/account_move_line_report_xls + :target: https://github.com/OCA/account-financial-reporting/tree/16.0/account_move_line_report_xls :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-15-0/account-financial-reporting-15-0-account_move_line_report_xls + :target: https://translation.odoo-community.org/projects/account-financial-reporting-16-0/account-financial-reporting-16-0-account_move_line_report_xls :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=15.0 + :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| @@ -67,13 +67,18 @@ of the 'account.move.line' object: Change/extend the Excel template. +Known issues / Roadmap +====================== + +* Add support for the analytic_distribution field + 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -103,6 +108,6 @@ 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. +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_move_line_report_xls/__manifest__.py b/account_move_line_report_xls/__manifest__.py index 2e0c865a99f6..25fb5e5e9781 100644 --- a/account_move_line_report_xls/__manifest__.py +++ b/account_move_line_report_xls/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Account Move Line XLSX export", - "version": "15.0.1.0.0", + "version": "16.0.1.0.0", "license": "AGPL-3", "author": "Noviat, Odoo Community Association (OCA)", "category": "Accounting & Finance", diff --git a/account_move_line_report_xls/models/account_move_line.py b/account_move_line_report_xls/models/account_move_line.py index 9f3ab2cfc395..6b009f3040ea 100644 --- a/account_move_line_report_xls/models/account_move_line.py +++ b/account_move_line_report_xls/models/account_move_line.py @@ -29,7 +29,6 @@ def _report_xlsx_fields(self): "balance", "full_reconcile", "reconcile_amount", - # 'analytic_account_name', 'analytic_account', # 'ref', 'partner_ref', # 'amount_residual', 'amount_currency', 'currency_name', # 'company_currency', 'amount_residual_currency', diff --git a/account_move_line_report_xls/readme/ROADMAP.rst b/account_move_line_report_xls/readme/ROADMAP.rst new file mode 100644 index 000000000000..9c5e9d7da0c1 --- /dev/null +++ b/account_move_line_report_xls/readme/ROADMAP.rst @@ -0,0 +1 @@ +* Add support for the analytic_distribution field diff --git a/account_move_line_report_xls/report/account_move_line_xlsx.py b/account_move_line_report_xls/report/account_move_line_xlsx.py index c0f11b0e4be5..f506f17a0344 100644 --- a/account_move_line_report_xls/report/account_move_line_xlsx.py +++ b/account_move_line_report_xls/report/account_move_line_xlsx.py @@ -1,52 +1,40 @@ # Copyright 2009-2020 Noviat # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -import logging - -from odoo import models -from odoo.tools.translate import translate +from odoo import _, models from odoo.addons.report_xlsx_helper.report.report_xlsx_format import ( FORMATS, XLS_HEADERS, ) -_logger = logging.getLogger(__name__) - -IR_TRANSLATION_NAME = "move.line.list.xls" - class AccountMoveLineXlsx(models.AbstractModel): _name = "report.account_move_line_report_xls.account_move_line_xlsx" _inherit = "report.report_xlsx.abstract" _description = "XLSX report for account move lines." - def _(self, src): - lang = self.env.context.get("lang", "en_US") - val = translate(self.env.cr, IR_TRANSLATION_NAME, "report", lang, src) or src - return val - def _get_ws_params(self, workbook, data, amls): # XLSX Template col_specs = { "move": { - "header": {"value": self._("Entry")}, + "header": {"value": _("Entry")}, "lines": {"value": self._render("line.move_id.name")}, "width": 20, }, "name": { - "header": {"value": self._("Name")}, + "header": {"value": _("Name")}, "lines": {"value": self._render("line.name")}, "width": 42, }, "ref": { - "header": {"value": self._("Reference")}, + "header": {"value": _("Reference")}, "lines": {"value": self._render("line.ref")}, "width": 42, }, "date": { - "header": {"value": self._("Effective Date")}, + "header": {"value": _("Effective Date")}, "lines": { "value": self._render("line.date"), "format": FORMATS["format_tcell_date_left"], @@ -54,26 +42,26 @@ def _get_ws_params(self, workbook, data, amls): "width": 13, }, "partner": { - "header": {"value": self._("Partner")}, + "header": {"value": _("Partner")}, "lines": { "value": self._render("line.partner_id and line.partner_id.name") }, "width": 36, }, "partner_ref": { - "header": {"value": self._("Partner Reference")}, + "header": {"value": _("Partner Reference")}, "lines": { "value": self._render("line.partner_id and line.partner_id.ref") }, "width": 36, }, "account": { - "header": {"value": self._("Account")}, + "header": {"value": _("Account")}, "lines": {"value": self._render("line.account_id.code")}, "width": 12, }, "date_maturity": { - "header": {"value": self._("Maturity Date")}, + "header": {"value": _("Maturity Date")}, "lines": { "value": self._render("line.date_maturity"), "format": FORMATS["format_tcell_date_left"], @@ -82,7 +70,7 @@ def _get_ws_params(self, workbook, data, amls): }, "debit": { "header": { - "value": self._("Debit"), + "value": _("Debit"), "format": FORMATS["format_theader_yellow_right"], }, "lines": { @@ -98,7 +86,7 @@ def _get_ws_params(self, workbook, data, amls): }, "credit": { "header": { - "value": self._("Credit"), + "value": _("Credit"), "format": FORMATS["format_theader_yellow_right"], }, "lines": { @@ -114,7 +102,7 @@ def _get_ws_params(self, workbook, data, amls): }, "balance": { "header": { - "value": self._("Balance"), + "value": _("Balance"), "format": FORMATS["format_theader_yellow_right"], }, "lines": { @@ -130,7 +118,7 @@ def _get_ws_params(self, workbook, data, amls): }, "full_reconcile": { "header": { - "value": self._("Rec."), + "value": _("Rec."), "format": FORMATS["format_theader_yellow_center"], }, "lines": { @@ -142,7 +130,7 @@ def _get_ws_params(self, workbook, data, amls): "width": 12, }, "reconcile_amount": { - "header": {"value": self._("Reconcile Amount")}, + "header": {"value": _("Reconcile Amount")}, "lines": { "value": self._render( "line.full_reconcile_id and line.balance or " @@ -154,7 +142,7 @@ def _get_ws_params(self, workbook, data, amls): "width": 12, }, "matched_debit_ids": { - "header": {"value": self._("Matched Debits")}, + "header": {"value": _("Matched Debits")}, "lines": { "value": self._render( "line.matched_debit_ids " @@ -165,7 +153,7 @@ def _get_ws_params(self, workbook, data, amls): "width": 20, }, "matched_credit_ids": { - "header": {"value": self._("Matched Credits")}, + "header": {"value": _("Matched Credits")}, "lines": { "value": self._render( "line.matched_credit_ids " @@ -177,7 +165,7 @@ def _get_ws_params(self, workbook, data, amls): }, "amount_currency": { "header": { - "value": self._("Am. Currency"), + "value": _("Am. Currency"), "format": FORMATS["format_theader_yellow_right"], }, "lines": { @@ -188,7 +176,7 @@ def _get_ws_params(self, workbook, data, amls): }, "currency_name": { "header": { - "value": self._("Curr."), + "value": _("Curr."), "format": FORMATS["format_theader_yellow_center"], }, "lines": { @@ -198,13 +186,13 @@ def _get_ws_params(self, workbook, data, amls): "width": 6, }, "journal": { - "header": {"value": self._("Journal")}, + "header": {"value": _("Journal")}, "lines": {"value": self._render("line.journal_id.code")}, "width": 12, }, "company_currency": { "header": { - "value": self._("Comp. Curr."), + "value": _("Comp. Curr."), "format": FORMATS["format_theader_yellow_center"], }, "lines": { @@ -213,33 +201,15 @@ def _get_ws_params(self, workbook, data, amls): }, "width": 10, }, - "analytic_account": { - "header": {"value": self._("Analytic Account Reference")}, - "lines": { - "value": self._render( - "line.analytic_account_id " "and line.analytic_account_id.code" - ) - }, - "width": 36, - }, - "analytic_account_name": { - "header": {"value": self._("Analytic Account")}, - "lines": { - "value": self._render( - "line.analytic_account_id " "and line.analytic_account_id.name" - ) - }, - "width": 36, - }, "product": { - "header": {"value": self._("Product")}, + "header": {"value": _("Product")}, "lines": { "value": self._render("line.product_id and line.product_id.name") }, "width": 36, }, "product_ref": { - "header": {"value": self._("Product Reference")}, + "header": {"value": _("Product Reference")}, "lines": { "value": self._render( "line.product_id and line.product_id.default_code " "or ''" @@ -248,7 +218,7 @@ def _get_ws_params(self, workbook, data, amls): "width": 36, }, "product_uom": { - "header": {"value": self._("Unit of Measure")}, + "header": {"value": _("Unit of Measure")}, "lines": { "value": self._render( "line.product_uom_id and line.product_uom_id.name" @@ -258,7 +228,7 @@ def _get_ws_params(self, workbook, data, amls): }, "quantity": { "header": { - "value": self._("Qty"), + "value": _("Qty"), "format": FORMATS["format_theader_yellow_right"], }, "lines": { @@ -268,7 +238,7 @@ def _get_ws_params(self, workbook, data, amls): "width": 8, }, "statement": { - "header": {"value": self._("Statement")}, + "header": {"value": _("Statement")}, "lines": { "value": self._render( "line.statement_id and line.statement_id.name" @@ -277,13 +247,13 @@ def _get_ws_params(self, workbook, data, amls): "width": 20, }, "invoice": { - "header": {"value": self._("Invoice")}, + "header": {"value": _("Invoice")}, "lines": {"value": self._render("line.move_id and line.move_id.name")}, "width": 20, }, "amount_residual": { "header": { - "value": self._("Residual Amount"), + "value": _("Residual Amount"), "format": FORMATS["format_theader_yellow_right"], }, "lines": { @@ -294,7 +264,7 @@ def _get_ws_params(self, workbook, data, amls): }, "amount_residual_currency": { "header": { - "value": self._("Res. Am. in Curr."), + "value": _("Res. Am. in Curr."), "format": FORMATS["format_theader_yellow_right"], }, "lines": { @@ -304,13 +274,13 @@ def _get_ws_params(self, workbook, data, amls): "width": 18, }, "narration": { - "header": {"value": self._("Notes")}, + "header": {"value": _("Notes")}, "lines": {"value": self._render("line.move_id.narration or ''")}, "width": 42, }, "blocked": { "header": { - "value": self._("Lit."), + "value": _("Lit."), "format": FORMATS["format_theader_yellow_center"], }, "lines": { @@ -321,7 +291,7 @@ def _get_ws_params(self, workbook, data, amls): }, "id": { "header": { - "value": self._("Id"), + "value": _("Id"), "format": FORMATS["format_theader_yellow_right"], }, "lines": { @@ -333,7 +303,7 @@ def _get_ws_params(self, workbook, data, amls): } col_specs.update(self.env["account.move.line"]._report_xlsx_template()) wanted_list = self.env["account.move.line"]._report_xlsx_fields() - title = self._("Journal Items") + title = _("Journal Items") return [ { diff --git a/account_move_line_report_xls/static/description/index.html b/account_move_line_report_xls/static/description/index.html index 2031f3fd8a99..697513e1671f 100644 --- a/account_move_line_report_xls/static/description/index.html +++ b/account_move_line_report_xls/static/description/index.html @@ -368,18 +368,19 @@

Account Move Line XLSX export

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! source digest: sha256:585fb4c438ac263d7904ecbdcae3a45c8ab9b0c126a164b7df9bd2a10ec7fc55 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

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

+

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

This module extends the functionality of the journal items (‘account.move.line’) list view and allow you to export the selected lines.

Table of contents

+
+

Known issues / Roadmap

+
    +
  • Add support for the analytic_distribution field
  • +
+
-

Bug Tracker

+

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.

+feedback.

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

-

Credits

+

Credits

-

Authors

+

Authors

  • Noviat
-

Maintainers

+

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.

+

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.