[Add] Added Upstream Patch For website_blog,website_event,website_forum
This commit is contained in:
parent
750aef6e5f
commit
16b77ebcb9
@ -233,7 +233,7 @@ class BlogPost(models.Model):
|
||||
return super(BlogPost, self).get_access_action(access_uid)
|
||||
return {
|
||||
'type': 'ir.actions.act_url',
|
||||
'url': self.url,
|
||||
'url': self.website_url,
|
||||
'target': 'self',
|
||||
'target_type': 'public',
|
||||
'res_id': self.id,
|
||||
|
@ -79,7 +79,7 @@ class Event(models.Model):
|
||||
event.menu_id = root_menu
|
||||
|
||||
existing_page_names = event.menu_id.child_id.mapped('name')
|
||||
required_page_names = [entry[0] for entry in self._get_menu_entries()]
|
||||
required_page_names = [entry[0] for entry in event._get_menu_entries()]
|
||||
standard_page_names = self._get_standard_menu_entries_names()
|
||||
|
||||
# remove entries that should not exist anymore
|
||||
@ -87,11 +87,11 @@ class Event(models.Model):
|
||||
submenu_to_delete.unlink()
|
||||
|
||||
# create missing entries
|
||||
for sequence, (name, url, xml_id) in enumerate(self._get_menu_entries()):
|
||||
for sequence, (name, url, xml_id) in enumerate(event._get_menu_entries()):
|
||||
if name not in existing_page_names:
|
||||
if not url:
|
||||
newpath = self.env['website'].new_page(name + ' ' + self.name, template=xml_id, ispage=False)['url']
|
||||
url = "/event/" + slug(self) + "/page/" + newpath[1:]
|
||||
newpath = self.env['website'].new_page(name + ' ' + event.name, template=xml_id, ispage=False)['url']
|
||||
url = "/event/" + slug(event) + "/page/" + newpath[1:]
|
||||
self.env['website.menu'].create({
|
||||
'name': name,
|
||||
'url': url,
|
||||
|
@ -509,7 +509,7 @@ class Post(models.Model):
|
||||
self.env.user.sudo().add_karma(post.forum_id.karma_gen_answer_accept * mult)
|
||||
if 'tag_ids' in vals:
|
||||
tag_ids = set(tag.get('id') for tag in self.resolve_2many_commands('tag_ids', vals['tag_ids']))
|
||||
if any(set(post.tag_ids) != tag_ids for post in self) and any(self.env.user.karma < post.forum_id.karma_edit_retag for post in self):
|
||||
if any(set(post.tag_ids.ids) != tag_ids for post in self) and any(self.env.user.karma < post.forum_id.karma_edit_retag for post in self):
|
||||
raise KarmaError(_('Not enough karma to retag.'))
|
||||
if any(key not in trusted_keys for key in vals) and any(not post.can_edit for post in self):
|
||||
raise KarmaError('Not enough karma to edit a post.')
|
||||
|
@ -620,7 +620,7 @@
|
||||
<div t-if="not is_answer">
|
||||
<br/>
|
||||
<input type="hidden" name="karma_edit_retag" t-attf-value="#{forum.karma_edit_retag}" id="karma_edit_retag"/>
|
||||
<input type="text" name="post_tags" class="form-control col-md-9 js_select2" placeholder="Tags" t-attf-data-init-value="#{tags}" value="Tags"/>
|
||||
<input type="text" name="post_tags" class="form-control col-md-9 js_select2" placeholder="Tags" t-attf-data-init-value="#{tags}" value="Tags" t-att-readonly="user.karma < forum.karma_edit_retag" t-att-title="'You need to have sufficient karma to edit tags' if user.karma < forum.karma_edit_retag else ''"/>
|
||||
<br/>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary btn-lg">Save</button>
|
||||
|
Loading…
Reference in New Issue
Block a user