From 3b79f19614664e921a14f52062f376ca9fd1cf9a Mon Sep 17 00:00:00 2001 From: shreyas Date: Wed, 1 Jun 2016 17:45:10 +0530 Subject: [PATCH 1/7] [Fix] Allow user to quantity in fraction while transferring material using production order --- .../manufacturing/doctype/production_order/production_order.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/manufacturing/doctype/production_order/production_order.js b/erpnext/manufacturing/doctype/production_order/production_order.js index d2e95faf49..8e6b7e698c 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.js +++ b/erpnext/manufacturing/doctype/production_order/production_order.js @@ -177,7 +177,7 @@ $.extend(cur_frm.cscript, { flt(this.frm.doc.material_transferred_for_manufacturing) - flt(this.frm.doc.produced_qty) : flt(this.frm.doc.qty) - flt(this.frm.doc.material_transferred_for_manufacturing); - frappe.prompt({fieldtype:"Int", label: __("Qty for {0}", [purpose]), fieldname:"qty", + frappe.prompt({fieldtype:"Float", label: __("Qty for {0}", [purpose]), fieldname:"qty", description: __("Max: {0}", [max]) }, function(data) { if(data.qty > max) { From 690a0805f6c9b5f25e6bc5d69cffc6d8cc07e85b Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Mon, 6 Jun 2016 16:50:20 +0530 Subject: [PATCH 2/7] [Fixes] Purchase register, showing wrong value for total amount if tax has deducted. --- .../accounts/report/purchase_register/purchase_register.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/report/purchase_register/purchase_register.py b/erpnext/accounts/report/purchase_register/purchase_register.py index 9a90f2f235..4bba066f44 100644 --- a/erpnext/accounts/report/purchase_register/purchase_register.py +++ b/erpnext/accounts/report/purchase_register/purchase_register.py @@ -147,10 +147,11 @@ def get_invoice_expense_map(invoice_list): def get_invoice_tax_map(invoice_list, invoice_expense_map, expense_accounts): tax_details = frappe.db.sql(""" - select parent, account_head, sum(base_tax_amount_after_discount_amount) as tax_amount + select parent, account_head, case add_deduct_tax when "Add" then sum(base_tax_amount_after_discount_amount) + else sum(base_tax_amount_after_discount_amount) * -1 end as tax_amount from `tabPurchase Taxes and Charges` where parent in (%s) and category in ('Total', 'Valuation and Total') - group by parent, account_head + group by parent, account_head, add_deduct_tax """ % ', '.join(['%s']*len(invoice_list)), tuple([inv.name for inv in invoice_list]), as_dict=1) invoice_tax_map = {} From 36a0c5c5646ff837f1477dbb2bdf23c700da5443 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 9 Jun 2016 16:29:12 +0530 Subject: [PATCH 3/7] [fix] change in versioning: store __version__ in __init__.py --- erpnext/__init__.py | 5 ++++- erpnext/__version__.py | 2 -- erpnext/hooks.py | 2 +- setup.py | 10 +++++++++- 4 files changed, 14 insertions(+), 5 deletions(-) delete mode 100644 erpnext/__version__.py diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 60bec4fbec..3ef27a4032 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -1 +1,4 @@ -from erpnext.__version__ import __version__ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +__version__ = '6.27.22' diff --git a/erpnext/__version__.py b/erpnext/__version__.py deleted file mode 100644 index c27ae20f2a..0000000000 --- a/erpnext/__version__.py +++ /dev/null @@ -1,2 +0,0 @@ -from __future__ import unicode_literals -__version__ = '6.27.22' diff --git a/erpnext/hooks.py b/erpnext/hooks.py index a94acffb76..184004c11a 100644 --- a/erpnext/hooks.py +++ b/erpnext/hooks.py @@ -1,5 +1,6 @@ from __future__ import unicode_literals from frappe import _ +from . import __version__ as app_version app_name = "erpnext" app_title = "ERPNext" @@ -7,7 +8,6 @@ app_publisher = "Frappe Technologies Pvt. Ltd." app_description = """ERP made simple""" app_icon = "icon-th" app_color = "#e74c3c" -app_version = "6.27.22" app_email = "info@erpnext.com" app_license = "GNU General Public License (v3)" source_link = "https://github.com/frappe/erpnext" diff --git a/setup.py b/setup.py index d592c5f3cd..5dd87abb5b 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,15 @@ +# -*- coding: utf-8 -*- from setuptools import setup, find_packages from pip.req import parse_requirements +import re, ast + +# get version from __version__ variable in erpnext/__init__.py +_version_re = re.compile(r'__version__\s+=\s+(.*)') + +with open('erpnext/__init__.py', 'rb') as f: + version = str(ast.literal_eval(_version_re.search( + f.read().decode('utf-8')).group(1))) -version = "6.27.22" requirements = parse_requirements("requirements.txt", session="") setup( From 8f6e6ff543953bf35ebe63c5519c0d9e7272baef Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 9 Jun 2016 16:56:54 +0530 Subject: [PATCH 4/7] [fix] removed bad import --- erpnext/controllers/tests/__init__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/erpnext/controllers/tests/__init__.py b/erpnext/controllers/tests/__init__.py index 60bec4fbec..e69de29bb2 100644 --- a/erpnext/controllers/tests/__init__.py +++ b/erpnext/controllers/tests/__init__.py @@ -1 +0,0 @@ -from erpnext.__version__ import __version__ From 2dd26055c981928e57629cf20f164f36571d7b38 Mon Sep 17 00:00:00 2001 From: Rohit Waghchaure Date: Sat, 11 Jun 2016 01:36:23 +0530 Subject: [PATCH 5/7] [Fix] Shipping address's get_query not working on autocomplete. --- .../purchase_common/purchase_common.js | 39 ++++++++++--------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.js b/erpnext/buying/doctype/purchase_common/purchase_common.js index c67a30fb69..9b316e4473 100644 --- a/erpnext/buying/doctype/purchase_common/purchase_common.js +++ b/erpnext/buying/doctype/purchase_common/purchase_common.js @@ -14,6 +14,26 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({ onload: function() { this.setup_queries(); this._super(); + + if(this.frm.get_field('shipping_address')) { + this.frm.set_query("shipping_address", function(){ + if(me.frm.doc.customer){ + return{ + filters:{ + "customer": me.frm.doc.customer + } + } + } + else{ + return{ + filters:{ + "is_your_company_address": 1, + "company": me.frm.doc.company + } + } + } + }); + } }, setup_queries: function() { @@ -174,25 +194,6 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({ shipping_address: function(){ var me = this; - - this.frm.set_query("shipping_address", function(){ - if(me.frm.doc.customer){ - return{ - filters:{ - "customer": me.frm.doc.customer - } - } - } - else{ - return{ - filters:{ - "is_your_company_address": 1, - "company": me.frm.doc.company - } - } - } - }); - erpnext.utils.get_address_display(this.frm, "shipping_address", "shipping_address_display", is_your_company_address=true) } From f8122646ba5a1b7a741aa749bd63d061d7d531a8 Mon Sep 17 00:00:00 2001 From: Maxwell Morais Date: Mon, 18 Apr 2016 13:24:25 -0300 Subject: [PATCH 6/7] Set `get_contact_details` and `get_address_display` to the right standard! --- erpnext/crm/doctype/opportunity/opportunity.js | 4 +++- .../maintenance_schedule/maintenance_schedule.js | 10 ++++++---- .../doctype/maintenance_visit/maintenance_visit.js | 12 +++++++----- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/erpnext/crm/doctype/opportunity/opportunity.js b/erpnext/crm/doctype/opportunity/opportunity.js index a918cf3257..9bf11df9b5 100644 --- a/erpnext/crm/doctype/opportunity/opportunity.js +++ b/erpnext/crm/doctype/opportunity/opportunity.js @@ -8,7 +8,9 @@ frappe.ui.form.on("Opportunity", { customer: function(frm) { erpnext.utils.get_party_details(frm); }, - customer_address: erpnext.utils.get_address_display, + customer_address: function(frm, cdt, cdn){ + erpnext.utils.get_address_display(frm, 'customer_address', 'address_display', false); + }, contact_person: erpnext.utils.get_contact_details, enquiry_from: function(frm) { frm.toggle_reqd("lead", frm.doc.enquiry_from==="Lead"); diff --git a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js index 650429c8d9..b1cd3e2bfc 100644 --- a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js +++ b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js @@ -5,10 +5,12 @@ frappe.provide("erpnext.support"); frappe.ui.form.on_change("Maintenance Schedule", "customer", function(frm) { erpnext.utils.get_party_details(frm) }); -frappe.ui.form.on_change("Maintenance Schedule", "customer_address", - erpnext.utils.get_address_display); -frappe.ui.form.on_change("Maintenance Schedule", "contact_person", - erpnext.utils.get_contact_details); +frappe.ui.form.on_change("Maintenance Schedule", "customer_address", function(){ + erpnext.utils.get_address_display(cur_frm, 'customer_address', 'address_display'); +}); +frappe.ui.form.on_change("Maintenance Schedule", "contact_person", function(){ + erpnext.utils.get_contact_details(cur_frm); +}); // TODO commonify this code erpnext.support.MaintenanceSchedule = frappe.ui.form.Controller.extend({ diff --git a/erpnext/support/doctype/maintenance_visit/maintenance_visit.js b/erpnext/support/doctype/maintenance_visit/maintenance_visit.js index 65a84c0903..c748bae095 100644 --- a/erpnext/support/doctype/maintenance_visit/maintenance_visit.js +++ b/erpnext/support/doctype/maintenance_visit/maintenance_visit.js @@ -6,10 +6,12 @@ frappe.require("assets/erpnext/js/utils.js"); frappe.ui.form.on_change("Maintenance Visit", "customer", function(frm) { erpnext.utils.get_party_details(frm) }); -frappe.ui.form.on_change("Maintenance Visit", "customer_address", - erpnext.utils.get_address_display); -frappe.ui.form.on_change("Maintenance Visit", "contact_person", - erpnext.utils.get_contact_details); +frappe.ui.form.on_change("Maintenance Visit", "customer_address", function(frm){ + erpnext.utils.get_address_display(frm, 'customer_address', 'address_display') +}); +frappe.ui.form.on_change("Maintenance Visit", "contact_person", function(frm){ + erpnext.utils.get_contact_details(frm) +}); // TODO commonify this code erpnext.support.MaintenanceVisit = frappe.ui.form.Controller.extend({ @@ -87,4 +89,4 @@ cur_frm.fields_dict['purposes'].grid.get_field('item_code').get_query = function cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) { return {query: "erpnext.controllers.queries.customer_query" } -} \ No newline at end of file +} From 2eb9b34ff21d501120cc276d85251fed492e6cba Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Tue, 21 Jun 2016 17:11:34 +0600 Subject: [PATCH 7/7] bumped to version 6.27.23 --- erpnext/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/__init__.py b/erpnext/__init__.py index 3ef27a4032..cda08ac875 100644 --- a/erpnext/__init__.py +++ b/erpnext/__init__.py @@ -1,4 +1,4 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals -__version__ = '6.27.22' +__version__ = '6.27.23'