added validate posting time method

This commit is contained in:
Anand Doshi 2013-03-13 12:58:54 +05:30
parent 71bed3116f
commit ee3d5cc621

View File

@ -16,7 +16,7 @@
from __future__ import unicode_literals
import webnotes
from webnotes.utils import load_json, cstr, flt
from webnotes.utils import load_json, cstr, flt, now_datetime
from webnotes.model.doc import addchild
from webnotes.model.controller import DocListController
@ -246,4 +246,8 @@ class TransactionBase(DocListController):
[d.update({"doctype":"Communication"}) for d in comm_list]
self.doclist.extend(webnotes.doclist([webnotes.doc(fielddata=d) \
for d in comm_list]))
for d in comm_list]))
def validate_posting_time(self):
if not self.doc.posting_time:
self.doc.posting_time = now_datetime().strftime('%H:%M:%S')