changeset 2654644ab9c5 in modules/account_asset:5.2
details:
https://hg.tryton.org/modules/account_asset?cmd=changeset;node=2654644ab9c5
description:
Test asset_lines before using first line for start_fixed_value
issue9254
review311381002
(grafted from e5edf81c806250b628025ed52ced52d638a2b5c0)
diffstat:
asset.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diffs (13 lines):
diff -r bd787d464613 -r 2654644ab9c5 asset.py
--- a/asset.py Sat Apr 04 16:56:51 2020 +0200
+++ b/asset.py Tue Apr 28 00:25:58 2020 +0200
@@ -921,7 +921,8 @@
@cached_property
def start_fixed_value(self):
- if self.start_date < self.asset.start_date:
+ if (self.start_date < self.asset.start_date
+ or not self.asset_lines):
return 0
value = self.asset_lines[0].acquired_value
date = self.asset_lines[0].date