ERPGulf / whatsapp_saudi

Frappe ERPNext Integration with Saudi.support whatsapp
MIT License
0 stars 1 forks source link

Not sending whatsapp message on "SAVE" #1

Closed fkalpana closed 11 months ago

fkalpana commented 11 months ago

If notification setting configured for sending whatsapp message for SAVE, message not sending.

Error. Traceback with variables (most recent call last): File "apps/frappe/frappe/utils/background_jobs.py", line 194, in execute_job retval = method(kwargs) site = 'test.erpgulf.com' method = <bound method ERPGulfNotification.send_whatsapp_with_pdf of > event = None job_name = '<bound method ERPGulfNotification.send_whatsapp_with_pdf of >' kwargs = {'doc': , 'context': {'doc': , 'alert': , 'comments': None}} user = 'Administrator' is_async = True retry = 0 retval = None method_name = 'send_whatsapp_with_pdf' before_job_task = 'frappe.monitor.start' File "apps/whatsapp_saudi/whatsapp_saudi/overrides/whtatsapp_notification.py", line 25, in send_whatsapp_with_pdf memory_url=self.create_pdf(doc) self = doc = context = {'doc': , 'alert': , 'comments': None} File "apps/whatsapp_saudi/whatsapp_saudi/overrides/whtatsapp_notification.py", line 15, in create_pdf file = frappe.get_print(doc.doctype, doc.name, self.print_format, as_pdf=True) self = doc = File "apps/frappe/frappe/init.py", line 2051, in get_print html = get_response_content("printview") doctype = 'Purchase Order' name = 'PUR-ORD-2023-00005' print_format = 'Purchasing Order' style = None html = None as_pdf = True doc = None output = None no_letterhead = 0 password = ** pdf_options = {} letterhead = None get_pdf = <function get_pdf at 0x7f4720848940> get_response_content = <function get_response_content at 0x7f4720ef7910> File "apps/frappe/frappe/website/serve.py", line 32, in get_response_content response = get_response(path, http_status_code) path = 'printview' http_status_code = 200 File "apps/frappe/frappe/website/serve.py", line 22, in get_response response = NotPermittedPage(endpoint, http_status_code, exception=e).render() path = 'printview' http_status_code = 200 response = None endpoint = 'printview' path_resolver = <frappe.website.path_resolver.PathResolver object at 0x7f472405d000> renderer_instance = <frappe.website.page_renderers.template_page.TemplatePage object at 0x7f4720617760> File "apps/frappe/frappe/website/page_renderers/not_permitted_page.py", line 17, in render action = f"/login?redirect-to={frappe.request.path}" self = <frappe.website.page_renderers.not_permitted_page.NotPermittedPage object at 0x7f47202ce290> class = <class 'frappe.website.page_renderers.not_permitted_page.NotPermittedPage'> File "env/lib/python3.10/site-packages/werkzeug/local.py", line 316, in get obj = instance._get_current_object() # type: ignore[misc] self = proxy getattr instance = owner = <class 'werkzeug.local.LocalProxy'> File "env/lib/python3.10/site-packages/werkzeug/local.py", line 495, in _get_current_object raise RuntimeError(unbound_message) from None get_name = operator.attrgetter('request') local = <werkzeug.local.Local object at 0x7f47251d9d20> unbound_message = 'object is not bound' builtins.RuntimeError: object is not bound

fkalpana commented 11 months ago

if you want to send whatsaspp message with PDF while saving, You need to allow printing on Draft . See the attachment

Screenshot 2023-12-06 at 11 16 52 AM