Rename the basic rule 'Balance' to 'Roundings'

This commit is contained in:
Guewen Baconnier
2014-12-03 14:23:36 +01:00
parent cac59983c3
commit 0656b9afa0
3 changed files with 7 additions and 7 deletions

View File

@@ -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,

View File

@@ -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,

View File

@@ -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