sale_discount_approval_workflow.xml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <openerp>
  3. <data>
  4. <record id="sale_inherit_wkfform_view" model="ir.ui.view">
  5. <field name="name">sale.order.workflow.inherit</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. <!-- Statusbar widget should also contain the new status -->
  10. <field name="state" position="replace">
  11. <field name="state" widget="statusbar" statusbar_visible="draft,sent,progress,done" statusbar_colors='{"invoice_except":"red","waiting_date":"blue"}'/>
  12. </field>
  13. <field name="state" position="before">
  14. <!-- buttonz -->
  15. <button string="Approve Order" type="workflow" name="order_confirm" states="waitingapproval" class="oe_highlight" groups="base.group_sale_manager"/>
  16. </field>
  17. <xpath expr="//button[@name='action_cancel']" position="attributes">
  18. <attribute name ="states">waitingapproval,manual,progress</attribute>
  19. </xpath>
  20. <xpath expr="//button[@name='action_cancel']" position="attributes">
  21. <attribute name ="states">waitingapproval,manual,progress</attribute>
  22. </xpath>
  23. </field>
  24. </record>
  25. <!--activity-->
  26. <record id="act_approve" model="workflow.activity">
  27. <field name="wkf_id" ref="sale.wkf_sale"/>
  28. <field name="name">Waiting Approval</field>
  29. <field name="kind">function</field>
  30. <field name="action">wait_approval()</field>
  31. </record>
  32. <!--end of activity-->
  33. <!--transitions-->
  34. <record model="workflow.transition" id="sale.trans_draft_router">
  35. <field name="act_from" ref="sale.act_draft"/>
  36. <field name="act_to" ref="act_approve"/>
  37. <field name="signal">order_toapprov</field>
  38. </record>
  39. <record id="sale_trans_draft_router" model="workflow.transition">
  40. <field name="act_from" ref="sale.act_draft"/>
  41. <field name="act_to" ref="sale.act_router"/>
  42. <field name="signal">order_confirm</field>
  43. </record>
  44. <record id="sale_trans_approvd" model="workflow.transition">
  45. <field name="act_from" ref="act_approve"/>
  46. <field name="act_to" ref="sale.act_router"/>
  47. <field name="signal">order_confirm</field>
  48. </record>
  49. <!--end of transition-->
  50. <!--sale transition inherit-->
  51. <record id="sale.trans_draft_sent" model="workflow.transition">
  52. <field name="act_from" ref="sale.act_draft"/>
  53. <field name="act_to" ref="sale.act_sent"/>
  54. <field name="signal">quotation_sent</field>
  55. </record>
  56. <record id="sale.trans_draft_cancel" model="workflow.transition">
  57. <field name="act_from" ref="sale.act_draft"/>
  58. <field name="act_to" ref="sale.act_cancel"/>
  59. <field name="signal">cancel</field>
  60. </record>
  61. <record id="sale.trans_sent_router" model="workflow.transition">
  62. <field name="act_from" ref="sale.act_sent"/>
  63. <field name="act_to" ref="sale.act_router"/>
  64. <field name="signal">order_confirm</field>
  65. </record>
  66. <record id="sale.trans_sent_cancel" model="workflow.transition">
  67. <field name="act_from" ref="sale.act_sent"/>
  68. <field name="act_to" ref="sale.act_cancel"/>
  69. <field name="signal">cancel</field>
  70. </record>
  71. <record id="sale.trans_router_wait_invoice" model="workflow.transition">
  72. <field name="act_from" ref="sale.act_router"/>
  73. <field name="act_to" ref="sale.act_wait_invoice"/>
  74. </record>
  75. <record id="sale.trans_wait_invoice_all_lines_invoiced" model="workflow.transition">
  76. <field name="act_from" ref="sale.act_wait_invoice"/>
  77. <field name="act_to" ref="sale.act_invoice_end"/>
  78. <field name="signal">all_lines</field>
  79. </record>
  80. <record id="sale.trans_wait_invoice_cancel2" model="workflow.transition">
  81. <field name="act_from" ref="sale.act_wait_invoice"/>
  82. <field name="act_to" ref="sale.act_cancel2"/>
  83. <field name="signal">cancel</field>
  84. </record>
  85. <record id="sale.trans_wait_invoice_invoice_manual" model="workflow.transition">
  86. <field name="act_from" ref="sale.act_wait_invoice"/>
  87. <field name="act_to" ref="sale.act_invoice"/>
  88. <field name="signal">manual_invoice</field>
  89. </record>
  90. <record id="sale.trans_invoice_invoice_end" model="workflow.transition">
  91. <field name="act_from" ref="sale.act_invoice"/>
  92. <field name="act_to" ref="sale.act_invoice_end"/>
  93. <field name="signal">subflow.paid</field>
  94. </record>
  95. <record id="sale.trans_invoice_invoice_except" model="workflow.transition">
  96. <field name="act_from" ref="sale.act_invoice"/>
  97. <field name="act_to" ref="sale.act_invoice_except"/>
  98. <field name="signal">subflow.cancel</field>
  99. </record>
  100. <record id="sale.trans_invoice_except_invoice" model="workflow.transition">
  101. <field name="act_from" ref="sale.act_invoice_except"/>
  102. <field name="act_to" ref="sale.act_invoice"/>
  103. <field name="signal">invoice_recreate</field>
  104. </record>
  105. <record id="sale.trans_invoice_except_invoice_end" model="workflow.transition">
  106. <field name="act_from" ref="sale.act_invoice_except"/>
  107. <field name="act_to" ref="sale.act_invoice_end"/>
  108. <field name="signal">invoice_corrected</field>
  109. </record>
  110. <record id="sale.trans_invoice_except_invoice_cancel" model="workflow.transition">
  111. <field name="act_from" ref="sale.act_invoice_except"/>
  112. <field name="act_to" ref="sale.act_invoice_cancel"/>
  113. <field name="signal">invoice_cancel</field>
  114. </record>
  115. <record id="sale.trans_invoice_end_done" model="workflow.transition">
  116. <field name="act_from" ref="sale.act_invoice_end"/>
  117. <field name="act_to" ref="sale.act_done"/>
  118. </record>
  119. <!--end of sale transitions-->
  120. </data>
  121. </openerp>