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