From 385342b575f6f8510cea6c90108be7b510fd1fa1 Mon Sep 17 00:00:00 2001 From: Nans Lefebvre Date: Fri, 12 Apr 2019 09:57:09 +0000 Subject: [PATCH] [FIX] account: only put internal users as followers of vendor bills (2) Fine-tuning of 0a4e67c609f3d84e25715f57a61ad00ce9aec4df. Due to some confusion, has_group had been replaced by user_has_groups on the corresponding PR. However the latter is not a higher-level version of the former, since it checks the groups on the self.env.user, not on self. As a result, the filtering was completely False, since it checked that the env user was in group_user which was always True. closes odoo/odoo#32653 Signed-off-by: Nans Lefebvre (len) --- addons/account/models/account_invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index d2039926804..9c1518ae3c7 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -703,7 +703,7 @@ class AccountInvoice(models.Model): # Subscribe internal users on the newly created bill partners = self.env['res.partner'].browse(seen_partner_ids) is_internal = lambda p: (p.user_ids and - all(p.user_ids.mapped(lambda u: u.user_has_groups('base.group_user')))) + all(p.user_ids.mapped(lambda u: u.has_group('base.group_user')))) partners_to_subscribe = partners.filtered(is_internal) if partners_to_subscribe: invoice.message_subscribe([p.id for p in partners_to_subscribe])