[fix] added ignore_in_install flag to accommodate Gcal custom field (#5455)

This commit is contained in:
Saurabh 2018-04-18 12:39:56 +05:30 committed by Faris Ansari
parent 14c621fca2
commit 3d7e56d1ef
3 changed files with 5 additions and 1 deletions

View file

@ -30,6 +30,7 @@ class DataMigrationPlan(Document):
create_init_py(get_module_path(self.module), dt, dn)
def make_custom_fields_for_mappings(self):
frappe.flags.ignore_in_install = True
label = self.name + ' ID'
fieldname = frappe.scrub(label)
@ -51,6 +52,7 @@ class DataMigrationPlan(Document):
# Create custom field in Deleted Document
create_custom_field('Deleted Document', df)
frappe.flags.ignore_in_install = False
def pre_process_doc(self, mapping_name, doc):
module = self.get_mapping_module(mapping_name)

View file

@ -108,6 +108,8 @@ def get_root_connection(root_login='root', root_password=None):
def install_app(name, verbose=False, set_as_patched=True):
frappe.flags.in_install = name
frappe.flags.ignore_in_install = False
frappe.clear_cache()
app_hooks = frappe.get_hooks(app_name=name)
installed_apps = frappe.get_installed_apps()

View file

@ -230,7 +230,7 @@ class DbTable:
'fieldtype': 'Text'
})
if not frappe.flags.in_install_db and frappe.flags.in_install != "frappe":
if not frappe.flags.in_install_db and (frappe.flags.in_install != "frappe" or frappe.flags.ignore_in_install):
custom_fl = frappe.db.sql("""\
SELECT * FROM `tabCustom Field`
WHERE dt = %s AND docstatus < 2""", (self.doctype,), as_dict=1)