Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
3875 Visualizzazioni

What are the steps to reproduce your issue?
I have two fields pnumber (Char)pdate (Date)
when I'm trying to do like this
<field name="pnumber" attrs="{'required': [('pdate', '=', True)]}"/>
What is the current behavior that you observe?
But it is working if I do like this
<field name="pnumber" attrs="{'required': [('pdate', !'=', False)]}"/>
What would be your expected behavior in this case?
It should working in True value also.. as per my view
<field name="pnumber" attrs="{'required': [('pdate', '=', True)]}"/>

Avatar
Abbandona
Risposta migliore

You cant check datetime object with true if that has a value. but  in python it will accept that != False,


check this code in your python console

import datetime

x = datetime.date(2012, 9, 1)

if x == True:

     print "fail"

elif x != False or x != True:

     print "truee"


so you can check that using this code


isinstance(x, datetime.date)


Thank You

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
0
feb 25
811
2
ott 24
3736
2
giu 24
2490
1
giu 19
6013
0
mar 15
5208