Browse Source

[ADD] partner_contact_phones2

16.0
RemiFr82 9 months ago
parent
commit
de63f035d5
  1. 5
      partner_contact_phones2/__init__.py
  2. 39
      partner_contact_phones2/__manifest__.py
  3. 1
      partner_contact_phones2/models/__init__.py
  4. 11
      partner_contact_phones2/models/res_partner.py
  5. 18
      partner_contact_phones2/views/res_partner.xml

5
partner_contact_phones2/__init__.py

@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# from . import controllers
# from . import models
# from . import wizards
# from .hooks import pre_init_hook, post_init_hook, uninstall_hook

39
partner_contact_phones2/__manifest__.py

@ -0,0 +1,39 @@
# -*- coding: utf-8 -*-
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
{
"name": "Partner secondary phone numbers",
"version": "1.0.0",
"summary": "Partner secondary phone numbers",
"description": """
Adds a secondary phone and mobile fields on res.partner model
""",
"author": "RemiFr82",
"contributors": "",
"maintainer": "RemiFr82",
"website": "https://remifr82.me",
"license": "LGPL-3",
"category": "",
# "price": 0,
# "currency": "EUR",
"application": False,
"installable": True,
"auto_install": False,
# "pre_init_hook": "",
# "post_init_hook": "",
# "uninstall_hook": "",
# "excludes": [],
# "external_dependencies": [],
"depends": [
"base",
],
"data": [
# Views
"views/res_partner.xml",
],
# "assets": [],
# "css": [],
# "images": [],
# "js": [],
# "test": [],
# "demo": [],
}

1
partner_contact_phones2/models/__init__.py

@ -0,0 +1 @@
# from . import model

11
partner_contact_phones2/models/res_partner.py

@ -0,0 +1,11 @@
import logging
from odoo import models, fields, api, tools
_logger = logging.getLogger(__name__)
class ResPartner(models.Model):
_name = "res.partner"
phone2 = fields.Char("Phone 2", unaccent=False)
mobile2 = fields.Char("Mobile 2", unaccent=False)

18
partner_contact_phones2/views/res_partner.xml

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_partner_form_inherit_base" model="ir.ui.view">
<field name="name">res.partner.view.form.inherit</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="arch" type="xml">
<field name="phone" position="after">
<field name="phone2" widget="phone" />
</field>
<field name="mobile" position="after">
<field name="mobile2" widget="phone" />
</field>
</field>
</record>
</odoo>
Loading…
Cancel
Save