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