Use separate XML files for views

This commit is contained in:
resteve 2014-01-17 14:54:11 +01:00
parent 74116dddf7
commit 9d33543185
6 changed files with 79 additions and 74 deletions

View File

@ -6,97 +6,28 @@ The COPYRIGHT file at the top level of this repository contains the full copyrig
<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>

13
view/sale_form.xml Normal file
View File

@ -0,0 +1,13 @@
<?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>

18
view/sale_line_form.xml Normal file
View File

@ -0,0 +1,18 @@
<?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>

16
view/sale_line_tree.xml Normal file
View File

@ -0,0 +1,16 @@
<?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>

View File

@ -0,0 +1,16 @@
<?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>

11
view/sale_tree.xml Normal file
View File

@ -0,0 +1,11 @@
<?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>