コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
7313 ビュー

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












アバター
破棄
著作者

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>

著作者

Can you explain what I did wrong

Is it worked?

最善の回答

Hello alfik,

Please find below answer it may help you,


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

アバター
破棄

<!-- 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>

最善の回答

Would you provide the full error trace ?

also , did you try to use xpath expr?

アバター
破棄

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

関連投稿 返信 ビュー 活動
2
7月 24
7688
0
3月 22
101
2
2月 22
3665
0
1月 24
1130
3
5月 23
3331