Odoo中文社区可以通过以下两个域名访问:shine-it.net , odoo.net.cn

由于系统升迁的原因,本论坛部分较早期的内容存在格式和链接损坏失效的问题,并非本论坛系统本身的缺陷,望谅解

本社区没有维护任何QQ群讨论组,任何与本社区同名的QQ群讨论组的言论与本社区无关!

开发人员可以登录gitter讨论组: http://gitter.im/odoo-china/Talk, 需要github账号

如果您登录系统碰到问题,请在微信公众号留言:

请大腿帮忙看一下这个问题:"relation "ir_sequence_003" already exists



  • return f(self, *args, **kwargs)
    

    File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/sql_db.py", line 225, in execute
    res = self._obj.execute(query, params)
    odoo.tools.convert.ParseError: "relation "ir_sequence_003" already exists
    " while parsing /Users/john/PycharmProjects/GC/Odoo_project/XXX/addons/account/data/account_data.xml:69, near

    Account reconcile sequence
    account.reconcile
    A




    请大神帮忙看看怎么解决


  • 管理员

    连traceback 的log都贴不好,叫别人怎么帮你。



  • This post is deleted!


  • @digitalsatori
    不好意思第一次发帖

    Traceback (most recent call last):
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/http.py", line 656, in _handle_exception
        return super(JsonRequest, self)._handle_exception(exception)
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/http.py", line 314, in _handle_exception
        raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/tools/pycompat.py", line 87, in reraise
        raise value
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/http.py", line 698, in dispatch
        result = self._call_function(**self.params)
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/http.py", line 346, in _call_function
        return checked_call(self.db, *args, **kwargs)
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/service/model.py", line 97, in wrapper
        return f(dbname, *args, **kwargs)
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/http.py", line 339, in checked_call
        result = self.endpoint(*a, **kw)
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/http.py", line 941, in __call__
        return self.method(*args, **kw)
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/http.py", line 519, in response_wrap
        response = f(*args, **kw)
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/addons/web/controllers/main.py", line 966, in call_button
        action = self._call_kw(model, method, args, {})
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/addons/web/controllers/main.py", line 954, in _call_kw
        return call_kw(request.env[model], method, args, kwargs)
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/api.py", line 749, in call_kw
        return _call_kw_multi(method, model, args, kwargs)
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/api.py", line 736, in _call_kw_multi
        result = method(recs, *args, **kwargs)
      File "<decorator-gen-61>", line 2, in button_immediate_install
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/addons/base/models/ir_module.py", line 74, in check_and_log
        return method(self, *args, **kwargs)
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/addons/base/models/ir_module.py", line 445, in button_immediate_install
        return self._button_immediate_function(type(self).button_install)
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/addons/base/models/ir_module.py", line 561, in _button_immediate_function
        modules.registry.Registry.new(self._cr.dbname, update_module=True)
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/modules/registry.py", line 86, in new
        odoo.modules.load_modules(registry._db, force_demo, status, update_module)
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/modules/loading.py", line 421, in load_modules
        loaded_modules, update_module, models_to_check)
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/modules/loading.py", line 313, in load_marked_modules
        perform_checks=perform_checks, models_to_check=models_to_check
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/modules/loading.py", line 222, in load_module_graph
        load_data(cr, idref, mode, kind='data', package=package, report=report)
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/modules/loading.py", line 68, in load_data
        tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind, report)
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/tools/convert.py", line 802, in convert_file
        convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/tools/convert.py", line 865, in convert_xml_import
        obj.parse(doc.getroot(), mode=mode)
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/tools/convert.py", line 755, in parse
        self.parse(rec, mode)
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/tools/convert.py", line 764, in parse
        exc_info[2]
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/tools/pycompat.py", line 86, in reraise
        raise value.with_traceback(tb)
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/tools/convert.py", line 758, in parse
        self._tags[rec.tag](rec, de, mode=mode)
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/tools/convert.py", line 663, in _tag_record
        record = model.with_context(rec_context)._load_records([data], self.mode == 'update')
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/models.py", line 3865, in _load_records
        records = self._load_records_create([data['values'] for data in to_create])
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/models.py", line 3779, in _load_records_create
        return self.create(values)
      File "<decorator-gen-26>", line 2, in create
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/api.py", line 433, in _model_create_single
        return self.browse().concat(*(create(self, vals) for vals in arg))
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/api.py", line 433, in <genexpr>
        return self.browse().concat(*(create(self, vals) for vals in arg))
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/addons/base/models/ir_sequence.py", line 149, in create
        _create_sequence(self._cr, "ir_sequence_%03d" % seq.id, values.get('number_increment', 1), values.get('number_next', 1))
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/addons/base/models/ir_sequence.py", line 18, in _create_sequence
        cr.execute(sql, (number_increment, number_next))
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/sql_db.py", line 148, in wrapper
        return f(self, *args, **kwargs)
      File "/Users/john/PycharmProjects/GC/Odoo_project/XXX/odoo/sql_db.py", line 225, in execute
        res = self._obj.execute(query, params)
    odoo.tools.convert.ParseError: "relation "ir_sequence_001" already exists
    " while parsing /Users/john/PycharmProjects/GC/Odoo_project/XXX/addons/account/data/account_data.xml:69, near
    <record id="sequence_reconcile_seq" model="ir.sequence">
                <field name="name">Account reconcile sequence</field>
                <field name="code">account.reconcile</field>
                <field name="prefix">A</field>
                <field eval="1" name="number_next"/>
                <field eval="1" name="number_increment"/>
                <field eval="False" name="company_id"/>
            </record>
    

  • 管理员

    可以用```把你的log信息包起来,这样就可以保持格式了。帮你改了一下。

    这个错误的原因是系统在安装Account模块的时候要为Reconcile创建数据库序列,但是数据库中已经有了同名的序列了。

    要想了解产生这个问题的原因,你得告诉我们导致这个错误前你的具体操作,或者你安装了什么第三方的模块。

    如果仅仅是测试,你可以注释掉错误提示中提到的account/data/account_data.xml文件中的

    <record id="sequence_reconcile_seq" model="ir.sequence">
                <field name="name">Account reconcile sequence</field>
                <field name="code">account.reconcile</field>
                <field name="prefix">A</field>
                <field eval="1" name="number_next"/>
                <field eval="1" name="number_increment"/>
                <field eval="False" name="company_id"/>
            </record>
    

    再尝试安装或升级



  • @digitalsatori
    您好,我发生错误的之前操作是安装 中国-城市数据 模块,后面发现只要涉及到系统自带的开票模块(Account)的都会有这样的问题产生,我现在将这个文件夹下的所有序列代码都注释了才装成功(😢)。我也想请教一下,如何去在数据库中查找您所说的序列。。。

           <!--
            Account Statement Sequences
            对账单序列
            -->
            <record id="sequence_reconcile_seq" model="ir.sequence">
                <field name="name">Account reconcile sequence</field>
                <field name="code">account.reconcile</field>
                <field name="prefix">A</field>
                <field eval="1" name="number_next"/>
                <field eval="1" name="number_increment"/>
                <field eval="False" name="company_id"/>
            </record>
    

    1570607994555.jpg


Log in to reply