Skip to content
Snippets Groups Projects
Commit d0f4a3e8 authored by Patrick Hoste's avatar Patrick Hoste Committed by Thibault Delavallée
Browse files

[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#49840

X-original-commit: 9983989ffe74648bcea6fb079cfb530c617fb59f
Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
parent 7a40950e
No related branches found
No related tags found
No related merge requests found
# -*- 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
\ No newline at end of file
from . import res_partner
# -*- 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)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment