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

i inherited 'hr.view_employee_form' form and  'personal information' page to 'base.group_user' Group but entire fields don't appear because of field access in original model and view .

note : i added all access rights ( read ) to 'base.group_user' Group

what is the solution


<record id="hide_working_hours_for_employees" model="ir.ui.view">
<field name="name">Hide Working Hours Employees Form</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='resource_calendar_id']" position="before">
<field name="inv" invisible="True"/>
</xpath>
<xpath expr="//page[@name='personal_information']" position="attributes">
<attribute name="groups">base.group_user</attribute>
</xpath>  
  </field>
</record>
อวตาร
ละทิ้ง

Inheritance in Model and Views: https://goo.gl/4Zyc9d

Groups and Access Rights: https://goo.gl/4jAhtH

คำตอบที่ดีที่สุด

Hi Bro,

you can solve that by replacing this code of yours :

<xpath expr="//page[@name='personal_information']" position="attributes">
<attribute name="groups">base.group_user</attribute>
</xpath>

With this code of mine :

<xpath expr="//*/page[@name='personal_information']" position="attributes">
<attribute name="groups">base.group_user</attribute>
</xpath>
And dont forget to vote positif :) 
อวตาร
ละทิ้ง
ผู้เขียน

it produced an Error :

View inheritance may not use attribute 'string' as a selector.

Hi , i edited my answer to match with your odoo 11 version , hope it works now!

คำตอบที่ดีที่สุด

Hi,

It seems you are adding a group to the page inside the form, once this is done, the page will be visible only for the users in the group. 

But, here it seems you have given the group as base.group_user(which is Internal User group), so its not making any sense of giving this, as all the backend users are in this group.

Thanks

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
6
ธ.ค. 22
15298
0
ก.พ. 20
2869
2
ม.ค. 20
7320
0
ม.ค. 25
1246
1
มี.ค. 25
652