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

I have extended the res.partner model and added a custom field to it (say "redeemable_points").

Now, I have created a page(tab "Redeemed-Sale Orders") in res.partner view which shows only sales orders with redeemable_points > 0 in it.

My query is, how can I set a domain for a XML field to select sales orders with redeemable_points is not equal to 0?


Below is my xml view :

<page string="Redeemed-Sales Orders" col="4" name="Redeemed Sales Orders">

      <field name="sale_order_ids" domain="[('redeemable_points', '!=', 0)]"> <!-- This domain is not working -->  

             <tree decoration-info="state == 'draft'"  string="Redeem  Logs">

                  <field name="partner_id" groups="base.group_user"  string="Customer" />

                  <field name="name"/>

                  <field name="user_id"/>

                  <field name="invoice_status"/>

                   <field name="redeemable_points" string="Total Redeem Points" sum="Total Reward Points"/>

              </tree>

        </field>

  </page>


can anyone please help me on this?

아바타
취소
베스트 답변

first you have to make the redeemable field to store state, else the field will kept empty on db.

<field name="redeemable_points" string="Total Redeem Points" sum="Total Reward Points" store="1"/>
then try the domain

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

Hi Krupesh, 

Thanks for your reply, but still it is not working. 

Tried both ways. Any other alternative for this? 

아바타
취소
베스트 답변

try this 
<field name="sale_order_ids" domain="[('redeemable_points', '!=', False)]"> 

or you can new field in sale order is_redeemable when redeemable case in sale order it will tick.

and you can apply new domain for that

<field name="sale_order_ids" domain="[('is_reddemable', '=', True)]">


아바타
취소
관련 게시물 답글 화면 활동
1
11월 24
19899
1
9월 23
2768
3
5월 23
5419
7
4월 23
48696
1
12월 22
7593