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

I HAVE AN INHERITED VIEW OF SALE.VIEW_ORDER_FORM

I AM TRYING TO CHANGE THE DOMAIN OF PARTNER_ID IN THIS NEW INHERITED FORM.

BUT IT DOESN´T TAKE ANY CHANGE WHEN RELOAD THE FORM... I MEAN, THE NEW FIELD ( VEHICLE_ID ) IS THERE, BUT THE DOMAIN OF PARNER_ID DOESN´T CHANGE. IT TAKES THE ORIGINAL FROM THE SALE.VIEW_ORDER_FORM

<record id="saymeh_view_order_form" model="ir.ui.view">
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="model">sale.order</field>
<field name="arch" type="xml">
<field name="partner_id" domain="[('customer','=',1), ('parent_id', '=', False)]" position="after">
<field name="vehicle_id" />
</field>
</field>
</record>
아바타
취소

Please follow netiquette and do not use all caps.

베스트 답변

Hi,

Try this,

<record id="saymeh_view_order_form" model="ir.ui.view">
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="model">sale.order</field>
<field name="arch" type="xml">
<field name="partner_id" position="replace">
<field name="partner_id" domain="[('customer','=',1), ('parent_id', '=', False)]"/> #here change the domain as per need
<field name="vehicle_id" />
</field>
</field>
</record>

Thanks

아바타
취소
베스트 답변

Hi Wayo,

Your code:

* See Bold Font at last word : position="after" it is wrong that used in xpath not domain.

<record id="saymeh_view_order_form" model="ir.ui.view">
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="model">sale.order</field>
<field name="arch" type="xml">
<field name="partner_id" domain="[('customer','=',1), ('parent_id', '=', False)]" position="after">
<field name="vehicle_id" />
</field>
</field>
</record>

Solution:
    * Syntax for domain : domain="[('FIELD NAME'),'OPERATOR',VALUES]"
    * you can set domain as per your need that used to filtering record values.
Like:
    <field name="partner_id" domain="[('customer','=',1), ('parent_id', '=', False)]"/>

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

Thanks a lot buddy. It woks perfect. 

Blessings

아바타
취소
관련 게시물 답글 화면 활동
1
1월 20
4383
naked domain set up 해결 완료
3
7월 25
4470
0
5월 25
950
5
8월 24
46979
2
3월 24
2189