Merge branch 'hotfix'

This commit is contained in:
mbauskar 2017-07-05 11:25:14 +05:30
commit 9fbdf14e61
8 changed files with 40 additions and 18 deletions

View File

@ -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):

View File

@ -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]

View File

@ -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']);

View File

@ -131,6 +131,8 @@ class SalesInvoice(SellingController):
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:
@ -793,19 +795,18 @@ class SalesInvoice(SellingController):
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):
"""

View File

@ -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,
@ -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",

View File

@ -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

View File

@ -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')""")

View File

@ -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",
@ -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
}