콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
3 답글
2178 화면

Good evening everyone,

I am a developer and new to Odoo 17. For a while now, I have been looking for a way to disable the 'Create' and 'Edit' suggestions that appear when searching for a specific value in a Many2One field.

I found a solution that allows this for a specific model, which is:


{'no_create': True}

This response does not work for me because it does not apply to all models. If you have a link to an article, forum, etc.

Any response is welcome.

 

아바타
취소
베스트 답변

In your case modify this line of odoo source code, i guess you know what to be modified

https://github.com/odoo/odoo/blob/17.0/addons/web/static/src/views/fields/many2one/many2one_field.js#L368

아바타
취소
베스트 답변

Hi,
You can use the web_m2x_options module by OCA, the v17 is not merged yet, once merged it will be available in:  https://github.com/OCA/web/tree/17.0

For now, you can download it from here:   https://github.com/DynAppsNV/web/tree/17.0-mig-web_m2x_options/web_m2x_options


Thanks

아바타
취소
작성자 베스트 답변

Hello, thank you very much for your response.

By modifying the following line to true, I get the behavior I want:

// Before
const canCreate = options.no_create ? false : hasCreatePermission;
// After
const canCreate = true ? false : hasCreatePermission;

Please refer to the GitHub link provided by @Duong Nguyen

How can I modify this value from another plugin?

아바타
취소
관련 게시물 답글 화면 활동
4
10월 24
1718
1
7월 24
764
1
6월 17
4771
0
6월 24
70
1
3월 22
9237