콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
7722 화면
<group>
                            <field name="id" invisible="1"/>
                            <field name="q_versions" widget="selection" on_change="onchange_version(id)" domain="[('sale_id', '=', id)]"/>
                            </group>
                        <group>
                            <button name="add_version" string="add version" type="object" class="oe_edit_only" />

there is a error, that id is not defined. how can i use dynamic domain

아바타
취소

I am also facing the same problem...

Note: we can define domain="[('sale_id', '=', id)]" only in py file

when widget="selection" is used in xml, the domain provided in python file gets overridden

베스트 답변

You can follow this: https://youtu.be/XGqXEL2qQmE 

Hope it helps, Thanks

아바타
취소
베스트 답변

You cannot use field id because id field is automatically generated by orm of OpenERP.

You can use active_id or active_ids which indicates your current active records.

Try this:

domain="[('sale_id', '=', active_id)]"
아바타
취소
작성자

active_id alse show 'active_id' not defined
there is no active_id in my context

관련 게시물 답글 화면 활동
2
5월 24
9096
1
1월 22
11892
1
7월 20
15967
6
1월 24
16186
naked domain set up 해결 완료
3
7월 25
3926