From 47f030b1bfbc251ccd50c81414b2aa6dbf75c221 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Tue, 2 Jun 2020 12:34:46 +0530 Subject: [PATCH 1/9] fix: show disabled items in the stock balance --- erpnext/stock/report/stock_balance/stock_balance.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/stock/report/stock_balance/stock_balance.py b/erpnext/stock/report/stock_balance/stock_balance.py index 13118610531..da9a815cda3 100644 --- a/erpnext/stock/report/stock_balance/stock_balance.py +++ b/erpnext/stock/report/stock_balance/stock_balance.py @@ -233,7 +233,7 @@ def get_item_details(items, sle, filters): `tabItem` item {cf_join} where - item.name in ({item_codes}) and ifnull(item.disabled, 0) = 0 + item.name in ({item_codes}) """.format(cf_field=cf_field, cf_join=cf_join, item_codes=item_codes), as_dict=1) for item in res: From 2382312d416486c474987a33233850190a095f3d Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Sun, 7 Jun 2020 18:59:14 +0530 Subject: [PATCH 2/9] fix: fetch tax lines within the shipping lines (#22138) (#22140) (cherry picked from commit 303112816771639a7808663170dac497b4f8e2d1) Co-authored-by: Mangesh-Khairnar --- .../connectors/shopify_connection.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/erpnext/erpnext_integrations/connectors/shopify_connection.py b/erpnext/erpnext_integrations/connectors/shopify_connection.py index 1d6e8917f50..e54d04a90c9 100644 --- a/erpnext/erpnext_integrations/connectors/shopify_connection.py +++ b/erpnext/erpnext_integrations/connectors/shopify_connection.py @@ -234,14 +234,17 @@ def get_order_taxes(shopify_order, shopify_settings): return taxes def update_taxes_with_shipping_lines(taxes, shipping_lines, shopify_settings): + """Shipping lines represents the shipping details, + each such shipping detail consists of a list of tax_lines""" for shipping_charge in shipping_lines: - taxes.append({ - "charge_type": _("Actual"), - "account_head": get_tax_account_head(shipping_charge), - "description": shipping_charge["title"], - "tax_amount": shipping_charge["price"], - "cost_center": shopify_settings.cost_center - }) + for tax in shipping_charge.get("tax_lines"): + taxes.append({ + "charge_type": _("Actual"), + "account_head": get_tax_account_head(tax), + "description": tax["title"], + "tax_amount": tax["price"], + "cost_center": shopify_settings.cost_center + }) return taxes From 97ccb0eec27f8213a5878cd974721c656cd91d69 Mon Sep 17 00:00:00 2001 From: Mangesh-Khairnar Date: Thu, 18 Jun 2020 15:50:16 +0530 Subject: [PATCH 3/9] fix: update shopify api version (#22311) --- .../shopify_settings/shopify_settings.py | 25 +++++++++++++------ .../doctype/shopify_settings/sync_product.py | 2 +- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/erpnext/erpnext_integrations/doctype/shopify_settings/shopify_settings.py b/erpnext/erpnext_integrations/doctype/shopify_settings/shopify_settings.py index 7f4b7bab0a0..56b3c2c2feb 100644 --- a/erpnext/erpnext_integrations/doctype/shopify_settings/shopify_settings.py +++ b/erpnext/erpnext_integrations/doctype/shopify_settings/shopify_settings.py @@ -8,6 +8,7 @@ import json from frappe import _ 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 @@ -39,24 +40,28 @@ class ShopifySettings(Document): def register_webhooks(self): webhooks = ["orders/create", "orders/paid", "orders/fulfilled"] - url = get_shopify_url('admin/webhooks.json', self) + url = get_shopify_url('admin/api/2020-04/webhooks.json', self) created_webhooks = [d.method for d in self.webhooks] - for method in webhooks: if method in created_webhooks: continue session = get_request_session() try: - d = session.post(url, data=json.dumps({ + res = session.post(url, data=json.dumps({ "webhook": { "topic": method, "address": get_webhook_address(connector_name='shopify_connection', method='store_request_data'), "format": "json" } }), headers=get_header(self)) - d.raise_for_status() - self.update_webhook_table(method, d.json()) + res.raise_for_status() + self.update_webhook_table(method, res.json()) + + except HTTPError as e: + error_message = res.json().get('errors', e) + make_shopify_log(status="Warning", exception=error_message, rollback=True) + except Exception as e: make_shopify_log(status="Warning", message=e.message, exception=False) @@ -65,13 +70,18 @@ class ShopifySettings(Document): deleted_webhooks = [] for d in self.webhooks: - url = get_shopify_url('admin/webhooks/{0}.json'.format(d.webhook_id), self) + url = get_shopify_url('admin/api/2020-04/webhooks/{0}.json'.format(d.webhook_id), self) try: res = session.delete(url, headers=get_header(self)) res.raise_for_status() deleted_webhooks.append(d) + + except HTTPError as e: + error_message = res.json().get('errors', e) + make_shopify_log(status="Warning", exception=error_message, rollback=True) + except Exception as e: - frappe.log_error(message=frappe.get_traceback(), title=e.message[:140]) + frappe.log_error(message=e, title='Shopify Webhooks Issue') for d in deleted_webhooks: self.remove(d) @@ -144,4 +154,3 @@ def setup_custom_fields(): } create_custom_fields(custom_fields) - diff --git a/erpnext/erpnext_integrations/doctype/shopify_settings/sync_product.py b/erpnext/erpnext_integrations/doctype/shopify_settings/sync_product.py index 5570e6903a8..ee21f4571d0 100644 --- a/erpnext/erpnext_integrations/doctype/shopify_settings/sync_product.py +++ b/erpnext/erpnext_integrations/doctype/shopify_settings/sync_product.py @@ -7,7 +7,7 @@ from erpnext.erpnext_integrations.doctype.shopify_settings.shopify_settings impo shopify_variants_attr_list = ["option1", "option2", "option3"] def sync_item_from_shopify(shopify_settings, item): - url = get_shopify_url("/admin/products/{0}.json".format(item.get("product_id")), shopify_settings) + url = get_shopify_url("admin/api/2020-04/products/{0}.json".format(item.get("product_id")), shopify_settings) session = get_request_session() try: From c4ff9c72ddc31d737ee26515bbc481794112e398 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Tue, 23 Jun 2020 10:35:18 +0530 Subject: [PATCH 4/9] fix:status error in purchase invoice (#22390) (cherry picked from commit 8a1f2ed65a0ca9e925ea32f4b7d07add1f3c0b72) Co-authored-by: Kenneth Sequeira --- .../accounts/doctype/purchase_invoice/purchase_invoice_list.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js index 4e76a8d9552..011c782e6d0 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js @@ -16,7 +16,7 @@ frappe.listview_settings['Purchase Invoice'] = { } else if(frappe.datetime.get_diff(doc.due_date) < 0) { return [__("Overdue"), "red", "outstanding_amount,>,0|due_date,<,Today"]; } else { - return [__("Unpaid"), "orange", "outstanding_amount,>,0|due,>=,Today"]; + return [__("Unpaid"), "orange", "outstanding_amount,>,0|due_date,>=,Today"]; } } else if(cint(doc.is_return)) { return [__("Return"), "darkgrey", "is_return,=,Yes"]; From d075399ecd4670b8c82e23c034683fa1a136a590 Mon Sep 17 00:00:00 2001 From: Revant Nandgaonkar Date: Wed, 24 Jun 2020 10:45:18 +0530 Subject: [PATCH 5/9] ci: github release action for v11 (#22408) --- .github/workflows/docker-release.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 .github/workflows/docker-release.yml diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml new file mode 100644 index 00000000000..4b1147e79f9 --- /dev/null +++ b/.github/workflows/docker-release.yml @@ -0,0 +1,14 @@ +name: Trigger Docker build on release +on: + release: + types: [released] +jobs: + curl: + runs-on: ubuntu-latest + container: + image: alpine:latest + steps: + - name: curl + run: | + apk add curl bash + curl -s -X POST -H "Content-Type: application/json" -H "Accept: application/json" -H "Travis-API-Version: 3" -H "Authorization: token ${{ secrets.TRAVIS_CI_TOKEN }}" -d '{"request":{"branch":"master"}}' https://api.travis-ci.com/repo/frappe%2Ffrappe_docker/requests From 87f8d66b79d5b8afc7c98088d4c1415feecd598f Mon Sep 17 00:00:00 2001 From: britlog Date: Tue, 9 Jun 2020 22:50:49 +0200 Subject: [PATCH 6/9] fix product_info --- erpnext/shopping_cart/product_info.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/shopping_cart/product_info.py b/erpnext/shopping_cart/product_info.py index 3af5afa0442..6545a75322b 100644 --- a/erpnext/shopping_cart/product_info.py +++ b/erpnext/shopping_cart/product_info.py @@ -48,7 +48,7 @@ def get_product_info_for_website(item_code): def set_product_info_for_website(item): """set product price uom for website""" - product_info = get_product_info_for_website(item.item_code) + product_info = get_product_info_for_website(item.item_code).get("product_info") if product_info: item.update(product_info) From ccf62886e42637640d67c6695739eeaf1d66f8f4 Mon Sep 17 00:00:00 2001 From: Ivan Ray Altomera Date: Tue, 15 Sep 2020 15:36:31 +0800 Subject: [PATCH 7/9] fix(stock_controller): precision based on `debit_in_account_currency` --- erpnext/controllers/stock_controller.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py index 4a468205276..e5fea08be76 100644 --- a/erpnext/controllers/stock_controller.py +++ b/erpnext/controllers/stock_controller.py @@ -54,6 +54,7 @@ class StockController(AccountsController): gl_list = [] warehouse_with_no_account = [] + precision = frappe.get_precision('GL Entry', 'debit_in_account_currency') for item_row in voucher_details: sle_list = sle_map.get(item_row.name) if sle_list: @@ -79,7 +80,7 @@ class StockController(AccountsController): "against": item_row.expense_account, "cost_center": item_row.cost_center, "remarks": self.get("remarks") or "Accounting Entry for Stock", - "debit": flt(sle.stock_value_difference, 2), + "debit": flt(sle.stock_value_difference, precision), "is_opening": item_row.get("is_opening") or self.get("is_opening") or "No", }, warehouse_account[sle.warehouse]["account_currency"])) @@ -89,7 +90,7 @@ class StockController(AccountsController): "against": warehouse_account[sle.warehouse]["account"], "cost_center": item_row.cost_center, "remarks": self.get("remarks") or "Accounting Entry for Stock", - "credit": flt(sle.stock_value_difference, 2), + "credit": flt(sle.stock_value_difference, precision), "project": item_row.get("project") or self.get("project"), "is_opening": item_row.get("is_opening") or self.get("is_opening") or "No" })) From 1d6bb3953d97c7a27ff844eab10f13e91d7e9784 Mon Sep 17 00:00:00 2001 From: Ivan Ray Altomera Date: Mon, 4 Jan 2021 14:24:19 +0800 Subject: [PATCH 8/9] fix: Customer Ledger Summary report not working on python 3 (#23957) --- .../report/customer_ledger_summary/customer_ledger_summary.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py index 7872dbe7b16..2cb10b11e1b 100644 --- a/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py +++ b/erpnext/accounts/report/customer_ledger_summary/customer_ledger_summary.py @@ -286,14 +286,14 @@ class PartyLedgerSummaryReport(object): if parties and accounts: if len(parties) == 1: - party = parties.keys()[0] + party = list(parties.keys())[0] for account, amount in iteritems(accounts): self.party_adjustment_accounts.add(account) self.party_adjustment_details.setdefault(party, {}) self.party_adjustment_details[party].setdefault(account, 0) self.party_adjustment_details[party][account] += amount elif len(accounts) == 1 and not has_irrelevant_entry: - account = accounts.keys()[0] + account = list(accounts.keys())[0] self.party_adjustment_accounts.add(account) for party, amount in iteritems(parties): self.party_adjustment_details.setdefault(party, {}) From 7bb53131908ebdb6209542c1137f31f204472e53 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 21 Jun 2021 16:04:04 +0550 Subject: [PATCH 9/9] bumped to version 11.1.69 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 46cf3132c78..a8d8e10b59d 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -5,7 +5,7 @@ import frappe from erpnext.hooks import regional_overrides from frappe.utils import getdate -__version__ = '11.1.68' +__version__ = '11.1.69' def get_default_company(user=None): '''Get default company for user'''