product_views.xml 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <!-- Product Suppliers-->
  4. <record id="product_supplierinfo_tree_view2" model="ir.ui.view">
  5. <field name="name">product.supplierinfo.tree.view2</field>
  6. <field name="model">product.supplierinfo</field>
  7. <field name="inherit_id" ref="product.product_supplierinfo_tree_view"/>
  8. <field name="mode">primary</field>
  9. <field name="priority" eval="1000"/>
  10. <field name="arch" type="xml">
  11. <xpath expr="//tree" position="attributes">
  12. <attribute name="editable">bottom</attribute>
  13. </xpath>
  14. <xpath expr="//tree" position="inside">
  15. <field name="company_id" invisible="1"/>
  16. </xpath>
  17. <xpath expr="//field[@name='company_id']" position="attributes">
  18. <attribute name="readonly">0</attribute>
  19. <attribute name="optional">hide</attribute>
  20. </xpath>
  21. <xpath expr="//field[@name='partner_id']" position="attributes">
  22. <attribute name="readonly">0</attribute>
  23. </xpath>
  24. <xpath expr="//field[@name='product_id']" position="attributes">
  25. <attribute name="readonly">0</attribute>
  26. <attribute name="options">{'no_create': True, 'no_open': True}</attribute>
  27. </xpath>
  28. <xpath expr="//field[@name='delay']" position="attributes">
  29. <attribute name="optional">show</attribute>
  30. </xpath>
  31. </field>
  32. </record>
  33. <record id="view_product_supplier_inherit" model="ir.ui.view">
  34. <field name="name">product.template.supplier.form.inherit</field>
  35. <field name="model">product.template</field>
  36. <field name="inherit_id" ref="product.product_template_form_view"/>
  37. <field name="arch" type="xml">
  38. <xpath expr="//page[@name='purchase']" position="attributes">
  39. <attribute name="invisible">0</attribute>
  40. </xpath>
  41. <group name="purchase" position="before">
  42. <field name="seller_ids" context="{'default_product_tmpl_id':context.get('product_tmpl_id',active_id), 'product_template_invisible_variant': True, 'tree_view_ref':'purchase.product_supplierinfo_tree_view2'}" nolabel="1" attrs="{'invisible': [('product_variant_count','&gt;',1)], 'readonly': [('product_variant_count','&gt;',1)]}"/>
  43. <field name="variant_seller_ids" context="{'model': active_model, 'active_id': active_id, 'tree_view_ref':'purchase.product_supplierinfo_tree_view2'}" nolabel="1" attrs="{'invisible': [('product_variant_count','&lt;=',1)], 'readonly': [('product_variant_count','&lt;=',1)]}"/>
  44. </group>
  45. <group name="bill" position="attributes">
  46. <attribute name="groups">purchase.group_purchase_manager</attribute>
  47. </group>
  48. <group name="bill" position="inside">
  49. <field name="purchase_method" widget="radio"/>
  50. </group>
  51. <group name="purchase" position="inside">
  52. <group col="1">
  53. <group string="Purchase Description">
  54. <field name="description_purchase" nolabel="1" colspan="2"
  55. placeholder="This note is added to purchase orders."/>
  56. </group>
  57. <group string="Warning when Purchasing this Product" groups="purchase.group_warning_purchase">
  58. <field name="purchase_line_warn" nolabel="1" colspan="2"/>
  59. <field name="purchase_line_warn_msg" colspan="2" nolabel="1" placeholder="Type a message..."
  60. attrs="{'required':[('purchase_line_warn','!=','no-message')],'readonly':[('purchase_line_warn','=','no-message')], 'invisible':[('purchase_line_warn','=','no-message')]}"/>
  61. </group>
  62. </group>
  63. </group>
  64. </field>
  65. </record>
  66. <record id="view_product_account_purchase_ok_form" model="ir.ui.view">
  67. <field name="name">product.template.account.purchase.ok.form.inherit</field>
  68. <field name="model">product.template</field>
  69. <field name="inherit_id" ref="account.product_template_form_view"/>
  70. <field name="arch" type="xml">
  71. <field name="property_account_expense_id" position="attributes">
  72. <attribute name="attrs">{'readonly': [('purchase_ok', '=', 0)]}</attribute>
  73. </field>
  74. <field name='supplier_taxes_id' position="replace" >
  75. <field name="supplier_taxes_id" colspan="2" widget="many2many_tags" attrs="{'readonly':[('purchase_ok','=',0)]}" context="{'default_type_tax_use':'purchase'}"/>
  76. </field>
  77. </field>
  78. </record>
  79. <record id="view_product_template_purchase_buttons_from" model="ir.ui.view">
  80. <field name="name">product.template.purchase.button.inherit</field>
  81. <field name="model">product.template</field>
  82. <field name="inherit_id" ref="product.product_template_only_form_view"/>
  83. <field name="arch" type="xml">
  84. <div name="button_box" position="inside">
  85. <button class="oe_stat_button" name="action_view_po"
  86. groups="purchase.group_purchase_user"
  87. type="object" icon="fa-credit-card" attrs="{'invisible': [('purchase_ok', '=', False)]}" help="Purchased in the last 365 days">
  88. <div class="o_field_widget o_stat_info">
  89. <span class="o_stat_value">
  90. <field name="purchased_product_qty" widget="statinfo" nolabel="1" class="mr4"/>
  91. <field name="uom_name"/>
  92. </span>
  93. <span class="o_stat_text">Purchased</span>
  94. </div>
  95. </button>
  96. </div>
  97. </field>
  98. </record>
  99. <record id="product_normal_form_view_inherit_purchase" model="ir.ui.view">
  100. <field name="name">product.product.purchase.order</field>
  101. <field name="model">product.product</field>
  102. <field name="inherit_id" ref="product.product_normal_form_view"/>
  103. <field name="arch" type="xml">
  104. <div name="button_box" position="inside">
  105. <button class="oe_stat_button" name="action_view_po"
  106. groups="purchase.group_purchase_user"
  107. type="object" icon="fa-credit-card" attrs="{'invisible': [('purchase_ok', '=', False)]}" help="Purchased in the last 365 days">
  108. <div class="o_field_widget o_stat_info">
  109. <span class="o_stat_value">
  110. <field name="purchased_product_qty" widget="statinfo" nolabel="1" class="mr4"/>
  111. <field name="uom_name"/>
  112. </span>
  113. <span class="o_stat_text">Purchased</span>
  114. </div>
  115. </button>
  116. </div>
  117. </field>
  118. </record>
  119. </odoo>