patch: Set against_blanket_order value in existing SO/PO (#19810)

* patch: Set against_blanket_order value in existing SO/PO

* Update set_against_blanket_order_in_sales_and_purchase_order.py
This commit is contained in:
Nabin Hait 2019-12-09 18:27:50 +05:30 committed by GitHub
parent 9e0b3b29fa
commit da4847e46d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 1 deletions

View File

@ -647,4 +647,5 @@ erpnext.patches.v12_0.update_owner_fields_in_acc_dimension_custom_fields
erpnext.patches.v12_0.set_default_for_add_taxes_from_item_tax_template
erpnext.patches.v12_0.remove_denied_leaves_from_leave_ledger
erpnext.patches.v12_0.update_price_or_product_discount
erpnext.patches.v12_0.set_production_capacity_in_workstation
erpnext.patches.v12_0.set_production_capacity_in_workstation
erpnext.patches.v12_0.set_against_blanket_order_in_sales_and_purchase_order

View File

@ -0,0 +1,9 @@
import frappe
def execute():
for doctype in ['Sales Order Item', 'Purchase Order Item']:
frappe.reload_doctype(doctype)
frappe.db.sql("""
UPDATE `tab{0}`
SET against_blanket_order = 1
WHERE ifnull(blanket_order, '') != ''
""".format(doctype))