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