diff --git a/README.md b/README.md index cda9155927..196131b96a 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,7 @@ addon | version | maintainers | summary [report_generate_helper](report_generate_helper/) | 16.0.1.0.0 | | Helper to easily generate report [report_label](report_label/) | 16.0.1.0.1 | ivantodorovich | Print configurable self-adhesive labels reports [report_paperformat_company_dependent](report_paperformat_company_dependent/) | 16.0.1.0.0 | | Report Paperformat Company Dependent +[report_partner_address](report_partner_address/) | 16.0.1.0.0 | yostashiro aungkokolin1997 | Translatable partner address details for reports and portal [report_py3o](report_py3o/) | 16.0.1.0.6 | | Reporting engine based on Libreoffice (ODT -> ODT, ODT -> PDF, ODT -> DOC, ODT -> DOCX, ODS -> ODS, etc.) [report_py3o_fusion_server](report_py3o_fusion_server/) | 16.0.1.0.0 | | Let the fusion server handle format conversion. [report_qr](report_qr/) | 16.0.1.0.0 | | Web QR Manager @@ -44,7 +45,7 @@ addon | version | maintainers | summary [report_qweb_parameter](report_qweb_parameter/) | 16.0.1.0.1 | | Add new parameters for qweb templates in order to reduce field length and check minimal length [report_qweb_pdf_cover](report_qweb_pdf_cover/) | 16.0.1.0.0 | | Add front and back covers to your QWeb PDF reports [report_qweb_pdf_watermark](report_qweb_pdf_watermark/) | 16.0.1.0.1 | | Add watermarks to your QWEB PDF reports -[report_qweb_signer](report_qweb_signer/) | 16.0.1.0.4 | | Sign Qweb PDFs usign a PKCS#12 certificate +[report_qweb_signer](report_qweb_signer/) | 16.0.1.0.5 | | Sign Qweb PDFs usign a PKCS#12 certificate [report_substitute](report_substitute/) | 16.0.1.1.1 | sbejaoui | This module allows to create substitution rules for report actions. [report_text_format_option](report_text_format_option/) | 16.0.1.0.0 | | Report Text Format Option [report_wkhtmltopdf_param](report_wkhtmltopdf_param/) | 16.0.1.0.0 | | Add new parameters for a paper format to be used by wkhtmltopdf command as arguments. diff --git a/report_partner_address/README.rst b/report_partner_address/README.rst new file mode 100644 index 0000000000..37b4b3af8b --- /dev/null +++ b/report_partner_address/README.rst @@ -0,0 +1,110 @@ +.. image:: https://odoo-community.org/readme-banner-image + :target: https://odoo-community.org/get-involved?utm_source=readme + :alt: Odoo Community Association + +====================== +Report Partner Address +====================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:7c019dbfd9524b0b0daaaafa5fbbc77df627c40d3bb1e1b6bf9bea2f5a224972 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/license-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%2Freporting--engine-lightgray.png?logo=github + :target: https://github.com/OCA/reporting-engine/tree/16.0/report_partner_address + :alt: OCA/reporting-engine +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/reporting-engine-16-0/reporting-engine-16-0-report_partner_address + :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/reporting-engine&target_branch=16.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Adds a translatable Address Details field on partners for use in reports +and portal. + +Odoo prints documents in the partner's language but lacks a standard way +to display addresses in multiple languages. This module fills that gap. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +- Go to the partner record. +- Fill in Address Details, including translations for the active + languages. + +The address in reports and portal pages will use the value from Address +Details. + +If Address Details is left blank, the standard address format is used. + +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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* Quartile + +Contributors +------------ + +- Quartile + + - Yoshi Tashiro + - Aung Ko Ko Lin + +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. + +.. |maintainer-yostashiro| image:: https://github.com/yostashiro.png?size=40px + :target: https://github.com/yostashiro + :alt: yostashiro +.. |maintainer-aungkokolin1997| image:: https://github.com/aungkokolin1997.png?size=40px + :target: https://github.com/aungkokolin1997 + :alt: aungkokolin1997 + +Current `maintainers `__: + +|maintainer-yostashiro| |maintainer-aungkokolin1997| + +This module is part of the `OCA/reporting-engine `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/report_partner_address/__init__.py b/report_partner_address/__init__.py new file mode 100644 index 0000000000..0650744f6b --- /dev/null +++ b/report_partner_address/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/report_partner_address/__manifest__.py b/report_partner_address/__manifest__.py new file mode 100644 index 0000000000..ea2a25881f --- /dev/null +++ b/report_partner_address/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2025 Quartile (https://www.quartile.co) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +{ + "name": "Report Partner Address", + "summary": "Translatable partner address details for reports and portal", + "version": "16.0.1.0.0", + "author": "Quartile, Odoo Community Association (OCA)", + "category": "Reporting", + "website": "https://github.com/OCA/reporting-engine", + "license": "AGPL-3", + "depends": ["web"], + "data": [ + "views/ir_qweb_widget_templates.xml", + "views/res_partner_views.xml", + ], + "maintainers": ["yostashiro", "aungkokolin1997"], + "installable": True, +} diff --git a/report_partner_address/i18n/ja.po b/report_partner_address/i18n/ja.po new file mode 100644 index 0000000000..8540d01e86 --- /dev/null +++ b/report_partner_address/i18n/ja.po @@ -0,0 +1,38 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * report_partner_address +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2025-12-21 08:50+0000\n" +"PO-Revision-Date: 2025-12-21 08:50+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: report_partner_address +#: model:ir.model.fields,field_description:report_partner_address.field_res_partner__address_details +#: model:ir.model.fields,field_description:report_partner_address.field_res_users__address_details +msgid "Address Details" +msgstr "アドレス詳細" + +#. module: report_partner_address +#: model:ir.model,name:report_partner_address.model_res_partner +msgid "Contact" +msgstr "連絡先" + +#. module: report_partner_address +#: model:ir.model.fields,help:report_partner_address.field_res_partner__address_details +#: model:ir.model.fields,help:report_partner_address.field_res_users__address_details +msgid "" +"Custom address format used in reports and portal pages. When set, this " +"replaces the standard address format for external display." +msgstr "" +"レポートやポータルページに適用されるアドレスフォーマット。設定されている場" +"合、対外表示用に標準のアドレスフォーマットがその内容で置き換えられます。" diff --git a/report_partner_address/i18n/report_partner_address.pot b/report_partner_address/i18n/report_partner_address.pot new file mode 100644 index 0000000000..be4a3fd574 --- /dev/null +++ b/report_partner_address/i18n/report_partner_address.pot @@ -0,0 +1,33 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * report_partner_address +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \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: report_partner_address +#: model:ir.model.fields,field_description:report_partner_address.field_res_partner__address_details +#: model:ir.model.fields,field_description:report_partner_address.field_res_users__address_details +msgid "Address Details" +msgstr "" + +#. module: report_partner_address +#: model:ir.model,name:report_partner_address.model_res_partner +msgid "Contact" +msgstr "" + +#. module: report_partner_address +#: model:ir.model.fields,help:report_partner_address.field_res_partner__address_details +#: model:ir.model.fields,help:report_partner_address.field_res_users__address_details +msgid "" +"Custom address format used in reports and portal pages. When set, this " +"replaces the standard address format for external display." +msgstr "" diff --git a/report_partner_address/models/__init__.py b/report_partner_address/models/__init__.py new file mode 100644 index 0000000000..91fed54d40 --- /dev/null +++ b/report_partner_address/models/__init__.py @@ -0,0 +1 @@ +from . import res_partner diff --git a/report_partner_address/models/res_partner.py b/report_partner_address/models/res_partner.py new file mode 100644 index 0000000000..a073452fb5 --- /dev/null +++ b/report_partner_address/models/res_partner.py @@ -0,0 +1,56 @@ +# Copyright 2025 Quartile (https://www.quartile.co) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import api, fields, models + + +class ResPartner(models.Model): + _inherit = "res.partner" + + address_details = fields.Text( + compute="_compute_address_details", + store=True, + readonly=False, + translate=True, + help="Custom address format used in reports and portal pages. " + "When set, this replaces the standard address format for external display.", + ) + + @api.depends("parent_id.address_details", "type") + def _compute_address_details(self): + for partner in self: + if partner.parent_id and partner.type == "contact": + partner.address_details = partner.parent_id.address_details + # No translation sync here to avoid unnecessary DB operations + + @api.model + def _address_fields(self): + """For address_details to be synced from parent.""" + return super()._address_fields() + ["address_details"] + + def _fields_sync(self, values): + """Copy address_details translations from parent for contacts.""" + result = super()._fields_sync(values) + parent = self.parent_id + if parent and self.type == "contact" and parent.address_details: + # Copy JSONB translations directly to avoid recursion + self.env.cr.execute( + """ + UPDATE res_partner + SET address_details = p.address_details + FROM res_partner p + WHERE res_partner.id = %(partner_id)s + AND p.id = %(parent_id)s + """, + {"partner_id": self.id, "parent_id": parent.id}, + ) + return result + + def _prepare_display_address(self, without_company=False): + self.ensure_one() + address_format, args = super()._prepare_display_address( + without_company=without_company + ) + if self.address_details: + address_format = self.address_details + return address_format, args diff --git a/report_partner_address/readme/CONTRIBUTORS.md b/report_partner_address/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..2794613f37 --- /dev/null +++ b/report_partner_address/readme/CONTRIBUTORS.md @@ -0,0 +1,3 @@ +- Quartile \<\> + - Yoshi Tashiro + - Aung Ko Ko Lin diff --git a/report_partner_address/readme/DESCRIPTION.md b/report_partner_address/readme/DESCRIPTION.md new file mode 100644 index 0000000000..61e62efa74 --- /dev/null +++ b/report_partner_address/readme/DESCRIPTION.md @@ -0,0 +1,4 @@ +Adds a translatable Address Details field on partners for use in reports and portal. + +Odoo prints documents in the partner's language but lacks a standard way to display +addresses in multiple languages. This module fills that gap. diff --git a/report_partner_address/readme/USAGE.md b/report_partner_address/readme/USAGE.md new file mode 100644 index 0000000000..7b4f8211fd --- /dev/null +++ b/report_partner_address/readme/USAGE.md @@ -0,0 +1,6 @@ +- Go to the partner record. +- Fill in Address Details, including translations for the active languages. + +The address in reports and portal pages will use the value from Address Details. + +If Address Details is left blank, the standard address format is used. diff --git a/report_partner_address/static/description/icon.png b/report_partner_address/static/description/icon.png new file mode 100644 index 0000000000..1dcc49c24f Binary files /dev/null and b/report_partner_address/static/description/icon.png differ diff --git a/report_partner_address/static/description/index.html b/report_partner_address/static/description/index.html new file mode 100644 index 0000000000..8d1ae22a87 --- /dev/null +++ b/report_partner_address/static/description/index.html @@ -0,0 +1,450 @@ + + + + + +README.rst + + + +
+ + + +Odoo Community Association + +
+

Report Partner Address

+ +

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

+

Adds a translatable Address Details field on partners for use in reports +and portal.

+

Odoo prints documents in the partner’s language but lacks a standard way +to display addresses in multiple languages. This module fills that gap.

+

Table of contents

+ +
+

Usage

+
    +
  • Go to the partner record.
  • +
  • Fill in Address Details, including translations for the active +languages.
  • +
+

The address in reports and portal pages will use the value from Address +Details.

+

If Address Details is left blank, the standard address format is used.

+
+
+

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.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • Quartile
  • +
+
+
+

Contributors

+ +
+
+

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.

+

Current maintainers:

+

yostashiro aungkokolin1997

+

This module is part of the OCA/reporting-engine project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+
+ + diff --git a/report_partner_address/tests/__init__.py b/report_partner_address/tests/__init__.py new file mode 100644 index 0000000000..7ad72d135d --- /dev/null +++ b/report_partner_address/tests/__init__.py @@ -0,0 +1 @@ +from . import test_report_partner_address diff --git a/report_partner_address/tests/test_report_partner_address.py b/report_partner_address/tests/test_report_partner_address.py new file mode 100644 index 0000000000..da977e1b55 --- /dev/null +++ b/report_partner_address/tests/test_report_partner_address.py @@ -0,0 +1,81 @@ +# Copyright 2025 Quartile (https://www.quartile.co) +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo.tests.common import TransactionCase, tagged + + +@tagged("post_install", "-at_install") +class TestReportPartnerAddress(TransactionCase): + @classmethod + def setUpClass(cls): + super().setUpClass() + ja = ( + cls.env["res.lang"] + .with_context(active_test=False) + .search([("code", "=", "ja_JP")]) + ) + cls.env["base.language.install"].create({"lang_ids": [ja.id]}).lang_install() + cls.partner = cls.env["res.partner"].create( + { + "name": "Test Company", + "street": "1-2-3 Jingumae", + "city": "Shibuya-ku, Tokyo", + "zip": "150-0001", + "country_id": cls.env.ref("base.jp").id, + } + ) + # Japanese address format (native) + cls.partner.with_context(lang="ja_JP").write( + {"address_details": "〒150-0001\n東京都渋谷区神宮前1-2-3\nテスト株式会社"} + ) + # English transliteration for international use + cls.partner.address_details = ( + "Test Company\n1-2-3 Jingumae, Shibuya-ku\nTokyo 150-0001\nJapan" + ) + + def test_address_details_always_used(self): + res = self.partner.with_context(lang="en_US")._display_address() + self.assertEqual( + res, "Test Company\n1-2-3 Jingumae, Shibuya-ku\nTokyo 150-0001\nJapan" + ) + res = self.partner.with_context(lang="ja_JP")._display_address() + self.assertEqual(res, "〒150-0001\n東京都渋谷区神宮前1-2-3\nテスト株式会社") + + def test_address_details_empty_uses_standard_format(self): + partner = self.env["res.partner"].create( + { + "name": "No Details Partner", + "street": "123 Main St", + "city": "Springfield", + "zip": "12345", + "country_id": self.env.ref("base.us").id, + } + ) + res = partner._display_address() + self.assertIn("123 Main St", res) + self.assertIn("Springfield", res) + + def test_contact_inherits_address_details_from_parent(self): + contact = self.env["res.partner"].create( + {"name": "Contact Person", "type": "contact", "parent_id": self.partner.id} + ) + self.assertEqual( + contact.address_details, + "Test Company\n1-2-3 Jingumae, Shibuya-ku\nTokyo 150-0001\nJapan", + ) + self.assertEqual( + contact.with_context(lang="ja_JP").address_details, + "〒150-0001\n東京都渋谷区神宮前1-2-3\nテスト株式会社", + ) + + def test_non_contact_does_not_inherit_address_details(self): + delivery_address = self.env["res.partner"].create( + { + "name": "Delivery Address", + "type": "delivery", + "parent_id": self.partner.id, + "street": "456 Delivery St", + } + ) + # Non-contact address should NOT inherit parent's address_details + self.assertFalse(delivery_address.address_details) diff --git a/report_partner_address/views/ir_qweb_widget_templates.xml b/report_partner_address/views/ir_qweb_widget_templates.xml new file mode 100644 index 0000000000..cda0b2f466 --- /dev/null +++ b/report_partner_address/views/ir_qweb_widget_templates.xml @@ -0,0 +1,9 @@ + + + diff --git a/report_partner_address/views/res_partner_views.xml b/report_partner_address/views/res_partner_views.xml new file mode 100644 index 0000000000..8c1dada41d --- /dev/null +++ b/report_partner_address/views/res_partner_views.xml @@ -0,0 +1,15 @@ + + + res.partner.form + res.partner + + + + + + + + diff --git a/report_qweb_signer/README.rst b/report_qweb_signer/README.rst index 851d8891fb..a8491194a4 100644 --- a/report_qweb_signer/README.rst +++ b/report_qweb_signer/README.rst @@ -11,7 +11,7 @@ Qweb PDF reports signer !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:98ab01f40082429507d6180e23d3ffba607dff06c259e5adf5e41fd07bf25b76 + !! source digest: sha256:88f640b44c936412d511a7e1cf1f0c900d708f233a0a976b5f3fa09d8384fd3b !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/report_qweb_signer/__manifest__.py b/report_qweb_signer/__manifest__.py index 0feabed02d..9fc26e4e7f 100644 --- a/report_qweb_signer/__manifest__.py +++ b/report_qweb_signer/__manifest__.py @@ -6,7 +6,7 @@ { "name": "Qweb PDF reports signer", "summary": "Sign Qweb PDFs usign a PKCS#12 certificate", - "version": "16.0.1.0.4", + "version": "16.0.1.0.5", "category": "Reporting", "website": "https://github.com/OCA/reporting-engine", "author": "Tecnativa, " "Odoo Community Association (OCA)", diff --git a/report_qweb_signer/static/certificate/test.p12 b/report_qweb_signer/static/certificate/test.p12 index eca08285ce..c3aff430fe 100644 Binary files a/report_qweb_signer/static/certificate/test.p12 and b/report_qweb_signer/static/certificate/test.p12 differ diff --git a/report_qweb_signer/static/description/index.html b/report_qweb_signer/static/description/index.html index 62ded6d64c..65e444f2b5 100644 --- a/report_qweb_signer/static/description/index.html +++ b/report_qweb_signer/static/description/index.html @@ -372,7 +372,7 @@

Qweb PDF reports signer

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:98ab01f40082429507d6180e23d3ffba607dff06c259e5adf5e41fd07bf25b76 +!! source digest: sha256:88f640b44c936412d511a7e1cf1f0c900d708f233a0a976b5f3fa09d8384fd3b !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

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

This module extends the functionality of report module to sign diff --git a/setup/_metapackage/VERSION.txt b/setup/_metapackage/VERSION.txt index 7c022a4ab9..f5ac8c23bc 100644 --- a/setup/_metapackage/VERSION.txt +++ b/setup/_metapackage/VERSION.txt @@ -1 +1 @@ -16.0.20251023.0 \ No newline at end of file +16.0.20251222.0 \ No newline at end of file diff --git a/setup/_metapackage/setup.py b/setup/_metapackage/setup.py index be17320d95..e70307eebe 100644 --- a/setup/_metapackage/setup.py +++ b/setup/_metapackage/setup.py @@ -21,6 +21,7 @@ 'odoo-addon-report_generate_helper>=16.0dev,<16.1dev', 'odoo-addon-report_label>=16.0dev,<16.1dev', 'odoo-addon-report_paperformat_company_dependent>=16.0dev,<16.1dev', + 'odoo-addon-report_partner_address>=16.0dev,<16.1dev', 'odoo-addon-report_py3o>=16.0dev,<16.1dev', 'odoo-addon-report_py3o_fusion_server>=16.0dev,<16.1dev', 'odoo-addon-report_qr>=16.0dev,<16.1dev', diff --git a/setup/report_partner_address/odoo/addons/report_partner_address b/setup/report_partner_address/odoo/addons/report_partner_address new file mode 120000 index 0000000000..d733edf7ee --- /dev/null +++ b/setup/report_partner_address/odoo/addons/report_partner_address @@ -0,0 +1 @@ +../../../../report_partner_address \ No newline at end of file diff --git a/setup/report_partner_address/setup.py b/setup/report_partner_address/setup.py new file mode 100644 index 0000000000..28c57bb640 --- /dev/null +++ b/setup/report_partner_address/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)