diff --git a/g2p_registry_encryption/models/partner.py b/g2p_registry_encryption/models/partner.py index abf719f..a37104c 100644 --- a/g2p_registry_encryption/models/partner.py +++ b/g2p_registry_encryption/models/partner.py @@ -33,6 +33,8 @@ def create(self, vals_list): if not is_encrypt_fields: return super().create(vals_list) + vals_list = [vals_list] if isinstance(vals_list, dict) else vals_list + prov = self.env["g2p.encryption.provider"].get_registry_provider() for vals in vals_list: if vals.get("is_registrant", False): @@ -69,8 +71,8 @@ def write(self, vals): return super().write(vals) def _fetch_query(self, query, fields): - fields = set(fields) res = super()._fetch_query(query, fields) + fields = {field.name for field in fields} prov = self.env["g2p.encryption.provider"].get_registry_provider() enc_fields_set = prov.get_registry_fields_set_to_enc().intersection(fields) if not enc_fields_set: