[patch] Update refdoc in Landed Cost Voucher

This commit is contained in:
Nabin Hait 2016-08-01 15:52:29 +05:30
parent 185110159e
commit 3c364dd5b8
2 changed files with 16 additions and 0 deletions

View File

@ -306,3 +306,4 @@ erpnext.patches.v7_0.calculate_total_costing_amount
erpnext.patches.v7_0.fix_nonwarehouse_ledger_gl_entries_for_transactions
erpnext.patches.v7_0.remove_old_earning_deduction_doctypes
erpnext.patches.v7_0.make_guardian
erpnext.patches.v7_0.update_refdoc_in_landed_cost_voucher

View File

@ -0,0 +1,15 @@
from __future__ import unicode_literals
import frappe
def execute():
if "purchase_receipt" not in frappe.db.get_table_columns("Landed Cost Purchase Receipt"):
return
frappe.reload_doctype("Landed Cost Purchase Receipt")
frappe.db.sql("""
update `tabLanded Cost Purchase Receipt`
set receipt_document_type = 'Purchase Receipt', receipt_document = purchase_receipt
where (receipt_document is null or receipt_document = '')
and (purchase_receipt is not null and purchase_receipt != '')
""")