示例#1
0
    def _start_salesforce_cdr_order_to_cash_process(self, bucket_key, account,
                                                    subprocess):

        sp_id = subprocess.id
        account_id = account.account_id

        chain = download_and_parse_sdr_task.s(
            True, bucket_key, account_id, sp_id
        ) | get_customer_details_from_sf_task.s(sp_id) | create_order_task(
            sp_id) | generate_pdf_and_upload_task.s(sp_id) | send_email_task.s(
                sp_id) | charge_user_task.s(
                    sp_id) | create_order_summary_on_salesforce_task.s(sp_id)

        chain()
示例#2
0
    def _start_standalone_online_order_to_cash_process(self, order, line_items,
                                                       billing_address,
                                                       subprocess):

        sp_id = subprocess.id

        # Serializing data objects in order to remove no-serializable fields (database connections, etc)
        # Every argument passed to Celery tasks must be JSON serializable => python dict for example, objects are not Json serializable
        order_dict = order.to_dict()
        line_items_dict = [line_item.to_dict() for line_item in line_items]
        billing_address_dict = billing_address.to_dict()

        chain = rate_from_order_task.s(
            True, order_dict, line_items_dict, billing_address_dict, sp_id
        ) | generate_pdf_and_upload_task.s(sp_id) | send_invoice_email_task.s(
            sp_id) | charge_user_task.s(sp_id)

        chain()
    def _start_standalone_online_order_to_cash_process(self, order, line_items, billing_address, subprocess):

        sp_id = subprocess.id

        # Serializing data objects in order to remove no-serializable fields (database connections, etc)
        # Every argument passed to Celery tasks must be JSON serializable => python dict for example, objects are not Json serializable
        order_dict      = order.to_dict()
        line_items_dict = [line_item.to_dict() for line_item in line_items]
        billing_address_dict = billing_address.to_dict()

        chain = rate_from_order_task.s(True, order_dict, line_items_dict, billing_address_dict, sp_id) | generate_pdf_and_upload_task.s(sp_id) | send_invoice_email_task.s(sp_id) | charge_user_task.s(sp_id)

        chain()
    def _start_salesforce_cdr_order_to_cash_process(self, bucket_key, account, subprocess):
        
        sp_id      = subprocess.id
        account_id = account.account_id
        
        chain = download_and_parse_sdr_task.s(True, bucket_key, account_id, sp_id) | get_customer_details_from_sf_task.s(sp_id) | create_order_task(sp_id) | generate_pdf_and_upload_task.s(sp_id) | send_email_task.s(sp_id) | charge_user_task.s(sp_id) | create_order_summary_on_salesforce_task.s(sp_id)

        chain()