Skip to Content
Menu
This question has been flagged
2 Replies
1022 Views

Context:

By mistake I deactivated the option "Auto-populate company data" from general options, when I wanted to activate it again, I got the following error.


Error:

Odoo Server Error


Traceback (most recent call last):

  File "/odoo/odoo/odoo/models.py", line 1128, in _validate_fields

    check(self)

  File "/odoo/odoo/odoo/addons/base/models/ir_ui_view.py", line 345, in _check_xml

    view_def = view.read_combined(['arch'])

  File "/odoo/custom-addons/module_visual/muk_branding/models/ir_ui_view.py", line 31, in read_combined

    res = super(View, self).read_combined(fields=fields)

  File "/odoo/odoo/odoo/addons/base/models/ir_ui_view.py", line 814, in read_combined

    arch = self.apply_view_inheritance(arch_tree, root.id, self.model)

  File "/odoo/odoo/odoo/addons/base/models/ir_ui_view.py", line 762, in apply_view_inheritance

    source = self.apply_inheritance_specs(source, specs_tree, view_id)

  File "/odoo/odoo/odoo/addons/base/models/ir_ui_view.py", line 740, in apply_inheritance_specs

    self.raise_view_error(_("Element '%s' cannot be located in parent view") % tag, inherit_id)

  File "/odoo/odoo/odoo/addons/base/models/ir_ui_view.py", line 568, in raise_view_error

    raise ValueError(message)

ValueError: El elemento '<xpath expr="//field[@name='vat']">' no puede ser localizado en la vista padre


Contexto del error:

Vista `res.partner.short.form.inherit.partner.autocomplete`

[view_id: 2333, xml_id: n/a, model: res.partner, parent_id: 112]


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "/odoo/odoo/odoo/tools/convert.py", line 758, in parse

    self._tags[rec.tag](rec, de, mode=mode)

  File "/odoo/odoo/odoo/tools/convert.py", line 663, in _tag_record

    record = model.with_context(rec_context)._load_records([data], self.mode == 'update')

  File "/odoo/odoo/odoo/models.py", line 3893, in _load_records

    records = self._load_records_create([data['values'] for data in to_create])

  File "/odoo/odoo/odoo/models.py", line 3807, in _load_records_create

    return self.create(values)

  File "<decorator-gen-33>", line 2, in create

  File "/odoo/odoo/odoo/api.py", line 462, in _model_create_multi

    return create(self, arg)

  File "/odoo/odoo/odoo/addons/base/models/ir_ui_view.py", line 428, in create

    return super(View, self).create(vals_list)

  File "<decorator-gen-3>", line 2, in create

  File "/odoo/odoo/odoo/api.py", line 462, in _model_create_multi

    return create(self, arg)

  File "/odoo/odoo/odoo/models.py", line 3624, in create

    fields[0].determine_inverse(batch_recs)

  File "/odoo/odoo/odoo/fields.py", line 1148, in determine_inverse

    getattr(records, self.inverse)()

  File "/odoo/odoo/odoo/addons/base/models/ir_ui_view.py", line 275, in _inverse_arch

    view.write(data)

  File "/odoo/odoo/addons/website/models/ir_ui_view.py", line 41, in write

    return super(View, self).write(vals)

  File "/odoo/odoo/odoo/addons/base/models/ir_ui_view.py", line 445, in write

    res = super(View, self).write(self._compute_defaults(vals))

  File "/odoo/odoo/odoo/models.py", line 3349, in write

    self._write(store_vals)

  File "/odoo/odoo/odoo/models.py", line 3485, in _write

    self._validate_fields(vals)

  File "/odoo/odoo/odoo/models.py", line 1132, in _validate_fields

    raise ValidationError("%s\n\n%s" % (_("Error while validating constraint"), tools.ustr(e)))

odoo.exceptions.ValidationError: ('Error mientras se validaban las restricciones\n\nEl elemento \'<xpath expr="//field[@name=\'vat\']">\' no puede ser localizado en la vista padre\n\nContexto del error:\nVista `res.partner.short.form.inherit.partner.autocomplete`\n[view_id: 2333, xml_id: n/a, model: res.partner, parent_id: 112]', None)


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "/odoo/odoo/odoo/http.py", line 656, in _handle_exception

    return super(JsonRequest, self)._handle_exception(exception)

  File "/odoo/odoo/odoo/http.py", line 314, in _handle_exception

    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])

  File "/odoo/odoo/odoo/tools/pycompat.py", line 87, in reraise

    raise value

  File "/odoo/odoo/odoo/http.py", line 698, in dispatch

    result = self._call_function(**self.params)

  File "/odoo/odoo/odoo/http.py", line 346, in _call_function

    return checked_call(self.db, *args, **kwargs)

  File "/odoo/odoo/odoo/service/model.py", line 98, in wrapper

    return f(dbname, *args, **kwargs)

  File "/odoo/odoo/odoo/http.py", line 339, in checked_call

    result = self.endpoint(*a, **kw)

  File "/odoo/odoo/odoo/http.py", line 941, in __call__

    return self.method(*args, **kw)

  File "/odoo/odoo/odoo/http.py", line 519, in response_wrap

    response = f(*args, **kw)

  File "/odoo/odoo/addons/web/controllers/main.py", line 966, in call_button

    action = self._call_kw(model, method, args, {})

  File "/odoo/odoo/addons/web/controllers/main.py", line 954, in _call_kw

    return call_kw(request.env[model], method, args, kwargs)

  File "/odoo/odoo/odoo/api.py", line 759, in call_kw

    return _call_kw_multi(method, model, args, kwargs)

  File "/odoo/odoo/odoo/api.py", line 746, in _call_kw_multi

    result = method(recs, *args, **kwargs)

  File "/odoo/odoo/odoo/addons/base/models/res_config.py", line 637, in execute

    self._install_modules(to_install)

  File "/odoo/odoo/odoo/addons/base/models/res_config.py", line 34, in _install_modules

    result = to_install_modules.button_immediate_install()

  File "<decorator-gen-62>", line 2, in button_immediate_install

  File "/odoo/odoo/odoo/addons/base/models/ir_module.py", line 74, in check_and_log

    return method(self, *args, **kwargs)

  File "/odoo/odoo/odoo/addons/base/models/ir_module.py", line 445, in button_immediate_install

    return self._button_immediate_function(type(self).button_install)

  File "/odoo/odoo/odoo/addons/base/models/ir_module.py", line 561, in _button_immediate_function

    modules.registry.Registry.new(self._cr.dbname, update_module=True)

  File "/odoo/odoo/odoo/modules/registry.py", line 86, in new

    odoo.modules.load_modules(registry._db, force_demo, status, update_module)

  File "/odoo/odoo/odoo/modules/loading.py", line 421, in load_modules

    loaded_modules, update_module, models_to_check)

  File "/odoo/odoo/odoo/modules/loading.py", line 313, in load_marked_modules

    perform_checks=perform_checks, models_to_check=models_to_check

  File "/odoo/odoo/odoo/modules/loading.py", line 222, in load_module_graph

    load_data(cr, idref, mode, kind='data', package=package, report=report)

  File "/odoo/odoo/odoo/modules/loading.py", line 68, in load_data

    tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind, report)

  File "/odoo/odoo/odoo/tools/convert.py", line 802, in convert_file

    convert_xml_import(cr, module, fp, idref, mode, noupdate, report)

  File "/odoo/odoo/odoo/tools/convert.py", line 865, in convert_xml_import

    obj.parse(doc.getroot(), mode=mode)

  File "/odoo/odoo/odoo/tools/convert.py", line 764, in parse

    exc_info[2]

  File "/odoo/odoo/odoo/tools/pycompat.py", line 86, in reraise

    raise value.with_traceback(tb)

  File "/odoo/odoo/odoo/tools/convert.py", line 758, in parse

    self._tags[rec.tag](rec, de, mode=mode)

  File "/odoo/odoo/odoo/tools/convert.py", line 663, in _tag_record

    record = model.with_context(rec_context)._load_records([data], self.mode == 'update')

  File "/odoo/odoo/odoo/models.py", line 3893, in _load_records

    records = self._load_records_create([data['values'] for data in to_create])

  File "/odoo/odoo/odoo/models.py", line 3807, in _load_records_create

    return self.create(values)

  File "<decorator-gen-33>", line 2, in create

  File "/odoo/odoo/odoo/api.py", line 462, in _model_create_multi

    return create(self, arg)

  File "/odoo/odoo/odoo/addons/base/models/ir_ui_view.py", line 428, in create

    return super(View, self).create(vals_list)

  File "<decorator-gen-3>", line 2, in create

  File "/odoo/odoo/odoo/api.py", line 462, in _model_create_multi

    return create(self, arg)

  File "/odoo/odoo/odoo/models.py", line 3624, in create

    fields[0].determine_inverse(batch_recs)

  File "/odoo/odoo/odoo/fields.py", line 1148, in determine_inverse

    getattr(records, self.inverse)()

  File "/odoo/odoo/odoo/addons/base/models/ir_ui_view.py", line 275, in _inverse_arch

    view.write(data)

  File "/odoo/odoo/addons/website/models/ir_ui_view.py", line 41, in write

    return super(View, self).write(vals)

  File "/odoo/odoo/odoo/addons/base/models/ir_ui_view.py", line 445, in write

    res = super(View, self).write(self._compute_defaults(vals))

  File "/odoo/odoo/odoo/models.py", line 3349, in write

    self._write(store_vals)

  File "/odoo/odoo/odoo/models.py", line 3485, in _write

    self._validate_fields(vals)

  File "/odoo/odoo/odoo/models.py", line 1132, in _validate_fields

    raise ValidationError("%s\n\n%s" % (_("Error while validating constraint"), tools.ustr(e)))

odoo.tools.convert.ParseError: "Error mientras se validaban las restricciones


El elemento '<xpath expr="//field[@name='vat']">' no puede ser localizado en la vista padre


Contexto del error:

Vista `res.partner.short.form.inherit.partner.autocomplete`

[view_id: 2333, xml_id: n/a, model: res.partner, parent_id: 112]

None" while parsing /odoo/odoo/addons/partner_autocomplete/views/res_partner_views.xml:21, near

<record id="view_res_partner_short_form_inherit_partner_autocomplete" model="ir.ui.view">

        <field name="name">res.partner.short.form.inherit.partner.autocomplete</field>

        <field name="model">res.partner</field>

        <field name="inherit_id" ref="base.view_partner_short_form"/>

        <field name="arch" type="xml">

            <data><xpath expr="//div[hasclass('oe_title')]/h1/field[@name='name']" position="attributes">

                <attribute name="widget">field_partner_autocomplete</attribute>

            </xpath>

            <xpath expr="//field[@name='vat']" position="attributes">

                <attribute name="widget">field_partner_autocomplete</attribute>

            </xpath>

            <xpath expr="//field[last()]" position="after">

                <field name="partner_gid" invisible="True"/>

                <field name="additional_info" invisible="True"/>

            </xpath>

        </data></field>

    </record>

Avatar
Discard

The error message is telling you exactly what your problem is, and this should also be used as your question title.

... but in english please.

Author

 

Hola,

 

 

When activating the option that he told me, then we click on save and the error described appears.

 

Atte.

 

Felipe A. Carvajal F.

 

 

From: Kamrul Hasan <kamruldev66@gmail.com>
Sent: lunes, 1 de marzo de 2021 1:42
To: Felipe Carvajal Freire <fc@azurtech.cl>
Subject: Re: active option error (odoo v12 community): "Auto-populate company data" from general options

 

A new answer on active option error (odoo v12 community): "Auto-populate company data" from general options has been posted. Click here to access the post :

See post

Sent by Odoo S.A. using Odoo.

Author Best Answer

sorry I'm new to this, and would like to know where to add the missing field in the parent view so that the error doesn't appear.


PS: sorry the error appears in Spanish, because the language is Spanish, however the context and the rest is in English.

Avatar
Discard
Best Answer

Please make sure to enable this feature go to General settings under settings.

Settings → General Settings → Enable Auto Populate Company Data.

Avatar
Discard