From 07e87e1e346d81b07e80b77edc1940c37a44f5f4 Mon Sep 17 00:00:00 2001 From: Toufik Ben Jaa Date: Wed, 10 Jul 2019 14:19:17 +0000 Subject: [PATCH] [FIX] lunch: default value for `responsible_id` is incorrect - When creating a vendor on lunch without setting explicitly the `responsible_id`, `default_get` should return the current user id. Instead it returns the current user's partner id. closes odoo/odoo#34759 Signed-off-by: Nicolas Seinlet (nse) --- addons/lunch/models/lunch_supplier.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/lunch/models/lunch_supplier.py b/addons/lunch/models/lunch_supplier.py index f0ee44b853f..af1cf46f33a 100644 --- a/addons/lunch/models/lunch_supplier.py +++ b/addons/lunch/models/lunch_supplier.py @@ -50,7 +50,7 @@ class LunchSupplier(models.Model): country_id = fields.Many2one('res.country', related='partner_id.country_id', readonly=False) responsible_id = fields.Many2one('res.users', string="Responsible", domain=lambda self: [('groups_id', 'in', self.env.ref('lunch.group_lunch_manager').id)], - default=lambda self: self.env.user.partner_id, + default=lambda self: self.env.user, help="The responsible is the person that will order lunch for everyone" "It will be used as the 'from' when sending the automatic email")