Use separate XML files for views

This commit is contained in:
Cédric Krier committed 2013-03-10 22:39:40 +01:00
1 parent 1785037b14
commit 0980318d1b
7 files changed
+93 -92

No files matched your search

+1
View File
@@ -6,6 +6,7 @@ include CHANGELOG
include LICENSE
include tryton.cfg
include *.xml
include view/*.xml
include *.odt
include locale/*.po
include doc/*
+1 -1
View File
@@ -45,7 +45,7 @@ setup(name='trytond_project',
],
package_data={
'trytond.modules.project': (info.get('xml', [])
+ ['tryton.cfg', 'locale/*.po', 'icons/*.svg']),
+ ['tryton.cfg', 'view/*.xml', 'locale/*.po', 'icons/*.svg']),
},
classifiers=[
'Development Status :: 5 - Production/Stable',
+51
View File
@@ -0,0 +1,51 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<form string="Works Efforts" col="6">
<label name="name"/>
<field name="name" colspan="3"/>
<label name="active"/>
<field name="active" xexpand="0"/>
<label name="type"/>
<field name="type"/>
<label name="parent"/>
<field name="parent"/>
<label name="sequence"/>
<field name="sequence"/>
<label name="company"/>
<field name="company"/>
<label name="party"/>
<field name="party"/>
<label name="party_address"/>
<field name="party_address"/>
<notebook colspan="8">
<page string="General" id="general" col="6">
<group col="2" colspan="6" id="timesheet_available">
<label name="timesheet_available"/>
<field name="timesheet_available"/>
</group>
<label name="hours"/>
<field name="hours" widget="float_time" float_time="company_work_time"/>
<label name="total_effort"/>
<field name="total_effort" widget="float_time" float_time="company_work_time"/>
<label name="effort"/>
<field name="effort" widget="float_time" float_time="company_work_time"/>
<separator name="comment" colspan="6"/>
<field name="comment" colspan="6"/>
</page>
<page string="Children" id="children"
states="{'invisible': Not(Equal(Eval('type'), 'project'))}">
<field name="children" colspan="4"/>
</page>
<page string="Timesheet" id="timesheet_lines"
states="{'invisible': Not(Bool(Eval('timesheet_available')))}">
<label name="timesheet_start_date"/>
<field name="timesheet_start_date"/>
<label name="timesheet_end_date"/>
<field name="timesheet_end_date"/>
<field name="timesheet_lines" colspan="4"/>
</page>
</notebook>
<label name="state"/>
<field name="state"/>
</form>
+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tree string="Works Efforts">
<field name="name"/>
<field name="hours" widget="float_time" float_time="company_work_time"/>
<field name="total_effort" widget="float_time"
float_time="company_work_time"/>
<field name="type"/>
<field name="state"/>
<field name="active" tree_invisible="1"/>
</tree>
+11
View File
@@ -0,0 +1,11 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tree string="Tasks">
<field name="name"/>
<field name="hours" widget="float_time" float_time="company_work_time"/>
<field name="total_effort" widget="float_time"
float_time="company_work_time"/>
<field name="state"/>
<field name="active" tree_invisible="1"/>
</tree>
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0"?>
<!-- This file is part of Tryton. The COPYRIGHT file at the top level of
this repository contains the full copyright notices and license terms. -->
<tree string="Works Efforts">
<field name="name"/>
<field name="hours" widget="float_time" float_time="company_work_time"/>
<field name="total_effort" widget="float_time" float_time="company_work_time"/>
<field name="type"/>
<field name="state"/>
<field name="active" tree_invisible="1"/>
<field name="parent" tree_invisible="1"/>
<field name="children" tree_invisible="1"/>
</tree>
+4 -91
View File
@@ -3,117 +3,30 @@
this repository contains the full copyright notices and license terms. -->
<tryton>
<data>
<!-- default tree view -->
<record model="ir.ui.view" id="work_view_tree">
<field name="model">project.work</field>
<field name="type">tree</field>
<field name="priority" eval="20"/>
<field name="field_childs">children</field>
<field name="arch" type="xml">
<![CDATA[
<tree string="Works Efforts">
<field name="name"/>
<field name="hours" widget="float_time" float_time="company_work_time"/>
<field name="total_effort" widget="float_time" float_time="company_work_time"/>
<field name="type"/>
<field name="state"/>
<field name="active" tree_invisible="1"/>
<field name="parent" tree_invisible="1"/>
<field name="children" tree_invisible="1"/>
</tree>
]]>
</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="type">tree</field>
<field name="priority" eval="10"/>
<field name="arch" type="xml">
<![CDATA[
<tree string="Works Efforts">
<field name="name"/>
<field name="hours" widget="float_time" float_time="company_work_time"/>
<field name="total_effort" widget="float_time" float_time="company_work_time"/>
<field name="type"/>
<field name="state"/>
<field name="active" tree_invisible="1"/>
</tree>
]]>
</field>
<field name="name">work_list</field>
</record>
<!-- list view for tasks (wihtout type field) -->
<record model="ir.ui.view" id="work_view_list2">
<field name="model">project.work</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<![CDATA[
<tree string="Tasks">
<field name="name"/>
<field name="hours" widget="float_time" float_time="company_work_time"/>
<field name="total_effort" widget="float_time" float_time="company_work_time"/>
<field name="state"/>
<field name="active" tree_invisible="1"/>
</tree>
]]>
</field>
<field name="name">work_list2</field>
</record>
<record model="ir.ui.view" id="work_view_form">
<field name="model">project.work</field>
<field name="type">form</field>
<field name="arch" type="xml">
<![CDATA[
<form string="Works Efforts" col="6">
<label name="name"/>
<field name="name" colspan="3"/>
<label name="active"/>
<field name="active" xexpand="0"/>
<label name="type"/>
<field name="type"/>
<label name="parent"/>
<field name="parent"/>
<label name="sequence"/>
<field name="sequence"/>
<label name="company"/>
<field name="company"/>
<label name="party"/>
<field name="party"/>
<label name="party_address"/>
<field name="party_address"/>
<notebook colspan="8">
<page string="General" id="general" col="6">
<group col="2" colspan="6" id="timesheet_available">
<label name="timesheet_available"/>
<field name="timesheet_available"/>
</group>
<label name="hours"/>
<field name="hours" widget="float_time" float_time="company_work_time"/>
<label name="total_effort"/>
<field name="total_effort" widget="float_time" float_time="company_work_time"/>
<label name="effort"/>
<field name="effort" widget="float_time" float_time="company_work_time"/>
<separator name="comment" colspan="6"/>
<field name="comment" colspan="6"/>
</page>
<page string="Children" id="children"
states="{'invisible': Not(Equal(Eval('type'), 'project'))}">
<field name="children" colspan="4"/>
</page>
<page string="Timesheet" id="timesheet_lines"
states="{'invisible': Not(Bool(Eval('timesheet_available')))}">
<label name="timesheet_start_date"/>
<field name="timesheet_start_date"/>
<label name="timesheet_end_date"/>
<field name="timesheet_end_date"/>
<field name="timesheet_lines" colspan="4"/>
</page>
</notebook>
<label name="state"/>
<field name="state"/>
</form>
]]>
</field>
<field name="name">work_form</field>
</record>
<record model="ir.action.act_window" id="act_work_tree">
<field name="name">Works Efforts</field>