sale_view.xml 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?xml version="1.0"?>
  2. <openerp>
  3. <data>
  4. <!-- sale.order -->
  5. <record id="view_price_security_order_form" model="ir.ui.view">
  6. <field name="name">price_security.order.form</field>
  7. <field name="model">sale.order</field>
  8. <field name="inherit_id" ref="sale.view_order_form"/>
  9. <field name="groups_id" eval="[(6, 0, [ref('group_restrict_prices')])]"/>
  10. <field name="arch" type="xml">
  11. <xpath expr="//field[@name='order_line']/form" position="inside">
  12. <field name="product_can_modify_prices" invisible="1"/>
  13. </xpath>
  14. <xpath expr="//field[@name='order_line']/tree" position="inside">
  15. <field name="product_can_modify_prices" invisible="1"/>
  16. </xpath>
  17. <!-- add readonly price unit on tree -->
  18. <xpath expr="//field[@name='order_line']/tree//field[@name='price_unit']" position="after">
  19. <field name="price_unit_readonly" attrs="{'readonly': [('product_can_modify_prices','=', False)]}"/>
  20. </xpath>
  21. <!-- make price unit invisible on tree -->
  22. <xpath expr="//field[@name='order_line']/tree//field[@name='price_unit']" position="attributes">
  23. <attribute name="invisible">1</attribute>
  24. </xpath>
  25. <!-- add readonly tax on tree -->
  26. <xpath expr="//field[@name='order_line']/tree//field[@name='tax_id']" position="after">
  27. <field name="tax_id_readonly" attrs="{'readonly': [('product_can_modify_prices','=', False)]}" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]" widget="many2many_tags"/>
  28. </xpath>
  29. <!-- make tax invisible on tree -->
  30. <xpath expr="//field[@name='order_line']/tree//field[@name='tax_id']" position="attributes">
  31. <attribute name="invisible">1</attribute>
  32. </xpath>
  33. <!-- add readonly price unit on form -->
  34. <xpath expr="//field[@name='order_line']/form//field[@name='price_unit']" position="after">
  35. <field name="price_unit_readonly" attrs="{'readonly': [('product_can_modify_prices','=', False)]}"/>
  36. </xpath>
  37. <!-- make price unit invisible on form -->
  38. <xpath expr="//field[@name='order_line']/form//field[@name='price_unit']" position="attributes">
  39. <attribute name="invisible">1</attribute>
  40. </xpath>
  41. <!-- add readonly tax on form -->
  42. <xpath expr="//field[@name='order_line']/form//field[@name='tax_id']" position="after">
  43. <field name="tax_id_readonly" attrs="{'readonly': [('product_can_modify_prices','=', False)]}" domain="[('parent_id','=',False),('type_tax_use','&lt;&gt;','purchase')]" widget="many2many_tags"/>
  44. </xpath>
  45. <!-- make tax invisible on form -->
  46. <xpath expr="//field[@name='order_line']/form//field[@name='tax_id']" position="attributes">
  47. <attribute name="invisible">1</attribute>
  48. </xpath>
  49. </field>
  50. </record>
  51. </data>
  52. </openerp>