Fixed issie in auto notification
This commit is contained in:
parent
28b9551acf
commit
41cc32790f
@ -248,7 +248,8 @@ $import(Notification Control)
|
|||||||
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
|
||||||
var args = {
|
var args = {
|
||||||
type: 'Expense Voucher',
|
type: 'Expense Voucher',
|
||||||
doctype: 'Expense Voucher'
|
doctype: 'Expense Voucher',
|
||||||
|
send_to: doc.exp_approver
|
||||||
}
|
}
|
||||||
cur_frm.cscript.notify(doc, args);
|
cur_frm.cscript.notify(doc, args);
|
||||||
}
|
}
|
||||||
|
@ -98,8 +98,6 @@ class DocType:
|
|||||||
set(self.doc, 'remark', self.doc.remark)
|
set(self.doc, 'remark', self.doc.remark)
|
||||||
set(self.doc, 'approval_status', 'Rejected')
|
set(self.doc, 'approval_status', 'Rejected')
|
||||||
|
|
||||||
# on approval notification
|
|
||||||
#get_obj('Notification Control').notify_contact('Expense Voucher Rejected', self.doc.doctype, self.doc.name, self.doc.email_id, self.doc.employee_name)
|
|
||||||
|
|
||||||
return cstr('Rejected')
|
return cstr('Rejected')
|
||||||
|
|
||||||
@ -157,3 +155,8 @@ class DocType:
|
|||||||
|
|
||||||
def on_cancel(self):
|
def on_cancel(self):
|
||||||
set(self.doc, 'approval_status', 'Cancelled')
|
set(self.doc, 'approval_status', 'Cancelled')
|
||||||
|
|
||||||
|
|
||||||
|
def get_formatted_message(self, args):
|
||||||
|
""" get formatted message for auto notification"""
|
||||||
|
return get_obj('Notification Control').get_formatted_message(args)
|
||||||
|
@ -90,7 +90,8 @@ class DocType(TransactionBase):
|
|||||||
# -------------------------------------
|
# -------------------------------------
|
||||||
def get_comm_rate(self, sales_partner):
|
def get_comm_rate(self, sales_partner):
|
||||||
return get_obj('Sales Common').get_comm_rate(sales_partner, self)
|
return get_obj('Sales Common').get_comm_rate(sales_partner, self)
|
||||||
|
|
||||||
|
|
||||||
# Clear Sales Order Details Table
|
# Clear Sales Order Details Table
|
||||||
# --------------------------------
|
# --------------------------------
|
||||||
def clear_sales_order_details(self):
|
def clear_sales_order_details(self):
|
||||||
|
@ -23,7 +23,7 @@ from webnotes.model.code import get_obj
|
|||||||
from webnotes import msgprint
|
from webnotes import msgprint
|
||||||
|
|
||||||
sql = webnotes.conn.sql
|
sql = webnotes.conn.sql
|
||||||
|
|
||||||
# -----------------------------------------------------------------------------------------
|
# -----------------------------------------------------------------------------------------
|
||||||
# Notification control
|
# Notification control
|
||||||
class DocType:
|
class DocType:
|
||||||
|
@ -18,6 +18,7 @@ import webnotes
|
|||||||
from webnotes.utils import load_json, cint, cstr, flt, get_defaults
|
from webnotes.utils import load_json, cint, cstr, flt, get_defaults
|
||||||
from webnotes.model.doc import Document, addchild, removechild, getchildren
|
from webnotes.model.doc import Document, addchild, removechild, getchildren
|
||||||
from webnotes.model.doclist import getlist, copy_doclist
|
from webnotes.model.doclist import getlist, copy_doclist
|
||||||
|
from webnotes.model.code import get_obj
|
||||||
from webnotes import msgprint
|
from webnotes import msgprint
|
||||||
|
|
||||||
class TransactionBase:
|
class TransactionBase:
|
||||||
@ -225,3 +226,8 @@ class TransactionBase:
|
|||||||
ret = webnotes.conn.sql("select default_currency from tabCompany where name = '%s'" %(name))
|
ret = webnotes.conn.sql("select default_currency from tabCompany where name = '%s'" %(name))
|
||||||
dcc = ret and ret[0][0] or get_defaults()['currency']
|
dcc = ret and ret[0][0] or get_defaults()['currency']
|
||||||
return dcc
|
return dcc
|
||||||
|
|
||||||
|
|
||||||
|
def get_formatted_message(self, args):
|
||||||
|
""" get formatted message for auto notification"""
|
||||||
|
return get_obj('Notification Control').get_formatted_message(args)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user