Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 106 additions & 0 deletions report_partner_address/README.rst
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.
1 change: 1 addition & 0 deletions report_partner_address/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
18 changes: 18 additions & 0 deletions report_partner_address/__manifest__.py
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,
}
38 changes: 38 additions & 0 deletions report_partner_address/i18n/ja.po
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 ""
"レポートやポータルページに適用されるアドレスフォーマット。設定されている場"
"合、対外表示用に標準のアドレスフォーマットがその内容で置き換えられます。"
33 changes: 33 additions & 0 deletions report_partner_address/i18n/report_partner_address.pot
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 ""
1 change: 1 addition & 0 deletions report_partner_address/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import res_partner
57 changes: 57 additions & 0 deletions report_partner_address/models/res_partner.py
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
3 changes: 3 additions & 0 deletions report_partner_address/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
3 changes: 3 additions & 0 deletions report_partner_address/readme/CONTRIBUTORS.md
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
4 changes: 4 additions & 0 deletions report_partner_address/readme/DESCRIPTION.md
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.
6 changes: 6 additions & 0 deletions report_partner_address/readme/USAGE.md
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.
Loading