Currently, the slide.embed statistics only work if a 'Referer' header is passed in the request object. The issue with that strategy is that it's not very reliable, indeed some modern browsers now completely avoid passing the referer header (mostly for security and privacy reasons). This commit refactors the slide.embed feature to work even without a referer header. When the header is missing, the incremented count will be stored under a common slide.embed record with a url field = False. This count is still useful because the end-user will want to know if the slide is popular externally, even if we don't know on which website it has been embedded exactly. In addition, we add more visibility to the slide.embed feature by introducing a stat-button on the slide.slide form view, that redirects to the list of slide.embeds for this slide. Finally, we also renamed the 'embedcount_ids' field to 'embed_ids' to get a better / clearer naming. A few tests about embed detection were added to ensure this behavior. (Tests are based on the work of Nathan Marotte <nama@odoo.com>). Task-2654009 Part-of: odoo/odoo#77736
12 lines
329 B
Python
12 lines
329 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from . import common
|
|
from . import test_embed_detection
|
|
from . import test_karma
|
|
from . import test_resources
|
|
from . import test_security
|
|
from . import test_slide_utils
|
|
from . import test_statistics
|
|
from . import test_ui_wslides
|