跳至內容
選單
此問題已被標幟
1 回覆
4543 瀏覽次數

If you want to prevent users from creating new records from a relational field

頭像
捨棄

You can do it dynamically based on each model and its fields (relational fields) in v16 and v17: https://apps.odoo.com/apps/modules/17.0/mh_dynamic_many2one_field_options

作者 最佳答案

If you want to prevent users from creating new records from a relational field (just like the country_id field on the res.partner model), just add this in the xml view: options="{"no_open": True, "no_create": True}".

For example:

.

will prevent users from creating new roles from the x_role_id field.

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
1月 25
10065
1
5月 21
2316
1
4月 21
8426
2
1月 25
6025
4
12月 24
16564