Aug 14, 2019

SOLVED odoo 11 Domains no longer working with dynamic dates

regarding to :
https://github.com/odoo/odoo/issues/22956

on V10, we can use :

[["create_date","<",time.strftime('%Y-%m-%d')]]  


this is a simple solution,

update base_automation set filter_pre_domain='[["write_date","<=", datetime.datetime.now().replace(microsecond=0).replace(hour=0).replace(minute=0).replace(second=0).isoformat(" ").partition("+")[0]  ]]', filter_domain='[["write_date","<=", datetime.datetime.now().replace(microsecond=0).replace(hour=0).replace(minute=0).replace(second=0).isoformat(" ").partition("+")[0]  ]]' where id=5;

main idea is change "%" notation from strftime to native, make it pass the "eval" to be compiled.




.
regarding to :
https://github.com/odoo/odoo/issues/22956

on V10, we can use :

[["create_date","<",time.strftime('%Y-%m-%d')]]  


this is a simple solution,

update base_automation set filter_pre_domain='[["write_date","<=", datetime.datetime.now().replace(microsecond=0).replace(hour=0).replace(minute=0).replace(second=0).isoformat(" ").partition("+")[0]  ]]', filter_domain='[["write_date","<=", datetime.datetime.now().replace(microsecond=0).replace(hour=0).replace(minute=0).replace(second=0).isoformat(" ").partition("+")[0]  ]]' where id=5;

main idea is change "%" notation from strftime to native, make it pass the "eval" to be compiled.



No comments:

Post a Comment