Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
4 Odpovědi
26430 Zobrazení

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?

Avatar
Zrušit
Nejlepší odpověď

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

Avatar
Zrušit
Autor Nejlepší odpověď

Hi Krupesh, 

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

Tried both ways. Any other alternative for this? 

Avatar
Zrušit
Nejlepší odpověď

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)]">


Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
lis 24
20082
1
zář 23
2940
3
kvě 23
5537
7
dub 23
48881
1
pro 22
7763