[IMP] account: display access buttons in notification email only on not draft not canceled invoices
Indeed draft and canceled invoices should not be displayed to customer or portal customers.
This commit is contained in:
@@ -875,10 +875,11 @@ class AccountInvoice(models.Model):
|
||||
def _notification_recipients(self, message, groups):
|
||||
groups = super(AccountInvoice, self)._notification_recipients(message, groups)
|
||||
|
||||
for group_name, group_method, group_data in groups:
|
||||
if group_name == 'customer':
|
||||
continue
|
||||
group_data['has_button_access'] = True
|
||||
if self.state not in ('draft', 'cancel'):
|
||||
for group_name, group_method, group_data in groups:
|
||||
if group_name == 'customer':
|
||||
continue
|
||||
group_data['has_button_access'] = True
|
||||
|
||||
return groups
|
||||
|
||||
|
||||
Reference in New Issue
Block a user