feat: add dlv_partner_child_address_street — street/street2 and email below phone on child cards of the partner form

This commit is contained in:
Kristof Bernaert
2026-10-04 17:57:33 +02:00
parent c4b848ce0b
commit aa0bafca84
5 changed files with 117 additions and 0 deletions
@@ -0,0 +1,25 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [16.0.1.1.0] - 2026-10-04
### Changed
- Email moved from directly under the name to below phone/mobile on the child
cards.
## [16.0.1.0.1] - 2026-10-04
### Changed
- Street2 is shown on its own line (only when filled) instead of after a
comma behind street.
## [16.0.1.0.0] - 2026-10-04
### Added
- Initial release.
- Street and street2 on the child address cards of the partner form
(Contacts & Addresses tab), for address-type children only.
@@ -0,0 +1,47 @@
# dlv_partner_child_address_street
## Overview
In the partner form, the **Contacts & Addresses** tab lists child records as
kanban cards. For address-type children (delivery, invoice, other, ...) the
standard card shows only zip, city and country, so several addresses of the
same company look identical.
This addon changes those cards in two ways:
1. **Street and street2** are added to address-type children. Each is shown on
its own line and omitted when empty.
2. **Email is moved** from directly under the name to below phone/mobile, so the
name, address and phone read as one block. This applies to all child cards,
including contact (person) children.
Resulting order: name, function, street, street2, zip/city, country, phone,
mobile, email.
## How it works
Pure view inheritance of `base.view_partner_form`; no models, no Python, no
extra fields. `street` and `street2` are already loaded by the standard
`child_ids` kanban, so no additional data is fetched. An xpath inserts the line
before the zip/city block, inside the existing `type != 'contact'` condition. A
second xpath moves the existing email `div` after the mobile `div`
(`position="move"`).
Street and street2 are not shown for child contacts (persons); only the email
move affects them.
## Scope
- Only the inline `child_ids` kanban of the partner form.
- Other views (sale order address popup, partner kanban, ...) are not touched.
## Compatibility
- Odoo 16.0 (Community and Enterprise)
- Depends on: `base`
## Credits
bv Domus La Vila — https://domuslavila.eu
License: LGPL-3
@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
{
"name": "DLV Partner Child Address Street",
"summary": "Show street and street2 on the child contact/address cards "
"of the partner form",
"description": """
In the partner form, the "Contacts & Addresses" tab shows child addresses
(delivery, invoice, other) as kanban cards that only display zip, city and
country. Addresses of the same company therefore look identical.
This addon adds street and street2 (each on its own line, only when filled)
to the cards of address-type children. Child contacts (persons) are unchanged.
""",
"author": "bv Domus La Vila",
"website": "https://domuslavila.eu",
"category": "Contacts",
"version": "16.0.1.1.0",
"license": "LGPL-3",
"depends": ["base"],
"data": [
"views/res_partner_views.xml",
],
"installable": True,
"application": False,
"auto_install": False,
}
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_partner_form_child_street" model="ir.ui.view">
<field name="name">res.partner.form.child.street</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<!-- street/street2 are already loaded by the base child_ids kanban -->
<xpath expr="//field[@name='child_ids']/kanban//div[hasclass('oe_kanban_details')]//div[@t-if=&quot;record.type.raw_value != 'contact'&quot;]/div" position="before">
<div t-if="record.street.raw_value"><field name="street"/></div>
<div t-if="record.street2.raw_value"><field name="street2"/></div>
</xpath>
<!-- email below phone/mobile instead of directly under the name -->
<xpath expr="//field[@name='child_ids']/kanban//div[hasclass('oe_kanban_details')]/div[@t-if=&quot;record.mobile.raw_value&quot;]" position="after">
<xpath expr="//field[@name='child_ids']/kanban//div[hasclass('oe_kanban_details')]/div[@t-if=&quot;record.email.raw_value&quot;]" position="move"/>
</xpath>
</field>
</record>
</odoo>