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