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

Dear all,


I have odoo 13 installed and would like to install asterisk_click2dial from OCA and Odoo Asterisk VOIP connector.


- I have downloaded the module and installed in my custome addons.

- I have installed the prerequisites as specified : Python library phonenumbers and py_Asterisk


While trying to install in odoo, I`m getting :


Error:
Odoo Server Error

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 664, in apply_inheritance_specs
    pre_locate=pre_locate)
  File "/usr/lib/python3/dist-packages/odoo/tools/template_inheritance.py", line 230, in apply_inheritance_specs
    _("Element '%s' cannot be located in parent view") % tag
ValueError: Element '<xpath expr="//group[@name='preference_email']/..">' cannot be located in parent view

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 712, in parse
    self._tag_root(de)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 674, in _tag_root
    f(rec)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 577, in _tag_record
    record = model._load_records([data], self.mode == 'update')
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 4080, in _load_records
    records = self._load_records_create([data['values'] for data in to_create])
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 3994, in _load_records_create
    return self.create(values)
  File "<decorator-gen-152>", line 2, in create
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 317, in _model_create_single
    return self.browse().concat(*(create(self, vals) for vals in arg))
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 317, in <genexpr>
    return self.browse().concat(*(create(self, vals) for vals in arg))
  File "/usr/lib/python3/dist-packages/odoo/addons/web_studio/models/studio_mixin.py", line 19, in create
    res = super(StudioMixin, self).create(vals)
  File "<decorator-gen-31>", line 2, in create
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 335, in _model_create_multi
    return create(self, [arg])
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 475, in create
    return super(View, self).create(vals_list)
  File "<decorator-gen-3>", line 2, in create
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 336, in _model_create_multi
    return create(self, arg)
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 3775, in create
    fields[0].determine_inverse(batch_recs)
  File "/usr/lib/python3/dist-packages/odoo/fields.py", line 1120, in determine_inverse
    getattr(records, self.inverse)()
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 299, in _inverse_arch
    view.write(data)
  File "/usr/lib/python3/dist-packages/odoo/addons/website_theme_install/models/theme_models.py", line 224, in write
    res = super(IrUiView, other_views).write(vals)
  File "/usr/lib/python3/dist-packages/odoo/addons/website/models/ir_ui_view.py", line 51, in write
    return super(View, self).write(vals)
  File "/usr/lib/python3/dist-packages/odoo/addons/web_studio/models/studio_mixin.py", line 28, in write
    res = super(StudioMixin, self).write(vals)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 493, in write
    res = super(View, self).write(self._compute_defaults(vals))
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 3564, in write
    real_recs._validate_fields(set(vals) - set(inverse_fields))
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 1176, in _validate_fields
    check(self)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 387, in _check_xml
    view_def = view.read_combined(['arch'])
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 738, in read_combined
    arch = self.apply_view_inheritance(arch_tree, root.id, self.model)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 687, in apply_view_inheritance
    source = self.apply_inheritance_specs(source, specs_tree, view_id)
  File "/usr/lib/python3/dist-packages/odoo/addons/web_studio/models/ir_ui_view.py", line 154, in apply_inheritance_specs
    pre_locate=pre_locate)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 666, in apply_inheritance_specs
    self.raise_view_error(str(e), inherit_id)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 614, in raise_view_error
    raise ValueError(message)
ValueError: Element '<xpath expr="//group[@name='preference_email']/..">' cannot be located in parent view

Error context:
View `base_phone.user_preferences.view`
[view_id: 3175, xml_id: n/a, model: res.users, parent_id: 161]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 624, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 310, in _handle_exception
    raise pycompat.reraise(type(exception), exception, sys.exc_info()[2])
  File "/usr/lib/python3/dist-packages/odoo/tools/pycompat.py", line 14, in reraise
    raise value
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 669, in dispatch
    result = self._call_function(**self.params)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 350, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 94, in wrapper
    return f(dbname, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 339, in checked_call
    result = self.endpoint(*a, **kw)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 915, in __call__
    return self.method(*args, **kw)
  File "/usr/lib/python3/dist-packages/odoo/http.py", line 515, in response_wrap
    response = f(*args, **kw)
  File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1326, in call_button
    action = self._call_kw(model, method, args, kwargs)
  File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1314, in _call_kw
    return call_kw(request.env[model], method, args, kwargs)
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 387, in call_kw
    result = _call_kw_multi(method, model, args, kwargs)
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 374, in _call_kw_multi
    result = method(recs, *args, **kwargs)
  File "<decorator-gen-59>", line 2, in button_immediate_install
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_module.py", line 72, in check_and_log
    return method(self, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_module.py", line 463, in button_immediate_install
    return self._button_immediate_function(type(self).button_install)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_module.py", line 573, in _button_immediate_function
    modules.registry.Registry.new(self._cr.dbname, update_module=True)
  File "/usr/lib/python3/dist-packages/odoo/modules/registry.py", line 86, in new
    odoo.modules.load_modules(registry._db, force_demo, status, update_module)
  File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 423, in load_modules
    loaded_modules, update_module, models_to_check)
  File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 315, in load_marked_modules
    perform_checks=perform_checks, models_to_check=models_to_check
  File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 225, in load_module_graph
    load_data(cr, idref, mode, kind='data', package=package, report=report)
  File "/usr/lib/python3/dist-packages/odoo/modules/loading.py", line 68, in load_data
    tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind, report)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 736, in convert_file
    convert_xml_import(cr, module, fp, idref, mode, noupdate, report)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 803, in convert_xml_import
    obj.parse(doc.getroot())
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 721, in parse
    exc_info[2]
  File "/usr/lib/python3/dist-packages/odoo/tools/pycompat.py", line 13, in reraise
    raise value.with_traceback(tb)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 712, in parse
    self._tag_root(de)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 674, in _tag_root
    f(rec)
  File "/usr/lib/python3/dist-packages/odoo/tools/convert.py", line 577, in _tag_record
    record = model._load_records([data], self.mode == 'update')
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 4080, in _load_records
    records = self._load_records_create([data['values'] for data in to_create])
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 3994, in _load_records_create
    return self.create(values)
  File "<decorator-gen-152>", line 2, in create
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 317, in _model_create_single
    return self.browse().concat(*(create(self, vals) for vals in arg))
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 317, in <genexpr>
    return self.browse().concat(*(create(self, vals) for vals in arg))
  File "/usr/lib/python3/dist-packages/odoo/addons/web_studio/models/studio_mixin.py", line 19, in create
    res = super(StudioMixin, self).create(vals)
  File "<decorator-gen-31>", line 2, in create
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 335, in _model_create_multi
    return create(self, [arg])
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 475, in create
    return super(View, self).create(vals_list)
  File "<decorator-gen-3>", line 2, in create
  File "/usr/lib/python3/dist-packages/odoo/api.py", line 336, in _model_create_multi
    return create(self, arg)
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 3775, in create
    fields[0].determine_inverse(batch_recs)
  File "/usr/lib/python3/dist-packages/odoo/fields.py", line 1120, in determine_inverse
    getattr(records, self.inverse)()
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 299, in _inverse_arch
    view.write(data)
  File "/usr/lib/python3/dist-packages/odoo/addons/website_theme_install/models/theme_models.py", line 224, in write
    res = super(IrUiView, other_views).write(vals)
  File "/usr/lib/python3/dist-packages/odoo/addons/website/models/ir_ui_view.py", line 51, in write
    return super(View, self).write(vals)
  File "/usr/lib/python3/dist-packages/odoo/addons/web_studio/models/studio_mixin.py", line 28, in write
    res = super(StudioMixin, self).write(vals)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 493, in write
    res = super(View, self).write(self._compute_defaults(vals))
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 3564, in write
    real_recs._validate_fields(set(vals) - set(inverse_fields))
  File "/usr/lib/python3/dist-packages/odoo/models.py", line 1176, in _validate_fields
    check(self)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 387, in _check_xml
    view_def = view.read_combined(['arch'])
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 738, in read_combined
    arch = self.apply_view_inheritance(arch_tree, root.id, self.model)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 687, in apply_view_inheritance
    source = self.apply_inheritance_specs(source, specs_tree, view_id)
  File "/usr/lib/python3/dist-packages/odoo/addons/web_studio/models/ir_ui_view.py", line 154, in apply_inheritance_specs
    pre_locate=pre_locate)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 666, in apply_inheritance_specs
    self.raise_view_error(str(e), inherit_id)
  File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_ui_view.py", line 614, in raise_view_error
    raise ValueError(message)
odoo.tools.convert.ParseError: "Element '<xpath expr="//group[@name='preference_email']/..">' cannot be located in parent view

Error context:
View `base_phone.user_preferences.view`
[view_id: 3175, xml_id: n/a, model: res.users, parent_id: 161]" while parsing /usr/lib/python3/dist-packages/odoo/custom/base_phone/views/res_users_view.xml:8, near
<odoo>


<record id="view_users_form" model="ir.ui.view">
    <field name="name">base_phone.res.users.telephony_tab</field>
    <field name="model">res.users</field>
    <field name="inherit_id" ref="base.view_users_form"/>
    <field name="arch" type="xml">
        <notebook position="inside">
            <page string="Telephony" name="phone" invisible="1">
                <!-- Empty page, which will be used by other phone modules -->
                <group name="phone-preferences" string="Telephony Preferences">
                </group>
            </page>
        </notebook>
    </field>
</record>

<record id="view_users_form_simple_modif" model="ir.ui.view">
    <field name="name">base_phone.user_preferences.view</field>
    <field name="model">res.users</field>
    <field name="inherit_id" ref="base.view_users_form_simple_modif"/>
    <field name="arch" type="xml">
        <xpath expr="//group[@name='preference_email']/.." position="after">
            <group name="phone" string="Telephony Preferences" invisible="1">
                <!-- Empty group, that is used by other phone modules -->
            </group>
        </xpath>
    </field>
</record>


</odoo>

 

Avatar
Discard
Best Answer

Hello Samir BECHAR

Here preference_email group name was change https://github.com/odoo/odoo/blob/13.0/odoo/addons/base/views/res_users_views.xml#L350

so please change code like this
Ex.
<record id="view_users_form_simple_modif" model="ir.ui.view">
    <field name="name">base_phone.user_preferences.view</field>
    <field name="model">res.users</field>
    <field name="inherit_id" ref="base.view_users_form_simple_modif"/>
    <field name="arch" type="xml">
        <xpath expr="//group[@name='preferences'][1]" position="after">
            <group name="phone" string="Telephony Preferences" invisible="1">
                <!-- Empty group, that is used by other phone modules -->
            </group>
        </xpath>
    </field>
</record>



Avatar
Discard
Author Best Answer

Thank you Nikul,

That solved the issue after updating  below in /usr/lib/python3/dist-packages/odoo/custom/base_phone/views/res_users_view.xml

<xpath expr="//group[@name='preferences'][1]" position="after">

Can you please brief me how you ended up to this resolution?

Thank you 

Samir 


Avatar
Discard

Mr. Samir

"asterisk_click2dial" this OCA module not migrated in v13, You used v12 module.

In Odoo v12 `preference_email ` group in users_view.xml but in Odoo v13 this group was remove.

And renamed only 'preferences' group.

when you Installed the module that time path was not located in parent view, that time given this Error.

Thank You

Nikul Chaudhary