Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
3113 Widoki

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.

Awatar
Odrzuć
Autor Najlepsza odpowiedź

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.

Awatar
Odrzuć
Najlepsza odpowiedź

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

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
0
gru 24
1331
0
lip 24
1187
2
lut 24
2861
4
lis 23
3201
0
lis 23
1385