mirror of
https://github.com/OCA/account-reconcile.git
synced 2025-01-20 12:27:39 +02:00
Rename the basic rule 'Balance' to 'Roundings'
This commit is contained in:
@@ -30,10 +30,10 @@ class AccountStatementOperationRule(models.Model):
|
|||||||
|
|
||||||
name = fields.Char()
|
name = fields.Char()
|
||||||
rule_type = fields.Selection(
|
rule_type = fields.Selection(
|
||||||
selection=[('balance', 'Balance'),
|
selection=[('rounding', 'Roundings'),
|
||||||
('currency', 'Currencies')],
|
('currency', 'Currencies')],
|
||||||
string='Type',
|
string='Type',
|
||||||
default='balance',
|
default='rounding',
|
||||||
required=True,
|
required=True,
|
||||||
)
|
)
|
||||||
operations = fields.Many2many(
|
operations = fields.Many2many(
|
||||||
@@ -126,7 +126,7 @@ class AccountStatementOperationRule(models.Model):
|
|||||||
rule when called on multiple rules.
|
rule when called on multiple rules.
|
||||||
"""
|
"""
|
||||||
self.ensure_one()
|
self.ensure_one()
|
||||||
if self.rule_type == 'balance':
|
if self.rule_type == 'rounding':
|
||||||
return self._is_valid_balance(statement_line, move_lines, balance)
|
return self._is_valid_balance(statement_line, move_lines, balance)
|
||||||
elif self.rule_type == 'currency':
|
elif self.rule_type == 'currency':
|
||||||
return self._is_valid_multicurrency(statement_line,
|
return self._is_valid_multicurrency(statement_line,
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ class TestRule(common.TransactionCase):
|
|||||||
})
|
})
|
||||||
self.rule_round_1 = self.rule_obj.create({
|
self.rule_round_1 = self.rule_obj.create({
|
||||||
'name': 'Rounding -1.0 to 0.0',
|
'name': 'Rounding -1.0 to 0.0',
|
||||||
'rule_type': 'balance',
|
'rule_type': 'rounding',
|
||||||
'operations': [(6, 0, (self.operation_round_1.id, ))],
|
'operations': [(6, 0, (self.operation_round_1.id, ))],
|
||||||
'amount_min': -1.0,
|
'amount_min': -1.0,
|
||||||
'amount_max': 0,
|
'amount_max': 0,
|
||||||
@@ -56,7 +56,7 @@ class TestRule(common.TransactionCase):
|
|||||||
})
|
})
|
||||||
self.rule_round_2 = self.rule_obj.create({
|
self.rule_round_2 = self.rule_obj.create({
|
||||||
'name': 'Rounding -1.0 to 0.0',
|
'name': 'Rounding -1.0 to 0.0',
|
||||||
'rule_type': 'balance',
|
'rule_type': 'rounding',
|
||||||
'operations': [(6, 0, (self.operation_round_2.id, ))],
|
'operations': [(6, 0, (self.operation_round_2.id, ))],
|
||||||
'amount_min': -2.0,
|
'amount_min': -2.0,
|
||||||
'amount_max': -1.0,
|
'amount_max': -1.0,
|
||||||
@@ -72,7 +72,7 @@ class TestRule(common.TransactionCase):
|
|||||||
})
|
})
|
||||||
self.rule_round_3 = self.rule_obj.create({
|
self.rule_round_3 = self.rule_obj.create({
|
||||||
'name': 'Rounding 0.0 to 2.0',
|
'name': 'Rounding 0.0 to 2.0',
|
||||||
'rule_type': 'balance',
|
'rule_type': 'rounding',
|
||||||
'operations': [(6, 0, (self.operation_round_3.id, ))],
|
'operations': [(6, 0, (self.operation_round_3.id, ))],
|
||||||
'amount_min': 0,
|
'amount_min': 0,
|
||||||
'amount_max': 2,
|
'amount_max': 2,
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
<group name="options">
|
<group name="options">
|
||||||
<field name="rule_type"/>
|
<field name="rule_type"/>
|
||||||
</group>
|
</group>
|
||||||
<group name="amount" string="Balance" attrs="{'invisible': [('rule_type', 'not in', ('balance', 'currency'))]}">
|
<group name="amount" string="Balance" attrs="{'invisible': [('rule_type', 'not in', ('rounding', 'currency'))]}">
|
||||||
<label for="amount" string="When the balance is between"/>
|
<label for="amount" string="When the balance is between"/>
|
||||||
<div>
|
<div>
|
||||||
<field name="amount_min" class="oe_inline" /> And
|
<field name="amount_min" class="oe_inline" /> And
|
||||||
|
|||||||
Reference in New Issue
Block a user