summaryrefslogtreecommitdiff
path: root/addons/hr_expense/data/mail_data.xml
blob: 735771fbff72828ceb573973c04e00c3f7a833a0 (plain)
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <data noupdate="1">

        <record id="mail_act_expense_approval" model="mail.activity.type">
            <field name="name">Expense Approval</field>
            <field name="icon">fa-dollar</field>
            <field name="res_model_id" ref="hr_expense.model_hr_expense_sheet"/>
        </record>

        <!-- default alias for expenses -->
        <record id="mail_alias_expense" model="mail.alias">
            <field name="alias_name">expense</field>
            <field name="alias_model_id" ref="model_hr_expense"/>
            <field name="alias_user_id" ref="base.user_admin"/>
            <field name="alias_contact">employees</field>
        </record>

        <!-- Expense-related subtypes for messaging / Chatter -->
        <record id="mt_expense_approved" model="mail.message.subtype">
            <field name="name">Approved</field>
            <field name="res_model">hr.expense.sheet</field>
            <field name="default" eval="True"/>
            <field name="description">Expense report approved</field>
        </record>
        <record id="mt_expense_refused" model="mail.message.subtype">
            <field name="name">Refused</field>
            <field name="res_model">hr.expense.sheet</field>
            <field name="default" eval="True"/>
            <field name="description">Expense report refused</field>
        </record>
        <record id="mt_expense_paid" model="mail.message.subtype">
            <field name="name">Paid</field>
            <field name="res_model">hr.expense.sheet</field>
            <field name="description">Expense report paid</field>
            <field name="default" eval="True"/>
        </record>

        <!-- Email Templates -->
        <template id="hr_expense_template_refuse_reason">
            <p>Your Expense <t t-if="is_sheet">Report </t><t t-esc="name"/> has been refused</p>
            <ul class="o_timeline_tracking_value_list">
                <li>Reason : <t t-esc="reason"/></li>
            </ul>
        </template>

        <template id="hr_expense_template_register">
            <p>Dear <t t-esc="expense.employee_id.name"/>,</p>
            <p>
                Your expense has been successfully registered.
                <t t-if="expense.employee_id.user_id">
                    You can now submit it to the manager from the following link.
                </t>
            </p>
            <p t-if="expense.product_id">
                Product: <t t-esc="expense.product_id.name"/>
            </p>
            <div t-else="">
                <p>Product: not found</p>
                <p>The first word of the email subject did not correspond to any product code. You'll have to set the product manually on the expense.</p>
            </div>
            <p>
                Price: <t t-esc="expense.unit_amount"/><t t-esc="expense.currency_id.symbol"/>
            </p>
            <p t-if="expense.employee_id.user_id">
                <br/>
                <a t-att-href="'/web#id=%s&amp;model=hr.expense&amp;view_type=form' % (expense.id)" style="background-color: #9E588B; margin-top: 10px; padding: 10px; text-decoration: none; color: #fff; border-radius: 5px; font-size: 16px;">View Expense</a>
            </p>
        </template>

        <template id="hr_expense_template_register_no_user">
            <div style="background:#F0F0F0;color:#515166;padding:10px 0px;font-family:Arial,Helvetica,sans-serif;font-size:14px;">
                <table style="width:600px;margin:5px auto;">
                    <tbody>
                        <tr>
                            <td><a href="/"><img src="/web/binary/company_logo" style="vertical-align:baseline;max-width:100px;" /></a></td>
                        </tr>
                    </tbody>
                </table>
                <table style="width:600px;margin:0px auto;background:white;border:1px solid #e1e1e1;">
                    <tbody>
                        <tr>
                            <td style="padding:15px 20px 10px 20px;">
                                <t t-call="hr_expense.hr_expense_template_register"/>
                                <p style="color:#9E588B;">Powered by <a target="_blank" href="https://www.odoo.com">Odoo</a>.</p>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </template>
    </data>
</odoo>