--- a/src/pyams_content/component/keynumber/interfaces.py Mon May 13 15:10:46 2019 +0200
+++ b/src/pyams_content/component/keynumber/interfaces.py Mon May 13 16:08:34 2019 +0200
@@ -49,7 +49,7 @@
number = TextLine(title=_("Number"),
description=_("Key number value"),
- required=True)
+ required=False)
unit = I18nTextLineField(title=_('key-number-unit', default="Unit"),
description=_("Displayed unit"),
--- a/src/pyams_content/component/keynumber/zmi/__init__.py Mon May 13 15:10:46 2019 +0200
+++ b/src/pyams_content/component/keynumber/zmi/__init__.py Mon May 13 16:08:34 2019 +0200
@@ -173,6 +173,9 @@
attrName = 'number'
weight = 20
+ def getValue(self, obj):
+ return super(KeyNumbersTableNameColumn, self).getValue(obj) or '--'
+
@adapter_config(name='unit', context=(IKeyNumberContainer, IPyAMSLayer, KeyNumbersTable), provides=IColumn)
class KeyNumbersTableUnitColumn(I18nColumn, I18nAttrColumn):