We (@Thedevilcoder and me) are stuck at a very trivial issue. We are trying to create a selection field and getting this error (with traceback)-
Traceback (most recent call last):
File "/home/prakhar/workspace/tryton/tryton50/src/trytond/trytond/protocols/dispatcher.py", line 176, in _dispatch
result = rpc.result(meth(*c_args, **c_kwargs))
File "/home/prakhar/workspace/tryton/tryton50/src/trytond/trytond/wizard/wizard.py", line 287, in execute
return wizard._execute(state_name)
File "/home/prakhar/workspace/tryton/tryton50/src/trytond/trytond/wizard/wizard.py", line 318, in _execute
result = self._execute(transition())
File "/home/prakhar/workspace/tryton/tryton50/src/trytond/trytond/ir/module.py", line 582, in transition_upgrade
pool.init(update=update, lang=lang)
File "/home/prakhar/workspace/tryton/tryton50/src/trytond/trytond/pool.py", line 160, in init
lang=lang, activatedeps=activatedeps)
File "/home/prakhar/workspace/tryton/tryton50/src/trytond/trytond/modules/__init__.py", line 423, in load_modules
_load_modules(update)
File "/home/prakhar/workspace/tryton/tryton50/src/trytond/trytond/modules/__init__.py", line 388, in _load_modules
load_module_graph(graph, pool, update, lang)
File "/home/prakhar/workspace/tryton/tryton50/src/trytond/trytond/modules/__init__.py", line 216, in load_module_graph
cls.__register__(module)
File "/home/prakhar/workspace/tryton/tryton50/src/trytond/trytond/model/modelsql.py", line 201, in __register__
super(ModelSQL, cls).__register__(module_name)
File "/home/prakhar/workspace/tryton/tryton50/src/trytond/trytond/model/model.py", line 123, in __register__
Translation.register_fields(cls, module_name)
File "/home/prakhar/workspace/tryton/tryton50/src/trytond/trytond/ir/translation.py", line 240, in register_fields
insert_selection(field, trans_name)
File "/home/prakhar/workspace/tryton/tryton50/src/trytond/trytond/ir/translation.py", line 231, in insert_selection
'', module_name, False, -1]]))
File "/home/prakhar/workspace/tryton/tryton50/src/trytond/trytond/backend/postgresql/database.py", line 65, in execute
cursor.execute(self, sql, args)
psycopg2.IntegrityError: duplicate key value violates unique constraint "ir_translation_translation_md5_uniq"
DETAIL: Key (name, res_id, lang, type, src_md5, module)=(gdm.workflow,state, -1, en, selection, ea4788705e6873b424c65e91c2846b19, gdm_cohort) already exists.
The code is very simple and we have reduced the model to only this content -
from trytond.model import (ModelSQL, ModelView, fields, Workflow)
from trytond.pyson import Eval
__all__ = ['GdmWorkflow',
]
class GdmWorkflow(Workflow, ModelSQL, ModelView):
'GDM'
__name__ = 'gdm.workflow'
state = fields.Selection(
[
('draft', 'Draft'),
('f_to_administer', 'Forwarded to Administer'),
('cancel_deo', 'Cancel'),
('f_to_reviewer', 'Forwarded to Reviewer'),
('cancel_administer', 'Cancel'),
('f_b_to_administer', 'Sent to administer for further administration'),
('finalise_form', 'Form Freezed'),
], 'Status')
We know that we are missing a minor detail here but are not able to figure out.