Skip to content

Commit

Permalink
[FIX] account_statement_import_sheet_file: Reset fields based on the …
Browse files Browse the repository at this point in the history
…selected 'amount_type' value when its change
  • Loading branch information
rov-adhoc committed Jan 2, 2025
1 parent b92378f commit 1022538
Showing 1 changed file with 14 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -254,3 +254,17 @@ def _decode_column_delimiter_character(self, delimiter):

def _get_column_delimiter_character(self):
return self._decode_column_delimiter_character(self.delimiter)

@api.onchange("amount_type")
def _onchange_amount_type(self):
if self.amount_type == "simple_value":
self.debit_credit_column = False
self.amount_debit_column = False
self.amount_credit_column = False

Check warning on line 263 in account_statement_import_sheet_file/models/account_statement_import_sheet_mapping.py

View check run for this annotation

Codecov / codecov/patch

account_statement_import_sheet_file/models/account_statement_import_sheet_mapping.py#L261-L263

Added lines #L261 - L263 were not covered by tests
elif self.amount_type == "absolute_value":
self.amount_column = False
self.amount_debit_column = False
self.amount_credit_column = False

Check warning on line 267 in account_statement_import_sheet_file/models/account_statement_import_sheet_mapping.py

View check run for this annotation

Codecov / codecov/patch

account_statement_import_sheet_file/models/account_statement_import_sheet_mapping.py#L265-L267

Added lines #L265 - L267 were not covered by tests
elif self.amount_type == "distinct_credit_debit":
self.amount_column = False
self.debit_credit_column = False

Check warning on line 270 in account_statement_import_sheet_file/models/account_statement_import_sheet_mapping.py

View check run for this annotation

Codecov / codecov/patch

account_statement_import_sheet_file/models/account_statement_import_sheet_mapping.py#L269-L270

Added lines #L269 - L270 were not covered by tests

0 comments on commit 1022538

Please sign in to comment.