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.

158 lines
9.3 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="date"/>
  65. <field name="source"/>
  66. <field name="activities_address" attrs="{'invisible':[('is_company','=',False)]}"/>
  67. <field name="activities_zip_code" attrs="{'invisible':[('is_company','=',False)]}"/>
  68. <field name="activities_city" attrs="{'invisible':[('is_company','=',False)]}"/>
  69. <field name="activities_country_id" attrs="{'invisible':[('is_company','=',False)]}"/>
  70. <field name="ordered_parts"/>
  71. <field name="share_product_id"/>
  72. <field name="share_short_name"/>
  73. <field name="share_unit_price"/>
  74. <field name="subscription_amount"/>
  75. <field name="partner_id"/>
  76. <field name="type"/>
  77. <field name="lang"/>
  78. <field name="validated"/>
  79. <field name="skip_control_ng"/>
  80. </group>
  81. </group>
  82. </sheet>
  83. </form>
  84. </field>
  85. </record>
  86. <record id="view_subscription_request_filter" model="ir.ui.view">
  87. <field name="name">Cooperator Subscription Search</field>
  88. <field name="model">subscription.request</field>
  89. <field name="arch" type="xml">
  90. <search string="Search Subscription Request">
  91. <field name="name"
  92. filter_domain="['|',('name','ilike',self),('email','ilike',self)]"/>
  93. <separator/>
  94. <filter string="draft" name="state_draft" domain="[('state','=','draft')]"/>
  95. <filter string="done" name="state_done" domain="[('state','=','done')]"/>
  96. <separator/>
  97. <filter string="Unvalid" name="Unvalid" domain="[('validated', '=', False)]"/>
  98. <group expand="0" name="group_by" string="Group By">
  99. <filter string="Request type" context="{'group_by' : 'type'}" />
  100. <!-- <filter string="Part type" context="{'group_by': 'share_short_name'}"/> -->
  101. <filter string="Date Month" context="{'group_by': 'date'}"/>
  102. </group>
  103. </search>
  104. </field>
  105. </record>
  106. <record id="subscription_request_action" model="ir.actions.act_window">
  107. <field name="name">Cooperator Subscription</field>
  108. <field name="res_model">subscription.request</field>
  109. <field name="view_type">form</field>
  110. <field name="domain">[('is_company','=',False),('is_operation','=',False)]</field>
  111. <field name="context">{'default_source':'manual'}</field>
  112. <field name="view_id" ref="subscription_request_tree"/>
  113. <field name="search_view_id" ref="view_subscription_request_filter"/>
  114. </record>
  115. <menuitem action="subscription_request_action" name="Cooperator Subscription" id="menu_easy_my_coop_subscription_request" parent="menu_easy_my_coop_main_subscription" sequence="10"/>
  116. <record id="company_subscription_request_tree" model="ir.ui.view">
  117. <field name="name">subscription.request.tree</field>
  118. <field name="model">subscription.request</field>
  119. <field name="arch" type="xml">
  120. <tree string="Company Cooperator Subscriptions Request" colors="red:validated == False; blue:state in ('draft');grey: state in ('done')">
  121. <field name="company_name"/>
  122. <field name="name"/>
  123. <field name="date" string="Request Date"/>
  124. <field name="type"/>
  125. <field name="share_short_name" string="Share Type"/>
  126. <field name="ordered_parts" string="Quantity" sum="Total ordered parts"/>
  127. <field name="subscription_amount" sum="Total amount"/>
  128. <field name="email"/>
  129. <field name="iban"/>
  130. <field name="partner_id"/>
  131. <field name="source"/>
  132. <field name="state"/>
  133. <field name="validated" invisible="True"/>
  134. <button type="object" name="validate_subscription_request" attrs="{'invisible':['|',('state','!=','draft'),('validated','=',False)]}" icon="STOCK_MEDIA_PLAY"/>
  135. <button type="object" name="block_subscription_request" states="draft" groups="easy_my_coop.group_energiris_user" icon="gtk-cancel"/>
  136. <button type="object" name="unblock_subscription_request" states="block" groups="easy_my_coop.group_energiris_manager" icon="gtk-jump-to"/>
  137. </tree>
  138. </field>
  139. </record>
  140. <record id="company_subscription_request_action" model="ir.actions.act_window">
  141. <field name="name">Company Subscription</field>
  142. <field name="res_model">subscription.request</field>
  143. <field name="view_type">form</field>
  144. <field name="domain">[('is_company','=',True),('is_operation','=',False)]</field>
  145. <field name="context">{'default_is_company': True,'default_source':'manual'}</field>
  146. <field name="view_id" ref="company_subscription_request_tree"/>
  147. <field name="search_view_id" ref="view_subscription_request_filter"/>
  148. </record>
  149. <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"/>
  150. </data>
  151. </openerp>