Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
nabinhait committed May 11, 2017
2 parents 0d0d3ba + b579fd7 commit fcefc60
Show file tree
Hide file tree
Showing 73 changed files with 734 additions and 1,762 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.0.24'
__version__ = '8.0.25'

def get_default_company(user=None):
'''Get default company for user'''
Expand Down
6 changes: 3 additions & 3 deletions erpnext/accounts/doctype/account/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ def validate_warehouse_account(self):
account_balance = get_balance_on(self.name)

if account_balance != stock_balance:
frappe.throw(_('Account balance ({0}) and stock value ({1}) must be same')\
.format(fmt_money(account_balance, currency=self.account_currency),
fmt_money(stock_balance, currency=self.account_currency)))
frappe.throw(_('Account balance ({0}) for {1} and stock value ({2}) for warehouse {3} must be same')
.format(fmt_money(account_balance, currency=self.account_currency), self.name,
fmt_money(stock_balance, currency=self.account_currency), self.warehouse))

elif self.warehouse:
self.warehouse = None
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@ def on_update(self):
company.save()

# Create account head for warehouses
warehouse_list = frappe.db.sql("select name, company from tabWarehouse", as_dict=1)
warehouse_list = frappe.db.sql("""select name, company from tabWarehouse
where disabled=0""", as_dict=1)
warehouse_with_no_company = [d.name for d in warehouse_list if not d.company]
if warehouse_with_no_company:
frappe.throw(_("Company is missing in warehouses {0}").format(comma_and(warehouse_with_no_company)))
frappe.throw(_("Company is missing in warehouses {0}")
.format(comma_and(warehouse_with_no_company)))

for wh in warehouse_list:
wh_doc = frappe.get_doc("Warehouse", wh.name)
wh_doc.flags.ignore_permissions = True
Expand Down
Loading

0 comments on commit fcefc60

Please sign in to comment.