Files
odoo_source/addons/purchase/report/purchase_report_views.xml
T
Mathieu Duckerts-Antoine af999f40dd [IMP] *: review date type groupbys in search views archs
The parent commit allows to select a specific interval for any
date or datetime field in the groupby menu. This makes some filter
akward, for instance "Order Month".

Accordingly, we have rewritten the string and help attributes in
search views archs and removed groupbys related to the same field
(that would have become redundant).
2018-06-12 09:22:30 +02:00

97 lines
5.6 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record model="ir.ui.view" id="view_purchase_order_pivot">
<field name="name">product.month.pivot</field>
<field name="model">purchase.report</field>
<field name="arch" type="xml">
<pivot string="Purchase Orders Statistics" disable_linking="True">
<field name="partner_id" type="row"/>
<field name="date_order" interval="month" type="col"/>
<field name="price_total" type="measure"/>
<field name="unit_quantity" type="measure"/>
<field name="price_average" type="measure"/>
</pivot>
</field>
</record>
<record model="ir.ui.view" id="view_purchase_order_graph">
<field name="name">product.month.graph</field>
<field name="model">purchase.report</field>
<field name="arch" type="xml">
<graph string="Purchase Orders Statistics">
<field name="partner_id" type="row"/>
<field name="date_order" interval="month" type="col"/>
<field name="price_average" type="measure"/>
</graph>
</field>
</record>
<!-- Custom reports (aka filters) -->
<record id="filter_purchase_order_monthly_purchases" model="ir.filters">
<field name="name">Monthly Purchases</field>
<field name="model_id">purchase.report</field>
<field name="domain">[('state','!=','cancel')]</field>
<field name="user_id" eval="False"/>
<field name="context">{'group_by': ['category_id'], 'col_group_by': ['date_order:month'], 'measures': ['unit_quantity']}</field>
</record>
<record id="filter_purchase_order_price_per_supplier" model="ir.filters">
<field name="name">Price Per Vendor</field>
<field name="model_id">purchase.report</field>
<field name="domain">[('state','!=','draft'),('state','!=','cancel')]</field>
<field name="user_id" eval="False"/>
<field name="context">{'group_by': ['partner_id'], 'col_group_by': ['product_id'], 'measures': ['price_average']}</field>
</record>
<record id="filter_purchase_order_average_delivery_time" model="ir.filters">
<field name="name">Average Delivery Time</field>
<field name="model_id">purchase.report</field>
<field name="domain">[('state','!=','draft'),('state','!=','cancel')]</field>
<field name="user_id" eval="False"/>
<field name="context">{'group_by': ['partner_id'], 'measures': ['delay_pass']}</field>
</record>
<record id="view_purchase_order_search" model="ir.ui.view">
<field name="name">report.purchase.order.search</field>
<field name="model">purchase.report</field>
<field name="arch" type="xml">
<search string="Purchase Orders">
<filter string="Quotations" name="quotes" domain="[('state','=','draft')]"/>
<filter string="Orders" name="orders" domain="[('state','!=','draft'),('state','!=','cancel')]"/>
<field name="partner_id"/>
<field name="product_id"/>
<group expand="0" string="Extended Filters">
<field name="user_id"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="date_order"/>
<field name="date_approve"/>
<field name="category_id" filter_domain="[('category_id', 'child_of', self)]"/>
</group>
<group expand="1" string="Group By">
<filter string="Vendor" name="group_partner_id" context="{'group_by':'partner_id'}"/>
<filter string="Partner's Country" name="country_id" context="{'group_by':'country_id'}"/>
<filter string="Purchase Representative" name="user_id" context="{'group_by':'user_id'}"/>
<filter string="Product Category" name="group_category_id" context="{'group_by':'category_id'}"/>
<filter string="Status" name="status" context="{'group_by':'state'}"/>
<filter string="Company" name="company" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<separator/>
<filter string="Order Date" name="order_month" context="{'group_by':'date_order:month'}"/>
<filter string="Fiscal Position" name="fiscal_position" context="{'group_by':'fiscal_position_id'}" help="Purchase Order Fiscal Position"/>
</group>
</search>
</field>
</record>
<record id="action_purchase_order_report_all" model="ir.actions.act_window">
<field name="name">Purchase Analysis</field>
<field name="res_model">purchase.report</field>
<field name="view_type">form</field>
<field name="view_mode">graph,pivot</field>
<field name="context">{'search_default_orders': 1}</field>
<field name="view_id"></field> <!-- force empty -->
<field name="help">Purchase Analysis allows you to easily check and analyse your company purchase history and performance. From this menu you can track your negotiation performance, the delivery performance of your vendors, etc.</field>
</record>
<menuitem id="purchase_report" name="Reporting" parent="purchase.menu_purchase_root" sequence="99"
groups="purchase.group_purchase_manager" action="action_purchase_order_report_all"/>
</odoo>