Browse Source

[10.0][ADD][partner_coc] Add field 'Chamber Of Commerce Registration Number' (#428)

* [ADD] partner_coc

* [ADD] partner_coc

* [IMP] Shorter field string

* [FIX] flake

* [FIX] Manifest and readme issues
14.0
Dennis Sluijk 8 years ago
committed by bosd
parent
commit
d3eb884e06
  1. 52
      partner_coc/README.rst
  2. 1
      partner_coc/__init__.py
  3. 19
      partner_coc/__manifest__.py
  4. 7
      partner_coc/data/res_partner_id_category_data.xml
  5. 1
      partner_coc/models/__init__.py
  6. 18
      partner_coc/models/res_partner.py
  7. 15
      partner_coc/views/res_partner_view.xml

52
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
<https://github.com/OCA/partner-contact/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 <d.sluijk@onestein.nl>
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.

1
partner_coc/__init__.py

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

19
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,
}

7
partner_coc/data/res_partner_id_category_data.xml

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="id_category_coc" model="res.partner.id_category">
<field name="code">coc</field>
<field name="name">Chamber Of Commerce Registration Number</field>
</record>
</odoo>

1
partner_coc/models/__init__.py

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

18
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
),
)

15
partner_coc/views/res_partner_view.xml

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<!-- Add coc_registration_number to res partner view -->
<record model="ir.ui.view" id="view_partner_form">
<field name="name">view.partner.form</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="priority" eval="10"/>
<field name="arch" type="xml">
<field name="lang" position="after">
<field name="coc_registration_number" attrs="{'invisible': [('company_type','!=','company')]}"/>
</field>
</field>
</record>
</odoo>
Loading…
Cancel
Save