So, I have this function:
def activities_log(_type=None, item_searched=None, product_seen=None, product_from=None, search_from=None):
doc = {
'doctype': 'Store Logs and Activities',
'user': 'dsds'
}
logs = frappe.get_doc(doc)
logs.insert(ignore_permissions=True)
return '1'
I want this function to insert a new record on doctype every time a page loads. I am implementing like this:
def get_context(context):
context.ttt = activities_log(_type='Home Page')
It returns 1
but does not insert new data on doctype.