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

Is it possible to dynamically create selection type field using functional fields? 

For Example : I am having a maximum limit of leaves a person can take at one type

Casual Leave : 2

Sick Leave : 3

User can take these leave with 0.5 interval, means for CL 0.5,1,1.5 and 2

I am having around 10 types of leaves.

So is it possiblt to create a selection type field dynamically in OpenERP?

아바타
취소
베스트 답변

You can use many2one with domain for this purpose.

You need create object "Leave" like:


    _columns = {
        'name': fields.char('Leave'),
        'type': fields.char('Type'),
        'interval': fields.char('interval'),
        }

Then create records for "Leave" with all available combination type and interval.

In object, where you need selection field, define instead many2one to "Leave" object (for example: leave_id).
And define selection filed for type (for example: type).
Now you can dinamically select available leaves, depend from type, like:

    <field name="type"/>
    <field name="leave_id" domain="[('type','=',type)]"/>

아바타
취소

Hi Vasilliy ....Can u explain with an example

작성자

Vasiliy, Thanks for your answer. It will be great if you can give me an example!!

베스트 답변

Hi, 

You can follow following link for this:

https://youtu.be/GPhgxxwprA4

Hope it helps,

Thanks

아바타
취소
관련 게시물 답글 화면 활동
2
3월 23
46600
2
12월 23
57560
0
3월 22
2268
3
6월 20
10526
1
10월 19
4356