mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-03 20:29:09 +00:00
[patches] [fix] replace sync with reload_doc in old patches
This commit is contained in:
@@ -31,5 +31,4 @@ def execute():
|
|||||||
webnotes.conn.commit()
|
webnotes.conn.commit()
|
||||||
webnotes.conn.begin()
|
webnotes.conn.begin()
|
||||||
|
|
||||||
import webnotes.model.sync
|
webnotes.reload_doc('core', 'doctype', 'profile')
|
||||||
webnotes.model.sync.sync('core', 'profile')
|
|
||||||
@@ -6,7 +6,6 @@ def execute():
|
|||||||
where parent in ('Address', 'Contact')""")
|
where parent in ('Address', 'Contact')""")
|
||||||
webnotes.conn.commit()
|
webnotes.conn.commit()
|
||||||
|
|
||||||
import webnotes.model.sync
|
webnotes.reload_doc('utilities', 'doctype', 'address')
|
||||||
webnotes.model.sync.sync('utilities', 'address')
|
webnotes.reload_doc('utilities', 'doctype', 'contact')
|
||||||
webnotes.model.sync.sync('utilities', 'contact')
|
|
||||||
webnotes.conn.begin()
|
webnotes.conn.begin()
|
||||||
@@ -6,7 +6,6 @@ def execute():
|
|||||||
|
|
||||||
webnotes.conn.commit()
|
webnotes.conn.commit()
|
||||||
|
|
||||||
import webnotes.model.sync
|
webnotes.reload_doc('website', 'doctype', 'blog')
|
||||||
webnotes.model.sync.sync('website', 'blog', 1)
|
|
||||||
|
|
||||||
webnotes.conn.begin()
|
webnotes.conn.begin()
|
||||||
|
|||||||
@@ -12,8 +12,7 @@ def execute():
|
|||||||
and ifnull(t1.project_name, '') = ''""")
|
and ifnull(t1.project_name, '') = ''""")
|
||||||
|
|
||||||
webnotes.conn.commit()
|
webnotes.conn.commit()
|
||||||
from webnotes.model.sync import sync
|
webnotes.reload_doc("buying", "doctype", "purchase_order")
|
||||||
sync("buying", "purchase_order")
|
webnotes.reload_doc("buying", "doctype", "purchase_request")
|
||||||
sync("buying", "purchase_request")
|
webnotes.reload_doc("accounts", "doctype", "purchase_invoice")
|
||||||
sync("accounts", "purchase_invoice")
|
|
||||||
webnotes.conn.begin()
|
webnotes.conn.begin()
|
||||||
@@ -1,13 +1,12 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
def execute():
|
def execute():
|
||||||
"""sync supplier quotatoin and create supplier quotation mappers"""
|
"""sync supplier quotatoin and create supplier quotation mappers"""
|
||||||
from webnotes.model.sync import sync
|
webnotes.reload_doc('buying', 'doctype', 'supplier_quotation')
|
||||||
sync('buying', 'supplier_quotation')
|
webnotes.reload_doc('buying', 'doctype', 'supplier_quotation_item')
|
||||||
sync('buying', 'supplier_quotation_item')
|
webnotes.reload_doc('buying', 'doctype', 'purchase_request')
|
||||||
sync('buying', 'purchase_request')
|
webnotes.reload_doc('buying', 'doctype', 'purchase_request_item')
|
||||||
sync('buying', 'purchase_request_item')
|
webnotes.reload_doc('buying', 'doctype', 'purchase_order')
|
||||||
sync('buying', 'purchase_order')
|
webnotes.reload_doc('buying', 'doctype', 'purchase_order_item')
|
||||||
sync('buying', 'purchase_order_item')
|
|
||||||
|
|
||||||
from webnotes.modules import reload_doc
|
from webnotes.modules import reload_doc
|
||||||
reload_doc('buying', 'DocType Mapper', 'Material Request-Supplier Quotation')
|
reload_doc('buying', 'DocType Mapper', 'Material Request-Supplier Quotation')
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
def execute():
|
def execute():
|
||||||
import webnotes
|
import webnotes
|
||||||
import webnotes.model.sync
|
|
||||||
|
|
||||||
# sync doctypes required for the patch
|
# sync doctypes required for the patch
|
||||||
webnotes.model.sync.sync('website', 'web_cache')
|
webnotes.reload_doc('website', 'doctype', 'web_cache')
|
||||||
webnotes.model.sync.sync('website', 'web_page')
|
webnotes.reload_doc('website', 'doctype', 'web_page')
|
||||||
webnotes.model.sync.sync('website', 'blog')
|
webnotes.reload_doc('website', 'doctype', 'blog')
|
||||||
webnotes.model.sync.sync('website', 'website_settings')
|
webnotes.reload_doc('website', 'doctype', 'website_settings')
|
||||||
webnotes.model.sync.sync('stock', 'item')
|
webnotes.reload_doc('stock', 'doctype', 'item')
|
||||||
|
|
||||||
cleanup()
|
cleanup()
|
||||||
|
|
||||||
|
|||||||
@@ -2,11 +2,9 @@ from __future__ import unicode_literals
|
|||||||
def execute():
|
def execute():
|
||||||
import webnotes
|
import webnotes
|
||||||
|
|
||||||
# perform sync
|
webnotes.reload_doc('buying', 'doctype', 'purchase_order_item')
|
||||||
import webnotes.model.sync
|
webnotes.reload_doc('accounts', 'doctype', 'purchase_invoice_item')
|
||||||
webnotes.model.sync.sync('buying', 'purchase_order_item')
|
webnotes.reload_doc('stock', 'doctype', 'purchase_receipt_item')
|
||||||
webnotes.model.sync.sync('accounts', 'purchase_invoice_item')
|
|
||||||
webnotes.model.sync.sync('stock', 'purchase_receipt_item')
|
|
||||||
|
|
||||||
webnotes.conn.sql("update `tabPurchase Invoice Item` t1, `tabPurchase Order Item` t2 set t1.uom = t2.uom where ifnull(t1.po_detail, '') != '' and t1.po_detail = t2.name")
|
webnotes.conn.sql("update `tabPurchase Invoice Item` t1, `tabPurchase Order Item` t2 set t1.uom = t2.uom where ifnull(t1.po_detail, '') != '' and t1.po_detail = t2.name")
|
||||||
webnotes.conn.sql("update `tabPurchase Invoice Item` t1, `tabPurchase Receipt Item` t2 set t1.uom = t2.uom where ifnull(t1.pr_detail, '') != '' and t1.pr_detail = t2.name")
|
webnotes.conn.sql("update `tabPurchase Invoice Item` t1, `tabPurchase Receipt Item` t2 set t1.uom = t2.uom where ifnull(t1.pr_detail, '') != '' and t1.pr_detail = t2.name")
|
||||||
@@ -8,8 +8,7 @@ def execute():
|
|||||||
|
|
||||||
webnotes.conn.commit()
|
webnotes.conn.commit()
|
||||||
|
|
||||||
import webnotes.model.sync
|
webnotes.reload_doc('core', 'doctype', 'search_criteria')
|
||||||
webnotes.model.sync.sync('core', 'search_criteria')
|
webnotes.reload_doc('core', 'doctype', 'report')
|
||||||
webnotes.model.sync.sync('core', 'report')
|
|
||||||
|
|
||||||
webnotes.conn.begin()
|
webnotes.conn.begin()
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
def execute():
|
def execute():
|
||||||
import webnotes
|
import webnotes
|
||||||
from webnotes.model.sync import sync
|
webnotes.reload_doc('accounts', 'doctype', 'sales_invoice')
|
||||||
sync('accounts', 'sales_invoice')
|
|
||||||
|
|
||||||
webnotes.conn.sql("update `tabSales Invoice` set recurring_type = 'Monthly' where ifnull(convert_into_recurring_invoice, 0) = 1")
|
webnotes.conn.sql("update `tabSales Invoice` set recurring_type = 'Monthly' where ifnull(convert_into_recurring_invoice, 0) = 1")
|
||||||
@@ -4,9 +4,8 @@ def execute():
|
|||||||
import webnotes
|
import webnotes
|
||||||
import webnotes.utils
|
import webnotes.utils
|
||||||
|
|
||||||
import webnotes.model.sync
|
|
||||||
webnotes.conn.commit()
|
webnotes.conn.commit()
|
||||||
webnotes.model.sync.sync('setup', 'email_settings')
|
webnotes.reload_doc('setup', 'doctype', 'email_settings')
|
||||||
webnotes.conn.begin()
|
webnotes.conn.begin()
|
||||||
|
|
||||||
sync_support_mails = webnotes.utils.cint(webnotes.conn.get_value('Email Settings',
|
sync_support_mails = webnotes.utils.cint(webnotes.conn.get_value('Email Settings',
|
||||||
|
|||||||
@@ -12,8 +12,7 @@ def execute():
|
|||||||
clean_docfield_properties()
|
clean_docfield_properties()
|
||||||
|
|
||||||
def change_property_setter_fieldnames():
|
def change_property_setter_fieldnames():
|
||||||
import webnotes.model.sync
|
webnotes.reload_doc('core', 'doctype', 'property_setter')
|
||||||
webnotes.model.sync.sync('core', 'property_setter')
|
|
||||||
docfield_list = webnotes.conn.sql("""\
|
docfield_list = webnotes.conn.sql("""\
|
||||||
SELECT name, fieldname FROM `tabDocField`""", as_list=1)
|
SELECT name, fieldname FROM `tabDocField`""", as_list=1)
|
||||||
custom_field_list = webnotes.conn.sql("""\
|
custom_field_list = webnotes.conn.sql("""\
|
||||||
|
|||||||
@@ -94,8 +94,7 @@ from webnotes.model.code import get_obj
|
|||||||
from webnotes.model.doc import Document
|
from webnotes.model.doc import Document
|
||||||
|
|
||||||
def execute():
|
def execute():
|
||||||
import webnotes.model.sync
|
webnotes.reload_doc('core', 'doctype', 'custom_field')
|
||||||
webnotes.model.sync.sync('core', 'custom_field')
|
|
||||||
for f in field_list:
|
for f in field_list:
|
||||||
res = webnotes.conn.sql("""SELECT name FROM `tabCustom Field`
|
res = webnotes.conn.sql("""SELECT name FROM `tabCustom Field`
|
||||||
WHERE dt=%s AND fieldname=%s""", (f[0], f[1]))
|
WHERE dt=%s AND fieldname=%s""", (f[0], f[1]))
|
||||||
|
|||||||
@@ -25,5 +25,4 @@ def execute():
|
|||||||
|
|
||||||
webnotes.conn.commit()
|
webnotes.conn.commit()
|
||||||
webnotes.conn.begin()
|
webnotes.conn.begin()
|
||||||
import webnotes.model.sync
|
webnotes.reload_doc('setup', 'doctype', 'notification_control')
|
||||||
webnotes.model.sync.sync('setup', 'notification_control')
|
|
||||||
@@ -27,5 +27,4 @@ def execute():
|
|||||||
doc.save()
|
doc.save()
|
||||||
webnotes.conn.commit()
|
webnotes.conn.commit()
|
||||||
webnotes.conn.begin()
|
webnotes.conn.begin()
|
||||||
import webnotes.model.sync
|
webnotes.reload_doc('core', 'doctype', 'custom_script')
|
||||||
webnotes.model.sync.sync('core', 'custom_script')
|
|
||||||
@@ -19,5 +19,4 @@ def execute():
|
|||||||
doc.save()
|
doc.save()
|
||||||
webnotes.conn.commit()
|
webnotes.conn.commit()
|
||||||
webnotes.conn.begin()
|
webnotes.conn.begin()
|
||||||
import webnotes.model.sync
|
webnotes.reload_doc('core', 'doctype', 'profile')
|
||||||
webnotes.model.sync.sync('core', 'profile')
|
|
||||||
@@ -1,8 +1,7 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
def execute():
|
def execute():
|
||||||
import webnotes
|
import webnotes
|
||||||
import webnotes.model.sync
|
webnotes.reload_doc('support', 'doctype', 'communication')
|
||||||
webnotes.model.sync.sync('support', 'communication')
|
|
||||||
webnotes.conn.commit()
|
webnotes.conn.commit()
|
||||||
webnotes.conn.begin()
|
webnotes.conn.begin()
|
||||||
|
|
||||||
|
|||||||
@@ -27,5 +27,4 @@ def execute():
|
|||||||
doc.save()
|
doc.save()
|
||||||
webnotes.conn.commit()
|
webnotes.conn.commit()
|
||||||
webnotes.conn.begin()
|
webnotes.conn.begin()
|
||||||
import webnotes.model.sync
|
webnotes.reload_doc('core', 'doctype', 'print_format')
|
||||||
webnotes.model.sync.sync('core', 'print_format')
|
|
||||||
Reference in New Issue
Block a user