跳至內容
選單
此問題已被標幟
2 回覆
2971 瀏覽次數

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.

頭像
捨棄
作者 最佳答案

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.

頭像
捨棄
最佳答案

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

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
0
12月 24
1130
0
7月 24
1036
2
2月 24
2653
4
11月 23
2908
0
11月 23
1292