Removed print format option. Instead show html code.
This commit is contained in:
parent
393f5e6078
commit
adf2f777d3
@ -1,6 +1,6 @@
|
||||
cur_frm.cscript.refresh = function(doc, dt, dn) {
|
||||
cur_frm.add_custom_button('Execute Now', function() {
|
||||
$c_obj(make_doclist(dt, dn), 'get_standard_data', '', function(r, rt) {
|
||||
$c_obj(make_doclist(dt, dn), 'get', '', function(r, rt) {
|
||||
if(r.exc) {
|
||||
msgprint(r.exc);
|
||||
} else {
|
||||
|
@ -109,18 +109,19 @@ class DocType:
|
||||
|
||||
for query in query_dict.keys():
|
||||
if self.doc.fields[query]:
|
||||
webnotes.msgprint(query)
|
||||
res = webnotes.conn.sql(query_dict[query], as_dict=1, debug=1)
|
||||
#webnotes.msgprint(query)
|
||||
res = webnotes.conn.sql(query_dict[query], as_dict=1)
|
||||
if query == 'income':
|
||||
for r in res:
|
||||
r['value'] = float(r['credit'] - r['debit'])
|
||||
elif query in ['expenses_booked', 'bank_balance']:
|
||||
for r in res:
|
||||
r['value'] = float(r['debit'] - r['credit'])
|
||||
webnotes.msgprint(query)
|
||||
webnotes.msgprint(res)
|
||||
#webnotes.msgprint(query)
|
||||
#webnotes.msgprint(res)
|
||||
result[query] = (res and res[0]) and res[0] or None
|
||||
|
||||
#webnotes.msgprint(result)
|
||||
return result
|
||||
|
||||
|
||||
@ -280,7 +281,9 @@ class DocType:
|
||||
* Execute Query
|
||||
* Prepare Email Body from Print Format
|
||||
"""
|
||||
pass
|
||||
result = self.execute_queries()
|
||||
webnotes.msgprint(result)
|
||||
return result
|
||||
|
||||
|
||||
def execute_queries(self):
|
||||
@ -288,6 +291,21 @@ class DocType:
|
||||
* If standard==1, execute get_standard_data
|
||||
* If standard==0, execute python code in custom_code field
|
||||
"""
|
||||
result = {}
|
||||
if self.doc.use_standard==1:
|
||||
result = self.get_standard_data()
|
||||
else:
|
||||
result = self.execute_custom_code()
|
||||
|
||||
#webnotes.msgprint(result)
|
||||
|
||||
return result
|
||||
|
||||
|
||||
def execute_custom_code(self):
|
||||
"""
|
||||
Execute custom python code
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
|
@ -5,14 +5,14 @@
|
||||
{
|
||||
'creation': '2011-11-28 13:11:56',
|
||||
'docstatus': 0,
|
||||
'modified': '2011-12-02 18:55:47',
|
||||
'modified': '2011-12-05 11:55:31',
|
||||
'modified_by': 'Administrator',
|
||||
'owner': 'Administrator'
|
||||
},
|
||||
|
||||
# These values are common for all DocType
|
||||
{
|
||||
'_last_update': '1322829965',
|
||||
'_last_update': '1323066269',
|
||||
'autoname': 'Prompt',
|
||||
'colour': 'White:FFF',
|
||||
'doctype': 'DocType',
|
||||
@ -21,7 +21,7 @@
|
||||
'name': '__common__',
|
||||
'section_style': 'Simple',
|
||||
'show_in_menu': 0,
|
||||
'version': 47
|
||||
'version': 51
|
||||
},
|
||||
|
||||
# These values are common for all DocField
|
||||
@ -132,16 +132,6 @@
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'print_format',
|
||||
'fieldtype': 'Select',
|
||||
'label': 'Email Template',
|
||||
'options': "link:Print Format\ndoc_type='Email Digest'",
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
@ -279,6 +269,7 @@
|
||||
|
||||
# DocField
|
||||
{
|
||||
'depends_on': 'eval:doc.use_standard',
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'new_sales_orders',
|
||||
'fieldtype': 'Check',
|
||||
@ -318,13 +309,21 @@
|
||||
|
||||
# DocField
|
||||
{
|
||||
'depends_on': 'eval:!doc.use_standard',
|
||||
'doctype': 'DocField',
|
||||
'fieldtype': 'Section Break',
|
||||
'label': 'Enter Custom Code',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'doctype': 'DocField',
|
||||
'fieldname': 'email_template',
|
||||
'fieldtype': 'Code',
|
||||
'label': 'Email Template',
|
||||
'permlevel': 0
|
||||
},
|
||||
|
||||
# DocField
|
||||
{
|
||||
'default': '\n',
|
||||
|
Loading…
x
Reference in New Issue
Block a user