Skip to content
Snippets Groups Projects
Commit d78db6511a98 authored by szeka.wong's avatar szeka.wong
Browse files

Update account consultation criteria to match user_type_id instead of internanl_type.

parent 881ae2bd5f8c
No related branches found
No related tags found
1 merge request!12Topic/13.0/sb task 429
......@@ -154,6 +154,5 @@
def _handle_account_criteria_change(self):
"""Update selectable accounts based on criteria."""
account_types = self.account_type_ids.mapped("type")
partner = self.partner_id
......@@ -158,6 +157,6 @@
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 = (
......@@ -161,7 +160,9 @@
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:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment