You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

114 lines
4.5 KiB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <!-- views-->
  4. <!--tree-->
  5. <record id="purchase_order_generator_tree" model="ir.ui.view">
  6. <field name="name">purchase.order.generator.tree</field>
  7. <field name="model">purchase.order.generator</field>
  8. <field name="arch" type="xml">
  9. <tree>
  10. <field name="name"/>
  11. <field name="supplier_id"/>
  12. <field name="order_date"/>
  13. <field name="date_planned"/>
  14. <field name="total_amount"/>
  15. </tree>
  16. </field>
  17. </record>
  18. <!-- form -->
  19. <record id="purchase_order_generator_form" model="ir.ui.view">
  20. <field name="name">purchase.order.generator.form</field>
  21. <field name="model">purchase.order.generator</field>
  22. <field name="arch" type="xml">
  23. <form>
  24. <header>
  25. <button type="object"
  26. name="create_purchase_order"
  27. string="Create Purchase Order"
  28. class="oe_highlight"/>
  29. </header>
  30. <sheet>
  31. <group>
  32. <group>
  33. <field name="supplier_id"/>
  34. <field name="order_date"/>
  35. <field name="date_planned"/>
  36. <field name="total_amount"/>
  37. <field name="generated_purchase_order_ids"
  38. invisible='1'/>
  39. </group>
  40. <div name="buttons" class="oe_right oe_button_box">
  41. <button class="oe_inline oe_stat_button"
  42. type="object"
  43. icon="fa-shopping-cart"
  44. name="get_generated_po_action"
  45. help="Generated Purchase Orders">
  46. <field string="Purchase orders"
  47. name="generated_po_count"
  48. widget="statinfo"/>
  49. </button>
  50. </div>
  51. </group>
  52. <field name="pog_line_ids"
  53. context="{'cpo_seller_id': supplier_id}">
  54. <tree name="order_lines" string="Order Lines"
  55. editable='bottom'>
  56. <field name="product_template_id"/>
  57. <field name="qty_available" readonly='1'/>
  58. <field name="virtual_available" readonly='1'/>
  59. <field name="uom_id" readonly='1'/>
  60. <field name="daily_sales" readonly='1'/>
  61. <field name="stock_coverage" readonly='1'/>
  62. <field name="virtual_coverage" readonly='1'/>
  63. <field name="product_price" readonly='1'/>
  64. <field name="uom_po_id" readonly='1'/>
  65. <field name="purchase_quantity"/>
  66. <field name="subtotal" readonly='1'/>
  67. </tree>
  68. </field>
  69. </sheet>
  70. </form>
  71. </field>
  72. </record>
  73. <!-- filters-->
  74. <record id="purchase_order_generator_filter" model="ir.ui.view">
  75. <field name="model">purchase.order.generator</field>
  76. <field name="arch" type="xml">
  77. <search>
  78. <field name="supplier_id"/>
  79. </search>
  80. </field>
  81. </record>
  82. <!-- Menu item -->
  83. <record id="action_purchase_order_generator" model="ir.actions.act_window">
  84. <field name="name">Purchase Order Generators</field>
  85. <field name="res_model">purchase.order.generator</field>
  86. </record>
  87. <menuitem id="purchase_order_generator"
  88. parent="purchase.menu_procurement_management"
  89. action="action_purchase_order_generator"/>
  90. <!-- Actions -->
  91. <record id="action_generate_pog" model="ir.actions.server">
  92. <field name="name">Generate Purchase Order</field>
  93. <field name="model_id" ref="model_purchase_order_generator"/>
  94. <field name="binding_model_id" ref="product.model_product_template"/>
  95. <field name="state">code</field>
  96. <field name="code">
  97. action = model.test_generate_pog()
  98. </field>
  99. </record>
  100. </odoo>