Browse Source

[ADD] new module for partner business id

Business id is a necessity for b2b sales in some countries.
This field has a slightly different function than fields "company_registry" or "vat"
pull/463/head
Jarmo Kortetjärvi 8 years ago
parent
commit
0d480e65da
  1. 69
      partner_business_code/README.rst
  2. 5
      partner_business_code/__init__.py
  3. 44
      partner_business_code/__openerp__.py
  4. 5
      partner_business_code/models/__init__.py
  5. 11
      partner_business_code/models/res_partner.py
  6. BIN
      partner_business_code/static/description/icon.png
  7. 24
      partner_business_code/views/res_partner.xml

69
partner_business_code/README.rst

@ -0,0 +1,69 @@
.. 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 business code
=====================
Adds a business code (business id) for partners
Does not add any validation or format checks
Installation
============
\-
Configuration
=============
\-
Usage
=====
\-
Known issues / Roadmap
======================
\-
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 smash it by providing detailed and welcomed feedback.
Credits
=======
Images
------
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
Contributors
------------
* Jarmo Kortetjärvi <jarmo.kortetjarvi@tawasta.fi>
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.

5
partner_business_code/__init__.py

@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Oy Tawasta OS Technologies Ltd.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import models

44
partner_business_code/__openerp__.py

@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Oy Tawasta OS Technologies Ltd.
# Copyright 2017 Oy Tawasta OS Technologies Ltd. (http://www.tawasta.fi)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see http://www.gnu.org/licenses/agpl.html
#
{
"name": "Partner business code",
"summary": "Adds a business code (business id) for partners",
"version": "8.0.1.0.0",
"category": "CRM",
"website": "https://odoo-community.org/",
"author": "Oy Tawasta Technologies Ltd., Odoo Community Association (OCA)",
"license": "AGPL-3",
"application": False,
"installable": True,
"external_dependencies": {
"python": [],
"bin": [],
},
"depends": [
"base",
],
"data": [
'views/res_partner.xml',
],
"demo": [
],
"qweb": [
]
}

5
partner_business_code/models/__init__.py

@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Oy Tawasta OS Technologies Ltd.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import res_partner

11
partner_business_code/models/res_partner.py

@ -0,0 +1,11 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Oy Tawasta OS Technologies Ltd.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from openerp import models, fields
class ResPartner(models.Model):
_inherit = 'res.partner'
business_id = fields.Char('Business id')

BIN
partner_business_code/static/description/icon.png

After

Width: 128  |  Height: 128  |  Size: 9.2 KiB

24
partner_business_code/views/res_partner.xml

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2017 Oy Tawasta OS Technologies Ltd.
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<openerp>
<data>
<record id="view_partner_form" model="ir.ui.view">
<field name="name">view.partner.form.business.id</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form" />
<field name="arch" type="xml">
<field name="category_id" position="before">
<h2 attrs="{'invisible': [('is_company', '=', False)]}">
<field name="business_id" placeholder="Business id"/>
</h2>
</field>
</field>
</record>
</data>
</openerp>
Loading…
Cancel
Save