Browse Source

[IMP] emc: merge cooperator and company subscription request menus

pull/26/head^2
robin.keunen 5 years ago
parent
commit
078dd7ebcf
  1. 1
      easy_my_coop/views/menus.xml
  2. 48
      easy_my_coop/views/subscription_request_view.xml

1
easy_my_coop/views/menus.xml

@ -8,7 +8,6 @@
<menuitem name="Share Management" id="menu_easy_my_coop_main_subscription" parent="menu_main_easy_my_coop" groups="easy_my_coop.group_easy_my_coop_manager" sequence="10" /> <menuitem name="Share Management" id="menu_easy_my_coop_main_subscription" parent="menu_main_easy_my_coop" groups="easy_my_coop.group_easy_my_coop_manager" sequence="10" />
<menuitem name="Subscriptions" id="menu_easy_my_coop_subscription_request" action="subscription_request_action" parent="menu_easy_my_coop_main_subscription" sequence="110" /> <menuitem name="Subscriptions" id="menu_easy_my_coop_subscription_request" action="subscription_request_action" parent="menu_easy_my_coop_main_subscription" sequence="110" />
<menuitem name="Company Subscription" id="menu_easy_my_coop_company_subscription_request" action="company_subscription_request_action" parent="menu_easy_my_coop_main_subscription" sequence="120" />
<menuitem name="Register Payment" id="menu_action_invoice_tree_coop" action="action_invoice_tree_coop" parent="menu_easy_my_coop_main_subscription" groups="easy_my_coop.group_easy_my_coop_user" sequence="130" /> <menuitem name="Register Payment" id="menu_action_invoice_tree_coop" action="action_invoice_tree_coop" parent="menu_easy_my_coop_main_subscription" groups="easy_my_coop.group_easy_my_coop_user" sequence="130" />
<menuitem name="Cooperator Candidates" id="menu_easy_my_coop_cooperator_candidate" action="action_partner_cooperator_candidate_form" parent="menu_easy_my_coop_main_subscription" sequence="140" /> <menuitem name="Cooperator Candidates" id="menu_easy_my_coop_cooperator_candidate" action="action_partner_cooperator_candidate_form" parent="menu_easy_my_coop_main_subscription" sequence="140" />
<menuitem name="Subscription Register" id="menu_easy_my_coop_subscription_register" action="subscription_register_action" parent="menu_easy_my_coop_main_subscription" sequence="150" /> <menuitem name="Subscription Register" id="menu_easy_my_coop_subscription_register" action="subscription_register_action" parent="menu_easy_my_coop_main_subscription" sequence="150" />

48
easy_my_coop/views/subscription_request_view.xml

@ -5,8 +5,9 @@
<field name="name">subscription.request.tree</field> <field name="name">subscription.request.tree</field>
<field name="model">subscription.request</field> <field name="model">subscription.request</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree string="Cooperator Subscriptions Request" colors="red:validated == False; blue:state in ('draft');grey: state in ('done')">
<tree string="Subscription Requests" colors="red:validated == False; blue:state in ('draft'); grey: state in ('done')">
<field name="name"/> <field name="name"/>
<field name="company_name"/>
<field name="date" string="Request Date"/> <field name="date" string="Request Date"/>
<field name="type"/> <field name="type"/>
<field name="share_short_name" string="Share Type"/> <field name="share_short_name" string="Share Type"/>
@ -104,10 +105,10 @@
<search string="Search Subscription Request"> <search string="Search Subscription Request">
<field name="name"/> <field name="name"/>
<separator/> <separator/>
<filter string="draft" name="state_draft" domain="[('state','=','draft')]"/>
<filter string="done" name="state_done" domain="[('state','=','done')]"/>
<filter string="Draft" name="state_draft" domain="[('state','=','draft')]"/>
<filter string="Done" name="state_done" domain="[('state','=','done')]"/>
<separator/> <separator/>
<filter string="Unvalid" name="Unvalid" domain="[('validated', '=', False)]"/>
<filter string="Not Validated" name="Not Validated" domain="[('validated', '=', False)]"/>
<group expand="0" name="group_by" string="Group By"> <group expand="0" name="group_by" string="Group By">
<filter name="request_type" string="Request type" context="{'group_by' : 'type'}" /> <filter name="request_type" string="Request type" context="{'group_by' : 'type'}" />
<filter name="date_month" string="Date Month" context="{'group_by': 'date'}"/> <filter name="date_month" string="Date Month" context="{'group_by': 'date'}"/>
@ -117,50 +118,15 @@
</record> </record>
<record id="subscription_request_action" model="ir.actions.act_window"> <record id="subscription_request_action" model="ir.actions.act_window">
<field name="name">Cooperator Subscription</field>
<field name="name">Subscriptions</field>
<field name="res_model">subscription.request</field> <field name="res_model">subscription.request</field>
<field name="view_type">form</field> <field name="view_type">form</field>
<field name="domain">[('is_company','=',False),('is_operation','=',False)]</field>
<field name="domain">[('is_operation','=',False)]</field>
<field name="context">{'default_source':'manual'}</field> <field name="context">{'default_source':'manual'}</field>
<field name="view_id" ref="subscription_request_tree"/> <field name="view_id" ref="subscription_request_tree"/>
<field name="search_view_id" ref="view_subscription_request_filter"/> <field name="search_view_id" ref="view_subscription_request_filter"/>
</record> </record>
<record id="company_subscription_request_tree" model="ir.ui.view">
<field name="name">subscription.request.tree</field>
<field name="model">subscription.request</field>
<field name="arch" type="xml">
<tree string="Company Cooperator Subscriptions Request" colors="red:validated == False; blue:state in ('draft');grey: state in ('done')">
<field name="company_name"/>
<field name="name"/>
<field name="date" string="Request Date"/>
<field name="type"/>
<field name="share_short_name" string="Share Type"/>
<field name="ordered_parts" string="Quantity" sum="Total ordered parts"/>
<field name="subscription_amount" sum="Total amount"/>
<field name="email"/>
<field name="iban"/>
<field name="partner_id"/>
<field name="source"/>
<field name="state"/>
<field name="validated" invisible="True"/>
<button type="object" title="Validate" aria-label="Validate" name="validate_subscription_request" attrs="{'invisible':['|',('state','!=','draft'),('validated','=',False)]}" icon="STOCK_MEDIA_PLAY" />
<button type="object" title="Block" aria-label="Block" name="block_subscription_request" states="draft" groups="easy_my_coop.group_easy_my_coop_user" icon="gtk-cancel"/>
<button type="object" title="Unblock" aria-label="Unblock" name="unblock_subscription_request" states="block" groups="easy_my_coop.group_easy_my_coop_manager" icon="gtk-jump-to"/>
</tree>
</field>
</record>
<record id="company_subscription_request_action" model="ir.actions.act_window">
<field name="name">Company Subscription</field>
<field name="res_model">subscription.request</field>
<field name="view_type">form</field>
<field name="domain">[('is_company','=',True),('is_operation','=',False)]</field>
<field name="context">{'default_is_company': True,'default_source':'manual'}</field>
<field name="view_id" ref="company_subscription_request_tree"/>
<field name="search_view_id" ref="view_subscription_request_filter"/>
</record>
<record id="share_line_form" model="ir.ui.view"> <record id="share_line_form" model="ir.ui.view">
<field name="name">share.line.form</field> <field name="name">share.line.form</field>
<field name="model">share.line</field> <field name="model">share.line</field>

Loading…
Cancel
Save