purchase_views.xml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <?xml version="1.0"?>
  2. <odoo>
  3. <record id="purchase_order_form_inherit" model="ir.ui.view">
  4. <field name="name">purchase.order.form.inherit</field>
  5. <field name="model">purchase.order</field>
  6. <field name="inherit_id" ref="purchase.purchase_order_form"/>
  7. <field name="arch" type="xml">
  8. <field name="partner_id" position="replace">
  9. <field name="is_quantity_copy" invisible="1"/>
  10. <field name="partner_id" widget="res_partner_many2one" context="{'res_partner_search_mode': 'supplier', 'show_vat': True}" attrs="{'readonly': ['|', ('is_quantity_copy', '=', 'none'), ('state', 'in', ['purchase', 'done', 'cancel'])]}" placeholder="Name, TIN, Email, or Reference" force_save="1"/>
  11. </field>
  12. <field name="partner_ref" position="after">
  13. <field name="requisition_id" domain="[('state', 'in', ('in_progress', 'open', 'ongoing')), ('vendor_id', 'in', (partner_id, False)), ('company_id', '=', company_id)]"
  14. options="{'no_create': True}"/>
  15. </field>
  16. <xpath expr="//page[@name='purchase_delivery_invoice']" position="after">
  17. <page string="Alternatives" name="alternative_pos">
  18. <group>
  19. <group>
  20. <p colspan="2">Create a call for tender by adding alternative request for quotations to different vendors.
  21. Make your choice by selecting the best combination of lead time, OTD and/or total amount.
  22. By comparing product lines you can also decide to order some products from one vendor and others from another vendor.</p>
  23. </group>
  24. <group>
  25. <p colspan="2">
  26. <button name="action_create_alternative" type="object" class="btn-link d-block" string="Create Alternative" icon="fa-copy"/>
  27. <button name="action_compare_alternative_lines" type="object" class="btn-link d-block" string="Compare Product Lines" icon="fa-bar-chart" attrs="{'invisible': [('alternative_po_ids', '=', [])]}"/>
  28. </p>
  29. </group>
  30. </group>
  31. <field name="alternative_po_ids" attrs="{'readonly': [('id', '=', False)]}" widget="many2many_alt_pos" context="{'quotation_only': True}">
  32. <tree string="Alternative Purchase Order" decoration-muted="state in ['cancel', 'purchase', 'done']" decoration-bf="id == parent.id">
  33. <control>
  34. <create string="Link to Existing RfQ"/>
  35. </control>
  36. <field name="partner_id"/>
  37. <field name="name" string="Reference"/>
  38. <field name="date_planned"/>
  39. <field name="amount_total"/>
  40. <field name="state"/>
  41. </tree>
  42. </field>
  43. </page>
  44. </xpath>
  45. </field>
  46. </record>
  47. <record id="purchase_order_search_inherit" model="ir.ui.view">
  48. <field name="name">purchase.order.list.select.inherit</field>
  49. <field name="model">purchase.order</field>
  50. <field name="inherit_id" ref="purchase.view_purchase_order_filter"/>
  51. <field name="arch" type="xml">
  52. <xpath expr="//filter[@name='approved']" position="after">
  53. <filter string="Requisition" name="requisition" domain="[('requisition_id', '!=', False)]" help="Purchase Orders with requisition"/>
  54. </xpath>
  55. </field>
  56. </record>
  57. <record id="purchase_order_kpis_tree_inherit_purchase_requisition" model="ir.ui.view">
  58. <field name="name">purchase.order.kpis.tree.inherit.purchase.requisition</field>
  59. <field name="model">purchase.order</field>
  60. <field name="inherit_id" ref="purchase.purchase_order_kpis_tree"/>
  61. <field name="arch" type="xml">
  62. <field name="name" position="before">
  63. <field name="has_alternatives" invisible="1"/>
  64. <button class="fa fa-copy"
  65. title="Has Alternatives"
  66. disabled="1"
  67. attrs="{'invisible': [('has_alternatives', '=', False)]}"/>
  68. </field>
  69. </field>
  70. </record>
  71. <record id="purchase_order_tree_inherit_purchase_requisition" model="ir.ui.view">
  72. <field name="name">purchase.order.tree.inherit.purchase.requisition</field>
  73. <field name="model">purchase.order</field>
  74. <field name="inherit_id" ref="purchase.purchase_order_tree"/>
  75. <field name="arch" type="xml">
  76. <field name="name" position="before">
  77. <field name="has_alternatives" invisible="1"/>
  78. <button class="fa fa-copy"
  79. title="Has Alternatives"
  80. disabled="1"
  81. attrs="{'invisible': [('has_alternatives', '=', False)]}"/>
  82. </field>
  83. </field>
  84. </record>
  85. <record id="purchase_order_line_compare_tree" model="ir.ui.view">
  86. <field name="name">purchase.order.line.compare.tree</field>
  87. <field name="model">purchase.order.line</field>
  88. <field name="priority">1000</field>
  89. <field name="arch" type="xml">
  90. <tree string="Purchase Order Lines"
  91. decoration-muted="state in ['cancel', 'purchase', 'done']"
  92. create="0" delete="0" edit="0" expand="1"
  93. js_class="purchase_order_line_compare">
  94. <header>
  95. <button name="action_clear_quantities" string="Clear Selected" type="object" class="o_clear_qty_buttons"/>
  96. </header>
  97. <field name="product_id" readonly="1"/>
  98. <field name="partner_id" string="Vendor"/>
  99. <field name="order_id" string="Reference" readonly="1"/>
  100. <field name="state"/>
  101. <field name="name" readonly="1"/>
  102. <field name="date_planned" readonly="1"/>
  103. <field name="product_qty"/>
  104. <field name="product_uom" groups="uom.group_uom"/>
  105. <field name="price_unit"/>
  106. <field name="price_subtotal" string="Total"/>
  107. <field name="currency_id"/>
  108. <button name="action_choose" string="Choose" type="object" class="o_clear_qty_buttons" icon="fa-bullseye"
  109. attrs="{'invisible': [('product_qty', '&lt;=', 0.0)]}"/>
  110. <button name="action_clear_quantities" string="Clear" type="object" class="o_clear_qty_buttons" icon="fa-times"
  111. attrs="{'invisible': ['|', ('product_qty', '&lt;=', 0.0), ('state', 'in', ['cancel', 'purchase', 'done'])]}"/>
  112. </tree>
  113. </field>
  114. </record>
  115. </odoo>