Browse Source

trim tables for a doctype

version-14
Nabin Hait 8 years ago
parent
commit
0398e2d397
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      frappe/model/meta.py

+ 5
- 1
frappe/model/meta.py View File

@@ -465,9 +465,13 @@ def get_default_df(fieldname):
fieldtype = "Data"
)

def trim_tables():
def trim_tables(doctype=None):
"""Use this to remove columns that don't exist in meta"""
ignore_fields = default_fields + optional_fields
filters={ "issingle": 0 }
if doctype:
filters["name"] = doctype

for doctype in frappe.db.get_all("DocType", filters={"issingle": 0}):
doctype = doctype.name


Loading…
Cancel
Save