update app

This commit is contained in:
ivan deng
2020-05-10 00:43:31 +08:00
parent 26aaf73142
commit 304f8faff2
3 changed files with 41 additions and 5 deletions

View File

@@ -1,5 +1,17 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<odoo> <odoo>
<record id="app_view_company_tree" model="ir.ui.view">
<field name="name">app.res.company.tree</field>
<field name="model">res.company</field>
<field name="inherit_id" ref="base.view_company_tree"/>
<field name="arch" type="xml">
<xpath expr="//tree" position="inside">
<field name="parent_id"/>
</xpath>
</field>
</record>
<record id="app_view_company_form" model="ir.ui.view"> <record id="app_view_company_form" model="ir.ui.view">
<field name="name">app.res.company.form</field> <field name="name">app.res.company.form</field>
<field name="model">res.company</field> <field name="model">res.company</field>

View File

@@ -17,7 +17,7 @@
{ {
'name': "App Product category ztree, parent children tree", 'name': "App Product category ztree, parent children tree",
'version': '13.19.09.18', 'version': '13.20.05.03',
'author': 'Sunpop.cn', 'author': 'Sunpop.cn',
'category': 'Base', 'category': 'Base',
'website': 'https://www.sunpop.cn', 'website': 'https://www.sunpop.cn',

View File

@@ -1,6 +1,18 @@
<odoo> <odoo>
<data> <data>
<!-- Product --> <!-- Product template -->
<record id="app_product_template_tree_view" model="ir.ui.view">
<field name="name">app.product.template.tree</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_tree_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='categ_id']" position="attributes">
<!-- Add your fields or attributes here -->
<attribute name="widget">ztree_select</attribute>
<attribute name="options">{'ztree_parent_key': 'parent_id','ztree_expend_level': '2', 'ztree_name_field': 'name', 'order': 'name' }</attribute>
</xpath>
</field>
</record>
<record id="app_product_template_form_view" model="ir.ui.view"> <record id="app_product_template_form_view" model="ir.ui.view">
<field name="name">app.product.template.form</field> <field name="name">app.product.template.form</field>
<field name="model">product.template</field> <field name="model">product.template</field>
@@ -9,7 +21,20 @@
<xpath expr="//field[@name='categ_id']" position="attributes"> <xpath expr="//field[@name='categ_id']" position="attributes">
<!-- Add your fields or attributes here --> <!-- Add your fields or attributes here -->
<attribute name="widget">ztree_select</attribute> <attribute name="widget">ztree_select</attribute>
<attribute name="options">{'ztree_parent_key': 'parent_id','ztree_expend_level': '1', 'ztree_name_field': 'name', 'order': 'name' }</attribute> <attribute name="options">{'ztree_parent_key': 'parent_id','ztree_expend_level': '2', 'ztree_name_field': 'name', 'order': 'name' }</attribute>
</xpath>
</field>
</record>
<!-- Product product -->
<record id="app_product_product_tree_view" model="ir.ui.view">
<field name="name">app.product.product.tree</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_product_tree_view"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='categ_id']" position="attributes">
<!-- Add your fields or attributes here -->
<attribute name="widget">ztree_select</attribute>
<attribute name="options">{'ztree_parent_key': 'parent_id','ztree_expend_level': '2', 'ztree_name_field': 'name', 'order': 'name' }</attribute>
</xpath> </xpath>
</field> </field>
</record> </record>
@@ -21,9 +46,8 @@
<xpath expr="//field[@name='parent_id']" position="attributes"> <xpath expr="//field[@name='parent_id']" position="attributes">
<!-- Add your fields or attributes here --> <!-- Add your fields or attributes here -->
<attribute name="widget">ztree_select</attribute> <attribute name="widget">ztree_select</attribute>
<attribute name="options">{'ztree_parent_key': 'parent_id','ztree_expend_level': '1', 'order': 'name' }</attribute> <attribute name="options">{'ztree_parent_key': 'parent_id','ztree_expend_level': '2', 'order': 'name' }</attribute>
</xpath> </xpath>
</field> </field>
</record> </record>
</data> </data>