From 3cd34ebab65a030aae2b42d0fa0a5cbee934f1f6 Mon Sep 17 00:00:00 2001 From: ruthra kumar Date: Tue, 21 Jun 2022 11:15:19 +0530 Subject: [PATCH 1/4] fix: 'attribute error' on AR/AP report with delivery note filter --- .../accounts/report/accounts_receivable/accounts_receivable.py | 1 + 1 file changed, 1 insertion(+) diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py index 1911152dec1..411b31371b2 100755 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py @@ -128,6 +128,7 @@ class ReceivablePayableReport(object): credit_note_in_account_currency=0.0, outstanding_in_account_currency=0.0, ) + self.get_invoices(ple) if self.filters.get("group_by_party"): self.init_subtotal_row(ple.party) From 5d73697c647d5aeadd1b0738c1be8409a3ef7337 Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Tue, 28 Jun 2022 12:22:17 +0530 Subject: [PATCH 2/4] fix: offset some scheduled jobs to avoid locks (#31466) If your site has multiple background workers then there's possibility that two jobs will execute in parallal, this creates problem when both are on operating on same data. This PR adds a separate section for hourly and daily jobs which have frequency offset from default frequency to avoid such conflicts. --- erpnext/hooks.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/erpnext/hooks.py b/erpnext/hooks.py index 8abf65f4b5e..816cb626449 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -402,6 +402,14 @@ scheduler_events = { "0/30 * * * *": [ "erpnext.utilities.doctype.video.video.update_youtube_data", ], + # Hourly but offset by 30 minutes + "30 * * * *": [ + "erpnext.accounts.doctype.gl_entry.gl_entry.rename_gle_sle_docs", + ], + # Daily but offset by 45 minutes + "45 0 * * *": [ + "erpnext.stock.reorder_item.reorder_item", + ], }, "all": [ "erpnext.projects.doctype.project.project.project_status_update_reminder", @@ -411,7 +419,6 @@ scheduler_events = { "hourly": [ "erpnext.hr.doctype.daily_work_summary_group.daily_work_summary_group.trigger_emails", "erpnext.accounts.doctype.subscription.subscription.process_all", - "erpnext.accounts.doctype.gl_entry.gl_entry.rename_gle_sle_docs", "erpnext.erpnext_integrations.doctype.plaid_settings.plaid_settings.automatic_synchronization", "erpnext.projects.doctype.project.project.hourly_reminder", "erpnext.projects.doctype.project.project.collect_project_status", @@ -422,7 +429,6 @@ scheduler_events = { "erpnext.bulk_transaction.doctype.bulk_transaction_log.bulk_transaction_log.retry_failing_transaction", ], "daily": [ - "erpnext.stock.reorder_item.reorder_item", "erpnext.support.doctype.issue.issue.auto_close_tickets", "erpnext.crm.doctype.opportunity.opportunity.auto_close_opportunity", "erpnext.controllers.accounts_controller.update_invoice_status", From 080fcb91f25af9f4174183b4fe662049ff710e0c Mon Sep 17 00:00:00 2001 From: Ankush Menat Date: Tue, 28 Jun 2022 13:46:12 +0530 Subject: [PATCH 3/4] ci: pin semgrep to old version current version has problem with PRs originating from fork --- .github/workflows/linters.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index ebb88c9edac..af6d8f26a73 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -11,10 +11,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up Python 3.8 + - name: Set up Python 3.10 uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: '3.10' - name: Install and Run Pre-commit uses: pre-commit/action@v2.0.3 @@ -22,10 +22,8 @@ jobs: - name: Download Semgrep rules run: git clone --depth 1 https://github.com/frappe/semgrep-rules.git frappe-semgrep-rules - - uses: returntocorp/semgrep-action@v1 - env: - SEMGREP_TIMEOUT: 120 - with: - config: >- - r/python.lang.correctness - ./frappe-semgrep-rules/rules + - name: Download semgrep + run: pip install semgrep==0.97.0 + + - name: Run Semgrep rules + run: semgrep ci --config ./frappe-semgrep-rules/rules --config r/python.lang.correctness From cdf631b9de4b0351c4dc2613e1709e0d464ea69d Mon Sep 17 00:00:00 2001 From: Devin Slauenwhite Date: Wed, 29 Jun 2022 02:36:47 -0400 Subject: [PATCH 4/4] fix: validate item dashboard material transfer entry (#31473) --- erpnext/stock/dashboard/item_dashboard.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/erpnext/stock/dashboard/item_dashboard.js b/erpnext/stock/dashboard/item_dashboard.js index c9d5f61f22b..6e7622c067f 100644 --- a/erpnext/stock/dashboard/item_dashboard.js +++ b/erpnext/stock/dashboard/item_dashboard.js @@ -260,6 +260,16 @@ erpnext.stock.move_item = function (item, source, target, actual_qty, rate, call } dialog.set_primary_action(__('Create Stock Entry'), function () { + if (source && (dialog.get_value("qty") == 0 || dialog.get_value("qty") > actual_qty)) { + frappe.msgprint(__("Quantity must be greater than zero, and less or equal to {0}", [actual_qty])); + return; + } + + if (dialog.get_value("source") === dialog.get_value("target")) { + frappe.msgprint(__("Source and target warehouse must be different")); + return; + } + frappe.model.with_doctype('Stock Entry', function () { let doc = frappe.model.get_new_doc('Stock Entry'); doc.from_warehouse = dialog.get_value('source');