Browse Source
[MOD] partner_industry/ies: some users want to manage only one industry, others want to manage multiple industries. So let's create 2 modules to fit both cases
pull/218/head
[MOD] partner_industry/ies: some users want to manage only one industry, others want to manage multiple industries. So let's create 2 modules to fit both cases
pull/218/head
10 changed files with 235 additions and 8 deletions
-
25partner_industries/README.rst
-
7partner_industries/__init__.py
-
39partner_industries/__openerp__.py
-
2partner_industries/model/__init__.py
-
36partner_industries/model/industry.py
-
32partner_industries/model/partner.py
-
54partner_industries/view/industry.xml
-
34partner_industries/view/partner.xml
-
6partner_industry/model/partner.py
-
8partner_industry/view/partner.xml
@ -0,0 +1,25 @@ |
|||||
|
Industry sector on partner |
||||
|
========================== |
||||
|
|
||||
|
This addon adds an industry sector object and a field 'Industry sectors' after the tags on the partner form view. |
||||
|
|
||||
|
Credits |
||||
|
======= |
||||
|
|
||||
|
Contributors |
||||
|
------------ |
||||
|
|
||||
|
* Jacques-Etienne Baudoux <je@bcim.be> (BCIM sprl) |
||||
|
|
||||
|
Maintainer |
||||
|
---------- |
||||
|
|
||||
|
.. image:: http://odoo-community.org/logo.png |
||||
|
:alt: Odoo Community Association |
||||
|
:target: http://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 http://odoo-community.org. |
@ -0,0 +1,7 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
# |
||||
|
# License, author and contributors information in: |
||||
|
# __openerp__.py file at the root folder of this module. |
||||
|
# |
||||
|
|
||||
|
from . import model |
@ -0,0 +1,39 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# |
||||
|
# Author: Jacques-Etienne Baudoux <je@bcim.be> |
||||
|
# Copyright 2015 BCIM sprl |
||||
|
# |
||||
|
# 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/>. |
||||
|
# |
||||
|
############################################################################## |
||||
|
|
||||
|
{ |
||||
|
'name': 'Partner Industry Sector', |
||||
|
'version': '1.0', |
||||
|
'author': "BCIM,Odoo Community Association (OCA)", |
||||
|
'maintainer': 'BCIM', |
||||
|
'category': 'Sales Management', |
||||
|
'complexity': 'easy', |
||||
|
'depends': ['base'], |
||||
|
'website': 'http://www.bcim.be', |
||||
|
'data': [ |
||||
|
'view/industry.xml', |
||||
|
'view/partner.xml', |
||||
|
], |
||||
|
'installable': True, |
||||
|
'auto_install': False, |
||||
|
'license': 'AGPL-3', |
||||
|
'application': False, |
||||
|
} |
@ -0,0 +1,2 @@ |
|||||
|
from . import industry |
||||
|
from . import partner |
@ -0,0 +1,36 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# |
||||
|
# Author: Jacques-Etienne Baudoux <je@bcim.be> |
||||
|
# Copyright 2015 BCIM sprl |
||||
|
# |
||||
|
# 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/>. |
||||
|
# |
||||
|
############################################################################## |
||||
|
|
||||
|
from openerp.osv import fields, orm |
||||
|
|
||||
|
|
||||
|
class Industry(orm.Model): |
||||
|
_name = 'res.partner.category.industry' |
||||
|
_inherit = 'res.partner.category' |
||||
|
|
||||
|
_columns = { |
||||
|
'code': fields.char('Code', size=16), |
||||
|
'parent_id': fields.many2one(_name, 'Parent Category', select=True, ondelete='cascade'), |
||||
|
'partner_ids': fields.many2many( |
||||
|
'res.partner', |
||||
|
'res_partner_industry_rel', 'industry_id', 'partner_id', |
||||
|
'Partners'), |
||||
|
} |
@ -0,0 +1,32 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
############################################################################## |
||||
|
# |
||||
|
# Author: Jacques-Etienne Baudoux <je@bcim.be> |
||||
|
# Copyright 2015 BCIM sprl |
||||
|
# |
||||
|
# 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/>. |
||||
|
# |
||||
|
############################################################################## |
||||
|
|
||||
|
from openerp.osv import fields, orm |
||||
|
|
||||
|
|
||||
|
class res_partner(orm.Model): |
||||
|
_inherit = 'res.partner' |
||||
|
_columns = { |
||||
|
'industry_ids': fields.many2many( |
||||
|
'res.partner.category.industry', |
||||
|
'res_partner_industry_rel', 'partner_id', 'industry_id', |
||||
|
'Industries'), |
||||
|
} |
@ -0,0 +1,54 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<openerp> |
||||
|
<data> |
||||
|
|
||||
|
<record model="ir.ui.view" id="view_crm_industry_form"> |
||||
|
<field name="name">Industry</field> |
||||
|
<field name="model">res.partner.category.industry</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<form string="Industry Sector" version="7.0"> |
||||
|
<sheet> |
||||
|
<label for="name" class="oe_edit_only" /> |
||||
|
<h1> |
||||
|
<field name="name" /> |
||||
|
</h1> |
||||
|
<group> |
||||
|
<group> |
||||
|
<field name="code" /> |
||||
|
<field name="active" /> |
||||
|
</group> |
||||
|
<group> |
||||
|
<field name="parent_id" /> |
||||
|
</group> |
||||
|
</group> |
||||
|
</sheet> |
||||
|
</form> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<record model="ir.ui.view" id="view_crm_industry_tree"> |
||||
|
<field name="name">Industry</field> |
||||
|
<field name="model">res.partner.category.industry</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<tree string="Industry Sectors"> |
||||
|
<field name="complete_name" /> |
||||
|
<field name="code" /> |
||||
|
</tree> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<record model="ir.actions.act_window" id="action_crm_industry"> |
||||
|
<field name="name">Industry Sectors</field> |
||||
|
<field name="res_model">res.partner.category.industry</field> |
||||
|
<field name="view_type">form</field> |
||||
|
<field name="view_mode">tree,form</field> |
||||
|
<field name="view_id" ref="view_crm_industry_tree" /> |
||||
|
</record> |
||||
|
|
||||
|
<menuitem id="menu_crm_config_industry" name="Industry Sectors" |
||||
|
parent="base.menu_config_address_book" action="action_crm_industry" |
||||
|
sequence="20" groups="base.group_no_one" /> |
||||
|
|
||||
|
</data> |
||||
|
</openerp> |
||||
|
|
@ -0,0 +1,34 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<openerp> |
||||
|
<data> |
||||
|
|
||||
|
<record id="view_partner_filter" model="ir.ui.view"> |
||||
|
<field name="name">res.partner.search.industry</field> |
||||
|
<field name="model">res.partner</field> |
||||
|
<field name="inherit_id" ref="base.view_res_partner_filter" /> |
||||
|
<field name="arch" type="xml"> |
||||
|
<field name="category_id" position="after"> |
||||
|
<field name="industry_ids" string="Industry Sector" filter_domain="[('industry_ids','ilike', self)]"/> |
||||
|
</field> |
||||
|
<!-- |
||||
|
<xpath expr="//filter[@string='Country']" position="after"> |
||||
|
<filter string="Industry" context="{'group_by': 'industry_ids'}"/> |
||||
|
</xpath> |
||||
|
--> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
<record id="view_partner_form" model="ir.ui.view"> |
||||
|
<field name="name">res.partner.form.industry</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="after"> |
||||
|
<field name="industry_ids" widget="many2many_tags" placeholder="Industry Sectors.." |
||||
|
attrs="{'invisible':[('is_company','=', False)]}"/> |
||||
|
</field> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
|
</data> |
||||
|
</openerp> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue