sale_view.xml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <openerp>
  3. <data>
  4. <record id="view_order_confirm_form" model="ir.ui.view">
  5. <field name="name">sale.order.form - Confirm</field>
  6. <field name="model">sale.order</field>
  7. <field name="inherit_id" ref="sale.view_order_form"/>
  8. <field name="arch" type="xml">
  9. <!-- Confirmación rápida -->
  10. <button name="action_button_confirm" states="sent" position="after">
  11. <button name="order_process_now" string="Procesar Venta" type="object" states="draft,sent" groups="base.group_user"/>
  12. </button>
  13. <!-- Confirmar pedido -->
  14. <button name="action_button_confirm" position="replace">
  15. <button name="action_button_confirm" states="draft" string="Confirm Sale" type="object" groups="base.group_user" invisible="1"/>
  16. </button>
  17. <button name="action_button_confirm" position="replace">
  18. <button name="action_button_confirm" states="sent" string="Confirm Sale" class="oe_highlight" type="object" groups="base.group_user" invisible="1"/>
  19. </button>
  20. <!-- Cancelar cotización (Hacer visible en estado 'draft') -->
  21. <button name="action_cancel" position="replace">
  22. <button name="action_cancel" states="draft, sent" string="Cancel Quotation" type="object" groups="base.group_user" invisible="0"/> <!-- Cambiar invisible="1" a invisible="0" -->
  23. </button>
  24. <!-- Cancelar pedido -->
  25. <button name="action_cancel" position="replace">
  26. <button name="action_cancel" states="manual,progress" string="Cancel Order" type="object" groups="base.group_user" invisible="1"/>
  27. </button>
  28. </field>
  29. </record>
  30. <record id="order_process_now_action" model="ir.actions.server">
  31. <field name="name">Fast Confirm</field>
  32. <field name="model_id" ref="model_sale_order"/>
  33. <field name="state">code</field>
  34. <field name="code">
  35. if context.get('active_model') == 'sale.order' and context.get('active_ids'):
  36. self.order_process_now(cr, uid, context['active_ids'], context=context)
  37. </field>
  38. </record>
  39. <record id="ir_order_process_now" model="ir.values">
  40. <field eval="'client_action_multi'" name="key2"/>
  41. <field eval="'sale.order'" name="model"/>
  42. <field name="name">Fast Confirm</field>
  43. <field eval="'ir.actions.server,%d'%order_process_now_action" name="value"/>
  44. </record>
  45. </data>
  46. </openerp>