diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py index 37dffb764ea..820f9a25cd0 100644 --- a/addons/mail/models/mail_thread.py +++ b/addons/mail/models/mail_thread.py @@ -2480,7 +2480,7 @@ class MailThread(models.AbstractModel): ( 'user', lambda pdata: pdata['type'] == 'user', - {} + {'has_button_access': True} ), ( 'portal', lambda pdata: pdata['type'] == 'portal', diff --git a/addons/portal/models/portal_mixin.py b/addons/portal/models/portal_mixin.py index bbd9576c094..be4f9e762cb 100644 --- a/addons/portal/models/portal_mixin.py +++ b/addons/portal/models/portal_mixin.py @@ -73,7 +73,7 @@ class PortalMixin(models.AbstractModel): new_group = [ ('portal_customer', lambda pdata: pdata['id'] == customer.id, { - 'has_button_access': False, + 'has_button_access': True, 'button_access': { 'url': access_link, }, diff --git a/addons/project/models/project.py b/addons/project/models/project.py index 1d14da9bc35..42bf5d445c2 100644 --- a/addons/project/models/project.py +++ b/addons/project/models/project.py @@ -1975,7 +1975,7 @@ class Task(models.Model): {} )) portal_privacy = self.project_id.privacy_visibility == 'portal' - for group_name, group_method, group_data in groups: + for group_name, _group_method, group_data in groups: if group_name in ('customer', 'user') or group_name == 'portal_customer' and not portal_privacy: group_data['has_button_access'] = False elif group_name == 'portal_customer' and portal_privacy: diff --git a/addons/sale/models/sale_order.py b/addons/sale/models/sale_order.py index 168a09deb9f..3fda7ef1349 100644 --- a/addons/sale/models/sale_order.py +++ b/addons/sale/models/sale_order.py @@ -1069,20 +1069,6 @@ class SaleOrder(models.Model): transaction = self.get_portal_last_transaction() return (self.state == 'sent' or (self.state == 'draft' and include_draft)) and not self.is_expired and self.require_payment and transaction.state != 'done' and self.amount_total - def _notify_get_groups(self, msg_vals=None): - """ Give access button to users and portal customer as portal is integrated - in sale. Customer and portal group have probably no right to see - the document so they don't have the access button. """ - groups = super(SaleOrder, self)._notify_get_groups(msg_vals=msg_vals) - - self.ensure_one() - if self.state not in ('draft', 'cancel'): - for group_name, group_method, group_data in groups: - if group_name not in ('customer', 'portal'): - group_data['has_button_access'] = True - - return groups - def preview_sale_order(self): self.ensure_one() return {