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

Hello Everyone...

In Odoo 8 Contract Form, I want to hide supplementary_allowance field . But its already a inherited view of l_10n_in_hr_payroll form. My xpath is as below but its giving error

<xpath expr="//page[@string='Information']/group/group[@name='salary_and_advantages']/group[1]/field[@name='supplementary_allowance']" position="attributes">

        <attribute name="invisible">1</attribute>

                </xpath>

So can any one tell correct xpath.

Thanks in advance.......

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

  There is no id problem we are passing correct id,  the problem is that supplementary_allowance is an inherited view of odoo so we are not able to go to correct xpath, so kindly provide correct xpath if you know. Thanks 

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

I think external id is not found error in your code.please refer my code

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

            <field name="name">hr.contract.view.form.hides.supp.allo</field>

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

            <field name="inherit_id" ref="hr_contract.hr_contract_form_inherit"/>

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

                <xpath expr="//field[@name='supplementary_allowance']" position="attributes">

                    <attribute name="invisible">1</attribute>

                </xpath>

            </field>

</record>


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

Hi Aslam,

There is no id problem we are passing correct id, the problem is that supplementary_allowance is an inherited view of odoo so we are not able to go to correct xpath, so kindly provide correct xpath if you know. Thanks

Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 7 16
3398
1
thg 3 24
2456
1
thg 6 22
4742
1
thg 12 19
4839
2
thg 4 16
3757