Merge pull request #749 from ursais/bodedra_fix_748

[FIX] ValueError: min() arg is an empty sequence
This commit is contained in:
Pedro M. Baeza
2019-01-18 10:01:28 +01:00
committed by GitHub
3 changed files with 4 additions and 1 deletions

View File

@@ -69,6 +69,7 @@ Contributors
------------
* Enric Tobella <etobella@creublanca.es>
* Bhavesh Odedra <bodedra@opensourceintegrators.com>
Do not contact contributors directly about support or help with technical issues.

View File

@@ -2,7 +2,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Account Loan management",
"version": "11.0.1.1.0",
"version": "11.0.1.1.1",
"author": "Creu Blanca,Odoo Community Association (OCA)",
"website": "http://github.com/OCA/account-financial-tools",
"license": "AGPL-3",

View File

@@ -390,6 +390,8 @@ class AccountLoan(models.Model):
"""
lines = self.line_ids.filtered(lambda r: not r.move_ids)
amount = 0
if not lines:
return
final_sequence = min(lines.mapped('sequence'))
for line in lines.sorted('sequence', reverse=True):
date = datetime.strptime(