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.

135 lines
7.5 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="effective_date"
  47. attrs="{'readonly':[('state','!=','draft')]}"/>
  48. <field name="operation_type"
  49. attrs="{'readonly':[('state','!=','draft')]}"/>
  50. <field name="receiver_not_member"
  51. attrs="{'invisible':[('operation_type','!=','transfer')]}"/>
  52. <field name="partner_id"
  53. options="{'no_create':True}"
  54. attrs="{'readonly':[('state','!=','draft')]}"/>
  55. <field name="partner_id_to"
  56. options="{'no_create':True}"
  57. attrs="{'invisible':['|',('operation_type','!=','transfer'), ('receiver_not_member','=',True)]}"/>
  58. </group>
  59. <group>
  60. <field name="user_id"/>
  61. <field name="share_product_id"
  62. attrs="{'readonly':[('state','!=','draft')]}"
  63. widget="selection"/>
  64. <field name="share_short_name" readonly="True"/>
  65. <field name="share_to_product_id"
  66. attrs="{'invisible':[('operation_type','!=','convert')],'required':[('operation_type','=','convert')],'readonly':[('state','!=','draft')]}"
  67. widget="selection"/>
  68. <field name="share_to_short_name" readonly="True"/>
  69. <field name="quantity"
  70. attrs="{'readonly':[('state','!=','draft')]}"/>
  71. <field name="share_unit_price" readonly="True"/>
  72. <field name="subscription_amount" readonly="True"/>
  73. </group>
  74. </group>
  75. <group>
  76. <field name="subscription_request"
  77. attrs="{'invisible':['|',('operation_type','!=','transfer'),('receiver_not_member','=',False)]}"
  78. context="{'default_is_operation': True, 'default_ordered_parts':quantity,'default_share_product_id': share_product_id, 'default_source':'operation'}">
  79. <tree>
  80. <field name="name"/>
  81. <field name="birthdate"/>
  82. <field name="phone"/>
  83. <field name="email"/>
  84. <field name="iban"/>
  85. <field name="state" invisible="True"/>
  86. </tree>
  87. <form string="Subscription Requests">
  88. <sheet>
  89. <group>
  90. <group>
  91. <field name="name"/>
  92. <field name="firstname"/>
  93. <field name="lastname"/>
  94. <field name="birthdate"/>
  95. <field name="gender"/>
  96. <field name="email"/>
  97. <field name="phone"/>
  98. <field name="iban"/>
  99. </group>
  100. <group>
  101. <field name="address"/>
  102. <field name="zip_code"/>
  103. <field name="city"/>
  104. <field name="country_id"/>
  105. <field name="lang"/>
  106. <field name="validated"/>
  107. <field name="skip_control_ng"/>
  108. <field name="ordered_parts"
  109. invisible="True"/>
  110. <field name="source"
  111. invisible="True"/>
  112. <field name="state"
  113. invisible="True"/>
  114. <field name="share_product_id"
  115. invisible="True"/>
  116. </group>
  117. </group>
  118. </sheet>
  119. </form>
  120. </field>
  121. </group>
  122. </sheet>
  123. </form>
  124. </field>
  125. </record>
  126. <record id="operation_request_action" model="ir.actions.act_window">
  127. <field name="name">Operation request</field>
  128. <field name="res_model">operation.request</field>
  129. <field name="view_type">form</field>
  130. <field name="view_id" ref="operation_request_tree"/>
  131. </record>
  132. </odoo>