Skip to content
Snippets Groups Projects
Commit 81b5ef93 authored by Krzysztof Magusiak's avatar Krzysztof Magusiak
Browse files

[FIX] sale_project: filter on tasks linked to the sale


In the case where we have multiple projects, we also want to filter on
tasks linked to the SO. In the current implmementation, the default sale
order passed in the context is used to filter by name which results in
including tasks where name of the SO contains the name of the SO instead
of being equal.

opw-3499181

closes odoo/odoo#135771

Signed-off-by: default avatarAudric Onockx (auon) <auon@odoo.com>
parent 38058e5d
Branches
Tags
No related merge requests found
......@@ -97,7 +97,6 @@ class SaleOrder(models.Model):
if len(task_projects) == 1 and len(self.tasks_ids) > 1: # redirect to task of the project (with kanban stage, ...)
action = self.with_context(active_id=task_projects.id).env['ir.actions.actions']._for_xml_id(
'project.act_project_project_2_project_task_all')
action['domain'] = [('id', 'in', self.tasks_ids.ids)]
if action.get('context'):
eval_context = self.env['ir.actions.actions']._get_eval_context()
eval_context.update({'active_id': task_projects.id})
......@@ -113,6 +112,7 @@ class SaleOrder(models.Model):
action['views'] = [(form_view_id, 'form')]
action['res_id'] = self.tasks_ids.id
# filter on the task of the current SO
action['domain'] = [('id', 'in', self.tasks_ids.ids)]
action.setdefault('context', {})
action['context'].update({'search_default_sale_order_id': self.id})
return action
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment