Scheduler call function

Hi,
first, thanks to all for this amazing framework. i really enjoy it.
am working with automatic jobs.
When i declare inside of hooks.py in the scheduler section, The scheduler work fine, it means, the call happen.
But, when use functions in my file tasks.py like lista_l = frappe.get_all(“Lectura Modbus”,fields=[“name”]) i got errors:

ProgrammingError: (1146, “Table ‘be9b563f69ab1aa8.tabLectura Modbus’ doesn’t exist”)

but if, i get the data using lista_l = frappe.db.sql(""" select name from tabLectura ModBus;""", as_list=1 ), work fine.

if we use the scheduler for call a function, how setup the environment for use functions like frappe.get[doc,all] instead frappe.sql.db?.
because i need insert a new doctype, and its not elegant do with SQL. I think.

any orientation will be apreciated.

sorry for my bad english.

I can see you used Modbus in get_all, instead of ModBus. Please check if that is the issue.

yes, sir, my mistake.
Thanks.

1 Like