{"action":"created","issue":{"url":"https://api.github.com/repos/OCA/OpenUpgrade/issues/478","repository_url":"https://api.github.com/repos/OCA/OpenUpgrade","labels_url":"https://api.github.com/repos/OCA/OpenUpgrade/issues/478/labels{/name}","comments_url":"https://api.github.com/repos/OCA/OpenUpgrade/issues/478/comments","events_url":"https://api.github.com/repos/OCA/OpenUpgrade/issues/478/events","html_url":"https://github.com/OCA/OpenUpgrade/issues/478","id":151312043,"number":478,"title":"[7.0] duplicates in ir_sequence_type","user":{"login":"kellogs","id":682580,"avatar_url":"https://avatars.githubusercontent.com/u/682580?v=3","gravatar_id":"","url":"https://api.github.com/users/kellogs","html_url":"https://github.com/kellogs","followers_url":"https://api.github.com/users/kellogs/followers","following_url":"https://api.github.com/users/kellogs/following{/other_user}","gists_url":"https://api.github.com/users/kellogs/gists{/gist_id}","starred_url":"https://api.github.com/users/kellogs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kellogs/subscriptions","organizations_url":"https://api.github.com/users/kellogs/orgs","repos_url":"https://api.github.com/users/kellogs/repos","events_url":"https://api.github.com/users/kellogs/events{/privacy}","received_events_url":"https://api.github.com/users/kellogs/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-04-27T06:51:44Z","updated_at":"2016-04-27T08:40:12Z","closed_at":"2016-04-27T08:40:12Z","body":"After migrating from 6.04 to 6.1, I renamed the database and began a migration to 7.0. It stops with the following SQL query:\r\n\r\ninsert into \"ir_sequence_type\" (id,\"code\",\"name\",create_uid,create_date,write_uid,write_date) values (45,'account.journal','Account Journal',1,(now() at time zone 'UTC'),1,(now() at time zone 'UTC'))\r\n\r\nThere is already a record with id 45, so migration stops.\r\n2016-04-27 00:01:06,325 3803 INFO xxxx_61_migrated openerp.modules.module: module account_sequence: creating or updating database tables\r\n2016-04-27 00:01:06,824 3803 INFO xxxx_61_migrated openerp.modules.loading: module account_sequence: loading account_sequence_data.xml\r\n2016-04-27 00:01:06,879 3803 ERROR xxxx_61_migrated openerp.sql_db: bad query: insert into \"ir_sequence_type\" (id,\"code\",\"name\",create_uid,create_date,write_uid,write_date) values (45,'account.journal','Account Journal',1,(now() at time zone 'UTC'),1,(now() at time zone 'UTC'))\r\nTraceback (most recent call last):\r\n  File \"/var/tmp/openupgrade/7.0/server/openerp/sql_db.py\", line 226, in execute\r\n    res = self._obj.execute(query, params)\r\nIntegrityError: ERREUR:  la valeur d'une clé dupliquée rompt la contrainte unique « ir_sequence_type_code_unique »\r\nDÉTAIL : La clé « (code)=(account.journal) » existe déjà.\r\n\r\n2016-04-27 00:01:06,933 3803 ERROR xxxx_61_migrated openerp.tools.convert: Parse error in /var/tmp/openupgrade/7.0/addons/account_sequence/account_sequence_data.xml:7: \r\n<record id=\"sequence_journal\" model=\"ir.sequence.type\">\r\n\t    <field name=\"name\">Account Journal</field>\r\n\t    <field name=\"code\">account.journal</field>\r\n\t</record>\r\nTraceback (most recent call last):\r\n  File \"/var/tmp/openupgrade/7.0/server/openerp/tools/convert.py\", line 855, in parse\r\n    self._tags[rec.tag](self.cr, rec, n)\r\n  File \"/var/tmp/openupgrade/7.0/server/openerp/tools/convert.py\", line 822, in _tag_record\r\n    id = self.pool.get('ir.model.data')._update(cr, self.uid, rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode, context=rec_context )\r\n  File \"/var/tmp/openupgrade/7.0/server/openerp/addons/base/ir/ir_model.py\", line 1001, in _update\r\n    res_id = model_obj.create(cr, uid, values, context=context)\r\n  File \"/var/tmp/openupgrade/7.0/server/openerp/osv/orm.py\", line 4592, in create\r\n    cr.execute('insert into \"'+self._table+'\" (id'+upd0+\") values (\"+str(id_new)+upd1+')', tuple(upd2))\r\n  File \"/var/tmp/openupgrade/7.0/server/openerp/sql_db.py\", line 161, in wrapper\r\n    return f(self, *args, **kwargs)\r\n  File \"/var/tmp/openupgrade/7.0/server/openerp/sql_db.py\", line 226, in execute\r\n    res = self._obj.execute(query, params)\r\nIntegrityError: ERREUR:  la valeur d'une clé dupliquée rompt la contrainte unique « ir_sequence_type_code_unique »\r\nDÉTAIL : La clé « (code)=(account.journal) » existe déjà.\r\n\r\n2016-04-27 00:01:06,959 3803 ERROR xxxx_61_migrated openerp: Failed to initialize database `xxxx_61_migrated`.\r\nTraceback (most recent call last):\r\n  File \"/var/tmp/openupgrade/7.0/server/openerp/cli/server.py\", line 97, in preload_registry\r\n    db, registry = openerp.pooler.get_db_and_pool(dbname,update_module=update_module)\r\n  File \"/var/tmp/openupgrade/7.0/server/openerp/pooler.py\", line 33, in get_db_and_pool\r\n    registry = RegistryManager.get(db_name, force_demo, status, update_module)\r\n  File \"/var/tmp/openupgrade/7.0/server/openerp/modules/registry.py\", line 203, in get\r\n    update_module)\r\n  File \"/var/tmp/openupgrade/7.0/server/openerp/modules/registry.py\", line 233, in new\r\n    openerp.modules.load_modules(registry.db, force_demo, status, update_module)\r\n  File \"/var/tmp/openupgrade/7.0/server/openerp/modules/loading.py\", line 379, in load_modules\r\n    registry)\r\n  File \"/var/tmp/openupgrade/7.0/server/openerp/modules/loading.py\", line 282, in load_marked_modules\r\n    loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks, registry=registry)\r\n  File \"/var/tmp/openupgrade/7.0/server/openerp/modules/loading.py\", line 206, in load_module_graph\r\n    load_data(module_name, idref, mode)\r\n  File \"/var/tmp/openupgrade/7.0/server/openerp/modules/loading.py\", line 77, in <lambda>\r\n    load_data = lambda *args: _load_data(cr, *args, kind='data')\r\n  File \"/var/tmp/openupgrade/7.0/server/openerp/modules/loading.py\", line 125, in _load_data\r\n    tools.convert_xml_import(cr, module_name, fp, idref, mode, noupdate, report)\r\n  File \"/var/tmp/openupgrade/7.0/server/openerp/tools/convert.py\", line 962, in convert_xml_import\r\n    obj.parse(doc.getroot())\r\n  File \"/var/tmp/openupgrade/7.0/server/openerp/tools/convert.py\", line 855, in parse\r\n    self._tags[rec.tag](self.cr, rec, n)\r\n  File \"/var/tmp/openupgrade/7.0/server/openerp/tools/convert.py\", line 822, in _tag_record\r\n    id = self.pool.get('ir.model.data')._update(cr, self.uid, rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode, context=rec_context )\r\n  File \"/var/tmp/openupgrade/7.0/server/openerp/addons/base/ir/ir_model.py\", line 1001, in _update\r\n    res_id = model_obj.create(cr, uid, values, context=context)\r\n  File \"/var/tmp/openupgrade/7.0/server/openerp/osv/orm.py\", line 4592, in create\r\n    cr.execute('insert into \"'+self._table+'\" (id'+upd0+\") values (\"+str(id_new)+upd1+')', tuple(upd2))\r\n  File \"/var/tmp/openupgrade/7.0/server/openerp/sql_db.py\", line 161, in wrapper\r\n    return f(self, *args, **kwargs)\r\n  File \"/var/tmp/openupgrade/7.0/server/openerp/sql_db.py\", line 226, in execute\r\n    res = self._obj.execute(query, params)\r\nIntegrityError: ERREUR:  la valeur d'une clé dupliquée rompt la contrainte unique « ir_sequence_type_code_unique »\r\nDÉTAIL : La clé « (code)=(account.journal) » existe déjà.\r\n"},"comment":{"url":"https://api.github.com/repos/OCA/OpenUpgrade/issues/comments/215012321","html_url":"https://github.com/OCA/OpenUpgrade/issues/478#issuecomment-215012321","issue_url":"https://api.github.com/repos/OCA/OpenUpgrade/issues/478","id":215012321,"user":{"login":"kellogs","id":682580,"avatar_url":"https://avatars.githubusercontent.com/u/682580?v=3","gravatar_id":"","url":"https://api.github.com/users/kellogs","html_url":"https://github.com/kellogs","followers_url":"https://api.github.com/users/kellogs/followers","following_url":"https://api.github.com/users/kellogs/following{/other_user}","gists_url":"https://api.github.com/users/kellogs/gists{/gist_id}","starred_url":"https://api.github.com/users/kellogs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kellogs/subscriptions","organizations_url":"https://api.github.com/users/kellogs/orgs","repos_url":"https://api.github.com/users/kellogs/repos","events_url":"https://api.github.com/users/kellogs/events{/privacy}","received_events_url":"https://api.github.com/users/kellogs/received_events","type":"User","site_admin":false},"created_at":"2016-04-27T08:40:12Z","updated_at":"2016-04-27T08:40:12Z","body":"I need to validate migration to 6.1 priot to moving to 7.0, so closing this now."}}