El lunes, 18 de diciembre de 2017, 12:08:55 (UTC+1), Cato Nano escribió: > Now that a list of entities represented by my model get correctly shown, I > want to add a selection field to my model. Like this > > > tipo = fields.Selection('tipo', [ > ('M', 'Male') > ('F', 'Female') > ], > ) > > > > I copied this from the manual, here > http://doc.tryton.org/4.6/trytond/doc/ref/models/fields.html#ref-models-fields > > when updating the module like this > > :~/tributi$ sudo python3 setup.py develop > :~/tributi$ sudo trytond-admin -c /etc/tryton/trytond.conf -d tryton -u > tributi > > > > i get this error > > > > > Traceback (most recent call last): > File "/usr/bin/trytond-admin", line 21, in <module> > admin.run(options) > File "/usr/lib/python3/dist-packages/trytond/admin.py", line 54, in run > installdeps=options.installdeps) > File "/usr/lib/python3/dist-packages/trytond/pool.py", line 142, in init > self.start() > File "/usr/lib/python3/dist-packages/trytond/pool.py", line 95, in start > register_classes() > File "/usr/lib/python3/dist-packages/trytond/modules/__init__.py", line > 373, in register_classes > mod_file, pathname, description) > File "/usr/lib/python3.6/imp.py", line 245, in load_module > return load_package(name, filename) > File "/usr/lib/python3.6/imp.py", line 217, in load_package > return _load(spec) > File "<frozen importlib._bootstrap>", line 684, in _load > File "<frozen importlib._bootstrap>", line 665, in _load_unlocked > File "<frozen importlib._bootstrap_external>", line 678, in exec_module > File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed > File "/home/admin/tributi/build/lib/trytond/modules/tributi/__init__.py", > line 2, in <module> > from .bolletta import Bolletta > File "/home/admin/tributi/build/lib/trytond/modules/tributi/bolletta.py", > line 6, in <module> > class Bolletta(ModelSQL, ModelView): > File "/home/admin/tributi/build/lib/trytond/modules/tributi/bolletta.py", > line 13, in Bolletta > ('F', 'Female') > TypeError: 'tuple' object is not callable > > > Thanks in advance !
First param is the options, second the label i think ... -- You received this message because you are subscribed to the Google Groups "tryton" group. To view this discussion on the web visit https://groups.google.com/d/msgid/tryton/ee9020b4-27ce-4c34-ba1e-441a1f3654bf%40googlegroups.com.