product_view.xml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?xml version="1.0"?>
  2. <openerp>
  3. <data>
  4. <!-- add can modify pries -->
  5. <record id="product_template_only_form_view" model="ir.ui.view">
  6. <field name="name">price_security.product.form</field>
  7. <field name="model">product.template</field>
  8. <field name="inherit_id" ref="product.product_template_only_form_view"/>
  9. <field name="arch" type="xml">
  10. <xpath expr="//page[@string='Information']/group/group" position="inside">
  11. <field name="can_modify_prices"/>
  12. </xpath>
  13. </field>
  14. </record>
  15. <record id="product_normal_form_view" model="ir.ui.view">
  16. <field name="name">price_security.product.form</field>
  17. <field name="model">product.product</field>
  18. <field name="inherit_id" ref="product.product_normal_form_view"/>
  19. <field name="arch" type="xml">
  20. <xpath expr="//page[@string='Information']/group/group" position="inside">
  21. <field name="can_modify_prices"/>
  22. </xpath>
  23. </field>
  24. </record>
  25. <!-- make readonly for group_restrict_prices -->
  26. <record id="product_readonly_template_only_form_view" model="ir.ui.view">
  27. <field name="name">price_security.product.form</field>
  28. <field name="model">product.template</field>
  29. <field name="inherit_id" ref="product_template_only_form_view"/>
  30. <field name="groups_id" eval="[(6, 0, [ref('group_restrict_prices')])]"/>
  31. <field name="arch" type="xml">
  32. <field name="list_price" position="attributes">
  33. <attribute name="readonly">1</attribute>
  34. </field>
  35. <field name="can_modify_prices" position="attributes">
  36. <attribute name="readonly">1</attribute>
  37. </field>
  38. </field>
  39. </record>
  40. <record id="product_readonly_normal_form_view" model="ir.ui.view">
  41. <field name="name">price_security.product.form</field>
  42. <field name="model">product.product</field>
  43. <field name="inherit_id" ref="product_normal_form_view"/>
  44. <field name="groups_id" eval="[(6, 0, [ref('group_restrict_prices')])]"/>
  45. <field name="arch" type="xml">
  46. <field name="lst_price" position="attributes">
  47. <attribute name="readonly">1</attribute>
  48. </field>
  49. <field name="can_modify_prices" position="attributes">
  50. <attribute name="readonly">1</attribute>
  51. </field>
  52. </field>
  53. </record>
  54. <record id="product_pricelist_form_view" model="ir.ui.view">
  55. <field name="name">product.pricelist.form</field>
  56. <field name="model">product.pricelist</field>
  57. <field name="inherit_id" ref="product.product_pricelist_view"/>
  58. <field name="arch" type="xml">
  59. <field name="active" position="after">
  60. <field name="sequence"/>
  61. </field>
  62. </field>
  63. </record>
  64. <record id="product_pricelist_view_tree" model="ir.ui.view">
  65. <field name="name">product.pricelist.tree</field>
  66. <field name="model">product.pricelist</field>
  67. <field name="inherit_id" ref="product.product_pricelist_view_tree"/>
  68. <field name="arch" type="xml">
  69. <field name="name" position="before">
  70. <field name="sequence" widget="handle"/>
  71. </field>
  72. </field>
  73. </record>
  74. </data>
  75. </openerp>