diff --git a/accounts/doctype/budget_distribution/budget_distribution.txt b/accounts/doctype/budget_distribution/budget_distribution.txt index 70ef717f92..ae668abe8d 100644 --- a/accounts/doctype/budget_distribution/budget_distribution.txt +++ b/accounts/doctype/budget_distribution/budget_distribution.txt @@ -2,7 +2,7 @@ { "creation": "2013-01-10 16:34:05", "docstatus": 0, - "modified": "2013-07-05 14:29:23", + "modified": "2013-07-22 15:30:37", "modified_by": "Administrator", "owner": "Administrator" }, @@ -31,6 +31,7 @@ "parenttype": "DocType", "read": 1, "report": 1, + "role": "Accounts Manager", "submit": 0 }, { @@ -76,31 +77,16 @@ "oldfieldtype": "Small Text", "read_only": 1 }, - { - "cancel": 1, - "create": 1, - "doctype": "DocPerm", - "permlevel": 0, - "role": "System Manager", - "write": 1 - }, - { - "doctype": "DocPerm", - "permlevel": 2, - "role": "System Manager" - }, { "amend": 0, "cancel": 1, "create": 1, "doctype": "DocPerm", "permlevel": 0, - "role": "Accounts Manager", "write": 1 }, { "doctype": "DocPerm", - "permlevel": 2, - "role": "Accounts Manager" + "permlevel": 2 } ] \ No newline at end of file diff --git a/accounts/doctype/cost_center/cost_center.txt b/accounts/doctype/cost_center/cost_center.txt index 95c4f5a7af..a9c7add775 100644 --- a/accounts/doctype/cost_center/cost_center.txt +++ b/accounts/doctype/cost_center/cost_center.txt @@ -2,7 +2,7 @@ { "creation": "2013-01-23 19:57:17", "docstatus": 0, - "modified": "2013-07-09 14:43:41", + "modified": "2013-07-22 15:23:10", "modified_by": "Administrator", "owner": "Administrator" }, @@ -28,6 +28,7 @@ "permlevel": 0 }, { + "amend": 0, "doctype": "DocPerm", "name": "__common__", "parent": "Cost Center", @@ -179,7 +180,6 @@ "report_hide": 1 }, { - "amend": 0, "cancel": 1, "create": 1, "doctype": "DocPerm", @@ -187,18 +187,10 @@ "write": 1 }, { - "amend": 0, "cancel": 0, "create": 0, "doctype": "DocPerm", "role": "Accounts User", "write": 0 - }, - { - "cancel": 1, - "create": 1, - "doctype": "DocPerm", - "role": "System Manager", - "write": 1 } ] \ No newline at end of file diff --git a/accounts/doctype/journal_voucher/journal_voucher.js b/accounts/doctype/journal_voucher/journal_voucher.js index 2e89a67cb1..ab4b2b05fd 100644 --- a/accounts/doctype/journal_voucher/journal_voucher.js +++ b/accounts/doctype/journal_voucher/journal_voucher.js @@ -104,14 +104,6 @@ cur_frm.cscript.is_opening = function(doc, cdt, cdn) { if (doc.is_opening == 'Yes') unhide_field('aging_date'); } -cur_frm.fields_dict['entries'].grid.onrowadd = function(doc, cdt, cdn){ - var d = locals[cdt][cdn]; - if(d.idx == 1){ - d.debit = 0; - d.credit = 0; - } -} - cur_frm.cscript.against_voucher = function(doc,cdt,cdn) { var d = locals[cdt][cdn]; if (d.against_voucher && !flt(d.debit)) { diff --git a/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.txt b/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.txt index 235188ebf2..accf51595d 100644 --- a/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.txt +++ b/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.txt @@ -2,7 +2,7 @@ { "creation": "2013-01-30 12:49:46", "docstatus": 0, - "modified": "2013-07-05 14:48:10", + "modified": "2013-07-22 15:31:00", "modified_by": "Administrator", "owner": "Administrator" }, @@ -185,10 +185,6 @@ "fieldtype": "Data", "label": "Amount <=" }, - { - "doctype": "DocPerm", - "role": "System Manager" - }, { "doctype": "DocPerm", "role": "Accounts Manager" diff --git a/accounts/doctype/period_closing_voucher/period_closing_voucher.txt b/accounts/doctype/period_closing_voucher/period_closing_voucher.txt index 77d55dca18..1f2d35e460 100644 --- a/accounts/doctype/period_closing_voucher/period_closing_voucher.txt +++ b/accounts/doctype/period_closing_voucher/period_closing_voucher.txt @@ -2,7 +2,7 @@ { "creation": "2013-01-10 16:34:07", "docstatus": 0, - "modified": "2013-07-05 14:50:27", + "modified": "2013-07-22 15:31:33", "modified_by": "Administrator", "owner": "jai@webnotestech.com" }, @@ -35,6 +35,7 @@ "permlevel": 0, "read": 1, "report": 1, + "role": "Accounts Manager", "submit": 1, "write": 1 }, @@ -130,11 +131,6 @@ "reqd": 1 }, { - "doctype": "DocPerm", - "role": "System Manager" - }, - { - "doctype": "DocPerm", - "role": "Accounts Manager" + "doctype": "DocPerm" } ] \ No newline at end of file diff --git a/accounts/doctype/purchase_invoice/purchase_invoice.js b/accounts/doctype/purchase_invoice/purchase_invoice.js index 2bdab8ac0b..e73386f71f 100644 --- a/accounts/doctype/purchase_invoice/purchase_invoice.js +++ b/accounts/doctype/purchase_invoice/purchase_invoice.js @@ -22,7 +22,7 @@ wn.provide("erpnext.accounts"); wn.require('app/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js'); wn.require('app/buying/doctype/purchase_common/purchase_common.js'); -erpnext.accounts.PurchaseInvoiceController = erpnext.buying.BuyingController.extend({ +erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({ onload: function() { this._super(); @@ -103,29 +103,14 @@ erpnext.accounts.PurchaseInvoiceController = erpnext.buying.BuyingController.ext tc_name: function() { this.get_terms(); }, - + + entries_add: function(doc, cdt, cdn) { + var row = wn.model.get_doc(cdt, cdn); + this.frm.script_manager.copy_from_first_row("entries", row, ["expense_head", "cost_center"]); + } }); -// for backward compatibility: combine new and previous states -$.extend(cur_frm.cscript, new erpnext.accounts.PurchaseInvoiceController({frm: cur_frm})); - -cur_frm.fields_dict['entries'].grid.onrowadd = function(doc, cdt, cdn){ - - cl = getchildren('Purchase Invoice Item', doc.name, cur_frm.cscript.fname, doc.doctype); - acc = ''; - cc = ''; - - for(var i = 0; i""" + self.doc.name + "" website_settings.doc.copyright = self.doc.name - website_settings.doclist.append({ - "doctype": "Top Bar Item", - "parentfield": "top_bar_items", - "label":"Home", - "url": webpage.doc.name - }) website_settings.doclist.append({ "doctype": "Top Bar Item", "parentfield": "top_bar_items", diff --git a/setup/doctype/item_group/item_group.js b/setup/doctype/item_group/item_group.js index b642735215..f672e7a832 100644 --- a/setup/doctype/item_group/item_group.js +++ b/setup/doctype/item_group/item_group.js @@ -37,7 +37,7 @@ cur_frm.fields_dict['parent_item_group'].get_query = function(doc,cdt,cdn) { return{ filters:[ ['Item Group', 'is_group', '=', 'Yes'], - ['Item Group', 'naem', '!=', doc.item_group_name] + ['Item Group', 'name', '!=', doc.item_group_name] ] } } \ No newline at end of file diff --git a/setup/doctype/item_group/item_group.txt b/setup/doctype/item_group/item_group.txt index a2b04e7d90..44faa49070 100644 --- a/setup/doctype/item_group/item_group.txt +++ b/setup/doctype/item_group/item_group.txt @@ -2,7 +2,7 @@ { "creation": "2013-03-28 10:35:29", "docstatus": 0, - "modified": "2013-07-05 14:43:08", + "modified": "2013-07-22 15:29:54", "modified_by": "Administrator", "owner": "Administrator" }, @@ -190,13 +190,6 @@ "role": "Material User", "write": 0 }, - { - "cancel": 1, - "create": 1, - "doctype": "DocPerm", - "role": "System Manager", - "write": 1 - }, { "cancel": 1, "create": 1, diff --git a/setup/doctype/quotation_lost_reason/quotation_lost_reason.txt b/setup/doctype/quotation_lost_reason/quotation_lost_reason.txt index d580410d44..d9174e359c 100644 --- a/setup/doctype/quotation_lost_reason/quotation_lost_reason.txt +++ b/setup/doctype/quotation_lost_reason/quotation_lost_reason.txt @@ -2,7 +2,7 @@ { "creation": "2013-01-10 16:34:24", "docstatus": 0, - "modified": "2013-07-05 14:52:43", + "modified": "2013-07-22 15:29:22", "modified_by": "Administrator", "owner": "Administrator" }, @@ -23,6 +23,7 @@ "permlevel": 0 }, { + "amend": 0, "cancel": 1, "create": 1, "doctype": "DocPerm", @@ -33,6 +34,7 @@ "permlevel": 0, "read": 1, "report": 1, + "role": "Sales Master Manager", "submit": 0, "write": 1 }, @@ -59,12 +61,6 @@ "reqd": 1 }, { - "doctype": "DocPerm", - "role": "System Manager" - }, - { - "amend": 0, - "doctype": "DocPerm", - "role": "Sales Master Manager" + "doctype": "DocPerm" } ] \ No newline at end of file diff --git a/stock/doctype/item/item.js b/stock/doctype/item/item.js index b2a1ffe493..b1bb26902e 100644 --- a/stock/doctype/item/item.js +++ b/stock/doctype/item/item.js @@ -14,8 +14,25 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -cur_frm.add_fetch("price_list_name", "currency", "ref_currency"); -cur_frm.add_fetch("price_list_name", "buying_or_selling", "buying_or_selling"); +wn.provide("erpnext.stock"); + +erpnext.stock.Item = wn.ui.form.Controller.extend({ + onload: function() { + this.frm.add_fetch("price_list_name", "currency", "ref_currency"); + this.frm.add_fetch("price_list_name", "buying_or_selling", "buying_or_selling"); + }, + + ref_rate_details_add: function(doc, cdt, cdn) { + var row = wn.model.get_doc(cdt, cdn); + if(row.price_list_name && !row.ref_currency) { + // execute fetch + var df = wn.meta.get_docfield(row.doctype, "price_list_name", row.parent); + this.frm.script_manager.validate_link_and_fetch(df, row.name, row.price_list_name); + } + } +}); + +cur_frm.script_manager.make(erpnext.stock.Item); cur_frm.cscript.refresh = function(doc) { // make sensitive fields(has_serial_no, is_stock_item, valuation_method) @@ -157,11 +174,6 @@ cur_frm.cscript.validate = function(doc,cdt,cdn){ cur_frm.cscript.weight_to_validate(doc,cdt,cdn); } -cur_frm.fields_dict['ref_rate_details'].grid.onrowadd = function(doc, cdt, cdn){ - locals[cdt][cdn].ref_currency = sys_defaults.currency; - refresh_field('ref_currency',cdn,'ref_rate_details'); -} - cur_frm.fields_dict.item_customer_details.grid.get_field("customer_name").get_query = function(doc,cdt,cdn) { return{ query:"controllers.queries.customer_query" } } diff --git a/stock/doctype/landed_cost_wizard/landed_cost_wizard.txt b/stock/doctype/landed_cost_wizard/landed_cost_wizard.txt index 36a5d727b9..53f2407be7 100644 --- a/stock/doctype/landed_cost_wizard/landed_cost_wizard.txt +++ b/stock/doctype/landed_cost_wizard/landed_cost_wizard.txt @@ -2,7 +2,7 @@ { "creation": "2013-01-22 16:50:39", "docstatus": 0, - "modified": "2013-07-05 14:43:57", + "modified": "2013-07-22 15:31:20", "modified_by": "Administrator", "owner": "wasim@webnotestech.com" }, @@ -113,10 +113,6 @@ "doctype": "DocPerm", "role": "Purchase Manager" }, - { - "doctype": "DocPerm", - "role": "System Manager" - }, { "doctype": "DocPerm", "role": "Purchase User" diff --git a/stock/doctype/serial_no/serial_no.txt b/stock/doctype/serial_no/serial_no.txt index 72f7828636..efa35f5667 100644 --- a/stock/doctype/serial_no/serial_no.txt +++ b/stock/doctype/serial_no/serial_no.txt @@ -2,7 +2,7 @@ { "creation": "2013-05-16 10:59:15", "docstatus": 0, - "modified": "2013-07-05 14:54:52", + "modified": "2013-07-22 15:29:43", "modified_by": "Administrator", "owner": "Administrator" }, @@ -520,13 +520,6 @@ "read_only": 1, "report_hide": 1 }, - { - "cancel": 1, - "create": 1, - "doctype": "DocPerm", - "role": "System Manager", - "write": 1 - }, { "cancel": 1, "create": 1, diff --git a/stock/doctype/stock_entry/stock_entry.js b/stock/doctype/stock_entry/stock_entry.js index 123c9fbd8c..7032f92ec1 100644 --- a/stock/doctype/stock_entry/stock_entry.js +++ b/stock/doctype/stock_entry/stock_entry.js @@ -234,9 +234,15 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({ } }, + mtn_details_add: function(doc, cdt, cdn) { + var row = wn.model.get_doc(cdt, cdn); + + if(!row.s_warehouse) row.s_warehouse = this.frm.doc.from_warehouse; + if(!row.t_warehouse) row.t_warehouse = this.frm.doc.to_warehouse; + }, }); -cur_frm.cscript = new erpnext.stock.StockEntry({frm: cur_frm}); +cur_frm.script_manager.make(erpnext.stock.StockEntry); cur_frm.cscript.toggle_related_fields = function(doc) { disable_from_warehouse = inList(["Material Receipt", "Sales Return"], doc.purpose); @@ -296,19 +302,6 @@ cur_frm.cscript.purpose = function(doc, cdt, cdn) { cur_frm.cscript.toggle_related_fields(doc, cdt, cdn); } -// copy over source and target warehouses -cur_frm.fields_dict['mtn_details'].grid.onrowadd = function(doc, cdt, cdn){ - var d = locals[cdt][cdn]; - if(!d.s_warehouse && doc.from_warehouse) { - d.s_warehouse = doc.from_warehouse - refresh_field('s_warehouse', cdn, 'mtn_details') - } - if(!d.t_warehouse && doc.to_warehouse) { - d.t_warehouse = doc.to_warehouse - refresh_field('t_warehouse', cdn, 'mtn_details') - } -} - // Overloaded query for link batch_no cur_frm.fields_dict['mtn_details'].grid.get_field('batch_no').get_query = function(doc, cdt, cdn) { var d = locals[cdt][cdn]; diff --git a/stock/doctype/stock_reconciliation/stock_reconciliation.txt b/stock/doctype/stock_reconciliation/stock_reconciliation.txt index fc63b8dcd5..7ddcbf7c1c 100644 --- a/stock/doctype/stock_reconciliation/stock_reconciliation.txt +++ b/stock/doctype/stock_reconciliation/stock_reconciliation.txt @@ -2,7 +2,7 @@ { "creation": "2013-03-28 10:35:31", "docstatus": 0, - "modified": "2013-07-05 14:56:37", + "modified": "2013-07-22 15:22:44", "modified_by": "Administrator", "owner": "Administrator" }, @@ -31,6 +31,7 @@ "permlevel": 0 }, { + "amend": 0, "cancel": 1, "create": 1, "doctype": "DocPerm", @@ -41,6 +42,7 @@ "permlevel": 0, "read": 1, "report": 1, + "role": "Material Manager", "submit": 1, "write": 1 }, @@ -156,12 +158,6 @@ "print_hide": 1 }, { - "amend": 0, - "doctype": "DocPerm", - "role": "Material Manager" - }, - { - "doctype": "DocPerm", - "role": "System Manager" + "doctype": "DocPerm" } ] \ No newline at end of file diff --git a/stock/doctype/warehouse/warehouse.txt b/stock/doctype/warehouse/warehouse.txt index 95b0b52e54..f6d3bcc3e5 100644 --- a/stock/doctype/warehouse/warehouse.txt +++ b/stock/doctype/warehouse/warehouse.txt @@ -2,7 +2,7 @@ { "creation": "2013-03-07 18:50:32", "docstatus": 0, - "modified": "2013-07-10 18:46:40", + "modified": "2013-07-22 15:20:35", "modified_by": "Administrator", "owner": "Administrator" }, @@ -24,11 +24,13 @@ "read_only": 0 }, { + "amend": 0, "doctype": "DocPerm", "name": "__common__", "parent": "Warehouse", "parentfield": "permissions", "parenttype": "DocType", + "permlevel": 0, "read": 1, "report": 1, "submit": 0 @@ -201,47 +203,17 @@ "permlevel": 2 }, { - "amend": 0, "cancel": 1, "create": 1, "doctype": "DocPerm", - "permlevel": 0, "role": "Material Master Manager", "write": 1 }, { - "cancel": 1, - "create": 1, - "doctype": "DocPerm", - "permlevel": 0, - "role": "System Manager", - "write": 1 - }, - { - "amend": 0, "cancel": 0, "create": 0, "doctype": "DocPerm", - "permlevel": 0, - "role": "Material Manager", - "write": 0 - }, - { - "amend": 0, - "cancel": 0, - "create": 0, - "doctype": "DocPerm", - "permlevel": 0, "role": "Material User", "write": 0 - }, - { - "amend": 0, - "cancel": 0, - "create": 0, - "doctype": "DocPerm", - "permlevel": 2, - "role": "System Manager", - "write": 1 } ] \ No newline at end of file diff --git a/support/doctype/maintenance_schedule/maintenance_schedule.txt b/support/doctype/maintenance_schedule/maintenance_schedule.txt index 0491946bf0..c14764ccce 100644 --- a/support/doctype/maintenance_schedule/maintenance_schedule.txt +++ b/support/doctype/maintenance_schedule/maintenance_schedule.txt @@ -2,7 +2,7 @@ { "creation": "2013-01-10 16:34:30", "docstatus": 0, - "modified": "2013-07-10 12:18:19", + "modified": "2013-07-22 15:32:36", "modified_by": "Administrator", "owner": "Administrator" }, @@ -35,6 +35,7 @@ "permlevel": 0, "read": 1, "report": 1, + "role": "Maintenance Manager", "submit": 1, "write": 1 }, @@ -249,11 +250,6 @@ "read_only": 1 }, { - "doctype": "DocPerm", - "role": "System Manager" - }, - { - "doctype": "DocPerm", - "role": "Maintenance Manager" + "doctype": "DocPerm" } ] \ No newline at end of file diff --git a/support/doctype/maintenance_visit/maintenance_visit.txt b/support/doctype/maintenance_visit/maintenance_visit.txt index 478d9ac71a..ee84f96c55 100644 --- a/support/doctype/maintenance_visit/maintenance_visit.txt +++ b/support/doctype/maintenance_visit/maintenance_visit.txt @@ -2,7 +2,7 @@ { "creation": "2013-01-10 16:34:31", "docstatus": 0, - "modified": "2013-07-10 12:26:15", + "modified": "2013-07-22 15:24:40", "modified_by": "Administrator", "owner": "ashwini@webnotestech.com" }, @@ -35,6 +35,7 @@ "permlevel": 0, "read": 1, "report": 1, + "role": "Maintenance User", "submit": 1, "write": 1 }, @@ -308,15 +309,6 @@ "print_hide": 1 }, { - "doctype": "DocPerm", - "role": "System Manager" - }, - { - "doctype": "DocPerm", - "role": "Maintenance Manager" - }, - { - "doctype": "DocPerm", - "role": "Maintenance User" + "doctype": "DocPerm" } ] \ No newline at end of file diff --git a/website/templates/html/navbar.html b/website/templates/html/navbar.html index 9166cde84d..68706ec0e3 100644 --- a/website/templates/html/navbar.html +++ b/website/templates/html/navbar.html @@ -1,5 +1,5 @@