Skip to content

Commit

Permalink
Merge branch 'hotfix'
Browse files Browse the repository at this point in the history
  • Loading branch information
mbauskar committed Jul 5, 2017
2 parents ea92682 + 4b7a30b commit 9fbdf14
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 18 deletions.
2 changes: 1 addition & 1 deletion erpnext/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from __future__ import unicode_literals
import frappe

__version__ = '8.2.3'
__version__ = '8.2.4'


def get_default_company(user=None):
Expand Down
9 changes: 4 additions & 5 deletions erpnext/accounts/doctype/journal_entry/journal_entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -733,11 +733,10 @@ def get_opening_accounts(company):
accounts = frappe.db.sql_list("""select
name from tabAccount
where
is_group=0 and
report_type='Balance Sheet' and
ifnull(warehouse, '') = '' and
company=%s
order by name asc""", company)
is_group=0 and report_type='Balance Sheet' and company=%s and
name not in(select distinct account from tabWarehouse where
account is not null and account != '')
order by name asc""", frappe.db.escape(company))

return [{"account": a, "balance": get_balance_on(a)} for a in accounts]

Expand Down
2 changes: 2 additions & 0 deletions erpnext/accounts/doctype/sales_invoice/sales_invoice.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,12 @@ cur_frm.cscript.hide_fields = function(doc) {
}
}

/*
var item_fields_stock = ['batch_no', 'actual_batch_qty', 'actual_qty', 'expense_account',
'warehouse', 'expense_account', 'quality_inspection']
cur_frm.fields_dict['items'].grid.set_column_disp(item_fields_stock,
(cint(doc.update_stock)==1 || cint(doc.is_return)==1 ? true : false));
*/

// India related fields
if (frappe.boot.sysdefaults.country == 'India') unhide_field(['c_form_applicable', 'c_form_no']);
Expand Down
17 changes: 9 additions & 8 deletions erpnext/accounts/doctype/sales_invoice/sales_invoice.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ def on_submit(self):
if not self.is_return:
self.update_billing_status_for_zero_amount_refdoc("Sales Order")
self.check_credit_limit()

if self.update_stock:
self.update_serial_no()

if not cint(self.is_pos) == 1 and not self.is_return:
Expand Down Expand Up @@ -793,19 +795,18 @@ def on_recurring(self, reference_doc):

def update_serial_no(self, in_cancel=False):
""" update Sales Invoice refrence in Serial No """
invoice = None if (in_cancel or self.is_return) else self.name
if in_cancel and self.is_return:
invoice = self.return_against

for item in self.items:
if not item.serial_no:
continue

serial_nos = ["'%s'"%serial_no for serial_no in item.serial_no.split("\n")]

frappe.db.sql(""" update `tabSerial No` set sales_invoice='{invoice}'
where name in ({serial_nos})""".format(
invoice='' if in_cancel else self.name,
serial_nos=",".join(serial_nos)
)
)
for serial_no in item.serial_no.split("\n"):
sno = frappe.get_doc('Serial No', serial_no)
sno.sales_invoice = invoice
sno.db_update()

def validate_serial_numbers(self):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1423,7 +1423,7 @@
"collapsible": 1,
"collapsible_depends_on": "eval:doc.serial_no || doc.batch_no",
"columns": 0,
"depends_on": "eval: parent.update_stock",
"depends_on": "",
"fieldname": "warehouse_and_reference",
"fieldtype": "Section Break",
"hidden": 0,
Expand Down Expand Up @@ -2165,7 +2165,7 @@
"issingle": 0,
"istable": 1,
"max_attachments": 0,
"modified": "2017-05-10 17:14:42.681757",
"modified": "2017-07-03 19:34:14.820285",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Sales Invoice Item",
Expand Down
1 change: 1 addition & 0 deletions erpnext/patches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -410,3 +410,4 @@ erpnext.patches.v8_0.save_system_settings
erpnext.patches.v8_1.delete_deprecated_reports
erpnext.patches.v8_1.setup_gst_india #2017-06-27
execute:frappe.reload_doc('regional', 'doctype', 'gst_hsn_code')
erpnext.patches.v8_1.removed_roles_from_gst_report_non_indian_account
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2017, Frappe and Contributors
# License: GNU General Public License v3. See license.txt

from __future__ import unicode_literals
import frappe

def execute():
frappe.reload_doc('core', 'doctype', 'has_role')
company = frappe.get_all('Company', filters = {'country': 'India'})

if not company:
frappe.db.sql("""
delete from
`tabHas Role`
where
parenttype = 'Report' and parent in('GST Sales Register',
'GST Purchase Register', 'GST Itemised Sales Register',
'GST Itemised Purchase Register')""")
5 changes: 3 additions & 2 deletions erpnext/regional/doctype/gst_hsn_code/gst_hsn_code.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"issingle": 0,
"istable": 0,
"max_attachments": 0,
"modified": "2017-06-29 21:28:09.053351",
"modified": "2017-06-30 20:12:57.903983",
"modified_by": "Administrator",
"module": "Regional",
"name": "GST HSN Code",
Expand All @@ -94,10 +94,11 @@
"quick_entry": 1,
"read_only": 0,
"read_only_onload": 0,
"search_fields": "description",
"search_fields": "hsn_code, description",
"show_name_in_global_search": 0,
"sort_field": "modified",
"sort_order": "DESC",
"title_field": "hsn_code",
"track_changes": 1,
"track_seen": 0
}

0 comments on commit 9fbdf14

Please sign in to comment.