flectra/addons/website_sale/views/sale_report_views.xml

98 lines
4.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<flectra>
<record id="sale_report_view_search_website" model="ir.ui.view">
<field name="name">sale.report.search</field>
<field name="model">sale.report</field>
<field name="arch" type="xml">
<search string="Sales">
<filter name="week" string="Last Week"
domain="[
'&amp;',
('date', '&gt;=', (context_today()-relativedelta(days=7)).strftime('%Y-%m-%d')),
('date', '&lt;=', context_today().strftime('%Y-%m-%d')),
]"/>
<filter name="month" string="Last Month"
domain="[
'&amp;',
('date', '&gt;=', (context_today()-relativedelta(months=1)).strftime('%Y-%m-%d')),
('date', '&lt;=', context_today().strftime('%Y-%m-%d')),
]"/>
<filter name="year" string="Last Year"
domain="[
'&amp;',
('date', '&gt;=', (context_today()-relativedelta(years=1)).strftime('%Y-%m-%d')),
('date', '&lt;=', context_today().strftime('%Y-%m-%d')),
]"/>
</search>
</field>
</record>
<record id="sale_report_view_pivot_website" model="ir.ui.view">
<field name="name">sale.report.view.pivot.website</field>
<field name="model">sale.report</field>
<field name="arch" type="xml">
<pivot string="Sales Report" disable_linking="True">
<field name="date" type="row"/>
<field name="state" type="col"/>
<field name="price_subtotal" type="measure"/>
</pivot>
</field>
</record>
<record id="sale_report_view_graph_website" model="ir.ui.view">
<field name="name">sale.report.view.graph.website</field>
<field name="model">sale.report</field>
<field name="arch" type="xml">
<graph string="Sale Report" type="bar">
<field name="date"/>
<field name="price_subtotal" type='measure'/>
</graph>
</field>
</record>
<record id="sale_report_action_dashboard" model="ir.actions.act_window">
<field name="name">Sales</field>
<field name="res_model">sale.report</field>
<field name="view_mode">pivot,graph</field>
<field name="domain">[('state','in',('sale', 'done')), ('team_id.team_type', '=', 'website')]</field>
<field name="search_view_id" ref="sale_report_view_search_website"/>
<field name="help">You don't have any order from the website.</field>
</record>
<record id="sale_report_action_view_pivot_website" model="ir.actions.act_window.view">
<field name="sequence" eval="1"/>
<field name="view_mode">pivot</field>
<field name="view_id" ref="sale_report_view_pivot_website"/>
<field name="act_window_id" ref="sale_report_action_dashboard"/>
</record>
<record id="sale_report_action_view_graph_website" model="ir.actions.act_window.view">
<field name="sequence" eval="1"/>
<field name="view_mode">graph</field>
<field name="view_id" ref="sale_report_view_graph_website"/>
<field name="act_window_id" ref="sale_report_action_dashboard"/>
</record>
<record id="sale_report_action_carts" model="ir.actions.act_window">
<field name="name">Sales</field>
<field name="res_model">sale.report</field>
<field name="view_mode">pivot,graph</field>
<field name="domain">[('team_id.team_type', '=', 'website')]</field>
<field name="search_view_id" ref="sale_report_view_search_website"/>
<field name="help">You don't have any order from the website.</field>
</record>
<record id="sale_report_action_view_pivot_carts" model="ir.actions.act_window.view">
<field name="sequence" eval="1"/>
<field name="view_mode">pivot</field>
<field name="view_id" ref="sale_report_view_pivot_website"/>
<field name="act_window_id" ref="sale_report_action_carts"/>
</record>
<record id="sale_report_action_view_graph_carts" model="ir.actions.act_window.view">
<field name="sequence" eval="1"/>
<field name="view_mode">graph</field>
<field name="view_id" ref="sale_report_view_graph_website"/>
<field name="act_window_id" ref="sale_report_action_carts"/>
</record>
</flectra>