You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

133 lines
7.3 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <odoo>
  3. <record id="operation_request_tree" model="ir.ui.view">
  4. <field name="name">operation.request.tree</field>
  5. <field name="model">operation.request</field>
  6. <field name="arch" type="xml">
  7. <tree string="Operation requests"
  8. colors="green:state in ('approved'); blue:state in ('draft');grey: state in ('done')">
  9. <field name="request_date"/>
  10. <field name="partner_id"/>
  11. <field name="operation_type"/>
  12. <field name="quantity"/>
  13. <field name="user_id"/>
  14. <field name="state"/>
  15. </tree>
  16. </field>
  17. </record>
  18. <record id="operation_request_form" model="ir.ui.view">
  19. <field name="name">operation.request.form</field>
  20. <field name="model">operation.request</field>
  21. <field name="arch" type="xml">
  22. <form string="Operation request">
  23. <header>
  24. <button string="Submit" type="object"
  25. name="submit_operation" states="draft"/>
  26. <button string="Approve" type="object"
  27. name="approve_operation" states="waiting"/>
  28. <button string="Refuse" type="object"
  29. name="refuse_operation" states="waiting"/>
  30. <button string="Cancel" type="object"
  31. name="cancel_operation"
  32. states="draft,waiting,approved"/>
  33. <button string="Draft" type="object" name="reset_to_draft"
  34. states="waiting,cancelled"/>
  35. <button string="Execute" type="object"
  36. name="execute_operation" states="approved"/>
  37. <field name="state" widget="statusbar"
  38. statusbar_visible="draft,done,cancelled,refused"
  39. statusbar_colors='{"draft":"grey","done":"green","cancelled":"orange","refused":"red"}'/>
  40. </header>
  41. <sheet>
  42. <group>
  43. <group>
  44. <field name="request_date"
  45. attrs="{'readonly':[('state','!=','draft')]}"/>
  46. <field name="operation_type"
  47. attrs="{'readonly':[('state','!=','draft')]}"/>
  48. <field name="receiver_not_member"
  49. attrs="{'invisible':[('operation_type','!=','transfer')]}"/>
  50. <field name="partner_id"
  51. options="{'no_create':True}"
  52. attrs="{'readonly':[('state','!=','draft')]}"/>
  53. <field name="partner_id_to"
  54. options="{'no_create':True}"
  55. attrs="{'invisible':['|',('operation_type','!=','transfer'), ('receiver_not_member','=',True)]}"/>
  56. </group>
  57. <group>
  58. <field name="user_id"/>
  59. <field name="share_product_id"
  60. attrs="{'readonly':[('state','!=','draft')]}"
  61. widget="selection"/>
  62. <field name="share_short_name" readonly="True"/>
  63. <field name="share_to_product_id"
  64. attrs="{'invisible':[('operation_type','!=','convert')],'required':[('operation_type','=','convert')],'readonly':[('state','!=','draft')]}"
  65. widget="selection"/>
  66. <field name="share_to_short_name" readonly="True"/>
  67. <field name="quantity"
  68. attrs="{'readonly':[('state','!=','draft')]}"/>
  69. <field name="share_unit_price" readonly="True"/>
  70. <field name="subscription_amount" readonly="True"/>
  71. </group>
  72. </group>
  73. <group>
  74. <field name="subscription_request"
  75. attrs="{'invisible':['|',('operation_type','!=','transfer'),('receiver_not_member','=',False)]}"
  76. context="{'default_is_operation': True, 'default_ordered_parts':quantity,'default_share_product_id': share_product_id, 'default_source':'operation'}">
  77. <tree>
  78. <field name="name"/>
  79. <field name="birthdate"/>
  80. <field name="phone"/>
  81. <field name="email"/>
  82. <field name="iban"/>
  83. <field name="state" invisible="True"/>
  84. </tree>
  85. <form string="Subscription Requests">
  86. <sheet>
  87. <group>
  88. <group>
  89. <field name="name"/>
  90. <field name="firstname"/>
  91. <field name="lastname"/>
  92. <field name="birthdate"/>
  93. <field name="gender"/>
  94. <field name="email"/>
  95. <field name="phone"/>
  96. <field name="iban"/>
  97. </group>
  98. <group>
  99. <field name="address"/>
  100. <field name="zip_code"/>
  101. <field name="city"/>
  102. <field name="country_id"/>
  103. <field name="lang"/>
  104. <field name="validated"/>
  105. <field name="skip_control_ng"/>
  106. <field name="ordered_parts"
  107. invisible="True"/>
  108. <field name="source"
  109. invisible="True"/>
  110. <field name="state"
  111. invisible="True"/>
  112. <field name="share_product_id"
  113. invisible="True"/>
  114. </group>
  115. </group>
  116. </sheet>
  117. </form>
  118. </field>
  119. </group>
  120. </sheet>
  121. </form>
  122. </field>
  123. </record>
  124. <record id="operation_request_action" model="ir.actions.act_window">
  125. <field name="name">Operation request</field>
  126. <field name="res_model">operation.request</field>
  127. <field name="view_type">form</field>
  128. <field name="view_id" ref="operation_request_tree"/>
  129. </record>
  130. </odoo>