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

I have address fields on my website and I can't show them to public visitors. I have written following line to security CSV file -

access_res_partner,res_partner,base.model_res_partner,,1,0,0,0

The module is upgrading but page not showing for public visitors.


อวตาร
ละทิ้ง

Did you add csv file in __openerp__.py file ?

ผู้เขียน

yes, I did.

ผู้เขียน คำตอบที่ดีที่สุด

It was solved with this:

<span t-field="event.address_id.sudo().city"/>,                                
<span t-field="event.address_id.sudo().country_id.name"/>
อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

HI Tanzilul,

You can inherit the website template and give a condition to display your field,

eg t-if = "not public visitor[portal group or your custom group]" t-esc="yourfield"

hence the public users cant see the field,

if you provide your code here I can answer you by code

อวตาร
ละทิ้ง
ผู้เขียน

The new module is made by inheriting existing module. I got it solved. Thanks.

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

Tanzil,

I tried to override the existing access right

https://www.odoo.com/forum/help-1/question/how-to-make-a-model-is-fully-public-108950

But I could not find it.

Then I directly changed under the settings menu

Activate developer mode
Settings -> Technical -> Database Structure -> model -> res.partner -> Access rights

Thanks !

อวตาร
ละทิ้ง
ผู้เขียน

Shameem, I found a workaround by using sudo. I can't use the backend because the access has to come with module installed. Thanks :)

<span t-field="event.address_id.sudo().city"/>

<span t-field="event.address_id.sudo().country_id.name"/>

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

Odoo provides 3 kinds/levels of Security access to control the data.

  1. Object Access Control

  2. Record Rules

  3. Field Access

To Control displaying of records/data, you need to use Security Record Rules.

Similarly to control couple of fields on the view, you need to use Groups to define Field Access in the XML Views.


Permissions which are defined in the CSV, will merely act as Object Permission and certainly not on the data/record present in the object.

For more details Refer this Odoo Security

อวตาร
ละทิ้ง
ผู้เขียน

I know these, but for some reason the csv security access not working.

Related Posts ตอบกลับ มุมมอง กิจกรรม
8
เม.ย. 23
18318
5
ก.พ. 24
24099
0
ก.ค. 18
2627
2
ก.ค. 18
3024
2
พ.ย. 17
4513