[IMP]rename all fields which r required in project and another module and improve...
[odoo/odoo.git] / addons / project_timesheet / project_timesheet_view.xml
1 <?xml version="1.0" encoding="utf-8"?>
2 <openerp>
3     <data>
4         <record id="project_invoice_form" model="ir.ui.view">
5             <field name="name">Inherit project form : Invoicing Data</field>
6             <field name="model">project.project</field>
7             <field name="type">form</field>
8             <field name="inherit_id" ref="project.edit_project"/>
9             <field name="arch" type="xml">
10                 <xpath expr="//field[@name='use_tasks']" position='after'>
11                     <field name="use_timesheets"/>
12                     <field name="amt_to_invoice" invisible="True"/>
13                     <field name="hrs_to_invoice" invisible="True"/>
14                 </xpath>
15             
16                 <field name="warn_customer" position="after">
17                     <group colspan="4" col="4">
18                         <separator colspan="4" string="Invoicing Data"/>
19                         <field name="pricelist_id" groups="product.group_sale_pricelist" domain="[('type','=','sale')]" widget="selection"/>
20                         <field name="to_invoice" widget="selection" string="Invoice Task Work"/>
21                         <field name="amount_max"/>
22                         <field name="amount_invoiced"/>
23                     </group>
24                 </field>
25             </field>
26         </record>
27
28         <record id="view_project_kanban_inherited" model="ir.ui.view">
29             <field name="name">project.project.kanban.inherited</field>
30             <field name="model">project.project</field>
31             <field name="type">kanban</field>
32             <field name="inherit_id" ref="project.view_project_kanban"/>
33             <field name="arch" type="xml">
34                   <field name="use_tasks" position="after">
35                     <field name="use_timesheets" context="{'search_default_account_id': project_id, 'default_account_id': project_id}"/>
36                     <field name="timesheet_count"/>
37                     <field name="currency_id"/>
38                 </field>
39                 <xpath expr="//div[@id='list']" position="inside">
40                     <t t-if="record.use_timesheets.raw_value">
41                         <a id="3" name="open_timesheets" class="oe_project_buttons" type="object"><t t-if="record.timesheet_count.value &lt;= 1">Timesheet</t><t t-if="record.timesheet_count.value &gt; 1">Timesheets</t>(<t t-esc="record.timesheet_count.value"/>)</a>
42                     </t>
43                 </xpath>
44
45                 <xpath expr="//tr[@id='deadline']" position="before">
46                     <tr >
47                         <th align="left">Amount to invoice</th>
48                         <td align="left">
49                             <field name="amt_to_invoice"/> <t t-esc="record.currency_id.raw_value[1].split(' ')[1][1]"/>
50                         </td>
51                     </tr>
52                     <tr>
53                         <th align="left">Hours to Invoice</th>
54                         <td align="left">
55                             <field name="hrs_to_invoice"/> h
56                         </td>
57                     </tr>
58                 </xpath>
59             </field>
60         </record>
61
62         <record id="project_invoice_form_cutomer" model="ir.ui.view">
63             <field name="name">Inherit project form : Customer</field>
64             <field name="model">project.project</field>
65             <field name="type">form</field>
66             <field name="inherit_id" ref="project_invoice_form"/>
67             <field name="arch" type="xml">
68                 <field name="partner_id" position="replace">
69                     <field colspan="4" name="partner_id" on_change="onchange_partner_id(partner_id)" select="1" string="Customer"  attrs="{'required':[('to_invoice','!=',False)]}"/>
70                 </field>
71             </field>
72         </record>
73
74         <record id="project_invoice_search" model="ir.ui.view">
75             <field name="name">Inherit project search view : Invoicing Data</field>
76             <field name="model">project.project</field>
77             <field name="type">search</field>
78             <field name="inherit_id" ref="project.view_project_project_filter"/>
79             <field name="arch" type="xml">
80                 <xpath expr='//filter[@string="Member"]' position='after'>
81                     <separator orientation="vertical"/>
82                     <filter icon="terp-camera_test" string="Billable" domain="[('to_invoice','!=', False)]" help="Billable Project"/>
83                 </xpath>
84             </field>
85         </record>
86         <record id="view_account_analytic_line_search_account_inherit" model="ir.ui.view">
87             <field name="name">account.analytic.line.search.account_id</field>
88             <field name="model">account.analytic.line</field>
89             <field name="type">search</field>
90             <field name="inherit_id" ref="account.view_account_analytic_line_filter"/>
91             <field name="arch" type="xml">
92                      <field name="account_id" position="replace">
93                     <field name="account_id" string="Analytic account/project" />
94                 </field>
95             </field>
96          </record>
97         <record id="view_account_analytic_line_form_inherit_account_id" model="ir.ui.view">
98             <field name="name">account.analytic.line.form.account_id</field>
99             <field name="model">account.analytic.line</field>
100             <field name="type">form</field>
101             <field name="inherit_id" ref="account.view_account_analytic_line_form"/>
102             <field name="arch" type="xml">
103                 <field name="account_id"  position="replace">
104                    <field name="account_id" string="Analytic account/project" on_change="on_change_account_id(account_id)"/>
105                 </field>
106             </field>
107         </record>
108        <record id="view_account_analytic_line_tree_inherit_account_id" model="ir.ui.view">
109             <field name="name">account.analytic.line.tree.account_id</field>
110             <field name="model">account.analytic.line</field>
111             <field name="type">tree</field>
112             <field name="inherit_id" ref="account.view_account_analytic_line_tree"/>
113             <field name="arch" type="xml">
114                 <field name="account_id"  position="replace">
115                     <field name="account_id" string="Analytic account/project"/>
116                 </field>
117             </field>
118         </record>
119
120         <!-- Menus -->
121         <record id="action_project_timesheet_bill_task" model="ir.actions.act_window">
122             <field name="name">Bill Tasks Works</field>
123             <field name="res_model">account.analytic.line</field>
124             <field name="view_type">form</field>
125             <field name="view_mode">tree,form</field>
126             <field name="domain">[]</field>
127             <field name="context">{}</field>
128             <field name="view_id" ref="view_account_analytic_line_tree_inherit_account_id"/>
129             <field name="help">You will find here all works made on tasks that you can invoice.
130 In order to invoice the time spent on a project, you must define the
131 pricelist and the field 'Invoice Task Work' on the tab 'Billing' of
132 the project form.</field>
133         </record>
134         <menuitem action="hr_timesheet.action_hr_timesheet_sign_in"
135             id="menu_hr_timesheet_sign_in"
136             parent="hr_attendance.menu_hr_attendance"
137             sequence="5" />
138
139         <menuitem id="menu_project_billing" name="Invoicing"
140                   parent="base.menu_main_pm" sequence="5"/>
141         <menuitem id="menu_project_billing_line" name="Invoice Tasks Work"
142             parent="menu_project_billing" action="action_project_timesheet_bill_task"/>
143
144         <!--
145             Time Tracking menu in project Management
146         -->
147 <!--        <menuitem id="menu_project_working_hours" parent="base.menu_project_management_time_tracking" action="hr_timesheet.act_hr_timesheet_line_evry1_all_form"/> -->
148
149         <record id="action_account_analytic_overdue" model="ir.actions.act_window">
150             <field name="name">Customer Projects</field>
151             <field name="res_model">account.analytic.account</field>
152             <field name="view_type">form</field>
153             <field name="view_mode">tree,form,graph</field>
154             <field name="context">{}</field>
155             <field name="domain">[('type','=','normal')]</field>
156             <field name="search_view_id" ref="account_analytic_analysis.view_account_analytic_account_overdue_search"/>
157             <field name="help">You will find here the contracts related to your customer projects in order to track the invoicing progress.</field>
158         </record>
159         <menuitem id="menu_invoicing_contracts" parent="menu_project_billing" sequence="4"
160             action="account_analytic_analysis.action_account_analytic_overdue"/>
161
162     </data>
163 </openerp>