Esempio n. 1
0
def assign_task_to_owner(inv, msg, users):
	for d in users:
		from webnotes.widgets.form import assign_to
		args = {
			'assign_to' 	:	d,
			'doctype'		:	'Sales Invoice',
			'name'			:	inv,
			'description'	:	msg,
			'priority'		:	'Urgent'
		}
		assign_to.add(args)
def execute():
	from webnotes.widgets.form.assign_to import add
	for t in webnotes.conn.sql("""select * from tabTask 
		where ifnull(allocated_to, '')!=''""", as_dict=1):
		add({
			'doctype': "Task",
			'name': t['name'],
			'assign_to': t['allocated_to'],
			'assigned_by': t['owner'],
			'description': t['subject'],
			'date': t['creation']
		})
def execute():
    from webnotes.widgets.form.assign_to import add
    for t in webnotes.conn.sql("""select * from tabTask 
		where ifnull(allocated_to, '')!=''""",
                               as_dict=1):
        add({
            'doctype': "Task",
            'name': t['name'],
            'assign_to': t['allocated_to'],
            'assigned_by': t['owner'],
            'description': t['subject'],
            'date': t['creation']
        })
def execute():
	from webnotes.widgets.form.assign_to import add
	for t in webnotes.conn.sql("""select * from tabQuotation 
		where ifnull(contact_by, '')!=''""", as_dict=1):
		add({
			'doctype': "Quotation",
			'name': t['name'],
			'assign_to': t['contact_by'],
			'assigned_by': t['owner'],
			'description': "Contact regarding quotation.",
			'date': t['creation'],
			"no_notification": True
		})
Esempio n. 5
0
def assign_task_to_owner(inv, msg, users):
	for d in users:
		if d.lower() == 'administrator':
			d = webnotes.conn.sql("select ifnull(email_id, '') \
				from `tabProfile` where name = 'Administrator'")[0][0]
		from webnotes.widgets.form import assign_to
		args = {
			'assign_to' 	:	d,
			'doctype'		:	'Sales Invoice',
			'name'			:	inv,
			'description'	:	msg,
			'priority'		:	'Urgent'
		}
		assign_to.add(args)
Esempio n. 6
0
def assign_task_to_owner(inv, msg, users):
    for d in users:
        if d.lower() == 'administrator':
            d = webnotes.conn.sql("select ifnull(email_id, '') \
				from `tabProfile` where name = 'Administrator'")[0][0]
        from webnotes.widgets.form import assign_to
        args = {
            'assign_to': d,
            'doctype': 'Sales Invoice',
            'name': inv,
            'description': msg,
            'priority': 'Urgent'
        }
        assign_to.add(args)
def execute():
    from webnotes.widgets.form.assign_to import add
    for t in webnotes.conn.sql("""select * from tabQuotation 
		where ifnull(contact_by, '')!=''""",
                               as_dict=1):
        add({
            'doctype': "Quotation",
            'name': t['name'],
            'assign_to': t['contact_by'],
            'assigned_by': t['owner'],
            'description': "Contact regarding quotation.",
            'date': t['creation'],
            "no_notification": True
        })
Esempio n. 8
0
def execute():
	from webnotes.widgets.form.assign_to import add
	# clear old customer issue todos
	webnotes.conn.sql("""delete from tabToDo where reference_type='Customer Issue'""")
	webnotes.conn.sql("""delete from tabComment where comment like '%Form/Customer Issue%'""")
	for t in webnotes.conn.sql("""select * from `tabCustomer Issue` 
		where ifnull(allocated_to, '')!='' and ifnull(status, "")="Open" """, as_dict=1):
		add({
			'doctype': "Customer Issue",
			'name': t['name'],
			'assign_to': t['allocated_to'],
			'assigned_by': t['owner'],
			'description': t['complaint'],
			'date': t['creation'],
			'no_notification': True
		})
Esempio n. 9
0
def assign_task_to_owner(inv, msg, users):
    for d in users:
        from webnotes.widgets.form import assign_to

        args = {"assign_to": d, "doctype": "Sales Invoice", "name": inv, "description": msg, "priority": "Urgent"}
        assign_to.add(args)