Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
5 ตอบกลับ
12785 มุมมอง

I want to inherit new page tab in payroll module

I have written code in xml like this, but it cant.

     <xpath expr="//page[1]/field[@name='worked_days_line_ids']" position="after">

         <page string="New Page Tab">

         </page>

     </xpath>


I try another model like this, but failed. There is no page name, so I use index and field to inherit this. In here I use odoo 10. Can anyone help me for this?

     <xpath expr="//page[1]" position="after">

         <page string="New Page Tab">

         </page>

     </xpath>

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด



Did you add  dependency   hr_payroll   in    __manifest__.py  ?


Thanks !

iWesabe

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Try 'depends' : ['hr','hr_payroll'], in manifest.py

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi Festy,

Your code seems to be good.

Try this:

<record model="ir.ui.view" id="view_hr_payslip_inherit_form_extended">

     <field name="name">hr.payslip.inherit.form</field>

     <field name="model">hr.payslip</field>

     <field name="inherit_id" ref="hr_payroll.view_hr_payslip_form"/>

     <field name="arch" type="xml">

         <xpath expr="//page[1]" position="after">

             <page string="New Page Tab">

            </page>

         </xpath>

     </field>

</record>

Hope it helps,

Regards,

Mayank Gosai

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Thanks for your answer mayank. But I have problem again, when I add tree and some fields inside page, it doesnt work again.

For example, I write code like this :

     <xpath expr="//page[1]" position="after">

         <page string="Pendapatan Karyawan">

             <tree string="Tunjangan Gaji">

                 <field name="gaji_pokok"/>

             </tree>

     </page>

</xpath>


Then, I have error message like this :

 Model 'hr.payslip' does not exist in registry.


Can anyone help me?

อวตาร
ละทิ้ง

Hello Festy,

Pleasure to meet you too!

Again looking at this seems good.

Can you confirm your manifest file ?

Does your manifest file contains hr.payslip in depends ?

Regards,

Mayank

Related Posts ตอบกลับ มุมมอง กิจกรรม
Add tree and some fields แก้ไขแล้ว
3
ม.ค. 18
3267
1
ส.ค. 19
5652
1
พ.ย. 24
1366
1
มิ.ย. 24
1401
1
พ.ค. 24
2749