rename Profile to User frappe/frappe#470

This commit is contained in:
Rushabh Mehta
2014-03-11 16:15:05 +05:30
parent c379c78fec
commit 7c932003ed
62 changed files with 196 additions and 196 deletions

View File

@@ -68,7 +68,7 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
this.show_general_ledger();
if(this.frm.doc.docstatus === 1 &&
frappe.boot.profile.can_create.indexOf("Journal Voucher")!==-1) {
frappe.boot.user.can_create.indexOf("Journal Voucher")!==-1) {
if(this.frm.doc.purpose === "Sales Return") {
this.frm.add_custom_button(frappe._("Make Credit Note"), function() { me.make_return_jv(); });
this.add_excise_button();

View File

@@ -765,7 +765,7 @@ class TestStockEntry(unittest.TestCase):
def test_warehouse_company_validation(self):
set_perpetual_inventory(0)
self._clear_stock_account_balance()
frappe.bean("Profile", "test2@example.com").get_controller()\
frappe.bean("User", "test2@example.com").get_controller()\
.add_roles("Sales User", "Sales Manager", "Material User", "Material Manager")
frappe.set_user("test2@example.com")
@@ -783,9 +783,9 @@ class TestStockEntry(unittest.TestCase):
frappe.defaults.add_default("Warehouse", "_Test Warehouse 1 - _TC1", "test@example.com", "Restriction")
frappe.defaults.add_default("Warehouse", "_Test Warehouse 2 - _TC1", "test2@example.com", "Restriction")
frappe.bean("Profile", "test@example.com").get_controller()\
frappe.bean("User", "test@example.com").get_controller()\
.add_roles("Sales User", "Sales Manager", "Material User", "Material Manager")
frappe.bean("Profile", "test2@example.com").get_controller()\
frappe.bean("User", "test2@example.com").get_controller()\
.add_roles("Sales User", "Sales Manager", "Material User", "Material Manager")
frappe.set_user("test@example.com")

View File

@@ -20,7 +20,7 @@
"in_list_view": 1,
"label": "User",
"name": "__common__",
"options": "Profile",
"options": "User",
"parent": "Warehouse User",
"parentfield": "fields",
"parenttype": "DocType",

View File

@@ -289,7 +289,7 @@ def send_email_notification(mr_list):
""" Notify user about auto creation of indent"""
email_list = frappe.db.sql_list("""select distinct r.parent
from tabUserRole r, tabProfile p
from tabUserRole r, tabUser p
where p.name = r.parent and p.enabled = 1 and p.docstatus < 2
and r.role in ('Purchase Manager','Material Manager')
and p.name not in ('Administrator', 'All', 'Guest')""")
@@ -320,5 +320,5 @@ def notify_errors(exceptions_list):
Regards,
Administrator""" % ("\n\n".join(["\n".join(msg) for msg in exceptions_list]),)
from frappe.profile import get_system_managers
from frappe.utils.user import get_system_managers
sendmail(get_system_managers(), subject=subject, msg=msg)