[IMP] base_custom_info: Make backend UI work
# Conflicts: # base_custom_info/i18n/es.popull/1115/head
-
23base_custom_info/README.rst
-
4base_custom_info/__manifest__.py
-
2base_custom_info/demo/custom.info.category.csv
-
575base_custom_info/i18n/es.po
-
0base_custom_info/images/customizations-everywhere.jpg
-
0base_custom_info/images/templateception.jpg
-
122base_custom_info/models/custom_info.py
-
3base_custom_info/models/custom_info_option.py
-
14base_custom_info/models/custom_info_property.py
-
71base_custom_info/models/custom_info_template.py
-
169base_custom_info/models/custom_info_value.py
-
9base_custom_info/models/res_partner.py
-
BINbase_custom_info/static/description/icon.png
-
60base_custom_info/static/description/icon.svg
-
25base_custom_info/tests/test_partner.py
-
83base_custom_info/views/custom_info_category_view.xml
-
113base_custom_info/views/custom_info_option_view.xml
-
169base_custom_info/views/custom_info_property_view.xml
-
124base_custom_info/views/custom_info_template_view.xml
-
185base_custom_info/views/custom_info_value_view.xml
-
72base_custom_info/views/menu.xml
-
52base_custom_info/views/res_partner_view.xml
@ -1,3 +1,3 @@ |
|||
id,name,sequence |
|||
cat_statics,Statics,50 |
|||
cat_statics,Statistics,50 |
|||
cat_gaming,Gaming,100 |
Before Width: 500 | Height: 380 | Size: 120 KiB After Width: 500 | Height: 380 | Size: 120 KiB |
Before Width: 318 | Height: 240 | Size: 57 KiB After Width: 318 | Height: 240 | Size: 57 KiB |
Before Width: 200 | Height: 200 | Size: 5.2 KiB After Width: 128 | Height: 128 | Size: 4.0 KiB |
@ -1,54 +1,79 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<!-- Copyright 2016 Jairo Llopis <jairo.llopis@tecnativa.com> |
|||
Copyright 2017 Pedro M. Baeza <pedro.baeza@tecnativa.com> |
|||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). --> |
|||
<odoo> |
|||
|
|||
<record id="custom_info_option_tree" model="ir.ui.view"> |
|||
<field name="name">Custom Info Option Tree</field> |
|||
<field name="model">custom.info.option</field> |
|||
<field name="arch" type="xml"> |
|||
<tree string="Custom Info Options"> |
|||
<field name="name"/> |
|||
<field name="template_id"/> |
|||
<field name="property_ids"/> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
<record id="custom_info_option_tree" model="ir.ui.view"> |
|||
<field name="model">custom.info.option</field> |
|||
<field name="priority" eval="999"/> |
|||
<field name="arch" type="xml"> |
|||
<tree string="Custom Info Options" editable="bottom"> |
|||
<field name="name"/> |
|||
<!-- Hidden for now from backend UI --> |
|||
<field name="template_id" invisible="1"/> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="custom_info_option_form" model="ir.ui.view"> |
|||
<field name="name">Custom Info Option Form</field> |
|||
<field name="model">custom.info.option</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Custom Info Template Properties"> |
|||
<sheet> |
|||
<group> |
|||
<field name="name"/> |
|||
<field name="template_id"/> |
|||
<field name="property_ids"/> |
|||
<field name="value_ids"/> |
|||
</group> |
|||
</sheet> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
<record id="custom_info_option_tree_full" model="ir.ui.view"> |
|||
<field name="model">custom.info.option</field> |
|||
<field name="inherit_id" ref="custom_info_option_tree"/> |
|||
<field name="mode">primary</field> |
|||
<field name="arch" type="xml"> |
|||
<tree position="attributes"> |
|||
<attribute name="editable"/> |
|||
</tree> |
|||
<field name="name" position="before"> |
|||
<field name="property_ids" widget="many2many_tags"/> |
|||
</field> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="custom_info_option_search" model="ir.ui.view"> |
|||
<field name="name">Custom Info Option Search</field> |
|||
<field name="model">custom.info.option</field> |
|||
<field name="arch" type="xml"> |
|||
<search> |
|||
<field name="name"/> |
|||
<field name="property_ids"/> |
|||
</search> |
|||
</field> |
|||
</record> |
|||
<record id="custom_info_option_form" model="ir.ui.view"> |
|||
<field name="model">custom.info.option</field> |
|||
<field name="priority" eval="999"/> |
|||
<field name="arch" type="xml"> |
|||
<form string="Custom Info Template Properties"> |
|||
<sheet> |
|||
<group> |
|||
<field name="name"/> |
|||
<!-- Hidden for now from backend UI --> |
|||
<field name="template_id" invisible="1"/> |
|||
</group> |
|||
</sheet> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="custom_info_option_action" model="ir.actions.act_window"> |
|||
<field name="name">Options</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">custom.info.option</field> |
|||
<field name="view_mode">tree,form</field> |
|||
<field name="view_type">form</field> |
|||
</record> |
|||
<record id="custom_info_option_form_full" model="ir.ui.view"> |
|||
<field name="model">custom.info.option</field> |
|||
<field name="inherit_id" ref="custom_info_option_form"/> |
|||
<field name="mode">primary</field> |
|||
<field name="arch" type="xml"> |
|||
<field name="template_id" position="after"> |
|||
<field name="property_ids"/> |
|||
<field name="value_ids"/> |
|||
</field> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="custom_info_option_search" model="ir.ui.view"> |
|||
<field name="model">custom.info.option</field> |
|||
<field name="arch" type="xml"> |
|||
<search> |
|||
<field name="name"/> |
|||
<field name="property_ids"/> |
|||
</search> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="custom_info_option_action" model="ir.actions.act_window"> |
|||
<field name="name">Options</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">custom.info.option</field> |
|||
<field name="view_mode">tree,form</field> |
|||
<field name="view_type">form</field> |
|||
</record> |
|||
|
|||
</odoo> |
@ -1,84 +1,105 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<!-- Copyright 2016 Jairo Llopis <jairo.llopis@tecnativa.com> |
|||
Copyright 2017 Pedro M. Baeza <pedro.baeza@tecnativa.com> |
|||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). --> |
|||
<odoo> |
|||
|
|||
<record id="custom_info_property_tree" model="ir.ui.view"> |
|||
<field name="name">Custom Info Property Tree</field> |
|||
<field name="model">custom.info.property</field> |
|||
<field name="arch" type="xml"> |
|||
<tree string="Custom Info Properties"> |
|||
<field name="sequence" widget="handle"/> |
|||
<field name="name"/> |
|||
<field name="template_id" invisible="context.get('embed')"/> |
|||
<field name="field_type"/> |
|||
<field name="category_id"/> |
|||
<field name="required"/> |
|||
<field name="default_value"/> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
<record id="custom_info_property_tree" model="ir.ui.view"> |
|||
<field name="model">custom.info.property</field> |
|||
<field name="priority" eval="999"/> |
|||
<field name="arch" type="xml"> |
|||
<tree string="Custom Info Properties"> |
|||
<field name="sequence" widget="handle"/> |
|||
<field name="name"/> |
|||
<field name="field_type"/> |
|||
<field name="category_id"/> |
|||
<field name="required"/> |
|||
<field name="default_value"/> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="custom_info_property_form" model="ir.ui.view"> |
|||
<field name="name">Custom Info Property Form</field> |
|||
<field name="model">custom.info.property</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Custom Info Template Properties"> |
|||
<sheet> |
|||
<group> |
|||
<field name="name"/> |
|||
<field name="template_id" |
|||
invisible="context.get('embed')"/> |
|||
<field name="field_type"/> |
|||
<field name="category_id"/> |
|||
<field name="required"/> |
|||
<field name="default_value"/> |
|||
<field name="minimum" |
|||
attrs="{'invisible': [('field_type', 'not in', ['str', 'int', 'float'])]}"/> |
|||
<field name="maximum" |
|||
attrs="{'invisible': [('field_type', 'not in', ['str', 'int', 'float'])]}"/> |
|||
</group> |
|||
<group> |
|||
<field name="info_value_ids" |
|||
invisible="context.get('embed')"/> |
|||
<field |
|||
name="option_ids" |
|||
attrs="{'invisible': [('field_type', '!=', 'id')]}"/> |
|||
</group> |
|||
</sheet> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
<record id="custom_info_property_tree_full" model="ir.ui.view"> |
|||
<field name="model">custom.info.property</field> |
|||
<field name="inherit_id" ref="custom_info_property_tree"/> |
|||
<field name="mode">primary</field> |
|||
<field name="arch" type="xml"> |
|||
<field name="name" position="after"> |
|||
<field name="template_id"/> |
|||
</field> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="custom_info_property_form" model="ir.ui.view"> |
|||
<field name="model">custom.info.property</field> |
|||
<field name="priority" eval="999"/> |
|||
<field name="arch" type="xml"> |
|||
<form string="Custom Info Template Properties"> |
|||
<sheet> |
|||
<group> |
|||
<field name="name"/> |
|||
<field name="field_type"/> |
|||
<field name="category_id"/> |
|||
<field name="required"/> |
|||
<field name="default_value"/> |
|||
<field name="minimum" |
|||
attrs="{'invisible': [('field_type', 'not in', ['str', 'int', 'float'])]}" |
|||
/> |
|||
<field name="maximum" |
|||
attrs="{'invisible': [('field_type', 'not in', ['str', 'int', 'float'])]}" |
|||
/> |
|||
</group> |
|||
<group string="Options" col="1" attrs="{'invisible': [('field_type', '!=', 'id')]}"> |
|||
<label string="Select one of the existing options or create a new one clicking on 'Add an item'"/> |
|||
<field name="option_ids" |
|||
nolabel="1" |
|||
context="{'form_view_ref': 'base_custom_info.custom_info_option_form', 'tree_view_ref': 'base_custom_info.custom_info_option_tree'}" |
|||
/> |
|||
</group> |
|||
</sheet> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="custom_info_property_search" model="ir.ui.view"> |
|||
<field name="name">Custom Info Property Search</field> |
|||
<field name="model">custom.info.property</field> |
|||
<field name="arch" type="xml"> |
|||
<search> |
|||
<field name="name"/> |
|||
<field name="template_id"/> |
|||
<field name="field_type"/> |
|||
<field name="category_id"/> |
|||
<field name="required"/> |
|||
<field name="default_value"/> |
|||
<group expand="0" string="Group By"> |
|||
<filter |
|||
string="Template" |
|||
context="{'group_by': 'template_id'}"/> |
|||
<filter |
|||
string="Category" |
|||
context="{'group_by': 'category_id'}"/> |
|||
</group> |
|||
</search> |
|||
</field> |
|||
</record> |
|||
<record id="custom_info_property_form_full" model="ir.ui.view"> |
|||
<field name="model">custom.info.property</field> |
|||
<field name="inherit_id" ref="custom_info_property_form"/> |
|||
<field name="mode">primary</field> |
|||
<field name="arch" type="xml"> |
|||
<field name="name" position="after"> |
|||
<field name="template_id"/> |
|||
</field> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="custom_info_property_search" model="ir.ui.view"> |
|||
<field name="model">custom.info.property</field> |
|||
<field name="arch" type="xml"> |
|||
<search> |
|||
<field name="name"/> |
|||
<field name="template_id"/> |
|||
<field name="field_type"/> |
|||
<field name="category_id"/> |
|||
<field name="required"/> |
|||
<field name="default_value"/> |
|||
<group expand="0" string="Group By"> |
|||
<filter |
|||
string="Template" |
|||
context="{'group_by': 'template_id'}"/> |
|||
<filter |
|||
string="Category" |
|||
context="{'group_by': 'category_id'}"/> |
|||
</group> |
|||
</search> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="custom_info_property_action" model="ir.actions.act_window"> |
|||
<field name="name">Properties</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">custom.info.property</field> |
|||
<field name="view_mode">tree,form</field> |
|||
<field name="view_type">form</field> |
|||
</record> |
|||
<record id="custom_info_property_action" model="ir.actions.act_window"> |
|||
<field name="name">Properties</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">custom.info.property</field> |
|||
<field name="view_mode">tree,form</field> |
|||
<field name="view_type">form</field> |
|||
</record> |
|||
|
|||
</odoo> |
@ -1,72 +1,72 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<!-- Copyright 2016 Jairo Llopis <jairo.llopis@tecnativa.com> |
|||
Copyright 2017 Pedro M. Baeza <pedro.baeza@tecnativa.com> |
|||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). --> |
|||
<odoo> |
|||
|
|||
<record id="base_custom_info_template_tree" model="ir.ui.view"> |
|||
<field name="name">Custom Info Template Tree</field> |
|||
<field name="model">custom.info.template</field> |
|||
<field name="arch" type="xml"> |
|||
<tree string="Custom Info Templates"> |
|||
<field name="name"/> |
|||
<field name="model"/> |
|||
<field name="model_id"/> |
|||
<field name="property_ids"/> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
<record id="custom_info_template_tree" model="ir.ui.view"> |
|||
<field name="model">custom.info.template</field> |
|||
<field name="arch" type="xml"> |
|||
<tree string="Custom Info Templates"> |
|||
<field name="name"/> |
|||
<field name="model"/> |
|||
<field name="model_id"/> |
|||
<field name="property_ids"/> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="base_custom_info_template_form" model="ir.ui.view"> |
|||
<field name="name">Custom Info Template Form</field> |
|||
<field name="model">custom.info.template</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Custom Info Template"> |
|||
<sheet> |
|||
<group> |
|||
<field name="name"/> |
|||
<field name="model"/> |
|||
<field name="model_id"/> |
|||
</group> |
|||
<group> |
|||
<field name="property_ids"/> |
|||
</group> |
|||
</sheet> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
<record id="custom_info_template_form" model="ir.ui.view"> |
|||
<field name="model">custom.info.template</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Custom Info Template"> |
|||
<sheet> |
|||
<group> |
|||
<field name="name"/> |
|||
<field name="model"/> |
|||
<field name="model_id"/> |
|||
</group> |
|||
<group string="Properties"> |
|||
<field name="property_ids" |
|||
nolabel="1" |
|||
context="{'form_view_ref': 'base_custom_info.custom_info_property_form', 'tree_view_ref': 'base_custom_info.custom_info_property_tree'}" |
|||
/> |
|||
</group> |
|||
</sheet> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="base_custom_info_template_search" model="ir.ui.view"> |
|||
<field name="name">Custom Info Template Search</field> |
|||
<field name="model">custom.info.template</field> |
|||
<field name="arch" type="xml"> |
|||
<search> |
|||
<field name="name"/> |
|||
<field name="model_id"/> |
|||
<field name="property_ids"/> |
|||
<group expand="0" string="Group By"> |
|||
<filter |
|||
string="Model" |
|||
context="{'group_by': 'model_id'}"/> |
|||
</group> |
|||
</search> |
|||
</field> |
|||
</record> |
|||
<record id="custom_info_template_search" model="ir.ui.view"> |
|||
<field name="model">custom.info.template</field> |
|||
<field name="arch" type="xml"> |
|||
<search> |
|||
<field name="name"/> |
|||
<field name="model_id"/> |
|||
<field name="property_ids"/> |
|||
<group expand="0" string="Group By"> |
|||
<filter string="Model" context="{'group_by': 'model_id'}"/> |
|||
</group> |
|||
</search> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="custom_info_template_action" model="ir.actions.act_window"> |
|||
<field name="name">Templates</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">custom.info.template</field> |
|||
<field name="view_mode">tree,form</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_id" eval="False"/> <!-- Force empty --> |
|||
<field name="domain" eval="False"/> <!-- Force empty --> |
|||
<field name="help" type="html"> |
|||
<p class="oe_view_nocontent_create"> |
|||
Click to define a new custom info template. |
|||
</p><p> |
|||
You must define a custom info template for each properties group. |
|||
</p> |
|||
</field> |
|||
</record> |
|||
<record id="custom_info_template_action" model="ir.actions.act_window"> |
|||
<field name="name">Templates</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">custom.info.template</field> |
|||
<field name="view_mode">tree,form</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_id" eval="False"/> <!-- Force empty --> |
|||
<field name="domain" eval="False"/> <!-- Force empty --> |
|||
<field name="help" type="html"> |
|||
<p class="oe_view_nocontent_create"> |
|||
Click to define a new custom info template. |
|||
</p> |
|||
<p> |
|||
You must define a custom info template for each properties group. |
|||
</p> |
|||
</field> |
|||
</record> |
|||
|
|||
</odoo> |
@ -1,93 +1,112 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<!-- Copyright 2016 Jairo Llopis <jairo.llopis@tecnativa.com> |
|||
Copyright 2017 Pedro M. Baeza <pedro.baeza@tecnativa.com> |
|||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). --> |
|||
<odoo> |
|||
|
|||
<record id="base_custom_info_value_tree" model="ir.ui.view"> |
|||
<field name="name">Custom Info Value Tree</field> |
|||
<field name="model">custom.info.value</field> |
|||
<field name="arch" type="xml"> |
|||
<tree string="Custom Property Values" create="0" delete="0"> |
|||
<field name="owner_id" invisible="context.get('embed')"/> |
|||
<field name="category_id"/> |
|||
<field name="property_id"/> |
|||
<field name="value"/> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
<record id="custom_info_value_tree" model="ir.ui.view"> |
|||
<field name="model">custom.info.value</field> |
|||
<field name="arch" type="xml"> |
|||
<tree string="Custom Property Values" create="0" delete="0"> |
|||
<field name="owner_id" invisible="context.get('embed')"/> |
|||
<field name="property_id"/> |
|||
<field name="category_id"/> |
|||
<field name="required" invisible="1"/> |
|||
<field name="value" |
|||
attrs="{'required': [('required', '=', True)]}" |
|||
/> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="base_custom_info_value_form" model="ir.ui.view"> |
|||
<field name="name">Custom Info Value Form</field> |
|||
<field name="model">custom.info.value</field> |
|||
<field name="arch" type="xml"> |
|||
<form> |
|||
<sheet> |
|||
<group name="metadata"> |
|||
<field name="owner_id" invisible="context.get('embed')"/> |
|||
<field name="category_id"/> |
|||
<field name="property_id" readonly="context.get('embed')"/> |
|||
<field name="field_type" readonly="True"/> |
|||
<field name="required" readonly="True"/> |
|||
</group> |
|||
<group name="value"> |
|||
<field |
|||
name="value_str" |
|||
attrs="{'invisible': [('field_type', '!=', 'str')], 'required': [('required', '=', True), ('field_type', '=', 'str')]}"/> |
|||
<field |
|||
name="value_int" |
|||
attrs="{'invisible': [('field_type', '!=', 'int')], 'required': [('required', '=', True), ('field_type', '=', 'int')]}"/> |
|||
<field |
|||
name="value_float" |
|||
attrs="{'invisible': [('field_type', '!=', 'float')], 'required': [('required', '=', True), ('field_type', '=', 'float')]}"/> |
|||
<field |
|||
name="value_bool" |
|||
attrs="{'invisible': [('field_type', '!=', 'bool')], 'required': [('required', '=', True), ('field_type', '=', 'bool')]}"/> |
|||
<field |
|||
name="value_id" |
|||
widget="selection" |
|||
attrs="{'invisible': [('field_type', '!=', 'id')], 'required': [('required', '=', True), ('field_type', '=', 'id')]}"/> |
|||
</group> |
|||
<div invisible="context.get('embed')" |
|||
class="alert alert-warning"> |
|||
<strong>Warning!</strong> |
|||
You might see no changes in parent form until you save it. |
|||
</div> |
|||
</sheet> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
<record id="custom_info_value_tree_editable" model="ir.ui.view"> |
|||
<field name="model">custom.info.value</field> |
|||
<field name="priority" eval="999"/> |
|||
<field name="mode">primary</field> |
|||
<field name="inherit_id" ref="custom_info_value_tree"/> |
|||
<field name="arch" type="xml"> |
|||
<tree position="attributes"> |
|||
<attribute name="editable">bottom</attribute> |
|||
</tree> |
|||
<field name="value" position="after"> |
|||
<field name="field_type" invisible="1"/> |
|||
<field name="value_id" |
|||
widget="selection" |
|||
attrs="{'invisible': [('field_type', '!=', 'id')], 'required': [('required', '=', True), ('field_type', '=', 'id')]}" |
|||
/> |
|||
</field> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="base_custom_info_value_search" model="ir.ui.view"> |
|||
<field name="name">Custom Info Value Search</field> |
|||
<field name="model">custom.info.value</field> |
|||
<field name="arch" type="xml"> |
|||
<search> |
|||
<field name="model"/> |
|||
<field name="res_id"/> |
|||
<field name="category_id"/> |
|||
<field name="property_id"/> |
|||
<field name="value"/> |
|||
<group expand="0" string="Group By"> |
|||
<filter |
|||
string="Owner" |
|||
context="{'group_by': ['model' , 'res_id']}"/> |
|||
<filter |
|||
string="Category" |
|||
context="{'group_by': 'category_id'}"/> |
|||
<filter |
|||
string="Property" |
|||
context="{'group_by': 'property_id'}"/> |
|||
</group> |
|||
</search> |
|||
</field> |
|||
</record> |
|||
<record id="custom_info_value_form" model="ir.ui.view"> |
|||
<field name="model">custom.info.value</field> |
|||
<field name="arch" type="xml"> |
|||
<form> |
|||
<sheet> |
|||
<group name="metadata"> |
|||
<field name="owner_id" invisible="context.get('embed')"/> |
|||
<field name="property_id" readonly="context.get('embed')"/> |
|||
<field name="category_id"/> |
|||
<field name="field_type" readonly="True"/> |
|||
<field name="required" readonly="True"/> |
|||
</group> |
|||
<group name="value"> |
|||
<field name="value_str" |
|||
attrs="{'invisible': [('field_type', '!=', 'str')], 'required': [('required', '=', True), ('field_type', '=', 'str')]}" |
|||
/> |
|||
<field name="value_int" |
|||
attrs="{'invisible': [('field_type', '!=', 'int')], 'required': [('required', '=', True), ('field_type', '=', 'int')]}" |
|||
/> |
|||
<field name="value_float" |
|||
attrs="{'invisible': [('field_type', '!=', 'float')], 'required': [('required', '=', True), ('field_type', '=', 'float')]}" |
|||
/> |
|||
<field name="value_bool" |
|||
attrs="{'invisible': [('field_type', '!=', 'bool')], 'required': [('required', '=', True), ('field_type', '=', 'bool')]}" |
|||
/> |
|||
<field name="value_id" |
|||
widget="selection" |
|||
attrs="{'invisible': [('field_type', '!=', 'id')], 'required': [('required', '=', True), ('field_type', '=', 'id')]}" |
|||
/> |
|||
</group> |
|||
<div class="alert alert-warning" invisible="not context.get('embed')"> |
|||
<strong>Warning!</strong> |
|||
You might see no changes in parent form until you save it. |
|||
</div> |
|||
</sheet> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="custom_info_value_search" model="ir.ui.view"> |
|||
<field name="model">custom.info.value</field> |
|||
<field name="arch" type="xml"> |
|||
<search> |
|||
<field name="model"/> |
|||
<field name="res_id"/> |
|||
<field name="category_id"/> |
|||
<field name="property_id"/> |
|||
<field name="value"/> |
|||
<group expand="0" string="Group By"> |
|||
<filter |
|||
string="Owner" |
|||
context="{'group_by': ['model' , 'res_id']}"/> |
|||
<filter |
|||
string="Category" |
|||
context="{'group_by': 'category_id'}"/> |
|||
<filter |
|||
string="Property" |
|||
context="{'group_by': 'property_id'}"/> |
|||
</group> |
|||
</search> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="custom_info_value_action" model="ir.actions.act_window"> |
|||
<field name="name">Values</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">custom.info.value</field> |
|||
<field name="view_mode">tree,form</field> |
|||
<field name="view_type">form</field> |
|||
</record> |
|||
<record id="custom_info_value_action" model="ir.actions.act_window"> |
|||
<field name="name">Values</field> |
|||
<field name="type">ir.actions.act_window</field> |
|||
<field name="res_model">custom.info.value</field> |
|||
<field name="view_mode">tree,form</field> |
|||
<field name="view_type">form</field> |
|||
</record> |
|||
|
|||
</odoo> |
@ -1,41 +1,45 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<!-- Copyright 2016 Jairo Llopis <jairo.llopis@tecnativa.com> |
|||
Copyright 2017 Pedro M. Baeza <pedro.baeza@tecnativa.com> |
|||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). --> |
|||
<odoo> |
|||
|
|||
<!--Base menus --> |
|||
<menuitem id="menu_base_custom_info" name="Custom Info" |
|||
groups="base_custom_info.group_basic"/> |
|||
|
|||
<menuitem |
|||
id="menu_basic" |
|||
name="Basic" |
|||
parent="menu_base_custom_info"/> |
|||
|
|||
<menuitem |
|||
id="menu_advanced" |
|||
name="Advanced" |
|||
groups="base_custom_info.group_basic" |
|||
parent="menu_base_custom_info"/> |
|||
|
|||
<menuitem id="menu_base_custom_info_template" |
|||
action="custom_info_template_action" |
|||
parent="menu_basic" sequence="10"/> |
|||
|
|||
<menuitem id="menu_base_custom_info_value" |
|||
action="custom_info_value_action" |
|||
parent="menu_basic" sequence="20"/> |
|||
|
|||
<menuitem id="menu_category" |
|||
action="custom_info_category_action" |
|||
parent="menu_advanced" sequence="10"/> |
|||
|
|||
<menuitem id="menu_property" |
|||
action="custom_info_property_action" |
|||
parent="menu_advanced" sequence="20"/> |
|||
|
|||
<menuitem id="menu_option" |
|||
action="custom_info_option_action" |
|||
parent="menu_advanced" sequence="30"/> |
|||
<!--Base menus --> |
|||
<menuitem id="menu_base_custom_info" |
|||
name="Custom Info" |
|||
groups="base_custom_info.group_basic" |
|||
web_icon="base_custom_info,static/description/icon.png" |
|||
/> |
|||
|
|||
<menuitem |
|||
id="menu_basic" |
|||
name="Basic" |
|||
parent="menu_base_custom_info"/> |
|||
|
|||
<menuitem |
|||
id="menu_advanced" |
|||
name="Advanced" |
|||
groups="base_custom_info.group_basic" |
|||
parent="menu_base_custom_info"/> |
|||
|
|||
<menuitem id="menu_base_custom_info_template" |
|||
action="custom_info_template_action" |
|||
parent="menu_basic" sequence="10"/> |
|||
|
|||
<menuitem id="menu_base_custom_info_value" |
|||
action="custom_info_value_action" |
|||
parent="menu_basic" sequence="20"/> |
|||
|
|||
<menuitem id="menu_category" |
|||
action="custom_info_category_action" |
|||
parent="menu_advanced" sequence="10"/> |
|||
|
|||
<menuitem id="menu_property" |
|||
action="custom_info_property_action" |
|||
parent="menu_advanced" sequence="20"/> |
|||
|
|||
<menuitem id="menu_option" |
|||
action="custom_info_option_action" |
|||
parent="menu_advanced" sequence="30"/> |
|||
|
|||
</odoo> |
@ -1,38 +1,32 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<!-- Copyright 2016 Jairo Llopis <jairo.llopis@tecnativa.com> |
|||
Copyright 2017 Pedro M. Baeza <pedro.baeza@tecnativa.com> |
|||
License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). --> |
|||
<odoo> |
|||
|
|||
<record id="view_partner_form" model="ir.ui.view"> |
|||
<field name="name">Custom info in partners form</field> |
|||
<field name="model">res.partner</field> |
|||
<field name="inherit_id" ref="base.view_partner_form"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//notebook[1]"> |
|||
<page name="custom_info" |
|||
string="Custom Information" |
|||
groups="base_custom_info.group_partner"> |
|||
<group> |
|||
<record id="view_partner_form" model="ir.ui.view"> |
|||
<field name="model">res.partner</field> |
|||
<field name="inherit_id" ref="base.view_partner_form"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//notebook[1]"> |
|||
<page name="custom_info" |
|||
string="Custom Information" |
|||
groups="base_custom_info.group_partner"> |
|||
<group> |
|||
<field name="dirty_templates" invisible="True"/> |
|||
<field |
|||
name="custom_info_template_id" |
|||
options='{"no_quick_create": True}'/> |
|||
<group> |
|||
<field name="custom_info_template_id" |
|||
options='{"no_quick_create": True}' |
|||
/> |
|||
</group> |
|||
<field name="custom_info_ids" |
|||
colspan="4" |
|||
nolabel="1" |
|||
context="{'embed': True, 'tree_view_ref': 'base_custom_info.custom_info_value_tree_editable'}" |
|||
/> |
|||
</group> |
|||
<group> |
|||
<button |
|||
string="Reload custom information templates" |
|||
type="object" |
|||
name="action_custom_info_templates_fill" |
|||
attrs="{'invisible': [('dirty_templates', '=', False)]}"/> |
|||
</group> |
|||
<group colspan="2"> |
|||
<field name="custom_info_ids"/> |
|||
</group> |
|||
</group> |
|||
</page> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
</page> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
|
|||
</odoo> |