\
\
\
+ '+__("Make Payment")+'\
\
\
\
+ '+__("Del")+'\
\
\
'+frappe._('Please setup your chart of accounts before you start Accounting Entries')+'
').appendTo(main);
- if (frappe.boot.profile.can_create.indexOf("Company") !== -1) {
+ if (frappe.boot.user.can_create.indexOf("Company") !== -1) {
wrapper.appframe.add_button(frappe._('New Company'), function() { newdoc('Company'); },
'icon-plus');
}
@@ -137,7 +137,7 @@ erpnext.AccountsChart = Class.extend({
{
condition: function(node) {
return !node.root && me.ctype === 'Account'
- && frappe.boot.profile.can_read.indexOf("GL Entry") !== -1
+ && frappe.boot.user.can_read.indexOf("GL Entry") !== -1
},
label: __("View Ledger"),
click: function(node, btn) {
diff --git a/erpnext/accounts/report/accounts_payable/accounts_payable.txt b/erpnext/accounts/report/accounts_payable/accounts_payable.txt
index 6de97f64e6..9d20510314 100644
--- a/erpnext/accounts/report/accounts_payable/accounts_payable.txt
+++ b/erpnext/accounts/report/accounts_payable/accounts_payable.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-04-22 16:16:03",
"docstatus": 0,
- "modified": "2013-04-30 17:55:54",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -10,6 +10,7 @@
"add_total_row": 1,
"doctype": "Report",
"is_standard": "Yes",
+ "module": "Accounts",
"name": "__common__",
"ref_doctype": "Purchase Invoice",
"report_name": "Accounts Payable",
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.txt b/erpnext/accounts/report/accounts_receivable/accounts_receivable.txt
index d01bef23d3..6da3088abe 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.txt
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-04-16 11:31:13",
"docstatus": 0,
- "modified": "2013-05-24 12:02:52",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -10,6 +10,7 @@
"add_total_row": 1,
"doctype": "Report",
"is_standard": "Yes",
+ "module": "Accounts",
"name": "__common__",
"ref_doctype": "Sales Invoice",
"report_name": "Accounts Receivable",
diff --git a/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.txt b/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.txt
index 3dd2079f3a..3b462a0114 100644
--- a/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.txt
+++ b/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.txt
@@ -2,13 +2,14 @@
{
"creation": "2013-05-01 12:13:25",
"docstatus": 0,
- "modified": "2013-05-01 12:13:25",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"doctype": "Report",
"is_standard": "Yes",
+ "module": "Accounts",
"name": "__common__",
"ref_doctype": "Journal Voucher",
"report_name": "Bank Clearance Summary",
diff --git a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.txt b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.txt
index 9867c5ded7..a2436a8eb0 100644
--- a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.txt
+++ b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-04-30 18:30:21",
"docstatus": 0,
- "modified": "2013-05-01 10:53:12",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -10,6 +10,7 @@
"add_total_row": 0,
"doctype": "Report",
"is_standard": "Yes",
+ "module": "Accounts",
"name": "__common__",
"ref_doctype": "Journal Voucher",
"report_name": "Bank Reconciliation Statement",
diff --git a/erpnext/accounts/report/budget_variance_report/budget_variance_report.txt b/erpnext/accounts/report/budget_variance_report/budget_variance_report.txt
index b89cb4545f..be9ce13a22 100644
--- a/erpnext/accounts/report/budget_variance_report/budget_variance_report.txt
+++ b/erpnext/accounts/report/budget_variance_report/budget_variance_report.txt
@@ -2,13 +2,14 @@
{
"creation": "2013-06-18 12:56:36",
"docstatus": 0,
- "modified": "2013-06-18 12:56:36",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"doctype": "Report",
"is_standard": "Yes",
+ "module": "Accounts",
"name": "__common__",
"ref_doctype": "Cost Center",
"report_name": "Budget Variance Report",
diff --git a/erpnext/accounts/report/customer_account_head/customer_account_head.txt b/erpnext/accounts/report/customer_account_head/customer_account_head.txt
index d258facd8a..c2a856bb94 100644
--- a/erpnext/accounts/report/customer_account_head/customer_account_head.txt
+++ b/erpnext/accounts/report/customer_account_head/customer_account_head.txt
@@ -2,13 +2,14 @@
{
"creation": "2013-06-03 16:17:34",
"docstatus": 0,
- "modified": "2013-06-03 16:17:34",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"doctype": "Report",
"is_standard": "Yes",
+ "module": "Accounts",
"name": "__common__",
"ref_doctype": "Account",
"report_name": "Customer Account Head",
diff --git a/erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.txt b/erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.txt
index f16aaaa964..a525d2df58 100644
--- a/erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.txt
+++ b/erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.txt
@@ -2,13 +2,14 @@
{
"creation": "2013-07-30 17:28:49",
"docstatus": 0,
- "modified": "2014-02-11 12:40:04",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"doctype": "Report",
"is_standard": "Yes",
+ "module": "Accounts",
"name": "__common__",
"query": "select\n `tabDelivery Note`.`name` as \"Delivery Note:Link/Delivery Note:120\",\n\t`tabDelivery Note`.`customer` as \"Customer:Link/Customer:120\",\n\t`tabDelivery Note`.`posting_date` as \"Date:Date\",\n\t`tabDelivery Note`.`project_name` as \"Project\",\n\t`tabDelivery Note Item`.`item_code` as \"Item:Link/Item:120\",\n\t(`tabDelivery Note Item`.`qty` - ifnull((select sum(qty) from `tabSales Invoice Item` \n\t where `tabSales Invoice Item`.docstatus=1 and \n `tabSales Invoice Item`.delivery_note = `tabDelivery Note`.name and\n\t `tabSales Invoice Item`.dn_detail = `tabDelivery Note Item`.name), 0))\n\t\tas \"Qty:Float:110\",\n\t(`tabDelivery Note Item`.`base_amount` - ifnull((select sum(base_amount) from `tabSales Invoice Item` \n where `tabSales Invoice Item`.docstatus=1 and \n `tabSales Invoice Item`.delivery_note = `tabDelivery Note`.name and\n `tabSales Invoice Item`.dn_detail = `tabDelivery Note Item`.name), 0))\n\t\tas \"Amount:Currency:110\",\n\t`tabDelivery Note Item`.`item_name` as \"Item Name::150\",\n\t`tabDelivery Note Item`.`description` as \"Description::200\"\nfrom `tabDelivery Note`, `tabDelivery Note Item`\nwhere\n `tabDelivery Note`.docstatus = 1 and\n\t`tabDelivery Note`.`status` != \"Stopped\" and\n `tabDelivery Note`.name = `tabDelivery Note Item`.parent and\n (`tabDelivery Note Item`.qty > ifnull((select sum(qty) from `tabSales Invoice Item` \n where `tabSales Invoice Item`.docstatus=1 and \n `tabSales Invoice Item`.delivery_note = `tabDelivery Note`.name and\n `tabSales Invoice Item`.dn_detail = `tabDelivery Note Item`.name), 0))\norder by `tabDelivery Note`.`name` desc",
"ref_doctype": "Sales Invoice",
diff --git a/erpnext/accounts/report/general_ledger/general_ledger.txt b/erpnext/accounts/report/general_ledger/general_ledger.txt
index ef169dbe88..cdfb033d0a 100644
--- a/erpnext/accounts/report/general_ledger/general_ledger.txt
+++ b/erpnext/accounts/report/general_ledger/general_ledger.txt
@@ -2,13 +2,14 @@
{
"creation": "2013-12-06 13:22:23",
"docstatus": 0,
- "modified": "2013-12-06 13:22:23",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"doctype": "Report",
"is_standard": "Yes",
+ "module": "Accounts",
"name": "__common__",
"ref_doctype": "GL Entry",
"report_name": "General Ledger",
diff --git a/erpnext/accounts/report/gross_profit/gross_profit.txt b/erpnext/accounts/report/gross_profit/gross_profit.txt
index bc21484f1c..56776600eb 100644
--- a/erpnext/accounts/report/gross_profit/gross_profit.txt
+++ b/erpnext/accounts/report/gross_profit/gross_profit.txt
@@ -2,13 +2,14 @@
{
"creation": "2013-02-25 17:03:34",
"docstatus": 0,
- "modified": "2013-02-25 17:03:34",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"doctype": "Report",
"is_standard": "Yes",
+ "module": "Accounts",
"name": "__common__",
"ref_doctype": "Sales Invoice",
"report_name": "Gross Profit",
diff --git a/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.txt b/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.txt
index 7ded5ff583..3dbd53614b 100644
--- a/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.txt
+++ b/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-06-05 15:37:30",
"docstatus": 0,
- "modified": "2013-06-05 15:37:30",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -10,6 +10,7 @@
"add_total_row": 1,
"doctype": "Report",
"is_standard": "Yes",
+ "module": "Accounts",
"name": "__common__",
"ref_doctype": "Purchase Invoice",
"report_name": "Item-wise Purchase Register",
diff --git a/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.txt b/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.txt
index fb0555d459..8d30644c39 100644
--- a/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.txt
+++ b/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-13 17:50:55",
"docstatus": 0,
- "modified": "2013-05-13 17:50:55",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -10,6 +10,7 @@
"add_total_row": 1,
"doctype": "Report",
"is_standard": "Yes",
+ "module": "Accounts",
"name": "__common__",
"ref_doctype": "Sales Invoice",
"report_name": "Item-wise Sales Register",
diff --git a/erpnext/accounts/report/ordered_items_to_be_billed/ordered_items_to_be_billed.txt b/erpnext/accounts/report/ordered_items_to_be_billed/ordered_items_to_be_billed.txt
index 8960823f89..09b6cff971 100644
--- a/erpnext/accounts/report/ordered_items_to_be_billed/ordered_items_to_be_billed.txt
+++ b/erpnext/accounts/report/ordered_items_to_be_billed/ordered_items_to_be_billed.txt
@@ -2,13 +2,14 @@
{
"creation": "2013-02-21 14:26:44",
"docstatus": 0,
- "modified": "2014-02-11 15:53:01",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"doctype": "Report",
"is_standard": "Yes",
+ "module": "Accounts",
"name": "__common__",
"query": "select \n `tabSales Order`.`name` as \"Sales Order:Link/Sales Order:120\",\n `tabSales Order`.`customer` as \"Customer:Link/Customer:120\",\n `tabSales Order`.`status` as \"Status\",\n `tabSales Order`.`transaction_date` as \"Date:Date\",\n `tabSales Order`.`project_name` as \"Project\",\n `tabSales Order Item`.item_code as \"Item:Link/Item:120\",\n `tabSales Order Item`.base_amount as \"Amount:Currency:110\",\n (`tabSales Order Item`.billed_amt * ifnull(`tabSales Order`.conversion_rate, 1)) as \"Billed Amount:Currency:110\",\n (ifnull(`tabSales Order Item`.base_amount, 0) - (ifnull(`tabSales Order Item`.billed_amt, 0) * ifnull(`tabSales Order`.conversion_rate, 1))) as \"Pending Amount:Currency:120\",\n `tabSales Order Item`.item_name as \"Item Name::150\",\n `tabSales Order Item`.description as \"Description::200\"\nfrom\n `tabSales Order`, `tabSales Order Item`\nwhere\n `tabSales Order Item`.`parent` = `tabSales Order`.`name`\n and `tabSales Order`.docstatus = 1\n and `tabSales Order`.status != \"Stopped\"\n and ifnull(`tabSales Order Item`.billed_amt,0) < ifnull(`tabSales Order Item`.amount,0)\norder by `tabSales Order`.transaction_date asc",
"ref_doctype": "Sales Invoice",
diff --git a/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.txt b/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.txt
index 408060240c..e48ea69ecc 100644
--- a/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.txt
+++ b/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-12-02 17:06:37",
"docstatus": 0,
- "modified": "2013-12-02 17:06:39",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -10,6 +10,7 @@
"add_total_row": 1,
"doctype": "Report",
"is_standard": "Yes",
+ "module": "Accounts",
"name": "__common__",
"ref_doctype": "Journal Voucher",
"report_name": "Payment Period Based On Invoice Date",
diff --git a/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.txt b/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.txt
index 1d5c2d5f45..20e5a53f51 100644
--- a/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.txt
+++ b/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.txt
@@ -2,13 +2,14 @@
{
"creation": "2013-06-13 18:46:55",
"docstatus": 0,
- "modified": "2013-06-13 18:46:55",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"doctype": "Report",
"is_standard": "Yes",
+ "module": "Accounts",
"name": "__common__",
"ref_doctype": "Purchase Invoice",
"report_name": "Purchase Invoice Trends",
diff --git a/erpnext/accounts/report/purchase_order_items_to_be_billed/purchase_order_items_to_be_billed.txt b/erpnext/accounts/report/purchase_order_items_to_be_billed/purchase_order_items_to_be_billed.txt
index bcde486374..88990cb6d1 100644
--- a/erpnext/accounts/report/purchase_order_items_to_be_billed/purchase_order_items_to_be_billed.txt
+++ b/erpnext/accounts/report/purchase_order_items_to_be_billed/purchase_order_items_to_be_billed.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-28 15:54:16",
"docstatus": 0,
- "modified": "2014-02-11 13:01:05",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -10,6 +10,7 @@
"add_total_row": 1,
"doctype": "Report",
"is_standard": "Yes",
+ "module": "Accounts",
"name": "__common__",
"query": "select \n `tabPurchase Order`.`name` as \"Purchase Order:Link/Purchase Order:120\",\n `tabPurchase Order`.`transaction_date` as \"Date:Date:100\",\n\t`tabPurchase Order`.`supplier` as \"Supplier:Link/Supplier:120\",\n\t`tabPurchase Order Item`.`project_name` as \"Project\",\n\t`tabPurchase Order Item`.item_code as \"Item Code:Link/Item:120\",\n\t`tabPurchase Order Item`.base_amount as \"Amount:Currency:100\",\n\t`tabPurchase Order Item`.billed_amt as \"Billed Amount:Currency:100\", \n\t(`tabPurchase Order Item`.base_amount - ifnull(`tabPurchase Order Item`.billed_amt, 0)) as \"Amount to Bill:Currency:100\",\n\t`tabPurchase Order Item`.item_name as \"Item Name::150\",\n\t`tabPurchase Order Item`.description as \"Description::200\"\nfrom\n\t`tabPurchase Order`, `tabPurchase Order Item`\nwhere\n\t`tabPurchase Order Item`.`parent` = `tabPurchase Order`.`name`\n\tand `tabPurchase Order`.docstatus = 1\n\tand `tabPurchase Order`.status != \"Stopped\"\n\tand ifnull(`tabPurchase Order Item`.billed_amt, 0) < ifnull(`tabPurchase Order Item`.base_amount, 0)\norder by `tabPurchase Order`.transaction_date asc",
"ref_doctype": "Purchase Invoice",
diff --git a/erpnext/accounts/report/purchase_register/purchase_register.txt b/erpnext/accounts/report/purchase_register/purchase_register.txt
index 847f5f3b6c..f04f8e6498 100644
--- a/erpnext/accounts/report/purchase_register/purchase_register.txt
+++ b/erpnext/accounts/report/purchase_register/purchase_register.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-04-29 16:13:11",
"docstatus": 0,
- "modified": "2013-04-30 17:51:19",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -10,6 +10,7 @@
"add_total_row": 1,
"doctype": "Report",
"is_standard": "Yes",
+ "module": "Accounts",
"name": "__common__",
"ref_doctype": "Purchase Invoice",
"report_name": "Purchase Register",
diff --git a/erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.txt b/erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.txt
index f7afd3b3fb..3ecb2d8879 100644
--- a/erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.txt
+++ b/erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.txt
@@ -2,13 +2,14 @@
{
"creation": "2013-07-30 18:35:10",
"docstatus": 0,
- "modified": "2014-02-11 11:46:57",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"doctype": "Report",
"is_standard": "Yes",
+ "module": "Accounts",
"name": "__common__",
"query": "select\n `tabPurchase Receipt`.`name` as \"Purchase Receipt:Link/Purchase Receipt:120\",\n `tabPurchase Receipt`.`supplier` as \"Supplier:Link/Supplier:120\",\n\t`tabPurchase Receipt`.`posting_date` as \"Date:Date\",\n\t`tabPurchase Receipt Item`.`project_name` as \"Project\",\n\t`tabPurchase Receipt Item`.`item_code` as \"Item:Link/Item:120\",\n\t(`tabPurchase Receipt Item`.`qty` - ifnull((select sum(qty) from `tabPurchase Invoice Item` \n\t where `tabPurchase Invoice Item`.purchase_receipt = `tabPurchase Receipt`.name and\n\t `tabPurchase Invoice Item`.pr_detail = `tabPurchase Receipt Item`.name), 0))\n\t\tas \"Qty:Float:110\",\n\t(`tabPurchase Receipt Item`.`base_amount` - ifnull((select sum(base_amount) from `tabPurchase Invoice Item` \n where `tabPurchase Invoice Item`.purchase_receipt = `tabPurchase Receipt`.name and\n `tabPurchase Invoice Item`.pr_detail = `tabPurchase Receipt Item`.name), 0))\n\t\tas \"Amount:Currency:110\",\n\t`tabPurchase Receipt Item`.`item_name` as \"Item Name::150\",\n\t`tabPurchase Receipt Item`.`description` as \"Description::200\"\nfrom `tabPurchase Receipt`, `tabPurchase Receipt Item`\nwhere\n `tabPurchase Receipt`.docstatus = 1 and\n\t`tabPurchase Receipt`.`status` != \"Stopped\" and\n `tabPurchase Receipt`.name = `tabPurchase Receipt Item`.parent and\n (`tabPurchase Receipt Item`.qty > ifnull((select sum(qty) from `tabPurchase Invoice Item` \n where `tabPurchase Invoice Item`.purchase_receipt = `tabPurchase Receipt`.name and\n `tabPurchase Invoice Item`.pr_detail = `tabPurchase Receipt Item`.name), 0))\norder by `tabPurchase Receipt`.`name` desc",
"ref_doctype": "Purchase Invoice",
diff --git a/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.txt b/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.txt
index 279ac1269f..4ffc3499bf 100644
--- a/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.txt
+++ b/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.txt
@@ -2,13 +2,14 @@
{
"creation": "2013-06-13 18:44:21",
"docstatus": 0,
- "modified": "2013-06-13 18:44:21",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"doctype": "Report",
"is_standard": "Yes",
+ "module": "Accounts",
"name": "__common__",
"ref_doctype": "Sales Invoice",
"report_name": "Sales Invoice Trends",
diff --git a/erpnext/accounts/report/sales_partners_commission/sales_partners_commission.txt b/erpnext/accounts/report/sales_partners_commission/sales_partners_commission.txt
index 52bbf3c751..e79d415b96 100644
--- a/erpnext/accounts/report/sales_partners_commission/sales_partners_commission.txt
+++ b/erpnext/accounts/report/sales_partners_commission/sales_partners_commission.txt
@@ -2,13 +2,14 @@
{
"creation": "2013-05-06 12:28:23",
"docstatus": 0,
- "modified": "2013-05-06 12:41:15",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"doctype": "Report",
"is_standard": "Yes",
+ "module": "Accounts",
"name": "__common__",
"query": "SELECT\n sales_partner as \"Sales Partner:Link/Sales Partner:150\",\n\tsum(net_total) as \"Invoiced Amount (Exculsive Tax):Currency:210\",\n\tsum(total_commission) as \"Total Commission:Currency:150\",\n\tsum(total_commission)*100/sum(net_total) as \"Average Commission Rate:Currency:170\"\nFROM\n\t`tabSales Invoice`\nWHERE\n\tdocstatus = 1 and ifnull(net_total, 0) > 0 and ifnull(total_commission, 0) > 0\nGROUP BY\n\tsales_partner\nORDER BY\n\t\"Total Commission:Currency:120\"",
"ref_doctype": "Sales Invoice",
diff --git a/erpnext/accounts/report/sales_register/sales_register.txt b/erpnext/accounts/report/sales_register/sales_register.txt
index dbf41af0d0..40ac3b5018 100644
--- a/erpnext/accounts/report/sales_register/sales_register.txt
+++ b/erpnext/accounts/report/sales_register/sales_register.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-04-23 18:15:29",
"docstatus": 0,
- "modified": "2013-04-30 17:53:10",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -10,6 +10,7 @@
"add_total_row": 1,
"doctype": "Report",
"is_standard": "Yes",
+ "module": "Accounts",
"name": "__common__",
"ref_doctype": "Sales Invoice",
"report_name": "Sales Register",
diff --git a/erpnext/accounts/report/supplier_account_head/supplier_account_head.txt b/erpnext/accounts/report/supplier_account_head/supplier_account_head.txt
index b0554e8576..cf6e322016 100644
--- a/erpnext/accounts/report/supplier_account_head/supplier_account_head.txt
+++ b/erpnext/accounts/report/supplier_account_head/supplier_account_head.txt
@@ -2,13 +2,14 @@
{
"creation": "2013-06-04 12:56:17",
"docstatus": 0,
- "modified": "2013-06-04 12:56:46",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"doctype": "Report",
"is_standard": "Yes",
+ "module": "Accounts",
"name": "__common__",
"ref_doctype": "Account",
"report_name": "Supplier Account Head",
diff --git a/erpnext/buying/doctype/quality_inspection/quality_inspection.py b/erpnext/buying/doctype/quality_inspection/quality_inspection.py
index 0acb8eed77..972757f40e 100644
--- a/erpnext/buying/doctype/quality_inspection/quality_inspection.py
+++ b/erpnext/buying/doctype/quality_inspection/quality_inspection.py
@@ -40,7 +40,7 @@ def item_query(doctype, txt, searchfield, start, page_len, filters):
from frappe.widgets.reportview import get_match_cond
filters.update({
"txt": txt,
- "mcond": get_match_cond(filters["from"], searchfield),
+ "mcond": get_match_cond(filters["from"]),
"start": start,
"page_len": page_len
})
diff --git a/erpnext/buying/report/item_wise_purchase_history/item_wise_purchase_history.txt b/erpnext/buying/report/item_wise_purchase_history/item_wise_purchase_history.txt
index ca6b42490c..199599005d 100644
--- a/erpnext/buying/report/item_wise_purchase_history/item_wise_purchase_history.txt
+++ b/erpnext/buying/report/item_wise_purchase_history/item_wise_purchase_history.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-03 14:55:53",
"docstatus": 0,
- "modified": "2013-07-11 12:28:00",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -10,6 +10,7 @@
"add_total_row": 1,
"doctype": "Report",
"is_standard": "Yes",
+ "module": "Buying",
"name": "__common__",
"query": "select\n po_item.item_code as \"Item Code:Link/Item:120\",\n\tpo_item.item_name as \"Item Name::120\",\n\tpo_item.description as \"Description::150\",\n\tpo_item.qty as \"Qty:Float:100\",\n\tpo_item.stock_uom as \"UOM:Link/UOM:80\",\n\tpo_item.base_rate as \"Rate:Currency:120\",\n\tpo_item.base_amount as \"Amount:Currency:120\",\n\tpo.name as \"Purchase Order:Link/Purchase Order:120\",\n\tpo.transaction_date as \"Transaction Date:Date:140\",\n\tpo.supplier as \"Supplier:Link/Supplier:130\",\n\tpo_item.project_name as \"Project:Link/Project:130\",\n\tifnull(po_item.received_qty, 0) as \"Received Qty:Float:120\"\nfrom\n\t`tabPurchase Order` po, `tabPurchase Order Item` po_item\nwhere\n\tpo.name = po_item.parent and po.docstatus = 1\norder by po.name desc",
"ref_doctype": "Purchase Order",
diff --git a/erpnext/buying/report/purchase_order_trends/purchase_order_trends.txt b/erpnext/buying/report/purchase_order_trends/purchase_order_trends.txt
index 658dd4aab1..683279fc20 100644
--- a/erpnext/buying/report/purchase_order_trends/purchase_order_trends.txt
+++ b/erpnext/buying/report/purchase_order_trends/purchase_order_trends.txt
@@ -2,13 +2,14 @@
{
"creation": "2013-06-13 18:45:01",
"docstatus": 0,
- "modified": "2013-06-13 18:45:01",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"doctype": "Report",
"is_standard": "Yes",
+ "module": "Buying",
"name": "__common__",
"ref_doctype": "Purchase Order",
"report_name": "Purchase Order Trends",
diff --git a/erpnext/buying/report/requested_items_to_be_ordered/requested_items_to_be_ordered.txt b/erpnext/buying/report/requested_items_to_be_ordered/requested_items_to_be_ordered.txt
index 4d3558ca68..c3e91ae29d 100644
--- a/erpnext/buying/report/requested_items_to_be_ordered/requested_items_to_be_ordered.txt
+++ b/erpnext/buying/report/requested_items_to_be_ordered/requested_items_to_be_ordered.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-13 16:10:02",
"docstatus": 0,
- "modified": "2014-01-24 18:19:11",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -10,6 +10,7 @@
"add_total_row": 1,
"doctype": "Report",
"is_standard": "Yes",
+ "module": "Buying",
"name": "__common__",
"query": "select \n mr.name as \"Material Request:Link/Material Request:120\",\n\tmr.transaction_date as \"Date:Date:100\",\n\tmr_item.item_code as \"Item Code:Link/Item:120\",\n\tsum(ifnull(mr_item.qty, 0)) as \"Qty:Float:100\",\n\tsum(ifnull(mr_item.ordered_qty, 0)) as \"Ordered Qty:Float:100\", \n\t(sum(mr_item.qty) - sum(ifnull(mr_item.ordered_qty, 0))) as \"Qty to Order:Float:100\",\n\tmr_item.item_name as \"Item Name::150\",\n\tmr_item.description as \"Description::200\"\nfrom\n\t`tabMaterial Request` mr, `tabMaterial Request Item` mr_item\nwhere\n\tmr_item.parent = mr.name\n\tand mr.material_request_type = \"Purchase\"\n\tand mr.docstatus = 1\n\tand mr.status != \"Stopped\"\ngroup by mr.name, mr_item.item_code\nhaving\n\tsum(ifnull(mr_item.ordered_qty, 0)) < sum(ifnull(mr_item.qty, 0))\norder by mr.transaction_date asc",
"ref_doctype": "Purchase Order",
diff --git a/erpnext/buying/report/supplier_addresses_and_contacts/supplier_addresses_and_contacts.txt b/erpnext/buying/report/supplier_addresses_and_contacts/supplier_addresses_and_contacts.txt
index fac1e9e929..25c11e73c3 100644
--- a/erpnext/buying/report/supplier_addresses_and_contacts/supplier_addresses_and_contacts.txt
+++ b/erpnext/buying/report/supplier_addresses_and_contacts/supplier_addresses_and_contacts.txt
@@ -2,13 +2,14 @@
{
"creation": "2013-10-09 10:38:40",
"docstatus": 0,
- "modified": "2013-10-09 10:53:52",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"doctype": "Report",
"is_standard": "Yes",
+ "module": "Buying",
"name": "__common__",
"query": "SELECT\n `tabSupplier`.name as \"Supplier:Link/Supplier:120\",\n\t`tabSupplier`.supplier_name as \"Supplier Name::120\",\n\t`tabSupplier`.supplier_type as \"Supplier Type:Link/Supplier Type:120\",\n\tconcat_ws(', ', \n\t\ttrim(',' from `tabAddress`.address_line1), \n\t\ttrim(',' from tabAddress.address_line2), \n\t\ttabAddress.state, tabAddress.pincode, tabAddress.country\n\t) as 'Address::180',\n concat_ws(', ', `tabContact`.first_name, `tabContact`.last_name) as 'Contact Name::180',\n\t`tabContact`.phone as \"Phone\",\n\t`tabContact`.mobile_no as \"Mobile No\",\n\t`tabContact`.email_id as \"Email Id::120\",\n\t`tabContact`.is_primary_contact as \"Is Primary Contact::120\"\nFROM\n\t`tabSupplier`\n\tleft join `tabAddress` on (\n\t\t`tabAddress`.supplier=`tabSupplier`.name\n\t)\n\tleft join `tabContact` on (\n\t\t`tabContact`.supplier=`tabSupplier`.name\n\t)\nWHERE\n\t`tabSupplier`.docstatus<2\nORDER BY\n\t`tabSupplier`.name asc",
"ref_doctype": "Supplier",
diff --git a/erpnext/config/accounts.py b/erpnext/config/accounts.py
index 7ae67fa18b..2a47c2ab4f 100644
--- a/erpnext/config/accounts.py
+++ b/erpnext/config/accounts.py
@@ -103,9 +103,14 @@ data = [
},
{
"type": "doctype",
- "name": "Shipping Rules",
+ "name": "Shipping Rule",
"description": _("Rules for adding shipping costs.")
},
+ {
+ "type": "doctype",
+ "name": "Pricing Rule",
+ "description": _("Rules for applying pricing and discount.")
+ },
{
"type": "doctype",
"name": "Currency",
diff --git a/erpnext/config/buying.py b/erpnext/config/buying.py
index 41f689f287..0c8c2f647a 100644
--- a/erpnext/config/buying.py
+++ b/erpnext/config/buying.py
@@ -87,6 +87,11 @@ data = [
"description": _("Multiple Item prices."),
"route": "Report/Item Price"
},
+ {
+ "type": "doctype",
+ "name": "Pricing Rule",
+ "description": _("Rules for applying pricing and discount.")
+ },
]
},
{
diff --git a/erpnext/config/selling.py b/erpnext/config/selling.py
index 2646167f3a..65cec9e22e 100644
--- a/erpnext/config/selling.py
+++ b/erpnext/config/selling.py
@@ -121,7 +121,7 @@ data = [
},
{
"type": "doctype",
- "name": "Shipping Rules",
+ "name": "Shipping Rule",
"description": _("Rules for adding shipping costs.")
},
{
@@ -135,6 +135,11 @@ data = [
"description": _("Multiple Item prices."),
"route": "Report/Item Price"
},
+ {
+ "type": "doctype",
+ "name": "Pricing Rule",
+ "description": _("Rules for applying pricing and discount.")
+ },
{
"type": "doctype",
"name": "Sales BOM",
diff --git a/erpnext/controllers/queries.py b/erpnext/controllers/queries.py
index d5ea23257d..1f8077fc8d 100644
--- a/erpnext/controllers/queries.py
+++ b/erpnext/controllers/queries.py
@@ -4,6 +4,7 @@
from __future__ import unicode_literals
import frappe
from frappe.widgets.reportview import get_match_cond
+from frappe.model.db_query import DatabaseQuery
def get_filters_cond(doctype, filters, conditions):
if filters:
@@ -16,9 +17,12 @@ def get_filters_cond(doctype, filters, conditions):
else:
flt.append([doctype, f[0], '=', f[1]])
- from frappe.widgets.reportview import build_filter_conditions
- build_filter_conditions(flt, conditions)
- cond = ' and ' + ' and '.join(conditions)
+ query = DatabaseQuery(doctype)
+ query.filters = flt
+ query.conditions = conditions
+ query.build_filter_conditions()
+
+ cond = ' and ' + ' and '.join(query.conditions)
else:
cond = ''
return cond
@@ -36,7 +40,7 @@ def employee_query(doctype, txt, searchfield, start, page_len, filters):
case when employee_name like "%(txt)s" then 0 else 1 end,
name
limit %(start)s, %(page_len)s""" % {'key': searchfield, 'txt': "%%%s%%" % txt,
- 'mcond':get_match_cond(doctype, searchfield), 'start': start, 'page_len': page_len})
+ 'mcond':get_match_cond(doctype), 'start': start, 'page_len': page_len})
# searches for leads which are not converted
def lead_query(doctype, txt, searchfield, start, page_len, filters):
@@ -53,7 +57,7 @@ def lead_query(doctype, txt, searchfield, start, page_len, filters):
case when company_name like "%(txt)s" then 0 else 1 end,
lead_name asc
limit %(start)s, %(page_len)s""" % {'key': searchfield, 'txt': "%%%s%%" % txt,
- 'mcond':get_match_cond(doctype, searchfield), 'start': start, 'page_len': page_len})
+ 'mcond':get_match_cond(doctype), 'start': start, 'page_len': page_len})
# searches for customer
def customer_query(doctype, txt, searchfield, start, page_len, filters):
@@ -76,7 +80,7 @@ def customer_query(doctype, txt, searchfield, start, page_len, filters):
case when customer_name like "%(txt)s" then 0 else 1 end,
name, customer_name
limit %(start)s, %(page_len)s""" % {'field': fields,'key': searchfield,
- 'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype, searchfield),
+ 'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype),
'start': start, 'page_len': page_len})
# searches for supplier
@@ -98,7 +102,7 @@ def supplier_query(doctype, txt, searchfield, start, page_len, filters):
case when supplier_name like "%(txt)s" then 0 else 1 end,
name, supplier_name
limit %(start)s, %(page_len)s """ % {'field': fields,'key': searchfield,
- 'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype, searchfield), 'start': start,
+ 'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype), 'start': start,
'page_len': page_len})
def tax_account_query(doctype, txt, searchfield, start, page_len, filters):
@@ -134,7 +138,7 @@ def item_query(doctype, txt, searchfield, start, page_len, filters):
{fcond} {mcond}
limit %(start)s, %(page_len)s """.format(key=searchfield,
fcond=get_filters_cond(doctype, filters, conditions),
- mcond=get_match_cond(doctype, searchfield)),
+ mcond=get_match_cond(doctype)),
{
"today": nowdate(),
"txt": "%%%s%%" % txt,
@@ -153,7 +157,7 @@ def bom(doctype, txt, searchfield, start, page_len, filters):
%(fcond)s %(mcond)s
limit %(start)s, %(page_len)s """ % {'key': searchfield, 'txt': "%%%s%%" % txt,
'fcond': get_filters_cond(doctype, filters, conditions),
- 'mcond':get_match_cond(doctype, searchfield), 'start': start, 'page_len': page_len})
+ 'mcond':get_match_cond(doctype), 'start': start, 'page_len': page_len})
def get_project_name(doctype, txt, searchfield, start, page_len, filters):
cond = ''
@@ -165,7 +169,7 @@ def get_project_name(doctype, txt, searchfield, start, page_len, filters):
and %(cond)s `tabProject`.name like "%(txt)s" %(mcond)s
order by `tabProject`.name asc
limit %(start)s, %(page_len)s """ % {'cond': cond,'txt': "%%%s%%" % txt,
- 'mcond':get_match_cond(doctype, searchfield),'start': start, 'page_len': page_len})
+ 'mcond':get_match_cond(doctype),'start': start, 'page_len': page_len})
def get_delivery_notes_to_be_billed(doctype, txt, searchfield, start, page_len, filters):
return frappe.db.sql("""select `tabDelivery Note`.name, `tabDelivery Note`.customer_name
@@ -202,7 +206,7 @@ def get_batch_no(doctype, txt, searchfield, start, page_len, filters):
order by batch_no desc
limit %(start)s, %(page_len)s """ % {'item_code': filters['item_code'],
'warehouse': filters['warehouse'], 'posting_date': filters['posting_date'],
- 'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype, searchfield),
+ 'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype),
'start': start, 'page_len': page_len})
else:
return frappe.db.sql("""select name from tabBatch
@@ -214,5 +218,5 @@ def get_batch_no(doctype, txt, searchfield, start, page_len, filters):
order by name desc
limit %(start)s, %(page_len)s""" % {'item_code': filters['item_code'],
'posting_date': filters['posting_date'], 'txt': "%%%s%%" % txt,
- 'mcond':get_match_cond(doctype, searchfield),'start': start,
+ 'mcond':get_match_cond(doctype),'start': start,
'page_len': page_len})
diff --git a/erpnext/home/page/activity/activity.js b/erpnext/home/page/activity/activity.js
index f3f2e0499b..fe0d70b83e 100644
--- a/erpnext/home/page/activity/activity.js
+++ b/erpnext/home/page/activity/activity.js
@@ -23,7 +23,7 @@ frappe.pages['activity'].onload = function(wrapper) {
wrapper.appframe.set_title_right("Refresh", function() { list.run(); });
// Build Report Button
- if(frappe.boot.profile.can_get_report.indexOf("Feed")!=-1) {
+ if(frappe.boot.user.can_get_report.indexOf("Feed")!=-1) {
wrapper.appframe.add_primary_action(frappe._('Build Report'), function() {
frappe.set_route('Report', "Feed");
}, 'icon-th')
diff --git a/erpnext/hooks.txt b/erpnext/hooks.txt
index 8b0ece2953..679389014c 100644
--- a/erpnext/hooks.txt
+++ b/erpnext/hooks.txt
@@ -29,10 +29,6 @@ bean_event:*:on_update = erpnext.home.update_feed
bean_event:*:on_submit = erpnext.home.update_feed
bean_event:Comment:on_update = erpnext.home.make_comment_feed
-bean_event:*:on_update = frappe.core.doctype.notification_count.notification_count.clear_doctype_notifications
-bean_event:*:on_cancel = frappe.core.doctype.notification_count.notification_count.clear_doctype_notifications
-bean_event:*:on_trash = frappe.core.doctype.notification_count.notification_count.clear_doctype_notifications
-
bean_event:Stock Entry:on_submit = erpnext.stock.doctype.material_request.material_request.update_completed_qty
bean_event:Stock Entry:on_cancel = erpnext.stock.doctype.material_request.material_request.update_completed_qty
@@ -43,18 +39,18 @@ standard_queries = Customer:erpnext.selling.doctype.customer.customer.get_custom
#### Frequently
-scheduler_event = all:erpnext.support.doctype.support_ticket.get_support_mails.get_support_mails
-scheduler_event = all:erpnext.hr.doctype.job_applicant.get_job_applications.get_job_applications
-scheduler_event = all:erpnext.selling.doctype.lead.get_leads.get_leads
+scheduler_event:all = erpnext.support.doctype.support_ticket.get_support_mails.get_support_mails
+scheduler_event:all = erpnext.hr.doctype.job_applicant.get_job_applications.get_job_applications
+scheduler_event:all = erpnext.selling.doctype.lead.get_leads.get_leads
#### Daily
-scheduler_event = daily:erpnext.accounts.doctype.sales_invoice.sales_invoice.manage_recurring_invoices
-scheduler_event = daily:erpnext.setup.doctype.backup_manager.backup_manager.take_backups_daily
-scheduler_event = daily:erpnext.stock.utils.reorder_item
-scheduler_event = daily:erpnext.setup.doctype.email_digest.email_digest.send
-scheduler_event = daily:support.doctype.support_ticket.support_ticket.auto_close_tickets
+scheduler_event:daily = erpnext.accounts.doctype.sales_invoice.sales_invoice.manage_recurring_invoices
+scheduler_event:daily_long = erpnext.setup.doctype.backup_manager.backup_manager.take_backups_daily
+scheduler_event:daily = erpnext.stock.utils.reorder_item
+scheduler_event:daily = erpnext.setup.doctype.email_digest.email_digest.send
+scheduler_event:daily = erpnext.support.doctype.support_ticket.support_ticket.auto_close_tickets
#### Weekly
-scheduler_event = weekly:erpnext.setup.doctype.backup_manager.backup_manager.take_backups_weekly
+scheduler_event:weekly_long = erpnext.setup.doctype.backup_manager.backup_manager.take_backups_weekly
diff --git a/erpnext/hr/doctype/employee/employee.js b/erpnext/hr/doctype/employee/employee.js
index 80150f1589..c27a4c56a2 100644
--- a/erpnext/hr/doctype/employee/employee.js
+++ b/erpnext/hr/doctype/employee/employee.js
@@ -5,7 +5,7 @@ frappe.provide("erpnext.hr");
erpnext.hr.EmployeeController = frappe.ui.form.Controller.extend({
setup: function() {
this.frm.fields_dict.user_id.get_query = function(doc, cdt, cdn) {
- return { query:"frappe.core.doctype.profile.profile.profile_query"} }
+ return { query:"frappe.core.doctype.user.user.user_query"} }
this.frm.fields_dict.reports_to.get_query = function(doc, cdt, cdn) {
return { query: "erpnext.controllers.queries.employee_query"} }
},
@@ -33,8 +33,8 @@ erpnext.hr.EmployeeController = frappe.ui.form.Controller.extend({
callback: function(r) {
var df = frappe.meta.get_docfield("Employee Leave Approver", "leave_approver",
me.frm.doc.name);
- df.options = $.map(r.message, function(profile) {
- return {value: profile, label: frappe.user_info(profile).fullname};
+ df.options = $.map(r.message, function(user) {
+ return {value: user, label: frappe.user_info(user).fullname};
});
me.frm.fields_dict.employee_leave_approvers.refresh();
}
diff --git a/erpnext/hr/doctype/employee/employee.py b/erpnext/hr/doctype/employee/employee.py
index 5838116a88..ad943d391d 100644
--- a/erpnext/hr/doctype/employee/employee.py
+++ b/erpnext/hr/doctype/employee/employee.py
@@ -39,10 +39,10 @@ class DocType(DocListController):
self.validate_duplicate_user_id()
def on_update(self):
- if self.doc.user_id:
+ if self.doc.user_id and frappe.db.get_value("User", self.doc.user_id, 'docstatus') == 0:
self.restrict_user()
self.update_user_default()
- self.update_profile()
+ self.update_user()
self.update_dob_event()
self.restrict_leave_approver()
@@ -71,47 +71,47 @@ class DocType(DocListController):
frappe.defaults.add_default("Employee", self.doc.name, user, "Restriction")
- def update_profile(self):
+ def update_user(self):
# add employee role if missing
if not "Employee" in frappe.db.sql_list("""select role from tabUserRole
where parent=%s""", self.doc.user_id):
- from frappe.profile import add_role
+ from frappe.utils.user import add_role
add_role(self.doc.user_id, "Employee")
- profile_wrapper = frappe.bean("Profile", self.doc.user_id)
+ user_wrapper = frappe.bean("User", self.doc.user_id)
- # copy details like Fullname, DOB and Image to Profile
+ # copy details like Fullname, DOB and Image to User
if self.doc.employee_name:
employee_name = self.doc.employee_name.split(" ")
if len(employee_name) >= 3:
- profile_wrapper.doc.last_name = " ".join(employee_name[2:])
- profile_wrapper.doc.middle_name = employee_name[1]
+ user_wrapper.doc.last_name = " ".join(employee_name[2:])
+ user_wrapper.doc.middle_name = employee_name[1]
elif len(employee_name) == 2:
- profile_wrapper.doc.last_name = employee_name[1]
+ user_wrapper.doc.last_name = employee_name[1]
- profile_wrapper.doc.first_name = employee_name[0]
+ user_wrapper.doc.first_name = employee_name[0]
if self.doc.date_of_birth:
- profile_wrapper.doc.birth_date = self.doc.date_of_birth
+ user_wrapper.doc.birth_date = self.doc.date_of_birth
if self.doc.gender:
- profile_wrapper.doc.gender = self.doc.gender
+ user_wrapper.doc.gender = self.doc.gender
if self.doc.image:
- if not profile_wrapper.doc.user_image == self.doc.image:
- profile_wrapper.doc.user_image = self.doc.image
+ if not user_wrapper.doc.user_image == self.doc.image:
+ user_wrapper.doc.user_image = self.doc.image
try:
frappe.doc({
"doctype": "File Data",
"file_name": self.doc.image,
- "attached_to_doctype": "Profile",
+ "attached_to_doctype": "User",
"attached_to_name": self.doc.user_id
}).insert()
except frappe.DuplicateEntryError, e:
# already exists
pass
- profile_wrapper.ignore_permissions = True
- profile_wrapper.save()
+ user_wrapper.ignore_permissions = True
+ user_wrapper.save()
def validate_date(self):
if self.doc.date_of_birth and self.doc.date_of_joining and getdate(self.doc.date_of_birth) >= getdate(self.doc.date_of_joining):
@@ -143,7 +143,7 @@ class DocType(DocListController):
throw(_("Please enter relieving date."))
def validate_for_enabled_user_id(self):
- enabled = frappe.db.sql("""select name from `tabProfile` where
+ enabled = frappe.db.sql("""select name from `tabUser` where
name=%s and enabled=1""", self.doc.user_id)
if not enabled:
throw("{id}: {user_id} {msg}".format(**{
@@ -164,11 +164,11 @@ class DocType(DocListController):
}))
def validate_employee_leave_approver(self):
- from frappe.profile import Profile
+ from frappe.utils.user import User
from erpnext.hr.doctype.leave_application.leave_application import InvalidLeaveApproverError
for l in self.doclist.get({"parentfield": "employee_leave_approvers"}):
- if "Leave Approver" not in Profile(l.leave_approver).get_roles():
+ if "Leave Approver" not in User(l.leave_approver).get_roles():
throw(_("Invalid Leave Approver") + ": \"" + l.leave_approver + "\"",
exc=InvalidLeaveApproverError)
@@ -212,4 +212,4 @@ def get_retirement_date(date_of_birth=None):
if date_of_birth:
dt = getdate(date_of_birth) + datetime.timedelta(21915)
ret = {'date_of_retirement': dt.strftime('%Y-%m-%d')}
- return ret
\ No newline at end of file
+ return ret
diff --git a/erpnext/hr/doctype/employee/employee.txt b/erpnext/hr/doctype/employee/employee.txt
index 795f4de4af..bc21ff95a0 100644
--- a/erpnext/hr/doctype/employee/employee.txt
+++ b/erpnext/hr/doctype/employee/employee.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-03-07 09:04:18",
"docstatus": 0,
- "modified": "2014-02-03 18:06:03",
+ "modified": "2014-02-03 18:06:04",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -126,7 +126,7 @@
"fieldname": "user_id",
"fieldtype": "Link",
"label": "User ID",
- "options": "Profile"
+ "options": "User"
},
{
"doctype": "DocField",
diff --git a/erpnext/hr/doctype/job_applicant/get_job_applications.py b/erpnext/hr/doctype/job_applicant/get_job_applications.py
index 91d3fad25a..4f753450d0 100644
--- a/erpnext/hr/doctype/job_applicant/get_job_applications.py
+++ b/erpnext/hr/doctype/job_applicant/get_job_applications.py
@@ -21,6 +21,7 @@ class JobsMailbox(POP3Mailbox):
applicant = frappe.bean("Job Applicant", name)
if applicant.doc.status!="Rejected":
applicant.doc.status = "Open"
+ applicant.ignore_permissions = True
applicant.doc.save()
else:
name = (mail.from_real_name and (mail.from_real_name + " - ") or "") \
@@ -32,6 +33,8 @@ class JobsMailbox(POP3Mailbox):
"email_id": mail.from_email,
"status": "Open"
})
+ applicant.ignore_permissions = True
+ applicant.ignore_mandatory = True
applicant.insert()
mail.save_attachments_in_doc(applicant.doc)
diff --git a/erpnext/hr/doctype/leave_application/leave_application.js b/erpnext/hr/doctype/leave_application/leave_application.js
index 447f7ff46b..2a6223af44 100755
--- a/erpnext/hr/doctype/leave_application/leave_application.js
+++ b/erpnext/hr/doctype/leave_application/leave_application.js
@@ -16,8 +16,8 @@ cur_frm.cscript.onload = function(doc, dt, dn) {
method: "erpnext.hr.utils.get_leave_approver_list",
callback: function(r) {
cur_frm.set_df_property("leave_approver", "options", $.map(r.message,
- function(profile) {
- return {value: profile, label: frappe.user_info(profile).fullname};
+ function(user) {
+ return {value: user, label: frappe.user_info(user).fullname};
}));
if(leave_approver) cur_frm.set_value("leave_approver", leave_approver);
cur_frm.cscript.get_leave_balance(cur_frm.doc);
@@ -116,6 +116,6 @@ cur_frm.cscript.calculate_total_days = function(doc, dt, dn) {
cur_frm.fields_dict.employee.get_query = function() {
return {
- query: "hr.doctype.leave_application.leave_application.query_for_permitted_employees"
+ query: "erpnext.hr.doctype.leave_application.leave_application.query_for_permitted_employees"
};
}
\ No newline at end of file
diff --git a/erpnext/hr/doctype/leave_application/leave_application.txt b/erpnext/hr/doctype/leave_application/leave_application.txt
index 038c29ddef..b56a0ed120 100644
--- a/erpnext/hr/doctype/leave_application/leave_application.txt
+++ b/erpnext/hr/doctype/leave_application/leave_application.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-20 11:18:11",
"docstatus": 0,
- "modified": "2014-01-20 17:48:55",
+ "modified": "2014-01-20 17:48:56",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -55,7 +55,7 @@
"fieldname": "leave_approver",
"fieldtype": "Select",
"label": "Leave Approver",
- "options": "link:Profile",
+ "options": "link:User",
"permlevel": 0
},
{
diff --git a/erpnext/hr/doctype/leave_application/test_leave_application.py b/erpnext/hr/doctype/leave_application/test_leave_application.py
index 56381fcc26..30f0cb7db9 100644
--- a/erpnext/hr/doctype/leave_application/test_leave_application.py
+++ b/erpnext/hr/doctype/leave_application/test_leave_application.py
@@ -41,7 +41,7 @@ class TestLeaveApplication(unittest.TestCase):
def test_block_list(self):
self._clear_roles()
- from frappe.profile import add_role
+ from frappe.utils.user import add_role
add_role("test1@example.com", "HR User")
frappe.db.set_value("Department", "_Test Department",
@@ -64,7 +64,7 @@ class TestLeaveApplication(unittest.TestCase):
self._clear_roles()
self._clear_applications()
- from frappe.profile import add_role
+ from frappe.utils.user import add_role
add_role("test@example.com", "Employee")
add_role("test2@example.com", "Leave Approver")
@@ -80,7 +80,7 @@ class TestLeaveApplication(unittest.TestCase):
def test_global_block_list(self):
self._clear_roles()
- from frappe.profile import add_role
+ from frappe.utils.user import add_role
add_role("test1@example.com", "Employee")
add_role("test@example.com", "Leave Approver")
@@ -105,7 +105,7 @@ class TestLeaveApplication(unittest.TestCase):
def test_leave_approval(self):
self._clear_roles()
- from frappe.profile import add_role
+ from frappe.utils.user import add_role
add_role("test@example.com", "Employee")
add_role("test1@example.com", "Leave Approver")
add_role("test2@example.com", "Leave Approver")
diff --git a/erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.txt b/erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.txt
index 94fd3de796..ea548004ce 100644
--- a/erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.txt
+++ b/erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:47",
"docstatus": 0,
- "modified": "2013-12-20 19:23:19",
+ "modified": "2013-12-20 19:23:18",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -19,7 +19,7 @@
"in_list_view": 1,
"label": "Allow User",
"name": "__common__",
- "options": "Profile",
+ "options": "User",
"parent": "Leave Block List Allow",
"parentfield": "fields",
"parenttype": "DocType",
diff --git a/erpnext/hr/report/employee_birthday/employee_birthday.txt b/erpnext/hr/report/employee_birthday/employee_birthday.txt
index 575ae73352..a114e5c181 100644
--- a/erpnext/hr/report/employee_birthday/employee_birthday.txt
+++ b/erpnext/hr/report/employee_birthday/employee_birthday.txt
@@ -2,13 +2,14 @@
{
"creation": "2013-05-06 17:56:03",
"docstatus": 0,
- "modified": "2013-05-06 17:56:03",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"doctype": "Report",
"is_standard": "Yes",
+ "module": "HR",
"name": "__common__",
"ref_doctype": "Employee",
"report_name": "Employee Birthday",
diff --git a/erpnext/hr/report/employee_information/employee_information.txt b/erpnext/hr/report/employee_information/employee_information.txt
index b9d190b029..8bd3c4c268 100644
--- a/erpnext/hr/report/employee_information/employee_information.txt
+++ b/erpnext/hr/report/employee_information/employee_information.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-06 18:43:53",
"docstatus": 0,
- "modified": "2013-05-06 18:47:43",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -10,6 +10,7 @@
"doctype": "Report",
"is_standard": "Yes",
"json": "{\"filters\":[],\"columns\":[[\"name\",\"Employee\"],[\"employee_number\",\"Employee\"],[\"date_of_joining\",\"Employee\"],[\"branch\",\"Employee\"],[\"department\",\"Employee\"],[\"designation\",\"Employee\"],[\"gender\",\"Employee\"],[\"status\",\"Employee\"],[\"company\",\"Employee\"],[\"employment_type\",\"Employee\"],[\"grade\",\"Employee\"],[\"reports_to\",\"Employee\"],[\"company_email\",\"Employee\"]],\"sort_by\":\"Employee.bank_ac_no\",\"sort_order\":\"desc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}",
+ "module": "HR",
"name": "__common__",
"ref_doctype": "Employee",
"report_name": "Employee Information",
diff --git a/erpnext/hr/report/employee_leave_balance/employee_leave_balance.txt b/erpnext/hr/report/employee_leave_balance/employee_leave_balance.txt
index 2a6d74f20a..f682c64217 100644
--- a/erpnext/hr/report/employee_leave_balance/employee_leave_balance.txt
+++ b/erpnext/hr/report/employee_leave_balance/employee_leave_balance.txt
@@ -2,13 +2,14 @@
{
"creation": "2013-02-22 15:29:34",
"docstatus": 0,
- "modified": "2013-02-22 15:53:01",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"doctype": "Report",
"is_standard": "Yes",
+ "module": "HR",
"name": "__common__",
"ref_doctype": "Employee",
"report_name": "Employee Leave Balance",
diff --git a/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.txt b/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.txt
index 3c53aae8e4..5c51c4ba6e 100644
--- a/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.txt
+++ b/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-13 14:04:03",
"docstatus": 0,
- "modified": "2013-05-13 14:32:42",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -10,6 +10,7 @@
"add_total_row": 0,
"doctype": "Report",
"is_standard": "Yes",
+ "module": "HR",
"name": "__common__",
"ref_doctype": "Attendance",
"report_name": "Monthly Attendance Sheet",
diff --git a/erpnext/hr/report/monthly_salary_register/monthly_salary_register.txt b/erpnext/hr/report/monthly_salary_register/monthly_salary_register.txt
index b0d5880eaf..80b0c136a7 100644
--- a/erpnext/hr/report/monthly_salary_register/monthly_salary_register.txt
+++ b/erpnext/hr/report/monthly_salary_register/monthly_salary_register.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-07 18:09:42",
"docstatus": 0,
- "modified": "2013-05-07 18:09:42",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -10,6 +10,7 @@
"add_total_row": 1,
"doctype": "Report",
"is_standard": "Yes",
+ "module": "HR",
"name": "__common__",
"ref_doctype": "Salary Slip",
"report_name": "Monthly Salary Register",
diff --git a/erpnext/manufacturing/report/completed_production_orders/completed_production_orders.txt b/erpnext/manufacturing/report/completed_production_orders/completed_production_orders.txt
index facda7e903..558ef3eedd 100644
--- a/erpnext/manufacturing/report/completed_production_orders/completed_production_orders.txt
+++ b/erpnext/manufacturing/report/completed_production_orders/completed_production_orders.txt
@@ -2,13 +2,14 @@
{
"creation": "2013-08-12 12:44:27",
"docstatus": 0,
- "modified": "2013-08-12 12:44:27",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"doctype": "Report",
"is_standard": "Yes",
+ "module": "Manufacturing",
"name": "__common__",
"query": "SELECT\n `tabProduction Order`.name as \"Production Order:Link/Production Order:200\",\n `tabProduction Order`.creation as \"Date:Date:120\",\n `tabProduction Order`.production_item as \"Item:Link/Item:150\",\n `tabProduction Order`.qty as \"To Produce:Int:100\",\n `tabProduction Order`.produced_qty as \"Produced:Int:100\"\nFROM\n `tabProduction Order`\nWHERE\n `tabProduction Order`.docstatus=1\n AND ifnull(`tabProduction Order`.produced_qty,0) = `tabProduction Order`.qty",
"ref_doctype": "Production Order",
diff --git a/erpnext/manufacturing/report/issued_items_against_production_order/issued_items_against_production_order.txt b/erpnext/manufacturing/report/issued_items_against_production_order/issued_items_against_production_order.txt
index a5a03bfa00..cb0808b9fd 100644
--- a/erpnext/manufacturing/report/issued_items_against_production_order/issued_items_against_production_order.txt
+++ b/erpnext/manufacturing/report/issued_items_against_production_order/issued_items_against_production_order.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-05-03 17:48:46",
"docstatus": 0,
- "modified": "2013-05-07 11:49:56",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -10,6 +10,7 @@
"add_total_row": 0,
"doctype": "Report",
"is_standard": "Yes",
+ "module": "Manufacturing",
"name": "__common__",
"query": "select\n ste.production_order as \"Production Order:Link/Production Order:120\",\n ste.posting_date as \"Issue Date:Date:140\",\n ste_item.item_code as \"Item Code:Link/Item:120\",\n\tste_item.description as \"Description::150\",\n\tste_item.transfer_qty as \"Qty:Float:100\",\n\tste_item.stock_uom as \"UOM:Link/UOM:80\",\n\tste_item.amount as \"Amount:Currency:120\",\n\tste_item.serial_no as \"Serial No:Link/Serial No:80\",\n\tste_item.s_warehouse as \"Source Warehouse:Link/Warehouse:120\",\n\tste_item.t_warehouse as \"Target Warehouse:Link/Warehouse:120\",\n\tpro.production_item as \"Finished Goods:Link/Item:120\", \n\tste.name as \"Stock Entry:Link/Stock Entry:120\"\nfrom\n\t`tabStock Entry` ste, `tabStock Entry Detail` ste_item, `tabProduction Order` pro\nwhere\n\tifnull(ste.production_order, '') != '' and ste.name = ste_item.parent \n\tand ste.production_order = pro.name and ste.docstatus = 1 \n\tand ste.purpose = 'Manufacture/Repack'\norder by ste.posting_date, ste.production_order, ste_item.item_code",
"ref_doctype": "Production Order",
diff --git a/erpnext/manufacturing/report/open_production_orders/open_production_orders.txt b/erpnext/manufacturing/report/open_production_orders/open_production_orders.txt
index f92bdd32d3..861392548a 100644
--- a/erpnext/manufacturing/report/open_production_orders/open_production_orders.txt
+++ b/erpnext/manufacturing/report/open_production_orders/open_production_orders.txt
@@ -2,13 +2,14 @@
{
"creation": "2013-08-12 12:32:30",
"docstatus": 0,
- "modified": "2013-08-12 12:42:29",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"doctype": "Report",
"is_standard": "Yes",
+ "module": "Manufacturing",
"name": "__common__",
"query": "SELECT\n `tabProduction Order`.name as \"Production Order:Link/Production Order:200\",\n `tabProduction Order`.creation as \"Date:Date:120\",\n `tabProduction Order`.production_item as \"Item:Link/Item:150\",\n `tabProduction Order`.qty as \"To Produce:Int:100\",\n `tabProduction Order`.produced_qty as \"Produced:Int:100\"\nFROM\n `tabProduction Order`\nWHERE\n `tabProduction Order`.docstatus=1\n AND ifnull(`tabProduction Order`.produced_qty,0) < `tabProduction Order`.qty\n AND NOT EXISTS (SELECT name from `tabStock Entry` where production_order =`tabProduction Order`.name) ",
"ref_doctype": "Production Order",
diff --git a/erpnext/manufacturing/report/production_orders_in_progress/production_orders_in_progress.txt b/erpnext/manufacturing/report/production_orders_in_progress/production_orders_in_progress.txt
index 3d3493f8a1..8c4e1d2fbf 100644
--- a/erpnext/manufacturing/report/production_orders_in_progress/production_orders_in_progress.txt
+++ b/erpnext/manufacturing/report/production_orders_in_progress/production_orders_in_progress.txt
@@ -2,13 +2,14 @@
{
"creation": "2013-08-12 12:43:47",
"docstatus": 0,
- "modified": "2013-08-12 12:43:47",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"doctype": "Report",
"is_standard": "Yes",
+ "module": "Manufacturing",
"name": "__common__",
"query": "SELECT\n `tabProduction Order`.name as \"Production Order:Link/Production Order:200\",\n `tabProduction Order`.creation as \"Date:Date:120\",\n `tabProduction Order`.production_item as \"Item:Link/Item:150\",\n `tabProduction Order`.qty as \"To Produce:Int:100\",\n `tabProduction Order`.produced_qty as \"Produced:Int:100\"\nFROM\n `tabProduction Order`\nWHERE\n `tabProduction Order`.docstatus=1\n AND ifnull(`tabProduction Order`.produced_qty,0) < `tabProduction Order`.qty\n AND EXISTS (SELECT name from `tabStock Entry` where production_order =`tabProduction Order`.name) ",
"ref_doctype": "Production Order",
diff --git a/erpnext/patches.txt b/erpnext/patches.txt
index 08caa76c83..fec9bb0844 100644
--- a/erpnext/patches.txt
+++ b/erpnext/patches.txt
@@ -1,3 +1,4 @@
+erpnext.patches.4_0.validate_v3_patch
erpnext.patches.4_0.update_user_properties
erpnext.patches.4_0.move_warehouse_user_to_restrictions
erpnext.patches.4_0.new_permissions
@@ -26,3 +27,4 @@ erpnext.patches.4_0.customer_discount_to_pricing_rule
execute:frappe.db.sql("""delete from `tabWebsite Item Group` where ifnull(item_group, '')=''""")
erpnext.patches.4_0.remove_module_home_pages
erpnext.patches.4_0.split_email_settings
+erpnext.patches.4_0.fix_employee_user_id
\ No newline at end of file
diff --git a/erpnext/patches/4_0/customer_discount_to_pricing_rule.py b/erpnext/patches/4_0/customer_discount_to_pricing_rule.py
index b310a1fa3c..156630138c 100644
--- a/erpnext/patches/4_0/customer_discount_to_pricing_rule.py
+++ b/erpnext/patches/4_0/customer_discount_to_pricing_rule.py
@@ -7,6 +7,8 @@ import frappe
def execute():
frappe.reload_doc("accounts", "doctype", "pricing_rule")
+ frappe.db.auto_commit_on_many_writes = True
+
for d in frappe.db.sql("""select * from `tabCustomer Discount`
where ifnull(parent, '') != '' and docstatus < 2""", as_dict=1):
if not d.item_group:
@@ -24,6 +26,7 @@ def execute():
"price_or_discount": "Discount",
"discount_percentage": d.discount
}]).insert()
-
+
+ frappe.db.auto_commit_on_many_writes = False
frappe.delete_doc("DocType", "Customer Discount")
\ No newline at end of file
diff --git a/erpnext/patches/4_0/fix_employee_user_id.py b/erpnext/patches/4_0/fix_employee_user_id.py
new file mode 100644
index 0000000000..71107f8301
--- /dev/null
+++ b/erpnext/patches/4_0/fix_employee_user_id.py
@@ -0,0 +1,13 @@
+import frappe
+from frappe.utils import get_fullname
+
+def execute():
+ for user_id in frappe.db.sql_list("""select distinct user_id from `tabEmployee`
+ where ifnull(user_id, '')!=''
+ group by user_id having count(name) > 1"""):
+
+ fullname = get_fullname(user_id)
+ employee = frappe.db.get_value("Employee", {"employee_name": fullname, "user_id": user_id})
+ if employee:
+ frappe.db.sql("""update `tabEmployee` set user_id=null
+ where user_id=%s and name!=%s""", (user_id, employee))
\ No newline at end of file
diff --git a/erpnext/patches/4_0/move_warehouse_user_to_restrictions.py b/erpnext/patches/4_0/move_warehouse_user_to_restrictions.py
index d199a42669..16d3b29c96 100644
--- a/erpnext/patches/4_0/move_warehouse_user_to_restrictions.py
+++ b/erpnext/patches/4_0/move_warehouse_user_to_restrictions.py
@@ -6,8 +6,8 @@ import frappe
def execute():
from frappe.core.page.user_properties import user_properties
- for warehouse, profile in frappe.db.sql("""select parent, user from `tabWarehouse User`"""):
- user_properties.add(profile, "Warehouse", warehouse)
+ for warehouse, user in frappe.db.sql("""select parent, user from `tabWarehouse User`"""):
+ user_properties.add(user, "Warehouse", warehouse)
frappe.delete_doc("DocType", "Warehouse User")
frappe.reload_doc("stock", "doctype", "warehouse")
\ No newline at end of file
diff --git a/erpnext/patches/4_0/update_user_properties.py b/erpnext/patches/4_0/update_user_properties.py
index 5070bfdf1a..6dac125c1c 100644
--- a/erpnext/patches/4_0/update_user_properties.py
+++ b/erpnext/patches/4_0/update_user_properties.py
@@ -42,10 +42,10 @@ def update_user_match():
meta = frappe.get_doctype(doctype)
# for each user with roles of this doctype, check if match condition applies
- for profile in frappe.db.sql_list("""select name from `tabProfile`
+ for user in frappe.db.sql_list("""select name from `tabUser`
where enabled=1 and user_type='System User'"""):
- user_roles = frappe.get_roles(profile)
+ user_roles = frappe.get_roles(user)
perms = meta.get({"doctype": "DocPerm", "permlevel": 0,
"role": ["in", [["All"] + user_roles]], "read": 1})
@@ -69,9 +69,9 @@ def update_user_match():
# add that doc's restriction to that user
for match in user_matches:
for name in frappe.db.sql_list("""select name from `tab{doctype}`
- where `{field}`=%s""".format(doctype=doctype, field=match.split(":")[0]), profile):
+ where `{field}`=%s""".format(doctype=doctype, field=match.split(":")[0]), user):
- frappe.defaults.add_default(doctype, name, profile, "Restriction")
+ frappe.defaults.add_default(doctype, name, user, "Restriction")
def add_employee_restrictions_to_leave_approver():
from frappe.core.page.user_properties import user_properties
diff --git a/erpnext/patches/4_0/validate_v3_patch.py b/erpnext/patches/4_0/validate_v3_patch.py
new file mode 100644
index 0000000000..5041a81ad3
--- /dev/null
+++ b/erpnext/patches/4_0/validate_v3_patch.py
@@ -0,0 +1,12 @@
+# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
+# License: GNU General Public License v3. See license.txt
+
+from __future__ import unicode_literals
+import frappe
+
+def execute():
+ from frappe.modules.patch_handler import executed
+ last_v3_patch = 'patches.1401.fix_planned_qty'
+ if not executed(last_v3_patch):
+ raise Exception, "site not ready to migrate to version 4"
+
\ No newline at end of file
diff --git a/erpnext/projects/doctype/task/task.py b/erpnext/projects/doctype/task/task.py
index 6f0ff927b6..0e7678118f 100644
--- a/erpnext/projects/doctype/task/task.py
+++ b/erpnext/projects/doctype/task/task.py
@@ -85,5 +85,5 @@ def get_project(doctype, txt, searchfield, start, page_len, filters):
%(mcond)s
order by name
limit %(start)s, %(page_len)s """ % {'key': searchfield,
- 'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype, searchfield),
+ 'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype),
'start': start, 'page_len': page_len})
\ No newline at end of file
diff --git a/erpnext/projects/doctype/time_log_batch_detail/time_log_batch_detail.txt b/erpnext/projects/doctype/time_log_batch_detail/time_log_batch_detail.txt
index 973fc576b7..3531a877df 100644
--- a/erpnext/projects/doctype/time_log_batch_detail/time_log_batch_detail.txt
+++ b/erpnext/projects/doctype/time_log_batch_detail/time_log_batch_detail.txt
@@ -2,7 +2,7 @@
{
"creation": "2013-03-05 09:11:06",
"docstatus": 0,
- "modified": "2013-12-20 19:21:53",
+ "modified": "2013-12-20 19:21:54",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -40,7 +40,7 @@
"fieldname": "created_by",
"fieldtype": "Link",
"label": "Created By",
- "options": "Profile",
+ "options": "User",
"read_only": 1
},
{
diff --git a/erpnext/projects/report/daily_time_log_summary/daily_time_log_summary.py b/erpnext/projects/report/daily_time_log_summary/daily_time_log_summary.py
index be3d6ce558..c652ca79ac 100644
--- a/erpnext/projects/report/daily_time_log_summary/daily_time_log_summary.py
+++ b/erpnext/projects/report/daily_time_log_summary/daily_time_log_summary.py
@@ -15,7 +15,7 @@ def execute(filters=None):
"To Datetime::140", "Hours::70", "Activity Type::120", "Task:Link/Task:150",
"Task Subject::180", "Project:Link/Project:120", "Status::70"]
- profile_map = get_profile_map()
+ user_map = get_user_map()
task_map = get_task_map()
conditions = build_conditions(filters)
@@ -23,17 +23,17 @@ def execute(filters=None):
where docstatus < 2 %s order by owner asc""" % (conditions, ), filters, as_dict=1)
if time_logs:
- profiles = [time_logs[0].owner]
+ users = [time_logs[0].owner]
data = []
total_hours = total_employee_hours = count = 0
for tl in time_logs:
- if tl.owner not in profiles:
- profiles.append(tl.owner)
+ if tl.owner not in users:
+ users.append(tl.owner)
data.append(["", "", "", "Total", total_employee_hours, "", "", "", "", ""])
total_employee_hours = 0
- data.append([tl.name, profile_map[tl.owner], tl.from_time, tl.to_time, tl.hours,
+ data.append([tl.name, user_map[tl.owner], tl.from_time, tl.to_time, tl.hours,
tl.activity_type, tl.task, task_map.get(tl.task), tl.project, tl.status])
count += 1
@@ -48,15 +48,15 @@ def execute(filters=None):
return columns, data
-def get_profile_map():
- profiles = frappe.db.sql("""select name,
+def get_user_map():
+ users = frappe.db.sql("""select name,
concat(first_name, if(last_name, (' ' + last_name), '')) as fullname
- from tabProfile""", as_dict=1)
- profile_map = {}
- for p in profiles:
- profile_map.setdefault(p.name, []).append(p.fullname)
+ from tabUser""", as_dict=1)
+ user_map = {}
+ for p in users:
+ user_map.setdefault(p.name, []).append(p.fullname)
- return profile_map
+ return user_map
def get_task_map():
tasks = frappe.db.sql("""select name, subject from tabTask""", as_dict=1)
diff --git a/erpnext/projects/report/daily_time_log_summary/daily_time_log_summary.txt b/erpnext/projects/report/daily_time_log_summary/daily_time_log_summary.txt
index 5bf3e6d57e..fe8feb0a5b 100644
--- a/erpnext/projects/report/daily_time_log_summary/daily_time_log_summary.txt
+++ b/erpnext/projects/report/daily_time_log_summary/daily_time_log_summary.txt
@@ -2,13 +2,14 @@
{
"creation": "2013-04-03 11:27:52",
"docstatus": 0,
- "modified": "2013-04-03 11:48:07",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"doctype": "Report",
"is_standard": "Yes",
+ "module": "Projects",
"name": "__common__",
"ref_doctype": "Time Log",
"report_name": "Daily Time Log Summary",
diff --git a/erpnext/projects/report/project_wise_stock_tracking/project_wise_stock_tracking.txt b/erpnext/projects/report/project_wise_stock_tracking/project_wise_stock_tracking.txt
index 89f5085351..4a8953696d 100644
--- a/erpnext/projects/report/project_wise_stock_tracking/project_wise_stock_tracking.txt
+++ b/erpnext/projects/report/project_wise_stock_tracking/project_wise_stock_tracking.txt
@@ -2,13 +2,14 @@
{
"creation": "2013-06-03 17:37:41",
"docstatus": 0,
- "modified": "2013-06-03 17:37:41",
+ "modified": "2014-03-07 15:30:27",
"modified_by": "Administrator",
"owner": "Administrator"
},
{
"doctype": "Report",
"is_standard": "Yes",
+ "module": "Projects",
"name": "__common__",
"ref_doctype": "Project",
"report_name": "Project wise Stock Tracking ",
diff --git a/erpnext/public/js/queries.js b/erpnext/public/js/queries.js
index 86db28e79b..966b27dd1a 100644
--- a/erpnext/public/js/queries.js
+++ b/erpnext/public/js/queries.js
@@ -1,11 +1,11 @@
// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
// License: GNU General Public License v3. See license.txt
-// searches for enabled profiles
+// searches for enabled users
frappe.provide("erpnext.queries");
$.extend(erpnext.queries, {
- profile: function() {
- return { query: "frappe.core.doctype.profile.profile.profile_query" };
+ user: function() {
+ return { query: "frappe.core.doctype.user.user.user_query" };
},
lead: function() {
diff --git a/erpnext/public/js/toolbar.js b/erpnext/public/js/toolbar.js
index 53efe30dad..c0645e39a9 100644
--- a/erpnext/public/js/toolbar.js
+++ b/erpnext/public/js/toolbar.js
@@ -5,9 +5,9 @@
frappe.provide('erpnext.toolbar');
erpnext.toolbar.setup = function() {
- // profile
+ // user
var $user = $('#toolbar-user');
- $user.append('