Hi,
I have a custom computed field that I use in v17. This is calculating the latest date among a list of dates
When I upgraded to v18 on a test database, I get the following error
ValueError: Cannot convert mycustommodel.mycustomfield to SQL because it is not stored
If I change the parameter of my field to "stored", then I no longer have the error but the field isn't computed anymore. Empty.
Here is the Python code for the computation :
for record in self:
dates = []
for line in record.custommodelwheremydatesare:
if line.fieldwithdate:
dates.append(line.fieldwithdate)
if dates:
record['mycustomcomputedfield'] = max(dates)
else:
record['mycustomcomputedfield'] = False
Any idea ?