[FIX] website_slides: make content stat button redirection match counters
Course content counters count only published content while content stat button redirects to all contents. Solution to this mismatch is to apply a search filter on button action to display published ontent by default. Also remove unnecessary action. Using a type="edit" seems sufficient, no need to define a python method just for that purpose. Task 2067324 (counters / action on content mismatch) PR #36756
This commit is contained in:
@@ -481,18 +481,12 @@ class Channel(models.Model):
|
||||
if removed_channel_partner_domain:
|
||||
self.env['slide.channel.partner'].sudo().search(removed_channel_partner_domain).unlink()
|
||||
|
||||
def action_view(self):
|
||||
return {
|
||||
'type': 'ir.actions.act_window',
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'slide.channel',
|
||||
'res_id': self.id,
|
||||
}
|
||||
|
||||
def action_view_slides(self):
|
||||
action = self.env.ref('website_slides.slide_slide_action').read()[0]
|
||||
action['context'] = {'default_channel_id': self.id}
|
||||
action['context'] = {
|
||||
'search_default_published': 1,
|
||||
'default_channel_id': self.id
|
||||
}
|
||||
action['domain'] = [('channel_id', "=", self.id), ('is_category', '=', False)]
|
||||
return action
|
||||
|
||||
|
||||
@@ -236,7 +236,7 @@
|
||||
<div class="o_kanban_card_header">
|
||||
<div class="o_kanban_card_header_title mb16">
|
||||
<div class="o_primary">
|
||||
<a name="action_view" type="object" class="mr-auto">
|
||||
<a type="edit" class="mr-auto">
|
||||
<span><field name="name" class="o_primary"/></span>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user