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