Skip to content

Commit

Permalink
[IMP] crm, website_crm_partner_assign: clean the controlpanel actions
Browse files Browse the repository at this point in the history
For the model 'crm.lead'

- Rename the action menu 'Send an email' by 'Send email'.
- Remove the action menu 'Mark Late Activities as Done' and
  'Mark All Activities as Done'.
- Set 'Mark as lost' menu action only for the list view.
- Remove the action menu 'Assign salesman of assigned partner'.
- Rename the action menu 'Forward to Partner' by 'Forward to partner'
  and set it for both form and list view.

For the model 'res.partner', remove the actions menu 'Meetings'.

Linked to task 1984526
Related to PR #33720
  • Loading branch information
hbh-odoo authored and tde-banana-odoo committed Jul 10, 2019
1 parent 69cf2c0 commit 701f26c
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 52 deletions.
31 changes: 2 additions & 29 deletions addons/crm/views/crm_lead_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,7 @@
<!--
MASS MAILING
-->
<act_window name="Send an email"
<act_window name="Send email"
res_model="mail.compose.message"
binding_model="crm.lead"
binding_views="list"
Expand Down Expand Up @@ -889,6 +889,7 @@
<field name="name">Mark as lost</field>
<field name="model_id" ref="model_crm_lead"/>
<field name="binding_model_id" ref="crm.model_crm_lead"/>
<field name="binding_view_types">list</field>
<field name="state">code</field>
<field name="code">
if record:
Expand All @@ -898,34 +899,6 @@ if record:
</field>
</record>

<!--
'Mark Late Activities as Done' in action dropdown
-->
<record id="action_mark_late_activities_done" model="ir.actions.server">
<field name="name">Mark Late Activities as Done</field>
<field name="model_id" ref="model_crm_lead"/>
<field name="binding_model_id" ref="crm.model_crm_lead"/>
<field name="state">code</field>
<field name="code">
for rec in records:
rec.activity_ids.filtered(lambda a: a.state == 'overdue').action_feedback(feedback='Closed automatically in batch')
</field>
</record>

<!--
'Mark All Activities as Done' in action dropdown
-->
<record id="action_mark_activities_done" model="ir.actions.server">
<field name="name">Mark All Activities as Done</field>
<field name="model_id" ref="model_crm_lead"/>
<field name="binding_model_id" ref="crm.model_crm_lead"/>
<field name="state">code</field>
<field name="code">
for rec in records:
rec.activity_ids.action_feedback(feedback='Closed automatically in batch')
</field>
</record>

<!--
Menu Actions
-->
Expand Down
9 changes: 0 additions & 9 deletions addons/crm/views/res_partner_views.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
<?xml version="1.0"?>
<odoo>

<!-- open meetings related to given partner -->
<record id="calendar_event_partner" model="ir.actions.act_window">
<field name="name">Meetings</field>
<field name="binding_model_id" ref="base.model_res_partner"/>
<field name="res_model">calendar.event</field>
<field name="view_mode">calendar,tree,form</field>
<field name="context">{'default_partner_ids': [active_id], 'search_default_partner_ids': [active_id]}</field>
</record>

<!-- open opportunities related to given partner -->
<record id="relate_partner_opportunities" model="ir.actions.act_window">
<field name="name">Opportunities</field>
Expand Down
12 changes: 0 additions & 12 deletions addons/website_crm_partner_assign/views/crm_lead_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,4 @@
</field>
</record>

<record id="action_assign_salesman_according_assigned_partner" model="ir.actions.server">
<field name="name">Assign salesman of assigned partner</field>
<field name="model_id" ref="model_crm_lead"/>
<field name="binding_model_id" ref="model_crm_lead"/>
<field name="state">code</field>
<field name="code">
if env.context.get('active_domain'):
records = model.search(env.context['active_domain'])
records.assign_salesman_of_assigned_partner()
</field>
</record>

</odoo>
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
</record>

<act_window id="action_crm_send_mass_forward"
name="Forward to Partner" res_model="crm.lead.forward.to.partner"
binding_model="crm.lead" binding_views="list"
name="Forward to partner" res_model="crm.lead.forward.to.partner"
binding_model="crm.lead"
view_mode="form" target="new"
groups="sales_team.group_sale_manager"
context="{'default_composition_mode' : 'mass_mail'}" view_id="crm_lead_forward_to_partner_form" />
Expand Down

0 comments on commit 701f26c

Please sign in to comment.