changeset 7a9a3b43b802 in modules/account_asset:5.0
details: 
https://hg.tryton.org/modules/account_asset?cmd=changeset;node=7a9a3b43b802
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 bce9625df238 -r 7a9a3b43b802 asset.py
--- a/asset.py  Sat Apr 04 17:43:28 2020 +0200
+++ b/asset.py  Tue Apr 28 00:25:58 2020 +0200
@@ -920,7 +920,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

Reply via email to