Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
1 Răspunde
4265 Vizualizări

I'm trying to create a filter for search view and I'm getting an error:

Traceback (most recent call last):
  File "/opt/odoo/odoo10/odoo/http.py", line 642, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/opt/odoo/odoo10/odoo/http.py", line 684, in dispatch
    result = self._call_function(**self.params)
  File "/opt/odoo/odoo10/odoo/http.py", line 334, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/odoo/odoo10/odoo/service/model.py", line 101, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/odoo/odoo10/odoo/http.py", line 327, in checked_call
    result = self.endpoint(*a, **kw)
  File "/opt/odoo/odoo10/odoo/http.py", line 942, in __call__
    return self.method(*args, **kw)
  File "/opt/odoo/odoo10/odoo/http.py", line 507, in response_wrap
    response = f(*args, **kw)
  File "/opt/odoo/odoo10/addons/web/controllers/main.py", line 837, in search_read
    return self.do_search_read(model, fields, offset, limit, domain, sort)
  File "/opt/odoo/odoo10/addons/web/controllers/main.py", line 859, in do_search_read
    offset=offset or 0, limit=limit or False, order=sort or False)
  File "/opt/odoo/odoo10/odoo/models.py", line 4704, in search_read
    records = self.search(domain or [], offset=offset, limit=limit, order=order)
  File "/opt/odoo/odoo10/odoo/models.py", line 1516, in search
    res = self._search(args, offset=offset, limit=limit, order=order, count=count)
  File "/opt/odoo/odoo10/odoo/models.py", line 4246, in _search
    query = self._where_calc(args)
  File "/opt/odoo/odoo10/odoo/models.py", line 4040, in _where_calc
    e = expression.expression(domain, self)
  File "/opt/odoo/odoo10/odoo/osv/expression.py", line 640, in __init__
    self.expression = distribute_not(normalize_domain(domain))
  File "/opt/odoo/odoo10/odoo/osv/expression.py", line 289, in distribute_not
    elif token in DOMAIN_OPERATORS_NEGATION:
TypeError: unhashable type: 'list'

The filter is simple but it does not work

[('task_start','>=', '2021-02-01'),('task_start','<=', '2021-02-09')]

I've also tried with the following

[('task_start','&gt;=', '2021-02-01'),('task_start','&lt;=', '2021-02-09')]

and

[['task_start','>=', '2021-02-01'],['task_start','<=', '2021-02-09']]

Iget the same error every time.


Imagine profil
Abandonează
Cel mai bun răspuns

try this 

[('task_start', '&gt;=', datetime.datetime.now().strftime('2021-02-01')),('task_start', '&lt;=', datetime.datetime.now().strftime('2021-02-09'))]"

Imagine profil
Abandonează
Autor

It does not work... same error. I've tried with datetime first and then I tried the simple version and it doesn't work. Only a single condition works.

Related Posts Răspunsuri Vizualizări Activitate
2
ian. 24
2595
3
mai 24
3772
2
iul. 25
4674
2
dec. 24
7801
2
nov. 24
28585