summaryrefslogtreecommitdiff
path: root/addons/sale_timesheet/report/project_profitability_report_analysis_views.xml
blob: ff400b632b303fad700344847d1dafeefad0170e (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
<?xml version="1.0" encoding="utf-8"?>
<odoo>

    <record id="project_profitability_report_view_pivot" model="ir.ui.view">
        <field name="name">project.profitability.report.pivot</field>
        <field name="model">project.profitability.report</field>
        <field name="arch" type="xml">
            <pivot string="Profitability Analysis" display_quantity="true" disable_linking="True" sample="1">
                <field name="project_id" type="row"/>
                <field name="amount_untaxed_to_invoice" type="measure"/>
                <field name="amount_untaxed_invoiced" type="measure"/>
                <field name="timesheet_cost" type="measure"/>
            </pivot>
        </field>
    </record>

    <record id="project_profitability_report_view_graph" model="ir.ui.view">
        <field name="name">project.profitability.report.graph</field>
        <field name="model">project.profitability.report</field>
        <field name="arch" type="xml">
            <graph string="Profitability Analysis" type="bar" sample="1" disable_linking="1">
                <field name="project_id" type="row"/>
                <field name="product_id" type="col"/>
                <field name="amount_untaxed_to_invoice" type="measure"/>
                <field name="amount_untaxed_invoiced" type="measure"/>
                <field name="timesheet_cost" type="measure"/>
                <field name="other_revenues" type="measure"/>
                <field name="margin" type="measure"/>
             </graph>
         </field>
    </record>

    <record id="project_profitability_report_view_search" model="ir.ui.view">
        <field name="name">project.profitability.report.search</field>
        <field name="model">project.profitability.report</field>
        <field name="arch" type="xml">
            <search string="Profitability Analysis">
                <field name="project_id"/>
                <field name="user_id"/>
                <field name="product_id"/>
                <field name="partner_id" filter_domain="[('partner_id', 'child_of', self)]"/>
                <field name="company_id" groups="base.group_multi_company"/>
                <filter string="My Projects" name="my_project" domain="[('user_id','=', uid)]"/>
                <group expand="1" string="Group By">
                    <filter string="Project" name="group_by_project" context="{'group_by':'project_id'}"/>
                    <filter string="Project Manager" name="group_by_user_id" context="{'group_by':'user_id'}"/>
                    <filter string="Customer" name="group_by_partner_id" context="{'group_by':'partner_id'}"/>
                    <filter string="Company" name="group_by_company" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
                    <filter string="Date" name="group_by_line_date" context="{'group_by':'line_date'}"/>
                </group>
            </search>
        </field>
    </record>

    <record id="project_profitability_report_action" model="ir.actions.act_window">
        <field name="name">Project Costs and Revenues</field>
        <field name="res_model">project.profitability.report</field>
        <field name="view_mode">pivot,graph</field>
        <field name="search_view_id" ref="project_profitability_report_view_search"/>
        <field name="context">{
            'group_by_no_leaf':1,
            'group_by':[],
            'sale_show_order_product_name': 1,
        }</field>
        <field name="help">This report allows you to analyse the profitability of your projects: compare the amount to invoice, the ones already invoiced and the project cost (via timesheet cost of your employees).</field>
    </record>

    <menuitem id="menu_project_profitability_analysis"
        parent="project.menu_project_report"
        action="project_profitability_report_action"
        name="Project Costs and Revenues"
        sequence="50"/>

</odoo>