Преглед на файлове

trim tables for a doctype

version-14
Nabin Hait преди 8 години
родител
ревизия
0398e2d397
променени са 1 файла, в които са добавени 5 реда и са изтрити 1 реда
  1. +5
    -1
      frappe/model/meta.py

+ 5
- 1
frappe/model/meta.py Целия файл

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


def trim_tables():
def trim_tables(doctype=None):
"""Use this to remove columns that don't exist in meta""" """Use this to remove columns that don't exist in meta"""
ignore_fields = default_fields + optional_fields 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}): for doctype in frappe.db.get_all("DocType", filters={"issingle": 0}):
doctype = doctype.name doctype = doctype.name


Зареждане…
Отказ
Запис