Merge branch 'version-13-hotfix' of https://github.com/frappe/erpnext into e-commerce-refactor

This commit is contained in:
marination
2021-08-24 11:48:13 +05:30
1294 changed files with 3267 additions and 2749 deletions

View File

@@ -350,4 +350,3 @@ def is_sync_complete(shopify_settings, order):
return getdate(shopify_settings.to_date) < getdate(order.get('created_at'))
else:
return cstr(order.get('id')) == cstr(shopify_settings.to_order_id)

View File

@@ -1,3 +1,2 @@
// Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
// For license information, please see license.txt

View File

@@ -103,4 +103,4 @@ class xml2dict(object):
"""parse a string"""
t = ET.fromstring(s)
root_tag, root_tree = self._namespace_split(t.tag, self._parse_node(t))
return object_dict({root_tag: root_tree})
return object_dict({root_tag: root_tree})

View File

@@ -17,4 +17,4 @@ class ExotelSettings(Document):
response = requests.get('https://api.exotel.com/v1/Accounts/{sid}'
.format(sid = self.account_sid), auth=(self.api_key, self.api_token))
if response.status_code != 200:
frappe.throw(_("Invalid credentials"))
frappe.throw(_("Invalid credentials"))

View File

@@ -25,4 +25,4 @@
</table>
{% else %}
<p style="margin-top: 30px;"> Account Balance Information Not Available. </p>
{% endif %}
{% endif %}

View File

@@ -115,4 +115,4 @@ class MpesaConnector():
saf_url = "{0}{1}".format(self.base_url, "/mpesa/stkpush/v1/processrequest")
r = requests.post(saf_url, headers=headers, json=payload)
return r.json()
return r.json()

View File

@@ -50,4 +50,4 @@ def create_pos_settings(record_dict):
for record in record_dict:
if frappe.db.exists("POS Field", {"fieldname": record.get("fieldname")}):
continue
frappe.get_doc(record).insert()
frappe.get_doc(record).insert()

View File

@@ -276,4 +276,4 @@ def fetch_param_value(response, key, key_field):
"""Fetch the specified key from list of dictionary. Key is identified via the key field."""
for param in response:
if param[key_field] == key:
return param["Value"]
return param["Value"]

View File

@@ -355,4 +355,4 @@ def get_account_balance_callback_payload():
}
}
}
}
}

View File

@@ -50,7 +50,7 @@ class PlaidConnector():
"secret": self.settings.plaid_secret,
"products": self.products,
})
return args
def get_link_token(self, update_mode=False):

View File

@@ -135,4 +135,4 @@ erpnext.integrations.plaidLink = class plaidLink {
});
}, __("Select a company"), __("Continue"));
}
};
};

View File

@@ -110,7 +110,7 @@ def add_bank_accounts(response, bank, company):
frappe.msgprint(_("Bank account {0} already exists and could not be created again").format(account["name"]))
except Exception:
frappe.log_error(frappe.get_traceback(), title=_("Plaid Link Error"))
frappe.throw(_("There was an error creating Bank Account while linking with Plaid."),
frappe.throw(_("There was an error creating Bank Account while linking with Plaid."),
title=_("Plaid Link Failed"))
else:

View File

@@ -346,4 +346,4 @@ erpnext.tally_migration.get_html_rows = (logs, field) => {
}).join("");
return rows
}
}

View File

@@ -27,7 +27,7 @@ class WoocommerceSettings(Document):
for doctype in ["Customer", "Address"]:
df = dict(fieldname='woocommerce_email', label='Woocommerce Email', fieldtype='Data', read_only=1, print_hide=1)
create_custom_field(doctype, df)
if not frappe.get_value("Item Group", {"name": _("WooCommerce Products")}):
item_group = frappe.new_doc("Item Group")
item_group.item_group_name = _("WooCommerce Products")
@@ -74,4 +74,4 @@ def generate_secret():
def get_series():
return {
"sales_order_series" : frappe.get_meta("Sales Order").get_options("naming_series") or "SO-WOO-",
}
}

View File

@@ -50,4 +50,4 @@ def create_subscription_on_stripe(stripe_settings):
stripe_settings.integration_request.db_set('status', 'Failed', update_modified=False)
frappe.log_error(frappe.get_traceback())
return stripe_settings.finalize_request()
return stripe_settings.finalize_request()

View File

@@ -52,7 +52,7 @@ def create_mode_of_payment(gateway, payment_type="General"):
"payment_gateway": gateway
}, ['payment_account'])
mode_of_payment = frappe.db.exists("Mode of Payment", gateway)
mode_of_payment = frappe.db.exists("Mode of Payment", gateway)
if not mode_of_payment and payment_gateway_account:
mode_of_payment = frappe.get_doc({
"doctype": "Mode of Payment",