fix: handle virtual doctype flag for existing doctypes

This commit is contained in:
Shridhar 2020-12-23 20:38:06 +05:30 committed by Chinmay D. Pai
parent 092d32be33
commit 42d889d2a4
No known key found for this signature in database
GPG key ID: 75507BE256F40CED
2 changed files with 3 additions and 3 deletions

View file

@ -30,9 +30,9 @@ class DBTable:
self.get_columns_from_docfields()
def sync(self):
if self.is_new() and not self.meta.virtual_doctype:
if self.is_new() and not self.meta.get('virtual_doctype'):
self.create()
elif not self.meta.virtual_doctype:
elif not self.meta.get('virtual_doctype'):
frappe.cache().hdel('table_columns', self.table_name)
self.alter()

View file

@ -687,7 +687,7 @@ class Document(BaseDocument):
`self.check_docstatus_transition`."""
conflict = False
self._action = "save"
if not self.get('__islocal') and not self.meta.virtual_doctype:
if not self.get('__islocal') and not self.meta.get('virtual_doctype'):
if self.meta.issingle:
modified = frappe.db.sql("""select value from tabSingles
where doctype=%s and field='modified' for update""", self.doctype)