Commits

Raimon Esteve (Zikzakmedia) committed c8115a5

Use separate XML files for views

Comments (0)

Files changed (7)

 include LICENSE
 include tryton.cfg
 include *.xml
+include view/*.xml
 include locale/*.po
 include doc/*
         ],
     package_data={
         'trytond.modules.project_employee': info.get('xml', []) \
-            + ['tryton.cfg', 'locale/*.po'],
+            + ['tryton.cfg', 'view/*.xml', 'locale/*.po'],
         },
     classifiers=[
         'Development Status :: 5 - Production/Stable',

view/work_form.xml

+<?xml version="1.0"?>
+<!-- This file is part project_employee module for Tryton.
+The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. -->
+<data>
+    <xpath expr="/form/notebook/page[@id=&quot;children&quot;]"
+           position="after">
+        <page string="Employees" id="employee">
+            <label name="employee"/>
+            <field name="employee"/>
+            <field name="employees" colspan="4"/>
+        </page>
+    </xpath>
+</data>

view/work_list.xml

+<?xml version="1.0"?>
+<!-- This file is part project_employee module for Tryton.
+The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. -->
+<data>
+    <xpath expr="/tree/field[@name='total_effort']" position="after">
+        <field name="employee"/>
+        <field name="employees" tree_invisible="1"/>
+    </xpath>
+</data>

view/work_list2.xml

+<?xml version="1.0"?>
+<!-- This file is part project_employee module for Tryton.
+The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. -->
+<data>
+    <xpath expr="/tree/field[@name='total_effort']" position="after">
+        <field name="employee"/>
+        <field name="employees" tree_invisible="1"/>
+    </xpath>
+</data>

view/work_tree.xml

+<?xml version="1.0"?>
+<!-- This file is part project_employee module for Tryton.
+The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms. -->
+<data>
+    <xpath expr="/tree/field[@name='total_effort']" position="after">
+        <field name="employee"/>
+        <field name="employees" tree_invisible="1"/>
+    </xpath>
+</data>
         <record model="ir.ui.view" id="work_view_form">
             <field name="model">project.work</field>
             <field name="inherit" ref="project.work_view_form"/>
-            <field name="arch" type="xml">
-                <![CDATA[
-                <data>
-                    <xpath expr="/form/notebook/page[@id=&quot;children&quot;]"
-                           position="after">
-                        <page string="Employees" id="employee">
-                            <label name="employee"/>
-                            <field name="employee"/>
-                            <field name="employees" colspan="4"/>
-                        </page>
-                    </xpath>
-                </data>
-                ]]>
-            </field>
+            <field name="name">work_form</field>
         </record>
 
         <record model="ir.ui.view" id="work_view_tree">
             <field name="model">project.work</field>
             <field name="inherit" ref="project.work_view_tree"/>
-            <field name="arch" type="xml">
-                <![CDATA[
-                <data>
-                    <xpath expr="/tree/field[@name='total_effort']" position="after">
-                        <field name="employee"/>
-                        <field name="employees" tree_invisible="1"/>
-                    </xpath>
-                </data>
-                ]]>
-            </field>
+            <field name="name">work_tree</field>
         </record>
         <record model="ir.ui.view" id="work_view_list">
             <field name="model">project.work</field>
             <field name="inherit" ref="project.work_view_list"/>
-            <field name="arch" type="xml">
-                <![CDATA[
-                <data>
-                    <xpath expr="/tree/field[@name='total_effort']" position="after">
-                        <field name="employee"/>
-                        <field name="employees" tree_invisible="1"/>
-                    </xpath>
-                </data>
-                ]]>
-            </field>
+            <field name="name">work_list</field>
         </record>
         <record model="ir.ui.view" id="work_view_list2">
             <field name="model">project.work</field>
             <field name="inherit" ref="project.work_view_list2"/>
-            <field name="arch" type="xml">
-                <![CDATA[
-                <data>
-                    <xpath expr="/tree/field[@name='total_effort']" position="after">
-                        <field name="employee"/>
-                        <field name="employees" tree_invisible="1"/>
-                    </xpath>
-                </data>
-                ]]>
-            </field>
+            <field name="name">work_list2</field>
         </record>
 
         <!-- Access -->