Exemplo n.º 1
0
def make_sales_order():
	q = get_random("Quotation", {"status": "Submitted"})
	if q:
		from erpnext.selling.doctype.quotation.quotation import make_sales_order as mso
		so = frappe.get_doc(mso(q))
		so.transaction_date = frappe.flags.current_date
		so.delivery_date = frappe.utils.add_days(frappe.flags.current_date, 10)
		so.insert()
		frappe.db.commit()
		so.submit()
		frappe.db.commit()
Exemplo n.º 2
0
def make_sales_order():
    q = get_random("Quotation", {"status": "Submitted"})
    if q:
        from erpnext.selling.doctype.quotation.quotation import make_sales_order as mso
        so = frappe.get_doc(mso(q))
        so.transaction_date = frappe.flags.current_date
        so.delivery_date = frappe.utils.add_days(frappe.flags.current_date, 10)
        so.insert()
        frappe.db.commit()
        so.submit()
        frappe.db.commit()
Exemplo n.º 3
0
def make_sales_order():
    q = get_random("Quotation", {"docstatus": 1, "status": "Open"})
    if q:
        from erpnext.selling.doctype.quotation.quotation import make_sales_order as mso
        so = frappe.get_doc(mso(q))
        so.transaction_date = frappe.flags.current_date
        so.delivery_date = frappe.utils.add_days(frappe.flags.current_date, 10)
        so.payment_schedule = []
        so.insert(ignore_permissions=True)
        frappe.db.commit()
        so.submit()
        frappe.db.commit()