diff --git a/partner_coc/README.rst b/partner_coc/README.rst new file mode 100644 index 000000000..b9864716f --- /dev/null +++ b/partner_coc/README.rst @@ -0,0 +1,52 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +=========== +Partner CoC +=========== + +Adds a field 'Chamber Of Commerce Registration Number' to partner. + +Usage +===== + +To use this module, you need to: + +#. Go to the partner form; +#. make sure the partner is a company. + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/134/10.0 + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smashing it by providing a detailed and welcomed feedback. + +Credits +======= + +Contributors +------------ + +* Dennis Sluijk + +Maintainer +---------- + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +This module is maintained by the OCA. + +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. + +To contribute to this module, please visit https://odoo-community.org. \ No newline at end of file diff --git a/partner_coc/__init__.py b/partner_coc/__init__.py new file mode 100644 index 000000000..0650744f6 --- /dev/null +++ b/partner_coc/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/partner_coc/__manifest__.py b/partner_coc/__manifest__.py new file mode 100644 index 000000000..3659fe811 --- /dev/null +++ b/partner_coc/__manifest__.py @@ -0,0 +1,19 @@ +{ + 'name': 'Partner CoC', + 'summary': "Adds a field 'Chamber Of Commerce Registration Number' to " + "partner", + 'version': '10.0.1.0.0', + 'category': 'Web', + 'author': 'Onestein,Odoo Community Association (OCA)', + 'website': 'http://www.onestein.eu', + 'license': 'AGPL-3', + 'depends': [ + 'partner_identification', + ], + 'data': [ + 'data/res_partner_id_category_data.xml', + 'views/res_partner_view.xml' + ], + 'installable': True, + 'application': False, +} diff --git a/partner_coc/data/res_partner_id_category_data.xml b/partner_coc/data/res_partner_id_category_data.xml new file mode 100644 index 000000000..5ca8dd5f9 --- /dev/null +++ b/partner_coc/data/res_partner_id_category_data.xml @@ -0,0 +1,7 @@ + + + + coc + Chamber Of Commerce Registration Number + + diff --git a/partner_coc/models/__init__.py b/partner_coc/models/__init__.py new file mode 100644 index 000000000..91fed54d4 --- /dev/null +++ b/partner_coc/models/__init__.py @@ -0,0 +1 @@ +from . import res_partner diff --git a/partner_coc/models/res_partner.py b/partner_coc/models/res_partner.py new file mode 100644 index 000000000..ad283c56f --- /dev/null +++ b/partner_coc/models/res_partner.py @@ -0,0 +1,18 @@ +from odoo import models, fields + + +class ResPartner(models.Model): + _inherit = 'res.partner' + + coc_registration_number = fields.Char( + string='CoC Registration Number', + compute=lambda s: s._compute_identification( + 'coc_registration_number', 'coc', + ), + inverse=lambda s: s._inverse_identification( + 'coc_registration_number', 'coc', + ), + search=lambda s, *a: s._search_identification( + 'coc_registration_number', 'coc', *a + ), + ) diff --git a/partner_coc/views/res_partner_view.xml b/partner_coc/views/res_partner_view.xml new file mode 100644 index 000000000..ec18cb749 --- /dev/null +++ b/partner_coc/views/res_partner_view.xml @@ -0,0 +1,15 @@ + + + + + view.partner.form + res.partner + + + + + + + + +