Commits

Raimon Esteve (Zikzakmedia) committed 27851e3

Use separate XML files for views

  • Participants
  • Parent commits a56dde8

Comments (0)

Files changed (6)

         <record model="ir.ui.view" id="sale_view_form">
             <field name="model">sale.sale</field>
             <field name="inherit" ref="sale.sale_view_form"/>
-            <field name="arch" type="xml">
-                <![CDATA[
-                <data>
-                    <xpath
-                        expr="/form/notebook/page[@id=&quot;sale&quot;]/group[@id=&quot;amount_buttons&quot;]/field[@name=&quot;total_amount&quot;]"
-                        position="after">
-                        <newline/>
-                        <label name="margin" xalign="1.0" xexpand="1"/>
-                        <field name="margin" xalign="1.0" xexpand="0"/>
-                    </xpath>
-                </data>
-                ]]>
-            </field>
+            <field name="name">sale_form</field>
         </record>
         <record model="ir.ui.view" id="sale_view_tree">
             <field name="model">sale.sale</field>
             <field name="inherit" ref="sale.sale_view_tree"/>
-            <field name="arch" type="xml">
-                <![CDATA[
-                <data>
-                    <xpath
-                        expr="/tree/field[@name=&quot;total_amount&quot;]"
-                        position="after">
-                        <field name="margin"/>
-                    </xpath>
-                </data>
-                ]]>
-            </field>
+            <field name="name">sale_tree</field>
         </record>
 
         <record model="ir.ui.view" id="sale_line_view_form">
             <field name="model">sale.line</field>
             <field name="inherit" ref="sale.sale_line_view_form"/>
-            <field name="arch" type="xml">
-                <![CDATA[
-                <data>
-                    <xpath
-                        expr="/form/notebook/page/label[@name=&quot;unit_price&quot;]"
-                        position="before">
-                        <label name="cost_price"/>
-                        <field name="cost_price"/>
-                    </xpath>
-                    <xpath
-                        expr="/form/notebook/page/field[@name=&quot;amount&quot;]"
-                        position="after">
-                        <label name="margin"/>
-                        <field name="margin"/>
-                    </xpath>
-                </data>
-                ]]>
-            </field>
+            <field name="name">sale_line_form</field>
         </record>
         <record model="ir.ui.view" id="sale_line_view_tree_sequence">
             <field name="model">sale.line</field>
             <field name="inherit" ref="sale.sale_line_view_tree_sequence"/>
-            <field name="arch" type="xml">
-                <![CDATA[
-                <data>
-                    <xpath
-                        expr="/tree/field[@name=&quot;unit_price&quot;]"
-                        position="before">
-                        <field name="cost_price"/>
-                    </xpath>
-                    <xpath
-                        expr="/tree/field[@name=&quot;amount&quot;]"
-                        position="after">
-                        <field name="margin"/>
-                    </xpath>
-                </data>
-                ]]>
-            </field>
+            <field name="name">sale_line_tree_sequence</field>
         </record>
         <record model="ir.ui.view" id="sale_line_view_tree">
             <field name="model">sale.line</field>
             <field name="inherit" ref="sale.sale_line_view_tree"/>
-            <field name="arch" type="xml">
-                <![CDATA[
-                <data>
-                    <xpath
-                        expr="/tree/field[@name=&quot;unit_price&quot;]"
-                        position="before">
-                        <field name="cost_price"/>
-                    </xpath>
-                    <xpath
-                        expr="/tree/field[@name=&quot;amount&quot;]"
-                        position="after">
-                        <field name="margin"/>
-                    </xpath>
-                </data>
-                ]]>
-            </field>
+            <field name="name">sale_line_tree</field>
         </record>
     </data>
 </tryton>

File view/sale_form.xml

+<?xml version="1.0"?>
+<!-- This file is part of sale_margin 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;sale&quot;]/group[@id=&quot;amount_buttons&quot;]/field[@name=&quot;total_amount&quot;]"
+        position="after">
+        <newline/>
+        <label name="margin" xalign="1.0" xexpand="1"/>
+        <field name="margin" xalign="1.0" xexpand="0"/>
+    </xpath>
+</data>

File view/sale_line_form.xml

+<?xml version="1.0"?>
+<!-- This file is part of sale_margin 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/label[@name=&quot;unit_price&quot;]"
+        position="before">
+        <label name="cost_price"/>
+        <field name="cost_price"/>
+    </xpath>
+    <xpath
+        expr="/form/notebook/page/field[@name=&quot;amount&quot;]"
+        position="after">
+        <label name="margin"/>
+        <field name="margin"/>
+    </xpath>
+</data>

File view/sale_line_tree.xml

+<?xml version="1.0"?>
+<!-- This file is part of sale_margin 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=&quot;unit_price&quot;]"
+        position="before">
+        <field name="cost_price"/>
+    </xpath>
+    <xpath
+        expr="/tree/field[@name=&quot;amount&quot;]"
+        position="after">
+        <field name="margin"/>
+    </xpath>
+</data>

File view/sale_line_tree_sequence.xml

+<?xml version="1.0"?>
+<!-- This file is part of sale_margin 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=&quot;unit_price&quot;]"
+        position="before">
+        <field name="cost_price"/>
+    </xpath>
+    <xpath
+        expr="/tree/field[@name=&quot;amount&quot;]"
+        position="after">
+        <field name="margin"/>
+    </xpath>
+</data>

File view/sale_tree.xml

+<?xml version="1.0"?>
+<!-- This file is part of sale_margin 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=&quot;total_amount&quot;]"
+        position="after">
+        <field name="margin"/>
+    </xpath>
+</data>