diff --git a/addons/lunch/report/lunch_product_report.py b/addons/lunch/report/lunch_product_report.py index bd2f93600c5..8ff8858487f 100644 --- a/addons/lunch/report/lunch_product_report.py +++ b/addons/lunch/report/lunch_product_report.py @@ -91,7 +91,7 @@ class LunchProductReport(models.Model): product.new_until >= current_date AS is_new, orders.last_order_date FROM lunch_product product - INNER JOIN res_users users ON product.company_id IS NULL OR users.company_id = product.company_id -- multi company + CROSS JOIN res_users users INNER JOIN res_groups_users_rel groups ON groups.uid = users.id -- only generate for internal users LEFT JOIN LATERAL (select max(date) AS last_order_date FROM lunch_order where user_id=users.id and product_id=product.id) AS orders ON TRUE LEFT JOIN LATERAL (select user_id FROM lunch_product_favorite_user_rel where user_id=users.id and product_id=product.id) AS fav ON TRUE diff --git a/addons/lunch/security/lunch_security.xml b/addons/lunch/security/lunch_security.xml index ac8d3eee796..01a59c0057a 100644 --- a/addons/lunch/security/lunch_security.xml +++ b/addons/lunch/security/lunch_security.xml @@ -85,5 +85,12 @@ ['|', ('company_id', '=', False), ('company_id', 'in', company_ids)] + + + Lunch product report: Multi Company + + + ['|', ('company_id', '=', False), ('company_id', 'in', company_ids)] +