[REM] mail, forum: remove hack to add buttons in forum notifications
It has been solved using the standard way of managing buttons in notification emails. At least we hope it.
This commit is contained in:
@@ -76,7 +76,7 @@
|
||||
</div>
|
||||
</div>
|
||||
% endif
|
||||
% if not ctx['is_discussion'] or not len(ctx['actions']) == 0 or ctx.get('button_access') or ctx.get('is_accessible'):
|
||||
% if not ctx['is_discussion'] or not len(ctx['actions']) == 0 or ctx.get('button_access'):
|
||||
<div summary="o_mail_notification">
|
||||
<table cellspacing="0" cellpadding="0" border="0" style="width: 100%; margin-top: 5px;">
|
||||
<tbody><tr>
|
||||
|
||||
@@ -114,11 +114,6 @@ class Message(models.Model):
|
||||
for message in self:
|
||||
message.needaction = message in my_messages
|
||||
|
||||
@api.multi
|
||||
def _is_accessible(self):
|
||||
self.ensure_one()
|
||||
return False
|
||||
|
||||
@api.model
|
||||
def _search_needaction(self, operator, operand):
|
||||
if operator == '=' and operand:
|
||||
|
||||
@@ -86,7 +86,6 @@ class Partner(models.Model):
|
||||
'tracking': tracking,
|
||||
'is_discussion': is_discussion,
|
||||
'subtype': message.subtype_id,
|
||||
'is_accessible': message._is_accessible()
|
||||
}
|
||||
|
||||
@api.model
|
||||
|
||||
@@ -911,12 +911,3 @@ class Tags(models.Model):
|
||||
if self.env.user.karma < forum.karma_tag_create:
|
||||
raise KarmaError(_('Not enough karma to create a new Tag'))
|
||||
return super(Tags, self.with_context(mail_create_nolog=True, mail_create_nosubscribe=True)).create(vals)
|
||||
|
||||
class Message(models.Model):
|
||||
_name = 'mail.message'
|
||||
_inherit = ['mail.message']
|
||||
|
||||
@api.multi
|
||||
def _is_accessible(self):
|
||||
res = super(Message, self)._is_accessible()
|
||||
return self.model == 'forum.post' or res
|
||||
|
||||
Reference in New Issue
Block a user