mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-05 06:28:29 +00:00
Merge branch 'master' of github.com:webnotes/erpnext into responsive
Conflicts: patches/patch_list.py projects/doctype/project/project.py utilities/transaction_base.py
This commit is contained in:
@@ -270,6 +270,41 @@ class TransactionBase(StatusUpdater):
|
||||
def validate_posting_time(self):
|
||||
if not self.doc.posting_time:
|
||||
self.doc.posting_time = now_datetime().strftime('%H:%M:%S')
|
||||
|
||||
def add_calendar_event(self, opts):
|
||||
if self.doc.contact_by != cstr(self._prev.contact_by) or \
|
||||
self.doc.contact_date != cstr(self._prev.contact_date):
|
||||
|
||||
self.delete_events()
|
||||
self._add_calendar_event(opts)
|
||||
|
||||
def delete_events(self):
|
||||
webnotes.delete_doc("Event", webnotes.conn.sql_list("""select name from `tabEvent`
|
||||
where ref_type=%s and ref_name=%s""", (self.doc.doctype, self.doc.name)))
|
||||
|
||||
def _add_calendar_event(self, opts):
|
||||
opts = webnotes._dict(opts)
|
||||
|
||||
if self.doc.contact_date:
|
||||
event_doclist = [{
|
||||
"doctype": "Event",
|
||||
"owner": opts.owner or self.doc.owner,
|
||||
"subject": opts.subject,
|
||||
"description": opts.description,
|
||||
"starts_on": self.doc.contact_date + " 10:00:00",
|
||||
"event_type": "Private",
|
||||
"ref_type": self.doc.doctype,
|
||||
"ref_name": self.doc.name
|
||||
}]
|
||||
|
||||
if webnotes.conn.exists("Profile", self.doc.contact_by):
|
||||
event_doclist.append({
|
||||
"doctype": "Event User",
|
||||
"parentfield": "event_individuals",
|
||||
"person": self.doc.contact_by
|
||||
})
|
||||
|
||||
webnotes.bean(event_doclist).insert()
|
||||
|
||||
def validate_conversion_rate(currency, conversion_rate, conversion_rate_label, company):
|
||||
"""common validation for currency and price list currency"""
|
||||
@@ -323,5 +358,4 @@ def validate_currency(args, item, meta=None):
|
||||
args.plc_conversion_rate = flt(args.plc_conversion_rate,
|
||||
get_field_precision(meta.get_field("plc_conversion_rate"),
|
||||
webnotes._dict({"fields": args})))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user