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.

108 lines
5.6 KiB

  1. <openerp>
  2. <data>
  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" colors="green:state in ('approved'); blue:state in ('draft');grey: state in ('done')">
  8. <field name="request_date"/>
  9. <field name="effective_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" name="submit_operation" states="draft"/>
  25. <button string="Approve" type="object" name="approve_operation" states="waiting"/>
  26. <button string="Refuse" type="object" name="refuse_operation" states="waiting"/>
  27. <button string="Cancel" type="object" name="cancel_operation" states="draft,waiting,approved"/>
  28. <button string="Draft" type="object" name="reset_to_draft" states="waiting,cancelled"/>
  29. <button string="Execute" type="object" name="execute_operation" states="approved"/>
  30. <field name="state" widget="statusbar" statusbar_visible="draft,done,cancelled,refused" statusbar_colors='{"draft":"grey","done":"green","cancelled":"orange","refused":"red"}'/>
  31. </header>
  32. <sheet>
  33. <group>
  34. <group>
  35. <field name="request_date" attrs="{'readonly':[('state','!=','draft')]}"/>
  36. <field name="effective_date" attrs="{'readonly':[('state','!=','draft')]}"/>
  37. <field name="operation_type" attrs="{'readonly':[('state','!=','draft')]}"/>
  38. <field name="receiver_not_member" attrs="{'invisible':[('operation_type','!=','transfer')],'readonly':[('state','!=','draft')]}"/>
  39. <field name="partner_id" options="{'no_create':True}" attrs="{'readonly':[('state','!=','draft')]}"/>
  40. <field name="partner_id_to" options="{'no_create':True}" attrs="{'invisible':['|',('operation_type','!=','transfer'), ('receiver_not_member','=',True)],'readonly':[('state','!=','draft')]}"/>
  41. </group>
  42. <group>
  43. <field name="user_id"/>
  44. <field name="share_product_id" attrs="{'readonly':[('state','!=','draft')]}" widget="selection"/>
  45. <field name="share_short_name" readonly="True"/>
  46. <field name="share_to_product_id" attrs="{'invisible':[('operation_type','!=','convert')],'required':[('operation_type','=','convert')],'readonly':[('state','!=','draft')]}" widget="selection"/>
  47. <field name="share_to_short_name" readonly="True"/>
  48. <field name="quantity" attrs="{'readonly':[('state','!=','draft')]}"/>
  49. <field name="share_unit_price" readonly="True"/>
  50. <field name="subscription_amount" readonly="True" />
  51. </group>
  52. </group>
  53. <group>
  54. <field name="subscription_request" attrs="{'invisible':['|',('operation_type','!=','transfer'),('receiver_not_member','=',False)]}" context="{'default_is_operation': True, 'default_ordered_parts':quantity,'default_share_product_id': share_product_id, 'default_source':'operation'}">
  55. <tree>
  56. <field name="name"/>
  57. <field name="email"/>
  58. <field name="birthdate"/>
  59. <field name="phone"/>
  60. <field name="iban"/>
  61. <field name="state" invisible="True"/>
  62. </tree>
  63. <form string="Subscription Requests">
  64. <sheet>
  65. <group>
  66. <group>
  67. <field name="name"/>
  68. <field name="firstname"/>
  69. <field name="lastname"/>
  70. <field name="email"/>
  71. <field name="birthdate"/>
  72. <field name="gender"/>
  73. <field name="phone"/>
  74. <field name="iban"/>
  75. </group>
  76. <group>
  77. <field name="address"/>
  78. <field name="zip_code"/>
  79. <field name="city"/>
  80. <field name="country_id"/>
  81. <field name="lang"/>
  82. <field name="validated"/>
  83. <field name="skip_control_ng"/>
  84. <field name="ordered_parts" invisible="True"/>
  85. <field name="source" invisible="True"/>
  86. <field name="state" invisible="True"/>
  87. <field name="share_product_id" invisible="True"/>
  88. </group>
  89. </group>
  90. </sheet>
  91. </form>
  92. </field>
  93. </group>
  94. </sheet>
  95. </form>
  96. </field>
  97. </record>
  98. <record id="operation_request_action" model="ir.actions.act_window">
  99. <field name="name">Operation request</field>
  100. <field name="res_model">operation.request</field>
  101. <field name="view_type">form</field>
  102. <field name="view_id" ref="operation_request_tree"/>
  103. </record>
  104. </data>
  105. </openerp>