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.

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