Odoo Help


1 Answer
02-05-17 06:23


I suggest you to add one more field which is compute field. and then pass in domain. use custom_funct_date method in that new compute field.

Baintex Technologies S.L.
02-05-17 06:28

Okay, I have tried this too: my_date = fields.Datetime(string="Computed date", compute="custom_funct_date")

But it gives me that error: ValueError: "name 'my_date' is not defined" while evaluating u"[('date_order','>=', my_date)]"

02-05-17 06:30

it's wrong syntax.

try this one.

"[('date_order','>=', 'my_date')]"

02-05-17 06:31

also add my_date on view file and set invisible = 1

Baintex Technologies S.L.
02-05-17 06:49

DataError: invalid input syntax for type timestamp: "my_date"

LÍNEA 1: ...ids"."res_id") AND (("sale_order"."date_order" >= 'my_date...

02-05-17 06:58

did you add field in form view?

Baintex Technologies S.L.
02-05-17 07:06

I think so. In my custom view, the field appears (if I quit the part of invisible).

02-05-17 07:09

make sure your compute function return proper date format like sale_order.date_order,

try also without ('date_order','>=', my_date)

02-05-17 07:13

*with ('date_order','>=', my_date)

Baintex Technologies S.L.
02-05-17 12:17

Checked and same result :(

Baintex Technologies S.L.
03-05-17 10:32

I think that if I put this:

('date_order','>=', my_date)

my_date is treated as a variable, and that variable doesn't exist.

If I put:

('date_order','>=', 'my_date')

'my_date' is treated as a string, and gives an error, because a string doen't have a datetime type

Avantgarde BCS, salah BELHAMICHE
17-04-18 05:20

Any solution For this problem ? i have the same use case.

Stel een vraag
Keep Informed
2 volger(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now