From 21a5498d5d7e21ff1b9321aa7896a36bf64db83f Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 4 Oct 2021 16:06:55 +0530 Subject: [PATCH 1/4] fix: Merge "Accounting Ledger" and "Accounts Receivable" in "View" button (#27769) (#27771) * fix: Added a new button "View" and merged "Accounting Ledger" and "Accounts Receivable" into it * fix: sider issues * chore: dead code (cherry picked from commit b483f173a6ea1082d9e5b6e0c232f99f0367fa73) Co-authored-by: Komal-Saraf0609 <81952590+Komal-Saraf0609@users.noreply.github.com> --- erpnext/selling/doctype/customer/customer.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/erpnext/selling/doctype/customer/customer.js b/erpnext/selling/doctype/customer/customer.js index 8416901b7cb..f277d7cca0a 100644 --- a/erpnext/selling/doctype/customer/customer.js +++ b/erpnext/selling/doctype/customer/customer.js @@ -116,14 +116,15 @@ frappe.ui.form.on("Customer", { frappe.contacts.render_address_and_contact(frm); // custom buttons - frm.add_custom_button(__('Accounting Ledger'), function() { - frappe.set_route('query-report', 'General Ledger', - {party_type:'Customer', party:frm.doc.name}); - }); - frm.add_custom_button(__('Accounts Receivable'), function() { + frm.add_custom_button(__('Accounts Receivable'), function () { frappe.set_route('query-report', 'Accounts Receivable', {customer:frm.doc.name}); - }); + }, __('View')); + + frm.add_custom_button(__('Accounting Ledger'), function () { + frappe.set_route('query-report', 'General Ledger', + {party_type: 'Customer', party: frm.doc.name}); + }, __('View')); frm.add_custom_button(__('Pricing Rule'), function () { erpnext.utils.make_pricing_rule(frm.doc.doctype, frm.doc.name); From e17713c9d6da422d4c3b36e5d115c19101c79307 Mon Sep 17 00:00:00 2001 From: Sagar Vora Date: Mon, 4 Oct 2021 17:08:50 +0530 Subject: [PATCH 2/4] fix: multiple fixes to timesheets (#27775) --- .../doctype/sales_invoice/sales_invoice.js | 15 ++++++++----- .../doctype/sales_invoice/sales_invoice.json | 22 +++++++++---------- .../sales_invoice_timesheet.json | 11 ++++++---- .../projects/doctype/timesheet/timesheet.py | 8 +------ 4 files changed, 27 insertions(+), 29 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index f59f5748f35..24928186b6b 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -446,12 +446,15 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte }, currency() { + var me = this; this._super(); - $.each(cur_frm.doc.timesheets, function(i, d) { - let row = frappe.get_doc(d.doctype, d.name) - set_timesheet_detail_rate(row.doctype, row.name, cur_frm.doc.currency, row.timesheet_detail) - }); - calculate_total_billing_amount(cur_frm) + if (this.frm.doc.timesheets) { + this.frm.doc.timesheets.forEach((d) => { + let row = frappe.get_doc(d.doctype, d.name) + set_timesheet_detail_rate(row.doctype, row.name, me.frm.doc.currency, row.timesheet_detail) + }); + frm.trigger("calculate_timesheet_totals"); + } } }); @@ -999,7 +1002,7 @@ frappe.ui.form.on('Sales Invoice', { frappe.ui.form.on("Sales Invoice Timesheet", { - timesheets_remove(frm, cdt, cdn) { + timesheets_remove(frm) { frm.trigger("calculate_timesheet_totals"); } }); diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json index a24164487e6..f3adb898aa8 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json @@ -1990,16 +1990,6 @@ "label": "Additional Discount Account", "options": "Account" }, - { - "default": "0", - "fieldname": "ignore_default_payment_terms_template", - "fieldtype": "Check", - "hidden": 1, - "label": "Ignore Default Payment Terms Template", - "read_only": 1, - "show_days": 1, - "show_seconds": 1 - }, { "allow_on_submit": 1, "fieldname": "dispatch_address_name", @@ -2015,6 +2005,14 @@ "label": "Dispatch Address", "read_only": 1 }, + { + "default": "0", + "fieldname": "ignore_default_payment_terms_template", + "fieldtype": "Check", + "hidden": 1, + "label": "Ignore Default Payment Terms Template", + "read_only": 1 + }, { "fieldname": "total_billing_hours", "fieldtype": "Float", @@ -2033,7 +2031,7 @@ "link_fieldname": "consolidated_invoice" } ], - "modified": "2021-09-28 13:09:34.391799", + "modified": "2021-10-02 03:36:10.251715", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice", @@ -2088,4 +2086,4 @@ "title_field": "title", "track_changes": 1, "track_seen": 1 -} +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/sales_invoice_timesheet/sales_invoice_timesheet.json b/erpnext/accounts/doctype/sales_invoice_timesheet/sales_invoice_timesheet.json index 2cddbbfceee..69b7c129f09 100644 --- a/erpnext/accounts/doctype/sales_invoice_timesheet/sales_invoice_timesheet.json +++ b/erpnext/accounts/doctype/sales_invoice_timesheet/sales_invoice_timesheet.json @@ -16,9 +16,9 @@ "column_break_9", "billing_amount", "section_break_11", - "timesheet_detail", - "column_break_5", "time_sheet", + "timesheet_detail", + "column_break_13", "project_name" ], "fields": [ @@ -91,7 +91,6 @@ "fieldtype": "Column Break" }, { - "fieldname": "section_break_7", "fieldtype": "Section Break", "label": "Totals" @@ -110,11 +109,15 @@ "fieldtype": "Data", "label": "Project Name", "read_only": 1 + }, + { + "fieldname": "column_break_13", + "fieldtype": "Column Break" } ], "istable": 1, "links": [], - "modified": "2021-08-15 18:37:08.084930", + "modified": "2021-10-02 03:48:44.979777", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice Timesheet", diff --git a/erpnext/projects/doctype/timesheet/timesheet.py b/erpnext/projects/doctype/timesheet/timesheet.py index 9155f45184f..363c3b6a3ca 100644 --- a/erpnext/projects/doctype/timesheet/timesheet.py +++ b/erpnext/projects/doctype/timesheet/timesheet.py @@ -225,7 +225,6 @@ def get_projectwise_timesheet_data(project=None, parent=None, from_time=None, to query = f""" SELECT - tsd.name as name, tsd.parent as time_sheet, tsd.from_time as from_time, @@ -235,21 +234,16 @@ def get_projectwise_timesheet_data(project=None, parent=None, from_time=None, to tsd.activity_type as activity_type, tsd.description as description, ts.currency as currency, - tsd.project_name as project_name - + tsd.project_name as project_name FROM `tabTimesheet Detail` tsd - INNER JOIN `tabTimesheet` ts ON ts.name = tsd.parent - WHERE - tsd.parenttype = 'Timesheet' AND tsd.docstatus = 1 AND tsd.is_billable = 1 AND tsd.sales_invoice is NULL {condition} - ORDER BY tsd.from_time ASC """ From 4535a9415f13a373f01358f52511ccc0431b312e Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 4 Oct 2021 18:10:52 +0530 Subject: [PATCH 3/4] ci(Mergify): configuration update (#27777) (#27778) Signed-off-by: Ankush Menat (cherry picked from commit 4159361d52e84e9e70ce0e045822cdf3993e8200) Co-authored-by: Ankush Menat --- .mergify.yml | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .mergify.yml diff --git a/.mergify.yml b/.mergify.yml new file mode 100644 index 00000000000..f3d04096cfc --- /dev/null +++ b/.mergify.yml @@ -0,0 +1,58 @@ +pull_request_rules: + - name: Auto-close PRs on stable branch + conditions: + - and: + - and: + - author!=surajshetty3416 + - author!=gavindsouza + - author!=rohitwaghchaure + - author!=nabinhait + - or: + - base=version-13 + - base=version-12 + actions: + close: + comment: + message: | + @{{author}}, thanks for the contribution, but we do not accept pull requests on a stable branch. Please raise PR on an appropriate hotfix branch. + https://github.com/frappe/erpnext/wiki/Pull-Request-Checklist#which-branch + + - name: backport to version-13-hotfix + conditions: + - label="backport version-13-hotfix" + actions: + backport: + branches: + - version-13-hotfix + assignees: + - "{{ author }}" + + - name: backport to version-13-pre-release + conditions: + - label="backport version-13-pre-release" + actions: + backport: + branches: + - version-13-pre-release + assignees: + - "{{ author }}" + + - name: backport to version-12-hotfix + conditions: + - label="backport version-12-hotfix" + actions: + backport: + branches: + - version-12-hotfix + assignees: + - "{{ author }}" + + - name: backport to version-12-pre-release + conditions: + - label="backport version-12-pre-release" + actions: + backport: + branches: + - version-12-pre-release + assignees: + - "{{ author }}" \ No newline at end of file From 91d269fe1aefd88987fd6f845ba5be4887fa4b38 Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Mon, 4 Oct 2021 22:41:12 +0530 Subject: [PATCH 4/4] fix: set item uom as stock_uom if it isn't set (#27623) (#27780) * fix: set item uom as stock_uom if it isn't set (cherry picked from commit 5c372202d5fb024843fc1b13f843901f832532f7) Co-authored-by: Alan <2.alan.tom@gmail.com> --- erpnext/stock/doctype/stock_entry/stock_entry.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js index 6d1df8fb599..dfd827b62d5 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry.js @@ -323,6 +323,12 @@ frappe.ui.form.on('Stock Entry', { attach_bom_items(frm.doc.bom_no) }, + before_save: function(frm) { + frm.doc.items.forEach((item) => { + item.uom = item.uom || item.stock_uom; + }) + }, + stock_entry_type: function(frm){ frm.remove_custom_button('Bill of Materials', "Get Items From"); frm.events.show_bom_custom_button(frm);