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.

155 lines
9.0 KiB

  1. <openerp>
  2. <data>
  3. <menuitem name="Easy-My Coop" id="menu_main_easy_my_coop" sequence="40" groups="easy_my_coop.group_energiris_user"/>
  4. <menuitem name="Subscription" id="menu_easy_my_coop_main_subscription" parent="menu_main_easy_my_coop" sequence="10" groups="easy_my_coop.group_energiris_manager"/>
  5. <record id="subscription_request_tree" model="ir.ui.view">
  6. <field name="name">subscription.request.tree</field>
  7. <field name="model">subscription.request</field>
  8. <field name="arch" type="xml">
  9. <tree string="Cooperator Subscriptions Request" colors="red:validated == False; blue:state in ('draft');grey: state in ('done')">
  10. <field name="name"/>
  11. <field name="date" string="Request Date"/>
  12. <field name="type"/>
  13. <field name="share_short_name" string="Share Type"/>
  14. <field name="ordered_parts" string="Quantity" sum="Total ordered parts"/>
  15. <field name="subscription_amount" sum="Total amount"/>
  16. <field name="email"/>
  17. <field name="iban"/>
  18. <field name="partner_id"/>
  19. <field name="source"/>
  20. <field name="state"/>
  21. <field name="validated" invisible="True"/>
  22. <button type="object" name="validate_subscription_request" attrs="{'invisible':['|',('state','!=','draft'),('validated','=',False)]}" icon="STOCK_MEDIA_PLAY" />
  23. <button type="object" name="block_subscription_request" states="draft" groups="easy_my_coop.group_energiris_user" icon="gtk-cancel"/>
  24. <button type="object" name="unblock_subscription_request" states="block" groups="easy_my_coop.group_energiris_manager" icon="gtk-jump-to"/>
  25. </tree>
  26. </field>
  27. </record>
  28. <record id="subscription_request_form" model="ir.ui.view">
  29. <field name="name">subscription.request.form</field>
  30. <field name="model">subscription.request</field>
  31. <field name="arch" type="xml">
  32. <form string="Subscription Requests">
  33. <header>
  34. <button string="Validate" type="object" name="validate_subscription_request" attrs="{'invisible':['|',('state','!=','draft'),('validated','=',False)]}"/>
  35. <button string="Cancel" type="object" name="cancel_subscription_request" states="draft,done,block" groups="easy_my_coop.group_energiris_manager"/>
  36. <field name="state" widget="statusbar" statusbar_visible="draft,cancelled,done,failed"/>
  37. </header>
  38. <sheet>
  39. <group>
  40. <group>
  41. <field name="already_cooperator"/>
  42. <field name="is_company" invisible="True"/>
  43. <field name="is_operation" invisible="True"/>
  44. <field name="company_name" attrs="{'invisible':[('is_company','=',False)]}"/>
  45. <field name="company_email" attrs="{'invisible':[('is_company','=',False)]}"/>
  46. <field name="company_type" attrs="{'invisible':[('is_company','=',False)]}"/>
  47. <field name="company_register_number" attrs="{'invisible':[('is_company','=',False)]}"/>
  48. <field name="name"/>
  49. <field name="firstname"/>
  50. <field name="lastname"/>
  51. <field name="birthdate"/>
  52. <field name="gender"/>
  53. <field name="email"/>
  54. <field name="phone"/>
  55. <field name="contact_person_function" attrs="{'invisible':[('is_company','=',False)]}"/>
  56. <field name="no_registre"/>
  57. <field name="iban"/>
  58. <field name="address"/>
  59. <field name="zip_code"/>
  60. <field name="city"/>
  61. <field name="country_id"/>
  62. </group>
  63. <group>
  64. <field name="capital_release_request_date" groups="easy_my_coop.group_energiris_super_manager"/>
  65. <field name="date"/>
  66. <field name="source"/>
  67. <field name="ordered_parts"/>
  68. <field name="share_product_id"/>
  69. <field name="share_short_name"/>
  70. <field name="share_unit_price"/>
  71. <field name="subscription_amount"/>
  72. <field name="partner_id"/>
  73. <field name="type"/>
  74. <field name="lang"/>
  75. <field name="validated"/>
  76. <field name="skip_control_ng"/>
  77. </group>
  78. </group>
  79. </sheet>
  80. </form>
  81. </field>
  82. </record>
  83. <record id="view_subscription_request_filter" model="ir.ui.view">
  84. <field name="name">Cooperator Subscription Search</field>
  85. <field name="model">subscription.request</field>
  86. <field name="arch" type="xml">
  87. <search string="Search Subscription Request">
  88. <field name="name"
  89. filter_domain="['|',('name','ilike',self),('email','ilike',self)]"/>
  90. <separator/>
  91. <filter string="draft" name="state_draft" domain="[('state','=','draft')]"/>
  92. <filter string="done" name="state_done" domain="[('state','=','done')]"/>
  93. <separator/>
  94. <filter string="Unvalid" name="Unvalid" domain="[('validated', '=', False)]"/>
  95. <group expand="0" name="group_by" string="Group By">
  96. <filter string="Request type" context="{'group_by' : 'type'}" />
  97. <!-- <filter string="Part type" context="{'group_by': 'share_short_name'}"/> -->
  98. <filter string="Date Month" context="{'group_by': 'date'}"/>
  99. </group>
  100. </search>
  101. </field>
  102. </record>
  103. <record id="subscription_request_action" model="ir.actions.act_window">
  104. <field name="name">Cooperator Subscription</field>
  105. <field name="res_model">subscription.request</field>
  106. <field name="view_type">form</field>
  107. <field name="domain">[('is_company','=',False),('is_operation','=',False)]</field>
  108. <field name="context">{'default_source':'manual'}</field>
  109. <field name="view_id" ref="subscription_request_tree"/>
  110. <field name="search_view_id" ref="view_subscription_request_filter"/>
  111. </record>
  112. <menuitem action="subscription_request_action" name="Cooperator Subscription" id="menu_easy_my_coop_subscription_request" parent="menu_easy_my_coop_main_subscription" sequence="10"/>
  113. <record id="company_subscription_request_tree" model="ir.ui.view">
  114. <field name="name">subscription.request.tree</field>
  115. <field name="model">subscription.request</field>
  116. <field name="arch" type="xml">
  117. <tree string="Company Cooperator Subscriptions Request" colors="red:validated == False; blue:state in ('draft');grey: state in ('done')">
  118. <field name="company_name"/>
  119. <field name="name"/>
  120. <field name="date" string="Request Date"/>
  121. <field name="type"/>
  122. <field name="share_short_name" string="Share Type"/>
  123. <field name="ordered_parts" string="Quantity" sum="Total ordered parts"/>
  124. <field name="subscription_amount" sum="Total amount"/>
  125. <field name="email"/>
  126. <field name="iban"/>
  127. <field name="partner_id"/>
  128. <field name="source"/>
  129. <field name="state"/>
  130. <field name="validated" invisible="True"/>
  131. <button type="object" name="validate_subscription_request" attrs="{'invisible':['|',('state','!=','draft'),('validated','=',False)]}" icon="STOCK_MEDIA_PLAY"/>
  132. <button type="object" name="block_subscription_request" states="draft" groups="easy_my_coop.group_energiris_user" icon="gtk-cancel"/>
  133. <button type="object" name="unblock_subscription_request" states="block" groups="easy_my_coop.group_energiris_manager" icon="gtk-jump-to"/>
  134. </tree>
  135. </field>
  136. </record>
  137. <record id="company_subscription_request_action" model="ir.actions.act_window">
  138. <field name="name">Company Subscription</field>
  139. <field name="res_model">subscription.request</field>
  140. <field name="view_type">form</field>
  141. <field name="domain">[('is_company','=',True),('is_operation','=',False)]</field>
  142. <field name="context">{'default_is_company': True,'default_source':'manual'}</field>
  143. <field name="view_id" ref="company_subscription_request_tree"/>
  144. <field name="search_view_id" ref="view_subscription_request_filter"/>
  145. </record>
  146. <menuitem action="company_subscription_request_action" name="Company Subscription" id="menu_easy_my_coop_company_subscription_request" parent="menu_easy_my_coop_main_subscription" sequence="12"/>
  147. </data>
  148. </openerp>