purchase_report_views.xml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <record model="ir.ui.view" id="view_purchase_order_pivot">
  4. <field name="name">product.month.pivot</field>
  5. <field name="model">purchase.report</field>
  6. <field name="arch" type="xml">
  7. <pivot string="Purchase Analysis" display_quantity="1" sample="1">
  8. <field name="category_id" type="row"/>
  9. <field name="order_id" type="measure"/>
  10. <field name="untaxed_total" type="measure"/>
  11. <field name="price_total" type="measure"/>
  12. </pivot>
  13. </field>
  14. </record>
  15. <record model="ir.ui.view" id="view_purchase_order_graph">
  16. <field name="name">product.month.graph</field>
  17. <field name="model">purchase.report</field>
  18. <field name="arch" type="xml">
  19. <graph string="Purchase Analysis" type="line" sample="1">
  20. <field name="date_approve" interval="day"/>
  21. <field name="untaxed_total" type="measure"/>
  22. </graph>
  23. </field>
  24. </record>
  25. <record id="purchase_report_view_tree" model="ir.ui.view">
  26. <field name="name">purchase.report.view.tree</field>
  27. <field name="model">purchase.report</field>
  28. <field name="arch" type="xml">
  29. <tree string="Purchase Analysis">
  30. <field name="date_order" widget="date"/>
  31. <field name="order_id" optional="show"/>
  32. <field name="partner_id" optional="show"/>
  33. <field name="product_id" optional="show"/>
  34. <field name="category_id" optional="show"/>
  35. <field name="user_id" optional="show" widget="many2one_avatar_user"/>
  36. <field name="company_id" optional="show" groups="base.group_multi_company"/>
  37. <field name="qty_ordered" optional="hide" sum="Sum of Qty Ordered"/>
  38. <field name="qty_received" optional="hide" sum="Sum of Qty Received"/>
  39. <field name="qty_billed" optional="hide" sum="Sum of Qty Billed"/>
  40. <field name="currency_id" optional="show" invisible="1"/>
  41. <field name="untaxed_total" optional="hide" widget="monetary" sum="Sum of Untaxed Total"/>
  42. <field name="price_total" optional="show" widget="monetary" sum="Sum of Total"/>
  43. <field name="state" optional="show"/>
  44. </tree>
  45. </field>
  46. </record>
  47. <record id="view_purchase_order_search" model="ir.ui.view">
  48. <field name="name">report.purchase.order.search</field>
  49. <field name="model">purchase.report</field>
  50. <field name="arch" type="xml">
  51. <search string="Purchase Orders">
  52. <filter string="Requests for Quotation" name="quotes" domain="[('state','in',('draft','sent'))]"/>
  53. <filter string="Purchase Orders" name="orders" domain="[('state','!=','draft'), ('state','!=','sent'), ('state','!=','cancel')]"/>
  54. <filter string="Confirmation Date Last Year" name="later_than_a_year_ago" domain="[('date_approve', '&gt;=', ((context_today()-relativedelta(years=1)).strftime('%Y-%m-%d')))]"/>
  55. <filter name="filter_date_order" date="date_order"/>
  56. <filter name="filter_date_approve" date="date_approve" default_period="this_month"/>
  57. <field name="partner_id"/>
  58. <field name="product_id"/>
  59. <group expand="0" string="Extended Filters">
  60. <field name="user_id"/>
  61. <field name="company_id" groups="base.group_multi_company"/>
  62. <field name="date_order"/>
  63. <field name="date_approve"/>
  64. <field name="category_id" filter_domain="[('category_id', 'child_of', self)]"/>
  65. </group>
  66. <group expand="1" string="Group By">
  67. <filter string="Vendor" name="group_partner_id" context="{'group_by':'partner_id'}"/>
  68. <filter string="Vendor Country" name="country_id" context="{'group_by':'country_id'}"/>
  69. <filter string="Purchase Representative" name="user_id" context="{'group_by':'user_id'}"/>
  70. <filter string="Product" name="group_product_id" context="{'group_by':'product_id'}"/>
  71. <filter string="Product Category" name="group_category_id" context="{'group_by':'category_id'}"/>
  72. <filter string="Status" name="status" context="{'group_by':'state'}"/>
  73. <filter string="Company" name="company" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
  74. <separator/>
  75. <filter string="Order Date" name="order_month" context="{'group_by': 'date_order:month'}"/>
  76. <filter string="Confirmation Date" name="group_date_approve_month" context="{'group_by': 'date_approve:month'}"/>
  77. </group>
  78. </search>
  79. </field>
  80. </record>
  81. <record id="action_purchase_order_report_all" model="ir.actions.act_window">
  82. <field name="name">Purchase Analysis</field>
  83. <field name="res_model">purchase.report</field>
  84. <field name="view_mode">graph,pivot</field>
  85. <field name="view_id"></field> <!-- force empty -->
  86. <field name="help" type="html">
  87. <p class="o_view_nocontent_smiling_face">
  88. No Purchase Analysis
  89. </p><p>
  90. This analysis allows you to easily check and analyse your company purchase history and performance.
  91. You can track your negotiation performance, the delivery performance of your vendors, etc
  92. </p>
  93. </field>
  94. <field name="target">current</field>
  95. </record>
  96. <menuitem id="purchase_report_main" name="Reporting" parent="purchase.menu_purchase_root" sequence="99" groups="purchase.group_purchase_manager"/>
  97. <menuitem id="purchase_report" name="Purchase" parent="purchase.purchase_report_main" sequence="99" groups="purchase.group_purchase_manager" action="action_purchase_order_report_all"/>
  98. </odoo>