diff --git a/sale_procurement_group_by_requested_date/tests/test_sale_procurement_group_by_requested_date.py b/sale_procurement_group_by_requested_date/tests/test_sale_procurement_group_by_requested_date.py index 030c48d6ceb..71573839775 100644 --- a/sale_procurement_group_by_requested_date/tests/test_sale_procurement_group_by_requested_date.py +++ b/sale_procurement_group_by_requested_date/tests/test_sale_procurement_group_by_requested_date.py @@ -90,19 +90,26 @@ def test_number_of_groups(self): procurements = self.env['procurement.order'].search([ ('group_id', '=', group.id)]) self.assertEqual(len(procurements), 2) - self.assertEqual(len(groups), 2) + self.assertEqual(len(groups), 1) + + req_date2 = fields.Date.to_string(self.dt2) + g_name = self.sale1.name + '/' + req_date2 + groups = self.env['procurement.group'].search([('name', '=', g_name)]) + + for group in groups: + if group.name == g_name: + procurements = self.env['procurement.order'].search([ + ('group_id', '=', group.id)]) + self.assertEqual(len(procurements), 2) + self.assertEqual(len(groups), 1) + self.sale2.action_confirm() - req_date = fields.Date.to_string(self.dt2) g_name = self.sale2.name + '/' + req_date groups = self.env['procurement.group'].search([('name', '=', g_name)]) - for group in groups: if group.name == g_name: procurements = self.env['procurement.order'].search([ ('group_id', '=', group.id)]) - self.assertEqual(len(procurements), 1) + self.assertEqual(len(procurements), 4) self.assertEqual(len(groups), 1) - g_name = self.sale2.name + '/' + self.wh1.name + '/' - groups = self.env['procurement.group'].search([('name', 'ilike', - g_name)]) - self.assertEqual(len(groups), 2) +