[FIX] sale_project: fix the traceback when doing action on the stat button of the project sharing view

Reason for traceback:

When an internal user clicks on the 'Sale Order', 'Invoice' or 'Ticket' state button, opens
Backend view. But the portal backend does not support chatter. So comes the traceback.
In this commit, we open the portal view.

task-2973173

closes odoo/odoo#102707

X-original-commit: 0df9b1ea93535d127475b89cc9d59ecc5e25b0aa
Related: odoo/enterprise#32538
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
This commit is contained in:
Sarika Shekhada
2022-10-08 10:41:50 +02:00
committed by Prakash Prajapati
parent 88887ce425
commit 2d89f7d58d
+7 -9
View File
@@ -558,15 +558,13 @@ class ProjectTask(models.Model):
def action_project_sharing_view_so(self):
self.ensure_one()
if self.user_has_groups('base.group_portal'):
if not self.display_sale_order_button:
return {}
return {
"name": "Portal Sale Order",
"type": "ir.actions.act_url",
"url": self.sale_order_id.access_url,
}
return self.action_view_so()
if not self.display_sale_order_button:
return {}
return {
"name": "Portal Sale Order",
"type": "ir.actions.act_url",
"url": self.sale_order_id.access_url,
}
def _rating_get_partner(self):
partner = self.partner_id or self.sale_line_id.order_id.partner_id