{"action":"created","issue":{"url":"https://api.github.com/repos/odoo/odoo/issues/12471","repository_url":"https://api.github.com/repos/odoo/odoo","labels_url":"https://api.github.com/repos/odoo/odoo/issues/12471/labels{/name}","comments_url":"https://api.github.com/repos/odoo/odoo/issues/12471/comments","events_url":"https://api.github.com/repos/odoo/odoo/issues/12471/events","html_url":"https://github.com/odoo/odoo/issues/12471","id":160841658,"number":12471,"title":"[8.0] Installing new chart of accounts results in error","user":{"login":"Yenthe666","id":6352350,"avatar_url":"https://avatars.githubusercontent.com/u/6352350?v=3","gravatar_id":"","url":"https://api.github.com/users/Yenthe666","html_url":"https://github.com/Yenthe666","followers_url":"https://api.github.com/users/Yenthe666/followers","following_url":"https://api.github.com/users/Yenthe666/following{/other_user}","gists_url":"https://api.github.com/users/Yenthe666/gists{/gist_id}","starred_url":"https://api.github.com/users/Yenthe666/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Yenthe666/subscriptions","organizations_url":"https://api.github.com/users/Yenthe666/orgs","repos_url":"https://api.github.com/users/Yenthe666/repos","events_url":"https://api.github.com/users/Yenthe666/events{/privacy}","received_events_url":"https://api.github.com/users/Yenthe666/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/odoo/odoo/labels/confirmed","name":"confirmed","color":"DF013A"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-06-17T08:55:16Z","updated_at":"2016-06-17T12:44:53Z","closed_at":"2016-06-17T12:44:52Z","body":"Impacted versions: 8.0\r\n\r\nSteps to reproduce:\r\n 1. Go to settings > Accounting\r\n 2. Choose a chart of account and try to install it.\r\n\r\nCurrent behavior:\r\nA major error happens and you're unable to install a chart of account. Full stacktrace:\r\n`Traceback (most recent call last):\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/http.py\", line 543, in _handle_exception\r\n    return super(JsonRequest, self)._handle_exception(exception)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/http.py\", line 580, in dispatch\r\n    result = self._call_function(**self.params)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/http.py\", line 316, in _call_function\r\n    return checked_call(self.db, *args, **kwargs)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/service/model.py\", line 118, in wrapper\r\n    return f(dbname, *args, **kwargs)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/http.py\", line 313, in checked_call\r\n    return self.endpoint(*a, **kw)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/http.py\", line 809, in __call__\r\n    return self.method(*args, **kw)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/http.py\", line 409, in response_wrap\r\n    response = f(*args, **kw)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/addons/web/controllers/main.py\", line 948, in call_button\r\n    action = self._call_kw(model, method, args, {})\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/addons/web/controllers/main.py\", line 936, in _call_kw\r\n    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/api.py\", line 268, in wrapper\r\n    return old_api(self, *args, **kwargs)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/addons/base/module/module.py\", line 447, in button_immediate_install\r\n    return self._button_immediate_function(cr, uid, ids, self.button_install, context=context)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/api.py\", line 268, in wrapper\r\n    return old_api(self, *args, **kwargs)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/addons/base/module/module.py\", line 495, in _button_immediate_function\r\n    registry = openerp.modules.registry.RegistryManager.new(cr.dbname, update_module=True)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/modules/registry.py\", line 370, in new\r\n    openerp.modules.load_modules(registry._db, force_demo, status, update_module)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/modules/loading.py\", line 355, in load_modules\r\n    loaded_modules, update_module)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/modules/loading.py\", line 255, in load_marked_modules\r\n    loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/modules/loading.py\", line 179, in load_module_graph\r\n    _load_data(cr, module_name, idref, mode, kind='demo')\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/modules/loading.py\", line 118, in _load_data\r\n    tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/tools/convert.py\", line 900, in convert_file\r\n    convert_xml_import(cr, module, fp, idref, mode, noupdate, report)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/tools/convert.py\", line 986, in convert_xml_import\r\n    obj.parse(doc.getroot(), mode=mode)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/tools/convert.py\", line 852, in parse\r\n    self._tags[rec.tag](self.cr, rec, n, mode=mode)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/tools/convert.py\", line 528, in _tag_workflow\r\n    uid, model, id, rec.get('action').encode('ascii'), cr)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/workflow/__init__.py\", line 85, in trg_validate\r\n    return WorkflowService.new(cr, uid, res_type, res_id).validate(signal)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/workflow/service.py\", line 91, in validate\r\n    res2 = wi.validate(signal)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/workflow/instance.py\", line 80, in validate\r\n    wi.process(signal=signal, force_running=force_running, stack=stack)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/workflow/workitem.py\", line 120, in process\r\n    ok = self._split_test(activity['split_mode'], signal, stack)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/workflow/workitem.py\", line 248, in _split_test\r\n    self._join_test(t[0], t[1], stack)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/workflow/workitem.py\", line 257, in _join_test\r\n    WorkflowItem.create(self.session, self.record, activity, inst_id, stack=stack)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/workflow/workitem.py\", line 95, in create\r\n    workflow_item.process(stack=stack)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/workflow/workitem.py\", line 116, in process\r\n    if not self._execute(activity, stack):\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/workflow/workitem.py\", line 162, in _execute\r\n    returned_action = self.wkf_expr_execute(activity)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/workflow/workitem.py\", line 313, in wkf_expr_execute\r\n    return self.wkf_expr_eval_expr(activity['action'])\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/workflow/workitem.py\", line 291, in wkf_expr_eval_expr\r\n    result = eval(line, env, nocopy=True)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/tools/safe_eval.py\", line 314, in safe_eval\r\n    return eval(c, globals_dict, locals_dict)\r\n  File \"\", line 1, in <module>\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/api.py\", line 266, in wrapper\r\n    return new_api(self, *args, **kwargs)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/addons/account/account_invoice.py\", line 931, in action_move_create\r\n    move.post()\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/api.py\", line 266, in wrapper\r\n    return new_api(self, *args, **kwargs)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/api.py\", line 592, in new_api\r\n    result = method(self._model, cr, uid, self.ids, *args, **old_kwargs)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/addons/account_sequence/account_sequence.py\", line 36, in post\r\n    res = super(account_move, self).post(cr, uid, ids, context=context)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/api.py\", line 268, in wrapper\r\n    return old_api(self, *args, **kwargs)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/addons/account/account.py\", line 1336, in post\r\n    self.write(cr, uid, [move.id], {'name':new_name})\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/api.py\", line 268, in wrapper\r\n    return old_api(self, *args, **kwargs)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/addons/account/account.py\", line 1377, in write\r\n    result = super(account_move, self).write(cr, uid, ids, vals, c)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/api.py\", line 268, in wrapper\r\n    return old_api(self, *args, **kwargs)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/api.py\", line 399, in old_api\r\n    result = method(recs, *args, **kwargs)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/models.py\", line 3788, in write\r\n    self._write(old_vals)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/api.py\", line 266, in wrapper\r\n    return new_api(self, *args, **kwargs)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/api.py\", line 592, in new_api\r\n    result = method(self._model, cr, uid, self.ids, *args, **old_kwargs)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/models.py\", line 4041, in _write\r\n    recs.recompute()\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/api.py\", line 266, in wrapper\r\n    return new_api(self, *args, **kwargs)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/models.py\", line 5761, in recompute\r\n    rec._write(values)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/api.py\", line 266, in wrapper\r\n    return new_api(self, *args, **kwargs)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/api.py\", line 592, in new_api\r\n    result = method(self._model, cr, uid, self.ids, *args, **old_kwargs)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/models.py\", line 3899, in _write\r\n    cr.execute(query, params + (sub_ids,))\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/sql_db.py\", line 158, in wrapper\r\n    return f(self, *args, **kwargs)\r\n  File \"/home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/sql_db.py\", line 234, in execute\r\n    res = self._obj.execute(query, params)\r\nParseError: \"\"duplicate key value violates unique constraint \"account_invoice_number_uniq\"\r\nDETAIL:  Key (number, company_id, journal_id, type)=(SAJ/2016/001, 1, 1, out_invoice) already exists.\r\n\" while evaluating\r\nu'action_move_create()'\" while parsing /home/odoo/runbot/extra/runbot/static/build/154378-8-0-bdf939/openerp/addons/l10n_be_coda/l10n_be_coda_demo.xml:57, near\r\n<workflow action=\"invoice_open\" model=\"account.invoice\" ref=\"coda_demo_invoice_1\"/>`\r\n![issue](https://cloud.githubusercontent.com/assets/6352350/16145645/0a68c37e-347a-11e6-8856-4b698c88acc6.PNG)\r\n\r\n\r\nExpected behavior:\r\nThe chart of account installs perfectly."},"comment":{"url":"https://api.github.com/repos/odoo/odoo/issues/comments/226759393","html_url":"https://github.com/odoo/odoo/issues/12471#issuecomment-226759393","issue_url":"https://api.github.com/repos/odoo/odoo/issues/12471","id":226759393,"user":{"login":"qdp-odoo","id":7628598,"avatar_url":"https://avatars.githubusercontent.com/u/7628598?v=3","gravatar_id":"","url":"https://api.github.com/users/qdp-odoo","html_url":"https://github.com/qdp-odoo","followers_url":"https://api.github.com/users/qdp-odoo/followers","following_url":"https://api.github.com/users/qdp-odoo/following{/other_user}","gists_url":"https://api.github.com/users/qdp-odoo/gists{/gist_id}","starred_url":"https://api.github.com/users/qdp-odoo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qdp-odoo/subscriptions","organizations_url":"https://api.github.com/users/qdp-odoo/orgs","repos_url":"https://api.github.com/users/qdp-odoo/repos","events_url":"https://api.github.com/users/qdp-odoo/events{/privacy}","received_events_url":"https://api.github.com/users/qdp-odoo/received_events","type":"User","site_admin":false},"created_at":"2016-06-17T12:44:52Z","updated_at":"2016-06-17T12:44:52Z","body":"It was a weird one, but should be fixed since revision https://github.com/odoo/odoo/commit/ba49172929559aeff0be5e59fd95b5562fab3224\r\n\r\nGlad we don't have that next-numbering-thing in v9...."}}
{"actor":{"display_login":"qdp-odoo"}}