Skip to content
Permalink
Browse files

[FIX] website_crm_partner_assign: stage breadcrumb in order

If the stage breadcrumb on the portal view is too long, it could get on
two lines but since they are righ-aligned in inversed order, the second
line (or more) will be the first stages.

With this fix, the breadcrumbs are left-aligned so on two line the
second line are the last breadcrumbs.

Also there was possibly a different order than backend since the order
is on "sequence, name, id" in backend but was just "sequence" here.

opw-1934497
closes #31237
  • Loading branch information...
nle-odoo committed Feb 19, 2019
1 parent d12c993 commit ed1200d047313e81f1a427110ab3fe4f3a3ab192
@@ -170,7 +170,7 @@ def portal_my_opportunity(self, opp, **kw):
"website_crm_partner_assign.portal_my_opportunity", {
'opportunity': opp,
'user_activity': opp.sudo().activity_ids.filtered(lambda activity: activity.user_id == request.env.user)[:1],
'stages': request.env['crm.stage'].search([('probability', '!=', '100')], order='sequence desc'),
'stages': request.env['crm.stage'].search([('probability', '!=', '100')], order='sequence desc, name desc, id desc'),
'activity_types': request.env['mail.activity.type'].sudo().search([]),
'states': request.env['res.country.state'].sudo().search([]),
'countries': request.env['res.country'].sudo().search([]),
@@ -510,12 +510,12 @@
</div>
<div class="col-md text-md-right">
<div class="d-inline-block">
<small class="mr-2"><b>Stage:</b></small>
<div t-foreach="stages" t-as="stage" class="float-right">
<small class="mr-2 mt-1 float-left"><b>Stage:</b></small>
<div t-foreach="stages[::-1]" t-as="stage" class="float-left">
<i t-if="not stage_first" class="fa fa-chevron-right ml-2 mr-1 small" style="opacity: 0.5"/>
<button type="button" t-att-data="stage.id" t-att-opp="opportunity.id" t-attf-class="btn btn-sm px-2 opp-stage-button #{'btn-secondary' if opportunity.stage_id.name != stage.name else 'btn-primary disabled'}">
<span t-field="stage.name"/>
</button>
<i t-if="not stage_first" class="fa fa-chevron-right ml-1 mr-2 small" style="opacity: 0.5"/>
</div>
</div>
</div>

0 comments on commit ed1200d

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.