diff --git a/account_statement_operation_rule/model/account_statement_operation_rule.py b/account_statement_operation_rule/model/account_statement_operation_rule.py index 9c616556..3de82c85 100644 --- a/account_statement_operation_rule/model/account_statement_operation_rule.py +++ b/account_statement_operation_rule/model/account_statement_operation_rule.py @@ -30,10 +30,10 @@ class AccountStatementOperationRule(models.Model): name = fields.Char() rule_type = fields.Selection( - selection=[('balance', 'Balance'), + selection=[('rounding', 'Roundings'), ('currency', 'Currencies')], string='Type', - default='balance', + default='rounding', required=True, ) operations = fields.Many2many( @@ -126,7 +126,7 @@ class AccountStatementOperationRule(models.Model): rule when called on multiple rules. """ self.ensure_one() - if self.rule_type == 'balance': + if self.rule_type == 'rounding': return self._is_valid_balance(statement_line, move_lines, balance) elif self.rule_type == 'currency': return self._is_valid_multicurrency(statement_line, diff --git a/account_statement_operation_rule/tests/test_rule.py b/account_statement_operation_rule/tests/test_rule.py index 8dde1f1a..2f6ea990 100644 --- a/account_statement_operation_rule/tests/test_rule.py +++ b/account_statement_operation_rule/tests/test_rule.py @@ -40,7 +40,7 @@ class TestRule(common.TransactionCase): }) self.rule_round_1 = self.rule_obj.create({ 'name': 'Rounding -1.0 to 0.0', - 'rule_type': 'balance', + 'rule_type': 'rounding', 'operations': [(6, 0, (self.operation_round_1.id, ))], 'amount_min': -1.0, 'amount_max': 0, @@ -56,7 +56,7 @@ class TestRule(common.TransactionCase): }) self.rule_round_2 = self.rule_obj.create({ 'name': 'Rounding -1.0 to 0.0', - 'rule_type': 'balance', + 'rule_type': 'rounding', 'operations': [(6, 0, (self.operation_round_2.id, ))], 'amount_min': -2.0, 'amount_max': -1.0, @@ -72,7 +72,7 @@ class TestRule(common.TransactionCase): }) self.rule_round_3 = self.rule_obj.create({ 'name': 'Rounding 0.0 to 2.0', - 'rule_type': 'balance', + 'rule_type': 'rounding', 'operations': [(6, 0, (self.operation_round_3.id, ))], 'amount_min': 0, 'amount_max': 2, diff --git a/account_statement_operation_rule/view/account_statement_operation_rule_view.xml b/account_statement_operation_rule/view/account_statement_operation_rule_view.xml index c4e9a3a4..ba34b050 100644 --- a/account_statement_operation_rule/view/account_statement_operation_rule_view.xml +++ b/account_statement_operation_rule/view/account_statement_operation_rule_view.xml @@ -17,7 +17,7 @@ - +