Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fixes] minor fix for between operator filter #3196

Merged
merged 2 commits into from
May 1, 2017

Conversation

mbauskar
Copy link
Contributor

@mbauskar mbauskar commented Apr 30, 2017

steps to recreate the issue

  1. In filters select the field with fieldtype date or datetime
  2. Select the operator as Between and set the value as Null
Traceback (most recent call last):
  File "/home/frappe/benches/bench-2017-03-30/apps/frappe/frappe/app.py", line 55, in application
    response = frappe.handler.handle()
  File "/home/frappe/benches/bench-2017-03-30/apps/frappe/frappe/handler.py", line 19, in handle
    execute_cmd(cmd)
  File "/home/frappe/benches/bench-2017-03-30/apps/frappe/frappe/handler.py", line 40, in execute_cmd
    ret = frappe.call(method, **frappe.form_dict)
  File "/home/frappe/benches/bench-2017-03-30/apps/frappe/frappe/__init__.py", line 901, in call
    return fn(*args, **newargs)
  File "/home/frappe/benches/bench-2017-03-30/apps/frappe/frappe/desk/reportview.py", line 17, in get
    data = compress(execute(**args), args = args)
  File "/home/frappe/benches/bench-2017-03-30/apps/frappe/frappe/desk/reportview.py", line 22, in execute
    return DatabaseQuery(doctype).execute(*args, **kwargs)
  File "/home/frappe/benches/bench-2017-03-30/apps/frappe/frappe/model/db_query.py", line 80, in execute
    result = self.build_and_run()
  File "/home/frappe/benches/bench-2017-03-30/apps/frappe/frappe/model/db_query.py", line 92, in build_and_run
    args = self.prepare_args()
  File "/home/frappe/benches/bench-2017-03-30/apps/frappe/frappe/model/db_query.py", line 110, in prepare_args
    self.build_conditions()
  File "/home/frappe/benches/bench-2017-03-30/apps/frappe/frappe/model/db_query.py", line 240, in build_conditions
    self.build_filter_conditions(self.filters, self.conditions)
  File "/home/frappe/benches/bench-2017-03-30/apps/frappe/frappe/model/db_query.py", line 258, in build_filter_conditions
    conditions.append(self.prepare_filter_condition(f))
  File "/home/frappe/benches/bench-2017-03-30/apps/frappe/frappe/model/db_query.py", line 299, in prepare_filter_condition
    get_datetime(f.value[0]).strftime("%Y-%m-%d %H:%M:%S.%f"),
TypeError: 'NoneType' object has no attribute '__getitem__'

@rmehta
Copy link
Member

rmehta commented May 1, 2017

can you add a test case?

@rmehta rmehta merged commit 8eeda18 into frappe:develop May 1, 2017
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants