diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000000..aa3a104e44 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,68 @@ +--- +name: Bug report +about: Create a report to help us improve + +--- + +Issue: Bug report + +Our project, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly. + +**Do the checklist before filing an issue:** + - [ ] Have a usage question? Ask your question on [Discuss Forum](https://discuss.erpnext.com). We use [Discuss Forum](https://discuss.erpnext.com) for usage question and GitHub for bugs. + - [ ] Can you replicate the issue? + - [ ] Is this something you can debug and fix? Send a pull request! Bug fixes and documentation fixes are welcome + +**Describe the bug** :chart_with_downwards_trend: +A clear and concise description of what the bug is. + +**To Reproduce** :page_with_curl: +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** :chart_with_upwards_trend: +A clear and concise description of what you expected to happen. + +**Screenshots** :crystal_ball: +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** :cyclone: + - OS: + - [ ] Linux + - [ ] macOS + - [ ] Windows + - [ ] Others? Please mention: + - Browser: + - [ ] Safari + - [ ] Chrome + - [ ] Firefox + - [ ] Other? Please mention: + +**Smartphone (please complete the following information):** :iphone: :computer: + - Device: + - [ ] iPhone + - [ ] Android + - Browser: + - [ ] Safari + - [ ] Chrome + - [ ] Firefox + - [ ] Other? Please mention: + +**Version Information** +- Which branch are you on? + - [ ] `master` :star2: + - [ ] `develop` :fire: +- Frappe Version: +- ERPNext Version: + +**Additional context** :page_facing_up: +Add any other context about the problem here. + +**Possible Solution** :bookmark_tabs: +Any idea what might be causing the issue. Or if you have a proposed solution to the problem, + +**Please don't be intimidated by the long list of options you've fill. Try to fill out as much as you can. Remember, the more the information the easier it is for us to replicate and fix the issue** :grin: + diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000000..e09e5e958d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,21 @@ +--- +name: Feature request +about: Suggest an idea for this project + +--- + +Issue: Feature Request + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. + + diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000000..8e2bd85728 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,28 @@ +Pull-Request + +- [ ] Have you followed the guidelines in our Contributing document? +- [ ] Have you checked to ensure there aren't other open [Pull Requests](../pulls) for the same update/change? +- [ ] Have you lint your code locally prior to submission? +- [ ] Have you successfully run tests with your changes locally? +- [ ] Does your commit message have an explanation for your changes and why you'd like us to include them? +- [ ] Docs have been added / updated +- [ ] Tests for the changes have been added (for bug fixes / features) +- [ ] Did you modify the existing test cases? If yes, why? + +--- + +What type of a PR is this? + +- [ ] Changes to Existing Features +- [ ] New Feature Submissions +- [ ] Bug Fix +- [ ] Breaking Change + +--- + +- Motivation and Context (What existing problem does the pull request solve): +- Related Issue: +- Screenshots (if applicable, remember, a picture tells a thousand words): + +**Please don't be intimidated by the long list of options you've fill. Try to fill out as much as you can. Remember, the more the information the easier it is for us to test and get your pull request merged** :grin: + diff --git a/.gitignore b/.gitignore index 68272c7d4d..2b52a4956f 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,9 @@ latest_updates.json dist/ erpnext/docs/current *.swp +<<<<<<< HEAD *.swo __pycache__ *~ +======= +>>>>>>> master diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 28212c5ab7..b9e3cfcaf7 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__ = '10.1.35' +__version__ = '10.1.36' def get_default_company(user=None): '''Get default company for user''' diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json index 7ea33bf336..b62a0f095f 100755 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json @@ -3712,6 +3712,65 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fieldname": "group_same_items", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Group same items", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "column_break_112", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "columns": 0, "fieldname": "select_print_heading", "fieldtype": "Link", "hidden": 0, @@ -4264,7 +4323,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2018-05-17 12:53:46.687257", + "modified": "2018-05-28 02:38:40.310899", "modified_by": "Administrator", "module": "Accounts", "name": "Purchase Invoice", diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py index c35242e102..92fc61093b 100644 --- a/erpnext/accounts/party.py +++ b/erpnext/accounts/party.py @@ -400,10 +400,21 @@ def get_timeline_data(doctype, name): from frappe.desk.form.load import get_communication_data out = {} + fields = 'date(creation), count(name)' + after = add_years(None, -1).strftime('%Y-%m-%d') + group_by='group by date(creation)' + data = get_communication_data(doctype, name, - fields = 'date(creation), count(name)', - after = add_years(None, -1).strftime('%Y-%m-%d'), - group_by='group by date(creation)', as_dict=False) + fields=fields, after=after, group_by=group_by, as_dict=False) + + # fetch and append data from Activity Log + data += frappe.db.sql("""select {fields} + from `tabActivity Log` + where reference_doctype='{doctype}' and reference_name='{name}' + and status!='Success' and creation > {after} + {group_by} order by creation desc + """.format(doctype=doctype, name=name, fields=fields, + group_by=group_by, after=after), as_dict=False) timeline_items = dict(data) diff --git a/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py b/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py index 710099ee10..72661ffdf0 100644 --- a/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py +++ b/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py @@ -49,7 +49,7 @@ def _execute(filters=None, additional_table_columns=None, additional_query_colum row += [ d.credit_to, d.mode_of_payment, d.project, d.company, d.purchase_order, - purchase_receipt, expense_account, d.stock_qty, d.stock_uom, d.base_net_rate, d.base_net_amount + purchase_receipt, expense_account, d.stock_qty, d.stock_uom, d.base_net_amount / d.stock_qty, d.base_net_amount ] total_tax = 0 @@ -120,8 +120,7 @@ def get_items(filters, additional_query_columns): `tabPurchase Invoice Item`.`project`, `tabPurchase Invoice Item`.`purchase_order`, `tabPurchase Invoice Item`.`purchase_receipt`, `tabPurchase Invoice Item`.`po_detail`, `tabPurchase Invoice Item`.`expense_account`, `tabPurchase Invoice Item`.`stock_qty`, - `tabPurchase Invoice Item`.`stock_uom`, `tabPurchase Invoice Item`.`base_net_rate`, - `tabPurchase Invoice Item`.`base_net_amount`, + `tabPurchase Invoice Item`.`stock_uom`, `tabPurchase Invoice Item`.`base_net_amount`, `tabPurchase Invoice`.supplier_name, `tabPurchase Invoice`.mode_of_payment {0} from `tabPurchase Invoice`, `tabPurchase Invoice Item` where `tabPurchase Invoice`.name = `tabPurchase Invoice Item`.`parent` and diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json index caa5fc5b47..27f24bff05 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json @@ -2279,6 +2279,65 @@ "bold": 0, "collapsible": 0, "columns": 0, + "fieldname": "group_same_items", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Group same items", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "column_break_72", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "columns": 0, "fieldname": "letter_head", "fieldtype": "Link", "hidden": 0, @@ -2602,7 +2661,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2018-05-17 12:57:42.384971", + "modified": "2018-05-28 02:45:48.616334", "modified_by": "Administrator", "module": "Buying", "name": "Supplier Quotation", diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index e3f7d1ea68..76be942db8 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -102,7 +102,8 @@ class AccountsController(TransactionBase): self.validate_non_invoice_documents_schedule() def before_print(self): - if self.doctype in ['Purchase Order', 'Sales Order']: + if self.doctype in ['Purchase Order', 'Sales Order', 'Sales Invoice', 'Purchase Invoice', + 'Supplier Quotation', 'Purchase Receipt', 'Delivery Note', 'Quotation']: if self.get("group_same_items"): self.group_similar_items() @@ -684,6 +685,7 @@ class AccountsController(TransactionBase): if item.item_code in group_item_qty: item.qty = group_item_qty[item.item_code] item.amount = group_item_amount[item.item_code] + item.rate = flt(flt(item.amount)/flt(item.qty), item.precision("rate")) del group_item_qty[item.item_code] else: duplicate_list.append(item) diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py index d1a75a9cf3..a595b4b032 100644 --- a/erpnext/controllers/taxes_and_totals.py +++ b/erpnext/controllers/taxes_and_totals.py @@ -38,6 +38,7 @@ class calculate_taxes_and_totals(object): self.manipulate_grand_total_for_inclusive_tax() self.calculate_totals() self._cleanup() + self.calculate_total_net_weight() def validate_conversion_rate(self): # validate conversion rate @@ -329,6 +330,13 @@ class calculate_taxes_and_totals(object): self.set_rounded_total() + def calculate_total_net_weight(self): + if self.doc.meta.get_field('total_net_weight'): + self.doc.total_net_weight = 0.0 + for d in self.doc.items: + if d.total_weight: + self.doc.total_net_weight += d.total_weight + def set_rounded_total(self): if self.doc.meta.get_field("rounded_total"): if self.doc.is_rounded_total_disabled(): diff --git a/erpnext/healthcare/doctype/consultation/consultation.py b/erpnext/healthcare/doctype/consultation/consultation.py index b647c2e6e2..ace5ac09b9 100755 --- a/erpnext/healthcare/doctype/consultation/consultation.py +++ b/erpnext/healthcare/doctype/consultation/consultation.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import frappe from frappe.model.document import Document -from frappe.utils import getdate +from frappe.utils import getdate, cstr import json from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import get_receivable_account, get_income_account @@ -120,7 +120,7 @@ def delete_medical_record(consultation): def set_subject_field(consultation): subject = "No Diagnosis " if(consultation.diagnosis): - subject = "Diagnosis: "+ str(consultation.diagnosis)+". " + subject = "Diagnosis: \n"+ cstr(consultation.diagnosis)+". " if(consultation.drug_prescription): subject +="\nDrug(s) Prescribed. " if(consultation.test_prescription): diff --git a/erpnext/healthcare/doctype/lab_test/lab_test.py b/erpnext/healthcare/doctype/lab_test/lab_test.py index c910d7cc88..4e07ed6b0d 100644 --- a/erpnext/healthcare/doctype/lab_test/lab_test.py +++ b/erpnext/healthcare/doctype/lab_test/lab_test.py @@ -6,7 +6,7 @@ from __future__ import unicode_literals import frappe from frappe.model.document import Document import json -from frappe.utils import getdate +from frappe.utils import getdate, cstr from erpnext.healthcare.doctype.healthcare_settings.healthcare_settings import get_receivable_account from frappe import _ @@ -228,9 +228,10 @@ def get_employee_by_user_id(user_id): return employee def insert_lab_test_to_medical_record(doc): - subject = str(doc.test_name) + subject = cstr(doc.test_name) if(doc.test_comment): - subject += ", "+str(doc.test_comment) + subject += ", \n"+ cstr(doc.test_comment) + medical_record = frappe.new_doc("Patient Medical Record") medical_record.patient = doc.patient medical_record.subject = subject diff --git a/erpnext/healthcare/doctype/vital_signs/vital_signs.py b/erpnext/healthcare/doctype/vital_signs/vital_signs.py index 41d9258a76..bf4dace22b 100644 --- a/erpnext/healthcare/doctype/vital_signs/vital_signs.py +++ b/erpnext/healthcare/doctype/vital_signs/vital_signs.py @@ -5,6 +5,7 @@ from __future__ import unicode_literals import frappe from frappe.model.document import Document +from frappe.utils import cstr class VitalSigns(Document): def on_submit(self): @@ -33,16 +34,16 @@ def delete_vital_signs_from_medical_record(doc): def set_subject_field(doc): subject = "" if(doc.temperature): - subject += "Temperature: "+ str(doc.temperature)+".\n" + subject += "Temperature: \n"+ cstr(doc.temperature)+". " if(doc.pulse): - subject += "Pulse: "+ str(doc.pulse)+".\n" + subject += "Pulse: \n"+ cstr(doc.pulse)+". " if(doc.respiratory_rate): - subject += "Respiratory Rate: "+ str(doc.respiratory_rate)+".\n" + subject += "Respiratory Rate: \n"+ cstr(doc.respiratory_rate)+". " if(doc.bp): - subject += "BP: "+ str(doc.bp)+".\n" + subject += "BP: \n"+ cstr(doc.bp)+". " if(doc.bmi): - subject += "BMI: "+ str(doc.bmi)+".\n" + subject += "BMI: \n"+ cstr(doc.bmi)+". " if(doc.nutrition_note): - subject += "Note: "+ str(doc.nutrition_note)+"." + subject += "Note: \n"+ cstr(doc.nutrition_note)+". " return subject diff --git a/erpnext/patches.txt b/erpnext/patches.txt index 360a006209..06ff4b5893 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -543,3 +543,4 @@ erpnext.patches.v11_0.check_buying_selling_in_currency_exchange erpnext.patches.v11_0.refactor_erpnext_shopify erpnext.patches.v11_0.move_item_defaults_to_child_table_for_multicompany erpnext.patches.v11_0.rename_overproduction_percent_field +erpnext.patches.v10_0.update_status_in_purchase_receipt diff --git a/erpnext/patches/v10_0/update_status_in_purchase_receipt.py b/erpnext/patches/v10_0/update_status_in_purchase_receipt.py new file mode 100644 index 0000000000..69e2bb881b --- /dev/null +++ b/erpnext/patches/v10_0/update_status_in_purchase_receipt.py @@ -0,0 +1,7 @@ +import frappe + +def execute(): + frappe.reload_doc("stock", "doctype", "purchase_receipt") + frappe.db.sql(''' + UPDATE `tabPurchase Receipt` SET status = "Completed" WHERE per_billed = 100 AND docstatus = 1 + ''') \ No newline at end of file diff --git a/erpnext/selling/doctype/quotation/quotation.json b/erpnext/selling/doctype/quotation/quotation.json index cf7916b6ce..8496a63cd7 100644 --- a/erpnext/selling/doctype/quotation/quotation.json +++ b/erpnext/selling/doctype/quotation/quotation.json @@ -2549,8 +2549,8 @@ "bold": 0, "collapsible": 0, "columns": 0, - "fieldname": "select_print_heading", - "fieldtype": "Link", + "fieldname": "group_same_items", + "fieldtype": "Check", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, @@ -2558,18 +2558,16 @@ "in_global_search": 0, "in_list_view": 0, "in_standard_filter": 0, - "label": "Print Heading", + "label": "Group same items", "length": 0, - "no_copy": 1, - "oldfieldname": "select_print_heading", - "oldfieldtype": "Link", - "options": "Print Heading", + "no_copy": 0, "permlevel": 0, + "precision": "", "print_hide": 1, "print_hide_if_no_value": 0, "read_only": 0, "remember_last_selected_value": 0, - "report_hide": 1, + "report_hide": 0, "reqd": 0, "search_index": 0, "set_only_once": 0, @@ -2608,6 +2606,38 @@ }, { "allow_bulk_edit": 0, + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "select_print_heading", + "fieldtype": "Link", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Print Heading", + "length": 0, + "no_copy": 1, + "oldfieldname": "select_print_heading", + "oldfieldtype": "Link", + "options": "Print Heading", + "permlevel": 0, + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 1, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, @@ -3005,8 +3035,13 @@ "istable": 0, "max_attachments": 1, "menu_index": 0, +<<<<<<< HEAD "modified": "2018-05-17 12:56:20.830562", "modified_by": "Administrator", +======= + "modified": "2018-05-28 03:23:15.354674", + "modified_by": "Administrator", +>>>>>>> master "module": "Selling", "name": "Quotation", "owner": "Administrator", diff --git a/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.py b/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.py index e7bb5b410c..fd5bc4ec5b 100644 --- a/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.py +++ b/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.py @@ -98,7 +98,7 @@ def get_achieved_details(filters, sales_person, all_sales_persons, target_item_g END as qty, CASE WHEN so.status = "Closed" THEN sum(soi.delivered_qty * soi.conversion_factor * soi.base_net_rate * (st.allocated_percentage/100)) - ELSE soi.base_net_amount * (st.allocated_percentage/100)) + ELSE sum(soi.base_net_amount * (st.allocated_percentage/100)) END as amount from `tabSales Order Item` soi, `tabSales Order` so, `tabSales Team` st diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.json b/erpnext/stock/doctype/delivery_note/delivery_note.json index 92219e70ab..12e5b394de 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.json +++ b/erpnext/stock/doctype/delivery_note/delivery_note.json @@ -3290,6 +3290,36 @@ }, { "allow_bulk_edit": 0, + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "group_same_items", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Group same items", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 1, @@ -3851,7 +3881,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2018-05-17 12:55:36.474198", + "modified": "2018-05-28 03:03:35.035396", "modified_by": "Administrator", "module": "Stock", "name": "Delivery Note", diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index 8886f330b4..1df07a2282 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -82,6 +82,8 @@ class DeliveryNote(SellingController): for f in fieldname: toggle_print_hide(self.meta if key == "parent" else item_meta, f) + super(DeliveryNote, self).before_print() + def set_actual_qty(self): for d in self.get('items'): if d.item_code and d.warehouse: diff --git a/erpnext/stock/doctype/packed_item/packed_item.py b/erpnext/stock/doctype/packed_item/packed_item.py index 5649b3d793..fc53794093 100644 --- a/erpnext/stock/doctype/packed_item/packed_item.py +++ b/erpnext/stock/doctype/packed_item/packed_item.py @@ -53,7 +53,8 @@ def update_packing_list_item(doc, packing_item_code, qty, main_item_row, descrip pi.qty = flt(qty) pi.description = description if not pi.warehouse: - pi.warehouse = item.default_warehouse or main_item_row.warehouse + pi.warehouse = (main_item_row.warehouse + if (doc.get('is_pos') or not item.default_warehouse) else item.default_warehouse) if not pi.batch_no: pi.batch_no = cstr(main_item_row.get("batch_no")) if not pi.target_warehouse: diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json index 9bd2ebb404..f94e5a5928 100755 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json @@ -3105,10 +3105,69 @@ }, { "allow_bulk_edit": 0, + "allow_on_submit": 1, + "bold": 0, + "collapsible": 0, + "columns": 0, + "fieldname": "group_same_items", + "fieldtype": "Check", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "label": "Group same items", + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, "allow_on_submit": 0, "bold": 0, "collapsible": 0, "columns": 0, + "fieldname": "column_break_97", + "fieldtype": "Column Break", + "hidden": 0, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_standard_filter": 0, + "length": 0, + "no_copy": 0, + "permlevel": 0, + "precision": "", + "print_hide": 0, + "print_hide_if_no_value": 0, + "read_only": 0, + "remember_last_selected_value": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "set_only_once": 0, + "unique": 0 + }, + { + "allow_bulk_edit": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "columns": 0, "fieldname": "other_details", "fieldtype": "HTML", "hidden": 1, @@ -3377,7 +3436,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2018-05-17 13:05:05.772877", + "modified": "2018-05-28 02:59:59.609643", "modified_by": "Administrator", "module": "Stock", "name": "Purchase Receipt", diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py index 17afba0292..fa441b5103 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py @@ -122,6 +122,8 @@ class PurchaseReceipt(BuyingController): self.update_prevdoc_status() if self.per_billed < 100: self.update_billing_status() + else: + self.status = "Completed" # Updating stock ledger should always be called after updating prevdoc status, diff --git a/erpnext/stock/report/stock_ledger/stock_ledger.py b/erpnext/stock/report/stock_ledger/stock_ledger.py index 1a91ab48d2..ec95561eb3 100644 --- a/erpnext/stock/report/stock_ledger/stock_ledger.py +++ b/erpnext/stock/report/stock_ledger/stock_ledger.py @@ -56,7 +56,7 @@ def get_stock_ledger_entries(filters, items): item_conditions_sql = '' if items: item_conditions_sql = 'and sle.item_code in ({})'\ - .format(', '.join(['"' + frappe.db.escape(i,percent=False) + '"' for i in items])) + .format(', '.join(['"' + frappe.db.escape(i) + '"' for i in items])) return frappe.db.sql("""select concat_ws(" ", posting_date, posting_time) as date, item_code, warehouse, actual_qty, qty_after_transaction, incoming_rate, valuation_rate, diff --git a/erpnext/utilities/page/leaderboard/leaderboard.js b/erpnext/utilities/page/leaderboard/leaderboard.js index 6e4db1ba8b..5563fb0e96 100644 --- a/erpnext/utilities/page/leaderboard/leaderboard.js +++ b/erpnext/utilities/page/leaderboard/leaderboard.js @@ -85,7 +85,7 @@ frappe.Leaderboard = Class.extend({ this.$sidebar_list.on('click', 'li', function(e) { let $li = $(this); - let doctype = $li.find('span').html(); + let doctype = $li.find('span').attr("doctype-value"); me.options.selected_company = frappe.defaults.get_default('company'); me.options.selected_doctype = doctype; @@ -172,7 +172,7 @@ frappe.Leaderboard = Class.extend({ $container.find(".leaderboard-list").html(me.render_list_view(res.message)); } else { me.$graph_area.hide(); - me.message = "No items found."; + me.message = __("No items found."); $container.find(".leaderboard-list").html(me.render_list_view()); } }, @@ -301,7 +301,7 @@ frappe.Leaderboard = Class.extend({ get_sidebar_item: function(item) { return $(`