Skip to content
Snippets Groups Projects
Commit 9a27710a authored by RomainLibert's avatar RomainLibert
Browse files

[FIX] lunch: fix lunch product report


closes odoo/odoo#35904

Signed-off-by: default avatarRomain Libert (rli) <rli@odoo.com>
parent f3c1e6cf
Branches
Tags
No related merge requests found
......@@ -82,7 +82,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 users.company_id = product.company_id -- multi company
INNER JOIN res_users users ON product.company_id IS NULL OR users.company_id = product.company_id -- multi company
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
......
......@@ -2,4 +2,5 @@
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import common
from . import test_product_report
from . import test_supplier
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.lunch.tests.common import TestsCommon
class TestLunchProductReport(TestsCommon):
def test_product_available(self):
self.assertTrue(self.env['lunch.product.report'].search([]), 'There should be some record on lunch_product_report')
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment