# Copyright (c) 2022, SolutionERP LLC and contributors
# For license information, please see license.txt

import xhiveframework


def execute():
	for doctype in ["Purchase Order", "Purchase Receipt", "Purchase Invoice"]:
		tab = xhiveframework.qb.DocType(doctype).as_("tab")
		xhiveframework.qb.update(tab).set(tab.is_old_subcontracting_flow, 1).where(
			tab.is_subcontracted == 1
		).run()
