Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
7336 Lượt xem

Hi im using doo14. i made a custom module and now im facing a error "Element '' cannot be located in parent view" while inheriting

my code

from odoo import fields, models


class Teacher(models.Model):

_inherit = 'hr.employee'

teacher = fields.Boolean( string='Teacher', required=False)





Teacher.form.view
hr.employee












Ảnh đại diện
Huỷ bỏ
Tác giả

this is the XML
<!-- Inherit Form View to Modify it -->
<record id="teacher_form_view" model="ir.ui.view">
<field name="name">Teacher.form.view</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<field name="coach_id" position="after"/>
<field name="teacher"/>

</field>
</record>

Tác giả

Can you explain what I did wrong

Is it worked?

Câu trả lời hay nhất

Hello alfik,

Please find below answer it may help you,


Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

Ảnh đại diện
Huỷ bỏ

<!-- Inherit Form View to Modify it -->
<record id="teacher_form_view" model="ir.ui.view">
<field name="name">Teacher.form.view</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<field name="coach_id" position="after">
<field name="teacher"/>
</field>
</field>
</record>

Câu trả lời hay nhất

Would you provide the full error trace ?

also , did you try to use xpath expr?

Ảnh đại diện
Huỷ bỏ

Also check this video to copy/past your code in this forum.
https://www.youtube.com/watch?v=nw3q0Cs1swg&ab_channel=OdooMates

Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 7 24
7716
0
thg 3 22
101
2
thg 2 22
3699
0
thg 1 24
1169
3
thg 5 23
3361