Code has been refactored since 8.0
This commit is contained in:
@@ -320,6 +320,17 @@ class Post(models.Model):
|
||||
self.env.user.sudo().add_karma(post.forum_id.karma_gen_question_new)
|
||||
return post
|
||||
|
||||
@api.multi
|
||||
@api.depends('name', 'post_type')
|
||||
def name_get(self):
|
||||
result = []
|
||||
for post in self:
|
||||
if post.post_type == 'discussion' and post.parent_id and not post.name:
|
||||
result.append((post.id, '%s (%s)' % (post.parent_id.name, post.id)))
|
||||
else:
|
||||
result.append((post.id, '%s' % (post.name)))
|
||||
return result
|
||||
|
||||
@api.multi
|
||||
def write(self, vals):
|
||||
if 'content' in vals:
|
||||
|
||||
@@ -727,7 +727,10 @@
|
||||
t-field="answer.create_uid"
|
||||
t-field-options='{"widget": "contact", "country_image": true, "fields": ["name", "country_id"]}'
|
||||
style="display: inline-block;"/>
|
||||
<div class="text-muted">On <span t-field="answer.create_date" t-field-options='{"format":"short"}'/></div>
|
||||
<div class="text-muted">
|
||||
<a t-attf-href="/forum/#{slug(question.forum_id)}/question/#{slug(question)}#answer_#{answer.id}">On</a>
|
||||
<span t-field="answer.create_date" t-field-options='{"format":"short"}'/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix"><span t-field="answer.content" class="oe_no_empty"/></div>
|
||||
<div class="clearfix">
|
||||
|
||||
Reference in New Issue
Block a user