[IMP] project_timesheet : Hide the Invoice Tasks Work from the project/user.
[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="inherit_id" ref="project.view_project_kanban"/>
9             <field name="arch" type="xml">
10                 <field name="use_tasks" position="after">
11                     <field name="use_timesheets"/>
12                     <field name="hours_quantity"/>
13                     <field name="currency_id"/>
14                     <field name="partner_id"/>
15                 </field>
16                 <xpath expr="//div[contains(@class, 'oe_kanban_project_list')]" position="inside">
17                     <a t-if="record.use_timesheets.raw_value" style="margin-right: 10px"
18                         name="open_timesheets" type="object"><field name="hours_quantity"/> Hours</a>
19                 </xpath>
20             </field>
21         </record>
22
23         <record id="project_invoice_form" model="ir.ui.view">
24             <field name="name">Inherit project form : Invoicing Data</field>
25             <field name="model">project.project</field>
26             <field name="inherit_id" ref="project.edit_project"/>
27             <field name="arch" type="xml">
28                 <xpath expr='//div[@name="options_active"]' position='inside'>
29                     <field name="use_timesheets" class="oe_inline"/>
30                     <label for="use_timesheets"/>
31                 </xpath>
32                 <xpath expr='//div[@name="buttons"]' position="inside">
33                     <button name="open_timesheets" string="Timesheets" type="object" attrs="{'invisible':[('use_timesheets','=', 0)]}"/>
34                 </xpath>
35             </field>
36         </record>
37
38         <record id="project_invoice_search" model="ir.ui.view">
39             <field name="name">Inherit project search view : Invoicing Data</field>
40             <field name="model">project.project</field>
41             <field name="inherit_id" ref="project.view_project_project_filter"/>
42             <field name="arch" type="xml">
43                 <xpath expr='//filter[@string="Project(s) Manager"]' position='after'>
44                     <filter icon="terp-camera_test" string="Billable" domain="[('to_invoice','!=', False)]" help="Billable Project"/>
45                 </xpath>
46             </field>
47         </record>
48         <record id="view_account_analytic_line_search_account_inherit" model="ir.ui.view">
49             <field name="name">account.analytic.line.search.account_id</field>
50             <field name="model">account.analytic.line</field>
51             <field name="inherit_id" ref="account.view_account_analytic_line_filter"/>
52             <field name="arch" type="xml">
53                  <field name="account_id" position="replace">
54                      <field name="account_id" string="Analytic account/project"/>
55                  </field>
56             </field>
57          </record>
58         <record id="view_account_analytic_line_form_inherit_account_id" model="ir.ui.view">
59             <field name="name">account.analytic.line.form.account_id</field>
60             <field name="model">account.analytic.line</field>
61             <field name="inherit_id" ref="account.view_account_analytic_line_form"/>
62             <field name="arch" type="xml">
63                 <field name="account_id"  position="replace">
64                    <field name="account_id" string="Analytic Account/Project" on_change="on_change_account_id(account_id)"/>
65                 </field>
66             </field>
67         </record>
68        <record id="view_account_analytic_line_tree_inherit_account_id" model="ir.ui.view">
69             <field name="name">account.analytic.line.tree.account_id</field>
70             <field name="model">account.analytic.line</field>
71             <field name="inherit_id" ref="account.view_account_analytic_line_tree"/>
72             <field name="arch" type="xml">
73                 <field name="account_id"  position="replace">
74                     <field name="account_id" string="Analytic account/project" on_change="on_change_account_id(account_id)"/>
75                 </field>
76             </field>
77         </record>
78
79         <!-- Menus -->
80         <record id="action_project_timesheet_bill_task" model="ir.actions.act_window">
81             <field name="name">Invoice Tasks Work</field>
82             <field name="res_model">account.analytic.line</field>
83             <field name="view_type">form</field>
84             <field name="view_mode">tree,form</field>
85             <field name="domain">[]</field>
86             <field name="context">{'search_default_to_invoice': 1}</field>
87             <field name="view_id" ref="view_account_analytic_line_tree_inherit_account_id"/>
88             <field name="help" type="html">
89               <p>
90                 You will find here timesheets and purchases you did for contracts that can be reinvoiced to the customer.
91                 If you want to record new jobs to invoice, you should use the timesheet menu instead.
92               </p>
93             </field>
94         </record>
95         <menuitem action="hr_timesheet.action_hr_timesheet_sign_in"
96             id="menu_hr_timesheet_sign_in"
97             parent="hr_attendance.menu_hr_attendance"
98             sequence="5" groups="base.group_hr_attendance" />
99
100         <menuitem id="menu_project_billing" name="Invoicing"
101                   parent="base.menu_main_pm" sequence="5"/>
102         <menuitem id="menu_project_billing_line" name="Invoice Tasks Work"
103             parent="menu_project_billing" action="action_project_timesheet_bill_task" groups="project.group_project_manager"/>
104
105         <!--
106             Time Tracking menu in project Management
107         -->
108 <!--        <menuitem id="menu_project_working_hours" parent="base.menu_project_management_time_tracking" action="hr_timesheet.act_hr_timesheet_line_evry1_all_form"/> -->
109
110         <record id="action_account_analytic_overdue" model="ir.actions.act_window">
111             <field name="name">Customer Projects</field>
112             <field name="res_model">account.analytic.account</field>
113             <field name="view_type">form</field>
114             <field name="view_mode">tree,form,graph</field>
115             <field name="context">{}</field>
116             <field name="domain">[('type','=','normal')]</field>
117             <field name="search_view_id" ref="account_analytic_analysis.view_account_analytic_account_overdue_search"/>
118             <field name="help" type="html">
119               <p class="oe_view_nocontent_create">
120                 Click to add a customer contract.
121               </p><p>
122                 You will find here the contracts related to your customer
123                 projects in order to track the invoicing progress.
124               </p>
125             </field>
126         </record>
127         <menuitem id="menu_invoicing_contracts" parent="menu_project_billing" sequence="4"
128             action="account_analytic_analysis.action_account_analytic_overdue"/>
129
130     </data>
131 </openerp>