From 3783289ece032f7d4aa4126160120b6cdea1cb4e Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 18 Nov 2015 15:43:09 +0100 Subject: [PATCH] [FIX] account: _default_line_ids for a account.payment.term record The sequence of the first account.payment.term.line must be 9 because the default sequence for a new line is 10. Before the fix: When changing the value of the default line by "percent" and adding a new line with value equal to "balance". An exception was raised because the sequence of the default line was 500 and then this default line was always considered as the last one. opw:656704 --- addons/account/models/account_invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py index bd7eb7c2f48..776b1ea959f 100644 --- a/addons/account/models/account_invoice.py +++ b/addons/account/models/account_invoice.py @@ -1192,7 +1192,7 @@ class AccountPaymentTerm(models.Model): _order = "name" def _default_line_ids(self): - return [(0, 0, {'value': 'balance', 'value_amount': 0.0, 'sequence': 500, 'days': 0, 'option': 'day_after_invoice_date'})] + return [(0, 0, {'value': 'balance', 'value_amount': 0.0, 'sequence': 9, 'days': 0, 'option': 'day_after_invoice_date'})] name = fields.Char(string='Payment Term', translate=True, required=True) active = fields.Boolean(default=True, help="If the active field is set to False, it will allow you to hide the payment term without removing it.")