sync ref db and changes in diff.py

This commit is contained in:
Nabin Hait 2012-03-22 15:08:15 +05:30
parent 2cd4531a8d
commit bf16176daf
11 changed files with 866 additions and 1152 deletions

View file

@ -5,115 +5,141 @@
{
'creation': '2010-08-08 17:08:55',
'docstatus': 0,
'modified': '2012-02-03 11:29:33',
'modified_by': 'Administrator',
'owner': 'Administrator'
'modified': '2012-03-22 14:53:41',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
# These values are common for all DocType
{
'_last_update': '1311536932',
'autoname': 'CWR/.#####',
'colour': 'White:FFF',
'default_print_format': 'Standard',
'_last_update': u'1311536932',
'autoname': u'CWR/.#####',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'issingle': 0,
'module': 'Core',
'module': u'Core',
'name': '__common__',
'section_style': 'Simple',
'server_code_error': ' ',
'section_style': u'Simple',
'server_code_error': u' ',
'show_in_menu': 0,
'version': 9
},
# These values are common for all DocField
{
'doctype': 'DocField',
'doctype': u'DocField',
'name': '__common__',
'parent': 'Comment Widget Record',
'parentfield': 'fields',
'parenttype': 'DocType',
'permlevel': 0
'no_copy': 0,
'parent': u'Comment Widget Record',
'parentfield': u'fields',
'parenttype': u'DocType',
'permlevel': 0,
'search_index': 0
},
# These values are common for all DocPerm
{
'doctype': 'DocPerm',
'create': 1,
'doctype': u'DocPerm',
'name': '__common__',
'parent': 'Comment Widget Record',
'parentfield': 'permissions',
'parenttype': 'DocType',
'parent': u'Comment Widget Record',
'parentfield': u'permissions',
'parenttype': u'DocType',
'permlevel': 0,
'read': 1
'read': 1,
'role': u'System Manager',
'write': 1
},
# DocType, Comment Widget Record
{
'doctype': 'DocType',
'name': 'Comment Widget Record'
'name': u'Comment Widget Record'
},
# DocPerm
{
'create': 1,
'doctype': 'DocPerm',
'role': 'System Manager',
'write': 1
},
# DocPerm
{
'doctype': 'DocPerm',
'role': 'All'
'doctype': u'DocPerm'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'comment',
'fieldtype': 'Text',
'label': 'Comment',
'oldfieldname': 'comment',
'oldfieldtype': 'Text'
'doctype': u'DocField',
'fieldname': u'comment',
'fieldtype': u'Text',
'label': u'Comment',
'oldfieldname': u'comment',
'oldfieldtype': u'Text'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'comment_by',
'fieldtype': 'Data',
'label': 'Comment By',
'oldfieldname': 'comment_by',
'oldfieldtype': 'Data'
'doctype': u'DocField',
'fieldname': u'comment_by',
'fieldtype': u'Data',
'label': u'Comment By',
'oldfieldname': u'comment_by',
'oldfieldtype': u'Data'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'comment_by_fullname',
'fieldtype': 'Data',
'label': 'Comment By Fullname',
'oldfieldname': 'comment_by_fullname',
'oldfieldtype': 'Data'
'doctype': u'DocField',
'fieldname': u'comment_by_fullname',
'fieldtype': u'Data',
'label': u'Comment By Fullname',
'oldfieldname': u'comment_by_fullname',
'oldfieldtype': u'Data'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'comment_doctype',
'fieldtype': 'Data',
'label': 'Comment Doctype',
'oldfieldname': 'comment_doctype',
'oldfieldtype': 'Data'
'doctype': u'DocField',
'fieldname': u'comment_date',
'fieldtype': u'Date',
'label': u'Comment Date',
'oldfieldname': u'comment_date',
'oldfieldtype': u'Date'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'comment_docname',
'fieldtype': 'Data',
'label': 'Comment Docname',
'oldfieldname': 'comment_docname',
'oldfieldtype': 'Data'
'doctype': u'DocField',
'fieldname': u'comment_time',
'fieldtype': u'Data',
'label': u'Comment Time',
'oldfieldname': u'comment_time',
'oldfieldtype': u'Data'
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'comment_doctype',
'fieldtype': u'Data',
'label': u'Comment Doctype',
'oldfieldname': u'comment_doctype',
'oldfieldtype': u'Data'
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'comment_docname',
'fieldtype': u'Data',
'label': u'Comment Docname',
'oldfieldname': u'comment_docname',
'oldfieldtype': u'Data'
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'post_topic',
'fieldtype': u'Data',
'label': u'Post Topic',
'oldfieldname': u'post_topic',
'oldfieldtype': u'Data'
}
]

View file

@ -3,359 +3,371 @@
# These values are common in all dictionaries
{
'creation': '2011-07-22 15:56:01',
'creation': '2010-10-13 16:33:29',
'docstatus': 0,
'modified': '2011-07-22 15:56:01',
'modified_by': 'Administrator',
'owner': 'Administrator'
'modified': '2012-03-22 14:23:46',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
# These values are common for all DocType
{
'_last_update': '1305789385',
'autoname': 'CustomField.####',
'colour': 'White:FFF',
'description': 'Adds a custom field to a DocType',
'_last_update': u'1305789385',
'allow_trash': 1,
'autoname': u'CustomField.####',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'description': u'Adds a custom field to a DocType',
'doctype': 'DocType',
'module': 'Core',
'module': u'Core',
'name': '__common__',
'search_fields': 'dt,label,fieldtype,options',
'section_style': 'Simple',
'server_code': ' \n # Add Field\n # ----------\n def add_field(self):\n field_exists = sql("select name from tabDocField where parent = %s and (label = %s or fieldname = %s)" , (self.doc.dt, self.doc.label, self.doc.fieldname))\n field_exists = field_exists and field_exists[0][0] or \'\'\n self.ignore_fields = [\'dt\',\'trash_reason\',\'insert_after\',\'index\',\'customfield1\',\'length\']\n if field_exists:\n df = Document(\'DocField\',field_exists)\n self.update_field(df, n = 0)\n else:\n df = Document(\'DocField\')\n self.update_field(df, n = 1)\n\n\n\n # Update Field\n # -------------\n def update_field(self, df, n):\n import webnotes.model\n sql("update tabDocField set idx = idx + 1 where parent = %s and idx > %s", (self.doc.dt, self.idx))\n for k in self.doc.fields:\n if k not in webnotes.model.default_fields and k not in self.ignore_fields:\n df.fields[k] = self.doc.fields[k]\n df.parent = self.doc.dt\n df.parenttype = \'DocType\'\n df.parentfield = \'fields\'\n df.idx = self.idx+1\n df.save(n)\n dt_obj = get_obj(\'DocType\',self.doc.dt,with_children=1)\n dt_obj.validate()\n dt_obj.on_update()\n dt_obj.doc.save()',
'server_code_error': ' ',
'search_fields': u'dt,label,fieldtype,options',
'section_style': u'Simple',
'server_code_error': u' ',
'show_in_menu': 0,
'version': 158
'subject': u'%(label)s (%(fieldtype)s) on %(dt)s',
'tag_fields': u'dt,fieldtype',
'version': 159
},
# These values are common for all DocField
{
'doctype': 'DocField',
'doctype': u'DocField',
'name': '__common__',
'parent': 'Custom Field',
'parentfield': 'fields',
'parenttype': 'DocType'
'parent': u'Custom Field',
'parentfield': u'fields',
'parenttype': u'DocType'
},
# These values are common for all DocPerm
{
'doctype': 'DocPerm',
'doctype': u'DocPerm',
'name': '__common__',
'parent': 'Custom Field',
'parentfield': 'permissions',
'parenttype': 'DocType',
'parent': u'Custom Field',
'parentfield': u'permissions',
'parenttype': u'DocType',
'read': 1
},
# DocType, Custom Field
{
'doctype': 'DocType',
'name': 'Custom Field'
'name': u'Custom Field'
},
# DocPerm
{
'cancel': 1,
'create': 1,
'doctype': 'DocPerm',
'idx': 1,
'doctype': u'DocPerm',
'permlevel': 0,
'role': 'Administrator',
'role': u'Administrator',
'write': 1
},
# DocPerm
{
'doctype': 'DocPerm',
'idx': 2,
'doctype': u'DocPerm',
'permlevel': 1,
'role': 'Administrator'
'role': u'Administrator'
},
# DocPerm
{
'doctype': 'DocPerm',
'idx': 3,
'doctype': u'DocPerm',
'permlevel': 2,
'role': 'Administrator'
'role': u'Administrator'
},
# DocPerm
{
'cancel': 1,
'create': 1,
'doctype': 'DocPerm',
'idx': 4,
'doctype': u'DocPerm',
'permlevel': 0,
'role': 'System Manager',
'role': u'System Manager',
'write': 1
},
# DocPerm
{
'doctype': 'DocPerm',
'idx': 5,
'doctype': u'DocPerm',
'permlevel': 1,
'role': 'System Manager'
'role': u'System Manager'
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Column Break',
'idx': 1,
'label': 'Details',
'oldfieldtype': 'Column Break',
'doctype': u'DocField',
'fieldtype': u'Column Break',
'label': u'Details',
'oldfieldtype': u'Column Break',
'permlevel': 0,
'width': '50%'
'width': u'50%'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'trash_reason',
'fieldtype': 'Small Text',
'idx': 2,
'label': 'Trash Reason',
'oldfieldname': 'trash_reason',
'oldfieldtype': 'Small Text',
'permlevel': 1
'doctype': u'DocField',
'fieldname': u'trash_reason',
'fieldtype': u'Small Text',
'label': u'Trash Reason',
'no_copy': 0,
'oldfieldname': u'trash_reason',
'oldfieldtype': u'Small Text',
'permlevel': 1,
'search_index': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'dt',
'fieldtype': 'Link',
'idx': 3,
'label': 'Document',
'oldfieldname': 'dt',
'oldfieldtype': 'Link',
'options': 'DocType',
'doctype': u'DocField',
'fieldname': u'dt',
'fieldtype': u'Link',
'in_filter': 1,
'label': u'Document',
'no_copy': 0,
'oldfieldname': u'dt',
'oldfieldtype': u'Link',
'options': u'DocType',
'permlevel': 0,
'reqd': 1,
'trigger': 'Client'
'search_index': 1,
'trigger': u'Client'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'label',
'fieldtype': 'Data',
'idx': 4,
'label': 'Label',
'doctype': u'DocField',
'fieldname': u'label',
'fieldtype': u'Data',
'in_filter': 1,
'label': u'Label',
'no_copy': 1,
'oldfieldname': 'label',
'oldfieldtype': 'Data',
'permlevel': 0,
'reqd': 1
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'HTML',
'idx': 5,
'label': 'Label Help',
'oldfieldtype': 'HTML',
'permlevel': 0
},
# DocField
{
'colour': 'White:FFF',
'doctype': 'DocField',
'fieldname': 'fieldtype',
'fieldtype': 'Select',
'idx': 6,
'label': 'Field Type',
'oldfieldname': 'fieldtype',
'oldfieldtype': 'Select',
'options': '\nButton\nCheck\nColumn Break\nCurrency\nData\nDate\nFloat\nHTML\nInt\nLink\nRead Only\nSection Break\nSelect\nSmall Text\nText\nText Editor\nTime',
'oldfieldname': u'label',
'oldfieldtype': u'Data',
'permlevel': 0,
'reqd': 1,
'trigger': 'Client'
'search_index': 0
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'HTML',
'idx': 7,
'label': 'Options Help',
'oldfieldtype': 'HTML',
'doctype': u'DocField',
'fieldtype': u'HTML',
'label': u'Label Help',
'oldfieldtype': u'HTML',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'options',
'fieldtype': 'Text',
'idx': 8,
'label': 'Options',
'oldfieldname': 'options',
'oldfieldtype': 'Text',
'colour': u'White:FFF',
'doctype': u'DocField',
'fieldname': u'fieldtype',
'fieldtype': u'Select',
'in_filter': 1,
'label': u'Field Type',
'no_copy': 0,
'oldfieldname': u'fieldtype',
'oldfieldtype': u'Select',
'options': u'\nButton\nCheck\nColumn Break\nCurrency\nData\nDate\nFloat\nHTML\nInt\nLink\nRead Only\nSection Break\nSelect\nSmall Text\nText\nText Editor\nTime',
'permlevel': 0,
'reqd': 1,
'search_index': 0,
'trigger': u'Client'
},
# DocField
{
'doctype': u'DocField',
'fieldtype': u'HTML',
'label': u'Options Help',
'oldfieldtype': u'HTML',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'description',
'fieldtype': 'Text',
'idx': 9,
'label': 'Field Description',
'oldfieldname': 'description',
'oldfieldtype': 'Text',
'doctype': u'DocField',
'fieldname': u'options',
'fieldtype': u'Text',
'label': u'Options',
'no_copy': 0,
'oldfieldname': u'options',
'oldfieldtype': u'Text',
'permlevel': 0,
'width': '300px'
'search_index': 0
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Column Break',
'idx': 10,
'label': 'Properties',
'oldfieldtype': 'Column Break',
'doctype': u'DocField',
'fieldname': u'description',
'fieldtype': u'Text',
'label': u'Field Description',
'no_copy': 0,
'oldfieldname': u'description',
'oldfieldtype': u'Text',
'permlevel': 0,
'width': '50%'
'search_index': 0,
'width': u'300px'
},
# DocField
{
'colour': 'White:FFF',
'description': 'Select the label after which you want to insert new field.',
'doctype': 'DocField',
'fieldname': 'insert_after',
'fieldtype': 'Select',
'idx': 11,
'label': 'Insert After',
'oldfieldname': 'insert_after',
'oldfieldtype': 'Select',
'doctype': u'DocField',
'fieldtype': u'Column Break',
'label': u'Properties',
'oldfieldtype': u'Column Break',
'permlevel': 0,
'trigger': 'Client'
'width': u'50%'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'default',
'fieldtype': 'Text',
'idx': 12,
'label': 'Default Value',
'oldfieldname': 'default',
'oldfieldtype': 'Text',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'fieldname',
'fieldtype': 'Data',
'idx': 13,
'label': 'Fieldname',
'colour': u'White:FFF',
'description': u'Select the label after which you want to insert new field.',
'doctype': u'DocField',
'fieldname': u'insert_after',
'fieldtype': u'Select',
'label': u'Insert After',
'no_copy': 1,
'oldfieldname': 'fieldname',
'oldfieldtype': 'Data',
'permlevel': 2
'oldfieldname': u'insert_after',
'oldfieldtype': u'Select',
'permlevel': 0,
'search_index': 0,
'trigger': u'Client'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'width',
'fieldtype': 'Data',
'idx': 14,
'label': 'Width',
'oldfieldname': 'width',
'oldfieldtype': 'Data',
'permlevel': 0
'doctype': u'DocField',
'fieldname': u'default',
'fieldtype': u'Text',
'label': u'Default Value',
'no_copy': 0,
'oldfieldname': u'default',
'oldfieldtype': u'Text',
'permlevel': 0,
'search_index': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'reqd',
'fieldtype': 'Check',
'idx': 15,
'label': 'Is Mandatory Field',
'oldfieldname': 'reqd',
'oldfieldtype': 'Check',
'permlevel': 0
'doctype': u'DocField',
'fieldname': u'fieldname',
'fieldtype': u'Data',
'label': u'Fieldname',
'no_copy': 1,
'oldfieldname': u'fieldname',
'oldfieldtype': u'Data',
'permlevel': 2,
'search_index': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'in_filter',
'fieldtype': 'Check',
'idx': 16,
'label': 'In Report Filter',
'oldfieldname': 'in_filter',
'oldfieldtype': 'Check',
'permlevel': 0
'doctype': u'DocField',
'fieldname': u'width',
'fieldtype': u'Data',
'label': u'Width',
'no_copy': 0,
'oldfieldname': u'width',
'oldfieldtype': u'Data',
'permlevel': 0,
'search_index': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'no_copy',
'fieldtype': 'Check',
'idx': 17,
'label': 'No Copy',
'oldfieldname': 'no_copy',
'oldfieldtype': 'Check',
'permlevel': 0
'doctype': u'DocField',
'fieldname': u'reqd',
'fieldtype': u'Check',
'label': u'Is Mandatory Field',
'no_copy': 0,
'oldfieldname': u'reqd',
'oldfieldtype': u'Check',
'permlevel': 0,
'search_index': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'print_hide',
'fieldtype': 'Check',
'idx': 18,
'label': 'Print Hide',
'oldfieldname': 'print_hide',
'oldfieldtype': 'Check',
'permlevel': 0
'doctype': u'DocField',
'fieldname': u'in_filter',
'fieldtype': u'Check',
'label': u'In Report Filter',
'no_copy': 0,
'oldfieldname': u'in_filter',
'oldfieldtype': u'Check',
'permlevel': 0,
'search_index': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'report_hide',
'fieldtype': 'Check',
'idx': 19,
'label': 'Report Hide',
'oldfieldname': 'report_hide',
'oldfieldtype': 'Check',
'permlevel': 0
'doctype': u'DocField',
'fieldname': u'no_copy',
'fieldtype': u'Check',
'label': u'No Copy',
'no_copy': 0,
'oldfieldname': u'no_copy',
'oldfieldtype': u'Check',
'permlevel': 0,
'search_index': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'allow_on_submit',
'fieldtype': 'Check',
'idx': 20,
'label': 'Allow on Submit',
'oldfieldname': 'allow_on_submit',
'oldfieldtype': 'Check',
'permlevel': 0
'doctype': u'DocField',
'fieldname': u'print_hide',
'fieldtype': u'Check',
'label': u'Print Hide',
'no_copy': 0,
'oldfieldname': u'print_hide',
'oldfieldtype': u'Check',
'permlevel': 0,
'search_index': 0
},
# DocField
{
'default': '0',
'doctype': 'DocField',
'fieldname': 'permlevel',
'fieldtype': 'Int',
'idx': 21,
'label': 'Permission Level',
'oldfieldname': 'permlevel',
'oldfieldtype': 'Int',
'permlevel': 0
'doctype': u'DocField',
'fieldname': u'report_hide',
'fieldtype': u'Check',
'label': u'Report Hide',
'no_copy': 0,
'oldfieldname': u'report_hide',
'oldfieldtype': u'Check',
'permlevel': 0,
'search_index': 0
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'allow_on_submit',
'fieldtype': u'Check',
'label': u'Allow on Submit',
'no_copy': 0,
'oldfieldname': u'allow_on_submit',
'oldfieldtype': u'Check',
'permlevel': 0,
'search_index': 0
},
# DocField
{
'default': u'0',
'doctype': u'DocField',
'fieldname': u'permlevel',
'fieldtype': u'Int',
'label': u'Permission Level',
'no_copy': 0,
'oldfieldname': u'permlevel',
'oldfieldtype': u'Int',
'permlevel': 0,
'search_index': 0
}
]

View file

@ -5,57 +5,57 @@
{
'creation': '2011-12-21 11:07:56',
'docstatus': 0,
'modified': '2012-01-25 17:14:46',
'modified_by': 'Administrator',
'owner': 'Administrator'
'modified': '2012-03-22 14:26:13',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
# These values are common for all DocType
{
'_last_update': '1326273643',
'autoname': 'DL.####',
'colour': 'White:FFF',
'_last_update': u'1326273643',
'autoname': u'DL.####',
'colour': u'White:FFF',
'doctype': 'DocType',
'hide_toolbar': 0,
'issingle': 1,
'module': 'Core',
'module': u'Core',
'name': '__common__',
'search_fields': 'doc_type',
'section_style': 'Simple',
'search_fields': u'doc_type',
'section_style': u'Simple',
'show_in_menu': 0,
'version': 106
'version': 107
},
# These values are common for all DocField
{
'doctype': 'DocField',
'doctype': u'DocField',
'name': '__common__',
'parent': 'DocLayer',
'parentfield': 'fields',
'parenttype': 'DocType'
'parent': u'DocLayer',
'parentfield': u'fields',
'parenttype': u'DocType'
},
# These values are common for all DocPerm
{
'doctype': 'DocPerm',
'doctype': u'DocPerm',
'name': '__common__',
'parent': 'DocLayer',
'parentfield': 'permissions',
'parenttype': 'DocType',
'parent': u'DocLayer',
'parentfield': u'permissions',
'parenttype': u'DocType',
'read': 1,
'role': 'System Manager'
'role': u'System Manager'
},
# DocType, DocLayer
{
'doctype': 'DocType',
'name': 'DocLayer'
'name': u'DocLayer'
},
# DocPerm
{
'create': 1,
'doctype': 'DocPerm',
'doctype': u'DocPerm',
'permlevel': 0,
'write': 1
},
@ -63,164 +63,188 @@
# DocPerm
{
'create': 1,
'doctype': 'DocPerm',
'doctype': u'DocPerm',
'permlevel': 1,
'write': 1
},
# DocPerm
{
'doctype': 'DocPerm',
'doctype': u'DocPerm',
'permlevel': 2
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'doc_type',
'fieldtype': 'Select',
'doctype': u'DocField',
'fieldname': u'doc_type',
'fieldtype': u'Select',
'hidden': 0,
'label': 'Select Form Type',
'label': u'Select Form Type',
'no_copy': 0,
'permlevel': 0,
'search_index': 0
},
# DocField
{
'doctype': u'DocField',
'fieldtype': u'Section Break',
'label': u'Properties',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Section Break',
'label': 'Properties',
'doctype': u'DocField',
'fieldtype': u'Column Break',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Column Break',
'permlevel': 0
},
# DocField
{
'description': 'E.g.<br />\nBased on field - <b>field:customer_name</b><br />\nBased on number series: <b>TRN.####</b>',
'doctype': 'DocField',
'fieldname': 'autoname',
'fieldtype': 'Data',
'description': u'E.g.<br />\nBased on field - <b>field:customer_name</b><br />\nBased on number series: <b>TRN.####</b>',
'doctype': u'DocField',
'fieldname': u'autoname',
'fieldtype': u'Data',
'hidden': 1,
'label': 'Auto Name',
'permlevel': 2
'label': u'Auto Name',
'no_copy': 0,
'permlevel': 2,
'search_index': 0
},
# DocField
{
'description': 'Fields separated by comma (,) will be included in the<br /><b>Search By</b> list of Search dialog box',
'doctype': 'DocField',
'fieldname': 'search_fields',
'fieldtype': 'Data',
'label': 'Search Fields',
'description': u'Fields separated by comma (,) will be included in the<br /><b>Search By</b> list of Search dialog box',
'doctype': u'DocField',
'fieldname': u'search_fields',
'fieldtype': u'Data',
'label': u'Search Fields',
'no_copy': 0,
'permlevel': 0,
'search_index': 0
},
# DocField
{
'description': u'Fields separated by comma (,) will be set as tags',
'doctype': u'DocField',
'fieldname': u'tag_fields',
'fieldtype': u'Data',
'label': u'Tag Fields',
'no_copy': 0,
'permlevel': 0,
'search_index': 0
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'default_print_format',
'fieldtype': u'Link',
'label': u'Default Print Format',
'no_copy': 0,
'options': u'Print Format',
'permlevel': 0,
'search_index': 0
},
# DocField
{
'doctype': u'DocField',
'fieldtype': u'Column Break',
'permlevel': 0
},
# DocField
{
'description': 'Fields separated by comma (,) will be set as tags',
'doctype': 'DocField',
'fieldname': 'tag_fields',
'fieldtype': 'Data',
'label': 'Tag Fields',
'description': u'Load Print View on opening of an existing form',
'doctype': u'DocField',
'fieldname': u'read_only_onload',
'fieldtype': u'Check',
'label': u'Show Print First',
'no_copy': 0,
'permlevel': 0,
'search_index': 0
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'allow_print',
'fieldtype': u'Check',
'label': u'Hide Print',
'no_copy': 0,
'permlevel': 0,
'search_index': 0
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'allow_email',
'fieldtype': u'Check',
'label': u'Hide Email',
'no_copy': 0,
'permlevel': 0,
'search_index': 0
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'allow_copy',
'fieldtype': u'Check',
'label': u'Hide Copy',
'no_copy': 0,
'permlevel': 0,
'search_index': 0
},
# DocField
{
'description': u'Note: maximum attachment size = 1mb',
'doctype': u'DocField',
'fieldname': u'allow_attach',
'fieldtype': u'Check',
'label': u'Allow Attach',
'no_copy': 0,
'permlevel': 0,
'search_index': 0
},
# DocField
{
'depends_on': u'eval:doc.allow_attach',
'doctype': u'DocField',
'fieldname': u'max_attachments',
'fieldtype': u'Int',
'label': u'Max Attachments',
'no_copy': 0,
'permlevel': 0,
'search_index': 0
},
# DocField
{
'description': u'Customize Label, Print Hide, Default etc.',
'doctype': u'DocField',
'fieldtype': u'Section Break',
'label': u'Fields',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'default_print_format',
'fieldtype': 'Link',
'label': 'Default Print Format',
'options': 'Print Format',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Column Break',
'permlevel': 0
},
# DocField
{
'description': 'Load Print View on opening of an existing form',
'doctype': 'DocField',
'fieldname': 'read_only_onload',
'fieldtype': 'Check',
'label': 'Show Print First',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'allow_print',
'fieldtype': 'Check',
'label': 'Hide Print',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'allow_email',
'fieldtype': 'Check',
'label': 'Hide Email',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'allow_copy',
'fieldtype': 'Check',
'label': 'Hide Copy',
'permlevel': 0
},
# DocField
{
'description': 'Note: maximum attachment size = 1mb',
'doctype': 'DocField',
'fieldname': 'allow_attach',
'fieldtype': 'Check',
'label': 'Allow Attach',
'permlevel': 0
},
# DocField
{
'depends_on': 'eval:doc.allow_attach',
'doctype': 'DocField',
'fieldname': 'max_attachments',
'fieldtype': 'Int',
'label': 'Max Attachments',
'permlevel': 0
},
# DocField
{
'description': 'Customize Label, Print Hide, Default etc.',
'doctype': 'DocField',
'fieldtype': 'Section Break',
'label': 'Fields',
'permlevel': 0
},
# DocField
{
'default': 'no add rows',
'doctype': 'DocField',
'fieldname': 'fields',
'fieldtype': 'Table',
'label': 'Fields',
'options': 'DocLayerField',
'permlevel': 1
'default': u'no add rows',
'doctype': u'DocField',
'fieldname': u'fields',
'fieldtype': u'Table',
'label': u'Fields',
'no_copy': 0,
'options': u'DocLayerField',
'permlevel': 1,
'search_index': 0
}
]

View file

@ -5,229 +5,231 @@
{
'creation': '2009-05-12 11:19:11',
'docstatus': 0,
'modified': '2011-02-25 17:03:58',
'modified_by': 'Administrator',
'owner': 'Administrator'
'modified': '2012-03-22 14:23:58',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
# These values are common for all DocType
{
'_last_update': '1307624201',
'autoname': 'EV.#####',
'client_script': "cur_frm.cscript.onload = function(doc, cdt, cdn) {\n var df = get_field('Event', 'Intro HTML', doc.name);\n if(doc.ref_type) {\n ref = repl(cur_frm.cstring.ref_html, {'dt': doc.ref_type, 'dn':doc.ref_name});\n } else var ref = '';\n \n df.options = repl(cur_frm.cstring.intro_html, {'ref': ref});\n refresh_fields('Intro HTML');\n}",
'client_string': '---intro_html---\n\n<div style="padding: 8px; background-color: #EEF; border: 1px solid #CCF; margin-bottom: 8px;">\n %(ref)s\n <a href="javascript:loadpage(\'_calendar\')">Go To Calendar</a>\n</div>\n\n---ref_html---\n\nReference : <a href="javascript:loaddoc(\'%(dt)s\', \'%(dn)s\')">%(dn)s</a><br><br>',
'colour': 'White:FFF',
'_last_update': u'1307624201',
'autoname': u'EV.#####',
'client_string': u'---intro_html---\n\n<div style="padding: 8px; background-color: #EEF; border: 1px solid #CCF; margin-bottom: 8px;">\n %(ref)s\n <a href="javascript:loadpage(\'_calendar\')">Go To Calendar</a>\n</div>\n\n---ref_html---\n\nReference : <a href="javascript:loaddoc(\'%(dt)s\', \'%(dn)s\')">%(dn)s</a><br><br>',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'in_create': 1,
'module': 'Core',
'module': u'Core',
'name': '__common__',
'read_only': 1,
'section_style': 'Tabbed',
'server_code_error': ' ',
'section_style': u'Tabbed',
'server_code_error': u' ',
'show_in_menu': 0,
'version': 2
'version': 3
},
# These values are common for all DocField
{
'doctype': 'DocField',
'doctype': u'DocField',
'name': '__common__',
'parent': 'Event',
'parentfield': 'fields',
'parenttype': 'DocType',
'parent': u'Event',
'parentfield': u'fields',
'parenttype': u'DocType',
'permlevel': 0
},
# These values are common for all DocPerm
{
'create': 1,
'doctype': 'DocPerm',
'idx': 1,
'match': 'owner',
'doctype': u'DocPerm',
'match': u'owner',
'name': '__common__',
'parent': 'Event',
'parentfield': 'permissions',
'parenttype': 'DocType',
'parent': u'Event',
'parentfield': u'permissions',
'parenttype': u'DocType',
'permlevel': 0,
'read': 1,
'role': 'All',
'role': u'All',
'write': 1
},
# DocType, Event
{
'doctype': 'DocType',
'name': 'Event'
'name': u'Event'
},
# DocPerm
{
'doctype': 'DocPerm'
'doctype': u'DocPerm'
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Section Break',
'idx': 1,
'label': 'Details',
'oldfieldtype': 'Section Break'
'doctype': u'DocField',
'fieldtype': u'Section Break',
'label': u'Details',
'oldfieldtype': u'Section Break'
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'HTML',
'idx': 2,
'label': 'Intro HTML',
'oldfieldtype': 'HTML'
'doctype': u'DocField',
'fieldtype': u'HTML',
'label': u'Intro HTML',
'oldfieldtype': u'HTML'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'event_date',
'fieldtype': 'Date',
'idx': 3,
'label': 'Event Date',
'oldfieldname': 'event_date',
'oldfieldtype': 'Date',
'doctype': u'DocField',
'fieldname': u'event_date',
'fieldtype': u'Date',
'label': u'Event Date',
'no_copy': 0,
'oldfieldname': u'event_date',
'oldfieldtype': u'Date',
'search_index': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'event_hour',
'fieldtype': 'Time',
'idx': 4,
'label': 'Event Time',
'oldfieldname': 'event_hour',
'oldfieldtype': 'Time'
'doctype': u'DocField',
'fieldname': u'event_hour',
'fieldtype': u'Time',
'label': u'Event Time',
'no_copy': 0,
'oldfieldname': u'event_hour',
'oldfieldtype': u'Time',
'search_index': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'event_name',
'fieldtype': 'Data',
'doctype': u'DocField',
'fieldname': u'event_name',
'fieldtype': u'Data',
'hidden': 1,
'idx': 5,
'label': 'Event Name',
'oldfieldname': 'event_name',
'oldfieldtype': 'Data'
'label': u'Event Name',
'no_copy': 0,
'oldfieldname': u'event_name',
'oldfieldtype': u'Data',
'search_index': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'description',
'fieldtype': 'Text',
'idx': 6,
'label': 'Description',
'oldfieldname': 'description',
'oldfieldtype': 'Text',
'width': '300px'
'doctype': u'DocField',
'fieldname': u'description',
'fieldtype': u'Text',
'label': u'Description',
'no_copy': 0,
'oldfieldname': u'description',
'oldfieldtype': u'Text',
'search_index': 0,
'width': u'300px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'notes',
'fieldtype': 'Text',
'idx': 7,
'label': 'Notes',
'oldfieldname': 'notes',
'oldfieldtype': 'Text'
'doctype': u'DocField',
'fieldname': u'notes',
'fieldtype': u'Text',
'label': u'Notes',
'no_copy': 0,
'oldfieldname': u'notes',
'oldfieldtype': u'Text',
'search_index': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'event_type',
'fieldtype': 'Select',
'idx': 8,
'label': 'Event Type',
'oldfieldname': 'event_type',
'oldfieldtype': 'Select',
'options': 'Private\nPublic\nCancel',
'doctype': u'DocField',
'fieldname': u'event_type',
'fieldtype': u'Select',
'label': u'Event Type',
'no_copy': 0,
'oldfieldname': u'event_type',
'oldfieldtype': u'Select',
'options': u'Private\nPublic\nCancel',
'search_index': 1
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Section Break',
'idx': 9,
'label': 'Participants',
'oldfieldtype': 'Section Break'
'doctype': u'DocField',
'fieldtype': u'Section Break',
'label': u'Participants',
'oldfieldtype': u'Section Break'
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Column Break',
'idx': 10,
'label': 'Individuals',
'oldfieldtype': 'Column Break',
'width': '50%'
'doctype': u'DocField',
'fieldtype': u'Column Break',
'label': u'Individuals',
'oldfieldtype': u'Column Break',
'width': u'50%'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'event_individuals',
'fieldtype': 'Table',
'idx': 11,
'label': 'Event Individuals',
'oldfieldname': 'event_individuals',
'oldfieldtype': 'Table',
'options': 'Event User'
'doctype': u'DocField',
'fieldname': u'event_individuals',
'fieldtype': u'Table',
'label': u'Event Individuals',
'no_copy': 0,
'oldfieldname': u'event_individuals',
'oldfieldtype': u'Table',
'options': u'Event User',
'search_index': 0
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Column Break',
'idx': 12,
'label': 'Groups',
'oldfieldtype': 'Column Break',
'width': '50%'
'doctype': u'DocField',
'fieldtype': u'Column Break',
'label': u'Groups',
'oldfieldtype': u'Column Break',
'width': u'50%'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'event_roles',
'fieldtype': 'Table',
'idx': 13,
'label': 'Event Roles',
'oldfieldname': 'event_roles',
'oldfieldtype': 'Table',
'options': 'Event Role'
'doctype': u'DocField',
'fieldname': u'event_roles',
'fieldtype': u'Table',
'label': u'Event Roles',
'no_copy': 0,
'oldfieldname': u'event_roles',
'oldfieldtype': u'Table',
'options': u'Event Role',
'search_index': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'ref_type',
'fieldtype': 'Data',
'doctype': u'DocField',
'fieldname': u'ref_type',
'fieldtype': u'Data',
'hidden': 0,
'idx': 14,
'label': 'Ref Type',
'oldfieldname': 'ref_type',
'oldfieldtype': 'Data'
'label': u'Ref Type',
'no_copy': 0,
'oldfieldname': u'ref_type',
'oldfieldtype': u'Data',
'search_index': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'ref_name',
'fieldtype': 'Data',
'doctype': u'DocField',
'fieldname': u'ref_name',
'fieldtype': u'Data',
'hidden': 0,
'idx': 15,
'label': 'Ref Name',
'oldfieldname': 'ref_name',
'oldfieldtype': 'Data'
'label': u'Ref Name',
'no_copy': 0,
'oldfieldname': u'ref_name',
'oldfieldtype': u'Data',
'search_index': 0
}
]

View file

@ -1,36 +0,0 @@
# Copyright (c) 2012 Web Notes Technologies Pvt Ltd (http://erpnext.com)
#
# MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
# INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
# PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
# HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
# CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
# OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
class DocType:
def __init__(self, d, dl):
self.doc, self.doclist = d,dl
def validate(self):
# check for extension
if not '.' in self.doc.file_name:
msgprint("Extension required in file name")
raise Exception
# set mime type
if not self.doc.mime_type:
import mimetypes
self.doc.mime_type = mimetypes.guess_type(self.doc.file_name)[0] or 'application/unknown'

View file

@ -1,191 +0,0 @@
# DocType, File
[
# These values are common in all dictionaries
{
'creation': '2009-06-04 10:49:33',
'docstatus': 0,
'modified': '2010-12-27 11:10:20',
'modified_by': 'umair@iwebnotes.com',
'owner': 'Administrator'
},
# These values are common for all DocType
{
'allow_attach': 1,
'autoname': 'field:file_name',
'colour': 'White:FFF',
'doctype': 'DocType',
'max_attachments': 1,
'module': 'Core',
'name': '__common__',
'search_fields': 'type, file_group',
'section_style': 'Simple',
'server_code': 'class DocType:\n def __init__(self, d, dl):\n self.doc, self.doclist = d,dl\n\n def validate(self):\n # check for extension\n if not \'.\' in self.doc.file_name:\n msgprint("Extension required in file name")\n raise Exception\n\n # set mime type\n if not self.doc.mime_type:\n import mimetypes\n self.doc.mime_type = mimetypes.guess_type(self.doc.file_name)[0] or \'application/unknown\'',
'server_code_error': ' ',
'show_in_menu': 0,
'version': 7
},
# These values are common for all DocField
{
'doctype': 'DocField',
'name': '__common__',
'parent': 'File',
'parentfield': 'fields',
'parenttype': 'DocType'
},
# These values are common for all DocPerm
{
'doctype': 'DocPerm',
'name': '__common__',
'parent': 'File',
'parentfield': 'permissions',
'parenttype': 'DocType',
'read': 1,
'role': 'All'
},
# DocType, File
{
'doctype': 'DocType',
'name': 'File'
},
# DocPerm
{
'amend': 0,
'create': 1,
'doctype': 'DocPerm',
'idx': 1,
'match': 'owner',
'permlevel': 0,
'write': 1
},
# DocPerm
{
'doctype': 'DocPerm',
'idx': 2,
'permlevel': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'file_name',
'fieldtype': 'Data',
'idx': 1,
'label': 'File Name',
'oldfieldname': 'file_name',
'oldfieldtype': 'Data',
'permlevel': 0,
'reqd': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'description',
'fieldtype': 'Text',
'idx': 2,
'label': 'Description',
'oldfieldname': 'description',
'oldfieldtype': 'Text',
'permlevel': 0,
'reqd': 1,
'width': '300px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'mime_type',
'fieldtype': 'Data',
'idx': 3,
'label': 'MIME Type',
'oldfieldname': 'mime_type',
'oldfieldtype': 'Data',
'permlevel': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'type',
'fieldtype': 'Select',
'idx': 4,
'label': 'Type',
'oldfieldname': 'type',
'oldfieldtype': 'Select',
'options': '\nImage\nDocument\nSpreadsheet\nPresentation\nOther',
'permlevel': 0,
'reqd': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'file_group',
'fieldtype': 'Link',
'idx': 5,
'label': 'File Group',
'oldfieldname': 'file_group',
'oldfieldtype': 'Link',
'options': 'File Group',
'permlevel': 0,
'reqd': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'file_list',
'fieldtype': 'Text',
'idx': 6,
'label': 'File List',
'oldfieldname': 'file_list',
'oldfieldtype': 'Text',
'permlevel': 2
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'shared_with',
'fieldtype': 'Text',
'hidden': 1,
'idx': 7,
'label': 'Shared With',
'oldfieldname': 'shared_with',
'oldfieldtype': 'Text',
'permlevel': 0,
'reqd': 0,
'search_index': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'can_edit',
'fieldtype': 'Text',
'idx': 8,
'label': 'Can Edit',
'oldfieldname': 'can_edit',
'oldfieldtype': 'Text',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'can_view',
'fieldtype': 'Text',
'idx': 9,
'label': 'Can View',
'oldfieldname': 'can_view',
'oldfieldtype': 'Text',
'permlevel': 0
}
]

View file

@ -1,144 +0,0 @@
# DocType, File Group
[
# These values are common in all dictionaries
{
'creation': '2009-06-04 11:14:44',
'docstatus': 0,
'modified': '2010-09-20 14:06:57',
'modified_by': 'Administrator',
'owner': 'Administrator'
},
# These values are common for all DocType
{
'autoname': 'field:group_name',
'colour': 'White:FFF',
'doctype': 'DocType',
'document_type': 'Master',
'module': 'Core',
'name': '__common__',
'section_style': 'Simple',
'server_code_error': ' ',
'show_in_menu': 0,
'version': 2
},
# These values are common for all DocField
{
'doctype': 'DocField',
'name': '__common__',
'parent': 'File Group',
'parentfield': 'fields',
'parenttype': 'DocType',
'permlevel': 0
},
# These values are common for all DocPerm
{
'create': 1,
'doctype': 'DocPerm',
'idx': 1,
'name': '__common__',
'parent': 'File Group',
'parentfield': 'permissions',
'parenttype': 'DocType',
'permlevel': 0,
'read': 1,
'role': 'Administrator',
'write': 1
},
# DocType, File Group
{
'doctype': 'DocType',
'name': 'File Group'
},
# DocPerm
{
'doctype': 'DocPerm'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'group_name',
'fieldtype': 'Data',
'idx': 1,
'label': 'Group Name',
'oldfieldname': 'group_name',
'oldfieldtype': 'Data',
'reqd': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'parent_group',
'fieldtype': 'Link',
'idx': 2,
'label': 'Parent Group',
'oldfieldname': 'parent_group',
'oldfieldtype': 'Link',
'options': 'File Group'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'description',
'fieldtype': 'Text',
'idx': 3,
'label': 'Description',
'oldfieldname': 'description',
'oldfieldtype': 'Text',
'width': '300px'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'is_parent',
'fieldtype': 'Check',
'hidden': 1,
'idx': 4,
'label': 'Is Parent',
'oldfieldname': 'is_parent',
'oldfieldtype': 'Check'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'shared_with',
'fieldtype': 'Text',
'hidden': 1,
'idx': 5,
'label': 'Shared With',
'oldfieldname': 'shared_with',
'oldfieldtype': 'Text'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'can_edit',
'fieldtype': 'Text',
'idx': 6,
'label': 'Can Edit',
'oldfieldname': 'can_edit',
'oldfieldtype': 'Text'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'can_view',
'fieldtype': 'Text',
'idx': 7,
'label': 'Can View',
'oldfieldname': 'can_view',
'oldfieldtype': 'Text'
}
]

View file

@ -5,356 +5,367 @@
{
'creation': '2009-05-12 11:19:11',
'docstatus': 0,
'modified': '2011-05-18 11:09:50',
'modified_by': 'Administrator',
'owner': 'Administrator'
'modified': '2012-03-22 14:29:28',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
# These values are common for all DocType
{
'_last_update': '1307624201',
'colour': 'White:FFF',
'_last_update': u'1307624201',
'colour': u'White:FFF',
'default_print_format': u'Standard',
'doctype': 'DocType',
'module': 'Core',
'module': u'Core',
'name': '__common__',
'search_fields': 'criteria_name',
'section_style': 'Tabbed',
'server_code_error': ' ',
'search_fields': u'criteria_name',
'section_style': u'Tabbed',
'server_code_error': u' ',
'show_in_menu': 0,
'version': 4
'version': 5
},
# These values are common for all DocField
{
'doctype': 'DocField',
'doctype': u'DocField',
'name': '__common__',
'parent': 'Search Criteria',
'parentfield': 'fields',
'parenttype': 'DocType'
'parent': u'Search Criteria',
'parentfield': u'fields',
'parenttype': u'DocType'
},
# These values are common for all DocPerm
{
'doctype': 'DocPerm',
'doctype': u'DocPerm',
'name': '__common__',
'parent': 'Search Criteria',
'parentfield': 'permissions',
'parenttype': 'DocType',
'parent': u'Search Criteria',
'parentfield': u'permissions',
'parenttype': u'DocType',
'read': 1
},
# DocType, Search Criteria
{
'doctype': 'DocType',
'name': 'Search Criteria'
'name': u'Search Criteria'
},
# DocPerm
{
'create': 1,
'doctype': 'DocPerm',
'idx': 1,
'doctype': u'DocPerm',
'permlevel': 0,
'role': 'All',
'role': u'All',
'write': 1
},
# DocPerm
{
'doctype': 'DocPerm',
'idx': 2,
'doctype': u'DocPerm',
'permlevel': 1,
'role': 'All'
'role': u'All'
},
# DocPerm
{
'doctype': 'DocPerm',
'idx': 3,
'doctype': u'DocPerm',
'permlevel': 0,
'role': 'Administrator',
'role': u'Administrator',
'write': 1
},
# DocPerm
{
'doctype': 'DocPerm',
'idx': 4,
'doctype': u'DocPerm',
'permlevel': 1,
'role': 'Administrator'
'role': u'Administrator'
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'criteria_name',
'fieldtype': 'Data',
'doctype': u'DocField',
'fieldname': u'criteria_name',
'fieldtype': u'Data',
'hidden': 0,
'idx': 5,
'label': 'Criteria Name',
'oldfieldname': 'criteria_name',
'oldfieldtype': 'Data',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'disabled',
'fieldtype': 'Check',
'idx': 2,
'label': 'Disabled',
'oldfieldname': 'disabled',
'oldfieldtype': 'Check',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'module',
'fieldtype': 'Link',
'idx': 3,
'label': 'Module',
'oldfieldname': 'module',
'oldfieldtype': 'Link',
'options': 'Module Def',
'label': u'Criteria Name',
'no_copy': 0,
'oldfieldname': u'criteria_name',
'oldfieldtype': u'Data',
'permlevel': 0,
'reqd': 0
'search_index': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'standard',
'fieldtype': 'Select',
'idx': 4,
'label': 'Standard',
'oldfieldname': 'standard',
'oldfieldtype': 'Select',
'options': '\nYes\nNo',
'doctype': u'DocField',
'fieldname': u'disabled',
'fieldtype': u'Check',
'label': u'Disabled',
'no_copy': 0,
'oldfieldname': u'disabled',
'oldfieldtype': u'Check',
'permlevel': 0,
'search_index': 0
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'module',
'fieldtype': u'Link',
'label': u'Module',
'no_copy': 0,
'oldfieldname': u'module',
'oldfieldtype': u'Link',
'options': u'Module Def',
'permlevel': 0,
'reqd': 0,
'search_index': 0
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'standard',
'fieldtype': u'Select',
'label': u'Standard',
'no_copy': 0,
'oldfieldname': u'standard',
'oldfieldtype': u'Select',
'options': u'\nYes\nNo',
'permlevel': 0,
'reqd': 0,
'search_index': 1
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'doc_type',
'fieldtype': 'Data',
'doctype': u'DocField',
'fieldname': u'doc_type',
'fieldtype': u'Data',
'hidden': 1,
'idx': 8,
'label': 'Doc Type',
'oldfieldname': 'doc_type',
'oldfieldtype': 'Data',
'permlevel': 1
'label': u'Doc Type',
'no_copy': 0,
'oldfieldname': u'doc_type',
'oldfieldtype': u'Data',
'permlevel': 1,
'search_index': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'filters',
'fieldtype': 'Text',
'doctype': u'DocField',
'fieldname': u'filters',
'fieldtype': u'Text',
'hidden': 1,
'idx': 9,
'label': 'Filters',
'oldfieldname': 'filters',
'oldfieldtype': 'Text',
'permlevel': 0
'label': u'Filters',
'no_copy': 0,
'oldfieldname': u'filters',
'oldfieldtype': u'Text',
'permlevel': 0,
'search_index': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'columns',
'fieldtype': 'Text',
'doctype': u'DocField',
'fieldname': u'columns',
'fieldtype': u'Text',
'hidden': 1,
'idx': 10,
'label': 'Columns',
'oldfieldname': 'columns',
'oldfieldtype': 'Text',
'permlevel': 1
'label': u'Columns',
'no_copy': 0,
'oldfieldname': u'columns',
'oldfieldtype': u'Text',
'permlevel': 1,
'search_index': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'parent_doc_type',
'fieldtype': 'Data',
'doctype': u'DocField',
'fieldname': u'parent_doc_type',
'fieldtype': u'Data',
'hidden': 1,
'idx': 11,
'label': 'Parent Doc Type',
'oldfieldname': 'parent_doc_type',
'oldfieldtype': 'Data',
'permlevel': 1
'label': u'Parent Doc Type',
'no_copy': 0,
'oldfieldname': u'parent_doc_type',
'oldfieldtype': u'Data',
'permlevel': 1,
'search_index': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'add_cond',
'fieldtype': 'Text',
'doctype': u'DocField',
'fieldname': u'add_cond',
'fieldtype': u'Text',
'hidden': 0,
'idx': 12,
'label': 'Additional Conditions',
'oldfieldname': 'add_cond',
'oldfieldtype': 'Text',
'permlevel': 0
'label': u'Additional Conditions',
'no_copy': 0,
'oldfieldname': u'add_cond',
'oldfieldtype': u'Text',
'permlevel': 0,
'search_index': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'add_col',
'fieldtype': 'Text',
'doctype': u'DocField',
'fieldname': u'add_col',
'fieldtype': u'Text',
'hidden': 0,
'idx': 13,
'label': 'Additional Columns',
'oldfieldname': 'add_col',
'oldfieldtype': 'Text',
'permlevel': 0
'label': u'Additional Columns',
'no_copy': 0,
'oldfieldname': u'add_col',
'oldfieldtype': u'Text',
'permlevel': 0,
'search_index': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'add_tab',
'fieldtype': 'Text',
'doctype': u'DocField',
'fieldname': u'add_tab',
'fieldtype': u'Text',
'hidden': 0,
'idx': 14,
'label': 'Additional Tables',
'oldfieldname': 'add_tab',
'oldfieldtype': 'Text',
'permlevel': 0
'label': u'Additional Tables',
'no_copy': 0,
'oldfieldname': u'add_tab',
'oldfieldtype': u'Text',
'permlevel': 0,
'search_index': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'dis_filters',
'fieldtype': 'Text',
'doctype': u'DocField',
'fieldname': u'dis_filters',
'fieldtype': u'Text',
'hidden': 0,
'idx': 15,
'label': 'Disabled Filters',
'oldfieldname': 'dis_filters',
'oldfieldtype': 'Text',
'permlevel': 0
'label': u'Disabled Filters',
'no_copy': 0,
'oldfieldname': u'dis_filters',
'oldfieldtype': u'Text',
'permlevel': 0,
'search_index': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'group_by',
'fieldtype': 'Data',
'doctype': u'DocField',
'fieldname': u'group_by',
'fieldtype': u'Data',
'hidden': 0,
'idx': 16,
'label': 'Group By',
'oldfieldname': 'group_by',
'oldfieldtype': 'Data',
'label': u'Group By',
'no_copy': 0,
'oldfieldname': u'group_by',
'oldfieldtype': u'Data',
'permlevel': 0,
'search_index': 0
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'sort_by',
'fieldtype': u'Data',
'label': u'Sort By',
'no_copy': 0,
'oldfieldname': u'sort_by',
'oldfieldtype': u'Data',
'permlevel': 0,
'search_index': 0
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'sort_order',
'fieldtype': u'Data',
'label': u'Sort Order',
'no_copy': 0,
'oldfieldname': u'sort_order',
'oldfieldtype': u'Data',
'permlevel': 0,
'search_index': 0
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'page_len',
'fieldtype': u'Int',
'label': u'Page Len',
'no_copy': 0,
'oldfieldname': u'page_len',
'oldfieldtype': u'Int',
'permlevel': 0,
'search_index': 0
},
# DocField
{
'doctype': u'DocField',
'fieldtype': u'Section Break',
'label': u'Client Script',
'oldfieldtype': u'Section Break',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'sort_by',
'fieldtype': 'Data',
'idx': 19,
'label': 'Sort By',
'oldfieldname': 'sort_by',
'oldfieldtype': 'Data',
'doctype': u'DocField',
'fieldname': u'report_script',
'fieldtype': u'Code',
'label': u'Report Script',
'no_copy': 0,
'oldfieldname': u'report_script',
'oldfieldtype': u'Code',
'permlevel': 0,
'search_index': 0
},
# DocField
{
'doctype': u'DocField',
'fieldtype': u'Section Break',
'label': u'Server Script',
'oldfieldtype': u'Section Break',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'sort_order',
'fieldtype': 'Data',
'idx': 20,
'label': 'Sort Order',
'oldfieldname': 'sort_order',
'oldfieldtype': 'Data',
'doctype': u'DocField',
'fieldname': u'server_script',
'fieldtype': u'Code',
'label': u'Report Server Script',
'no_copy': 0,
'oldfieldname': u'server_script',
'oldfieldtype': u'Code',
'permlevel': 0,
'search_index': 0
},
# DocField
{
'doctype': u'DocField',
'fieldtype': u'Section Break',
'label': u'Overload Query',
'oldfieldtype': u'Section Break',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'page_len',
'fieldtype': 'Int',
'idx': 21,
'label': 'Page Len',
'oldfieldname': 'page_len',
'oldfieldtype': 'Int',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Section Break',
'idx': 22,
'label': 'Client Script',
'oldfieldtype': 'Section Break',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'report_script',
'fieldtype': 'Code',
'idx': 23,
'label': 'Report Script',
'oldfieldname': 'report_script',
'oldfieldtype': 'Code',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Section Break',
'idx': 24,
'label': 'Server Script',
'oldfieldtype': 'Section Break',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'server_script',
'fieldtype': 'Code',
'idx': 25,
'label': 'Report Server Script',
'oldfieldname': 'server_script',
'oldfieldtype': 'Code',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldtype': 'Section Break',
'idx': 26,
'label': 'Overload Query',
'oldfieldtype': 'Section Break',
'permlevel': 0
},
# DocField
{
'doctype': 'DocField',
'fieldname': 'custom_query',
'fieldtype': 'Code',
'idx': 27,
'label': 'Custom Query',
'oldfieldname': 'custom_query',
'oldfieldtype': 'Code',
'permlevel': 0
'doctype': u'DocField',
'fieldname': u'custom_query',
'fieldtype': u'Code',
'label': u'Custom Query',
'no_copy': 0,
'oldfieldname': u'custom_query',
'oldfieldtype': u'Code',
'permlevel': 0,
'search_index': 0
}
]

View file

@ -46,15 +46,20 @@ def diff_ref_file():
missing = property_diff = 0
property_count = {}
get_diff(webnotes.defs.modules_path)
get_diff(os.path.join(os.getcwd(), 'lib', 'py', 'core'))
for wt in os.walk(webnotes.defs.modules_path):
print_stats()
def get_diff(path):
for wt in os.walk(path):
for fname in wt[2]:
if fname.endswith('.txt'):
path = os.path.join(wt[0], fname)
with open(path, 'r') as txtfile:
doclist_diff(peval_doclist(txtfile.read()))
print_stats()
def diff_ref_db():
"""get diff using database as reference"""
@ -65,11 +70,16 @@ def diff_ref_db():
# get file for this doc
doc['doctype'] = dt
path = os.path.join(webnotes.defs.modules_path, scrub(doc['module']), \
scrub(dt), scrub(doc['name']), scrub(doc['name']) + '.txt')
path_core = os.path.join(os.getcwd(), 'lib', 'py', 'core', \
scrub(dt), scrub(doc['name']), scrub(doc['name']) + '.txt')
if os.path.exists(path):
with open(path, 'r') as txtfile:
target = peval_doclist(txtfile.read())
elif os.path.exists(path_core):
with open(path_core, 'r') as txtfile:
target = peval_doclist(txtfile.read())
else:
target = [None,]
@ -180,4 +190,4 @@ def print_stats():
print "Property mismatch: " + str(property_diff)
for key in property_count:
print "- " + key + ": " + str(property_count[key] or 0)
print
print