diff --git a/accounts/doctype/journal_voucher/journal_voucher.js b/accounts/doctype/journal_voucher/journal_voucher.js index 9f82828e6de..80c46cab816 100644 --- a/accounts/doctype/journal_voucher/journal_voucher.js +++ b/accounts/doctype/journal_voucher/journal_voucher.js @@ -161,8 +161,10 @@ cur_frm.cscript.voucher_type = function(doc, cdt, cdn) { cur_frm.fields_dict['entries'].grid.get_field('account').get_query = function(doc) { return { - query: "accounts.utils.get_account_list", - filters: { company: doc.company } + filters: { + group_or_ledger: "Ledger", + company: doc.company + } } } diff --git a/hr/doctype/job_applicant/get_job_applications.py b/hr/doctype/job_applicant/get_job_applications.py index 4484bc50397..4737a6a81b5 100644 --- a/hr/doctype/job_applicant/get_job_applications.py +++ b/hr/doctype/job_applicant/get_job_applications.py @@ -23,11 +23,7 @@ from core.doctype.communication.communication import make class JobsMailbox(POP3Mailbox): def setup(self, args=None): self.settings = args or webnotes.doc("Jobs Email Settings", "Jobs Email Settings") - - def check_mails(self): - return webnotes.conn.sql("select user from tabSessions where \ - time_to_sec(timediff(now(), lastupdate)) < 1800") - + def process_message(self, mail): if mail.from_email == self.settings.email_id: return @@ -43,6 +39,7 @@ class JobsMailbox(POP3Mailbox): name = (mail.from_real_name and (mail.from_real_name + " - ") or "") \ + mail.from_email applicant = webnotes.model_wrapper({ + "creation": mail.date, "doctype":"Job Applicant", "applicant_name": name, "email_id": mail.from_email, diff --git a/selling/doctype/lead/get_leads.py b/selling/doctype/lead/get_leads.py index d1a4a3d4111..cda74129ddb 100644 --- a/selling/doctype/lead/get_leads.py +++ b/selling/doctype/lead/get_leads.py @@ -20,7 +20,8 @@ from webnotes.utils import cstr, cint from webnotes.utils.email_lib.receive import POP3Mailbox from core.doctype.communication.communication import make -def add_sales_communication(subject, content, sender, real_name, mail=None, status="Open"): +def add_sales_communication(subject, content, sender, real_name, mail=None, + status="Open", date=None): def set_status(doctype, name): w = webnotes.model_wrapper(doctype, name) w.ignore_permissions = True @@ -47,7 +48,7 @@ def add_sales_communication(subject, content, sender, real_name, mail=None, stat lead_name = lead.doc.name make(content=content, sender=sender, subject=subject, - lead=lead_name, contact=contact_name) + lead=lead_name, contact=contact_name, date=date) if contact_name: set_status("Contact", contact_name) @@ -58,17 +59,13 @@ def add_sales_communication(subject, content, sender, real_name, mail=None, stat class SalesMailbox(POP3Mailbox): def setup(self, args=None): self.settings = args or webnotes.doc("Sales Email Settings", "Sales Email Settings") - - def check_mails(self): - return webnotes.conn.sql("select user from tabSessions where \ - time_to_sec(timediff(now(), lastupdate)) < 1800") - + def process_message(self, mail): if mail.from_email == self.settings.email_id: return add_sales_communication(mail.subject, mail.content, mail.form_email, - mail.from_real_name, mail) + mail.from_real_name, mail=mail, date=mail.date) def get_leads(): if cint(webnotes.conn.get_value('Sales Email Settings', None, 'extract_emails')): diff --git a/support/doctype/support_ticket/get_support_mails.py b/support/doctype/support_ticket/get_support_mails.py index e0cbc0760a4..9e15236b3ee 100644 --- a/support/doctype/support_ticket/get_support_mails.py +++ b/support/doctype/support_ticket/get_support_mails.py @@ -30,12 +30,7 @@ class SupportMailbox(POP3Mailbox): "username": self.email_settings.support_username, "password": self.email_settings.support_password }) - - def check_mails(self): - self.auto_close_tickets() - return webnotes.conn.sql("select user from tabSessions where \ - time_to_sec(timediff(now(), lastupdate)) < 1800") - + def process_message(self, mail): if mail.from_email == self.email_settings.fields.get('support_email'): return @@ -66,7 +61,7 @@ class SupportMailbox(POP3Mailbox): make(content=mail.content, sender=mail.from_email, doctype="Support Ticket", name=ticket.doc.name, - lead = ticket.doc.lead, contact=ticket.doc.contact) + lead = ticket.doc.lead, contact=ticket.doc.contact, date=mail.date) def send_auto_reply(self, d): signature = self.email_settings.fields.get('support_signature') or ''