Radovan Skolnik
4 years ago
committed by
Jesus Ramoneda
7 changed files with 157 additions and 168 deletions
-
11base_import_match/__manifest__.py
-
21base_import_match/data/base_import_match.xml
-
51base_import_match/demo/base_import_match.xml
-
12base_import_match/models/base.py
-
39base_import_match/models/base_import.py
-
26base_import_match/tests/test_import.py
-
71base_import_match/views/base_import_match_view.xml
@ -1,33 +1,30 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<?xml version="1.0" encoding="utf-8" ?> |
|||
<!-- Copyright 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis |
|||
Copyright 2016 Tecnativa - Vicent Cubells |
|||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). --> |
|||
|
|||
<odoo noupdate="1"> |
|||
<!-- Match partners by VAT when is_company is True --> |
|||
<record model="base_import.match" id="res_partner_vat"> |
|||
<field name="model_id" eval="ref('base.model_res_partner')"/> |
|||
<field name="model_id" eval="ref('base.model_res_partner')" /> |
|||
<field name="sequence" type="int">10</field> |
|||
</record> |
|||
<record model="base_import.match.field" id="res_partner_vat_vat"> |
|||
<field name="match_id" ref="base_import_match.res_partner_vat"/> |
|||
<field name="field_id" ref="base.field_res_partner__vat"/> |
|||
<field name="match_id" ref="base_import_match.res_partner_vat" /> |
|||
<field name="field_id" ref="base.field_res_partner__vat" /> |
|||
</record> |
|||
<record model="base_import.match.field" id="res_partner_vat_is_company"> |
|||
<field name="match_id" ref="base_import_match.res_partner_vat"/> |
|||
<field name="field_id" ref="base.field_res_partner__is_company"/> |
|||
<field name="match_id" ref="base_import_match.res_partner_vat" /> |
|||
<field name="field_id" ref="base.field_res_partner__is_company" /> |
|||
<field name="conditional">True</field> |
|||
<field name="imported_value">True</field> |
|||
</record> |
|||
|
|||
<!-- Match users by login --> |
|||
<record model="base_import.match" id="res_users_login"> |
|||
<field name="model_id" eval="ref('base.model_res_users')"/> |
|||
<field name="model_id" eval="ref('base.model_res_users')" /> |
|||
<field name="sequence" type="int">50</field> |
|||
</record> |
|||
<record model="base_import.match.field" id="res_users_login_login"> |
|||
<field name="match_id" ref="base_import_match.res_users_login"/> |
|||
<field name="field_id" ref="base.field_res_users__login"/> |
|||
<field name="match_id" ref="base_import_match.res_users_login" /> |
|||
<field name="field_id" ref="base.field_res_users__login" /> |
|||
</record> |
|||
|
|||
</odoo> |
@ -1,45 +1,50 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<?xml version="1.0" encoding="utf-8" ?> |
|||
<!-- Copyright 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis |
|||
Copyright 2016 Tecnativa - Vicent Cubells |
|||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). --> |
|||
<odoo noupdate="1"> |
|||
|
|||
<!-- Match partners by name, parent_id and is_company --> |
|||
<record model="base_import.match" id="res_partner_parent_name_is_company"> |
|||
<field name="model_id" eval="ref('base.model_res_partner')"/> |
|||
<field name="model_id" eval="ref('base.model_res_partner')" /> |
|||
<field name="sequence" type="int">20</field> |
|||
</record> |
|||
<record model="base_import.match.field" id="res_partner_parent_name_is_company_name"> |
|||
<field name="match_id" ref="res_partner_parent_name_is_company"/> |
|||
<field name="field_id" ref="base.field_res_partner__name"/> |
|||
<record |
|||
model="base_import.match.field" |
|||
id="res_partner_parent_name_is_company_name" |
|||
> |
|||
<field name="match_id" ref="res_partner_parent_name_is_company" /> |
|||
<field name="field_id" ref="base.field_res_partner__name" /> |
|||
</record> |
|||
<record |
|||
model="base_import.match.field" |
|||
id="res_partner_parent_name_is_company_parent" |
|||
> |
|||
<field name="match_id" ref="res_partner_parent_name_is_company" /> |
|||
<field name="field_id" ref="base.field_res_partner__parent_id" /> |
|||
</record> |
|||
<record |
|||
model="base_import.match.field" |
|||
id="res_partner_parent_name_is_company_is_company" |
|||
> |
|||
<field name="match_id" ref="res_partner_parent_name_is_company" /> |
|||
<field name="field_id" ref="base.field_res_partner__is_company" /> |
|||
</record> |
|||
<record model="base_import.match.field" id="res_partner_parent_name_is_company_parent"> |
|||
<field name="match_id" ref="res_partner_parent_name_is_company"/> |
|||
<field name="field_id" ref="base.field_res_partner__parent_id"/> |
|||
</record> |
|||
<record model="base_import.match.field" id="res_partner_parent_name_is_company_is_company"> |
|||
<field name="match_id" ref="res_partner_parent_name_is_company"/> |
|||
<field name="field_id" ref="base.field_res_partner__is_company"/> |
|||
</record> |
|||
|
|||
<!-- Match partner by email --> |
|||
<record model="base_import.match" id="res_partner_email"> |
|||
<field name="model_id" eval="ref('base.model_res_partner')"/> |
|||
<field name="model_id" eval="ref('base.model_res_partner')" /> |
|||
<field name="sequence" type="int">30</field> |
|||
</record> |
|||
<record model="base_import.match.field" id="res_partner_email_email"> |
|||
<field name="match_id" ref="base_import_match.res_partner_email"/> |
|||
<field name="field_id" ref="base.field_res_partner__email"/> |
|||
<field name="match_id" ref="base_import_match.res_partner_email" /> |
|||
<field name="field_id" ref="base.field_res_partner__email" /> |
|||
</record> |
|||
|
|||
<!-- Match partner by name --> |
|||
<record model="base_import.match" id="res_partner_name"> |
|||
<field name="model_id" eval="ref('base.model_res_partner')"/> |
|||
<field name="model_id" eval="ref('base.model_res_partner')" /> |
|||
<field name="sequence" type="int">40</field> |
|||
</record> |
|||
<record model="base_import.match.field" id="res_partner_name_name"> |
|||
<field name="match_id" ref="base_import_match.res_partner_name"/> |
|||
<field name="field_id" ref="base.field_res_partner__name"/> |
|||
<field name="match_id" ref="base_import_match.res_partner_name" /> |
|||
<field name="field_id" ref="base.field_res_partner__name" /> |
|||
</record> |
|||
|
|||
</odoo> |
@ -1,81 +1,74 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<?xml version="1.0" encoding="utf-8" ?> |
|||
<!-- Copyright 2016 Grupo ESOC Ingeniería de Servicios, S.L.U. - Jairo Llopis |
|||
Copyright 2016 Tecnativa - Vicent Cubells |
|||
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). --> |
|||
|
|||
<odoo> |
|||
|
|||
<record id="match_form_view" model="ir.ui.view"> |
|||
<record id="match_form_view" model="ir.ui.view"> |
|||
<field name="name">Import match form view</field> |
|||
<field name="model">base_import.match</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Import Match"> |
|||
<sheet> |
|||
<h1> |
|||
<field name="name"/> |
|||
<field name="name" /> |
|||
</h1> |
|||
<group> |
|||
<field name="model_id"/> |
|||
<field name="model_id" /> |
|||
<field name="field_ids"> |
|||
<tree editable="bottom"> |
|||
<field name="field_id" |
|||
options="{'no_create': True}"/> |
|||
<field name="match_id" |
|||
<field name="field_id" options="{'no_create': True}" /> |
|||
<field |
|||
name="match_id" |
|||
invisible="True" |
|||
required="False"/> |
|||
<field name="model_id" invisible="True"/> |
|||
<field name="conditional"/> |
|||
required="False" |
|||
/> |
|||
<field name="model_id" invisible="True" /> |
|||
<field name="conditional" /> |
|||
<field |
|||
name="imported_value" |
|||
attrs="{ |
|||
'readonly': [ |
|||
('conditional', '=', False), |
|||
], |
|||
}"/> |
|||
}" |
|||
/> |
|||
</tree> |
|||
</field> |
|||
<field name="sequence"/> |
|||
<field name="sequence" /> |
|||
</group> |
|||
</sheet> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="match_tree_view" model="ir.ui.view"> |
|||
</record> |
|||
<record id="match_tree_view" model="ir.ui.view"> |
|||
<field name="name">Import match tree view</field> |
|||
<field name="model">base_import.match</field> |
|||
<field name="arch" type="xml"> |
|||
<tree string="Import Match"> |
|||
<field name="name"/> |
|||
<field name="sequence" invisible="True"/> |
|||
<field name="name" /> |
|||
<field name="sequence" invisible="True" /> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="match_search_view" model="ir.ui.view"> |
|||
</record> |
|||
<record id="match_search_view" model="ir.ui.view"> |
|||
<field name="name">Import match search view</field> |
|||
<field name="model">base_import.match</field> |
|||
<field name="arch" type="xml"> |
|||
<search string="Import Match"> |
|||
<field name="name"/> |
|||
<field name="model_id"/> |
|||
<field name="field_ids"/> |
|||
<separator/> |
|||
<field name="name" /> |
|||
<field name="model_id" /> |
|||
<field name="field_ids" /> |
|||
<separator /> |
|||
<group expand="0" string="Group By"> |
|||
<filter string="Model" context="{'group_by': 'model_id'}" name="model"/> |
|||
<filter |
|||
string="Model" |
|||
context="{'group_by': 'model_id'}" |
|||
name="model" |
|||
/> |
|||
</group> |
|||
</search> |
|||
</field> |
|||
</record> |
|||
|
|||
<act_window |
|||
name="Import Match" |
|||
res_model="base_import.match" |
|||
id="match_action"/> |
|||
|
|||
<menuitem |
|||
id="match_menu" |
|||
action="match_action" |
|||
parent="base.next_id_9"/> |
|||
|
|||
</record> |
|||
<act_window name="Import Match" res_model="base_import.match" id="match_action" /> |
|||
<menuitem id="match_menu" action="match_action" parent="base.next_id_9" /> |
|||
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue