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

I am getting "Element '%s' cannot be located in parent view") error when using an inherited view in which a field with only string attribute is used for inheriting, when I am using user language as Turkish(Probably for any other language than English).  Below is the view that causes the error in the addon oh_hr_zk_attendance of Cybrosys when clicking Attandances->Manager->Attandances manu item.


<recordid="inherited_hr_attendance_view_filter"model="ir.ui.view">
    <fieldname="name">inherited_hr_attendance_view_filterfield>
    <fieldname="model">hr.attendancefield>
    <fieldname="inherit_id"ref="hr_attendance.hr_attendance_view_filter"/>
    <fieldname="arch"type="xml">
        <searchstring="Hr Attendance Search"><groupexpand="0"string="Group By">
            <separator/>
            <filtername="date"string="Date"context="{'group_by':'check_in:day'}"/>
            group>
        search>
    field>
record>

Error occurs at odoo/addons/base/models/ir_ui_view.py, line 673, in apply_inheritance_specs.
Because the view_id browse(at odoo/odoo/models.py", line 1520, in _fields_view_get) is returned with translated value of fields string attribute,
system doesn't match the values.

Temporary solution is deleting the translation for this field.

Avatar
Discard
Author Best Answer

Hi Niyas,

This is a part of a third party addon which I only use for my database. They want to inherit and change all "Hr Attendance Search" tag, but this tag has only string attribute to call in inherited file.

The same thing also happened at "view_attendance_tree" view at hr_attendance module of Odoo V13 CE.

Only string attribute is defined and to change it they use this way. 

I think either every tag must have a name / id attribute or using string attribute of tag(this is not the right thing for me) must be under control(comparison of string attribute values of inherited and base views must be done in English).


Thanks.

Avatar
Discard
Best Answer

Hi,

It will be nice if you specify what you are trying to do with this view ? need to xpath and add new filter ? In the above code, you can see there is a name attribute for the field, ie name="date" , using this you can inherit right ?


Thanks

Avatar
Discard
Related Posts Replies Views Activity
0
Dec 24
32
0
Jul 24
207
2
Feb 24
1527
4
Nov 23
1106
0
Nov 23
517