# HG changeset patch # User szeka_wong <szeka.wong@xcg-consulting.fr> # Date 1624548189 -7200 # Thu Jun 24 17:23:09 2021 +0200 # Branch 13.0 # Node ID d78db6511a9882160da11d4a9cdb8d5859437bf6 # Parent 881ae2bd5f8c06063225dfea97fd747efb470ab5 Update account consultation criteria to match user_type_id instead of internanl_type. diff --git a/wizards/account_consultation.py b/wizards/account_consultation.py --- a/wizards/account_consultation.py +++ b/wizards/account_consultation.py @@ -154,14 +154,15 @@ def _handle_account_criteria_change(self): """Update selectable accounts based on criteria.""" - account_types = self.account_type_ids.mapped("type") partner = self.partner_id - if self.account_id.internal_type not in account_types: + if self.account_id.user_type_id.id not in self.account_type_ids.ids: self.account_id = self.env["account.account"] # Clear out. account_domain = ( - [("internal_type", "in", account_types)] if account_types else [] + [("user_type_id", "in", self.account_type_ids.ids)] + if self.account_type_ids + else [] ) if partner: @@ -353,9 +354,7 @@ elif partner: aml_domain = [("partner_id", "=", partner.id)] - aml_domain.append( - ("account_id.internal_type", "in", categories.mapped("type")) - ) + aml_domain.append(("account_id.user_type_id", "in", categories.ids)) period_states = ["draft"] if self.include_closed_periods: