[NEW] partner_phone_email_form_widget: create add-on

This commit is contained in:
Stéphan Sainléger
2025-03-23 11:59:08 +01:00
parent b42fc550b9
commit 4642927ce0
2 changed files with 49 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Partner Phone and Email form widget",
"summary": "Add widget button for phone and email fields in partner form view",
"version": "16.0.1.0.0",
"author": "Stéphan Sainléger",
"license": "AGPL-3",
"maintainer": "Elabore",
"category": "Partner Tools",
"website": "https://odoo-community.org/",
"depends": ["contacts"],
"data": [
"views/res_partner_views.xml",
],
"auto_install": False,
"installable": True,
}

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_partner_form_phone_email_widgets" model="ir.ui.view">
<field name="name">Add phone and email widgets</field>
<field name="model">res.partner</field>
<field name="priority">99</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='phone']" position="replace">
<label for="phone" />
<div class="o_row">
<field name="phone" widget="phone" />
<button type="action" name="137"
class="btn-sm btn-link mb4 fa fa-envelope-o" aria-label="Send SMS"
title="Send SMS" attrs="{'invisible':[('phone', '=', False)]}"
context="{'field_name': 'phone'}" />
</div>
</xpath>
<xpath expr="//field[@name='mobile']" position="replace">
<label for="mobile" />
<div class="o_row">
<field name="mobile" widget="phone" />
<button type="action" name="137"
class="btn-sm btn-link mb4 fa fa-envelope-o" aria-label="Send SMS"
title="Send SMS" attrs="{'invisible':[('mobile', '=', False)]}"
context="{'field_name': 'mobile'}" />
</div>
</xpath>
</field>
</record>
</odoo>