Julien Castiaux 54e970e710 [FIX] calendar: browse record using IrRules
Create a calendar meeting using Mark Demo. In the options of the event,
set the meeting as "Show Time as" = "Free". Using the admin user, send a
digest (KPI Digest module, technical > emails > digest email > send
now). It raises an User Error because the template cannot be rendered.

The problem is due to the way the "Show Time as" is implemented, the
"Free" option is used to not show the meeting in the different calendar
views. The events are hidden thanks to a record rule "Hide Private
Meetings".

Each digest is sent using the context of each subscripted user and not
the SuperUser ID 1. The call to `search_count` on `mail.message` calls
the dedicated `_search` of `mail.message` and ultimately end up in the
overriden `_find_allowed_model_wise` method of message in calendar.

That method does a browse of all the record ids containing new
messages in their chatter, but fail with an access error due to the
above record rule. Because it fails, the `kpi_mail_message_total_value`
compute fails and the field is missing when rendering the template.

Using `search` instead of `browse` ensures records unavailable due to a
record rule are filtered out.

opw-1966664

closes odoo/odoo#32735

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-04-16 14:21:41 +00:00
2019-04-11 11:55:38 +00:00
2015-09-08 15:45:09 +02:00
2018-10-09 13:44:38 +00:00
2015-09-08 17:58:38 +02:00
2019-03-13 15:10:02 +00:00

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, Purchase Management, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

Then follow the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%