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

原论坛用户的基本信息和发帖这里都予以保留,请注意:原论坛用户无需重新注册新用户,但是您的密码需要重置

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

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

Error while validating constraint



  • Traceback (most recent call last):
      File "/home/odoo/odoo-dev/odoo/odoo/http.py", line 638, in _handle_exception
        return super(JsonRequest, self)._handle_exception(exception)
      File "/home/odoo/odoo-dev/odoo/odoo/http.py", line 675, in dispatch
        result = self._call_function(**self.params)
      File "/home/odoo/odoo-dev/odoo/odoo/http.py", line 331, in _call_function
        return checked_call(self.db, *args, **kwargs)
      File "/home/odoo/odoo-dev/odoo/odoo/service/model.py", line 119, in wrapper
        return f(dbname, *args, **kwargs)
      File "/home/odoo/odoo-dev/odoo/odoo/http.py", line 324, in checked_call
        result = self.endpoint(*a, **kw)
      File "/home/odoo/odoo-dev/odoo/odoo/http.py", line 933, in __call__
        return self.method(*args, **kw)
      File "/home/odoo/odoo-dev/odoo/odoo/http.py", line 504, in response_wrap
        response = f(*args, **kw)
      File "/home/odoo/odoo-dev/odoo/addons/web/controllers/main.py", line 889, in call_button
        action = self._call_kw(model, method, args, {})
      File "/home/odoo/odoo-dev/odoo/addons/web/controllers/main.py", line 877, in _call_kw
        return call_kw(request.env[model], method, args, kwargs)
      File "/home/odoo/odoo-dev/odoo/odoo/api.py", line 681, in call_kw
        return call_kw_multi(method, model, args, kwargs)
      File "/home/odoo/odoo-dev/odoo/odoo/api.py", line 672, in call_kw_multi
        result = method(recs, *args, **kwargs)
      File "/home/odoo/odoo-dev/odoo/odoo/addons/base/module/module.py", line 527, in button_immediate_upgrade
        return self._button_immediate_function(type(self).button_upgrade)
      File "/home/odoo/odoo-dev/odoo/odoo/addons/base/module/module.py", line 484, in _button_immediate_function
        modules.registry.Registry.new(self._cr.dbname, update_module=True)
      File "/home/odoo/odoo-dev/odoo/odoo/modules/registry.py", line 82, in new
        odoo.modules.load_modules(registry._db, force_demo, status, update_module)
      File "/home/odoo/odoo-dev/odoo/odoo/modules/loading.py", line 335, in load_modules
        force, status, report, loaded_modules, update_module)
      File "/home/odoo/odoo-dev/odoo/odoo/modules/loading.py", line 237, in load_marked_modules
        loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)
      File "/home/odoo/odoo-dev/odoo/odoo/modules/loading.py", line 156, in load_module_graph
        _load_data(cr, module_name, idref, mode, kind='data')
      File "/home/odoo/odoo-dev/odoo/odoo/modules/loading.py", line 95, in _load_data
        tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report)
      File "/home/odoo/odoo-dev/odoo/odoo/tools/convert.py", line 845, in convert_file
        convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
      File "/home/odoo/odoo-dev/odoo/odoo/tools/convert.py", line 915, in convert_xml_import
        obj.parse(doc.getroot(), mode=mode)
      File "/home/odoo/odoo-dev/odoo/odoo/tools/convert.py", line 796, in parse
        self.parse(rec, mode)
      File "/home/odoo/odoo-dev/odoo/odoo/tools/convert.py", line 799, in parse
        self._tags[rec.tag](rec, de, mode=mode)
      File "/home/odoo/odoo-dev/odoo/odoo/tools/convert.py", line 707, in _tag_record
        id = self.env(context=rec_context)['ir.model.data']._update(rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode)
      File "/home/odoo/odoo-dev/odoo/odoo/addons/base/ir/ir_model.py", line 1189, in _update
        record.write(values)
      File "/home/odoo/odoo-dev/odoo/odoo/addons/base/ir/ir_ui_view.py", line 378, in write
        return super(View, self).write(self._compute_defaults(vals))
      File "/home/odoo/odoo-dev/odoo/odoo/models.py", line 3571, in write
        self._fields[key].determine_inverse(self)
      File "/home/odoo/odoo-dev/odoo/odoo/fields.py", line 1000, in determine_inverse
        getattr(records, self.inverse)()
      File "/home/odoo/odoo-dev/odoo/odoo/addons/base/ir/ir_ui_view.py", line 220, in _inverse_arch
        view.write(data)
      File "/home/odoo/odoo-dev/odoo/odoo/addons/base/ir/ir_ui_view.py", line 378, in write
        return super(View, self).write(self._compute_defaults(vals))
      File "/home/odoo/odoo-dev/odoo/odoo/models.py", line 3564, in write
        self._write(old_vals)
      File "/home/odoo/odoo-dev/odoo/odoo/models.py", line 3714, in _write
        self._validate_fields(vals)
      File "/home/odoo/odoo-dev/odoo/odoo/models.py", line 1083, in _validate_fields
        raise ValidationError("%s\n\n%s" % (_("Error while validating constraint"), tools.ustr(e)))
    ParseError: "Error while validating constraint
    
    need more than 1 value to unpack
    None" while parsing /home/odoo/odoo-dev/odoo/abbsps/sps_eco/views/eco_views.xml:22, near
    <record id="sps_eco_view_tree" model="ir.ui.view">
            <field name="name">sps.eco.view.tree</field>
            <field name="model">sps.eco</field>
            <field name="arch" type="xml">
                <tree decoration-info="state=='progress'" decoration-danger="state=='confirmed'"> <!-- Or RED for late stuff-->
                    <field name="name"/>
                    <field name="user_id"/>
                    <field name="effective_date"/>
                    <field name="priority"/>
                    <field name="state"/>
                </tree>
            </field>
        </record>
    

    什么原因导致的,我就是user的domain筛选多加了一个用户组,这个用户组也属于这个模型的?



  • 已解决,谢谢各位.

    是原来的错误写法是:user_ids_eco = self.env.ref('group_eco_user').mapped('users')

    我以为group_eco_user是这个模型中定义的,所以不用写所属模块了,这样不对.改成
    user_ids_eco = self.env.ref('sps_eco.group_eco_user').mapped('users')就对了.


登录后回复
 

与 Odoo 中文社区 的连接断开,我们正在尝试重连,请耐心等待