fix 'state' report field (backport from bluebream version)
This commit is contained in:
parent
d21e2da317
commit
1c1f259d4f
2 changed files with 4 additions and 1 deletions
|
@ -70,7 +70,8 @@
|
|||
|
||||
<metal:state define-macro="state">
|
||||
<tal:column define=" value python:col.getDisplayValue(row)">
|
||||
<img tal:attributes="src string:$resourceBase${value/icon};
|
||||
<img tal:condition="value"
|
||||
tal:attributes="src string:$resourceBase${value/icon};
|
||||
alt value/title;
|
||||
title value/title" />
|
||||
</tal:column>
|
||||
|
|
|
@ -109,6 +109,8 @@ class StateField(Field):
|
|||
def getDisplayValue(self, row):
|
||||
if IStateful.providedBy(row.context):
|
||||
stf = row.context
|
||||
elif row.context is None:
|
||||
return None
|
||||
else:
|
||||
stf = component.getAdapter(row.context, IStateful,
|
||||
name=self.statesDefinition)
|
||||
|
|
Loading…
Add table
Reference in a new issue