2
0

[11.0][FIX] ValueError: min() arg is an empty sequence

This commit is contained in:
Bhavesh Odedra 2019-01-08 20:14:46 +05:30 committed by Enric Tobella
parent 7643312cd7
commit b438be5934
3 changed files with 4 additions and 1 deletions

View File

@ -69,6 +69,7 @@ Contributors
------------ ------------
* Enric Tobella <etobella@creublanca.es> * Enric Tobella <etobella@creublanca.es>
* Bhavesh Odedra <bodedra@opensourceintegrators.com>
Do not contact contributors directly about support or help with technical issues. 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). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{ {
"name": "Account Loan management", "name": "Account Loan management",
"version": "11.0.1.1.0", "version": "11.0.1.1.1",
"author": "Creu Blanca,Odoo Community Association (OCA)", "author": "Creu Blanca,Odoo Community Association (OCA)",
"website": "http://github.com/OCA/account-financial-tools", "website": "http://github.com/OCA/account-financial-tools",
"license": "AGPL-3", "license": "AGPL-3",

View File

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