Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
4388 มุมมอง

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.


อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

try this 

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

อวตาร
ละทิ้ง
ผู้เขียน

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 ตอบกลับ มุมมอง กิจกรรม
2
ม.ค. 24
2700
3
พ.ค. 24
3863
2
ก.ค. 25
4915
2
ธ.ค. 24
7955
How to ORDER BY? [Odoo 10] แก้ไขแล้ว
2
พ.ย. 24
28773