cubells
8 years ago
committed by
Pedro M. Baeza
10 changed files with 80 additions and 76 deletions
-
8partner_sector/README.rst
-
1partner_sector/__init__.py
-
7partner_sector/__openerp__.py
-
1partner_sector/models/__init__.py
-
1partner_sector/models/res_partner.py
-
1partner_sector/models/res_partner_sector.py
-
1partner_sector/tests/__init__.py
-
1partner_sector/tests/test_res_partner.py
-
48partner_sector/views/res_partner_sector_view.xml
-
87partner_sector/views/res_partner_view.xml
@ -1,5 +1,6 @@ |
|||||
# -*- coding: utf-8 -*- |
# -*- coding: utf-8 -*- |
||||
# © 2015 Antiun Ingenieria S.L. - Antonio Espinosa |
# © 2015 Antiun Ingenieria S.L. - Antonio Espinosa |
||||
|
# © 2016 Tecnativa S.L. - Vicent Cubells |
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
||||
|
|
||||
from . import models |
from . import models |
@ -1,5 +1,6 @@ |
|||||
# -*- coding: utf-8 -*- |
# -*- coding: utf-8 -*- |
||||
# © 2015 Antiun Ingenieria S.L. - Javier Iniesta |
# © 2015 Antiun Ingenieria S.L. - Javier Iniesta |
||||
|
# © 2016 Tecnativa S.L. - Vicent Cubells |
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
||||
|
|
||||
from . import res_partner |
from . import res_partner |
||||
|
@ -1,5 +1,6 @@ |
|||||
# -*- coding: utf-8 -*- |
# -*- coding: utf-8 -*- |
||||
# © 2015 Antiun Ingenieria S.L. - Javier Iniesta |
# © 2015 Antiun Ingenieria S.L. - Javier Iniesta |
||||
|
# © 2016 Tecnativa S.L. - Vicent Cubells |
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). |
||||
|
|
||||
from . import test_res_partner |
from . import test_res_partner |
@ -1,32 +1,30 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
<?xml version="1.0" encoding="utf-8"?> |
||||
<!-- © 2015 Antiun Ingenieria S.L. - Javier Iniesta |
<!-- © 2015 Antiun Ingenieria S.L. - Javier Iniesta |
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). --> |
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). --> |
||||
<openerp> |
|
||||
<data> |
|
||||
|
<odoo> |
||||
|
|
||||
<record id="res_partner_sector_action" model="ir.actions.act_window"> |
|
||||
<field name="name">Sectors</field> |
|
||||
<field name="res_model">res.partner.sector</field> |
|
||||
<field name="view_type">form</field> |
|
||||
<field name="view_mode">tree</field> |
|
||||
</record> |
|
||||
|
<record id="res_partner_sector_action" model="ir.actions.act_window"> |
||||
|
<field name="name">Sectors</field> |
||||
|
<field name="res_model">res.partner.sector</field> |
||||
|
<field name="view_type">form</field> |
||||
|
<field name="view_mode">tree</field> |
||||
|
</record> |
||||
|
|
||||
<record id="res_partner_sector_tree_view" model="ir.ui.view"> |
|
||||
<field name="name">Partner Sector tree</field> |
|
||||
<field name="model">res.partner.sector</field> |
|
||||
<field name="arch" type="xml"> |
|
||||
<tree string="Sectors" editable="top"> |
|
||||
<field name="name"/> |
|
||||
<field name="parent_id"/> |
|
||||
</tree> |
|
||||
</field> |
|
||||
</record> |
|
||||
|
<record id="res_partner_sector_tree_view" model="ir.ui.view"> |
||||
|
<field name="name">Partner Sector tree</field> |
||||
|
<field name="model">res.partner.sector</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<tree string="Sectors" editable="top"> |
||||
|
<field name="name"/> |
||||
|
<field name="parent_id"/> |
||||
|
</tree> |
||||
|
</field> |
||||
|
</record> |
||||
|
|
||||
<menuitem action="res_partner_sector_action" |
|
||||
id="menu_res_partner_sector" |
|
||||
name="Sectors" |
|
||||
parent="base.menu_config_address_book" |
|
||||
sequence="3"/> |
|
||||
|
<menuitem action="res_partner_sector_action" |
||||
|
id="menu_res_partner_sector" |
||||
|
name="Sectors" |
||||
|
parent="base.menu_config_address_book" |
||||
|
sequence="3"/> |
||||
|
|
||||
</data> |
|
||||
</openerp> |
|
||||
|
</odoo> |
@ -1,54 +1,53 @@ |
|||||
<?xml version="1.0" encoding="utf-8"?> |
<?xml version="1.0" encoding="utf-8"?> |
||||
<!-- © 2015 Antiun Ingenieria S.L. - Javier Iniesta |
<!-- © 2015 Antiun Ingenieria S.L. - Javier Iniesta |
||||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). --> |
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). --> |
||||
<openerp> |
|
||||
<data> |
|
||||
|
<odoo> |
||||
|
|
||||
<record model="ir.ui.view" id="view_partner_form_sector"> |
|
||||
<field name="name">Partner form with sector</field> |
|
||||
<field name="model">res.partner</field> |
|
||||
<field name="inherit_id" ref="base.view_partner_form"/> |
|
||||
<field name="arch" type="xml"> |
|
||||
<field name="phone" position="before"> |
|
||||
<field name="sector_id" placeholder="Sector" |
|
||||
options='{"no_open": True}' |
|
||||
attrs="{'invisible': [('is_company', '=', False)]}"/> |
|
||||
<field name="secondary_sector_ids" widget="many2many_tags" |
|
||||
attrs="{'invisible': [('is_company', '=', False)]}"/> |
|
||||
|
<record model="ir.ui.view" id="view_partner_form_sector"> |
||||
|
<field name="name">Partner form with sector</field> |
||||
|
<field name="model">res.partner</field> |
||||
|
<field name="inherit_id" ref="base.view_partner_form"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<field name="phone" position="before"> |
||||
|
<field name="sector_id" placeholder="Sector" |
||||
|
options='{"no_open": True}' |
||||
|
attrs="{'invisible': [('is_company', '=', False)]}"/> |
||||
|
<field name="secondary_sector_ids" widget="many2many_tags" |
||||
|
attrs="{'invisible': [('is_company', '=', False)]}"/> |
||||
|
</field> |
||||
</field> |
</field> |
||||
</field> |
|
||||
</record> |
|
||||
|
</record> |
||||
|
|
||||
<record model="ir.ui.view" id="view_partner_tree_sector"> |
|
||||
<field name="name">Partner tree with sector</field> |
|
||||
<field name="model">res.partner</field> |
|
||||
<field name="inherit_id" ref="base.view_partner_tree"/> |
|
||||
<field name="arch" type="xml"> |
|
||||
<field name="email" position="after"> |
|
||||
<field name="sector_id" |
|
||||
attrs="{'invisible': [('is_company', '=', False)]}"/> |
|
||||
|
<record model="ir.ui.view" id="view_partner_tree_sector"> |
||||
|
<field name="name">Partner tree with sector</field> |
||||
|
<field name="model">res.partner</field> |
||||
|
<field name="inherit_id" ref="base.view_partner_tree"/> |
||||
|
<field name="arch" type="xml"> |
||||
|
<field name="email" position="after"> |
||||
|
<field name="sector_id" |
||||
|
attrs="{'invisible': [('is_company', '=', False)]}"/> |
||||
|
</field> |
||||
</field> |
</field> |
||||
</field> |
|
||||
</record> |
|
||||
|
</record> |
||||
|
|
||||
<record model="ir.ui.view" id="view_res_partner_filter_sector"> |
|
||||
<field name="name">Partner search with sector</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="sector_id" |
|
||||
string="Sector" |
|
||||
filter_domain="['|',('sector_id','ilike',self), |
|
||||
('secondary_sector_ids','ilike',self)]"/> |
|
||||
|
<record model="ir.ui.view" id="view_res_partner_filter_sector"> |
||||
|
<field name="name">Partner search with sector</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="sector_id" |
||||
|
string="Sector" |
||||
|
filter_domain="['|',('sector_id','ilike',self), |
||||
|
('secondary_sector_ids','ilike',self)]"/> |
||||
|
</field> |
||||
|
<filter name="salesperson" position="after"> |
||||
|
<filter name="sector" |
||||
|
string="Sector" |
||||
|
domain="[('is_company','=', True)]" |
||||
|
context="{'group_by': 'sector_id'}"/> |
||||
|
</filter> |
||||
</field> |
</field> |
||||
<filter string="Salesperson" position="after"> |
|
||||
<filter string="Sector" |
|
||||
domain="[('is_company','=', True)]" |
|
||||
context="{'group_by': 'sector_id'}"/> |
|
||||
</filter> |
|
||||
</field> |
|
||||
</record> |
|
||||
|
</record> |
||||
|
|
||||
</data> |
|
||||
</openerp> |
|
||||
|
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue