Browse Source

Merge PR #1407 into 14.0

Signed-off-by rafaelbn
14.0
OCA-git-bot 2 years ago
parent
commit
26270ca5ef
  1. 0
      partner_create_format_phone/README.rst
  2. 1
      partner_create_format_phone/__init__.py
  3. 15
      partner_create_format_phone/__manifest__.py
  4. 1
      partner_create_format_phone/models/__init__.py
  5. 15
      partner_create_format_phone/models/res_partner.py
  6. 2
      partner_create_format_phone/readme/CONTRIBUTORS.rst
  7. 1
      partner_create_format_phone/readme/DESCRIPTION.rst
  8. 1
      setup/partner_create_format_phone/odoo/addons/partner_create_format_phone
  9. 6
      setup/partner_create_format_phone/setup.py

0
partner_create_format_phone/README.rst

1
partner_create_format_phone/__init__.py

@ -0,0 +1 @@
from . import models

15
partner_create_format_phone/__manifest__.py

@ -0,0 +1,15 @@
# Copyright 2022 Ooops - Ashish Hirpara <ashish.hirapara1995@gmail.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Partner Phone number auto format",
"version": "14.0.1.0.0",
"author": "ooops404, Ashish Hirpara, Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "Tools",
"website": "https://github.com/OCA/partner-contact",
"summary": """Auto mobile number format for Partner""",
"data": [],
"depends": ["phone_validation"],
"installable": True,
}

1
partner_create_format_phone/models/__init__.py

@ -0,0 +1 @@
from . import res_partner

15
partner_create_format_phone/models/res_partner.py

@ -0,0 +1,15 @@
# Copyright 2022 Ooops Ashish Hirpara <https://ooops404.com>
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import api, models
class ResPartner(models.Model):
_inherit = "res.partner"
@api.model
def create(self, vals):
res = super(ResPartner, self).create(vals)
res._onchange_mobile_validation()
res._onchange_phone_validation()
return res

2
partner_create_format_phone/readme/CONTRIBUTORS.rst

@ -0,0 +1,2 @@
* `Ooops <https://www.ooops404.com>`_:
* Ashish Hirpara <https://ashish-hirpara.com/>

1
partner_create_format_phone/readme/DESCRIPTION.rst

@ -0,0 +1 @@
This module formats the Partner mobile number automatically on creation.

1
setup/partner_create_format_phone/odoo/addons/partner_create_format_phone

@ -0,0 +1 @@
../../../../partner_create_format_phone

6
setup/partner_create_format_phone/setup.py

@ -0,0 +1,6 @@
import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
Loading…
Cancel
Save