[FIX] base: Fix condition on selection field always evaluating to True
Part/Fix of commit #e579642 Issue The condition `default_type not in self._fields['type'].selection` always evaluate to True as the selection is list of (key, value) tuples. Solution Replace the tuples by a list of possible values. opw-2256905 closes odoo/odoo#52501 X-original-commit: 1b21c674c6de3ef96d7938c3e99b36d7cb2f2b6e Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com> Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
This commit is contained in:
@@ -715,7 +715,7 @@ class Partner(models.Model):
|
||||
a name, the name will have the email value.
|
||||
If 'force_email' key in context: must find the email address. """
|
||||
default_type = self._context.get('default_type')
|
||||
if default_type and default_type not in self._fields['type'].selection:
|
||||
if default_type and default_type not in self._fields['type'].get_values(self.env):
|
||||
context = dict(self._context)
|
||||
context.pop('default_type')
|
||||
self = self.with_context(context)
|
||||
|
||||
Reference in New Issue
Block a user