Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
4 Risposte
26447 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Autore Risposta migliore

Hi Krupesh, 

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

Tried both ways. Any other alternative for this? 

Avatar
Abbandona
Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
nov 24
20088
1
set 23
2947
3
mag 23
5544
7
apr 23
48890
1
dic 22
7769