Validate valid Dict schema selection type when save
- Install product_attribute module
Scenario - ok:
- Create a new record menu: Product / Conf / Attribute Set / Attributes
- Select "selection" in type field.
- Add some not valid text in "selection" field.
- Save: raise message: Invalid selection in schema "xxx".
Scenario - ko:
- Create a new record menu: Product / Conf / Attribute Set / Attributes
- Select "selection" in type field. keep "selection" field empty.
- Save. A new record was created.
- Click "translate" icon, and create value with translate field and wrong text.
- Save.
The new "attibute" could you save and not raise "invalid selection" with wrong selection text. Also, now you could edit "selection" field without validation.
Finally, user get traceback when try to use those attributes:
Traceback (most recent call last):
File "/tryton/trytond/trytond/protocols/dispatcher.py", line 195, in _dispatch
result = rpc.result(meth(*c_args, **c_kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/tryton/trytond/trytond/model/dictschema.py", line 175, in get_keys
selection = OrderedDict(json.loads(
^^^^^^^^^^^^^^^^^^^^^^^
ValueError: need more than 1 value to unpack