purchase.xml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <openerp>
  3. <data>
  4. <record id="purchase_order_form" model="ir.ui.view">
  5. <field name="name">purchase_order_form</field>
  6. <field name="model">purchase.order</field>
  7. <field name="inherit_id" ref="purchase.purchase_order_form"/>
  8. <field name="arch" type="xml">
  9. <button name="wkf_send_rfq" states="draft" position="replace">
  10. <button name="wkf_send_rfq" states="draft" string="Email" type="object" context="{'send_rfq':True}" class="oe_highlight"/>
  11. </button>
  12. <button name="wkf_send_rfq" states="sent" position="replace">
  13. <button name="wkf_send_rfq" states="sent" string="Email" type="object" context="{'send_rfq':True}"/>
  14. </button>
  15. <button name="wkf_send_rfq" states="approved" position="replace">
  16. <button name="wkf_send_rfq" states="approved" string="Email" type="object" context="{'send_rfq':False}"/>
  17. </button>
  18. <button name="print_quotation" states="draft" position="replace">
  19. <button name="print_quotation" string="Imprimir" type="object" states="draft" class="oe_highlight" groups="base.group_user"/>
  20. </button>
  21. <button name="print_quotation" states="sent" position="replace">
  22. <button name="print_quotation" string="Imprimir" type="object" states="sent" groups="base.group_user"/>
  23. </button>
  24. <button name="action_cancel" states="draft,confirmed,sent,bid,approved,except_picking,except_invoice" position="replace">
  25. <button name="action_cancel" states="draft,confirmed,sent,bid,approved,except_picking,except_invoice" string="Cancelar" type="object" />
  26. </button>
  27. <button name="purchase_confirm" states="draft" position="replace">
  28. <button name="purchase_confirm" states="draft" string="Confirmar" id="draft_confirm"/>
  29. </button>
  30. <button name="purchase_confirm" states="bid" position="replace">
  31. <button name="purchase_confirm" states="bid" string="Confirm Order" class="oe_highlight" id="bid_confirm"/>
  32. </button>
  33. </field>
  34. </record>
  35. <!-- MAKE READONLY -->
  36. <record id="readonly_purchase_form" model="ir.ui.view">
  37. <field name="name">readonly_purchase_form</field>
  38. <field name="model">purchase.order</field>
  39. <field name="inherit_id" ref="purchase.purchase_order_form"/>
  40. <field name="arch" type="xml">
  41. <xpath expr="//field[@name='pricelist_id']" position="attributes">
  42. <attribute name="readonly">1</attribute>
  43. </xpath>
  44. <xpath expr="//field[@name='picking_type_id']" position="attributes">
  45. <attribute name="readonly">1</attribute>
  46. </xpath>
  47. <xpath expr="//field[@name='location_id']" position="attributes">
  48. <attribute name="readonly">1</attribute>
  49. </xpath>
  50. </field>
  51. </record>
  52. <!-- MAKE EDITABLE FOR MANAGER -->
  53. <record id="editable_purchase_form" model="ir.ui.view">
  54. <field name="name">editable_purchase_form</field>
  55. <field name="model">purchase.order</field>
  56. <field name="inherit_id" ref="fields_security_dikasa.readonly_purchase_form"/>
  57. <field name="groups_id" eval="[(6, 0, [ref('purchase.group_purchase_manager')])]"/>
  58. <field name="arch" type="xml">
  59. <xpath expr="//field[@name='pricelist_id']" position="attributes">
  60. <attribute name="readonly">0</attribute>
  61. </xpath>
  62. <xpath expr="//field[@name='picking_type_id']" position="attributes">
  63. <attribute name="readonly">0</attribute>
  64. </xpath>
  65. <xpath expr="//field[@name='location_id']" position="attributes">
  66. <attribute name="readonly">0</attribute>
  67. </xpath>
  68. </field>
  69. </record>
  70. </data>
  71. </openerp>