[IMP] website_slides: publish content when publishing slide
Purpose of this commit is to avoid de-synchronization where content could be unpublished whereas slide was published. Task ID 2239840 closes odoo/odoo#49908 X-original-commit: d0f4a3e85eab63e335766a823185fd6ada6e07b4 Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is contained in:
committed by
Thibault Delavallée
parent
297641da69
commit
03e62ac8ad
@@ -1,6 +1,7 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import ir_http
|
||||
from . import gamification_challenge
|
||||
from . import slide_slide
|
||||
from . import slide_question
|
||||
@@ -10,4 +11,4 @@ from . import res_config_settings
|
||||
from . import website
|
||||
from . import res_users
|
||||
from . import res_groups
|
||||
from . import res_partner
|
||||
from . import res_partner
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class Http(models.AbstractModel):
|
||||
_inherit = 'ir.http'
|
||||
|
||||
def binary_content(self, xmlid=None, model='ir.attachment', id=None, field='datas',
|
||||
unique=False, filename=None, filename_field='name', download=False,
|
||||
mimetype=None, default_mimetype='application/octet-stream',
|
||||
access_token=None):
|
||||
obj = None
|
||||
if xmlid:
|
||||
obj = self._xmlid_to_obj(self.env, xmlid)
|
||||
if obj._name != 'slide.slide':
|
||||
obj = None
|
||||
elif id and model == 'slide.slide':
|
||||
obj = self.env[model].browse(int(id))
|
||||
if obj:
|
||||
obj.check_access_rights('read')
|
||||
obj.check_access_rule('read')
|
||||
return super(Http, self).binary_content(
|
||||
xmlid=xmlid, model=model, id=id, field=field, unique=unique, filename=filename,
|
||||
filename_field=filename_field, download=download, mimetype=mimetype,
|
||||
default_mimetype=default_mimetype, access_token=access_token)
|
||||
Reference in New Issue
Block a user