-
-
Notifications
You must be signed in to change notification settings - Fork 864
[18.0][MIG] report_partner_address: Migration to 18.0 #1113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
AungKoKoLin1997
wants to merge
6
commits into
OCA:18.0
Choose a base branch
from
qrtl:18.0-mig-report_partner_address
base: 18.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+765
−0
Open
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
5e18b5b
[ADD] report_partner_address
AungKoKoLin1997 9d91a56
[UPD] Update report_partner_address.pot
6098f8d
[BOT] post-merge updates
OCA-git-bot ab56b98
[IMP] report_partner_address: pre-commit auto fixes
AungKoKoLin1997 eb32d6d
[MIG] report_partner_address: Migration to 18.0
AungKoKoLin1997 c8b9067
[IMP] report_partner_address: remove sync address_details from parent
AungKoKoLin1997 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,106 @@ | ||
| ====================== | ||
| 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/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%2Freporting--engine-lightgray.png?logo=github | ||
| :target: https://github.com/OCA/reporting-engine/tree/18.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-18-0/reporting-engine-18-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=18.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 <https://github.com/OCA/reporting-engine/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/reporting-engine/issues/new?body=module:%20report_partner_address%0Aversion:%2018.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 | ||
| ------- | ||
|
|
||
| * Quartile | ||
|
|
||
| Contributors | ||
| ------------ | ||
|
|
||
| - Quartile <https://www.quartile.co> | ||
|
|
||
| - 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 <https://odoo-community.org/page/maintainer-role>`__: | ||
|
|
||
| |maintainer-yostashiro| |maintainer-aungkokolin1997| | ||
|
|
||
| This module is part of the `OCA/reporting-engine <https://github.com/OCA/reporting-engine/tree/18.0/report_partner_address>`_ project on GitHub. | ||
|
|
||
| You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
This file contains hidden or 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 @@ | ||
| from . import models |
This file contains hidden or 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 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": "18.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, | ||
| } |
This file contains hidden or 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,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 "" | ||
| "レポートやポータルページに適用されるアドレスフォーマット。設定されている場" | ||
| "合、対外表示用に標準のアドレスフォーマットがその内容で置き換えられます。" |
This file contains hidden or 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,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 "" |
This file contains hidden or 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 @@ | ||
| from . import res_partner |
This file contains hidden or 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,57 @@ | ||
| # 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, | ||
| recursive=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 | ||
This file contains hidden or 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,3 @@ | ||
| [build-system] | ||
| requires = ["whool"] | ||
| build-backend = "whool.buildapi" |
This file contains hidden or 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,3 @@ | ||
| - Quartile \<<https://www.quartile.co>\> | ||
| - Yoshi Tashiro | ||
| - Aung Ko Ko Lin |
This file contains hidden or 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 @@ | ||
| 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. |
This file contains hidden or 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 @@ | ||
| - 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. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.