mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-19 21:19:19 +00:00
Merge branch 'version-13-hotfix' into backport/version-13-hotfix/27143
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe.data_migration.doctype.data_migration_connector.connectors.base import BaseConnection
|
||||
from github import Github
|
||||
|
||||
|
||||
class GithubConnection(BaseConnection):
|
||||
def __init__(self, connector):
|
||||
self.connector = connector
|
||||
|
||||
@@ -1,14 +1,26 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import json
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
import json
|
||||
from frappe.utils import cstr, cint, nowdate, getdate, flt, get_request_session, get_datetime
|
||||
from frappe.utils import cint, cstr, flt, get_datetime, get_request_session, getdate, nowdate
|
||||
|
||||
from erpnext.erpnext_integrations.doctype.shopify_log.shopify_log import (
|
||||
dump_request_data,
|
||||
make_shopify_log,
|
||||
)
|
||||
from erpnext.erpnext_integrations.doctype.shopify_settings.shopify_settings import (
|
||||
get_header,
|
||||
get_shopify_url,
|
||||
)
|
||||
from erpnext.erpnext_integrations.doctype.shopify_settings.sync_customer import create_customer
|
||||
from erpnext.erpnext_integrations.doctype.shopify_settings.sync_product import (
|
||||
sync_item_from_shopify,
|
||||
)
|
||||
from erpnext.erpnext_integrations.utils import validate_webhooks_request
|
||||
from erpnext.selling.doctype.sales_order.sales_order import make_delivery_note, make_sales_invoice
|
||||
from erpnext.erpnext_integrations.doctype.shopify_settings.sync_product import sync_item_from_shopify
|
||||
from erpnext.erpnext_integrations.doctype.shopify_settings.sync_customer import create_customer
|
||||
from erpnext.erpnext_integrations.doctype.shopify_log.shopify_log import make_shopify_log, dump_request_data
|
||||
from erpnext.erpnext_integrations.doctype.shopify_settings.shopify_settings import get_shopify_url, get_header
|
||||
|
||||
|
||||
@frappe.whitelist(allow_guest=True)
|
||||
@validate_webhooks_request("Shopify Settings", 'X-Shopify-Hmac-Sha256', secret_key='shared_secret')
|
||||
|
||||
@@ -1,8 +1,15 @@
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe, base64, hashlib, hmac, json
|
||||
from frappe.utils import cstr
|
||||
|
||||
import base64
|
||||
import hashlib
|
||||
import hmac
|
||||
import json
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.utils import cstr
|
||||
|
||||
|
||||
def verify_request():
|
||||
woocommerce_settings = frappe.get_doc("Woocommerce Settings")
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
|
||||
|
||||
def pre_process(issue):
|
||||
|
||||
project = frappe.db.get_value('Project', filters={'project_name': issue.milestone})
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
|
||||
def pre_process(milestone):
|
||||
return {
|
||||
'title': milestone.title,
|
||||
|
||||
@@ -3,10 +3,18 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe, time, dateutil, math, csv
|
||||
from six import StringIO
|
||||
import erpnext.erpnext_integrations.doctype.amazon_mws_settings.amazon_mws_api as mws
|
||||
|
||||
import csv
|
||||
import math
|
||||
import time
|
||||
|
||||
import dateutil
|
||||
import frappe
|
||||
from frappe import _
|
||||
from six import StringIO
|
||||
|
||||
import erpnext.erpnext_integrations.doctype.amazon_mws_settings.amazon_mws_api as mws
|
||||
|
||||
|
||||
#Get and Create Products
|
||||
def get_products_details():
|
||||
@@ -143,7 +151,6 @@ def create_item_code(amazon_item_json, sku):
|
||||
item.description = amazon_item_json.Product.AttributeSets.ItemAttributes.Title
|
||||
item.brand = new_brand
|
||||
item.manufacturer = new_manufacturer
|
||||
item.web_long_description = amazon_item_json.Product.AttributeSets.ItemAttributes.Title
|
||||
|
||||
item.image = amazon_item_json.Product.AttributeSets.ItemAttributes.SmallImage.URL
|
||||
|
||||
|
||||
@@ -6,24 +6,24 @@
|
||||
# Extended to include finances object
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import urllib
|
||||
from urllib.parse import quote
|
||||
import base64
|
||||
import hashlib
|
||||
import hmac
|
||||
import base64
|
||||
import six
|
||||
from erpnext.erpnext_integrations.doctype.amazon_mws_settings import xml_utils
|
||||
import re
|
||||
from urllib.parse import quote
|
||||
|
||||
from erpnext.erpnext_integrations.doctype.amazon_mws_settings import xml_utils
|
||||
|
||||
try:
|
||||
from xml.etree.ElementTree import ParseError as XMLError
|
||||
except ImportError:
|
||||
from xml.parsers.expat import ExpatError as XMLError
|
||||
from time import strftime, gmtime
|
||||
|
||||
from time import gmtime, strftime
|
||||
|
||||
from requests import request
|
||||
from requests.exceptions import HTTPError
|
||||
|
||||
|
||||
__all__ = [
|
||||
'Feeds',
|
||||
'Inventory',
|
||||
|
||||
@@ -3,12 +3,15 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
import dateutil
|
||||
import frappe
|
||||
from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
|
||||
from frappe.model.document import Document
|
||||
|
||||
from erpnext.erpnext_integrations.doctype.amazon_mws_settings.amazon_methods import get_orders
|
||||
|
||||
|
||||
class AmazonMWSSettings(Document):
|
||||
def validate(self):
|
||||
if self.enable_amazon == 1:
|
||||
|
||||
@@ -5,5 +5,6 @@ from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestAmazonMWSSettings(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -8,8 +8,8 @@ Borrowed from https://github.com/timotheus/ebaysdk-python
|
||||
"""
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import xml.etree.ElementTree as ET
|
||||
import re
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
|
||||
class object_dict(dict):
|
||||
@@ -88,7 +88,7 @@ class xml2dict(object):
|
||||
ns = http://cs.sfsu.edu/csc867/myscheduler
|
||||
name = patients
|
||||
"""
|
||||
result = re.compile("\{(.*)\}(.*)").search(tag)
|
||||
result = re.compile(r"\{(.*)\}(.*)").search(tag)
|
||||
if result:
|
||||
value.namespace, tag = result.groups()
|
||||
|
||||
|
||||
@@ -3,10 +3,12 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
from frappe.model.document import Document
|
||||
import requests
|
||||
|
||||
import frappe
|
||||
import requests
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class ExotelSettings(Document):
|
||||
def validate(self):
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class GoCardlessMandate(Document):
|
||||
pass
|
||||
|
||||
@@ -5,5 +5,6 @@ from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestGoCardlessMandate(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,10 +3,13 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
import json
|
||||
import hmac
|
||||
|
||||
import hashlib
|
||||
import hmac
|
||||
import json
|
||||
|
||||
import frappe
|
||||
|
||||
|
||||
@frappe.whitelist(allow_guest=True)
|
||||
def webhooks():
|
||||
|
||||
@@ -3,13 +3,15 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
import gocardless_pro
|
||||
from frappe import _
|
||||
from frappe.integrations.utils import create_payment_gateway, create_request_log
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import call_hook_method, cint, flt, get_url
|
||||
from six.moves.urllib.parse import urlencode
|
||||
from frappe.utils import get_url, call_hook_method, flt, cint
|
||||
from frappe.integrations.utils import create_request_log, create_payment_gateway
|
||||
|
||||
|
||||
class GoCardlessSettings(Document):
|
||||
supported_currencies = ["EUR", "DKK", "GBP", "SEK"]
|
||||
|
||||
@@ -5,5 +5,6 @@ from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestGoCardlessSettings(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import base64
|
||||
import datetime
|
||||
|
||||
import requests
|
||||
from requests.auth import HTTPBasicAuth
|
||||
import datetime
|
||||
|
||||
|
||||
class MpesaConnector():
|
||||
def __init__(self, env="sandbox", app_key=None, app_secret=None, sandbox_url="https://sandbox.safaricom.co.ke",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import frappe
|
||||
from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
|
||||
|
||||
|
||||
def create_custom_pos_fields():
|
||||
"""Create custom fields corresponding to POS Settings and POS Invoice."""
|
||||
pos_field = {
|
||||
|
||||
@@ -4,17 +4,21 @@
|
||||
|
||||
|
||||
from __future__ import unicode_literals
|
||||
from json import loads, dumps
|
||||
|
||||
from json import dumps, loads
|
||||
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
from frappe import _
|
||||
from frappe.utils import call_hook_method, fmt_money
|
||||
from frappe.integrations.utils import create_request_log, create_payment_gateway
|
||||
from frappe.utils import get_request_site_address
|
||||
from erpnext.erpnext_integrations.utils import create_mode_of_payment
|
||||
from frappe.integrations.utils import create_payment_gateway, create_request_log
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import call_hook_method, fmt_money, get_request_site_address
|
||||
|
||||
from erpnext.erpnext_integrations.doctype.mpesa_settings.mpesa_connector import MpesaConnector
|
||||
from erpnext.erpnext_integrations.doctype.mpesa_settings.mpesa_custom_fields import create_custom_pos_fields
|
||||
from erpnext.erpnext_integrations.doctype.mpesa_settings.mpesa_custom_fields import (
|
||||
create_custom_pos_fields,
|
||||
)
|
||||
from erpnext.erpnext_integrations.utils import create_mode_of_payment
|
||||
|
||||
|
||||
class MpesaSettings(Document):
|
||||
supported_currencies = ["KES"]
|
||||
@@ -39,7 +43,9 @@ class MpesaSettings(Document):
|
||||
for i, amount in enumerate(request_amounts):
|
||||
args.request_amount = amount
|
||||
if frappe.flags.in_test:
|
||||
from erpnext.erpnext_integrations.doctype.mpesa_settings.test_mpesa_settings import get_payment_request_response_payload
|
||||
from erpnext.erpnext_integrations.doctype.mpesa_settings.test_mpesa_settings import (
|
||||
get_payment_request_response_payload,
|
||||
)
|
||||
response = frappe._dict(get_payment_request_response_payload(amount))
|
||||
else:
|
||||
response = frappe._dict(generate_stk_push(**args))
|
||||
@@ -71,7 +77,9 @@ class MpesaSettings(Document):
|
||||
)
|
||||
|
||||
if frappe.flags.in_test:
|
||||
from erpnext.erpnext_integrations.doctype.mpesa_settings.test_mpesa_settings import get_test_account_balance_response
|
||||
from erpnext.erpnext_integrations.doctype.mpesa_settings.test_mpesa_settings import (
|
||||
get_test_account_balance_response,
|
||||
)
|
||||
response = frappe._dict(get_test_account_balance_response())
|
||||
else:
|
||||
response = frappe._dict(get_account_balance(payload))
|
||||
|
||||
@@ -2,13 +2,20 @@
|
||||
# Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
from json import dumps
|
||||
import frappe
|
||||
|
||||
import unittest
|
||||
from erpnext.erpnext_integrations.doctype.mpesa_settings.mpesa_settings import process_balance_info, verify_transaction
|
||||
from json import dumps
|
||||
|
||||
import frappe
|
||||
|
||||
from erpnext.accounts.doctype.pos_invoice.test_pos_invoice import create_pos_invoice
|
||||
from erpnext.erpnext_integrations.doctype.mpesa_settings.mpesa_settings import (
|
||||
process_balance_info,
|
||||
verify_transaction,
|
||||
)
|
||||
from erpnext.erpnext_integrations.utils import create_mode_of_payment
|
||||
|
||||
|
||||
class TestMpesaSettings(unittest.TestCase):
|
||||
def setUp(self):
|
||||
# create payment gateway in setup
|
||||
|
||||
@@ -2,12 +2,11 @@
|
||||
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
import frappe
|
||||
import plaid
|
||||
import requests
|
||||
from plaid.errors import APIError, ItemError, InvalidRequestError
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from plaid.errors import APIError, InvalidRequestError, ItemError
|
||||
|
||||
|
||||
class PlaidConnector():
|
||||
|
||||
@@ -5,15 +5,16 @@
|
||||
import json
|
||||
|
||||
import frappe
|
||||
from erpnext.accounts.doctype.journal_entry.journal_entry import get_default_bank_cash_account
|
||||
from erpnext.erpnext_integrations.doctype.plaid_settings.plaid_connector import PlaidConnector
|
||||
from frappe import _
|
||||
from frappe.desk.doctype.tag.tag import add_tag
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import add_months, formatdate, getdate, today
|
||||
|
||||
from plaid.errors import ItemError
|
||||
|
||||
from erpnext.accounts.doctype.journal_entry.journal_entry import get_default_bank_cash_account
|
||||
from erpnext.erpnext_integrations.doctype.plaid_settings.plaid_connector import PlaidConnector
|
||||
|
||||
|
||||
class PlaidSettings(Document):
|
||||
@staticmethod
|
||||
@frappe.whitelist()
|
||||
|
||||
@@ -6,11 +6,16 @@ import json
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
from frappe.utils.response import json_handler
|
||||
|
||||
from erpnext.accounts.doctype.journal_entry.journal_entry import get_default_bank_cash_account
|
||||
from erpnext.erpnext_integrations.doctype.plaid_settings.plaid_settings import (
|
||||
add_account_subtype, add_account_type, add_bank_accounts,
|
||||
new_bank_transaction, get_plaid_configuration)
|
||||
from frappe.utils.response import json_handler
|
||||
add_account_subtype,
|
||||
add_account_type,
|
||||
add_bank_accounts,
|
||||
get_plaid_configuration,
|
||||
new_bank_transaction,
|
||||
)
|
||||
|
||||
|
||||
class TestPlaidSettings(unittest.TestCase):
|
||||
|
||||
@@ -3,15 +3,19 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import json
|
||||
import traceback
|
||||
|
||||
import frappe
|
||||
import requests
|
||||
from frappe import _
|
||||
from frappe.model.document import Document
|
||||
from requests_oauthlib import OAuth2Session
|
||||
import json
|
||||
import requests
|
||||
import traceback
|
||||
|
||||
from erpnext import encode_company_abbr
|
||||
|
||||
|
||||
# QuickBooks requires a redirect URL, User will be redirect to this URL
|
||||
# This will be a GET request
|
||||
# Request parameters will have two parameters `code` and `realmId`
|
||||
@@ -253,8 +257,9 @@ class QuickBooksMigrator(Document):
|
||||
try:
|
||||
# Assumes that exactly one fiscal year has been created so far
|
||||
# Creates fiscal years till oldest ledger entry date is covered
|
||||
from frappe.utils.data import add_years, getdate
|
||||
from itertools import chain
|
||||
|
||||
from frappe.utils.data import add_years, getdate
|
||||
smallest_ledger_entry_date = getdate(min(entry["date"] for entry in chain(*self.gl_entries.values()) if entry["date"]))
|
||||
oldest_fiscal_year = frappe.get_all("Fiscal Year",
|
||||
fields=["year_start_date", "year_end_date"],
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestQuickBooksMigrator(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,11 +3,15 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
import json
|
||||
|
||||
import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
from erpnext.erpnext_integrations.utils import get_webhook_address
|
||||
|
||||
|
||||
class ShopifyLog(Document):
|
||||
pass
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
# test_records = frappe.get_test_records('Shopify Log')
|
||||
|
||||
@@ -3,15 +3,19 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
import json
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils import get_request_session
|
||||
from requests.exceptions import HTTPError
|
||||
from frappe.custom.doctype.custom_field.custom_field import create_custom_fields
|
||||
from erpnext.erpnext_integrations.utils import get_webhook_address
|
||||
|
||||
from erpnext.erpnext_integrations.doctype.shopify_log.shopify_log import make_shopify_log
|
||||
from erpnext.erpnext_integrations.utils import get_webhook_address
|
||||
|
||||
|
||||
class ShopifySettings(Document):
|
||||
def validate(self):
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
|
||||
|
||||
def create_customer(shopify_customer, shopify_settings):
|
||||
import frappe.utils.nestedset
|
||||
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.utils import cint, cstr, get_request_session
|
||||
|
||||
from erpnext import get_default_company
|
||||
from frappe.utils import cstr, cint, get_request_session
|
||||
from erpnext.erpnext_integrations.doctype.shopify_settings.shopify_settings import get_shopify_url, get_header
|
||||
from erpnext.erpnext_integrations.doctype.shopify_settings.shopify_settings import (
|
||||
get_header,
|
||||
get_shopify_url,
|
||||
)
|
||||
|
||||
shopify_variants_attr_list = ["option1", "option2", "option3"]
|
||||
|
||||
|
||||
@@ -2,14 +2,18 @@
|
||||
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
import unittest, os, json
|
||||
from frappe.utils import cstr, cint
|
||||
from erpnext.erpnext_integrations.connectors.shopify_connection import create_order
|
||||
from erpnext.erpnext_integrations.doctype.shopify_settings.sync_product import make_item
|
||||
from erpnext.erpnext_integrations.doctype.shopify_settings.sync_customer import create_customer
|
||||
import json
|
||||
import os
|
||||
import unittest
|
||||
|
||||
import frappe
|
||||
from frappe.core.doctype.data_import.data_import import import_doc
|
||||
from frappe.utils import cint, cstr
|
||||
|
||||
from erpnext.erpnext_integrations.connectors.shopify_connection import create_order
|
||||
from erpnext.erpnext_integrations.doctype.shopify_settings.sync_customer import create_customer
|
||||
from erpnext.erpnext_integrations.doctype.shopify_settings.sync_product import make_item
|
||||
|
||||
|
||||
class ShopifySettings(unittest.TestCase):
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class ShopifyTaxAccount(Document):
|
||||
pass
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
import frappe
|
||||
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class ShopifyWebhookDetail(Document):
|
||||
pass
|
||||
|
||||
@@ -11,19 +11,19 @@ import traceback
|
||||
import zipfile
|
||||
from decimal import Decimal
|
||||
|
||||
from bs4 import BeautifulSoup as bs
|
||||
|
||||
import frappe
|
||||
from erpnext import encode_company_abbr
|
||||
from erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts import create_charts
|
||||
from erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer import unset_existing_data
|
||||
|
||||
from bs4 import BeautifulSoup as bs
|
||||
from frappe import _
|
||||
from frappe.custom.doctype.custom_field.custom_field import create_custom_field
|
||||
from frappe.model.document import Document
|
||||
from frappe.model.naming import getseries, revert_series_if_last
|
||||
from frappe.utils.data import format_datetime
|
||||
|
||||
from erpnext import encode_company_abbr
|
||||
from erpnext.accounts.doctype.account.chart_of_accounts.chart_of_accounts import create_charts
|
||||
from erpnext.accounts.doctype.chart_of_accounts_importer.chart_of_accounts_importer import (
|
||||
unset_existing_data,
|
||||
)
|
||||
|
||||
PRIMARY_ACCOUNT = "Primary"
|
||||
VOUCHER_CHUNK_SIZE = 500
|
||||
|
||||
@@ -266,7 +266,7 @@ class TallyMigration(Document):
|
||||
|
||||
self.is_master_data_processed = 1
|
||||
|
||||
except:
|
||||
except Exception:
|
||||
self.publish("Process Master Data", _("Process Failed"), -1, 5)
|
||||
self.log()
|
||||
|
||||
@@ -302,14 +302,14 @@ class TallyMigration(Document):
|
||||
try:
|
||||
party_doc = frappe.get_doc(party)
|
||||
party_doc.insert()
|
||||
except:
|
||||
except Exception:
|
||||
self.log(party_doc)
|
||||
addresses_file = frappe.get_doc("File", {"file_url": addresses_file_url})
|
||||
for address in json.loads(addresses_file.get_content()):
|
||||
try:
|
||||
address_doc = frappe.get_doc(address)
|
||||
address_doc.insert(ignore_mandatory=True)
|
||||
except:
|
||||
except Exception:
|
||||
self.log(address_doc)
|
||||
|
||||
def create_items_uoms(items_file_url, uoms_file_url):
|
||||
@@ -319,7 +319,7 @@ class TallyMigration(Document):
|
||||
try:
|
||||
uom_doc = frappe.get_doc(uom)
|
||||
uom_doc.insert()
|
||||
except:
|
||||
except Exception:
|
||||
self.log(uom_doc)
|
||||
|
||||
items_file = frappe.get_doc("File", {"file_url": items_file_url})
|
||||
@@ -327,7 +327,7 @@ class TallyMigration(Document):
|
||||
try:
|
||||
item_doc = frappe.get_doc(item)
|
||||
item_doc.insert()
|
||||
except:
|
||||
except Exception:
|
||||
self.log(item_doc)
|
||||
|
||||
try:
|
||||
@@ -346,7 +346,7 @@ class TallyMigration(Document):
|
||||
self.is_master_data_imported = 1
|
||||
frappe.db.commit()
|
||||
|
||||
except:
|
||||
except Exception:
|
||||
self.publish("Import Master Data", _("Process Failed"), -1, 5)
|
||||
frappe.db.rollback()
|
||||
self.log()
|
||||
@@ -370,7 +370,7 @@ class TallyMigration(Document):
|
||||
if processed_voucher:
|
||||
vouchers.append(processed_voucher)
|
||||
frappe.db.commit()
|
||||
except:
|
||||
except Exception:
|
||||
frappe.db.rollback()
|
||||
self.log(voucher)
|
||||
return vouchers
|
||||
@@ -494,7 +494,7 @@ class TallyMigration(Document):
|
||||
|
||||
self.is_day_book_data_processed = 1
|
||||
|
||||
except:
|
||||
except Exception:
|
||||
self.publish("Process Day Book Data", _("Process Failed"), -1, 5)
|
||||
self.log()
|
||||
|
||||
@@ -564,7 +564,7 @@ class TallyMigration(Document):
|
||||
is_last = True
|
||||
frappe.enqueue_doc(self.doctype, self.name, "_import_vouchers", queue="long", timeout=3600, start=index+1, total=total, is_last=is_last)
|
||||
|
||||
except:
|
||||
except Exception:
|
||||
self.log()
|
||||
|
||||
finally:
|
||||
@@ -583,7 +583,7 @@ class TallyMigration(Document):
|
||||
voucher_doc.submit()
|
||||
self.publish("Importing Vouchers", _("{} of {}").format(index, total), index, total)
|
||||
frappe.db.commit()
|
||||
except:
|
||||
except Exception:
|
||||
frappe.db.rollback()
|
||||
self.log(voucher_doc)
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
# See license.txt
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestTallyMigration(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,8 +3,10 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
# import frappe
|
||||
from frappe.model.document import Document
|
||||
|
||||
|
||||
class TaxJarSettings(Document):
|
||||
pass
|
||||
|
||||
@@ -6,5 +6,6 @@ from __future__ import unicode_literals
|
||||
# import frappe
|
||||
import unittest
|
||||
|
||||
|
||||
class TestTaxJarSettings(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -5,5 +5,6 @@ from __future__ import unicode_literals
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
class TestWoocommerceSettings(unittest.TestCase):
|
||||
pass
|
||||
|
||||
@@ -3,12 +3,14 @@
|
||||
# For license information, please see license.txt
|
||||
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
from frappe.utils.nestedset import get_root_of
|
||||
from frappe.model.document import Document
|
||||
from six.moves.urllib.parse import urlparse
|
||||
from frappe.custom.doctype.custom_field.custom_field import create_custom_field
|
||||
from frappe.model.document import Document
|
||||
from frappe.utils.nestedset import get_root_of
|
||||
from six.moves.urllib.parse import urlparse
|
||||
|
||||
|
||||
class WoocommerceSettings(Document):
|
||||
def validate(self):
|
||||
|
||||
@@ -2,9 +2,8 @@
|
||||
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
|
||||
# For license information, please see license.txt
|
||||
|
||||
import stripe
|
||||
|
||||
import frappe
|
||||
import stripe
|
||||
from frappe import _
|
||||
from frappe.integrations.utils import create_request_log
|
||||
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import traceback
|
||||
|
||||
import frappe
|
||||
import taxjar
|
||||
from erpnext import get_default_company
|
||||
from frappe import _
|
||||
from frappe.contacts.doctype.address.address import get_company_address
|
||||
from frappe.utils import cint
|
||||
|
||||
from erpnext import get_default_company
|
||||
|
||||
TAX_ACCOUNT_HEAD = frappe.db.get_single_value("TaxJar Settings", "tax_account_head")
|
||||
SHIP_ACCOUNT_HEAD = frappe.db.get_single_value("TaxJar Settings", "shipping_account_head")
|
||||
TAXJAR_CREATE_TRANSACTIONS = frappe.db.get_single_value("TaxJar Settings", "taxjar_create_transactions")
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
from __future__ import unicode_literals
|
||||
|
||||
import base64
|
||||
import hashlib
|
||||
import hmac
|
||||
|
||||
import frappe
|
||||
from frappe import _
|
||||
import base64, hashlib, hmac
|
||||
from six.moves.urllib.parse import urlparse
|
||||
|
||||
from erpnext import get_default_company
|
||||
|
||||
|
||||
def validate_webhooks_request(doctype, hmac_key, secret_key='secret'):
|
||||
def innerfn(fn):
|
||||
settings = frappe.get_doc(doctype)
|
||||
|
||||
Reference in New Issue
Block a user