mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-02 19:59:12 +00:00
merged with master
This commit is contained in:
@@ -10,9 +10,10 @@ def get_companies():
|
||||
# check if match permission exists
|
||||
res = webnotes.conn.sql("""select role, `match` from `tabDocPerm`
|
||||
where parent='Account' and permlevel=0 and `read`=1""", as_dict=1)
|
||||
|
||||
|
||||
roles = webnotes.user.get_roles()
|
||||
match = any((r["match"] for r in res
|
||||
if r["role"] in webnotes.user.roles and r["match"]=="company"))
|
||||
if r["role"] in roles and r["match"]=="company"))
|
||||
|
||||
# if match == company is specified and companies are specified in user defaults
|
||||
if match and webnotes.user.get_defaults().get("company"):
|
||||
|
||||
@@ -230,7 +230,7 @@ def get_data(rows, company_abbr):
|
||||
accounts = [c for c in rows[i+1] if c.endswith(" - " + company_abbr)]
|
||||
|
||||
if accounts and (len(columns) != rows[i+1].index(accounts[0])):
|
||||
raise Exception, """A non-account column cannot be after an account \
|
||||
column. Please rectify it in the file and try again."""
|
||||
raise Exception, """All account columns should be after standard columns and \
|
||||
on the right. Please rectify it in the file and try again."""
|
||||
|
||||
return data, start_row_idx
|
||||
Reference in New Issue
Block a user