diff options
| author | Djamel (otd) <otd@odoo.com> | 2021-03-08 08:39:13 +0000 |
|---|---|---|
| committer | Jorge Pinna Puissant <jpp@odoo.com> | 2021-03-11 09:25:23 +0000 |
| commit | 227c4dffffaf7a2fb3976391aa64685d3fb938c3 (patch) | |
| tree | 157f9f64ba0fd0abf08b0f19ff123dbc30e2a92d | |
| parent | 31ca461ee3a6b9560fe6d78642e8fe5017b1085e (diff) | |
[FIX]base: fix domain of "user_id" field in res.partner
Steps to follow to reproduce the bug:
-Go to the Contact app
-Choose any contact
-In the contact form> go to the "sales & purchase" tab and try to assign a user in the "salesperson" fields
Problem:
You can choose any user regardless of their type. While normally we can only choose internal users
Solution:
Add a domain to the "user_id" fields to only see users of the kind "internal type"
opw-2468819
closes odoo/odoo#67592
X-original-commit: a6c26aedf4c8043ac79b241acf6d69d1498f0acd
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
| -rw-r--r-- | odoo/addons/base/models/res_partner.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/odoo/addons/base/models/res_partner.py b/odoo/addons/base/models/res_partner.py index 1d148785a70..310a4c7d6ef 100644 --- a/odoo/addons/base/models/res_partner.py +++ b/odoo/addons/base/models/res_partner.py @@ -169,7 +169,7 @@ class Partner(models.Model): tz_offset = fields.Char(compute='_compute_tz_offset', string='Timezone offset', invisible=True) user_id = fields.Many2one('res.users', string='Salesperson', - help='The internal user in charge of this contact.') + help='The internal user in charge of this contact.', domain=lambda self: [('groups_id', 'in', self.env.ref('base.group_user').id)]) vat = fields.Char(string='Tax ID', index=True, help="The Tax Identification Number. Complete it if the contact is subjected to government taxes. Used in some legal statements.") same_vat_partner_id = fields.Many2one('res.partner', string='Partner with same Tax ID', compute='_compute_same_vat_partner_id', store=False) bank_ids = fields.One2many('res.partner.bank', 'partner_id', string='Banks') |
