[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
This commit is contained in:
@@ -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.")
|
||||
|
||||
Reference in New Issue
Block a user