-
Notifications
You must be signed in to change notification settings - Fork 23.2k
/
report_timesheet_templates.xml
73 lines (69 loc) · 3.46 KB
/
report_timesheet_templates.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="report_timesheet_sale_timesheet" inherit_id="hr_timesheet.timesheet_table">
<xpath expr="//th/span[text()='Description']" position="after">
<th class="text-start align-middle" t-if="not hide_sale_line">Sale Order Item</th>
</xpath>
<xpath expr="//td[span[@t-field='line.name']]" position="after">
<td class="align-middle" t-if="not hide_sale_line">
<span t-field="line.so_line">S00023 - Furniture Delivery (Manual) (Deco Addict)</span>
</td>
</xpath>
</template>
<template id="timesheet_sale_page">
<t t-set="show_project" t-value="true"/>
<t t-set="show_task" t-value="true"/>
<t t-call="web.html_container">
<t t-call="web.internal_layout">
<div class="page">
<t t-foreach="docs" t-as="doc">
<t t-set="doc_name" t-value="doc.name"/>
<t t-if="with_order_id" t-set="doc_name" t-value="str(doc.order_id.name) +' - '+ str(doc_name)"/>
<t t-elif="doc_name == '/'" t-set="doc_name" t-value="'Draft'"/>
<div class="oe_structure"/>
<div class="row mt8">
<div class="col-12">
<t t-if="doc.timesheet_ids">
<h2>
<br/>
<span t-if="not doc_name.startswith('INV/')">Order <t t-out="doc_name"/></span>
<span t-else="">Timesheets for the Invoice <t t-out="doc_name"/></span>
</h2>
<t t-set='lines' t-value='doc.timesheet_ids'/>
<t t-set="hide_sale_line" t-value="true"/>
<t t-call="hr_timesheet.timesheet_table"/>
</t>
</div>
</div>
</t>
</div>
</t>
</t>
</template>
<!-- Sale Order Timesheet Report for given timesheets -->
<template id="report_timesheet_sale_order">
<t t-set="record_name">Sales Order Item</t>
<t t-set="with_order_id" t-value="true"/>
<t t-set="docs" t-value="docs.order_line"/>
<t t-call="sale_timesheet.timesheet_sale_page"/>
</template>
<record id="timesheet_report_sale_order" model="ir.actions.report">
<field name="name">Timesheets</field>
<field name="model">sale.order</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">sale_timesheet.report_timesheet_sale_order</field>
<field name="binding_model_id" ref="model_sale_order"/>
</record>
<!-- Invoice Timesheet Report for given timesheets -->
<template id="report_timesheet_account_move">
<t t-set="record_name">Invoice</t>
<t t-call="sale_timesheet.timesheet_sale_page"/>
</template>
<record id="timesheet_report_account_move" model="ir.actions.report">
<field name="name">Timesheets</field>
<field name="model">account.move</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">sale_timesheet.report_timesheet_account_move</field>
<field name="binding_model_id" ref="model_account_move"/>
</record>
</odoo>