From aa355af2cf3d44f7c13df7ffe7f58018f701ae41 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 26 Mar 2014 18:24:30 +0530 Subject: [PATCH 01/42] refactored client side Model and Meta - frappe/frappe#478 --- erpnext/accounts/doctype/account/account.js | 4 ++-- .../budget_distribution.js | 3 +-- .../doctype/cost_center/cost_center.js | 4 ++-- .../journal_voucher/journal_voucher.js | 8 +++---- .../doctype/pos_setting/pos_setting.js | 2 +- .../doctype/sales_invoice/sales_invoice.js | 2 +- .../purchase_common/purchase_common.js | 2 +- .../doctype/purchase_order/purchase_order.js | 6 ++--- erpnext/hr/doctype/employee/employee.js | 2 +- .../hr/doctype/expense_claim/expense_claim.js | 2 +- .../leave_control_panel.js | 2 +- .../doctype/salary_manager/salary_manager.js | 6 ++--- erpnext/hr/doctype/salary_slip/salary_slip.js | 4 ++-- .../salary_structure/salary_structure.js | 2 +- .../production_order/production_order.js | 4 ++-- .../production_planning_tool.js | 4 ++-- .../doctype/time_log_batch/time_log_batch.js | 3 +-- erpnext/public/js/transaction.js | 23 ++++--------------- erpnext/public/js/utils.js | 3 +-- .../doctype/sales_order/sales_order.js | 4 ++-- erpnext/selling/sales_common.js | 9 ++++---- .../contact_control/contact_control.js | 2 +- .../doctype/email_digest/email_digest.js | 6 ++--- .../global_defaults/global_defaults.js | 2 +- .../doctype/naming_series/naming_series.js | 2 +- .../notification_control.js | 2 +- .../doctype/delivery_note/delivery_note.js | 3 +-- erpnext/stock/doctype/item/item.js | 3 +-- .../material_request/material_request.js | 6 ++--- .../maintenance_schedule.js | 3 +-- .../support/doctype/newsletter/newsletter.js | 2 +- 31 files changed, 53 insertions(+), 77 deletions(-) diff --git a/erpnext/accounts/doctype/account/account.js b/erpnext/accounts/doctype/account/account.js index 2577ccf88b..f4f2b8a795 100644 --- a/erpnext/accounts/doctype/account/account.js +++ b/erpnext/accounts/doctype/account/account.js @@ -87,7 +87,7 @@ cur_frm.cscript.add_toolbar_buttons = function(doc) { } cur_frm.cscript.convert_to_ledger = function(doc, cdt, cdn) { - return $c_obj(cur_frm.get_doclist(),'convert_group_to_ledger','',function(r,rt) { + return $c_obj(cur_frm.doc,'convert_group_to_ledger','',function(r,rt) { if(r.message == 1) { cur_frm.refresh(); } @@ -95,7 +95,7 @@ cur_frm.cscript.convert_to_ledger = function(doc, cdt, cdn) { } cur_frm.cscript.convert_to_group = function(doc, cdt, cdn) { - return $c_obj(cur_frm.get_doclist(),'convert_ledger_to_group','',function(r,rt) { + return $c_obj(cur_frm.doc,'convert_ledger_to_group','',function(r,rt) { if(r.message == 1) { cur_frm.refresh(); } diff --git a/erpnext/accounts/doctype/budget_distribution/budget_distribution.js b/erpnext/accounts/doctype/budget_distribution/budget_distribution.js index c2563741a4..3c11d874a4 100644 --- a/erpnext/accounts/doctype/budget_distribution/budget_distribution.js +++ b/erpnext/accounts/doctype/budget_distribution/budget_distribution.js @@ -7,8 +7,7 @@ cur_frm.cscript.onload = function(doc,cdt,cdn){ refresh_field('budget_distribution_details'); } - return $c('runserverobj',args={'method' : 'get_months', 'docs' : - frappe.model.compress(make_doclist(doc.doctype, doc.name))},callback1); + return $c('runserverobj',args={'method':'get_months', 'docs':doc}, callback1); } } diff --git a/erpnext/accounts/doctype/cost_center/cost_center.js b/erpnext/accounts/doctype/cost_center/cost_center.js index 5c8be10a3f..0cd3a700a4 100644 --- a/erpnext/accounts/doctype/cost_center/cost_center.js +++ b/erpnext/accounts/doctype/cost_center/cost_center.js @@ -70,7 +70,7 @@ cur_frm.cscript.hide_unhide_group_ledger = function(doc) { } cur_frm.cscript.convert_to_ledger = function(doc, cdt, cdn) { - return $c_obj(cur_frm.get_doclist(),'convert_group_to_ledger','',function(r,rt) { + return $c_obj(cur_frm.doc,'convert_group_to_ledger','',function(r,rt) { if(r.message == 1) { cur_frm.refresh(); } @@ -78,7 +78,7 @@ cur_frm.cscript.convert_to_ledger = function(doc, cdt, cdn) { } cur_frm.cscript.convert_to_group = function(doc, cdt, cdn) { - return $c_obj(cur_frm.get_doclist(),'convert_ledger_to_group','',function(r,rt) { + return $c_obj(cur_frm.doc,'convert_ledger_to_group','',function(r,rt) { if(r.message == 1) { cur_frm.refresh(); } diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher.js b/erpnext/accounts/doctype/journal_voucher/journal_voucher.js index 1107ba4a6c..fc042ba82c 100644 --- a/erpnext/accounts/doctype/journal_voucher/journal_voucher.js +++ b/erpnext/accounts/doctype/journal_voucher/journal_voucher.js @@ -12,8 +12,7 @@ erpnext.accounts.JournalVoucher = frappe.ui.form.Controller.extend({ load_defaults: function() { if(this.frm.doc.__islocal && this.frm.doc.company) { frappe.model.set_default_values(this.frm.doc); - $.each(frappe.model.get_doclist(this.frm.doc.doctype, - this.frm.doc.name, {parentfield: "entries"}), function(i, jvd) { + $.each(this.frm.doc.entries, function(i, jvd) { frappe.model.set_default_values(jvd); } ); @@ -156,7 +155,7 @@ cur_frm.cscript.credit = function(doc,dt,dn) { cur_frm.cscript.update_totals(doc cur_frm.cscript.get_balance = function(doc,dt,dn) { cur_frm.cscript.update_totals(doc); - return $c_obj(make_doclist(dt,dn), 'get_balance', '', function(r, rt){ + return $c_obj(cur_frm.doc, 'get_balance', '', function(r, rt){ cur_frm.refresh(); }); } @@ -194,8 +193,7 @@ cur_frm.cscript.voucher_type = function(doc, cdt, cdn) { cur_frm.set_df_property("cheque_no", "reqd", doc.voucher_type=="Bank Voucher"); cur_frm.set_df_property("cheque_date", "reqd", doc.voucher_type=="Bank Voucher"); - if(frappe.model.get("Journal Voucher Detail", {"parent":doc.name}).length!==0 // too late - || !doc.company) // too early + if((doc.entries || []).length!==0 || !doc.company) // too early return; var update_jv_details = function(doc, r) { diff --git a/erpnext/accounts/doctype/pos_setting/pos_setting.js b/erpnext/accounts/doctype/pos_setting/pos_setting.js index debfcd9d1a..61c64c2839 100755 --- a/erpnext/accounts/doctype/pos_setting/pos_setting.js +++ b/erpnext/accounts/doctype/pos_setting/pos_setting.js @@ -2,7 +2,7 @@ // License: GNU General Public License v3. See license.txt cur_frm.cscript.onload = function(doc,cdt,cdn){ - return $c_obj(make_doclist(cdt,cdn),'get_series','',function(r,rt){ + return $c_obj(cur_frm.doc, 'get_series','',function(r,rt){ if(r.message) set_field_options('naming_series', r.message); }); diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index 42cf8239b2..ebde867655 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -68,7 +68,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte if(cint(doc.update_stock)!=1) { // show Make Delivery Note button only if Sales Invoice is not created from Delivery Note var from_delivery_note = false; - from_delivery_note = cur_frm.get_doclist({parentfield: "entries"}) + from_delivery_note = cur_frm.doc.entries .some(function(item) { return item.delivery_note ? true : false; }); diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.js b/erpnext/buying/doctype/purchase_common/purchase_common.js index 6afcd95b92..14f1843abe 100644 --- a/erpnext/buying/doctype/purchase_common/purchase_common.js +++ b/erpnext/buying/doctype/purchase_common/purchase_common.js @@ -156,7 +156,7 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({ project_name: function(doc, cdt, cdn) { var item = frappe.model.get_doc(cdt, cdn); if(item.project_name) { - $.each(frappe.model.get_doclist(this.frm.doc.doctype, this.frm.doc.name, {parentfield: this.fname}), + $.each(this.frm.doc[this.fname], function(i, other_item) { if(!other_item.project_name) { other_item.project_name = item.project_name; diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js index 0db8d6fd99..410deeb07d 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.js +++ b/erpnext/buying/doctype/purchase_order/purchase_order.js @@ -128,7 +128,7 @@ cur_frm.fields_dict['po_details'].grid.get_field('project_name').get_query = fun } cur_frm.cscript.get_last_purchase_rate = function(doc, cdt, cdn){ - return $c_obj(make_doclist(doc.doctype, doc.name), 'get_last_purchase_rate', '', function(r, rt) { + return $c_obj(doc, 'get_last_purchase_rate', '', function(r, rt) { refresh_field(cur_frm.cscript.fname); var doc = locals[cdt][cdn]; cur_frm.cscript.calc_amount( doc, 2); @@ -140,7 +140,7 @@ cur_frm.cscript['Stop Purchase Order'] = function() { var check = confirm(frappe._("Do you really want to STOP ") + doc.name); if (check) { - return $c('runserverobj', args={'method':'update_status', 'arg': 'Stopped', 'docs': frappe.model.compress(make_doclist(doc.doctype, doc.name))}, function(r,rt) { + return $c('runserverobj', args={'method':'update_status', 'arg': 'Stopped', 'docs':doc}, function(r,rt) { cur_frm.refresh(); }); } @@ -151,7 +151,7 @@ cur_frm.cscript['Unstop Purchase Order'] = function() { var check = confirm(frappe._("Do you really want to UNSTOP ") + doc.name); if (check) { - return $c('runserverobj', args={'method':'update_status', 'arg': 'Submitted', 'docs': frappe.model.compress(make_doclist(doc.doctype, doc.name))}, function(r,rt) { + return $c('runserverobj', args={'method':'update_status', 'arg': 'Submitted', 'docs':doc}, function(r,rt) { cur_frm.refresh(); }); } diff --git a/erpnext/hr/doctype/employee/employee.js b/erpnext/hr/doctype/employee/employee.js index c27a4c56a2..88cf7cad68 100644 --- a/erpnext/hr/doctype/employee/employee.js +++ b/erpnext/hr/doctype/employee/employee.js @@ -68,7 +68,7 @@ erpnext.hr.EmployeeController = frappe.ui.form.Controller.extend({ Go to the active Salary Structure and set \"Is Active\" = \"No\"")); } else if(!r.exc) { frappe.model.map({ - source: frappe.model.get_doclist(me.frm.doc.doctype, me.frm.doc.name), + source: me.frm.doc, target: "Salary Structure" }); } diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.js b/erpnext/hr/doctype/expense_claim/expense_claim.js index 6ff1d3f261..9c54fd6384 100644 --- a/erpnext/hr/doctype/expense_claim/expense_claim.js +++ b/erpnext/hr/doctype/expense_claim/expense_claim.js @@ -125,7 +125,7 @@ cur_frm.cscript.validate = function(doc) { cur_frm.cscript.calculate_total = function(doc,cdt,cdn){ doc.total_claimed_amount = 0; doc.total_sanctioned_amount = 0; - $.each(frappe.model.get("Expense Claim Detail", {parent:doc.name}), function(i, d) { + $.each((doc.expense_voucher_details || []), function(i, d) { doc.total_claimed_amount += d.claim_amount; if(d.sanctioned_amount==null) { d.sanctioned_amount = d.claim_amount; diff --git a/erpnext/hr/doctype/leave_control_panel/leave_control_panel.js b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.js index be9096c23a..16ede6782d 100644 --- a/erpnext/hr/doctype/leave_control_panel/leave_control_panel.js +++ b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.js @@ -9,7 +9,7 @@ cur_frm.cscript.onload = function(doc, dt, dn){ } cur_frm.cscript.to_date = function(doc, cdt, cdn) { - return $c('runserverobj', args={'method':'to_date_validation','docs':frappe.model.compress(make_doclist(doc.doctype, doc.name))}, + return $c('runserverobj', args={'method':'to_date_validation','docs':doc}, function(r, rt) { var doc = locals[cdt][cdn]; if (r.message) { diff --git a/erpnext/hr/doctype/salary_manager/salary_manager.js b/erpnext/hr/doctype/salary_manager/salary_manager.js index 312a06d5c2..3745ee5a94 100644 --- a/erpnext/hr/doctype/salary_manager/salary_manager.js +++ b/erpnext/hr/doctype/salary_manager/salary_manager.js @@ -15,7 +15,7 @@ cur_frm.cscript.create_salary_slip = function(doc, cdt, cdn) { if (r.message) display_activity_log(r.message); } - return $c('runserverobj', args={'method':'create_sal_slip','docs':frappe.model.compress(make_doclist (cdt, cdn))},callback); + return $c('runserverobj', args={'method':'create_sal_slip','docs':doc},callback); } cur_frm.cscript.submit_salary_slip = function(doc, cdt, cdn) { @@ -25,7 +25,7 @@ cur_frm.cscript.submit_salary_slip = function(doc, cdt, cdn) { if (r.message) display_activity_log(r.message); } - return $c('runserverobj', args={'method':'submit_salary_slip','docs':frappe.model.compress(make_doclist (cdt, cdn))},callback); + return $c('runserverobj', args={'method':'submit_salary_slip','docs':doc},callback); } } @@ -59,5 +59,5 @@ cur_frm.cscript.make_jv = function(doc, dt, dn) { loaddoc('Journal Voucher', jv.name); } - return $c_obj(make_doclist(dt, dn), 'get_acc_details', '', call_back); + return $c_obj(doc, 'get_acc_details', '', call_back); } diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.js b/erpnext/hr/doctype/salary_slip/salary_slip.js index ceab14843e..e8aa6389bb 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.js +++ b/erpnext/hr/doctype/salary_slip/salary_slip.js @@ -21,7 +21,7 @@ cur_frm.cscript.onload = function(doc,dt,dn){ // Get leave details //--------------------------------------------------------------------- cur_frm.cscript.fiscal_year = function(doc,dt,dn){ - return $c_obj(make_doclist(doc.doctype,doc.name), 'get_emp_and_leave_details','',function(r, rt) { + return $c_obj(doc, 'get_emp_and_leave_details','',function(r, rt) { var doc = locals[dt][dn]; cur_frm.refresh(); calculate_all(doc, dt, dn); @@ -32,7 +32,7 @@ cur_frm.cscript.month = cur_frm.cscript.employee = cur_frm.cscript.fiscal_year; cur_frm.cscript.leave_without_pay = function(doc,dt,dn){ if (doc.employee && doc.fiscal_year && doc.month) { - return $c_obj(make_doclist(doc.doctype,doc.name), 'get_leave_details',doc.leave_without_pay,function(r, rt) { + return $c_obj(doc, 'get_leave_details',doc.leave_without_pay,function(r, rt) { var doc = locals[dt][dn]; cur_frm.refresh(); calculate_all(doc, dt, dn); diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.js b/erpnext/hr/doctype/salary_structure/salary_structure.js index 3b90ee6245..fc70455880 100644 --- a/erpnext/hr/doctype/salary_structure/salary_structure.js +++ b/erpnext/hr/doctype/salary_structure/salary_structure.js @@ -7,7 +7,7 @@ cur_frm.cscript.onload = function(doc, dt, dn){ e_tbl = getchildren('Salary Structure Earning', doc.name, 'earning_details', doc.doctype); d_tbl = getchildren('Salary Structure Deduction', doc.name, 'deduction_details', doc.doctype); if (e_tbl.length == 0 && d_tbl.length == 0) - return $c_obj(make_doclist(doc.doctype,doc.name),'make_earn_ded_table','', function(r, rt) { refresh_many(['earning_details', 'deduction_details']);}); + return $c_obj(doc,'make_earn_ded_table','', function(r, rt) { refresh_many(['earning_details', 'deduction_details']);}); } cur_frm.cscript.refresh = function(doc, dt, dn){ diff --git a/erpnext/manufacturing/doctype/production_order/production_order.js b/erpnext/manufacturing/doctype/production_order/production_order.js index 86580d611c..59017319b9 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.js +++ b/erpnext/manufacturing/doctype/production_order/production_order.js @@ -70,7 +70,7 @@ cur_frm.cscript['Stop Production Order'] = function() { var doc = cur_frm.doc; var check = confirm(frappe._("Do you really want to stop production order: " + doc.name)); if (check) { - return $c_obj(make_doclist(doc.doctype, doc.name), 'stop_unstop', 'Stopped', function(r, rt) {cur_frm.refresh();}); + return $c_obj(doc, 'stop_unstop', 'Stopped', function(r, rt) {cur_frm.refresh();}); } } @@ -78,7 +78,7 @@ cur_frm.cscript['Unstop Production Order'] = function() { var doc = cur_frm.doc; var check = confirm(frappe._("Do really want to unstop production order: " + doc.name)); if (check) - return $c_obj(make_doclist(doc.doctype, doc.name), 'stop_unstop', 'Unstopped', function(r, rt) {cur_frm.refresh();}); + return $c_obj(doc, 'stop_unstop', 'Unstopped', function(r, rt) {cur_frm.refresh();}); } cur_frm.cscript['Transfer Raw Materials'] = function() { diff --git a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.js b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.js index fdd4db1d77..fc7abde06c 100644 --- a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.js +++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.js @@ -25,9 +25,9 @@ cur_frm.cscript.item_code = function(doc,cdt,cdn) { } cur_frm.cscript.download_materials_required = function(doc, cdt, cdn) { - return $c_obj(make_doclist(cdt, cdn), 'validate_data', '', function(r, rt) { + return $c_obj(doc, 'validate_data', '', function(r, rt) { if (!r['exc']) - $c_obj_csv(make_doclist(cdt, cdn), 'download_raw_materials', '', ''); + $c_obj_csv(doc, 'download_raw_materials', '', ''); }); } diff --git a/erpnext/projects/doctype/time_log_batch/time_log_batch.js b/erpnext/projects/doctype/time_log_batch/time_log_batch.js index 7aa3e16097..7f3a17e6ef 100644 --- a/erpnext/projects/doctype/time_log_batch/time_log_batch.js +++ b/erpnext/projects/doctype/time_log_batch/time_log_batch.js @@ -30,9 +30,8 @@ $.extend(cur_frm.cscript, { } }, make_invoice: function() { - var doc = cur_frm.doc; frappe.model.map({ - source: frappe.model.get_doclist(doc.doctype, doc.name), + source: cur_frm.doc, target: "Sales Invoice" }); } diff --git a/erpnext/public/js/transaction.js b/erpnext/public/js/transaction.js index 2f89470b59..22c3c3a782 100644 --- a/erpnext/public/js/transaction.js +++ b/erpnext/public/js/transaction.js @@ -46,7 +46,6 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({ freeze: true, callback: function(r) { // remove this call when using client side mapper - me.set_default_values(); me.set_dynamic_labels(); me.calculate_taxes_and_totals(); } @@ -192,18 +191,7 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({ validate: function() { this.calculate_taxes_and_totals(); }, - - set_default_values: function() { - $.each(frappe.model.get_doclist(this.frm.doctype, this.frm.docname), function(i, doc) { - var updated = frappe.model.set_default_values(doc); - if(doc.parentfield) { - refresh_field(doc.parentfield); - } else { - refresh_field(updated); - } - }); - }, - + company: function() { if(this.frm.doc.company && this.frm.fields_dict.currency) { var company_currency = this.get_company_currency(); @@ -517,13 +505,11 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({ }, get_item_doclist: function() { - return frappe.model.get_doclist(this.frm.doc.doctype, this.frm.doc.name, - {parentfield: this.fname}); + return this.frm.doc[this.fname] || []; }, get_tax_doclist: function() { - return frappe.model.get_doclist(this.frm.doc.doctype, this.frm.doc.name, - {parentfield: this.other_fname}); + return this.frm.doc[this.other_fname] || []; }, validate_conversion_rate: function() { @@ -716,8 +702,7 @@ erpnext.TransactionController = erpnext.stock.StockController.extend({ calculate_total_advance: function(parenttype, advance_parentfield) { if(this.frm.doc.doctype == parenttype && this.frm.doc.docstatus < 2) { - var advance_doclist = frappe.model.get_doclist(this.frm.doc.doctype, this.frm.doc.name, - {parentfield: advance_parentfield}); + var advance_doclist = this.frm.doc[advance_parentfield] || []; this.frm.doc.total_advance = flt(frappe.utils.sum( $.map(advance_doclist, function(adv) { return adv.allocated_amount }) ), precision("total_advance")); diff --git a/erpnext/public/js/utils.js b/erpnext/public/js/utils.js index c5d3e0b729..9f7f278d95 100644 --- a/erpnext/public/js/utils.js +++ b/erpnext/public/js/utils.js @@ -29,8 +29,7 @@ $.extend(erpnext, { }, add_applicable_territory: function() { - if(cur_frm.doc.__islocal && - frappe.model.get_doclist(cur_frm.doc.doctype, cur_frm.doc.name).length === 1) { + if(cur_frm.doc.__islocal && (cur_frm.doc.valid_for_territories || []).length===0) { var default_territory = frappe.defaults.get_user_default("territory"); if(default_territory) { var territory = frappe.model.add_child(cur_frm.doc, "Applicable Territory", diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js index 0a3ca99bb0..727cca8544 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.js +++ b/erpnext/selling/doctype/sales_order/sales_order.js @@ -162,7 +162,7 @@ cur_frm.cscript['Stop Sales Order'] = function() { if (check) { return $c('runserverobj', { 'method':'stop_sales_order', - 'docs': frappe.model.compress(make_doclist(doc.doctype, doc.name)) + 'docs': doc }, function(r,rt) { cur_frm.refresh(); }); @@ -177,7 +177,7 @@ cur_frm.cscript['Unstop Sales Order'] = function() { if (check) { return $c('runserverobj', { 'method':'unstop_sales_order', - 'docs': frappe.model.compress(make_doclist(doc.doctype, doc.name)) + 'docs': doc }, function(r,rt) { cur_frm.refresh(); }); diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js index 1dbbbfe2a1..6859567df4 100644 --- a/erpnext/selling/sales_common.js +++ b/erpnext/selling/sales_common.js @@ -98,7 +98,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ this.frm.toggle_display("customer_name", (this.frm.doc.customer_name && this.frm.doc.customer_name!==this.frm.doc.customer)); if(this.frm.fields_dict.packing_details) { - var packing_list_exists = this.frm.get_doclist({parentfield: "packing_details"}).length; + var packing_list_exists = (this.frm.doc.packing_details || []).length; this.frm.toggle_display("packing_list", packing_list_exists ? true : false); } }, @@ -434,8 +434,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ calculate_contribution: function() { var me = this; - $.each(frappe.model.get_doclist(this.frm.doc.doctype, this.frm.doc.name, - {parentfield: "sales_team"}), function(i, sales_person) { + $.each(this.frm.doc.doctype.sales_team || [], function(i, sales_person) { frappe.model.round_floats_in(sales_person); if(sales_person.allocated_percentage) { sales_person.allocated_amount = flt( @@ -545,8 +544,8 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ // toggle columns var item_grid = this.frm.fields_dict[this.fname].grid; var show = (this.frm.doc.currency != company_currency) || - (frappe.model.get_doclist(cur_frm.doctype, cur_frm.docname, - {parentfield: "other_charges", included_in_print_rate: 1}).length); + (cur_frm.doc.other_charges.filter( + function(d) { return d.included_in_print_rate===1}).length); $.each(["base_rate", "base_price_list_rate", "base_amount"], function(i, fname) { if(frappe.meta.get_docfield(item_grid.doctype, fname)) diff --git a/erpnext/setup/doctype/contact_control/contact_control.js b/erpnext/setup/doctype/contact_control/contact_control.js index f28e3a0972..743bedd1dc 100755 --- a/erpnext/setup/doctype/contact_control/contact_control.js +++ b/erpnext/setup/doctype/contact_control/contact_control.js @@ -2,7 +2,7 @@ // License: GNU General Public License v3. See license.txt cur_frm.cscript.get_states=function(doc, dt, dn) { - return $c('runserverobj', args={'method': 'check_state', 'docs':frappe.model.compress(make_doclist(doc.doctype, doc.name))}, + return $c('runserverobj', args={'method': 'check_state', 'docs':doc}, function(r, rt) { if(r.message) set_field_options('state', r.message); diff --git a/erpnext/setup/doctype/email_digest/email_digest.js b/erpnext/setup/doctype/email_digest/email_digest.js index 875061b1b2..51f6231c29 100644 --- a/erpnext/setup/doctype/email_digest/email_digest.js +++ b/erpnext/setup/doctype/email_digest/email_digest.js @@ -9,7 +9,7 @@ cur_frm.cscript.refresh = function(doc, dt, dn) { cur_frm.add_custom_button(frappe._('View Now'), function() { doc = locals[dt][dn]; if(doc.__unsaved != 1) { - return $c_obj(make_doclist(dt, dn), 'get_digest_msg', '', function(r, rt) { + return $c_obj(doc, 'get_digest_msg', '', function(r, rt) { if(r.exc) { msgprint(err_msg); console.log(r.exc); @@ -32,7 +32,7 @@ cur_frm.cscript.refresh = function(doc, dt, dn) { cur_frm.add_custom_button(frappe._('Send Now'), function() { doc = locals[dt][dn]; if(doc.__unsaved != 1) { - return $c_obj(make_doclist(dt, dn), 'send', '', function(r, rt) { + return $c_obj(doc, 'send', '', function(r, rt) { if(r.exc) { msgprint(err_msg); console.log(r.exc); @@ -49,7 +49,7 @@ cur_frm.cscript.refresh = function(doc, dt, dn) { cur_frm.cscript.addremove_recipients = function(doc, dt, dn) { // Get user list - return $c_obj(make_doclist(dt, dn), 'get_users', '', function(r, rt) { + return $c_obj(doc, 'get_users', '', function(r, rt) { if(r.exc) { msgprint(r.exc); } else { diff --git a/erpnext/setup/doctype/global_defaults/global_defaults.js b/erpnext/setup/doctype/global_defaults/global_defaults.js index 4b378b3d7e..85d718ae79 100644 --- a/erpnext/setup/doctype/global_defaults/global_defaults.js +++ b/erpnext/setup/doctype/global_defaults/global_defaults.js @@ -18,7 +18,7 @@ $.extend(cur_frm.cscript, { }, validate: function(doc, cdt, cdn) { - return $c_obj(make_doclist(cdt, cdn), 'get_defaults', '', function(r, rt){ + return $c_obj(doc, 'get_defaults', '', function(r, rt){ sys_defaults = r.message; }); }, diff --git a/erpnext/setup/doctype/naming_series/naming_series.js b/erpnext/setup/doctype/naming_series/naming_series.js index 4f6a4c92c0..b9b94ca823 100644 --- a/erpnext/setup/doctype/naming_series/naming_series.js +++ b/erpnext/setup/doctype/naming_series/naming_series.js @@ -29,7 +29,7 @@ cur_frm.cscript.select_doc_for_series = function(doc, cdt, cdn) { } if(doc.select_doc_for_series) - return $c_obj(make_doclist(doc.doctype, doc.name),'get_options','',callback); + return $c_obj(doc,'get_options','',callback); } cur_frm.cscript.update = function() { diff --git a/erpnext/setup/doctype/notification_control/notification_control.js b/erpnext/setup/doctype/notification_control/notification_control.js index 9d26496d87..19660b8f7f 100644 --- a/erpnext/setup/doctype/notification_control/notification_control.js +++ b/erpnext/setup/doctype/notification_control/notification_control.js @@ -8,6 +8,6 @@ cur_frm.cscript.select_transaction = function(doc, cdt, cdn) { doc.custom_message = r.message; refresh_field('custom_message'); } - return $c_obj(make_doclist(cdt, cdn),'get_message',doc.select_transaction, callback) + return $c_obj(doc,'get_message',doc.select_transaction, callback) } } diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.js b/erpnext/stock/doctype/delivery_note/delivery_note.js index 371c093a2a..3a9ef8ddc0 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.js +++ b/erpnext/stock/doctype/delivery_note/delivery_note.js @@ -20,8 +20,7 @@ erpnext.stock.DeliveryNoteController = erpnext.selling.SellingController.extend( if(!doc.__billing_complete && doc.docstatus==1) { // show Make Invoice button only if Delivery Note is not created from Sales Invoice var from_sales_invoice = false; - from_sales_invoice = cur_frm.get_doclist({parentfield: "delivery_note_details"}) - .some(function(item) { + from_sales_invoice = cur_frm.doc.delivery_note_details.some(function(item) { return item.against_sales_invoice ? true : false; }); diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js index 3cae599255..b797420bdb 100644 --- a/erpnext/stock/doctype/item/item.js +++ b/erpnext/stock/doctype/item/item.js @@ -151,8 +151,7 @@ cur_frm.fields_dict.item_supplier_details.grid.get_field("supplier").get_query = cur_frm.cscript.copy_from_item_group = function(doc) { frappe.model.with_doc("Item Group", doc.item_group, function() { - $.each(frappe.model.get("Item Website Specification", {parent:doc.item_group}), - function(i, d) { + $.each((doc.item_website_specifications || []), function(i, d) { var n = frappe.model.add_child(doc, "Item Website Specification", "item_website_specifications"); n.label = d.label; diff --git a/erpnext/stock/doctype/material_request/material_request.js b/erpnext/stock/doctype/material_request/material_request.js index c83077530c..081469b103 100644 --- a/erpnext/stock/doctype/material_request/material_request.js +++ b/erpnext/stock/doctype/material_request/material_request.js @@ -80,7 +80,7 @@ erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.exten schedule_date: function(doc, cdt, cdn) { var val = locals[cdt][cdn].schedule_date; if(val) { - $.each(frappe.model.get("Material Request Item", { parent: cur_frm.doc.name }), function(i, d) { + $.each((doc.indent_details || []), function(i, d) { if(!d.schedule_date) { d.schedule_date = val; } @@ -172,7 +172,7 @@ cur_frm.cscript['Stop Material Request'] = function() { var check = confirm(frappe._("Do you really want to STOP this Material Request?")); if (check) { - return $c('runserverobj', args={'method':'update_status', 'arg': 'Stopped', 'docs': frappe.model.compress(make_doclist(doc.doctype, doc.name))}, function(r,rt) { + return $c('runserverobj', args={'method':'update_status', 'arg': 'Stopped', 'docs': doc}, function(r,rt) { cur_frm.refresh(); }); } @@ -183,7 +183,7 @@ cur_frm.cscript['Unstop Material Request'] = function(){ var check = confirm(frappe._("Do you really want to UNSTOP this Material Request?")); if (check) { - return $c('runserverobj', args={'method':'update_status', 'arg': 'Submitted','docs': frappe.model.compress(make_doclist(doc.doctype, doc.name))}, function(r,rt) { + return $c('runserverobj', args={'method':'update_status', 'arg': 'Submitted','docs': doc}, function(r,rt) { cur_frm.refresh(); }); } diff --git a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js index 328ca1d82c..c6ac73c0f7 100644 --- a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js +++ b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js @@ -94,8 +94,7 @@ cur_frm.cscript.periodicity = function(doc, cdt, cdn){ cur_frm.cscript.generate_schedule = function(doc, cdt, cdn) { if (!doc.__islocal) { - return $c('runserverobj', args={'method':'generate_schedule', - 'docs':frappe.model.compress(make_doclist(cdt,cdn))}, + return $c('runserverobj', args={'method':'generate_schedule', 'docs':doc}, function(r, rt) { refresh_field('maintenance_schedule_detail'); }); diff --git a/erpnext/support/doctype/newsletter/newsletter.js b/erpnext/support/doctype/newsletter/newsletter.js index dfa9af9a2e..5c88692c91 100644 --- a/erpnext/support/doctype/newsletter/newsletter.js +++ b/erpnext/support/doctype/newsletter/newsletter.js @@ -17,7 +17,7 @@ cur_frm.cscript.refresh = function(doc) { if(!doc.__islocal && !cint(doc.email_sent) && !doc.__unsaved && inList(frappe.boot.user.can_write, doc.doctype)) { cur_frm.add_custom_button(frappe._('Send'), function() { - return $c_obj(make_doclist(doc.doctype, doc.name), 'send_emails', '', function(r) { + return $c_obj(doc, 'send_emails', '', function(r) { cur_frm.refresh(); }); }) From 66d52b55c04b2869860f7669c5d027e23f0f5db7 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 27 Mar 2014 14:17:33 +0530 Subject: [PATCH 02/42] #478 --- erpnext/accounts/doctype/account/account.js | 2 +- .../doctype/journal_voucher/journal_voucher.js | 12 ++++++------ .../doctype/purchase_invoice/purchase_invoice.js | 6 +++--- .../purchase_taxes_and_charges_master.js | 2 +- erpnext/accounts/doctype/sales_invoice/pos.js | 15 +++++---------- .../doctype/sales_invoice/sales_invoice.js | 2 +- .../sales_taxes_and_charges_master.js | 2 +- .../doctype/purchase_common/purchase_common.js | 12 ++++++------ .../doctype/purchase_order/purchase_order.js | 2 +- erpnext/buying/doctype/supplier/supplier.js | 2 +- erpnext/controllers/js/contact_address_common.js | 6 +++--- erpnext/hr/doctype/appraisal/appraisal.js | 4 ++-- erpnext/hr/doctype/expense_claim/expense_claim.js | 3 +-- erpnext/hr/doctype/job_applicant/job_applicant.js | 2 +- erpnext/hr/doctype/salary_slip/salary_slip.js | 4 ++-- .../doctype/salary_structure/salary_structure.js | 8 ++++---- erpnext/manufacturing/doctype/bom/bom.js | 8 ++++---- erpnext/public/js/controllers/stock_controller.js | 2 +- erpnext/public/js/transaction.js | 10 +++++----- erpnext/public/js/utils.js | 2 +- erpnext/selling/doctype/lead/lead.js | 2 +- .../selling/doctype/opportunity/opportunity.js | 2 +- erpnext/selling/doctype/quotation/quotation.js | 2 +- .../selling/doctype/sales_order/sales_order.js | 2 +- erpnext/selling/sales_common.js | 14 +++++++------- .../stock/doctype/delivery_note/delivery_note.js | 6 +++--- .../stock/doctype/packing_slip/packing_slip.js | 2 +- .../doctype/purchase_receipt/purchase_receipt.js | 6 +++--- erpnext/stock/doctype/stock_entry/stock_entry.js | 8 ++++---- .../doctype/support_ticket/support_ticket.js | 2 +- erpnext/utilities/doctype/contact/contact.js | 2 +- 31 files changed, 74 insertions(+), 80 deletions(-) diff --git a/erpnext/accounts/doctype/account/account.js b/erpnext/accounts/doctype/account/account.js index f4f2b8a795..76a1e56fe9 100644 --- a/erpnext/accounts/doctype/account/account.js +++ b/erpnext/accounts/doctype/account/account.js @@ -18,7 +18,7 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) { if(doc.group_or_ledger=='Ledger') { frappe.model.with_doc("Accounts Settings", "Accounts Settings", function (name) { - var accounts_settings = frappe.model.get_doc("Accounts Settings", name); + var accounts_settings = frappe.get_doc("Accounts Settings", name); var display = accounts_settings["frozen_accounts_modifier"] && in_list(user_roles, accounts_settings["frozen_accounts_modifier"]); diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher.js b/erpnext/accounts/doctype/journal_voucher/journal_voucher.js index fc042ba82c..e8e513d0a2 100644 --- a/erpnext/accounts/doctype/journal_voucher/journal_voucher.js +++ b/erpnext/accounts/doctype/journal_voucher/journal_voucher.js @@ -39,7 +39,7 @@ erpnext.accounts.JournalVoucher = frappe.ui.form.Controller.extend({ $.each([["against_voucher", "Purchase Invoice", "credit_to"], ["against_invoice", "Sales Invoice", "debit_to"]], function(i, opts) { me.frm.set_query(opts[0], "entries", function(doc, cdt, cdn) { - var jvd = frappe.model.get_doc(cdt, cdn); + var jvd = frappe.get_doc(cdt, cdn); frappe.model.validate_missing(jvd, "account"); return { filters: [ @@ -52,7 +52,7 @@ erpnext.accounts.JournalVoucher = frappe.ui.form.Controller.extend({ }); this.frm.set_query("against_jv", "entries", function(doc, cdt, cdn) { - var jvd = frappe.model.get_doc(cdt, cdn); + var jvd = frappe.get_doc(cdt, cdn); frappe.model.validate_missing(jvd, "account"); return { @@ -63,7 +63,7 @@ erpnext.accounts.JournalVoucher = frappe.ui.form.Controller.extend({ }, against_voucher: function(doc, cdt, cdn) { - var d = frappe.model.get_doc(cdt, cdn); + var d = frappe.get_doc(cdt, cdn); if (d.against_voucher && !flt(d.debit)) { this.get_outstanding({ 'doctype': 'Purchase Invoice', @@ -73,7 +73,7 @@ erpnext.accounts.JournalVoucher = frappe.ui.form.Controller.extend({ }, against_invoice: function(doc, cdt, cdn) { - var d = frappe.model.get_doc(cdt, cdn); + var d = frappe.get_doc(cdt, cdn); if (d.against_invoice && !flt(d.credit)) { this.get_outstanding({ 'doctype': 'Sales Invoice', @@ -83,7 +83,7 @@ erpnext.accounts.JournalVoucher = frappe.ui.form.Controller.extend({ }, against_jv: function(doc, cdt, cdn) { - var d = frappe.model.get_doc(cdt, cdn); + var d = frappe.get_doc(cdt, cdn); if (d.against_jv && !flt(d.credit) && !flt(d.debit)) { this.get_outstanding({ 'doctype': 'Journal Voucher', @@ -138,7 +138,7 @@ cur_frm.cscript.is_opening = function(doc, cdt, cdn) { cur_frm.cscript.update_totals = function(doc) { var td=0.0; var tc =0.0; - var el = getchildren('Journal Voucher Detail', doc.name, 'entries'); + var el = doc.entries || []; for(var i in el) { td += flt(el[i].debit, 2); tc += flt(el[i].credit, 2); diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js index be1f3b2362..a45af20ae6 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js @@ -108,7 +108,7 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({ }, entries_add: function(doc, cdt, cdn) { - var row = frappe.model.get_doc(cdt, cdn); + var row = frappe.get_doc(cdt, cdn); this.frm.script_manager.copy_from_first_row("entries", row, ["expense_account", "cost_center"]); } }); @@ -184,7 +184,7 @@ cur_frm.set_query("expense_account", "entries", function(doc) { cur_frm.cscript.expense_account = function(doc, cdt, cdn){ var d = locals[cdt][cdn]; if(d.idx == 1 && d.expense_account){ - var cl = getchildren('Purchase Invoice Item', doc.name, 'entries', doc.doctype); + var cl = doc.entries || []; for(var i = 0; i < cl.length; i++){ if(!cl[i].expense_account) cl[i].expense_account = d.expense_account; } @@ -205,7 +205,7 @@ cur_frm.fields_dict["entries"].grid.get_field("cost_center").get_query = functio cur_frm.cscript.cost_center = function(doc, cdt, cdn){ var d = locals[cdt][cdn]; if(d.idx == 1 && d.cost_center){ - var cl = getchildren('Purchase Invoice Item', doc.name, 'entries', doc.doctype); + var cl = doc.entries || []; for(var i = 0; i < cl.length; i++){ if(!cl[i].cost_center) cl[i].cost_center = d.cost_center; } diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js index 2027a7b33a..bc0a912bd6 100644 --- a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js +++ b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js @@ -41,7 +41,7 @@ cur_frm.pformat.other_charges= function(doc) { return doc_field.print_hide; } - var cl = getchildren('Purchase Taxes and Charges', doc.name, 'other_charges'); + var cl = doc.other_charges || []; // outer table var out='
\ diff --git a/erpnext/accounts/doctype/sales_invoice/pos.js b/erpnext/accounts/doctype/sales_invoice/pos.js index fc6190ae7a..ff996cc107 100644 --- a/erpnext/accounts/doctype/sales_invoice/pos.js +++ b/erpnext/accounts/doctype/sales_invoice/pos.js @@ -293,8 +293,7 @@ erpnext.POS = Class.extend({ // check whether the item is already added if (no_of_items != 0) { - $.each(frappe.model.get_children(this.frm.doctype + " Item", this.frm.doc.name, - this.frm.cscript.fname, this.frm.doctype), function(i, d) { + $.each(this.frm.doc[this.frm.cscript.fname] || [], function(i, d) { if (d.item_code == item_code) { caught = true; if (serial_no) @@ -335,8 +334,7 @@ erpnext.POS = Class.extend({ }, update_qty: function(item_code, qty) { var me = this; - $.each(frappe.model.get_children(this.frm.doctype + " Item", this.frm.doc.name, - this.frm.cscript.fname, this.frm.doctype), function(i, d) { + $.each(this.frm.doc[this.frm.cscript.fname] || [], function(i, d) { if (d.item_code == item_code) { if (qty == 0) { frappe.model.clear_doc(d.doctype, d.name); @@ -387,8 +385,7 @@ erpnext.POS = Class.extend({ var me = this; var $items = this.wrapper.find("#cart tbody").empty(); - $.each(frappe.model.get_children(this.frm.doctype + " Item", this.frm.doc.name, - this.frm.cscript.fname, this.frm.doctype), function(i, d) { + $.each(this.frm.doc[this.frm.cscript.fname] || [], function(i, d) { $(repl('\ \ @@ -422,8 +419,7 @@ erpnext.POS = Class.extend({ }, show_taxes: function() { var me = this; - var taxes = frappe.model.get_children(this.sales_or_purchase + " Taxes and Charges", - this.frm.doc.name, this.frm.cscript.other_fname, this.frm.doctype); + var taxes = this.frm.doc[this.frm.cscript.other_fname] || []; $(this.wrapper).find(".tax-table") .toggle((taxes && taxes.length) ? true : false) .find("tbody").empty(); @@ -544,8 +540,7 @@ erpnext.POS = Class.extend({ } } - var child = frappe.model.get_children(this.frm.doctype + " Item", this.frm.doc.name, - this.frm.cscript.fname, this.frm.doctype); + var child = this.frm.doc[this.frm.cscript.fname] || []; $.each(child, function(i, d) { for (var i in selected_items) { diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index ebde867655..077c9136ac 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -199,7 +199,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte }, entries_add: function(doc, cdt, cdn) { - var row = frappe.model.get_doc(cdt, cdn); + var row = frappe.get_doc(cdt, cdn); this.frm.script_manager.copy_from_first_row("entries", row, ["income_account", "cost_center"]); }, diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js b/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js index 6f35f4af88..f4b425b84b 100644 --- a/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js +++ b/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.js @@ -54,7 +54,7 @@ cur_frm.pformat.other_charges= function(doc){ out =''; if (!doc.print_without_amount) { - var cl = getchildren('Sales Taxes and Charges', doc.name, 'other_charges'); + var cl = doc.other_charges || []; // outer table var out='
%(item_code)s%(item_name)s

\n

\n
\n
'; diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.js b/erpnext/buying/doctype/purchase_common/purchase_common.js index 14f1843abe..e18b3ef4e0 100644 --- a/erpnext/buying/doctype/purchase_common/purchase_common.js +++ b/erpnext/buying/doctype/purchase_common/purchase_common.js @@ -78,7 +78,7 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({ }, price_list_rate: function(doc, cdt, cdn) { - var item = frappe.model.get_doc(cdt, cdn); + var item = frappe.get_doc(cdt, cdn); frappe.model.round_floats_in(item, ["price_list_rate", "discount_percentage"]); item.rate = flt(item.price_list_rate * (1 - item.discount_percentage / 100.0), @@ -92,7 +92,7 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({ }, rate: function(doc, cdt, cdn) { - var item = frappe.model.get_doc(cdt, cdn); + var item = frappe.get_doc(cdt, cdn); frappe.model.round_floats_in(item, ["rate", "discount_percentage"]); if(item.price_list_rate) { @@ -107,7 +107,7 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({ uom: function(doc, cdt, cdn) { var me = this; - var item = frappe.model.get_doc(cdt, cdn); + var item = frappe.get_doc(cdt, cdn); if(item.item_code && item.uom) { return this.frm.call({ method: "erpnext.buying.utils.get_conversion_factor", @@ -132,7 +132,7 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({ conversion_factor: function(doc, cdt, cdn) { if(frappe.meta.get_docfield(cdt, "stock_qty", cdn)) { - var item = frappe.model.get_doc(cdt, cdn); + var item = frappe.get_doc(cdt, cdn); frappe.model.round_floats_in(item, ["qty", "conversion_factor"]); item.stock_qty = flt(item.qty * item.conversion_factor, precision("stock_qty", item)); refresh_field("stock_qty", item.name, item.parentfield); @@ -140,7 +140,7 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({ }, warehouse: function(doc, cdt, cdn) { - var item = frappe.model.get_doc(cdt, cdn); + var item = frappe.get_doc(cdt, cdn); if(item.item_code && item.warehouse) { return this.frm.call({ method: "erpnext.buying.utils.get_projected_qty", @@ -154,7 +154,7 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({ }, project_name: function(doc, cdt, cdn) { - var item = frappe.model.get_doc(cdt, cdn); + var item = frappe.get_doc(cdt, cdn); if(item.project_name) { $.each(this.frm.doc[this.fname], function(i, other_item) { diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js index 410deeb07d..1dfb78e00d 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.js +++ b/erpnext/buying/doctype/purchase_order/purchase_order.js @@ -170,7 +170,7 @@ cur_frm.pformat.indent_no = function(doc, cdt, cdn){ out =''; - var cl = getchildren('Purchase Order Item',doc.name,'po_details'); + var cl = doc.po_details || []; // outer table var out='

\n

\n
\n
'; diff --git a/erpnext/buying/doctype/supplier/supplier.js b/erpnext/buying/doctype/supplier/supplier.js index cfe526fc58..05288c3882 100644 --- a/erpnext/buying/doctype/supplier/supplier.js +++ b/erpnext/buying/doctype/supplier/supplier.js @@ -17,7 +17,7 @@ cur_frm.cscript.refresh = function(doc, dt, dn) { cur_frm.cscript.make_contact(doc,dt,dn); cur_frm.communication_view = new frappe.views.CommunicationList({ - list: frappe.model.get("Communication", {"supplier": doc.name}), + list: frappe.get_list("Communication", {"supplier": doc.name}), parent: cur_frm.fields_dict.communication_html.wrapper, doc: doc }) diff --git a/erpnext/controllers/js/contact_address_common.js b/erpnext/controllers/js/contact_address_common.js index 6a66469d63..d06f6a0265 100644 --- a/erpnext/controllers/js/contact_address_common.js +++ b/erpnext/controllers/js/contact_address_common.js @@ -23,7 +23,7 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) { "Installation Note", "Opportunity", "Customer Issue", "Maintenance Visit", "Maintenance Schedule"] .indexOf(doctype)!==-1) { - var refdoc = frappe.model.get_doc(doctype, docname); + var refdoc = frappe.get_doc(doctype, docname); if(refdoc.doctype == "Quotation" ? refdoc.quotation_to=="Customer" : true) { cur_frm.set_value("customer", refdoc.customer || refdoc.name); @@ -34,7 +34,7 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) { } if(["Supplier", "Supplier Quotation", "Purchase Order", "Purchase Invoice", "Purchase Receipt"] .indexOf(doctype)!==-1) { - var refdoc = frappe.model.get_doc(doctype, docname); + var refdoc = frappe.get_doc(doctype, docname); cur_frm.set_value("supplier", refdoc.supplier || refdoc.name); cur_frm.set_value("supplier_name", refdoc.supplier_name); if(cur_frm.doc.doctype==="Address") @@ -42,7 +42,7 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) { } if(["Lead", "Quotation"] .indexOf(doctype)!==-1) { - var refdoc = frappe.model.get_doc(doctype, docname); + var refdoc = frappe.get_doc(doctype, docname); if(refdoc.doctype == "Quotation" ? refdoc.quotation_to=="Lead" : true) { cur_frm.set_value("lead", refdoc.lead || refdoc.name); diff --git a/erpnext/hr/doctype/appraisal/appraisal.js b/erpnext/hr/doctype/appraisal/appraisal.js index 5bcb96d82c..a87607c03f 100644 --- a/erpnext/hr/doctype/appraisal/appraisal.js +++ b/erpnext/hr/doctype/appraisal/appraisal.js @@ -32,7 +32,7 @@ cur_frm.cscript.kra_template = function(doc, dt, dn) { cur_frm.cscript.calculate_total_score = function(doc,cdt,cdn){ //return get_server_fields('calculate_total','','',doc,cdt,cdn,1); - var val = getchildren('Appraisal Goal', doc.name, 'appraisal_details', doc.doctype); + var val = doc.appraisal_details || []; var total =0; for(var i = 0; i item.received_qty) { diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js index 535fcb735b..6ee3922327 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry.js @@ -105,9 +105,9 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({ }, callback: function(r) { if (!r.exc) { - for(d in getchildren('Stock Entry Detail', me.frm.doc.name, 'mtn_details')) { + $.each(doc.mtn_details || [], function(i, d) { if(!d.expense_account) d.expense_account = r.message; - } + }); } } }); @@ -225,7 +225,7 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({ }, mtn_details_add: function(doc, cdt, cdn) { - var row = frappe.model.get_doc(cdt, cdn); + var row = frappe.get_doc(cdt, cdn); this.frm.script_manager.copy_from_first_row("mtn_details", row, ["expense_account", "cost_center"]); @@ -388,7 +388,7 @@ cur_frm.cscript.validate = function(doc, cdt, cdn) { } cur_frm.cscript.validate_items = function(doc) { - cl = getchildren('Stock Entry Detail', doc.name, 'mtn_details'); + cl = doc.mtn_details || []; if (!cl.length) { msgprint(frappe._("Item table can not be blank")); validated = false; diff --git a/erpnext/support/doctype/support_ticket/support_ticket.js b/erpnext/support/doctype/support_ticket/support_ticket.js index 034fa8694f..c18653549c 100644 --- a/erpnext/support/doctype/support_ticket/support_ticket.js +++ b/erpnext/support/doctype/support_ticket/support_ticket.js @@ -34,7 +34,7 @@ $.extend(cur_frm.cscript, { make_listing: function(doc) { var wrapper = cur_frm.fields_dict['thread_html'].wrapper; - var comm_list = frappe.model.get("Communication", {"parent": doc.name, "parenttype":"Support Ticket"}) + var comm_list = frappe.get_list("Communication", {"parent": doc.name, "parenttype":"Support Ticket"}) if(!comm_list.length) { comm_list.push({ diff --git a/erpnext/utilities/doctype/contact/contact.js b/erpnext/utilities/doctype/contact/contact.js index eb7681f886..f2a2fdcef2 100644 --- a/erpnext/utilities/doctype/contact/contact.js +++ b/erpnext/utilities/doctype/contact/contact.js @@ -5,7 +5,7 @@ cur_frm.cscript.refresh = function(doc) { cur_frm.communication_view = new frappe.views.CommunicationList({ - list: frappe.model.get("Communication", {"parent": doc.name, "parenttype": "Contact"}), + list: frappe.get_list("Communication", {"parent": doc.name, "parenttype": "Contact"}), parent: cur_frm.fields_dict.communication_html.wrapper, doc: doc, recipients: doc.email_id From d2b34dc30c39a495b78f55bb02e32ef6ae657e81 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 27 Mar 2014 16:12:56 +0530 Subject: [PATCH 03/42] frappe/frappe#478 --- erpnext/accounts/doctype/account/account.py | 8 +-- .../accounts_settings/accounts_settings.py | 6 +- .../bank_reconciliation.py | 16 ++--- .../bank_reconciliation_detail.py | 7 +- .../doctype/budget_detail/budget_detail.py | 7 +- .../budget_distribution.py | 11 ++- .../budget_distribution_detail.py | 7 +- erpnext/accounts/doctype/c_form/c_form.py | 13 ++-- .../c_form_invoice_detail.py | 7 +- .../chart_of_accounts/chart_of_accounts.py | 6 +- .../doctype/cost_center/cost_center.py | 7 +- .../doctype/fiscal_year/fiscal_year.py | 6 +- erpnext/accounts/doctype/gl_entry/gl_entry.py | 6 +- .../journal_voucher/journal_voucher.py | 45 ++++++------ .../journal_voucher_detail.py | 7 +- .../mode_of_payment/mode_of_payment.py | 7 +- .../payment_to_invoice_matching_tool.py | 15 ++-- ...payment_to_invoice_matching_tool_detail.py | 7 +- .../period_closing_voucher.py | 4 +- .../doctype/pos_setting/pos_setting.py | 5 +- .../doctype/pricing_rule/pricing_rule.py | 4 +- .../purchase_invoice/purchase_invoice.py | 50 +++++++------- .../purchase_invoice/test_purchase_invoice.py | 8 +-- .../purchase_invoice_advance.py | 7 +- .../purchase_invoice_item.py | 7 +- .../purchase_taxes_and_charges.py | 7 +- .../purchase_taxes_and_charges_master.py | 14 +--- .../doctype/sales_invoice/sales_invoice.py | 68 +++++++++---------- .../sales_invoice/test_sales_invoice.py | 32 ++++----- .../sales_invoice_advance.py | 7 +- .../sales_invoice_item/sales_invoice_item.py | 7 +- .../sales_taxes_and_charges.py | 7 +- .../sales_taxes_and_charges_master.py | 2 +- .../doctype/shipping_rule/shipping_rule.py | 6 +- .../shipping_rule_condition.py | 7 +- erpnext/accounts/utils.py | 3 +- .../buying_settings/buying_settings.py | 6 +- .../purchase_common/purchase_common.py | 5 +- .../doctype/purchase_order/purchase_order.py | 11 ++- .../purchase_order/test_purchase_order.py | 2 +- .../purchase_order_item.py | 7 +- .../purchase_order_item_supplied.py | 7 +- .../purchase_receipt_item_supplied.py | 7 +- .../quality_inspection/quality_inspection.py | 12 ++-- .../quality_inspection_reading.py | 7 +- erpnext/buying/doctype/supplier/supplier.py | 5 +- .../supplier_quotation/supplier_quotation.py | 2 +- .../supplier_quotation_item.py | 7 +- erpnext/controllers/accounts_controller.py | 18 ++--- erpnext/controllers/buying_controller.py | 18 ++--- erpnext/controllers/selling_controller.py | 12 ++-- erpnext/controllers/status_updater.py | 2 +- erpnext/controllers/stock_controller.py | 8 +-- erpnext/home/doctype/feed/feed.py | 11 +-- erpnext/hr/doctype/appraisal/appraisal.py | 9 ++- .../doctype/appraisal_goal/appraisal_goal.py | 7 +- .../appraisal_template/appraisal_template.py | 6 +- .../appraisal_template_goal.py | 7 +- erpnext/hr/doctype/attendance/attendance.py | 7 +- erpnext/hr/doctype/branch/branch.py | 8 +-- .../doctype/deduction_type/deduction_type.py | 7 +- erpnext/hr/doctype/department/department.py | 8 +-- erpnext/hr/doctype/designation/designation.py | 8 +-- .../hr/doctype/earning_type/earning_type.py | 7 +- erpnext/hr/doctype/employee/employee.py | 6 +- .../employee_education/employee_education.py | 7 +- .../employee_external_work_history.py | 7 +- .../employee_internal_work_history.py | 7 +- .../employee_leave_approver.py | 7 +- .../employment_type/employment_type.py | 8 +-- .../hr/doctype/expense_claim/expense_claim.py | 9 ++- .../expense_claim_detail.py | 7 +- .../expense_claim_type/expense_claim_type.py | 7 +- erpnext/hr/doctype/grade/grade.py | 8 +-- erpnext/hr/doctype/holiday/holiday.py | 7 +- .../hr/doctype/holiday_list/holiday_list.py | 14 ++-- erpnext/hr/doctype/hr_settings/hr_settings.py | 6 +- .../hr/doctype/job_applicant/job_applicant.py | 4 +- erpnext/hr/doctype/job_opening/job_opening.py | 7 +- .../leave_allocation/leave_allocation.py | 4 +- .../leave_application/leave_application.py | 4 +- .../leave_block_list/leave_block_list.py | 6 +- .../leave_block_list_allow.py | 7 +- .../leave_block_list_date.py | 7 +- .../leave_control_panel.py | 4 +- erpnext/hr/doctype/leave_type/leave_type.py | 8 +-- .../doctype/salary_manager/salary_manager.py | 7 +- erpnext/hr/doctype/salary_slip/salary_slip.py | 14 ++-- .../salary_slip_deduction.py | 7 +- .../salary_slip_earning.py | 7 +- .../salary_structure/salary_structure.py | 10 ++- .../salary_structure_deduction.py | 7 +- .../salary_structure_earning.py | 7 +- .../upload_attendance/upload_attendance.py | 7 +- erpnext/manufacturing/doctype/bom/bom.py | 30 ++++---- .../bom_explosion_item/bom_explosion_item.py | 7 +- .../doctype/bom_item/bom_item.py | 7 +- .../doctype/bom_operation/bom_operation.py | 7 +- .../bom_replace_tool/bom_replace_tool.py | 4 +- .../production_order/production_order.py | 7 +- .../production_plan_item.py | 7 +- .../production_plan_sales_order.py | 7 +- .../production_planning_tool.py | 25 +++---- .../doctype/workstation/workstation.py | 4 +- .../doctype/activity_type/activity_type.py | 7 +- erpnext/projects/doctype/project/project.py | 9 ++- .../project_milestone/project_milestone.py | 7 +- erpnext/projects/doctype/task/task.py | 10 +-- erpnext/projects/doctype/time_log/time_log.py | 6 +- .../doctype/time_log_batch/time_log_batch.py | 6 +- .../time_log_batch_detail.py | 7 +- erpnext/selling/doctype/campaign/campaign.py | 8 +-- erpnext/selling/doctype/customer/customer.py | 5 +- .../doctype/industry_type/industry_type.py | 8 +-- .../installation_note/installation_note.py | 13 ++-- .../installation_note_item.py | 7 +- erpnext/selling/doctype/lead/lead.py | 5 +- .../doctype/opportunity/opportunity.py | 25 +++---- .../opportunity_item/opportunity_item.py | 7 +- .../selling/doctype/quotation/quotation.py | 15 ++-- .../doctype/quotation_item/quotation_item.py | 7 +- .../selling/doctype/sales_bom/sales_bom.py | 7 +- .../doctype/sales_bom_item/sales_bom_item.py | 7 +- .../doctype/sales_order/sales_order.py | 6 +- .../sales_order_item/sales_order_item.py | 7 +- .../selling/doctype/sales_team/sales_team.py | 7 +- .../selling_settings/selling_settings.py | 6 +- .../selling/doctype/sms_center/sms_center.py | 7 +- .../applicable_territory.py | 7 +- .../authorization_control.py | 4 +- .../authorization_rule/authorization_rule.py | 6 +- .../doctype/backup_manager/backup_manager.py | 6 +- erpnext/setup/doctype/brand/brand.py | 7 +- erpnext/setup/doctype/company/company.py | 7 +- .../contact_control/contact_control.py | 8 +-- erpnext/setup/doctype/country/country.py | 7 +- erpnext/setup/doctype/currency/currency.py | 6 +- .../currency_exchange/currency_exchange.py | 4 +- .../doctype/customer_group/customer_group.py | 5 +- .../doctype/email_digest/email_digest.py | 6 +- .../doctype/features_setup/features_setup.py | 6 +- .../global_defaults/global_defaults.py | 6 +- .../setup/doctype/item_group/item_group.py | 5 +- .../jobs_email_settings.py | 6 +- .../doctype/naming_series/naming_series.py | 6 +- .../notification_control.py | 7 +- .../doctype/print_heading/print_heading.py | 11 +-- .../quotation_lost_reason.py | 7 +- .../sales_email_settings.py | 6 +- .../doctype/sales_partner/sales_partner.py | 7 +- .../doctype/sales_person/sales_person.py | 7 +- .../doctype/sms_parameter/sms_parameter.py | 7 +- .../doctype/sms_settings/sms_settings.py | 7 +- .../doctype/supplier_type/supplier_type.py | 7 +- .../doctype/target_detail/target_detail.py | 7 +- .../terms_and_conditions.py | 7 +- erpnext/setup/doctype/territory/territory.py | 9 +-- erpnext/setup/doctype/uom/uom.py | 7 +- .../website_item_group/website_item_group.py | 7 +- .../setup/page/setup_wizard/setup_wizard.py | 10 ++- erpnext/stock/doctype/batch/batch.py | 7 +- erpnext/stock/doctype/bin/bin.py | 7 +- .../doctype/delivery_note/delivery_note.py | 23 +++---- .../delivery_note_item/delivery_note_item.py | 7 +- erpnext/stock/doctype/item/item.py | 15 ++-- .../item_customer_detail.py | 7 +- .../stock/doctype/item_price/item_price.py | 6 +- .../item_quality_inspection_parameter.py | 7 +- .../doctype/item_reorder/item_reorder.py | 7 +- .../doctype/item_supplier/item_supplier.py | 7 +- erpnext/stock/doctype/item_tax/item_tax.py | 7 +- .../item_website_specification.py | 7 +- .../landed_cost_item/landed_cost_item.py | 7 +- .../landed_cost_purchase_receipt.py | 7 +- .../landed_cost_wizard/landed_cost_wizard.py | 19 ++---- .../material_request/material_request.py | 17 ++--- .../material_request_item.py | 7 +- .../stock/doctype/packed_item/packed_item.py | 11 ++- .../doctype/packing_slip/packing_slip.py | 17 +++-- .../packing_slip_item/packing_slip_item.py | 7 +- .../stock/doctype/price_list/price_list.py | 4 +- .../purchase_receipt/purchase_receipt.py | 25 +++---- .../purchase_receipt/test_purchase_receipt.py | 2 +- .../purchase_receipt_item.py | 7 +- erpnext/stock/doctype/serial_no/serial_no.py | 2 +- .../stock/doctype/stock_entry/stock_entry.py | 41 +++++------ .../doctype/stock_entry/test_stock_entry.py | 12 ++-- .../stock_entry_detail/stock_entry_detail.py | 7 +- .../doctype/stock_ledger/stock_ledger.py | 7 +- .../stock_ledger_entry/stock_ledger_entry.py | 5 +- .../stock_reconciliation.py | 2 +- .../doctype/stock_settings/stock_settings.py | 6 +- .../stock_uom_replace_utility.py | 4 +- .../uom_conversion_detail.py | 7 +- erpnext/stock/doctype/warehouse/warehouse.py | 7 +- .../doctype/warehouse_user/warehouse_user.py | 7 +- erpnext/stock/get_item_details.py | 2 +- erpnext/stock/utils.py | 2 +- .../doctype/customer_issue/customer_issue.py | 5 +- .../maintenance_schedule.py | 33 ++++----- .../maintenance_schedule_detail.py | 7 +- .../maintenance_schedule_item.py | 7 +- .../maintenance_visit/maintenance_visit.py | 13 ++-- .../maintenance_visit_purpose.py | 7 +- .../support/doctype/newsletter/newsletter.py | 5 +- .../support_email_settings.py | 6 +- .../doctype/support_ticket/support_ticket.py | 5 +- erpnext/utilities/doctype/address/address.py | 7 +- erpnext/utilities/doctype/contact/contact.py | 5 +- erpnext/utilities/doctype/note/note.py | 6 +- .../utilities/doctype/note_user/note_user.py | 7 +- .../doctype/rename_tool/rename_tool.py | 6 +- .../doctype/sms_control/sms_control.py | 7 +- erpnext/utilities/doctype/sms_log/sms_log.py | 7 +- 214 files changed, 898 insertions(+), 973 deletions(-) diff --git a/erpnext/accounts/doctype/account/account.py b/erpnext/accounts/doctype/account/account.py index 4c3e4d1682..0c88aebd92 100644 --- a/erpnext/accounts/doctype/account/account.py +++ b/erpnext/accounts/doctype/account/account.py @@ -9,10 +9,10 @@ from frappe import msgprint, throw, _ get_value = frappe.db.get_value -class DocType: - def __init__(self,d,dl): - self.doc, self.doclist = d,dl - self.nsm_parent_field = 'parent_account' +from frappe.model.document import Document + +class Account(Document): + nsm_parent_field = 'parent_account' def autoname(self): self.doc.name = self.doc.account_name.strip() + ' - ' + \ diff --git a/erpnext/accounts/doctype/accounts_settings/accounts_settings.py b/erpnext/accounts/doctype/accounts_settings/accounts_settings.py index 3e01eea710..ab7e8ab286 100644 --- a/erpnext/accounts/doctype/accounts_settings/accounts_settings.py +++ b/erpnext/accounts/doctype/accounts_settings/accounts_settings.py @@ -8,9 +8,9 @@ import frappe from frappe import _ from frappe.utils import cint -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +from frappe.model.document import Document + +class AccountsSettings(Document): def on_update(self): frappe.db.set_default("auto_accounting_for_stock", self.doc.auto_accounting_for_stock) diff --git a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py index 859c9d00c4..5ad447cceb 100644 --- a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py +++ b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py @@ -5,17 +5,11 @@ from __future__ import unicode_literals import frappe from frappe.utils import cstr, flt, getdate, now, nowdate -from frappe.model import db_exists -from frappe.model.doc import addchild -from frappe.model.bean import getlist, copy_doclist from frappe import msgprint - +from frappe.model.document import Document - -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +class BankReconciliation(Document): def get_details(self): if not (self.doc.bank_account and self.doc.from_date and self.doc.to_date): @@ -24,11 +18,11 @@ class DocType: dl = frappe.db.sql("select t1.name, t1.cheque_no, t1.cheque_date, t2.debit, t2.credit, t1.posting_date, t2.against_account from `tabJournal Voucher` t1, `tabJournal Voucher Detail` t2 where t2.parent = t1.name and t2.account = %s and (clearance_date is null or clearance_date = '0000-00-00' or clearance_date = '') and t1.posting_date >= %s and t1.posting_date <= %s and t1.docstatus=1", (self.doc.bank_account, self.doc.from_date, self.doc.to_date)) - self.doclist = self.doc.clear_table(self.doclist, 'entries') + self.set('entries', []) self.doc.total_amount = 0.0 for d in dl: - nl = addchild(self.doc, 'entries', 'Bank Reconciliation Detail', self.doclist) + nl = self.doc.append('entries', {}) nl.posting_date = cstr(d[5]) nl.voucher_id = cstr(d[0]) nl.cheque_number = cstr(d[1]) @@ -40,7 +34,7 @@ class DocType: def update_details(self): vouchers = [] - for d in getlist(self.doclist, 'entries'): + for d in self.get('entries'): if d.clearance_date: if d.cheque_date and getdate(d.clearance_date) < getdate(d.cheque_date): msgprint("Clearance Date can not be before Cheque Date (Row #%s)" % diff --git a/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.py b/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.py index 26c87f1c04..93dca1da23 100644 --- a/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.py +++ b/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class BankReconciliationDetail(Document): + pass \ No newline at end of file diff --git a/erpnext/accounts/doctype/budget_detail/budget_detail.py b/erpnext/accounts/doctype/budget_detail/budget_detail.py index 26c87f1c04..58106a06ac 100644 --- a/erpnext/accounts/doctype/budget_detail/budget_detail.py +++ b/erpnext/accounts/doctype/budget_detail/budget_detail.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class BudgetDetail(Document): + pass \ No newline at end of file diff --git a/erpnext/accounts/doctype/budget_distribution/budget_distribution.py b/erpnext/accounts/doctype/budget_distribution/budget_distribution.py index 5173097666..069c4d3390 100644 --- a/erpnext/accounts/doctype/budget_distribution/budget_distribution.py +++ b/erpnext/accounts/doctype/budget_distribution/budget_distribution.py @@ -5,21 +5,18 @@ from __future__ import unicode_literals import frappe from frappe.utils import flt -from frappe.model.doc import addchild from frappe.model.bean import getlist from frappe import msgprint, _ -class DocType: - def __init__(self,doc,doclist=[]): - self.doc,self.doclist = doc,doclist - +from frappe.model.document import Document + +class BudgetDistribution(Document): def get_months(self): month_list = ['January','February','March','April','May','June','July','August','September', 'October','November','December'] idx =1 for m in month_list: - mnth = addchild(self.doc, 'budget_distribution_details', - 'Budget Distribution Detail', self.doclist) + mnth = self.append('budget_distribution_details') mnth.month = m or '' mnth.idx = idx idx += 1 diff --git a/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.py b/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.py index 26c87f1c04..84d8060731 100644 --- a/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.py +++ b/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class BudgetDistributionDetail(Document): + pass \ No newline at end of file diff --git a/erpnext/accounts/doctype/c_form/c_form.py b/erpnext/accounts/doctype/c_form/c_form.py index fdf8b30ebb..b832554164 100644 --- a/erpnext/accounts/doctype/c_form/c_form.py +++ b/erpnext/accounts/doctype/c_form/c_form.py @@ -6,15 +6,16 @@ import frappe from frappe.utils import flt, getdate from frappe.model.bean import getlist -class DocType: - def __init__(self,d,dl): - self.doc, self.doclist = d,dl +from frappe.model.document import Document + +class CForm(Document): + def validate(self): """Validate invoice that c-form is applicable and no other c-form is received for that""" - for d in getlist(self.doclist, 'invoice_details'): + for d in self.get('invoice_details'): if d.invoice_no: inv = frappe.db.sql("""select c_form_applicable, c_form_no from `tabSales Invoice` where name = %s and docstatus = 1""", d.invoice_no) @@ -46,7 +47,7 @@ class DocType: where c_form_no=%s""", self.doc.name) def set_cform_in_sales_invoices(self): - inv = [d.invoice_no for d in getlist(self.doclist, 'invoice_details')] + inv = [d.invoice_no for d in self.get('invoice_details')] if inv: frappe.db.sql("""update `tabSales Invoice` set c_form_no=%s, modified=%s where name in (%s)""" % ('%s', '%s', ', '.join(['%s'] * len(inv))), @@ -60,7 +61,7 @@ class DocType: frappe.msgprint("Please enter atleast 1 invoice in the table", raise_exception=1) def set_total_invoiced_amount(self): - total = sum([flt(d.grand_total) for d in getlist(self.doclist, 'invoice_details')]) + total = sum([flt(d.grand_total) for d in self.get('invoice_details')]) frappe.db.set(self.doc, 'total_invoiced_amount', total) def get_invoice_details(self, invoice_no): diff --git a/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.py b/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.py index 26c87f1c04..8e3bc2974a 100644 --- a/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.py +++ b/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class CFormInvoiceDetail(Document): + pass \ No newline at end of file diff --git a/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.py b/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.py index 16c6acff58..3b377fc54f 100644 --- a/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.py +++ b/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.py @@ -7,9 +7,9 @@ from frappe.utils import cstr from unidecode import unidecode -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +from frappe.model.document import Document + +class ChartOfAccounts(Document): self.no_report_type = False def create_accounts(self, company): diff --git a/erpnext/accounts/doctype/cost_center/cost_center.py b/erpnext/accounts/doctype/cost_center/cost_center.py index e02496ff5d..720b0bab19 100644 --- a/erpnext/accounts/doctype/cost_center/cost_center.py +++ b/erpnext/accounts/doctype/cost_center/cost_center.py @@ -8,9 +8,8 @@ from frappe import msgprint, _ from frappe.utils.nestedset import DocTypeNestedSet -class DocType(DocTypeNestedSet): - def __init__(self,d,dl): - self.doc, self.doclist = d,dl +class CostCenter(DocTypeNestedSet): + self.nsm_parent_field = 'parent_cost_center' def autoname(self): @@ -54,7 +53,7 @@ class DocType(DocTypeNestedSet): def validate_budget_details(self): check_acc_list = [] - for d in getlist(self.doclist, 'budget_details'): + for d in self.get('budget_details'): if self.doc.group_or_ledger=="Group": msgprint("Budget cannot be set for Group Cost Centers", raise_exception=1) diff --git a/erpnext/accounts/doctype/fiscal_year/fiscal_year.py b/erpnext/accounts/doctype/fiscal_year/fiscal_year.py index 3918751d84..34110d3386 100644 --- a/erpnext/accounts/doctype/fiscal_year/fiscal_year.py +++ b/erpnext/accounts/doctype/fiscal_year/fiscal_year.py @@ -6,9 +6,9 @@ import frappe from frappe import msgprint, _ from frappe.utils import getdate -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +from frappe.model.document import Document + +class FiscalYear(Document): def set_as_default(self): frappe.db.set_value("Global Defaults", None, "current_fiscal_year", self.doc.name) diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.py b/erpnext/accounts/doctype/gl_entry/gl_entry.py index 9e1dbb7f58..b6a52953c5 100644 --- a/erpnext/accounts/doctype/gl_entry/gl_entry.py +++ b/erpnext/accounts/doctype/gl_entry/gl_entry.py @@ -7,9 +7,9 @@ import frappe from frappe.utils import flt, fmt_money, getdate from frappe import _ -class DocType: - def __init__(self,d,dl): - self.doc, self.doclist = d, dl +from frappe.model.document import Document + +class GlEntry(Document): def validate(self): self.check_mandatory() diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher.py b/erpnext/accounts/doctype/journal_voucher/journal_voucher.py index 57c14b00d6..9884b57da3 100644 --- a/erpnext/accounts/doctype/journal_voucher/journal_voucher.py +++ b/erpnext/accounts/doctype/journal_voucher/journal_voucher.py @@ -5,16 +5,13 @@ from __future__ import unicode_literals import frappe from frappe.utils import cint, cstr, flt, fmt_money, formatdate, getdate -from frappe.model.doc import addchild -from frappe.model.bean import getlist from frappe import msgprint, _ from erpnext.setup.utils import get_company_currency from erpnext.controllers.accounts_controller import AccountsController -class DocType(AccountsController): - def __init__(self,d,dl): - self.doc, self.doclist = d,dl +class JournalVoucher(AccountsController): + self.master_type = {} self.credit_days_for = {} self.credit_days_global = -1 @@ -57,7 +54,7 @@ class DocType(AccountsController): # frappe.delete_doc("Journal Voucher", self.doc.amended_from) def validate_debit_credit(self): - for d in getlist(self.doclist, 'entries'): + for d in self.get('entries'): if d.debit and d.credit: msgprint("You cannot credit and debit same account at the same time.", raise_exception=1) @@ -72,7 +69,7 @@ class DocType(AccountsController): msgprint("Reference No is mandatory if you entered Reference Date", raise_exception=1) def validate_entries_for_advance(self): - for d in getlist(self.doclist,'entries'): + for d in self.get('entries'): if not d.is_advance and not d.against_voucher and \ not d.against_invoice and not d.against_jv: master_type = frappe.db.get_value("Account", d.account, "master_type") @@ -82,7 +79,7 @@ class DocType(AccountsController): Account %s if this is an advance entry." % d.account) def validate_against_jv(self): - for d in getlist(self.doclist, 'entries'): + for d in self.get('entries'): if d.against_jv: if d.against_jv == self.doc.name: msgprint("You can not enter current voucher in 'Against JV' column", @@ -96,7 +93,7 @@ class DocType(AccountsController): # Debit = Credit debit, credit = 0.0, 0.0 debit_list, credit_list = [], [] - for d in getlist(self.doclist, 'entries'): + for d in self.get('entries'): debit += flt(d.debit, 2) credit += flt(d.credit, 2) if flt(d.debit)>0 and (d.account not in debit_list): debit_list.append(d.account) @@ -110,7 +107,7 @@ class DocType(AccountsController): (self.doc.total_debit-self.doc.total_credit), raise_exception=1) # update against account - for d in getlist(self.doclist, 'entries'): + for d in self.get('entries'): if flt(d.debit) > 0: d.against_account = ', '.join(credit_list) if flt(d.credit) > 0: d.against_account = ', '.join(debit_list) @@ -123,7 +120,7 @@ class DocType(AccountsController): else : msgprint("Please enter Reference date", raise_exception=1) - for d in getlist(self.doclist, 'entries'): + for d in self.get('entries'): if d.against_invoice and d.credit: currency = frappe.db.get_value("Sales Invoice", d.against_invoice, "currency") r.append('%s %s against Invoice: %s' % @@ -152,7 +149,7 @@ class DocType(AccountsController): else: # check account type whether supplier or customer exists = False - for d in getlist(self.doclist, 'entries'): + for d in self.get('entries'): account_type = frappe.db.get_value("Account", d.account, "account_type") if account_type in ["Supplier", "Customer"]: exists = True @@ -165,7 +162,7 @@ class DocType(AccountsController): self.doc.aging_date = self.doc.posting_date def set_print_format_fields(self): - for d in getlist(self.doclist, 'entries'): + for d in self.get('entries'): account_type, master_type = frappe.db.get_value("Account", d.account, ["account_type", "master_type"]) @@ -191,7 +188,7 @@ class DocType(AccountsController): # Get List of Customer Account acc_list = filter(lambda d: frappe.db.get_value("Account", d.account, - "master_type")=='Customer', getlist(self.doclist,'entries')) + "master_type")=='Customer', self.get('entries')) for d in acc_list: credit_days = self.get_credit_days_for(d.account) @@ -228,7 +225,7 @@ class DocType(AccountsController): return self.is_approving_authority def check_account_against_entries(self): - for d in self.doclist.get({"parentfield": "entries"}): + for d in self.get("entries"): if d.against_invoice and frappe.db.get_value("Sales Invoice", d.against_invoice, "debit_to") != d.account: frappe.throw(_("Row #") + cstr(d.idx) + ": " + @@ -246,7 +243,7 @@ class DocType(AccountsController): self.check_account_against_entries() gl_map = [] - for d in self.doclist.get({"parentfield": "entries"}): + for d in self.get("entries"): if d.debit or d.credit: gl_map.append( self.get_gl_dict({ @@ -266,21 +263,21 @@ class DocType(AccountsController): make_gl_entries(gl_map, cancel=cancel, adv_adj=adv_adj) def check_credit_limit(self): - for d in self.doclist.get({"parentfield": "entries"}): + for d in self.get("entries"): master_type, master_name = frappe.db.get_value("Account", d.account, ["master_type", "master_name"]) if master_type == "Customer" and master_name: super(DocType, self).check_credit_limit(d.account) def get_balance(self): - if not getlist(self.doclist,'entries'): + if not self.get('entries'): msgprint("Please enter atleast 1 entry in 'GL Entries' table") else: flag, self.doc.total_debit, self.doc.total_credit = 0, 0, 0 diff = flt(self.doc.difference, 2) # If any row without amount, set the diff on that row - for d in getlist(self.doclist,'entries'): + for d in self.get('entries'): if not d.credit and not d.debit and diff != 0: if diff>0: d.credit = diff @@ -290,25 +287,25 @@ class DocType(AccountsController): # Set the diff in a new row if flag == 0 and diff != 0: - jd = addchild(self.doc, 'entries', 'Journal Voucher Detail', self.doclist) + jd = self.doc.append('entries', {}) if diff>0: jd.credit = abs(diff) elif diff<0: jd.debit = abs(diff) # Set the total debit, total credit and difference - for d in getlist(self.doclist,'entries'): + for d in self.get('entries'): self.doc.total_debit += flt(d.debit, 2) self.doc.total_credit += flt(d.credit, 2) self.doc.difference = flt(self.doc.total_debit, 2) - flt(self.doc.total_credit, 2) def get_outstanding_invoices(self): - self.doclist = self.doc.clear_table(self.doclist, 'entries') + self.set('entries', []) total = 0 for d in self.get_values(): total += flt(d[2]) - jd = addchild(self.doc, 'entries', 'Journal Voucher Detail', self.doclist) + jd = self.doc.append('entries', {}) jd.account = cstr(d[1]) if self.doc.write_off_based_on == 'Accounts Receivable': jd.credit = flt(d[2]) @@ -317,7 +314,7 @@ class DocType(AccountsController): jd.debit = flt(d[2]) jd.against_voucher = cstr(d[0]) jd.save(1) - jd = addchild(self.doc, 'entries', 'Journal Voucher Detail', self.doclist) + jd = self.doc.append('entries', {}) if self.doc.write_off_based_on == 'Accounts Receivable': jd.debit = total elif self.doc.write_off_based_on == 'Accounts Payable': diff --git a/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.py b/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.py index 26c87f1c04..36700d2dc3 100644 --- a/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.py +++ b/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class JournalVoucherDetail(Document): + pass \ No newline at end of file diff --git a/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.py b/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.py index 26c87f1c04..ddabf8973f 100644 --- a/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.py +++ b/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class ModeOfPayment(Document): + pass \ No newline at end of file diff --git a/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py b/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py index e0bd61d7ae..8260deadc3 100644 --- a/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py +++ b/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py @@ -5,14 +5,12 @@ from __future__ import unicode_literals import frappe from frappe.utils import flt -from frappe.model.doc import addchild from frappe.model.bean import getlist from frappe import msgprint -class DocType: - def __init__(self, doc, doclist): - self.doc = doc - self.doclist = doclist +from frappe.model.document import Document + +class PaymentToInvoiceMatchingTool(Document): def set_account_type(self): self.doc.account_type = "" @@ -49,7 +47,7 @@ class DocType: Payment entry will be decided based on account type (Dr/Cr) """ - self.doclist = self.doc.clear_table(self.doclist, 'ir_payment_details') + self.set('ir_payment_details', []) gle = self.get_gl_entries() self.create_payment_table(gle) @@ -79,8 +77,7 @@ class DocType: def create_payment_table(self, gle): for d in gle: - ch = addchild(self.doc, 'ir_payment_details', - 'Payment to Invoice Matching Tool Detail', self.doclist) + ch = self.doc.append('ir_payment_details', {}) ch.voucher_no = d.get('voucher_no') ch.posting_date = d.get('posting_date') ch.amt_due = self.doc.account_type == 'debit' and flt(d.get('amt_due')) \ @@ -106,7 +103,7 @@ class DocType: msgprint("Please select valid Voucher No to proceed", raise_exception=1) lst = [] - for d in getlist(self.doclist, 'ir_payment_details'): + for d in self.get('ir_payment_details'): if flt(d.amt_to_be_reconciled) > 0: args = { 'voucher_no' : d.voucher_no, diff --git a/erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.py b/erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.py index 26c87f1c04..a7bf686170 100644 --- a/erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.py +++ b/erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class PaymentToInvoiceMatchingToolDetail(Document): + pass \ No newline at end of file diff --git a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py index 100bd9562d..cdc20e85f0 100644 --- a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py +++ b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py @@ -7,9 +7,7 @@ from frappe.utils import cstr, flt from frappe import _ from erpnext.controllers.accounts_controller import AccountsController -class DocType(AccountsController): - def __init__(self,d,dl): - self.doc, self.doclist = d, dl +class PeriodClosingVoucher(AccountsController): self.year_start_date = '' def validate(self): diff --git a/erpnext/accounts/doctype/pos_setting/pos_setting.py b/erpnext/accounts/doctype/pos_setting/pos_setting.py index 29ae298b8e..61d405bccd 100755 --- a/erpnext/accounts/doctype/pos_setting/pos_setting.py +++ b/erpnext/accounts/doctype/pos_setting/pos_setting.py @@ -6,10 +6,9 @@ import frappe from frappe import msgprint, _ from frappe.utils import cint -class DocType: - def __init__(self,doc,doclist): - self.doc, self.doclist = doc,doclist +from frappe.model.document import Document +class PosSetting(Document): def get_series(self): import frappe.model.doctype docfield = frappe.model.doctype.get('Sales Invoice') diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py index 5073718d43..831efacb9d 100644 --- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py +++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py @@ -8,9 +8,7 @@ import frappe from frappe import throw, _ from frappe.model.controller import DocListController -class DocType(DocListController): - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +class PricingRule(DocListController): def validate(self): self.validate_mandatory() diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index c059d2d7c3..c07b2c8e29 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -15,22 +15,20 @@ import frappe.defaults from erpnext.controllers.buying_controller import BuyingController from erpnext.accounts.party import get_party_account, get_due_date -class DocType(BuyingController): - def __init__(self,d,dl): - self.doc, self.doclist = d, dl - self.tname = 'Purchase Invoice Item' - self.fname = 'entries' - self.status_updater = [{ - 'source_dt': 'Purchase Invoice Item', - 'target_dt': 'Purchase Order Item', - 'join_field': 'po_detail', - 'target_field': 'billed_amt', - 'target_parent_dt': 'Purchase Order', - 'target_parent_field': 'per_billed', - 'target_ref_field': 'amount', - 'source_field': 'amount', - 'percent_join_field': 'purchase_order', - }] +class PurchaseInvoice(BuyingController): + tname = 'Purchase Invoice Item' + fname = 'entries' + status_updater = [{ + 'source_dt': 'Purchase Invoice Item', + 'target_dt': 'Purchase Order Item', + 'join_field': 'po_detail', + 'target_field': 'billed_amt', + 'target_parent_dt': 'Purchase Order', + 'target_parent_field': 'per_billed', + 'target_ref_field': 'amount', + 'source_field': 'amount', + 'percent_join_field': 'purchase_order', + }] def validate(self): if not self.doc.is_opening: @@ -71,7 +69,7 @@ class DocType(BuyingController): "Purchase Invoice Advance", "advance_allocation_details", "debit") def check_active_purchase_items(self): - for d in getlist(self.doclist, 'entries'): + for d in self.get('entries'): if d.item_code: # extra condn coz item_code is not mandatory in PV valid_item = frappe.db.sql("select docstatus,is_purchase_item from tabItem where name = %s",d.item_code) if valid_item[0][0] == 2: @@ -125,7 +123,7 @@ class DocType(BuyingController): # --------------------- def check_for_stopped_status(self): check_list = [] - for d in getlist(self.doclist,'entries'): + for d in self.get('entries'): if d.purchase_order and not d.purchase_order in check_list and not d.purchase_receipt: check_list.append(d.purhcase_order) stopped = frappe.db.sql("select name from `tabPurchase Order` where status = 'Stopped' and name = %s", d.purchase_order) @@ -187,7 +185,7 @@ class DocType(BuyingController): against_accounts = [] stock_items = self.get_stock_items() - for item in self.doclist.get({"parentfield": "entries"}): + for item in self.get("entries"): if auto_accounting_for_stock and item.item_code in stock_items \ and self.doc.is_opening == 'No': # in case of auto inventory accounting, against expense account is always @@ -210,14 +208,14 @@ class DocType(BuyingController): def po_required(self): if frappe.db.get_value("Buying Settings", None, "po_required") == 'Yes': - for d in getlist(self.doclist,'entries'): + for d in self.get('entries'): if not d.purchase_order: msgprint("Purchse Order No. required against item %s"%d.item_code) raise Exception def pr_required(self): if frappe.db.get_value("Buying Settings", None, "pr_required") == 'Yes': - for d in getlist(self.doclist,'entries'): + for d in self.get('entries'): if not d.purchase_receipt: msgprint("Purchase Receipt No. required against item %s"%d.item_code) raise Exception @@ -227,7 +225,7 @@ class DocType(BuyingController): msgprint("Please enter Write Off Account", raise_exception=1) def check_prev_docstatus(self): - for d in getlist(self.doclist,'entries'): + for d in self.get('entries'): if d.purchase_order: submitted = frappe.db.sql("select name from `tabPurchase Order` where docstatus = 1 and name = %s", d.purchase_order) if not submitted: @@ -247,7 +245,7 @@ class DocType(BuyingController): """ lst = [] - for d in getlist(self.doclist, 'advance_allocation_details'): + for d in self.get('advance_allocation_details'): if flt(d.allocated_amount) > 0: args = { 'voucher_no' : d.journal_voucher, @@ -299,7 +297,7 @@ class DocType(BuyingController): # tax table gl entries valuation_tax = {} - for tax in self.doclist.get({"parentfield": "other_charges"}): + for tax in self.get("other_charges"): if tax.category in ("Total", "Valuation and Total") and flt(tax.tax_amount): gl_entries.append( self.get_gl_dict({ @@ -325,7 +323,7 @@ class DocType(BuyingController): # item gl entries stock_item_and_auto_accounting_for_stock = False stock_items = self.get_stock_items() - for item in self.doclist.get({"parentfield": "entries"}): + for item in self.get("entries"): if auto_accounting_for_stock and item.item_code in stock_items: if flt(item.valuation_rate): # if auto inventory accounting enabled and stock item, @@ -404,7 +402,7 @@ class DocType(BuyingController): def update_raw_material_cost(self): if self.sub_contracted_items: - for d in self.doclist.get({"parentfield": "entries"}): + for d in self.get("entries"): rm_cost = frappe.db.sql("""select raw_material_cost / quantity from `tabBOM` where item = %s and is_default = 1 and docstatus = 1 and is_active = 1 """, (d.item_code,)) diff --git a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py index b5942e3ddc..28bd2d183d 100644 --- a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py @@ -107,7 +107,7 @@ class TestPurchaseInvoice(unittest.TestCase): ["_Test Item Home Desktop 100", 90, 59], ["_Test Item Home Desktop 200", 135, 177] ] - for i, item in enumerate(wrapper.doclist.get({"parentfield": "entries"})): + for i, item in enumerate(wrapper.get("entries")): self.assertEqual(item.item_code, expected_values[i][0]) self.assertEqual(item.item_tax_amount, expected_values[i][1]) self.assertEqual(item.valuation_rate, expected_values[i][2]) @@ -126,7 +126,7 @@ class TestPurchaseInvoice(unittest.TestCase): ["_Test Account Discount - _TC", 168.03, 1512.30], ] - for i, tax in enumerate(wrapper.doclist.get({"parentfield": "other_charges"})): + for i, tax in enumerate(wrapper.get("other_charges")): self.assertEqual(tax.account_head, expected_values[i][0]) self.assertEqual(tax.tax_amount, expected_values[i][1]) self.assertEqual(tax.total, expected_values[i][2]) @@ -141,7 +141,7 @@ class TestPurchaseInvoice(unittest.TestCase): ["_Test FG Item", 90, 7059], ["_Test Item Home Desktop 200", 135, 177] ] - for i, item in enumerate(wrapper.doclist.get({"parentfield": "entries"})): + for i, item in enumerate(wrapper.get("entries")): self.assertEqual(item.item_code, expected_values[i][0]) self.assertEqual(item.item_tax_amount, expected_values[i][1]) self.assertEqual(item.valuation_rate, expected_values[i][2]) @@ -160,7 +160,7 @@ class TestPurchaseInvoice(unittest.TestCase): ["_Test Account Discount - _TC", 168.03, 1512.30], ] - for i, tax in enumerate(wrapper.doclist.get({"parentfield": "other_charges"})): + for i, tax in enumerate(wrapper.get("other_charges")): self.assertEqual(tax.account_head, expected_values[i][0]) self.assertEqual(tax.tax_amount, expected_values[i][1]) self.assertEqual(tax.total, expected_values[i][2]) diff --git a/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.py b/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.py index 26c87f1c04..9dc3b16878 100644 --- a/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.py +++ b/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class PurchaseInvoiceAdvance(Document): + pass \ No newline at end of file diff --git a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.py b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.py index 26c87f1c04..580d989158 100644 --- a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.py +++ b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class PurchaseInvoiceItem(Document): + pass \ No newline at end of file diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.py b/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.py index 26c87f1c04..910e380dcf 100644 --- a/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.py +++ b/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class PurchaseTaxesAndCharges(Document): + pass \ No newline at end of file diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.py b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.py index eee6e9ac8c..fb9a0ab674 100644 --- a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.py +++ b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.py @@ -3,15 +3,7 @@ from __future__ import unicode_literals import frappe +from frappe.model.document import Document -from frappe.model import db_exists -from frappe.model.bean import copy_doclist -from frappe.model.code import get_obj - - - - -class DocType: - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist \ No newline at end of file +class PurchaseTaxesAndChargesMaster(Document): + pass diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index a3302c7558..068d82ce85 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -20,27 +20,23 @@ month_map = {'Monthly': 1, 'Quarterly': 3, 'Half-yearly': 6, 'Yearly': 12} from erpnext.controllers.selling_controller import SellingController -class DocType(SellingController): - def __init__(self,d,dl): - self.doc, self.doclist = d, dl - self.log = [] - self.tname = 'Sales Invoice Item' - self.fname = 'entries' - self.status_updater = [{ - 'source_dt': 'Sales Invoice Item', - 'target_field': 'billed_amt', - 'target_ref_field': 'amount', - 'target_dt': 'Sales Order Item', - 'join_field': 'so_detail', - 'target_parent_dt': 'Sales Order', - 'target_parent_field': 'per_billed', - 'source_field': 'amount', - 'join_field': 'so_detail', - 'percent_join_field': 'sales_order', - 'status_field': 'billing_status', - 'keyword': 'Billed' - }] - +class SalesInvoice(SellingController): + tname = 'Sales Invoice Item' + fname = 'entries' + status_updater = [{ + 'source_dt': 'Sales Invoice Item', + 'target_field': 'billed_amt', + 'target_ref_field': 'amount', + 'target_dt': 'Sales Order Item', + 'join_field': 'so_detail', + 'target_parent_dt': 'Sales Order', + 'target_parent_field': 'per_billed', + 'source_field': 'amount', + 'join_field': 'so_detail', + 'percent_join_field': 'sales_order', + 'status_field': 'billing_status', + 'keyword': 'Billed' + }] def validate(self): super(DocType, self).validate() @@ -194,7 +190,7 @@ class DocType(SellingController): self.doc.update_stock = cint(pos.get("update_stock")) # set pos values in items - for item in self.doclist.get({"parentfield": "entries"}): + for item in self.get("entries"): if item.fields.get('item_code'): for fname, val in get_pos_settings_item_details(pos, frappe._dict(item.fields), pos).items(): @@ -207,7 +203,7 @@ class DocType(SellingController): self.doc.terms = frappe.db.get_value("Terms and Conditions", self.doc.tc_name, "terms") # fetch charges - if self.doc.charge and not len(self.doclist.get({"parentfield": "other_charges"})): + if self.doc.charge and not len(self.get("other_charges")): self.set_taxes("other_charges", "taxes_and_charges") def get_advances(self): @@ -226,7 +222,7 @@ class DocType(SellingController): """ lst = [] - for d in getlist(self.doclist, 'advance_adjustment_details'): + for d in self.get('advance_adjustment_details'): if flt(d.allocated_amount) > 0: args = { 'voucher_no' : d.journal_voucher, @@ -262,7 +258,7 @@ class DocType(SellingController): def validate_fixed_asset_account(self): """Validate Fixed Asset and whether Income Account Entered Exists""" - for d in getlist(self.doclist,'entries'): + for d in self.get('entries'): item = frappe.db.sql("""select name,is_asset_item,is_sales_item from `tabItem` where name = %s and (ifnull(end_of_life,'')='' or end_of_life = '0000-00-00' or end_of_life > now())""", d.item_code) @@ -314,7 +310,7 @@ class DocType(SellingController): def set_against_income_account(self): """Set against account for debit to account""" against_acc = [] - for d in getlist(self.doclist, 'entries'): + for d in self.get('entries'): if d.income_account not in against_acc: against_acc.append(d.income_account) self.doc.against_income_account = ','.join(against_acc) @@ -329,7 +325,7 @@ class DocType(SellingController): dic = {'Sales Order':'so_required','Delivery Note':'dn_required'} for i in dic: if frappe.db.get_value('Selling Settings', None, dic[i]) == 'Yes': - for d in getlist(self.doclist,'entries'): + for d in self.get('entries'): if frappe.db.get_value('Item', d.item_code, 'is_stock_item') == 'Yes' \ and not d.fields[i.lower().replace(' ','_')]: msgprint("%s is mandatory for stock item which is not mentioed against item: %s"%(i,d.item_code), raise_exception=1) @@ -356,13 +352,13 @@ class DocType(SellingController): def validate_item_code(self): - for d in getlist(self.doclist, 'entries'): + for d in self.get('entries'): if not d.item_code: msgprint("Please enter Item Code at line no : %s to update stock or remove check from Update Stock in Basic Info Tab." % (d.idx), raise_exception=True) def validate_delivery_note(self): - for d in self.doclist.get({"parentfield": "entries"}): + for d in self.get("entries"): if d.delivery_note: msgprint("""Stock update can not be made against Delivery Note""", raise_exception=1) @@ -381,12 +377,12 @@ class DocType(SellingController): frappe.db.set(self.doc, 'c_form_no', '') def update_current_stock(self): - for d in getlist(self.doclist, 'entries'): + for d in self.get('entries'): if d.item_code and d.warehouse: bin = frappe.db.sql("select actual_qty from `tabBin` where item_code = %s and warehouse = %s", (d.item_code, d.warehouse), as_dict = 1) d.actual_qty = bin and flt(bin[0]['actual_qty']) or 0 - for d in getlist(self.doclist, 'packing_details'): + for d in self.get('packing_details'): bin = frappe.db.sql("select actual_qty, projected_qty from `tabBin` where item_code = %s and warehouse = %s", (d.item_code, d.warehouse), as_dict = 1) d.actual_qty = bin and flt(bin[0]['actual_qty']) or 0 d.projected_qty = bin and flt(bin[0]['projected_qty']) or 0 @@ -414,14 +410,14 @@ class DocType(SellingController): if cint(self.doc.is_pos) == 1: w = self.get_warehouse() if w: - for d in getlist(self.doclist, 'entries'): + for d in self.get('entries'): if not d.warehouse: d.warehouse = cstr(w) from erpnext.stock.doctype.packed_item.packed_item import make_packing_list make_packing_list(self, 'entries') else: - self.doclist = self.doc.clear_table(self.doclist, 'packing_details') + self.set('packing_details', []) if cint(self.doc.is_pos) == 1: if flt(self.doc.paid_amount) == 0: @@ -436,7 +432,7 @@ class DocType(SellingController): frappe.db.set(self.doc,'paid_amount',0) def check_prev_docstatus(self): - for d in getlist(self.doclist,'entries'): + for d in self.get('entries'): if d.sales_order: submitted = frappe.db.sql("""select name from `tabSales Order` where docstatus = 1 and name = %s""", d.sales_order) @@ -510,7 +506,7 @@ class DocType(SellingController): ) def make_tax_gl_entries(self, gl_entries): - for tax in self.doclist.get({"parentfield": "other_charges"}): + for tax in self.get("other_charges"): if flt(tax.tax_amount_after_discount_amount): gl_entries.append( self.get_gl_dict({ @@ -524,7 +520,7 @@ class DocType(SellingController): def make_item_gl_entries(self, gl_entries): # income account gl entries - for item in self.doclist.get({"parentfield": "entries"}): + for item in self.get("entries"): if flt(item.base_amount): gl_entries.append( self.get_gl_dict({ diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index 81d55722f9..a4a1f7ba79 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -54,11 +54,11 @@ class TestSalesInvoice(unittest.TestCase): } # check if children are saved - self.assertEquals(len(si.doclist.get({"parentfield": "entries"})), + self.assertEquals(len(si.get("entries")), len(expected_values)-1) # check if item values are calculated - for d in si.doclist.get({"parentfield": "entries"}): + for d in si.get("entries"): for i, k in enumerate(expected_values["keys"]): self.assertEquals(d.fields.get(k), expected_values[d.item_code][i]) @@ -79,7 +79,7 @@ class TestSalesInvoice(unittest.TestCase): "_Test Account Discount - _TC": [-180.78, 1627.05] } - for d in si.doclist.get({"parentfield": "other_charges"}): + for d in si.get("other_charges"): for i, k in enumerate(expected_values["keys"]): self.assertEquals(d.fields.get(k), expected_values[d.account_head][i]) @@ -104,11 +104,11 @@ class TestSalesInvoice(unittest.TestCase): } # check if children are saved - self.assertEquals(len(si.doclist.get({"parentfield": "entries"})), + self.assertEquals(len(si.get("entries")), len(expected_values)-1) # check if item values are calculated - for d in si.doclist.get({"parentfield": "entries"}): + for d in si.get("entries"): for i, k in enumerate(expected_values["keys"]): self.assertEquals(d.fields.get(k), expected_values[d.item_code][i]) @@ -129,7 +129,7 @@ class TestSalesInvoice(unittest.TestCase): "_Test Account Discount - _TC": [-180.78, 1627.05] } - for d in si.doclist.get({"parentfield": "other_charges"}): + for d in si.get("other_charges"): for i, k in enumerate(expected_values["keys"]): self.assertEquals(d.fields.get(k), expected_values[d.account_head][i]) @@ -160,11 +160,11 @@ class TestSalesInvoice(unittest.TestCase): } # check if children are saved - self.assertEquals(len(si.doclist.get({"parentfield": "entries"})), + self.assertEquals(len(si.get("entries")), len(expected_values)-1) # check if item values are calculated - for d in si.doclist.get({"parentfield": "entries"}): + for d in si.get("entries"): for i, k in enumerate(expected_values["keys"]): self.assertEquals(d.fields.get(k), expected_values[d.item_code][i]) @@ -186,7 +186,7 @@ class TestSalesInvoice(unittest.TestCase): "_Test Account Service Tax - _TC": [-18.03, -16.88, 1500] } - for d in si.doclist.get({"parentfield": "other_charges"}): + for d in si.get("other_charges"): for i, k in enumerate(expected_values["keys"]): self.assertEquals(d.fields.get(k), expected_values[d.account_head][i]) @@ -245,7 +245,7 @@ class TestSalesInvoice(unittest.TestCase): def test_inclusive_rate_validations(self): si = frappe.bean(copy=test_records[2]) - for i, tax in enumerate(si.doclist.get({"parentfield": "other_charges"})): + for i, tax in enumerate(si.get("other_charges")): tax.idx = i+1 si.doclist[1].price_list_rate = 62.5 @@ -273,11 +273,11 @@ class TestSalesInvoice(unittest.TestCase): } # check if children are saved - self.assertEquals(len(si.doclist.get({"parentfield": "entries"})), + self.assertEquals(len(si.get("entries")), len(expected_values)-1) # check if item values are calculated - for d in si.doclist.get({"parentfield": "entries"}): + for d in si.get("entries"): for i, k in enumerate(expected_values["keys"]): self.assertEquals(d.fields.get(k), expected_values[d.item_code][i]) @@ -298,7 +298,7 @@ class TestSalesInvoice(unittest.TestCase): "_Test Account Discount - _TC": [-180.33, 1622.98] } - for d in si.doclist.get({"parentfield": "other_charges"}): + for d in si.get("other_charges"): for i, k in enumerate(expected_values["keys"]): self.assertEquals(d.fields.get(k), expected_values[d.account_head][i]) @@ -326,11 +326,11 @@ class TestSalesInvoice(unittest.TestCase): } # check if children are saved - self.assertEquals(len(si.doclist.get({"parentfield": "entries"})), + self.assertEquals(len(si.get("entries")), len(expected_values)-1) # check if item values are calculated - for d in si.doclist.get({"parentfield": "entries"}): + for d in si.get("entries"): for i, k in enumerate(expected_values["keys"]): self.assertEquals(d.fields.get(k), expected_values[d.item_code][i]) @@ -351,7 +351,7 @@ class TestSalesInvoice(unittest.TestCase): "_Test Account Discount - _TC": [-7245.01, 65205.16] } - for d in si.doclist.get({"parentfield": "other_charges"}): + for d in si.get("other_charges"): for i, k in enumerate(expected_values["keys"]): self.assertEquals(d.fields.get(k), expected_values[d.account_head][i]) diff --git a/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.py b/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.py index 26c87f1c04..683ca8a00a 100644 --- a/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.py +++ b/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class SalesInvoiceAdvance(Document): + pass \ No newline at end of file diff --git a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.py b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.py index 26c87f1c04..3fa0f2e0e5 100644 --- a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.py +++ b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class SalesInvoiceItem(Document): + pass \ No newline at end of file diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.py b/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.py index 26c87f1c04..8f621de86d 100644 --- a/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.py +++ b/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class SalesTaxesAndCharges(Document): + pass \ No newline at end of file diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.py b/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.py index 047bbd4f11..0546ce721b 100644 --- a/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.py +++ b/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.py @@ -6,7 +6,7 @@ import frappe from frappe.utils import cint from frappe.model.controller import DocListController -class DocType(DocListController): +class SalesTaxesAndChargesMaster(DocListController): def validate(self): if self.doc.is_default == 1: frappe.db.sql("""update `tabSales Taxes and Charges Master` set is_default = 0 diff --git a/erpnext/accounts/doctype/shipping_rule/shipping_rule.py b/erpnext/accounts/doctype/shipping_rule/shipping_rule.py index fe5d7f9010..e450e70a23 100644 --- a/erpnext/accounts/doctype/shipping_rule/shipping_rule.py +++ b/erpnext/accounts/doctype/shipping_rule/shipping_rule.py @@ -14,13 +14,11 @@ class OverlappingConditionError(frappe.ValidationError): pass class FromGreaterThanToError(frappe.ValidationError): pass class ManyBlankToValuesError(frappe.ValidationError): pass -class DocType(DocListController): - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +class ShippingRule(DocListController): def validate(self): self.validate_value("calculate_based_on", "in", ["Net Total", "Net Weight"]) - self.shipping_rule_conditions = self.doclist.get({"parentfield": "shipping_rule_conditions"}) + self.shipping_rule_conditions = self.get("shipping_rule_conditions") self.validate_from_to_values() self.sort_shipping_rule_conditions() self.validate_overlapping_shipping_rule_conditions() diff --git a/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.py b/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.py index 968a25b613..76d0a57b69 100644 --- a/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.py +++ b/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.py @@ -6,6 +6,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class ShippingRuleCondition(Document): + pass \ No newline at end of file diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index 1b00efce0a..3805ec3468 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -5,7 +5,6 @@ from __future__ import unicode_literals import frappe from frappe.utils import nowdate, cstr, flt, now, getdate, add_months -from frappe.model.doc import addchild from frappe import msgprint, throw, _ from frappe.utils import formatdate from erpnext.utilities import build_filter_conditions @@ -182,7 +181,7 @@ def update_against_doc(d, jv_obj): jvd = frappe.db.sql("""select cost_center, balance, against_account, is_advance from `tabJournal Voucher Detail` where name = %s""", d['voucher_detail_no']) # new entry with balance amount - ch = addchild(jv_obj.doc, 'entries', 'Journal Voucher Detail') + ch = jv_obj.append("entries") ch.account = d['account'] ch.cost_center = cstr(jvd[0][0]) ch.balance = cstr(jvd[0][1]) diff --git a/erpnext/buying/doctype/buying_settings/buying_settings.py b/erpnext/buying/doctype/buying_settings/buying_settings.py index 9776fda99c..1f63798ed9 100644 --- a/erpnext/buying/doctype/buying_settings/buying_settings.py +++ b/erpnext/buying/doctype/buying_settings/buying_settings.py @@ -6,9 +6,9 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +from frappe.model.document import Document + +class BuyingSettings(Document): def validate(self): for key in ["supplier_type", "supp_master_name", "maintain_same_rate", "buying_price_list"]: diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.py b/erpnext/buying/doctype/purchase_common/purchase_common.py index 3fefeba915..8ae364906c 100644 --- a/erpnext/buying/doctype/purchase_common/purchase_common.py +++ b/erpnext/buying/doctype/purchase_common/purchase_common.py @@ -11,10 +11,7 @@ from frappe import msgprint, _ from erpnext.stock.doctype.item.item import get_last_purchase_details from erpnext.controllers.buying_controller import BuyingController -class DocType(BuyingController): - def __init__(self, doc, doclist=None): - self.doc = doc - self.doclist = doclist +class PurchaseCommon(BuyingController): def update_last_purchase_rate(self, obj, is_submit): """updates last_purchase_rate in item table for each item""" diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index fca61e3632..587256ee89 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -11,10 +11,7 @@ from frappe import msgprint from erpnext.controllers.buying_controller import BuyingController -class DocType(BuyingController): - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist +class PurchaseOrder(BuyingController): self.tname = 'Purchase Order Item' self.fname = 'po_details' self.status_updater = [{ @@ -65,7 +62,7 @@ class DocType(BuyingController): }) def get_schedule_dates(self): - for d in getlist(self.doclist, 'po_details'): + for d in self.get('po_details'): if d.prevdoc_detail_docname and not d.schedule_date: d.schedule_date = frappe.db.get_value("Material Request Item", d.prevdoc_detail_docname, "schedule_date") @@ -76,7 +73,7 @@ class DocType(BuyingController): # Check for Stopped status def check_for_stopped_status(self, pc_obj): check_list =[] - for d in getlist(self.doclist, 'po_details'): + for d in self.get('po_details'): if d.fields.has_key('prevdoc_docname') and d.prevdoc_docname and d.prevdoc_docname not in check_list: check_list.append(d.prevdoc_docname) pc_obj.check_for_stopped_status( d.prevdoc_doctype, d.prevdoc_docname) @@ -85,7 +82,7 @@ class DocType(BuyingController): def update_bin(self, is_submit, is_stopped = 0): from erpnext.stock.utils import update_bin pc_obj = get_obj('Purchase Common') - for d in getlist(self.doclist, 'po_details'): + for d in self.get('po_details'): #1. Check if is_stock_item == 'Yes' if frappe.db.get_value("Item", d.item_code, "is_stock_item") == "Yes": # this happens when item is changed from non-stock to stock item diff --git a/erpnext/buying/doctype/purchase_order/test_purchase_order.py b/erpnext/buying/doctype/purchase_order/test_purchase_order.py index d58ce17bea..d0df0df068 100644 --- a/erpnext/buying/doctype/purchase_order/test_purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/test_purchase_order.py @@ -95,7 +95,7 @@ class TestPurchaseOrder(unittest.TestCase): def test_subcontracting(self): po = frappe.bean(copy=test_records[0]) po.insert() - self.assertEquals(len(po.doclist.get({"parentfield": "po_raw_material_details"})), 2) + self.assertEquals(len(po.get("po_raw_material_details")), 2) def test_warehouse_company_validation(self): from erpnext.stock.utils import InvalidWarehouseCompany diff --git a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.py b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.py index 26c87f1c04..8c7c0a8a47 100644 --- a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.py +++ b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class PurchaseOrderItem(Document): + pass \ No newline at end of file diff --git a/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.py b/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.py index 26c87f1c04..d1542fc7a6 100644 --- a/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.py +++ b/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class PurchaseOrderItemSupplied(Document): + pass \ No newline at end of file diff --git a/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.py b/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.py index 26c87f1c04..1270cf0e74 100644 --- a/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.py +++ b/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class PurchaseReceiptItemSupplied(Document): + pass \ No newline at end of file diff --git a/erpnext/buying/doctype/quality_inspection/quality_inspection.py b/erpnext/buying/doctype/quality_inspection/quality_inspection.py index 4222d68b49..4e289dcfcc 100644 --- a/erpnext/buying/doctype/quality_inspection/quality_inspection.py +++ b/erpnext/buying/doctype/quality_inspection/quality_inspection.py @@ -4,19 +4,17 @@ from __future__ import unicode_literals import frappe -from frappe.model.doc import addchild -class DocType: - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist +from frappe.model.document import Document + +class QualityInspection(Document): def get_item_specification_details(self): - self.doclist = self.doc.clear_table(self.doclist, 'qa_specification_details') + self.set('qa_specification_details', []) specification = frappe.db.sql("select specification, value from `tabItem Quality Inspection Parameter` \ where parent = '%s' order by idx" % (self.doc.item_code)) for d in specification: - child = addchild(self.doc, 'qa_specification_details', 'Quality Inspection Reading', self.doclist) + child = self.doc.append('qa_specification_details', {}) child.specification = d[0] child.value = d[1] child.status = 'Accepted' diff --git a/erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.py b/erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.py index 26c87f1c04..1e36103dd0 100644 --- a/erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.py +++ b/erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class QualityInspectionReading(Document): + pass \ No newline at end of file diff --git a/erpnext/buying/doctype/supplier/supplier.py b/erpnext/buying/doctype/supplier/supplier.py index f937958eda..44dcd5fd28 100644 --- a/erpnext/buying/doctype/supplier/supplier.py +++ b/erpnext/buying/doctype/supplier/supplier.py @@ -12,10 +12,7 @@ from erpnext.accounts.party import create_party_account from erpnext.utilities.transaction_base import TransactionBase -class DocType(TransactionBase): - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist +class Supplier(TransactionBase): def autoname(self): supp_master_name = frappe.defaults.get_global_default('supp_master_name') diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py index f6a3ffc516..edebfb3015 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py @@ -6,7 +6,7 @@ import frappe from frappe.model.code import get_obj from erpnext.controllers.buying_controller import BuyingController -class DocType(BuyingController): +class SupplierQuotation(BuyingController): def __init__(self, doc, doclist=None): self.doc, self.doclist = doc, doclist or [] self.tname, self.fname = "Supplier Quotation Item", "quotation_items" diff --git a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.py b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.py index 26c87f1c04..16e6e126eb 100644 --- a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.py +++ b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class SupplierQuotationItem(Document): + pass \ No newline at end of file diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 7ad5d86c62..35234ce568 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -87,7 +87,7 @@ class AccountsController(TransactionBase): def set_missing_item_details(self): """set missing item values""" from erpnext.stock.get_item_details import get_item_details - for item in self.doclist.get({"parentfield": self.fname}): + for item in self.get(self.fname): if item.fields.get("item_code"): args = item.fields.copy() args.update(self.doc.fields) @@ -103,7 +103,7 @@ class AccountsController(TransactionBase): tax_master_doctype = self.meta.get_field(tax_master_field).options - if not self.doclist.get({"parentfield": tax_parentfield}): + if not self.get(tax_parentfield): if not self.doc.fields.get(tax_master_field): # get the default tax master self.doc.fields[tax_master_field] = \ @@ -134,7 +134,7 @@ class AccountsController(TransactionBase): self.doclist.append(tax) def get_other_charges(self): - self.doclist = self.doc.clear_table(self.doclist, "other_charges") + self.set("other_charges", []) self.set_taxes("other_charges", "taxes_and_charges") def calculate_taxes_and_totals(self): @@ -156,8 +156,8 @@ class AccountsController(TransactionBase): self.meta.get_label("conversion_rate"), self.doc.company) self.doc.conversion_rate = flt(self.doc.conversion_rate) - self.item_doclist = self.doclist.get({"parentfield": self.fname}) - self.tax_doclist = self.doclist.get({"parentfield": self.other_fname}) + self.item_doclist = self.get(self.fname) + self.tax_doclist = self.get(self.other_fname) self.calculate_item_values() self.initialize_taxes() @@ -368,7 +368,7 @@ class AccountsController(TransactionBase): def calculate_total_advance(self, parenttype, advance_parentfield): if self.doc.doctype == parenttype and self.doc.docstatus < 2: sum_of_allocated_amount = sum([flt(adv.allocated_amount, self.precision("allocated_amount", adv)) - for adv in self.doclist.get({"parentfield": advance_parentfield})]) + for adv in self.get(advance_parentfield)]) self.doc.total_advance = flt(sum_of_allocated_amount, self.precision("total_advance")) @@ -408,7 +408,7 @@ class AccountsController(TransactionBase): and t1.docstatus = 1 order by t1.posting_date""" % (dr_or_cr, '%s'), account_head, as_dict=1) - self.doclist = self.doc.clear_table(self.doclist, parentfield) + self.set(parentfield, []) for d in res: self.doclist.append({ "doctype": child_doctype, @@ -425,7 +425,7 @@ class AccountsController(TransactionBase): item_tolerance = {} global_tolerance = None - for item in self.doclist.get({"parentfield": "entries"}): + for item in self.get("entries"): if item.fields.get(item_ref_dn): ref_amt = flt(frappe.db.get_value(ref_dt + " Item", item.fields[item_ref_dn], based_on), self.precision(based_on, item)) @@ -467,7 +467,7 @@ class AccountsController(TransactionBase): def get_stock_items(self): stock_items = [] item_codes = list(set(item.item_code for item in - self.doclist.get({"parentfield": self.fname}))) + self.get(self.fname))) if item_codes: stock_items = [r[0] for r in frappe.db.sql("""select name from `tabItem` where name in (%s) and is_stock_item='Yes'""" % \ diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index 4ca6c195b4..655b101a12 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -58,7 +58,7 @@ class BuyingController(StockController): def validate_stock_or_nonstock_items(self): if not self.get_stock_items(): tax_for_valuation = [d.account_head for d in - self.doclist.get({"parentfield": "other_charges"}) + self.get("other_charges") if d.category in ["Valuation", "Valuation and Total"]] if tax_for_valuation: frappe.msgprint(_("""Tax Category can not be 'Valuation' or 'Valuation and Total' as all items are non-stock items"""), raise_exception=1) @@ -171,19 +171,19 @@ class BuyingController(StockController): stock_items_qty, stock_items_amount = 0, 0 last_stock_item_idx = 1 - for d in self.doclist.get({"parentfield": parentfield}): + for d in self.get(parentfield): if d.item_code and d.item_code in stock_items: stock_items_qty += flt(d.qty) stock_items_amount += flt(d.base_amount) last_stock_item_idx = d.idx total_valuation_amount = sum([flt(d.tax_amount) for d in - self.doclist.get({"parentfield": "other_charges"}) + self.get("other_charges") if d.category in ["Valuation", "Valuation and Total"]]) valuation_amount_adjustment = total_valuation_amount - for i, item in enumerate(self.doclist.get({"parentfield": parentfield})): + for i, item in enumerate(self.get(parentfield)): if item.item_code and item.qty and item.item_code in stock_items: item_proportion = flt(item.base_amount) / stock_items_amount if stock_items_amount \ else flt(item.qty) / stock_items_qty @@ -218,9 +218,9 @@ class BuyingController(StockController): raise_exception=1) def update_raw_materials_supplied(self, raw_material_table): - self.doclist = self.doc.clear_table(self.doclist, raw_material_table) + self.set(raw_material_table, []) if self.doc.is_subcontracted=="Yes": - for item in self.doclist.get({"parentfield": self.fname}): + for item in self.get(self.fname): if item.item_code in self.sub_contracted_items: self.add_bom_items(item, raw_material_table) @@ -271,7 +271,7 @@ class BuyingController(StockController): if not hasattr(self, "_sub_contracted_items"): self._sub_contracted_items = [] item_codes = list(set(item.item_code for item in - self.doclist.get({"parentfield": self.fname}))) + self.get(self.fname))) if item_codes: self._sub_contracted_items = [r[0] for r in frappe.db.sql("""select name from `tabItem` where name in (%s) and is_sub_contracted_item='Yes'""" % \ @@ -284,7 +284,7 @@ class BuyingController(StockController): if not hasattr(self, "_purchase_items"): self._purchase_items = [] item_codes = list(set(item.item_code for item in - self.doclist.get({"parentfield": self.fname}))) + self.get(self.fname))) if item_codes: self._purchase_items = [r[0] for r in frappe.db.sql("""select name from `tabItem` where name in (%s) and is_purchase_item='Yes'""" % \ @@ -294,5 +294,5 @@ class BuyingController(StockController): def is_item_table_empty(self): - if not len(self.doclist.get({"parentfield": self.fname})): + if not len(self.get(self.fname)): frappe.throw(_("Item table can not be blank")) \ No newline at end of file diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index f58366830c..5e0ea659f5 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -54,7 +54,7 @@ class SellingController(StockController): # shipping rule calculation based on item's net weight shipping_amount = 0.0 - for condition in shipping_rule.doclist.get({"parentfield": "shipping_rule_conditions"}): + for condition in shipping_rule.get("shipping_rule_conditions"): if not condition.to_value or (flt(condition.from_value) <= value <= flt(condition.to_value)): shipping_amount = condition.shipping_amount break @@ -242,7 +242,7 @@ class SellingController(StockController): def calculate_contribution(self): total = 0.0 - sales_team = self.doclist.get({"parentfield": "sales_team"}) + sales_team = self.get("sales_team") for sales_person in sales_team: self.round_floats_in(sales_person) @@ -279,7 +279,7 @@ class SellingController(StockController): outstanding_including_current) def validate_max_discount(self): - for d in self.doclist.get({"parentfield": self.fname}): + for d in self.get(self.fname): discount = flt(frappe.db.get_value("Item", d.item_code, "max_discount")) if discount and flt(d.discount_percentage) > discount: @@ -288,7 +288,7 @@ class SellingController(StockController): def get_item_list(self): il = [] - for d in self.doclist.get({"parentfield": self.fname}): + for d in self.get(self.fname): reserved_warehouse = "" reserved_qty_for_main_item = 0 @@ -315,7 +315,7 @@ class SellingController(StockController): reserved_qty_for_main_item = -flt(d.qty) if self.has_sales_bom(d.item_code): - for p in self.doclist.get({"parentfield": "packing_details"}): + for p in self.get("packing_details"): if p.parent_detail_docname == d.name and p.parent_item == d.item_code: # the packing details table's qty is already multiplied with parent's qty il.append(frappe._dict({ @@ -362,7 +362,7 @@ class SellingController(StockController): return so_qty, so_warehouse def check_stop_sales_order(self, ref_fieldname): - for d in self.doclist.get({"parentfield": self.fname}): + for d in self.get(self.fname): if d.fields.get(ref_fieldname): status = frappe.db.get_value("Sales Order", d.fields[ref_fieldname], "status") if status == "Stopped": diff --git a/erpnext/controllers/status_updater.py b/erpnext/controllers/status_updater.py index 7411d092e2..30bc02ec23 100644 --- a/erpnext/controllers/status_updater.py +++ b/erpnext/controllers/status_updater.py @@ -240,7 +240,7 @@ class StatusUpdater(DocListController): all_zero_amount_refdoc = frappe.db.sql_list("""select name from `tab%s` where docstatus=1 and net_total = 0""" % ref_dt) - for item in self.doclist.get({"parentfield": "entries"}): + for item in self.get("entries"): if item.fields.get(ref_fieldname) \ and item.fields.get(ref_fieldname) in all_zero_amount_refdoc \ and item.fields.get(ref_fieldname) not in zero_amount_refdoc: diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py index 2481868abf..d87a88c331 100644 --- a/erpnext/controllers/stock_controller.py +++ b/erpnext/controllers/stock_controller.py @@ -70,7 +70,7 @@ class StockController(AccountsController): def get_voucher_details(self, stock_ledger, default_expense_account, default_cost_center): if not default_expense_account: - details = self.doclist.get({"parentfield": self.fname}) + details = self.get(self.fname) for d in details: self.check_expense_account(d) else: @@ -129,7 +129,7 @@ class StockController(AccountsController): future_stock_vouchers = [] if hasattr(self, "fname"): - item_list = [d.item_code for d in self.doclist.get({"parentfield": self.fname})] + item_list = [d.item_code for d in self.get(self.fname)] condition = ''.join(['and item_code in (\'', '\', \''.join(item_list) ,'\')']) else: condition = "" @@ -256,8 +256,8 @@ class StockController(AccountsController): def get_distinct_item_warehouse(self): item_list = [] warehouse_list = [] - for item in self.doclist.get({"parentfield": self.fname}) \ - + self.doclist.get({"parentfield": "packing_details"}): + for item in self.get(self.fname) \ + + self.get("packing_details"): item_list.append(item.item_code) warehouse_list.append(item.warehouse) diff --git a/erpnext/home/doctype/feed/feed.py b/erpnext/home/doctype/feed/feed.py index 0a12d26f8a..45d8ea1ac4 100644 --- a/erpnext/home/doctype/feed/feed.py +++ b/erpnext/home/doctype/feed/feed.py @@ -4,15 +4,10 @@ from __future__ import unicode_literals import frappe -from frappe.model import db_exists -from frappe.model.bean import copy_doclist +from frappe.model.document import Document - - - -class DocType: - def __init__(self,d,dl): - self.doc, self.doclist = d, dl +class Feed(Document): + pass def on_doctype_update(): if not frappe.db.sql("""show index from `tabFeed` diff --git a/erpnext/hr/doctype/appraisal/appraisal.py b/erpnext/hr/doctype/appraisal/appraisal.py index 8abeab8dc6..761e38595c 100644 --- a/erpnext/hr/doctype/appraisal/appraisal.py +++ b/erpnext/hr/doctype/appraisal/appraisal.py @@ -8,10 +8,9 @@ from frappe.utils import cstr, flt, getdate from frappe.model.bean import getlist from frappe import msgprint -class DocType: - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist +from frappe.model.document import Document + +class Appraisal(Document): def validate(self): if not self.doc.status: @@ -45,7 +44,7 @@ class DocType: def calculate_total(self): total, total_w = 0, 0 - for d in getlist(self.doclist, 'appraisal_details'): + for d in self.get('appraisal_details'): if d.score: d.score_earned = flt(d.score) * flt(d.per_weightage) / 100 total = total + d.score_earned diff --git a/erpnext/hr/doctype/appraisal_goal/appraisal_goal.py b/erpnext/hr/doctype/appraisal_goal/appraisal_goal.py index 26c87f1c04..c13c42bd03 100644 --- a/erpnext/hr/doctype/appraisal_goal/appraisal_goal.py +++ b/erpnext/hr/doctype/appraisal_goal/appraisal_goal.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class AppraisalGoal(Document): + pass \ No newline at end of file diff --git a/erpnext/hr/doctype/appraisal_template/appraisal_template.py b/erpnext/hr/doctype/appraisal_template/appraisal_template.py index 0f78a4a76a..e4fba2cd47 100644 --- a/erpnext/hr/doctype/appraisal_template/appraisal_template.py +++ b/erpnext/hr/doctype/appraisal_template/appraisal_template.py @@ -5,9 +5,9 @@ from __future__ import unicode_literals import frappe from frappe import _ -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +from frappe.model.document import Document + +class AppraisalTemplate(Document): def validate(self): self.doc.total_points = 0 diff --git a/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.py b/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.py index 26c87f1c04..0cdd921e05 100644 --- a/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.py +++ b/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class AppraisalTemplateGoal(Document): + pass \ No newline at end of file diff --git a/erpnext/hr/doctype/attendance/attendance.py b/erpnext/hr/doctype/attendance/attendance.py index 9abef7677e..42cb7b0379 100644 --- a/erpnext/hr/doctype/attendance/attendance.py +++ b/erpnext/hr/doctype/attendance/attendance.py @@ -8,10 +8,9 @@ from frappe.utils import getdate, nowdate from frappe import msgprint, _ -class DocType: - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist +from frappe.model.document import Document + +class Attendance(Document): def validate_duplicate_record(self): res = frappe.db.sql("""select name from `tabAttendance` where employee = %s and att_date = %s diff --git a/erpnext/hr/doctype/branch/branch.py b/erpnext/hr/doctype/branch/branch.py index 58ecbe8902..f5dbe18e47 100644 --- a/erpnext/hr/doctype/branch/branch.py +++ b/erpnext/hr/doctype/branch/branch.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl - +from frappe.model.document import Document + +class Branch(Document): + pass \ No newline at end of file diff --git a/erpnext/hr/doctype/deduction_type/deduction_type.py b/erpnext/hr/doctype/deduction_type/deduction_type.py index 26c87f1c04..c18f5692bb 100644 --- a/erpnext/hr/doctype/deduction_type/deduction_type.py +++ b/erpnext/hr/doctype/deduction_type/deduction_type.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class DeductionType(Document): + pass \ No newline at end of file diff --git a/erpnext/hr/doctype/department/department.py b/erpnext/hr/doctype/department/department.py index 5015bed79c..bf154914d7 100644 --- a/erpnext/hr/doctype/department/department.py +++ b/erpnext/hr/doctype/department/department.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl - \ No newline at end of file +from frappe.model.document import Document + +class Department(Document): + pass \ No newline at end of file diff --git a/erpnext/hr/doctype/designation/designation.py b/erpnext/hr/doctype/designation/designation.py index 58ecbe8902..fb530478c3 100644 --- a/erpnext/hr/doctype/designation/designation.py +++ b/erpnext/hr/doctype/designation/designation.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl - +from frappe.model.document import Document + +class Designation(Document): + pass \ No newline at end of file diff --git a/erpnext/hr/doctype/earning_type/earning_type.py b/erpnext/hr/doctype/earning_type/earning_type.py index 26c87f1c04..8f7450ef33 100644 --- a/erpnext/hr/doctype/earning_type/earning_type.py +++ b/erpnext/hr/doctype/earning_type/earning_type.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class EarningType(Document): + pass \ No newline at end of file diff --git a/erpnext/hr/doctype/employee/employee.py b/erpnext/hr/doctype/employee/employee.py index 3ec44e66d2..aacb2aa44b 100644 --- a/erpnext/hr/doctype/employee/employee.py +++ b/erpnext/hr/doctype/employee/employee.py @@ -11,7 +11,7 @@ import frappe.permissions from frappe.defaults import get_restrictions from frappe.model.controller import DocListController -class DocType(DocListController): +class Employee(DocListController): def autoname(self): naming_method = frappe.db.get_value("HR Settings", None, "emp_created_by") if not naming_method: @@ -57,7 +57,7 @@ class DocType(DocListController): def restrict_leave_approver(self): """restrict to this employee for leave approver""" - employee_leave_approvers = [d.leave_approver for d in self.doclist.get({"parentfield": "employee_leave_approvers"})] + employee_leave_approvers = [d.leave_approver for d in self.get("employee_leave_approvers")] if self.doc.reports_to and self.doc.reports_to not in employee_leave_approvers: employee_leave_approvers.append(frappe.db.get_value("Employee", self.doc.reports_to, "user_id")) @@ -167,7 +167,7 @@ class DocType(DocListController): 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"}): + for l in self.get("employee_leave_approvers"): if "Leave Approver" not in User(l.leave_approver).get_roles(): throw(_("Invalid Leave Approver") + ": \"" + l.leave_approver + "\"", exc=InvalidLeaveApproverError) diff --git a/erpnext/hr/doctype/employee_education/employee_education.py b/erpnext/hr/doctype/employee_education/employee_education.py index 26c87f1c04..2cc0f26037 100644 --- a/erpnext/hr/doctype/employee_education/employee_education.py +++ b/erpnext/hr/doctype/employee_education/employee_education.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class EmployeeEducation(Document): + pass \ No newline at end of file diff --git a/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.py b/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.py index 26c87f1c04..a99e4de8c2 100644 --- a/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.py +++ b/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class EmployeeExternalWorkHistory(Document): + pass \ No newline at end of file diff --git a/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.py b/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.py index 26c87f1c04..65dfa44a6a 100644 --- a/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.py +++ b/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class EmployeeInternalWorkHistory(Document): + pass \ No newline at end of file diff --git a/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.py b/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.py index 968a25b613..8736c4fe77 100644 --- a/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.py +++ b/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.py @@ -6,6 +6,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class EmployeeLeaveApprover(Document): + pass \ No newline at end of file diff --git a/erpnext/hr/doctype/employment_type/employment_type.py b/erpnext/hr/doctype/employment_type/employment_type.py index 5015bed79c..87a8634d66 100644 --- a/erpnext/hr/doctype/employment_type/employment_type.py +++ b/erpnext/hr/doctype/employment_type/employment_type.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl - \ No newline at end of file +from frappe.model.document import Document + +class EmploymentType(Document): + pass \ No newline at end of file diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.py b/erpnext/hr/doctype/expense_claim/expense_claim.py index 0fbfde5c3a..1d02e87b3a 100644 --- a/erpnext/hr/doctype/expense_claim/expense_claim.py +++ b/erpnext/hr/doctype/expense_claim/expense_claim.py @@ -7,10 +7,9 @@ import frappe from frappe.model.bean import getlist from frappe import msgprint -class DocType: - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist +from frappe.model.document import Document + +class ExpenseClaim(Document): def validate(self): self.validate_fiscal_year() @@ -26,6 +25,6 @@ class DocType: validate_fiscal_year(self.doc.posting_date, self.doc.fiscal_year, "Posting Date") def validate_exp_details(self): - if not getlist(self.doclist, 'expense_voucher_details'): + if not self.get('expense_voucher_details'): msgprint("Please add expense voucher details") raise Exception diff --git a/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.py b/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.py index 26c87f1c04..fe6cb1ef22 100644 --- a/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.py +++ b/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class ExpenseClaimDetail(Document): + pass \ No newline at end of file diff --git a/erpnext/hr/doctype/expense_claim_type/expense_claim_type.py b/erpnext/hr/doctype/expense_claim_type/expense_claim_type.py index 26c87f1c04..bc0db7fc51 100644 --- a/erpnext/hr/doctype/expense_claim_type/expense_claim_type.py +++ b/erpnext/hr/doctype/expense_claim_type/expense_claim_type.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class ExpenseClaimType(Document): + pass \ No newline at end of file diff --git a/erpnext/hr/doctype/grade/grade.py b/erpnext/hr/doctype/grade/grade.py index 58ecbe8902..04e3e97ed7 100644 --- a/erpnext/hr/doctype/grade/grade.py +++ b/erpnext/hr/doctype/grade/grade.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl - +from frappe.model.document import Document + +class Grade(Document): + pass \ No newline at end of file diff --git a/erpnext/hr/doctype/holiday/holiday.py b/erpnext/hr/doctype/holiday/holiday.py index 26c87f1c04..2e64a10557 100644 --- a/erpnext/hr/doctype/holiday/holiday.py +++ b/erpnext/hr/doctype/holiday/holiday.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class Holiday(Document): + pass \ No newline at end of file diff --git a/erpnext/hr/doctype/holiday_list/holiday_list.py b/erpnext/hr/doctype/holiday_list/holiday_list.py index 8fdfccc3ed..c0f1b1b83e 100644 --- a/erpnext/hr/doctype/holiday_list/holiday_list.py +++ b/erpnext/hr/doctype/holiday_list/holiday_list.py @@ -5,17 +5,13 @@ from __future__ import unicode_literals import frappe from frappe.utils import add_days, add_years, cint, getdate -from frappe.model import db_exists -from frappe.model.doc import addchild, make_autoname -from frappe.model.bean import copy_doclist +from frappe.model.doc import make_autoname from frappe import msgprint, throw, _ import datetime -class DocType: - def __init__(self,doc,doclist=[]): - self.doc = doc - self.doclist = doclist +from frappe.model.document import Document +class HolidayList(Document): def autoname(self): self.doc.name = make_autoname(self.doc.fiscal_year + "/" + self.doc.holiday_list_name + "/.###") @@ -29,7 +25,7 @@ class DocType: last_idx = max([cint(d.idx) for d in self.doclist.get( {"parentfield": "holiday_list_details"})] or [0,]) for i, d in enumerate(date_list): - ch = addchild(self.doc, 'holiday_list_details', 'Holiday', self.doclist) + ch = self.doc.append('holiday_list_details', {}) ch.description = self.doc.weekly_off ch.holiday_date = d ch.idx = last_idx + i + 1 @@ -63,7 +59,7 @@ class DocType: return date_list def clear_table(self): - self.doclist = self.doc.clear_table(self.doclist, 'holiday_list_details') + self.set('holiday_list_details', []) def update_default_holiday_list(self): frappe.db.sql("""update `tabHoliday List` set is_default = 0 diff --git a/erpnext/hr/doctype/hr_settings/hr_settings.py b/erpnext/hr/doctype/hr_settings/hr_settings.py index e9e44d4fea..6d5f8e07f3 100644 --- a/erpnext/hr/doctype/hr_settings/hr_settings.py +++ b/erpnext/hr/doctype/hr_settings/hr_settings.py @@ -8,9 +8,9 @@ import frappe from frappe.utils import cint -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +from frappe.model.document import Document + +class HrSettings(Document): def validate(self): self.update_birthday_reminders() diff --git a/erpnext/hr/doctype/job_applicant/job_applicant.py b/erpnext/hr/doctype/job_applicant/job_applicant.py index 41fc5f3b45..364030498a 100644 --- a/erpnext/hr/doctype/job_applicant/job_applicant.py +++ b/erpnext/hr/doctype/job_applicant/job_applicant.py @@ -8,9 +8,7 @@ import frappe from erpnext.utilities.transaction_base import TransactionBase from frappe.utils import extract_email_id -class DocType(TransactionBase): - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +class JobApplicant(TransactionBase): def get_sender(self, comm): return frappe.db.get_value('Jobs Email Settings',None,'email_id') diff --git a/erpnext/hr/doctype/job_opening/job_opening.py b/erpnext/hr/doctype/job_opening/job_opening.py index 968a25b613..4224207027 100644 --- a/erpnext/hr/doctype/job_opening/job_opening.py +++ b/erpnext/hr/doctype/job_opening/job_opening.py @@ -6,6 +6,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class JobOpening(Document): + pass \ No newline at end of file diff --git a/erpnext/hr/doctype/leave_allocation/leave_allocation.py b/erpnext/hr/doctype/leave_allocation/leave_allocation.py index 7648ba5b6b..a78dc1a530 100755 --- a/erpnext/hr/doctype/leave_allocation/leave_allocation.py +++ b/erpnext/hr/doctype/leave_allocation/leave_allocation.py @@ -6,7 +6,9 @@ import frappe from frappe.utils import cint, flt from frappe import msgprint -class DocType: +from frappe.model.document import Document + +class LeaveAllocation(Document): def __init__(self, doc, doclist): self.doc, self.doclist = doc, doclist diff --git a/erpnext/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py index 1630e1485e..03045a4c31 100755 --- a/erpnext/hr/doctype/leave_application/leave_application.py +++ b/erpnext/hr/doctype/leave_application/leave_application.py @@ -15,7 +15,7 @@ class InvalidLeaveApproverError(frappe.ValidationError): pass class LeaveApproverIdentityError(frappe.ValidationError): pass from frappe.model.controller import DocListController -class DocType(DocListController): +class LeaveApplication(DocListController): def setup(self): if frappe.db.exists(self.doc.doctype, self.doc.name): self.previous_doc = frappe.doc(self.doc.doctype, self.doc.name) @@ -149,7 +149,7 @@ class DocType(DocListController): def validate_leave_approver(self): employee = frappe.bean("Employee", self.doc.employee) leave_approvers = [l.leave_approver for l in - employee.doclist.get({"parentfield": "employee_leave_approvers"})] + employee.get("employee_leave_approvers")] if len(leave_approvers) and self.doc.leave_approver not in leave_approvers: msgprint(("[" + _("For Employee") + ' "' + self.doc.employee + '"] ' diff --git a/erpnext/hr/doctype/leave_block_list/leave_block_list.py b/erpnext/hr/doctype/leave_block_list/leave_block_list.py index cdbb2d0375..e1cbf1bfaf 100644 --- a/erpnext/hr/doctype/leave_block_list/leave_block_list.py +++ b/erpnext/hr/doctype/leave_block_list/leave_block_list.py @@ -8,9 +8,9 @@ import frappe from erpnext.accounts.utils import validate_fiscal_year from frappe import _ -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +from frappe.model.document import Document + +class LeaveBlockList(Document): def validate(self): dates = [] diff --git a/erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.py b/erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.py index 968a25b613..684e178d5b 100644 --- a/erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.py +++ b/erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.py @@ -6,6 +6,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class LeaveBlockListAllow(Document): + pass \ No newline at end of file diff --git a/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.py b/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.py index 968a25b613..3db479841e 100644 --- a/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.py +++ b/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.py @@ -6,6 +6,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class LeaveBlockListDate(Document): + pass \ No newline at end of file diff --git a/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py index 001d0d5848..f3aace2e5c 100644 --- a/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py +++ b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py @@ -12,7 +12,9 @@ from frappe import msgprint, _ -class DocType: +from frappe.model.document import Document + +class LeaveControlPanel(Document): def __init__(self, doc, doclist): self.doc = doc self.doclist = doclist diff --git a/erpnext/hr/doctype/leave_type/leave_type.py b/erpnext/hr/doctype/leave_type/leave_type.py index 5015bed79c..426bc73ca5 100644 --- a/erpnext/hr/doctype/leave_type/leave_type.py +++ b/erpnext/hr/doctype/leave_type/leave_type.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl - \ No newline at end of file +from frappe.model.document import Document + +class LeaveType(Document): + pass \ No newline at end of file diff --git a/erpnext/hr/doctype/salary_manager/salary_manager.py b/erpnext/hr/doctype/salary_manager/salary_manager.py index 0420f77409..d0af7beaed 100644 --- a/erpnext/hr/doctype/salary_manager/salary_manager.py +++ b/erpnext/hr/doctype/salary_manager/salary_manager.py @@ -7,10 +7,9 @@ from frappe.utils import cint, flt from frappe.model.code import get_obj from frappe import msgprint -class DocType: - def __init__(self, doc, doclist): - self.doc = doc - self.doclist = doclist +from frappe.model.document import Document + +class SalaryManager(Document): def get_emp_list(self): """ diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py index a264c1c2d5..a7c4f8df16 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.py +++ b/erpnext/hr/doctype/salary_slip/salary_slip.py @@ -14,11 +14,7 @@ from erpnext.setup.utils import get_company_currency from erpnext.utilities.transaction_base import TransactionBase -class DocType(TransactionBase): - def __init__(self,doc,doclist=[]): - self.doc = doc - self.doclist = doclist - +class SalarySlip(TransactionBase): def autoname(self): self.doc.name = make_autoname('Sal Slip/' +self.doc.employee + '/.#####') @@ -146,8 +142,8 @@ class DocType(TransactionBase): from frappe.utils import money_in_words self.check_existing() - if not (len(self.doclist.get({"parentfield": "earning_details"})) or - len(self.doclist.get({"parentfield": "deduction_details"}))): + if not (len(self.get("earning_details")) or + len(self.get("deduction_details"))): self.get_emp_and_leave_details() else: self.get_leave_details(self.doc.leave_without_pay) @@ -160,7 +156,7 @@ class DocType(TransactionBase): def calculate_earning_total(self): self.doc.gross_pay = flt(self.doc.arrear_amount) + flt(self.doc.leave_encashment_amount) - for d in self.doclist.get({"parentfield": "earning_details"}): + for d in self.get("earning_details"): if cint(d.e_depends_on_lwp) == 1: d.e_modified_amount = _round(flt(d.e_amount) * flt(self.doc.payment_days) / cint(self.doc.total_days_in_month), 2) @@ -172,7 +168,7 @@ class DocType(TransactionBase): def calculate_ded_total(self): self.doc.total_deduction = 0 - for d in getlist(self.doclist, 'deduction_details'): + for d in self.get('deduction_details'): if cint(d.d_depends_on_lwp) == 1: d.d_modified_amount = _round(flt(d.d_amount) * flt(self.doc.payment_days) / cint(self.doc.total_days_in_month), 2) diff --git a/erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.py b/erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.py index 26c87f1c04..422ee28338 100644 --- a/erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.py +++ b/erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class SalarySlipDeduction(Document): + pass \ No newline at end of file diff --git a/erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.py b/erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.py index 26c87f1c04..c4a7b4e2e2 100644 --- a/erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.py +++ b/erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class SalarySlipEarning(Document): + pass \ No newline at end of file diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.py b/erpnext/hr/doctype/salary_structure/salary_structure.py index 8d59f2b926..ae103945fc 100644 --- a/erpnext/hr/doctype/salary_structure/salary_structure.py +++ b/erpnext/hr/doctype/salary_structure/salary_structure.py @@ -5,15 +5,13 @@ from __future__ import unicode_literals import frappe from frappe.utils import cstr, flt -from frappe.model.doc import addchild, make_autoname +from frappe.model.doc import make_autoname from frappe import msgprint, _ -class DocType: - def __init__(self,doc,doclist=[]): - self.doc = doc - self.doclist = doclist +from frappe.model.document import Document +class SalaryStructure(Document): def autoname(self): self.doc.name = make_autoname(self.doc.employee + '/.SST' + '/.#####') @@ -44,7 +42,7 @@ class DocType: def make_table(self, doct_name, tab_fname, tab_name): list1 = frappe.db.sql("select name from `tab%s` where docstatus != 2" % doct_name) for li in list1: - child = addchild(self.doc, tab_fname, tab_name, self.doclist) + child = self.doc.append(tab_fname, {}) if(tab_fname == 'earning_details'): child.e_type = cstr(li[0]) child.modified_value = 0 diff --git a/erpnext/hr/doctype/salary_structure_deduction/salary_structure_deduction.py b/erpnext/hr/doctype/salary_structure_deduction/salary_structure_deduction.py index 26c87f1c04..95300e15e1 100644 --- a/erpnext/hr/doctype/salary_structure_deduction/salary_structure_deduction.py +++ b/erpnext/hr/doctype/salary_structure_deduction/salary_structure_deduction.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class SalaryStructureDeduction(Document): + pass \ No newline at end of file diff --git a/erpnext/hr/doctype/salary_structure_earning/salary_structure_earning.py b/erpnext/hr/doctype/salary_structure_earning/salary_structure_earning.py index 26c87f1c04..79f7972f81 100644 --- a/erpnext/hr/doctype/salary_structure_earning/salary_structure_earning.py +++ b/erpnext/hr/doctype/salary_structure_earning/salary_structure_earning.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class SalaryStructureEarning(Document): + pass \ No newline at end of file diff --git a/erpnext/hr/doctype/upload_attendance/upload_attendance.py b/erpnext/hr/doctype/upload_attendance/upload_attendance.py index 3da10786fe..844806ecb7 100644 --- a/erpnext/hr/doctype/upload_attendance/upload_attendance.py +++ b/erpnext/hr/doctype/upload_attendance/upload_attendance.py @@ -8,14 +8,13 @@ import frappe from frappe.utils import cstr, add_days, date_diff from frappe import msgprint, _ from frappe.utils.datautils import UnicodeWriter +from frappe.model.document import Document # doclist = None doclist = frappe.local('uploadattendance_doclist') -class DocType(): - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist +class UploadAttendance(Document): + pass @frappe.whitelist() def get_template(): diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index 2c6d642bdf..bd5642ee6b 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -4,17 +4,15 @@ from __future__ import unicode_literals import frappe from frappe.utils import cint, cstr, flt, now, nowdate -from frappe.model.doc import addchild from frappe.model.bean import getlist from frappe.model.code import get_obj from frappe import msgprint, _ -class DocType: - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist +from frappe.model.document import Document + +class Bom(Document): def autoname(self): last_name = frappe.db.sql("""select max(name) from `tabBOM` @@ -75,7 +73,7 @@ class DocType: msgprint("Item %s does not exist in system" % item[0]['item_code'], raise_exception = 1) def set_bom_material_details(self): - for item in self.doclist.get({"parentfield": "bom_materials"}): + for item in self.get("bom_materials"): ret = self.get_bom_material_detail({"item_code": item.item_code, "bom_no": item.bom_no, "qty": item.qty}) @@ -128,7 +126,7 @@ class DocType: return rate def update_cost(self): - for d in self.doclist.get({"parentfield": "bom_materials"}): + for d in self.get("bom_materials"): d.rate = self.get_bom_material_detail({ 'item_code': d.item_code, 'bom_no': d.bom_no, @@ -188,8 +186,8 @@ class DocType: def clear_operations(self): if not self.doc.with_operations: - self.doclist = self.doc.clear_table(self.doclist, 'bom_operations') - for d in self.doclist.get({"parentfield": "bom_materials"}): + self.set('bom_operations', []) + for d in self.get("bom_materials"): d.operation_no = None def validate_main_item(self): @@ -210,7 +208,7 @@ class DocType: def validate_operations(self): """ Check duplicate operation no""" self.op = [] - for d in getlist(self.doclist, 'bom_operations'): + for d in self.get('bom_operations'): if cstr(d.operation_no) in self.op: msgprint("Operation no: %s is repeated in Operations Table" % d.operation_no, raise_exception=1) @@ -221,7 +219,7 @@ class DocType: def validate_materials(self): """ Validate raw material entries """ check_list = [] - for m in getlist(self.doclist, 'bom_materials'): + for m in self.get('bom_materials'): # check if operation no not in op table if self.doc.with_operations and cstr(m.operation_no) not in self.op: msgprint("""Operation no: %s against item: %s at row no: %s \ @@ -315,7 +313,7 @@ class DocType: def calculate_op_cost(self): """Update workstation rate and calculates totals""" total_op_cost = 0 - for d in getlist(self.doclist, 'bom_operations'): + for d in self.get('bom_operations'): if d.workstation and not d.hour_rate: d.hour_rate = frappe.db.get_value("Workstation", d.workstation, "hour_rate") if d.hour_rate and d.time_in_mins: @@ -326,7 +324,7 @@ class DocType: def calculate_rm_cost(self): """Fetch RM rate as per today's valuation rate and calculate totals""" total_rm_cost = 0 - for d in getlist(self.doclist, 'bom_materials'): + for d in self.get('bom_materials'): if d.bom_no: d.rate = self.get_bom_unitcost(d.bom_no) d.amount = flt(d.rate) * flt(d.qty) @@ -343,7 +341,7 @@ class DocType: def get_exploded_items(self): """ Get all raw materials including items from child bom""" self.cur_exploded_items = {} - for d in getlist(self.doclist, 'bom_materials'): + for d in self.get('bom_materials'): if d.bom_no: self.get_child_exploded_items(d.bom_no, d.qty) else: @@ -379,9 +377,9 @@ class DocType: def add_exploded_items(self): "Add items to Flat BOM table" - self.doclist = self.doc.clear_table(self.doclist, 'flat_bom_details', 1) + self.set('flat_bom_details', []) for d in self.cur_exploded_items: - ch = addchild(self.doc, 'flat_bom_details', 'BOM Explosion Item', self.doclist) + ch = self.doc.append('flat_bom_details', {}) for i in self.cur_exploded_items[d].keys(): ch.fields[i] = self.cur_exploded_items[d][i] ch.amount = flt(ch.qty) * flt(ch.rate) diff --git a/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.py b/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.py index 26c87f1c04..bd1b1af43f 100644 --- a/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.py +++ b/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class BomExplosionItem(Document): + pass \ No newline at end of file diff --git a/erpnext/manufacturing/doctype/bom_item/bom_item.py b/erpnext/manufacturing/doctype/bom_item/bom_item.py index 26c87f1c04..f2bef2c7c4 100644 --- a/erpnext/manufacturing/doctype/bom_item/bom_item.py +++ b/erpnext/manufacturing/doctype/bom_item/bom_item.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class BomItem(Document): + pass \ No newline at end of file diff --git a/erpnext/manufacturing/doctype/bom_operation/bom_operation.py b/erpnext/manufacturing/doctype/bom_operation/bom_operation.py index 26c87f1c04..df55159e1c 100644 --- a/erpnext/manufacturing/doctype/bom_operation/bom_operation.py +++ b/erpnext/manufacturing/doctype/bom_operation/bom_operation.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class BomOperation(Document): + pass \ No newline at end of file diff --git a/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.py b/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.py index 598d822cd5..c406777a84 100644 --- a/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.py +++ b/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.py @@ -7,7 +7,9 @@ from frappe.utils import cstr, flt from frappe.model.code import get_obj from frappe import msgprint, _ -class DocType: +from frappe.model.document import Document + +class BomReplaceTool(Document): def __init__( self, doc, doclist=[]): self.doc = doc self.doclist = doclist diff --git a/erpnext/manufacturing/doctype/production_order/production_order.py b/erpnext/manufacturing/doctype/production_order/production_order.py index abc6cfd466..aeea1c0762 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.py +++ b/erpnext/manufacturing/doctype/production_order/production_order.py @@ -10,10 +10,9 @@ from frappe import msgprint, _ class OverProductionError(frappe.ValidationError): pass -class DocType: - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist +from frappe.model.document import Document + +class ProductionOrder(Document): def validate(self): if self.doc.docstatus == 0: diff --git a/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.py b/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.py index 26c87f1c04..a9a9c61f0d 100644 --- a/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.py +++ b/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class ProductionPlanItem(Document): + pass \ No newline at end of file diff --git a/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.py b/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.py index 26c87f1c04..c0be09e9c5 100644 --- a/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.py +++ b/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class ProductionPlanSalesOrder(Document): + pass \ No newline at end of file diff --git a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py index 60007cd839..89fafbcab7 100644 --- a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py +++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py @@ -4,15 +4,13 @@ from __future__ import unicode_literals import frappe from frappe.utils import cstr, flt, cint, nowdate, add_days -from frappe.model.doc import addchild, Document from frappe.model.bean import getlist from frappe.model.code import get_obj from frappe import msgprint, _ -class DocType: - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist +from frappe.model.document import Document + +class ProductionPlanningTool(Document): self.item_dict = {} def get_so_details(self, so): @@ -39,10 +37,10 @@ class DocType: return ret def clear_so_table(self): - self.doclist = self.doc.clear_table(self.doclist, 'pp_so_details') + self.set('pp_so_details', []) def clear_item_table(self): - self.doclist = self.doc.clear_table(self.doclist, 'pp_details') + self.set('pp_details', []) def validate_company(self): if not self.doc.company: @@ -84,11 +82,10 @@ class DocType: """ Add sales orders in the table""" self.clear_so_table() - so_list = [d.sales_order for d in getlist(self.doclist, 'pp_so_details')] + so_list = [d.sales_order for d in self.get('pp_so_details')] for r in open_so: if cstr(r['name']) not in so_list: - pp_so = addchild(self.doc, 'pp_so_details', - 'Production Plan Sales Order', self.doclist) + pp_so = self.doc.append('pp_so_details', {}) pp_so.sales_order = r['name'] pp_so.sales_order_date = cstr(r['transaction_date']) pp_so.customer = cstr(r['customer']) @@ -103,7 +100,7 @@ class DocType: self.add_items(items) def get_items(self): - so_list = filter(None, [d.sales_order for d in getlist(self.doclist, 'pp_so_details')]) + so_list = filter(None, [d.sales_order for d in self.get('pp_so_details')]) if not so_list: msgprint(_("Please enter sales order in the above table")) return [] @@ -138,7 +135,7 @@ class DocType: for p in items: item_details = frappe.db.sql("""select description, stock_uom, default_bom from tabItem where name=%s""", p['item_code']) - pi = addchild(self.doc, 'pp_details', 'Production Plan Item', self.doclist) + pi = self.doc.append('pp_details', {}) pi.sales_order = p['parent'] pi.warehouse = p['warehouse'] pi.item_code = p['item_code'] @@ -151,7 +148,7 @@ class DocType: def validate_data(self): self.validate_company() - for d in getlist(self.doclist, 'pp_details'): + for d in self.get('pp_details'): self.validate_bom_no(d) if not flt(d.planned_qty): frappe.throw("Please Enter Planned Qty for item: %s at row no: %s" % @@ -193,7 +190,7 @@ class DocType: } """ item_dict, bom_dict = {}, {} - for d in self.doclist.get({"parentfield": "pp_details"}): + for d in self.get("pp_details"): bom_dict.setdefault(d.bom_no, []).append([d.sales_order, flt(d.planned_qty)]) item_dict[(d.item_code, d.sales_order, d.warehouse)] = { "production_item" : d.item_code, diff --git a/erpnext/manufacturing/doctype/workstation/workstation.py b/erpnext/manufacturing/doctype/workstation/workstation.py index 2829f41ed8..dd53c56429 100644 --- a/erpnext/manufacturing/doctype/workstation/workstation.py +++ b/erpnext/manufacturing/doctype/workstation/workstation.py @@ -5,7 +5,9 @@ from __future__ import unicode_literals import frappe from frappe.utils import flt -class DocType: +from frappe.model.document import Document + +class Workstation(Document): def __init__(self, doc, doclist=[]): self.doc = doc self.doclist = doclist diff --git a/erpnext/projects/doctype/activity_type/activity_type.py b/erpnext/projects/doctype/activity_type/activity_type.py index 26c87f1c04..a98d8cf0ec 100644 --- a/erpnext/projects/doctype/activity_type/activity_type.py +++ b/erpnext/projects/doctype/activity_type/activity_type.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class ActivityType(Document): + pass \ No newline at end of file diff --git a/erpnext/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py index deac722ae9..99a9d3a394 100644 --- a/erpnext/projects/doctype/project/project.py +++ b/erpnext/projects/doctype/project/project.py @@ -8,10 +8,9 @@ from frappe.utils import flt, getdate from frappe import msgprint from erpnext.utilities.transaction_base import delete_events -class DocType: - def __init__(self, doc, doclist=None): - self.doc = doc - self.doclist = doclist +from frappe.model.document import Document + +class Project(Document): def get_gross_profit(self): pft, per_pft =0, 0 @@ -45,7 +44,7 @@ class DocType: delete_events(self.doc.doctype, self.doc.name) # add events - for milestone in self.doclist.get({"parentfield": "project_milestones"}): + for milestone in self.get("project_milestones"): if milestone.milestone_date: description = (milestone.milestone or "Milestone") + " for " + self.doc.name frappe.bean({ diff --git a/erpnext/projects/doctype/project_milestone/project_milestone.py b/erpnext/projects/doctype/project_milestone/project_milestone.py index 26c87f1c04..57bcfc4034 100644 --- a/erpnext/projects/doctype/project_milestone/project_milestone.py +++ b/erpnext/projects/doctype/project_milestone/project_milestone.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class ProjectMilestone(Document): + pass \ No newline at end of file diff --git a/erpnext/projects/doctype/task/task.py b/erpnext/projects/doctype/task/task.py index 0e7678118f..289903d2c9 100644 --- a/erpnext/projects/doctype/task/task.py +++ b/erpnext/projects/doctype/task/task.py @@ -5,16 +5,12 @@ from __future__ import unicode_literals import frappe, json from frappe.utils import getdate, today -from frappe.model import db_exists -from frappe.model.bean import copy_doclist from frappe import msgprint -class DocType: - def __init__(self,doc,doclist=[]): - self.doc = doc - self.doclist = doclist - +from frappe.model.document import Document + +class Task(Document): def get_project_details(self): return { "project": self.doc.project diff --git a/erpnext/projects/doctype/time_log/time_log.py b/erpnext/projects/doctype/time_log/time_log.py index 690eb9270e..3dedef14c2 100644 --- a/erpnext/projects/doctype/time_log/time_log.py +++ b/erpnext/projects/doctype/time_log/time_log.py @@ -11,9 +11,9 @@ from frappe.utils import cstr class OverlapError(frappe.ValidationError): pass -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +from frappe.model.document import Document + +class TimeLog(Document): def validate(self): self.set_status() diff --git a/erpnext/projects/doctype/time_log_batch/time_log_batch.py b/erpnext/projects/doctype/time_log_batch/time_log_batch.py index 3c3e6e06b0..89beb9d2b1 100644 --- a/erpnext/projects/doctype/time_log_batch/time_log_batch.py +++ b/erpnext/projects/doctype/time_log_batch/time_log_batch.py @@ -7,9 +7,9 @@ from __future__ import unicode_literals import frappe from frappe import _ -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +from frappe.model.document import Document + +class TimeLogBatch(Document): def validate(self): self.set_status() diff --git a/erpnext/projects/doctype/time_log_batch_detail/time_log_batch_detail.py b/erpnext/projects/doctype/time_log_batch_detail/time_log_batch_detail.py index 968a25b613..f0c4c1b49c 100644 --- a/erpnext/projects/doctype/time_log_batch_detail/time_log_batch_detail.py +++ b/erpnext/projects/doctype/time_log_batch_detail/time_log_batch_detail.py @@ -6,6 +6,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class TimeLogBatchDetail(Document): + pass \ No newline at end of file diff --git a/erpnext/selling/doctype/campaign/campaign.py b/erpnext/selling/doctype/campaign/campaign.py index 5015bed79c..523c62d03f 100644 --- a/erpnext/selling/doctype/campaign/campaign.py +++ b/erpnext/selling/doctype/campaign/campaign.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl - \ No newline at end of file +from frappe.model.document import Document + +class Campaign(Document): + pass \ No newline at end of file diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py index d8a095f7e5..1fc2613d1f 100644 --- a/erpnext/selling/doctype/customer/customer.py +++ b/erpnext/selling/doctype/customer/customer.py @@ -11,10 +11,7 @@ import frappe.defaults from erpnext.utilities.transaction_base import TransactionBase from erpnext.accounts.party import create_party_account -class DocType(TransactionBase): - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist +class Customer(TransactionBase): def autoname(self): cust_master_name = frappe.defaults.get_global_default('cust_master_name') diff --git a/erpnext/selling/doctype/industry_type/industry_type.py b/erpnext/selling/doctype/industry_type/industry_type.py index 5015bed79c..f6bf2c8132 100644 --- a/erpnext/selling/doctype/industry_type/industry_type.py +++ b/erpnext/selling/doctype/industry_type/industry_type.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl - \ No newline at end of file +from frappe.model.document import Document + +class IndustryType(Document): + pass \ No newline at end of file diff --git a/erpnext/selling/doctype/installation_note/installation_note.py b/erpnext/selling/doctype/installation_note/installation_note.py index 3d57db734a..404ad33ae9 100644 --- a/erpnext/selling/doctype/installation_note/installation_note.py +++ b/erpnext/selling/doctype/installation_note/installation_note.py @@ -11,10 +11,7 @@ from erpnext.stock.utils import get_valid_serial_nos from erpnext.utilities.transaction_base import TransactionBase -class DocType(TransactionBase): - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist +class InstallationNote(TransactionBase): self.tname = 'Installation Note Item' self.fname = 'installed_item_details' self.status_updater = [{ @@ -78,7 +75,7 @@ class DocType(TransactionBase): def validate_serial_no(self): cur_s_no, prevdoc_s_no, sr_list = [], [], [] - for d in getlist(self.doclist, 'installed_item_details'): + for d in self.get('installed_item_details'): self.is_serial_no_added(d.item_code, d.serial_no) if d.serial_no: sr_list = get_valid_serial_nos(d.serial_no, d.qty, d.item_code) @@ -91,7 +88,7 @@ class DocType(TransactionBase): self.is_serial_no_installed(sr_list, d.item_code) def validate_installation_date(self): - for d in getlist(self.doclist, 'installed_item_details'): + for d in self.get('installed_item_details'): if d.prevdoc_docname: d_date = frappe.db.get_value("Delivery Note", d.prevdoc_docname, "posting_date") if d_date > getdate(self.doc.inst_date): @@ -99,7 +96,7 @@ class DocType(TransactionBase): " for item "+d.item_code, raise_exception=1) def check_item_table(self): - if not(getlist(self.doclist, 'installed_item_details')): + if not(self.get('installed_item_details')): msgprint("Please fetch items from Delivery Note selected", raise_exception=1) def on_update(self): @@ -111,7 +108,7 @@ class DocType(TransactionBase): frappe.db.set(self.doc, 'status', 'Submitted') def on_cancel(self): - for d in getlist(self.doclist, 'installed_item_details'): + for d in self.get('installed_item_details'): if d.serial_no: d.serial_no = d.serial_no.replace(",", "\n") for sr_no in d.serial_no.split("\n"): diff --git a/erpnext/selling/doctype/installation_note_item/installation_note_item.py b/erpnext/selling/doctype/installation_note_item/installation_note_item.py index 26c87f1c04..ac3aacfab6 100644 --- a/erpnext/selling/doctype/installation_note_item/installation_note_item.py +++ b/erpnext/selling/doctype/installation_note_item/installation_note_item.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class InstallationNoteItem(Document): + pass \ No newline at end of file diff --git a/erpnext/selling/doctype/lead/lead.py b/erpnext/selling/doctype/lead/lead.py index 614a9c2d65..1472ff26f3 100644 --- a/erpnext/selling/doctype/lead/lead.py +++ b/erpnext/selling/doctype/lead/lead.py @@ -10,10 +10,7 @@ from frappe import session from erpnext.controllers.selling_controller import SellingController -class DocType(SellingController): - def __init__(self, doc, doclist): - self.doc = doc - self.doclist = doclist +class Lead(SellingController): self._prev = frappe._dict({ "contact_date": frappe.db.get_value("Lead", self.doc.name, "contact_date") if \ diff --git a/erpnext/selling/doctype/opportunity/opportunity.py b/erpnext/selling/doctype/opportunity/opportunity.py index d2f7a2eb75..bbe9a60bb9 100644 --- a/erpnext/selling/doctype/opportunity/opportunity.py +++ b/erpnext/selling/doctype/opportunity/opportunity.py @@ -11,19 +11,9 @@ from frappe import msgprint, _ from erpnext.utilities.transaction_base import TransactionBase -class DocType(TransactionBase): - def __init__(self,doc,doclist): - self.doc = doc - self.doclist = doclist - self.fname = 'enq_details' - self.tname = 'Opportunity Item' - - self._prev = frappe._dict({ - "contact_date": frappe.db.get_value("Opportunity", self.doc.name, "contact_date") if \ - (not cint(self.doc.fields.get("__islocal"))) else None, - "contact_by": frappe.db.get_value("Opportunity", self.doc.name, "contact_by") if \ - (not cint(self.doc.fields.get("__islocal"))) else None, - }) +class Opportunity(TransactionBase): + fname = 'enq_details' + tname = 'Opportunity Item' def get_item_details(self, item_code): item = frappe.db.sql("""select item_name, stock_uom, description_html, description, item_group, brand @@ -91,7 +81,7 @@ class DocType(TransactionBase): super(DocType, self).add_calendar_event(opts, force) def validate_item_details(self): - if not getlist(self.doclist, 'enquiry_details'): + if not self.get('enquiry_details'): msgprint("Please select items for which enquiry needs to be made") raise Exception @@ -102,6 +92,13 @@ class DocType(TransactionBase): msgprint("Customer is mandatory if 'Opportunity From' is selected as Customer", raise_exception=1) def validate(self): + self._prev = frappe._dict({ + "contact_date": frappe.db.get_value("Opportunity", self.doc.name, "contact_date") if \ + (not cint(self.doc.fields.get("__islocal"))) else None, + "contact_by": frappe.db.get_value("Opportunity", self.doc.name, "contact_by") if \ + (not cint(self.doc.fields.get("__islocal"))) else None, + }) + self.set_status() self.validate_item_details() self.validate_uom_is_integer("uom", "qty") diff --git a/erpnext/selling/doctype/opportunity_item/opportunity_item.py b/erpnext/selling/doctype/opportunity_item/opportunity_item.py index 26c87f1c04..26b2999ebb 100644 --- a/erpnext/selling/doctype/opportunity_item/opportunity_item.py +++ b/erpnext/selling/doctype/opportunity_item/opportunity_item.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class OpportunityItem(Document): + pass \ No newline at end of file diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py index 484c487548..530ad240f5 100644 --- a/erpnext/selling/doctype/quotation/quotation.py +++ b/erpnext/selling/doctype/quotation/quotation.py @@ -10,10 +10,7 @@ from frappe import _, msgprint from erpnext.controllers.selling_controller import SellingController -class DocType(SellingController): - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist +class Quotation(SellingController): self.tname = 'Quotation Item' self.fname = 'quotation_details' @@ -22,7 +19,7 @@ class DocType(SellingController): def validate_for_items(self): chk_dupl_itm = [] - for d in getlist(self.doclist,'quotation_details'): + for d in self.get('quotation_details'): if [cstr(d.item_code),cstr(d.description)] in chk_dupl_itm: msgprint("Item %s has been entered twice. Please change description atleast to continue" % d.item_code) raise Exception @@ -33,7 +30,7 @@ class DocType(SellingController): super(DocType, self).validate_order_type() if self.doc.order_type in ['Maintenance', 'Service']: - for d in getlist(self.doclist, 'quotation_details'): + for d in self.get('quotation_details'): is_service_item = frappe.db.sql("select is_service_item from `tabItem` where name=%s", d.item_code) is_service_item = is_service_item and is_service_item[0][0] or 'No' @@ -41,7 +38,7 @@ class DocType(SellingController): msgprint("You can not select non service item "+d.item_code+" in Maintenance Quotation") raise Exception else: - for d in getlist(self.doclist, 'quotation_details'): + for d in self.get('quotation_details'): is_sales_item = frappe.db.sql("select is_sales_item from `tabItem` where name=%s", d.item_code) is_sales_item = is_sales_item and is_sales_item[0][0] or 'No' @@ -69,7 +66,7 @@ class DocType(SellingController): frappe.throw(_("Cannot set as Lost as Sales Order is made.")) def check_item_table(self): - if not getlist(self.doclist, 'quotation_details'): + if not self.get('quotation_details'): msgprint("Please enter item details") raise Exception @@ -89,7 +86,7 @@ class DocType(SellingController): def print_other_charges(self,docname): print_lst = [] - for d in getlist(self.doclist,'other_charges'): + for d in self.get('other_charges'): lst1 = [] lst1.append(d.description) lst1.append(d.total) diff --git a/erpnext/selling/doctype/quotation_item/quotation_item.py b/erpnext/selling/doctype/quotation_item/quotation_item.py index 26c87f1c04..426b199a36 100644 --- a/erpnext/selling/doctype/quotation_item/quotation_item.py +++ b/erpnext/selling/doctype/quotation_item/quotation_item.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class QuotationItem(Document): + pass \ No newline at end of file diff --git a/erpnext/selling/doctype/sales_bom/sales_bom.py b/erpnext/selling/doctype/sales_bom/sales_bom.py index fb4696199c..3e97ed9f92 100644 --- a/erpnext/selling/doctype/sales_bom/sales_bom.py +++ b/erpnext/selling/doctype/sales_bom/sales_bom.py @@ -4,9 +4,10 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self,d,dl): - self.doc, self.doclist = d,dl +from frappe.model.document import Document + +class SalesBom(Document): + def autoname(self): self.doc.name = self.doc.new_item_code diff --git a/erpnext/selling/doctype/sales_bom_item/sales_bom_item.py b/erpnext/selling/doctype/sales_bom_item/sales_bom_item.py index 26c87f1c04..e1124d97cc 100644 --- a/erpnext/selling/doctype/sales_bom_item/sales_bom_item.py +++ b/erpnext/selling/doctype/sales_bom_item/sales_bom_item.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class SalesBomItem(Document): + pass \ No newline at end of file diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index fd915de7b5..25eda9ab3a 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -13,7 +13,7 @@ from frappe.model.mapper import get_mapped_doclist from erpnext.controllers.selling_controller import SellingController -class DocType(SellingController): +class SalesOrder(SellingController): def __init__(self, doc, doclist=None): self.doc = doc if not doclist: doclist = [] @@ -48,7 +48,7 @@ class DocType(SellingController): def validate_for_items(self): check_list, flag = [], 0 chk_dupl_itm = [] - for d in getlist(self.doclist, 'sales_order_details'): + for d in self.get('sales_order_details'): e = [d.item_code, d.description, d.warehouse, d.prevdoc_docname or ''] f = [d.item_code, d.description] @@ -75,7 +75,7 @@ class DocType(SellingController): d.projected_qty = tot_avail_qty and flt(tot_avail_qty[0][0]) or 0 def validate_sales_mntc_quotation(self): - for d in getlist(self.doclist, 'sales_order_details'): + for d in self.get('sales_order_details'): if d.prevdoc_docname: res = frappe.db.sql("select name from `tabQuotation` where name=%s and order_type = %s", (d.prevdoc_docname, self.doc.order_type)) if not res: diff --git a/erpnext/selling/doctype/sales_order_item/sales_order_item.py b/erpnext/selling/doctype/sales_order_item/sales_order_item.py index 26c87f1c04..ef2ad098ec 100644 --- a/erpnext/selling/doctype/sales_order_item/sales_order_item.py +++ b/erpnext/selling/doctype/sales_order_item/sales_order_item.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class SalesOrderItem(Document): + pass \ No newline at end of file diff --git a/erpnext/selling/doctype/sales_team/sales_team.py b/erpnext/selling/doctype/sales_team/sales_team.py index 26c87f1c04..01d38d2614 100644 --- a/erpnext/selling/doctype/sales_team/sales_team.py +++ b/erpnext/selling/doctype/sales_team/sales_team.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class SalesTeam(Document): + pass \ No newline at end of file diff --git a/erpnext/selling/doctype/selling_settings/selling_settings.py b/erpnext/selling/doctype/selling_settings/selling_settings.py index 5b44c7b6a6..6823fa1b86 100644 --- a/erpnext/selling/doctype/selling_settings/selling_settings.py +++ b/erpnext/selling/doctype/selling_settings/selling_settings.py @@ -6,9 +6,9 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +from frappe.model.document import Document + +class SellingSettings(Document): def validate(self): for key in ["cust_master_name", "customer_group", "territory", "maintain_same_sales_rate", diff --git a/erpnext/selling/doctype/sms_center/sms_center.py b/erpnext/selling/doctype/sms_center/sms_center.py index 7da6f32102..9aeb5eefef 100644 --- a/erpnext/selling/doctype/sms_center/sms_center.py +++ b/erpnext/selling/doctype/sms_center/sms_center.py @@ -8,10 +8,9 @@ from frappe.utils import cstr from frappe.model.code import get_obj from frappe import msgprint, _ -class DocType: - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist +from frappe.model.document import Document + +class SmsCenter(Document): def create_receiver_list(self): rec, where_clause = '', '' diff --git a/erpnext/setup/doctype/applicable_territory/applicable_territory.py b/erpnext/setup/doctype/applicable_territory/applicable_territory.py index cb42e2eea2..25478d6aad 100644 --- a/erpnext/setup/doctype/applicable_territory/applicable_territory.py +++ b/erpnext/setup/doctype/applicable_territory/applicable_territory.py @@ -6,6 +6,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class ApplicableTerritory(Document): + pass \ No newline at end of file diff --git a/erpnext/setup/doctype/authorization_control/authorization_control.py b/erpnext/setup/doctype/authorization_control/authorization_control.py index b37686a666..9b8980cd3c 100644 --- a/erpnext/setup/doctype/authorization_control/authorization_control.py +++ b/erpnext/setup/doctype/authorization_control/authorization_control.py @@ -12,9 +12,7 @@ from erpnext.setup.utils import get_company_currency from erpnext.utilities.transaction_base import TransactionBase -class DocType(TransactionBase): - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +class AuthorizationControl(TransactionBase): # Get Names of all Approving Users and Roles diff --git a/erpnext/setup/doctype/authorization_rule/authorization_rule.py b/erpnext/setup/doctype/authorization_rule/authorization_rule.py index 71f5caf6d0..5255e4cd17 100644 --- a/erpnext/setup/doctype/authorization_rule/authorization_rule.py +++ b/erpnext/setup/doctype/authorization_rule/authorization_rule.py @@ -7,9 +7,9 @@ import frappe from frappe.utils import cint, cstr, flt, has_common from frappe import msgprint -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +from frappe.model.document import Document + +class AuthorizationRule(Document): def check_duplicate_entry(self): diff --git a/erpnext/setup/doctype/backup_manager/backup_manager.py b/erpnext/setup/doctype/backup_manager/backup_manager.py index c3978006c8..8f7e891ad3 100644 --- a/erpnext/setup/doctype/backup_manager/backup_manager.py +++ b/erpnext/setup/doctype/backup_manager/backup_manager.py @@ -7,9 +7,9 @@ from __future__ import unicode_literals import frappe from frappe import _ -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +from frappe.model.document import Document + +class BackupManager(Document): def take_backups_daily(): take_backups_if("Daily") diff --git a/erpnext/setup/doctype/brand/brand.py b/erpnext/setup/doctype/brand/brand.py index d30eab6e92..5bdc243194 100644 --- a/erpnext/setup/doctype/brand/brand.py +++ b/erpnext/setup/doctype/brand/brand.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +from frappe.model.document import Document + +class Brand(Document): + pass \ No newline at end of file diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py index 5162ffbb14..9c980684e8 100644 --- a/erpnext/setup/doctype/company/company.py +++ b/erpnext/setup/doctype/company/company.py @@ -9,9 +9,10 @@ from frappe.utils import cstr, cint import frappe.defaults -class DocType: - def __init__(self,d,dl): - self.doc, self.doclist = d,dl +from frappe.model.document import Document + +class Company(Document): + def onload(self): self.doc.fields["__transactions_exist"] = self.check_if_transactions_exist() diff --git a/erpnext/setup/doctype/contact_control/contact_control.py b/erpnext/setup/doctype/contact_control/contact_control.py index 35bd61c982..96e9551c3f 100644 --- a/erpnext/setup/doctype/contact_control/contact_control.py +++ b/erpnext/setup/doctype/contact_control/contact_control.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self,doc,doclist=[]): - self.doc = doc - self.doclist = doclist +from frappe.model.document import Document + +class ContactControl(Document): + pass \ No newline at end of file diff --git a/erpnext/setup/doctype/country/country.py b/erpnext/setup/doctype/country/country.py index d30eab6e92..5e16f51f8f 100644 --- a/erpnext/setup/doctype/country/country.py +++ b/erpnext/setup/doctype/country/country.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +from frappe.model.document import Document + +class Country(Document): + pass \ No newline at end of file diff --git a/erpnext/setup/doctype/currency/currency.py b/erpnext/setup/doctype/currency/currency.py index 2f6a62af74..5541065437 100644 --- a/erpnext/setup/doctype/currency/currency.py +++ b/erpnext/setup/doctype/currency/currency.py @@ -5,9 +5,9 @@ from __future__ import unicode_literals import frappe from frappe import throw, _ -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +from frappe.model.document import Document + +class Currency(Document): def validate_conversion_rate(currency, conversion_rate, conversion_rate_label, company): """common validation for currency and price list currency""" diff --git a/erpnext/setup/doctype/currency_exchange/currency_exchange.py b/erpnext/setup/doctype/currency_exchange/currency_exchange.py index 93f44190ba..a0624de888 100644 --- a/erpnext/setup/doctype/currency_exchange/currency_exchange.py +++ b/erpnext/setup/doctype/currency_exchange/currency_exchange.py @@ -8,9 +8,7 @@ import frappe from frappe import _, msgprint from frappe.model.controller import DocListController -class DocType(DocListController): - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +class CurrencyExchange(DocListController): def autoname(self): self.doc.name = self.doc.from_currency + "-" + self.doc.to_currency diff --git a/erpnext/setup/doctype/customer_group/customer_group.py b/erpnext/setup/doctype/customer_group/customer_group.py index 547f19fc39..214e20c0e5 100644 --- a/erpnext/setup/doctype/customer_group/customer_group.py +++ b/erpnext/setup/doctype/customer_group/customer_group.py @@ -7,10 +7,7 @@ from frappe import msgprint from frappe.utils.nestedset import DocTypeNestedSet -class DocType(DocTypeNestedSet): - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist +class CustomerGroup(DocTypeNestedSet): self.nsm_parent_field = 'parent_customer_group'; def validate(self): diff --git a/erpnext/setup/doctype/email_digest/email_digest.py b/erpnext/setup/doctype/email_digest/email_digest.py index c46c43e841..1344686da6 100644 --- a/erpnext/setup/doctype/email_digest/email_digest.py +++ b/erpnext/setup/doctype/email_digest/email_digest.py @@ -45,9 +45,9 @@ row_template = """

""" from frappe.model.controller import DocListController -class DocType(DocListController): - def __init__(self, doc, doclist=[]): - self.doc, self.doclist = doc, doclist +class EmailDigest(DocListController): + def __init__(self, arg1, arg2=None): + super(EmailDigest, self).__init__(arg1, arg2) self.from_date, self.to_date = self.get_from_to_date() self.future_from_date, self.future_to_date = self.get_future_from_to_date() self.currency = frappe.db.get_value("Company", self.doc.company, diff --git a/erpnext/setup/doctype/features_setup/features_setup.py b/erpnext/setup/doctype/features_setup/features_setup.py index 0c9d6e4537..825163df9a 100644 --- a/erpnext/setup/doctype/features_setup/features_setup.py +++ b/erpnext/setup/doctype/features_setup/features_setup.py @@ -2,9 +2,9 @@ # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +from frappe.model.document import Document + +class FeaturesSetup(Document): def validate(self): """ diff --git a/erpnext/setup/doctype/global_defaults/global_defaults.py b/erpnext/setup/doctype/global_defaults/global_defaults.py index d61ff8a00e..bfe3265b9d 100644 --- a/erpnext/setup/doctype/global_defaults/global_defaults.py +++ b/erpnext/setup/doctype/global_defaults/global_defaults.py @@ -22,9 +22,9 @@ keydict = { 'disable_rounded_total': 'disable_rounded_total', } -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +from frappe.model.document import Document + +class GlobalDefaults(Document): def on_update(self): """update defaults""" diff --git a/erpnext/setup/doctype/item_group/item_group.py b/erpnext/setup/doctype/item_group/item_group.py index aa1002e66f..455d752452 100644 --- a/erpnext/setup/doctype/item_group/item_group.py +++ b/erpnext/setup/doctype/item_group/item_group.py @@ -6,10 +6,7 @@ import frappe from frappe.utils.nestedset import DocTypeNestedSet -class DocType(DocTypeNestedSet): - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist +class ItemGroup(DocTypeNestedSet): self.nsm_parent_field = 'parent_item_group' def validate(self): diff --git a/erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.py b/erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.py index 4d2d1ea7fa..2c928aaa7f 100644 --- a/erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.py +++ b/erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.py @@ -8,9 +8,9 @@ import frappe from frappe import _ from frappe.utils import cint -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +from frappe.model.document import Document + +class JobsEmailSettings(Document): def validate(self): if cint(self.doc.extract_emails) and not (self.doc.email_id and self.doc.host and \ diff --git a/erpnext/setup/doctype/naming_series/naming_series.py b/erpnext/setup/doctype/naming_series/naming_series.py index 5b0c9e25e6..454b38a349 100644 --- a/erpnext/setup/doctype/naming_series/naming_series.py +++ b/erpnext/setup/doctype/naming_series/naming_series.py @@ -8,9 +8,9 @@ from frappe.utils import cstr from frappe import msgprint, throw, _ import frappe.model.doctype -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +from frappe.model.document import Document + +class NamingSeries(Document): def get_transactions(self, arg=None): return { diff --git a/erpnext/setup/doctype/notification_control/notification_control.py b/erpnext/setup/doctype/notification_control/notification_control.py index c5137461c6..21bdcced93 100644 --- a/erpnext/setup/doctype/notification_control/notification_control.py +++ b/erpnext/setup/doctype/notification_control/notification_control.py @@ -7,9 +7,10 @@ import frappe from frappe import msgprint -class DocType: - def __init__(self,d,dl): - self.doc, self.doclist = d,dl +from frappe.model.document import Document + +class NotificationControl(Document): + def get_message(self, arg): fn = arg.lower().replace(' ', '_') + '_message' diff --git a/erpnext/setup/doctype/print_heading/print_heading.py b/erpnext/setup/doctype/print_heading/print_heading.py index 263c31e327..eb6d9780ff 100644 --- a/erpnext/setup/doctype/print_heading/print_heading.py +++ b/erpnext/setup/doctype/print_heading/print_heading.py @@ -4,12 +4,7 @@ from __future__ import unicode_literals import frappe -from frappe.model import db_exists -from frappe.model.bean import copy_doclist +from frappe.model.document import Document - - - -class DocType: - def __init__(self,doc,doclist=[]): - self.doc, self.doclist = doc,doclist \ No newline at end of file +class PrintHeading(Document): + pass \ No newline at end of file diff --git a/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.py b/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.py index d30eab6e92..ea9f927856 100644 --- a/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.py +++ b/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +from frappe.model.document import Document + +class QuotationLostReason(Document): + pass \ No newline at end of file diff --git a/erpnext/setup/doctype/sales_email_settings/sales_email_settings.py b/erpnext/setup/doctype/sales_email_settings/sales_email_settings.py index 4d2d1ea7fa..01e9be41fc 100644 --- a/erpnext/setup/doctype/sales_email_settings/sales_email_settings.py +++ b/erpnext/setup/doctype/sales_email_settings/sales_email_settings.py @@ -8,9 +8,9 @@ import frappe from frappe import _ from frappe.utils import cint -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +from frappe.model.document import Document + +class SalesEmailSettings(Document): def validate(self): if cint(self.doc.extract_emails) and not (self.doc.email_id and self.doc.host and \ diff --git a/erpnext/setup/doctype/sales_partner/sales_partner.py b/erpnext/setup/doctype/sales_partner/sales_partner.py index eefabf6784..5e3e569968 100644 --- a/erpnext/setup/doctype/sales_partner/sales_partner.py +++ b/erpnext/setup/doctype/sales_partner/sales_partner.py @@ -4,12 +4,9 @@ from __future__ import unicode_literals import frappe from frappe.utils import cint, cstr, filter_strip_join +from frappe.model.document import Document -class DocType(): - def __init__(self, doc, doclist=None): - self.doc = doc - self.doclist = doclist - +class SalesPartner(Document): def validate(self): if self.doc.partner_website and not self.doc.partner_website.startswith("http"): self.doc.partner_website = "http://" + self.doc.partner_website diff --git a/erpnext/setup/doctype/sales_person/sales_person.py b/erpnext/setup/doctype/sales_person/sales_person.py index 58ddd13c6c..b128d2c430 100644 --- a/erpnext/setup/doctype/sales_person/sales_person.py +++ b/erpnext/setup/doctype/sales_person/sales_person.py @@ -7,14 +7,11 @@ from frappe.model.bean import getlist from frappe.utils import flt from frappe.utils.nestedset import DocTypeNestedSet -class DocType(DocTypeNestedSet): - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist +class SalesPerson(DocTypeNestedSet): self.nsm_parent_field = 'parent_sales_person'; def validate(self): - for d in getlist(self.doclist, 'target_details'): + for d in self.get('target_details'): if not flt(d.target_qty) and not flt(d.target_amount): frappe.throw(_("Either target qty or target amount is mandatory.")) diff --git a/erpnext/setup/doctype/sms_parameter/sms_parameter.py b/erpnext/setup/doctype/sms_parameter/sms_parameter.py index 26c87f1c04..4c54a4f404 100644 --- a/erpnext/setup/doctype/sms_parameter/sms_parameter.py +++ b/erpnext/setup/doctype/sms_parameter/sms_parameter.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class SmsParameter(Document): + pass \ No newline at end of file diff --git a/erpnext/setup/doctype/sms_settings/sms_settings.py b/erpnext/setup/doctype/sms_settings/sms_settings.py index 26c87f1c04..9361d3b620 100644 --- a/erpnext/setup/doctype/sms_settings/sms_settings.py +++ b/erpnext/setup/doctype/sms_settings/sms_settings.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class SmsSettings(Document): + pass \ No newline at end of file diff --git a/erpnext/setup/doctype/supplier_type/supplier_type.py b/erpnext/setup/doctype/supplier_type/supplier_type.py index d30eab6e92..70369569ce 100644 --- a/erpnext/setup/doctype/supplier_type/supplier_type.py +++ b/erpnext/setup/doctype/supplier_type/supplier_type.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +from frappe.model.document import Document + +class SupplierType(Document): + pass \ No newline at end of file diff --git a/erpnext/setup/doctype/target_detail/target_detail.py b/erpnext/setup/doctype/target_detail/target_detail.py index 26c87f1c04..2332560b65 100644 --- a/erpnext/setup/doctype/target_detail/target_detail.py +++ b/erpnext/setup/doctype/target_detail/target_detail.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class TargetDetail(Document): + pass \ No newline at end of file diff --git a/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.py b/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.py index 26c87f1c04..73ac3947b8 100644 --- a/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.py +++ b/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class TermsAndConditions(Document): + pass \ No newline at end of file diff --git a/erpnext/setup/doctype/territory/territory.py b/erpnext/setup/doctype/territory/territory.py index 5dfe458908..67669d9902 100644 --- a/erpnext/setup/doctype/territory/territory.py +++ b/erpnext/setup/doctype/territory/territory.py @@ -9,14 +9,11 @@ from frappe.utils import flt from frappe.utils.nestedset import DocTypeNestedSet -class DocType(DocTypeNestedSet): - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist - self.nsm_parent_field = 'parent_territory' +class Territory(DocTypeNestedSet): + nsm_parent_field = 'parent_territory' def validate(self): - for d in getlist(self.doclist, 'target_details'): + for d in self.get('target_details'): if not flt(d.target_qty) and not flt(d.target_amount): msgprint("Either target qty or target amount is mandatory.") raise Exception diff --git a/erpnext/setup/doctype/uom/uom.py b/erpnext/setup/doctype/uom/uom.py index d30eab6e92..2d076f6584 100644 --- a/erpnext/setup/doctype/uom/uom.py +++ b/erpnext/setup/doctype/uom/uom.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +from frappe.model.document import Document + +class Uom(Document): + pass \ No newline at end of file diff --git a/erpnext/setup/doctype/website_item_group/website_item_group.py b/erpnext/setup/doctype/website_item_group/website_item_group.py index cb42e2eea2..4665cabef2 100644 --- a/erpnext/setup/doctype/website_item_group/website_item_group.py +++ b/erpnext/setup/doctype/website_item_group/website_item_group.py @@ -6,6 +6,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class WebsiteItemGroup(Document): + pass \ No newline at end of file diff --git a/erpnext/setup/page/setup_wizard/setup_wizard.py b/erpnext/setup/page/setup_wizard/setup_wizard.py index eba79d8432..b03eeaec07 100644 --- a/erpnext/setup/page/setup_wizard/setup_wizard.py +++ b/erpnext/setup/page/setup_wizard/setup_wizard.py @@ -334,16 +334,14 @@ def create_letter_head(args): fileurl = save_file(filename, content, "Letter Head", "Standard", decode=True).file_name frappe.db.set_value("Letter Head", "Standard", "content", "" % fileurl) - - def add_all_roles_to(name): - user = frappe.doc("User", name) + user = frappe.get_doc("User", name) for role in frappe.db.sql("""select name from tabRole"""): if role[0] not in ["Administrator", "Guest", "All", "Customer", "Supplier", "Partner"]: - d = user.addchild("user_roles", "UserRole") + d = user.append("user_roles") d.role = role[0] - d.insert() - + user.save() + def create_territories(): """create two default territories, one for home country and one named Rest of the World""" from frappe.utils.nestedset import get_root_of diff --git a/erpnext/stock/doctype/batch/batch.py b/erpnext/stock/doctype/batch/batch.py index 26c87f1c04..365cb38b60 100644 --- a/erpnext/stock/doctype/batch/batch.py +++ b/erpnext/stock/doctype/batch/batch.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class Batch(Document): + pass \ No newline at end of file diff --git a/erpnext/stock/doctype/bin/bin.py b/erpnext/stock/doctype/bin/bin.py index 1b5e243731..0587f47160 100644 --- a/erpnext/stock/doctype/bin/bin.py +++ b/erpnext/stock/doctype/bin/bin.py @@ -9,10 +9,9 @@ from frappe import msgprint, _ import frappe.defaults -class DocType: - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist +from frappe.model.document import Document + +class Bin(Document): def validate(self): if self.doc.fields.get("__islocal") or not self.doc.stock_uom: diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index a7c4923125..8d91e490db 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -13,10 +13,7 @@ from frappe.model.mapper import get_mapped_doclist from erpnext.stock.utils import update_bin from erpnext.controllers.selling_controller import SellingController -class DocType(SellingController): - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist +class DeliveryNote(SellingController): self.tname = 'Delivery Note Item' self.fname = 'delivery_note_details' self.status_updater = [{ @@ -37,14 +34,14 @@ class DocType(SellingController): billed_qty = frappe.db.sql("""select sum(ifnull(qty, 0)) from `tabSales Invoice Item` where docstatus=1 and delivery_note=%s""", self.doc.name) if billed_qty: - total_qty = sum((item.qty for item in self.doclist.get({"parentfield": "delivery_note_details"}))) + total_qty = sum((item.qty for item in self.get("delivery_note_details"))) self.doc.fields["__billing_complete"] = billed_qty[0][0] == total_qty def get_portal_page(self): return "shipment" if self.doc.docstatus==1 else None def set_actual_qty(self): - for d in getlist(self.doclist, 'delivery_note_details'): + for d in self.get('delivery_note_details'): if d.item_code and d.warehouse: actual_qty = frappe.db.sql("""select actual_qty from `tabBin` where item_code = %s and warehouse = %s""", (d.item_code, d.warehouse)) @@ -53,7 +50,7 @@ class DocType(SellingController): def so_required(self): """check in manage account if sales order required or not""" if frappe.db.get_value("Selling Settings", None, 'so_required') == 'Yes': - for d in getlist(self.doclist,'delivery_note_details'): + for d in self.get('delivery_note_details'): if not d.against_sales_order: msgprint("Sales Order No. required against item %s"%d.item_code) raise Exception @@ -81,7 +78,7 @@ class DocType(SellingController): if not self.doc.installation_status: self.doc.installation_status = 'Not Installed' def validate_with_previous_doc(self): - items = self.doclist.get({"parentfield": "delivery_note_details"}) + items = self.get("delivery_note_details") for fn in (("Sales Order", "against_sales_order"), ("Sales Invoice", "against_sales_invoice")): if items.get_distinct_values(fn[1]): @@ -114,7 +111,7 @@ class DocType(SellingController): def validate_for_items(self): check_list, chk_dupl_itm = [], [] - for d in getlist(self.doclist,'delivery_note_details'): + for d in self.get('delivery_note_details'): e = [d.item_code, d.description, d.warehouse, d.against_sales_order or d.against_sales_invoice, d.batch_no or ''] f = [d.item_code, d.description, d.against_sales_order or d.against_sales_invoice] @@ -140,11 +137,11 @@ class DocType(SellingController): def update_current_stock(self): - for d in getlist(self.doclist, 'delivery_note_details'): + for d in self.get('delivery_note_details'): bin = frappe.db.sql("select actual_qty from `tabBin` where item_code = %s and warehouse = %s", (d.item_code, d.warehouse), as_dict = 1) d.actual_qty = bin and flt(bin[0]['actual_qty']) or 0 - for d in getlist(self.doclist, 'packing_details'): + for d in self.get('packing_details'): bin = frappe.db.sql("select actual_qty, projected_qty from `tabBin` where item_code = %s and warehouse = %s", (d.item_code, d.warehouse), as_dict = 1) d.actual_qty = bin and flt(bin[0]['actual_qty']) or 0 d.projected_qty = bin and flt(bin[0]['projected_qty']) or 0 @@ -268,7 +265,7 @@ class DocType(SellingController): def credit_limit(self): """check credit limit of items in DN Detail which are not fetched from sales order""" amount, total = 0, 0 - for d in getlist(self.doclist, 'delivery_note_details'): + for d in self.get('delivery_note_details'): if not (d.against_sales_order or d.against_sales_invoice): amount += d.base_amount if amount != 0: @@ -299,7 +296,7 @@ def make_sales_invoice(source_name, target_doclist=None): si.set_doclist(si.doclist.get({"parentfield": ["!=", "entries"]}) + si.doclist.get({"parentfield": "entries", "qty": [">", 0]})) - if len(si.doclist.get({"parentfield": "entries"})) == 0: + if len(si.get("entries")) == 0: frappe.msgprint(_("Hey! All these items have already been invoiced."), raise_exception=True) diff --git a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.py b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.py index 26c87f1c04..3789cdaffa 100644 --- a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.py +++ b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class DeliveryNoteItem(Document): + pass \ No newline at end of file diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index 58d151a521..3a20d8cdf5 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -5,7 +5,6 @@ from __future__ import unicode_literals import frappe from frappe.utils import cstr, flt, getdate, now_datetime, formatdate -from frappe.model.doc import addchild from frappe.model.bean import getlist from frappe import msgprint, _ @@ -13,7 +12,7 @@ from frappe.model.controller import DocListController class WarehouseNotSet(Exception): pass -class DocType(DocListController): +class Item(DocListController): def onload(self): self.doc.fields["__sle_exists"] = self.check_if_sle_exists() @@ -58,13 +57,13 @@ class DocType(DocListController): raise_exception=WarehouseNotSet) def add_default_uom_in_conversion_factor_table(self): - uom_conv_list = [d.uom for d in self.doclist.get({"parentfield": "uom_conversion_details"})] + uom_conv_list = [d.uom for d in self.get("uom_conversion_details")] if self.doc.stock_uom not in uom_conv_list: - ch = addchild(self.doc, 'uom_conversion_details', 'UOM Conversion Detail', self.doclist) + ch = self.doc.append('uom_conversion_details', {}) ch.uom = self.doc.stock_uom ch.conversion_factor = 1 - for d in self.doclist.get({"parentfield": "uom_conversion_details"}): + for d in self.get("uom_conversion_details"): if d.conversion_factor == 1 and d.uom != self.doc.stock_uom: self.doclist.remove(d) @@ -95,7 +94,7 @@ class DocType(DocListController): def validate_conversion_factor(self): check_list = [] - for d in getlist(self.doclist,'uom_conversion_details'): + for d in self.get('uom_conversion_details'): if cstr(d.uom) in check_list: msgprint(_("UOM %s has been entered more than once in Conversion Factor Table." % cstr(d.uom)), raise_exception=1) @@ -141,14 +140,14 @@ class DocType(DocListController): def fill_customer_code(self): """ Append all the customer codes and insert into "customer_code" field of item table """ cust_code=[] - for d in getlist(self.doclist,'item_customer_details'): + for d in self.get('item_customer_details'): cust_code.append(d.ref_code) self.doc.customer_code=','.join(cust_code) def check_item_tax(self): """Check whether Tax Rate is not entered twice for same Tax Type""" check_list=[] - for d in getlist(self.doclist,'item_tax'): + for d in self.get('item_tax'): if d.tax_type: account_type = frappe.db.get_value("Account", d.tax_type, "account_type") diff --git a/erpnext/stock/doctype/item_customer_detail/item_customer_detail.py b/erpnext/stock/doctype/item_customer_detail/item_customer_detail.py index 26c87f1c04..b0bd280c7e 100644 --- a/erpnext/stock/doctype/item_customer_detail/item_customer_detail.py +++ b/erpnext/stock/doctype/item_customer_detail/item_customer_detail.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class ItemCustomerDetail(Document): + pass \ No newline at end of file diff --git a/erpnext/stock/doctype/item_price/item_price.py b/erpnext/stock/doctype/item_price/item_price.py index 879fcae4d1..3c3972bc78 100644 --- a/erpnext/stock/doctype/item_price/item_price.py +++ b/erpnext/stock/doctype/item_price/item_price.py @@ -7,9 +7,9 @@ from frappe import throw, _ class ItemPriceDuplicateItem(frappe.ValidationError): pass -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +from frappe.model.document import Document + +class ItemPrice(Document): def validate(self): self.validate_item() diff --git a/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.py b/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.py index 26c87f1c04..b659bb0746 100644 --- a/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.py +++ b/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class ItemQualityInspectionParameter(Document): + pass \ No newline at end of file diff --git a/erpnext/stock/doctype/item_reorder/item_reorder.py b/erpnext/stock/doctype/item_reorder/item_reorder.py index 968a25b613..7dcefb0e08 100644 --- a/erpnext/stock/doctype/item_reorder/item_reorder.py +++ b/erpnext/stock/doctype/item_reorder/item_reorder.py @@ -6,6 +6,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class ItemReorder(Document): + pass \ No newline at end of file diff --git a/erpnext/stock/doctype/item_supplier/item_supplier.py b/erpnext/stock/doctype/item_supplier/item_supplier.py index 26c87f1c04..68f481602f 100644 --- a/erpnext/stock/doctype/item_supplier/item_supplier.py +++ b/erpnext/stock/doctype/item_supplier/item_supplier.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class ItemSupplier(Document): + pass \ No newline at end of file diff --git a/erpnext/stock/doctype/item_tax/item_tax.py b/erpnext/stock/doctype/item_tax/item_tax.py index 26c87f1c04..96363e8115 100644 --- a/erpnext/stock/doctype/item_tax/item_tax.py +++ b/erpnext/stock/doctype/item_tax/item_tax.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class ItemTax(Document): + pass \ No newline at end of file diff --git a/erpnext/stock/doctype/item_website_specification/item_website_specification.py b/erpnext/stock/doctype/item_website_specification/item_website_specification.py index 968a25b613..ceb07275f9 100644 --- a/erpnext/stock/doctype/item_website_specification/item_website_specification.py +++ b/erpnext/stock/doctype/item_website_specification/item_website_specification.py @@ -6,6 +6,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class ItemWebsiteSpecification(Document): + pass \ No newline at end of file diff --git a/erpnext/stock/doctype/landed_cost_item/landed_cost_item.py b/erpnext/stock/doctype/landed_cost_item/landed_cost_item.py index 26c87f1c04..4681361d9d 100644 --- a/erpnext/stock/doctype/landed_cost_item/landed_cost_item.py +++ b/erpnext/stock/doctype/landed_cost_item/landed_cost_item.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class LandedCostItem(Document): + pass \ No newline at end of file diff --git a/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.py b/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.py index 26c87f1c04..090f833711 100644 --- a/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.py +++ b/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class LandedCostPurchaseReceipt(Document): + pass \ No newline at end of file diff --git a/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.py b/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.py index c52c820be9..34cbe3e2ea 100644 --- a/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.py +++ b/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.py @@ -4,13 +4,11 @@ from __future__ import unicode_literals import frappe from frappe.utils import flt -from frappe.model.doc import addchild from frappe import msgprint, _ -class DocType: - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist +from frappe.model.document import Document + +class LandedCostWizard(Document): def update_landed_cost(self): """ @@ -18,7 +16,7 @@ class DocType: Recalculate valuation rate in all sle after pr posting date """ purchase_receipts = [row.purchase_receipt for row in - self.doclist.get({"parentfield": "lc_pr_details"})] + self.get("lc_pr_details")] self.validate_purchase_receipts(purchase_receipts) self.cancel_pr(purchase_receipts) @@ -37,10 +35,9 @@ class DocType: for pr in purchase_receipts: pr_bean = frappe.bean('Purchase Receipt', pr) - pr_items = pr_bean.doclist.get({"parentfield": "purchase_tax_details"}) - idx = max([d.idx for d in pr_items]) if pr_items else 0 + pr_items = pr_bean.get("purchase_tax_details") - for lc in self.doclist.get({"parentfield": "landed_cost_details"}): + for lc in self.get("landed_cost_details"): amt = flt(lc.amount) * flt(pr_bean.doc.net_total)/ flt(total_amt) matched_row = pr_bean.doclist.get({ @@ -52,7 +49,7 @@ class DocType: }) if not matched_row: # add if not exists - ch = addchild(pr_bean.doc, 'other_charges', 'Purchase Taxes and Charges') + ch = pr_bean.append("other_charges") ch.category = 'Valuation' ch.add_deduct_tax = 'Add' ch.charge_type = 'Actual' @@ -62,9 +59,7 @@ class DocType: ch.rate = amt ch.tax_amount = amt ch.docstatus = 1 - ch.idx = idx + 1 ch.save(1) - idx += 1 else: # overwrite if exists matched_row[0].rate = amt matched_row[0].tax_amount = amt diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py index 2fca85bbb7..c05a8d87b2 100644 --- a/erpnext/stock/doctype/material_request/material_request.py +++ b/erpnext/stock/doctype/material_request/material_request.py @@ -13,19 +13,16 @@ from frappe.model.code import get_obj from frappe import msgprint, _ from erpnext.controllers.buying_controller import BuyingController -class DocType(BuyingController): - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist +class MaterialRequest(BuyingController): self.tname = 'Material Request Item' self.fname = 'indent_details' def check_if_already_pulled(self): - pass#if self.[d.sales_order_no for d in getlist(self.doclist, 'indent_details')] + pass#if self.[d.sales_order_no for d in self.get('indent_details')] def validate_qty_against_so(self): so_items = {} # Format --> {'SO/00001': {'Item/001': 120, 'Item/002': 24}} - for d in getlist(self.doclist, 'indent_details'): + for d in self.get('indent_details'): if d.sales_order_no: if not so_items.has_key(d.sales_order_no): so_items[d.sales_order_no] = {d.item_code: flt(d.qty)} @@ -53,7 +50,7 @@ class DocType(BuyingController): % (actual_so_qty - already_indented, item, so_no)) def validate_schedule_date(self): - for d in getlist(self.doclist, 'indent_details'): + for d in self.get('indent_details'): if d.schedule_date < self.doc.transaction_date: frappe.throw(_("Expected Date cannot be before Material Request Date")) @@ -84,7 +81,7 @@ class DocType(BuyingController): """ Update Quantity Requested for Purchase in Bin for Material Request of type 'Purchase'""" from erpnext.stock.utils import update_bin - for d in getlist(self.doclist, 'indent_details'): + for d in self.get('indent_details'): if frappe.db.get_value("Item", d.item_code, "is_stock_item") == "Yes": if not d.warehouse: frappe.throw("Please Enter Warehouse for Item %s as it is stock item" @@ -146,7 +143,7 @@ class DocType(BuyingController): if self.doc.material_request_type != "Transfer": return - item_doclist = self.doclist.get({"parentfield": "indent_details"}) + item_doclist = self.get("indent_details") if not mr_items: mr_items = [d.name for d in item_doclist] @@ -174,7 +171,7 @@ def update_completed_qty(bean, method): if bean.doc.doctype == "Stock Entry": material_request_map = {} - for d in bean.doclist.get({"parentfield": "mtn_details"}): + for d in bean.get("mtn_details"): if d.material_request: material_request_map.setdefault(d.material_request, []).append(d.material_request_item) diff --git a/erpnext/stock/doctype/material_request_item/material_request_item.py b/erpnext/stock/doctype/material_request_item/material_request_item.py index 968a25b613..30101f3a88 100644 --- a/erpnext/stock/doctype/material_request_item/material_request_item.py +++ b/erpnext/stock/doctype/material_request_item/material_request_item.py @@ -6,6 +6,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class MaterialRequestItem(Document): + pass \ No newline at end of file diff --git a/erpnext/stock/doctype/packed_item/packed_item.py b/erpnext/stock/doctype/packed_item/packed_item.py index b01307d7a2..b7a15b7c89 100644 --- a/erpnext/stock/doctype/packed_item/packed_item.py +++ b/erpnext/stock/doctype/packed_item/packed_item.py @@ -6,12 +6,11 @@ from __future__ import unicode_literals import frappe from frappe.utils import cstr, flt -from frappe.model.doc import addchild from frappe.model.bean import getlist -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +from frappe.model.document import Document + +class PackedItem(Document): def get_sales_bom_items(item_code): return frappe.db.sql("""select t1.item_code, t1.qty, t1.uom @@ -39,7 +38,7 @@ def update_packing_list_item(obj, packing_item_code, qty, warehouse, line, packi break if not exists: - pi = addchild(obj.doc, 'packing_details', 'Packed Item', obj.doclist) + pi = obj.doc.append('packing_details', {}) pi.parent_item = line.item_code pi.item_code = packing_item_code @@ -81,7 +80,7 @@ def make_packing_list(obj, item_table_fieldname): def cleanup_packing_list(obj, parent_items): """Remove all those child items which are no longer present in main item table""" delete_list = [] - for d in obj.doclist.get({"parentfield": "packing_details"}): + for d in obj.get("packing_details"): if [d.parent_item, d.parent_detail_docname] not in parent_items: # mark for deletion from doclist delete_list.append([d.parent_item, d.parent_detail_docname]) diff --git a/erpnext/stock/doctype/packing_slip/packing_slip.py b/erpnext/stock/doctype/packing_slip/packing_slip.py index b7b6473203..99a6ee3ee6 100644 --- a/erpnext/stock/doctype/packing_slip/packing_slip.py +++ b/erpnext/stock/doctype/packing_slip/packing_slip.py @@ -5,11 +5,10 @@ from __future__ import unicode_literals import frappe from frappe.utils import flt, cint from frappe import msgprint, _ -from frappe.model.doc import addchild -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +from frappe.model.document import Document + +class PackingSlip(Document): def validate(self): """ @@ -36,7 +35,7 @@ class DocType: msgprint(_("""Invalid Delivery Note. Delivery Note should exist and should be in draft state. Please rectify and try again."""), raise_exception=1) def validate_items_mandatory(self): - rows = [d.item_code for d in self.doclist.get({"parentfield": "item_details"})] + rows = [d.item_code for d in self.get("item_details")] if not rows: frappe.msgprint(_("No Items to Pack"), raise_exception=1) @@ -87,7 +86,7 @@ class DocType: * No. of Cases of this packing slip """ - rows = [d.item_code for d in self.doclist.get({"parentfield": "item_details"})] + rows = [d.item_code for d in self.get("item_details")] condition = "" if rows: @@ -132,7 +131,7 @@ class DocType: if not self.doc.from_case_no: self.doc.from_case_no = self.get_recommended_case_no() - for d in self.doclist.get({"parentfield": "item_details"}): + for d in self.get("item_details"): res = frappe.db.get_value("Item", d.item_code, ["net_weight", "weight_uom"], as_dict=True) @@ -151,12 +150,12 @@ class DocType: return cint(recommended_case_no[0][0]) + 1 def get_items(self): - self.doclist = self.doc.clear_table(self.doclist, "item_details", 1) + self.set("item_details", []) dn_details = self.get_details_for_packing()[0] for item in dn_details: if flt(item.qty) > flt(item.packed_qty): - ch = addchild(self.doc, 'item_details', 'Packing Slip Item', self.doclist) + ch = self.doc.append('item_details', {}) ch.item_code = item.item_code ch.item_name = item.item_name ch.stock_uom = item.stock_uom diff --git a/erpnext/stock/doctype/packing_slip_item/packing_slip_item.py b/erpnext/stock/doctype/packing_slip_item/packing_slip_item.py index 968a25b613..033e44b13c 100644 --- a/erpnext/stock/doctype/packing_slip_item/packing_slip_item.py +++ b/erpnext/stock/doctype/packing_slip_item/packing_slip_item.py @@ -6,6 +6,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class PackingSlipItem(Document): + pass \ No newline at end of file diff --git a/erpnext/stock/doctype/price_list/price_list.py b/erpnext/stock/doctype/price_list/price_list.py index 37b956763e..420c6c5ffc 100644 --- a/erpnext/stock/doctype/price_list/price_list.py +++ b/erpnext/stock/doctype/price_list/price_list.py @@ -8,12 +8,12 @@ from frappe.utils import cint from frappe.model.controller import DocListController import frappe.defaults -class DocType(DocListController): +class PriceList(DocListController): def validate(self): if not cint(self.doc.buying) and not cint(self.doc.selling): throw(_("Price List must be applicable for Buying or Selling")) - if not self.doclist.get({"parentfield": "valid_for_territories"}): + if not self.get("valid_for_territories"): # if no territory, set default territory if frappe.defaults.get_user_default("territory"): self.doclist.append({ diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py index d1e86a8521..bad59a6d86 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py @@ -12,10 +12,7 @@ import frappe.defaults from erpnext.stock.utils import update_bin from erpnext.controllers.buying_controller import BuyingController -class DocType(BuyingController): - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist +class PurchaseReceipt(BuyingController): self.tname = 'Purchase Receipt Item' self.fname = 'purchase_receipt_details' self.count = 0 @@ -35,7 +32,7 @@ class DocType(BuyingController): billed_qty = frappe.db.sql("""select sum(ifnull(qty, 0)) from `tabPurchase Invoice Item` where purchase_receipt=%s""", self.doc.name) if billed_qty: - total_qty = sum((item.qty for item in self.doclist.get({"parentfield": "purchase_receipt_details"}))) + total_qty = sum((item.qty for item in self.get("purchase_receipt_details"))) self.doc.fields["__billing_complete"] = billed_qty[0][0] == total_qty def validate(self): @@ -68,7 +65,7 @@ class DocType(BuyingController): self.update_valuation_rate("purchase_receipt_details") def validate_rejected_warehouse(self): - for d in self.doclist.get({"parentfield": "purchase_receipt_details"}): + for d in self.get("purchase_receipt_details"): if flt(d.rejected_qty) and not d.rejected_warehouse: d.rejected_warehouse = self.doc.rejected_warehouse if not d.rejected_warehouse: @@ -76,7 +73,7 @@ class DocType(BuyingController): # validate accepted and rejected qty def validate_accepted_rejected_qty(self): - for d in getlist(self.doclist, "purchase_receipt_details"): + for d in self.get("purchase_receipt_details"): if not flt(d.received_qty) and flt(d.qty): d.received_qty = flt(d.qty) - flt(d.rejected_qty) @@ -129,7 +126,7 @@ class DocType(BuyingController): def po_required(self): if frappe.db.get_value("Buying Settings", None, "po_required") == 'Yes': - for d in getlist(self.doclist,'purchase_receipt_details'): + for d in self.get('purchase_receipt_details'): if not d.prevdoc_docname: msgprint("Purchse Order No. required against item %s"%d.item_code) raise Exception @@ -138,7 +135,7 @@ class DocType(BuyingController): sl_entries = [] stock_items = self.get_stock_items() - for d in getlist(self.doclist, 'purchase_receipt_details'): + for d in self.get('purchase_receipt_details'): if d.item_code in stock_items and d.warehouse: pr_qty = flt(d.qty) * flt(d.conversion_factor) @@ -162,7 +159,7 @@ class DocType(BuyingController): def update_ordered_qty(self): stock_items = self.get_stock_items() - for d in self.doclist.get({"parentfield": "purchase_receipt_details"}): + for d in self.get("purchase_receipt_details"): if d.item_code in stock_items and d.warehouse \ and cstr(d.prevdoc_doctype) == 'Purchase Order': @@ -198,7 +195,7 @@ class DocType(BuyingController): return po_qty, po_warehouse def bk_flush_supp_wh(self, sl_entries): - for d in getlist(self.doclist, 'pr_raw_material_details'): + for d in self.get('pr_raw_material_details'): # negative quantity is passed as raw material qty has to be decreased # when PR is submitted and it has to be increased when PR is cancelled sl_entries.append(self.get_sl_entries(d, { @@ -209,7 +206,7 @@ class DocType(BuyingController): })) def validate_inspection(self): - for d in getlist(self.doclist, 'purchase_receipt_details'): #Enter inspection date for all items that require inspection + for d in self.get('purchase_receipt_details'): #Enter inspection date for all items that require inspection ins_reqd = frappe.db.sql("select inspection_required from `tabItem` where name = %s", (d.item_code,), as_dict = 1) ins_reqd = ins_reqd and ins_reqd[0]['inspection_required'] or 'No' @@ -219,7 +216,7 @@ class DocType(BuyingController): # Check for Stopped status def check_for_stopped_status(self, pc_obj): check_list =[] - for d in getlist(self.doclist, 'purchase_receipt_details'): + for d in self.get('purchase_receipt_details'): if d.fields.has_key('prevdoc_docname') and d.prevdoc_docname and d.prevdoc_docname not in check_list: check_list.append(d.prevdoc_docname) pc_obj.check_for_stopped_status( d.prevdoc_doctype, d.prevdoc_docname) @@ -282,7 +279,7 @@ class DocType(BuyingController): self.make_cancel_gl_entries() def get_current_stock(self): - for d in getlist(self.doclist, 'pr_raw_material_details'): + for d in self.get('pr_raw_material_details'): if self.doc.supplier_warehouse: bin = frappe.db.sql("select actual_qty from `tabBin` where item_code = %s and warehouse = %s", (d.rm_item_code, self.doc.supplier_warehouse), as_dict = 1) d.current_stock = bin and flt(bin[0]['actual_qty']) or 0 diff --git a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py index 862bd846f8..2a2e821745 100644 --- a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py @@ -95,7 +95,7 @@ class TestPurchaseReceipt(unittest.TestCase): pr.insert() self.assertEquals(pr.doclist[1].rm_supp_cost, 70000.0) - self.assertEquals(len(pr.doclist.get({"parentfield": "pr_raw_material_details"})), 2) + self.assertEquals(len(pr.get("pr_raw_material_details")), 2) def test_serial_no_supplier(self): pr = frappe.bean(copy=test_records[0]) diff --git a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.py b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.py index 26c87f1c04..35fca0d6c5 100644 --- a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.py +++ b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class PurchaseReceiptItem(Document): + pass \ No newline at end of file diff --git a/erpnext/stock/doctype/serial_no/serial_no.py b/erpnext/stock/doctype/serial_no/serial_no.py index d52d48dd8d..d8bdb77142 100644 --- a/erpnext/stock/doctype/serial_no/serial_no.py +++ b/erpnext/stock/doctype/serial_no/serial_no.py @@ -20,7 +20,7 @@ class SerialNoStatusError(ValidationError): pass class SerialNoNotExistsError(ValidationError): pass class SerialNoDuplicateError(ValidationError): pass -class DocType(StockController): +class SerialNo(StockController): def __init__(self, doc, doclist=None): self.doc = doc self.doclist = doclist or [] diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index 3aeb507873..785ad9787b 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -6,7 +6,6 @@ import frappe import frappe.defaults from frappe.utils import cstr, cint, flt, comma_or, nowdate -from frappe.model.doc import addchild from frappe.model.bean import getlist from frappe.model.code import get_obj from frappe import msgprint, _ @@ -24,10 +23,7 @@ class StockOverProductionError(frappe.ValidationError): pass from erpnext.controllers.stock_controller import StockController -class DocType(StockController): - def __init__(self, doc, doclist=None): - self.doc = doc - self.doclist = doclist +class StockEntry(StockController): self.fname = 'mtn_details' def validate(self): @@ -77,7 +73,7 @@ class DocType(StockController): def validate_item(self): stock_items = self.get_stock_items() - for item in self.doclist.get({"parentfield": "mtn_details"}): + for item in self.get("mtn_details"): if item.item_code not in stock_items: msgprint(_("""Only Stock Items are allowed for Stock Entry"""), raise_exception=True) @@ -93,14 +89,14 @@ class DocType(StockController): if self.doc.purpose in source_mandatory and self.doc.purpose not in target_mandatory: self.doc.to_warehouse = None - for d in getlist(self.doclist, 'mtn_details'): + for d in self.get('mtn_details'): d.t_warehouse = None elif self.doc.purpose in target_mandatory and self.doc.purpose not in source_mandatory: self.doc.from_warehouse = None - for d in getlist(self.doclist, 'mtn_details'): + for d in self.get('mtn_details'): d.s_warehouse = None - for d in getlist(self.doclist, 'mtn_details'): + for d in self.get('mtn_details'): if not d.s_warehouse and not d.t_warehouse: d.s_warehouse = self.doc.from_warehouse d.t_warehouse = self.doc.to_warehouse @@ -176,11 +172,11 @@ class DocType(StockController): + self.doc.production_order + ":" + ", ".join(other_ste), DuplicateEntryForProductionOrderError) def set_total_amount(self): - self.doc.total_amount = sum([flt(item.amount) for item in self.doclist.get({"parentfield": "mtn_details"})]) + self.doc.total_amount = sum([flt(item.amount) for item in self.get("mtn_details")]) def get_stock_and_rate(self): """get stock and incoming rate on posting date""" - for d in getlist(self.doclist, 'mtn_details'): + for d in self.get('mtn_details'): args = frappe._dict({ "item_code": d.item_code, "warehouse": d.s_warehouse or d.t_warehouse, @@ -225,12 +221,12 @@ class DocType(StockController): return incoming_rate def validate_incoming_rate(self): - for d in getlist(self.doclist, 'mtn_details'): + for d in self.get('mtn_details'): if d.t_warehouse: self.validate_value("incoming_rate", ">", 0, d, raise_exception=IncorrectValuationRateError) def validate_bom(self): - for d in getlist(self.doclist, 'mtn_details'): + for d in self.get('mtn_details'): if d.bom_no and not frappe.db.sql("""select name from `tabBOM` where item = %s and name = %s and docstatus = 1 and is_active = 1""", (d.item_code, d.bom_no)): @@ -240,7 +236,7 @@ class DocType(StockController): def validate_finished_goods(self): """validation: finished good quantity should be same as manufacturing quantity""" - for d in getlist(self.doclist, 'mtn_details'): + for d in self.get('mtn_details'): if d.bom_no and flt(d.transfer_qty) != flt(self.doc.fg_completed_qty): msgprint(_("Row #") + " %s: " % d.idx + _("Quantity should be equal to Manufacturing Quantity. To fetch items again, click on 'Get Items' button or update the Quantity manually."), raise_exception=1) @@ -275,7 +271,7 @@ class DocType(StockController): stock_items = get_stock_items_for_return(ref.doclist, ref.parentfields) already_returned_item_qty = self.get_already_returned_item_qty(ref.fieldname) - for item in self.doclist.get({"parentfield": "mtn_details"}): + for item in self.get("mtn_details"): # validate if item exists in the ref doclist and that it is a stock item if item.item_code not in stock_items: msgprint(_("Item") + ': "' + item.item_code + _("\" does not exist in ") + @@ -303,7 +299,7 @@ class DocType(StockController): def update_stock_ledger(self): sl_entries = [] - for d in getlist(self.doclist, 'mtn_details'): + for d in self.get('mtn_details'): if cstr(d.s_warehouse) and self.doc.docstatus == 1: sl_entries.append(self.get_sl_entries(d, { "warehouse": cstr(d.s_warehouse), @@ -431,7 +427,7 @@ class DocType(StockController): def get_items(self): self.doclist = filter(lambda d: d.parentfield!="mtn_details", self.doclist) - # self.doclist = self.doc.clear_table(self.doclist, 'mtn_details') + # self.set('mtn_details', []) pro_obj = None if self.doc.production_order: @@ -566,8 +562,7 @@ class DocType(StockController): ["default_expense_account", "cost_center"])[0] for d in item_dict: - se_child = addchild(self.doc, 'mtn_details', 'Stock Entry Detail', - self.doclist) + se_child = self.doc.append('mtn_details', {}) se_child.idx = idx se_child.s_warehouse = item_dict[d].get("from_warehouse", self.doc.from_warehouse) se_child.t_warehouse = item_dict[d].get("to_warehouse", self.doc.to_warehouse) @@ -592,7 +587,7 @@ class DocType(StockController): return idx def validate_with_material_request(self): - for item in self.doclist.get({"parentfield": "mtn_details"}): + for item in self.get("mtn_details"): if item.material_request: mreq_item = frappe.db.get_value("Material Request Item", {"name": item.material_request_item, "parent": item.material_request}, @@ -801,7 +796,7 @@ def make_return_jv_from_sales_invoice(se, ref): # income account entries children = [] - for se_item in se.doclist.get({"parentfield": "mtn_details"}): + for se_item in se.get("mtn_details"): # find item in ref.doclist ref_item = ref.doclist.getone({"item_code": se_item.item_code}) @@ -843,7 +838,7 @@ def make_return_jv_from_delivery_note(se, ref): parent = {} children = [] - for se_item in se.doclist.get({"parentfield": "mtn_details"}): + for se_item in se.get("mtn_details"): for sales_invoice in invoices_against_delivery: si = frappe.bean("Sales Invoice", sales_invoice) @@ -900,7 +895,7 @@ def make_return_jv_from_purchase_receipt(se, ref): parent = {} children = [] - for se_item in se.doclist.get({"parentfield": "mtn_details"}): + for se_item in se.get("mtn_details"): for purchase_invoice in invoice_against_receipt: pi = frappe.bean("Purchase Invoice", purchase_invoice) ref_item = pi.doclist.get({"item_code": se_item.item_code}) diff --git a/erpnext/stock/doctype/stock_entry/test_stock_entry.py b/erpnext/stock/doctype/stock_entry/test_stock_entry.py index d14e896fb0..dc27cc9fcc 100644 --- a/erpnext/stock/doctype/stock_entry/test_stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/test_stock_entry.py @@ -335,7 +335,7 @@ class TestStockEntry(unittest.TestCase): si = frappe.bean(si_doclist) si.doc.posting_date = dn.doc.posting_date si.doc.debit_to = "_Test Customer - _TC" - for d in si.doclist.get({"parentfield": "entries"}): + for d in si.get("entries"): d.income_account = "Sales - _TC" d.cost_center = "_Test Cost Center - _TC" si.insert() @@ -433,7 +433,7 @@ class TestStockEntry(unittest.TestCase): si = frappe.bean(si_doclist) si.doc.posting_date = dn.doc.posting_date si.doc.debit_to = "_Test Customer - _TC" - for d in si.doclist.get({"parentfield": "entries"}): + for d in si.get("entries"): d.income_account = "Sales - _TC" d.cost_center = "_Test Cost Center - _TC" si.insert() @@ -479,11 +479,11 @@ class TestStockEntry(unittest.TestCase): pi = frappe.bean(pi_doclist) pi.doc.posting_date = pr.doc.posting_date pi.doc.credit_to = "_Test Supplier - _TC" - for d in pi.doclist.get({"parentfield": "entries"}): + for d in pi.get("entries"): d.expense_account = "_Test Account Cost for Goods Sold - _TC" d.cost_center = "_Test Cost Center - _TC" - for d in pi.doclist.get({"parentfield": "other_charges"}): + for d in pi.get("other_charges"): d.cost_center = "_Test Cost Center - _TC" pi.run_method("calculate_taxes_and_totals") @@ -582,10 +582,10 @@ class TestStockEntry(unittest.TestCase): pi = frappe.bean(pi_doclist) pi.doc.posting_date = pr.doc.posting_date pi.doc.credit_to = "_Test Supplier - _TC" - for d in pi.doclist.get({"parentfield": "entries"}): + for d in pi.get("entries"): d.expense_account = "_Test Account Cost for Goods Sold - _TC" d.cost_center = "_Test Cost Center - _TC" - for d in pi.doclist.get({"parentfield": "other_charges"}): + for d in pi.get("other_charges"): d.cost_center = "_Test Cost Center - _TC" pi.run_method("calculate_taxes_and_totals") diff --git a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.py b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.py index 26c87f1c04..2570b68018 100644 --- a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.py +++ b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class StockEntryDetail(Document): + pass \ No newline at end of file diff --git a/erpnext/stock/doctype/stock_ledger/stock_ledger.py b/erpnext/stock/doctype/stock_ledger/stock_ledger.py index 664eadbd81..452ad35879 100644 --- a/erpnext/stock/doctype/stock_ledger/stock_ledger.py +++ b/erpnext/stock/doctype/stock_ledger/stock_ledger.py @@ -12,10 +12,9 @@ from frappe import session, msgprint from erpnext.stock.utils import get_valid_serial_nos -class DocType: - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist +from frappe.model.document import Document + +class StockLedger(Document): def update_stock(self, values, is_amended = 'No'): for v in values: diff --git a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py index 9bb991175a..dfc75d5b1a 100644 --- a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py +++ b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py @@ -11,10 +11,7 @@ from datetime import date class StockFreezeError(frappe.ValidationError): pass -class DocType(DocListController): - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist +class StockLedgerEntry(DocListController): def validate(self): from erpnext.stock.utils import validate_warehouse_company diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py index 7eef0a43e7..c4195c61d5 100644 --- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py @@ -10,7 +10,7 @@ from frappe.utils import cstr, flt, cint from erpnext.stock.stock_ledger import update_entries_after from erpnext.controllers.stock_controller import StockController -class DocType(StockController): +class StockReconciliation(StockController): def setup(self): self.head_row = ["Item Code", "Warehouse", "Quantity", "Valuation Rate"] self.entries = [] diff --git a/erpnext/stock/doctype/stock_settings/stock_settings.py b/erpnext/stock/doctype/stock_settings/stock_settings.py index 7f03bb1b1e..cb266ed434 100644 --- a/erpnext/stock/doctype/stock_settings/stock_settings.py +++ b/erpnext/stock/doctype/stock_settings/stock_settings.py @@ -7,9 +7,9 @@ from __future__ import unicode_literals import frappe from frappe import _ -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +from frappe.model.document import Document + +class StockSettings(Document): def validate(self): for key in ["item_naming_by", "item_group", "stock_uom", diff --git a/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.py b/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.py index 8ff893872c..62c80d2e60 100644 --- a/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.py +++ b/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.py @@ -7,7 +7,9 @@ from frappe.utils import cstr, flt, cint from frappe import msgprint, _ -class DocType: +from frappe.model.document import Document + +class StockUomReplaceUtility(Document): def __init__(self, d, dl=[]): self.doc, self.doclist = d,dl diff --git a/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.py b/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.py index 26c87f1c04..00cd84765a 100644 --- a/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.py +++ b/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class UomConversionDetail(Document): + pass \ No newline at end of file diff --git a/erpnext/stock/doctype/warehouse/warehouse.py b/erpnext/stock/doctype/warehouse/warehouse.py index 8ec62351a0..d098cfe576 100644 --- a/erpnext/stock/doctype/warehouse/warehouse.py +++ b/erpnext/stock/doctype/warehouse/warehouse.py @@ -6,10 +6,9 @@ import frappe from frappe.utils import cint, validate_email_add from frappe import throw, msgprint, _ -class DocType: - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist +from frappe.model.document import Document + +class Warehouse(Document): def autoname(self): suffix = " - " + frappe.db.get_value("Company", self.doc.company, "abbr") diff --git a/erpnext/stock/doctype/warehouse_user/warehouse_user.py b/erpnext/stock/doctype/warehouse_user/warehouse_user.py index 968a25b613..59bfefe3b1 100644 --- a/erpnext/stock/doctype/warehouse_user/warehouse_user.py +++ b/erpnext/stock/doctype/warehouse_user/warehouse_user.py @@ -6,6 +6,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class WarehouseUser(Document): + pass \ No newline at end of file diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index 39d494c69a..8bfc083629 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -138,7 +138,7 @@ def get_basic_details(args, item_bean): if args.transaction_type == "selling" else item.buying_cost_center, "batch_no": None, "item_tax_rate": json.dumps(dict(([d.tax_type, d.tax_rate] for d in - item_bean.doclist.get({"parentfield": "item_tax"})))), + item_bean.get("item_tax")))), "uom": item.stock_uom, "min_order_qty": flt(item.min_order_qty) if args.doctype == "Material Request" else "", "conversion_factor": 1.0, diff --git a/erpnext/stock/utils.py b/erpnext/stock/utils.py index 3a0766aca8..e5099c46e2 100644 --- a/erpnext/stock/utils.py +++ b/erpnext/stock/utils.py @@ -299,7 +299,7 @@ def send_email_notification(mr_list): for mr in mr_list: msg += "

" + mr.doc.name + """

""" - for item in mr.doclist.get({"parentfield": "indent_details"}): + for item in mr.get("indent_details"): msg += "" msg += "
Item CodeWarehouseQtyUOM
" + item.item_code + "" + item.warehouse + "" + \ cstr(item.qty) + "" + cstr(item.uom) + "
" diff --git a/erpnext/support/doctype/customer_issue/customer_issue.py b/erpnext/support/doctype/customer_issue/customer_issue.py index 128accd144..406ea61529 100644 --- a/erpnext/support/doctype/customer_issue/customer_issue.py +++ b/erpnext/support/doctype/customer_issue/customer_issue.py @@ -11,10 +11,7 @@ from frappe.utils import today from erpnext.utilities.transaction_base import TransactionBase -class DocType(TransactionBase): - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist +class CustomerIssue(TransactionBase): def validate(self): if session['user'] != 'Guest' and not self.doc.customer: diff --git a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py index 2fcd200493..9f7aef13c1 100644 --- a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py +++ b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py @@ -5,16 +5,12 @@ from __future__ import unicode_literals import frappe from frappe.utils import add_days, cstr, getdate, cint -from frappe.model.doc import addchild from frappe.model.bean import getlist from frappe import throw, _ from erpnext.utilities.transaction_base import TransactionBase, delete_events from erpnext.stock.utils import get_valid_serial_nos -class DocType(TransactionBase): - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist +class MaintenanceSchedule(TransactionBase): def get_item_details(self, item_code): item = frappe.db.sql("""select item_name, description from `tabItem` @@ -26,17 +22,16 @@ class DocType(TransactionBase): return ret def generate_schedule(self): - self.doclist = self.doc.clear_table(self.doclist, 'maintenance_schedule_detail') + self.set('maintenance_schedule_detail', []) frappe.db.sql("""delete from `tabMaintenance Schedule Detail` where parent=%s""", (self.doc.name)) count = 1 - for d in getlist(self.doclist, 'item_maintenance_detail'): + for d in self.get('item_maintenance_detail'): self.validate_maintenance_detail() s_list = [] s_list = self.create_schedule_list(d.start_date, d.end_date, d.no_of_visits, d.sales_person) for i in range(d.no_of_visits): - child = addchild(self.doc, 'maintenance_schedule_detail', - 'Maintenance Schedule Detail', self.doclist) + child = self.append('maintenance_schedule_detail') child.item_code = d.item_code child.item_name = d.item_name child.scheduled_date = s_list[i].strftime('%Y-%m-%d') @@ -50,13 +45,13 @@ class DocType(TransactionBase): self.on_update() def on_submit(self): - if not getlist(self.doclist, 'maintenance_schedule_detail'): + if not self.get('maintenance_schedule_detail'): throw("Please click on 'Generate Schedule' to get schedule") self.check_serial_no_added() self.validate_schedule() email_map = {} - for d in getlist(self.doclist, 'item_maintenance_detail'): + for d in self.get('item_maintenance_detail'): if d.serial_no: serial_nos = get_valid_serial_nos(d.serial_no) self.validate_serial_no(serial_nos, d.start_date) @@ -174,10 +169,10 @@ class DocType(TransactionBase): return ret def validate_maintenance_detail(self): - if not getlist(self.doclist, 'item_maintenance_detail'): + if not self.get('item_maintenance_detail'): throw(_("Please enter Maintaince Details first")) - for d in getlist(self.doclist, 'item_maintenance_detail'): + for d in self.get('item_maintenance_detail'): if not d.item_code: throw(_("Please select item code")) elif not d.start_date or not d.end_date: @@ -191,7 +186,7 @@ class DocType(TransactionBase): throw(_("Start date should be less than end date for item") + " " + d.item_code) def validate_sales_order(self): - for d in getlist(self.doclist, 'item_maintenance_detail'): + for d in self.get('item_maintenance_detail'): if d.prevdoc_docname: chk = frappe.db.sql("""select ms.name from `tabMaintenance Schedule` ms, `tabMaintenance Schedule Item` msi where msi.parent=ms.name and @@ -233,11 +228,11 @@ class DocType(TransactionBase): def validate_schedule(self): item_lst1 =[] item_lst2 =[] - for d in getlist(self.doclist, 'item_maintenance_detail'): + for d in self.get('item_maintenance_detail'): if d.item_code not in item_lst1: item_lst1.append(d.item_code) - for m in getlist(self.doclist, 'maintenance_schedule_detail'): + for m in self.get('maintenance_schedule_detail'): if m.item_code not in item_lst2: item_lst2.append(m.item_code) @@ -252,17 +247,17 @@ class DocType(TransactionBase): def check_serial_no_added(self): serial_present =[] - for d in getlist(self.doclist, 'item_maintenance_detail'): + for d in self.get('item_maintenance_detail'): if d.serial_no: serial_present.append(d.item_code) - for m in getlist(self.doclist, 'maintenance_schedule_detail'): + for m in self.get('maintenance_schedule_detail'): if serial_present: if m.item_code in serial_present and not m.serial_no: throw("Please click on 'Generate Schedule' to fetch serial no added for item "+m.item_code) def on_cancel(self): - for d in getlist(self.doclist, 'item_maintenance_detail'): + for d in self.get('item_maintenance_detail'): if d.serial_no: serial_nos = get_valid_serial_nos(d.serial_no) self.update_amc_date(serial_nos) diff --git a/erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.py b/erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.py index 26c87f1c04..8c15d32c83 100644 --- a/erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.py +++ b/erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class MaintenanceScheduleDetail(Document): + pass \ No newline at end of file diff --git a/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.py b/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.py index 26c87f1c04..47000c126a 100644 --- a/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.py +++ b/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class MaintenanceScheduleItem(Document): + pass \ No newline at end of file diff --git a/erpnext/support/doctype/maintenance_visit/maintenance_visit.py b/erpnext/support/doctype/maintenance_visit/maintenance_visit.py index 1ddf67be6c..234756bf9a 100644 --- a/erpnext/support/doctype/maintenance_visit/maintenance_visit.py +++ b/erpnext/support/doctype/maintenance_visit/maintenance_visit.py @@ -12,29 +12,26 @@ from frappe import msgprint from erpnext.utilities.transaction_base import TransactionBase -class DocType(TransactionBase): - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist +class MaintenanceVisit(TransactionBase): def get_item_details(self, item_code): return frappe.db.get_value("Item", item_code, ["item_name", "description"], as_dict=1) def validate_serial_no(self): - for d in getlist(self.doclist, 'maintenance_visit_details'): + for d in self.get('maintenance_visit_details'): if d.serial_no and not frappe.db.exists("Serial No", d.serial_no): frappe.throw("Serial No: "+ d.serial_no + " not exists in the system") def validate(self): - if not getlist(self.doclist, 'maintenance_visit_details'): + if not self.get('maintenance_visit_details'): msgprint("Please enter maintenance details") raise Exception self.validate_serial_no() def update_customer_issue(self, flag): - for d in getlist(self.doclist, 'maintenance_visit_details'): + for d in self.get('maintenance_visit_details'): if d.prevdoc_docname and d.prevdoc_doctype == 'Customer Issue' : if flag==1: mntc_date = self.doc.mntc_date @@ -64,7 +61,7 @@ class DocType(TransactionBase): def check_if_last_visit(self): """check if last maintenance visit against same sales order/ customer issue""" check_for_docname = check_for_doctype = None - for d in getlist(self.doclist, 'maintenance_visit_details'): + for d in self.get('maintenance_visit_details'): if d.prevdoc_docname: check_for_docname = d.prevdoc_docname check_for_doctype = d.prevdoc_doctype diff --git a/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.py b/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.py index 26c87f1c04..ac30b7a90e 100644 --- a/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.py +++ b/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class MaintenanceVisitPurpose(Document): + pass \ No newline at end of file diff --git a/erpnext/support/doctype/newsletter/newsletter.py b/erpnext/support/doctype/newsletter/newsletter.py index 72d05aff28..7ede45c035 100644 --- a/erpnext/support/doctype/newsletter/newsletter.py +++ b/erpnext/support/doctype/newsletter/newsletter.py @@ -7,10 +7,9 @@ import frappe import frappe.utils from frappe.utils import cstr from frappe import msgprint, throw, _ +from frappe.model.document import Document -class DocType(): - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +class Newsletter(Document): def onload(self): if self.doc.email_sent: diff --git a/erpnext/support/doctype/support_email_settings/support_email_settings.py b/erpnext/support/doctype/support_email_settings/support_email_settings.py index 203bf72d51..65edf23940 100644 --- a/erpnext/support/doctype/support_email_settings/support_email_settings.py +++ b/erpnext/support/doctype/support_email_settings/support_email_settings.py @@ -6,9 +6,9 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +from frappe.model.document import Document + +class SupportEmailSettings(Document): def validate(self): """ diff --git a/erpnext/support/doctype/support_ticket/support_ticket.py b/erpnext/support/doctype/support_ticket/support_ticket.py index 57d141ea01..a01dad3814 100644 --- a/erpnext/support/doctype/support_ticket/support_ticket.py +++ b/erpnext/support/doctype/support_ticket/support_ticket.py @@ -7,10 +7,7 @@ import frappe from erpnext.utilities.transaction_base import TransactionBase from frappe.utils import now, extract_email_id -class DocType(TransactionBase): - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist +class SupportTicket(TransactionBase): def get_sender(self, comm): return frappe.db.get_value('Support Email Settings',None,'support_email') diff --git a/erpnext/utilities/doctype/address/address.py b/erpnext/utilities/doctype/address/address.py index b80f13a337..b698658eac 100644 --- a/erpnext/utilities/doctype/address/address.py +++ b/erpnext/utilities/doctype/address/address.py @@ -7,10 +7,9 @@ import frappe from frappe import msgprint, throw, _ from frappe.utils import cstr, cint -class DocType: - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist +from frappe.model.document import Document + +class Address(Document): def autoname(self): if not self.doc.address_title: diff --git a/erpnext/utilities/doctype/contact/contact.py b/erpnext/utilities/doctype/contact/contact.py index 948b753fcd..16522a85eb 100644 --- a/erpnext/utilities/doctype/contact/contact.py +++ b/erpnext/utilities/doctype/contact/contact.py @@ -7,10 +7,7 @@ from frappe.utils import cstr, extract_email_id from erpnext.controllers.status_updater import StatusUpdater -class DocType(StatusUpdater): - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist +class Contact(StatusUpdater): def autoname(self): # concat first and last name diff --git a/erpnext/utilities/doctype/note/note.py b/erpnext/utilities/doctype/note/note.py index 99846d9f9b..8936da77a9 100644 --- a/erpnext/utilities/doctype/note/note.py +++ b/erpnext/utilities/doctype/note/note.py @@ -6,9 +6,9 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +from frappe.model.document import Document + +class Note(Document): def autoname(self): # replace forbidden characters diff --git a/erpnext/utilities/doctype/note_user/note_user.py b/erpnext/utilities/doctype/note_user/note_user.py index 968a25b613..1594f787ca 100644 --- a/erpnext/utilities/doctype/note_user/note_user.py +++ b/erpnext/utilities/doctype/note_user/note_user.py @@ -6,6 +6,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class NoteUser(Document): + pass \ No newline at end of file diff --git a/erpnext/utilities/doctype/rename_tool/rename_tool.py b/erpnext/utilities/doctype/rename_tool/rename_tool.py index 835e6471e7..7ee46df645 100644 --- a/erpnext/utilities/doctype/rename_tool/rename_tool.py +++ b/erpnext/utilities/doctype/rename_tool/rename_tool.py @@ -7,9 +7,9 @@ from __future__ import unicode_literals import frappe from frappe import _ -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl +from frappe.model.document import Document + +class RenameTool(Document): @frappe.whitelist() def get_doctypes(): diff --git a/erpnext/utilities/doctype/sms_control/sms_control.py b/erpnext/utilities/doctype/sms_control/sms_control.py index 832c443a8d..b160ad9139 100644 --- a/erpnext/utilities/doctype/sms_control/sms_control.py +++ b/erpnext/utilities/doctype/sms_control/sms_control.py @@ -10,10 +10,9 @@ from frappe.model.doc import Document from frappe import msgprint, throw, _ from frappe.model.bean import getlist -class DocType: - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist +from frappe.model.document import Document + +class SmsControl(Document): def validate_receiver_nos(self,receiver_list): validated_receiver_list = [] diff --git a/erpnext/utilities/doctype/sms_log/sms_log.py b/erpnext/utilities/doctype/sms_log/sms_log.py index 26c87f1c04..573054e66e 100644 --- a/erpnext/utilities/doctype/sms_log/sms_log.py +++ b/erpnext/utilities/doctype/sms_log/sms_log.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals import frappe -class DocType: - def __init__(self, d, dl): - self.doc, self.doclist = d, dl \ No newline at end of file +from frappe.model.document import Document + +class SmsLog(Document): + pass From e88bc8b12afd4a78667bc9210e99263c16d0af08 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 27 Mar 2014 17:51:41 +0530 Subject: [PATCH 04/42] frappe/frappe#478 --- .../journal_voucher/journal_voucher.py | 15 +++-------- .../purchase_invoice/test_purchase_invoice.py | 4 +-- .../doctype/sales_invoice/sales_invoice.py | 8 +----- .../sales_invoice/test_sales_invoice.py | 25 ++++++++----------- erpnext/accounts/utils.py | 2 +- erpnext/buying/doctype/supplier/supplier.py | 2 +- erpnext/controllers/accounts_controller.py | 17 ++++--------- erpnext/controllers/buying_controller.py | 3 +-- erpnext/controllers/selling_controller.py | 3 +-- erpnext/home/__init__.py | 5 ++-- erpnext/hr/doctype/employee/employee.py | 2 +- .../hr/doctype/holiday_list/holiday_list.py | 2 +- .../test_leave_application.py | 3 +-- .../leave_control_panel.py | 16 +++++------- erpnext/hr/doctype/salary_slip/salary_slip.py | 2 +- .../salary_structure/salary_structure.py | 2 +- .../upload_attendance/upload_attendance.py | 4 +-- .../production_planning_tool.py | 14 +++++------ erpnext/patches/4_0/update_user_properties.py | 2 +- .../doctype/time_log/test_time_log.py | 2 +- erpnext/selling/doctype/customer/customer.py | 7 +++--- .../doctype/sales_order/test_sales_order.py | 6 ++--- .../page/sales_browser/sales_browser.py | 3 +-- erpnext/setup/doctype/company/company.py | 6 ++--- .../doctype/naming_series/naming_series.py | 11 ++++---- erpnext/stock/doctype/item/item.py | 4 +-- .../material_request/material_request.py | 2 +- .../stock/doctype/price_list/price_list.py | 3 +-- erpnext/stock/doctype/serial_no/serial_no.py | 2 +- .../doctype/stock_ledger/stock_ledger.py | 1 - erpnext/stock/get_item_details.py | 2 +- erpnext/stock/stock_ledger.py | 2 +- .../support_email_settings.py | 7 +++--- erpnext/utilities/doctype/address/address.py | 2 +- .../doctype/sms_control/sms_control.py | 5 ++-- erpnext/utilities/transaction_base.py | 9 +++---- 36 files changed, 81 insertions(+), 124 deletions(-) diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher.py b/erpnext/accounts/doctype/journal_voucher/journal_voucher.py index 9884b57da3..5727ed4855 100644 --- a/erpnext/accounts/doctype/journal_voucher/journal_voucher.py +++ b/erpnext/accounts/doctype/journal_voucher/journal_voucher.py @@ -389,19 +389,12 @@ def get_payment_entry(doc): jv.doc.company = doc.company jv.doc.fiscal_year = doc.fiscal_year - jv.doclist.append({ - "doctype": "Journal Voucher Detail", - "parentfield": "entries" - }) + d1 = jv.append("entries") + d2 = jv.append("entries") - jv.doclist.append({ - "doctype": "Journal Voucher Detail", - "parentfield": "entries" - }) - if bank_account: - jv.doclist[2].account = bank_account["account"] - jv.doclist[2].balance = bank_account["balance"] + d2.account = bank_account["account"] + d2.balance = bank_account["balance"] return jv diff --git a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py index 28bd2d183d..c648c37f15 100644 --- a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py @@ -174,9 +174,7 @@ class TestPurchaseInvoice(unittest.TestCase): jv.submit() pi = frappe.bean(copy=test_records[0]) - pi.doclist.append({ - "doctype": "Purchase Invoice Advance", - "parentfield": "advance_allocation_details", + pi.append("advance_allocation_details", { "journal_voucher": jv.doc.name, "jv_detail_no": jv.doclist[1].name, "advance_amount": 400, diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 068d82ce85..c61df0e975 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -9,7 +9,7 @@ from frappe.utils import add_days, cint, cstr, date_diff, flt, getdate, nowdate, get_first_day, get_last_day from frappe.utils import comma_and, get_url -from frappe.model.doc import make_autoname +from frappe.model.naming import make_autoname from frappe.model.bean import getlist from frappe.model.code import get_obj from frappe import _, msgprint @@ -587,12 +587,6 @@ class SalesInvoice(SellingController): invoice_date = %s, territory = %s, net_total = %s, grand_total = %s where invoice_no = %s and parent = %s""", (self.doc.name, self.doc.amended_from, self.doc.c_form_no)) - - @property - def meta(self): - if not hasattr(self, "_meta"): - self._meta = frappe.get_doctype(self.doc.doctype) - return self._meta def validate_recurring_invoice(self): if self.doc.convert_into_recurring_invoice: diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index a4a1f7ba79..1c67e711a3 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -139,16 +139,14 @@ class TestSalesInvoice(unittest.TestCase): def test_sales_invoice_discount_amount(self): si = frappe.bean(copy=test_records[3]) si.doc.discount_amount = 104.95 - si.doclist.append({ + si.append("other_charges", { "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", "charge_type": "On Previous Row Amount", "account_head": "_Test Account Service Tax - _TC", "cost_center": "_Test Cost Center - _TC", "description": "Service Tax", "rate": 10, "row_id": 8, - "idx": 9 }) si.insert() @@ -196,16 +194,14 @@ class TestSalesInvoice(unittest.TestCase): def test_discount_amount_gl_entry(self): si = frappe.bean(copy=test_records[3]) si.doc.discount_amount = 104.95 - si.doclist.append({ + si.append("other_charges", { "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", "charge_type": "On Previous Row Amount", "account_head": "_Test Account Service Tax - _TC", "cost_center": "_Test Cost Center - _TC", "description": "Service Tax", "rate": 10, - "row_id": 8, - "idx": 9 + "row_id": 8 }) si.insert() si.submit() @@ -369,7 +365,7 @@ class TestSalesInvoice(unittest.TestCase): from erpnext.accounts.doctype.journal_voucher.test_journal_voucher \ import test_records as jv_test_records - jv = frappe.bean(frappe.copy_doclist(jv_test_records[0])) + jv = frappe.bean(frappe.copy_doc(jv_test_records[0])) jv.doclist[1].against_invoice = w.doc.name jv.insert() jv.submit() @@ -385,7 +381,7 @@ class TestSalesInvoice(unittest.TestCase): tlb = frappe.bean("Time Log Batch", "_T-Time Log Batch-00001") tlb.submit() - si = frappe.bean(frappe.copy_doclist(test_records[0])) + si = frappe.bean(frappe.copy_doc(test_records[0])) si.doclist[1].time_log_batch = "_T-Time Log Batch-00001" si.insert() si.submit() @@ -444,7 +440,7 @@ class TestSalesInvoice(unittest.TestCase): self._insert_purchase_receipt() self._insert_pos_settings() - pos = frappe.copy_doclist(test_records[1]) + pos = frappe.copy_doc(test_records[1]) pos[0]["is_pos"] = 1 pos[0]["update_stock"] = 1 pos[0]["posting_time"] = "12:05" @@ -510,7 +506,7 @@ class TestSalesInvoice(unittest.TestCase): pr.insert() pr.submit() - si_doclist = frappe.copy_doclist(test_records[1]) + si_doclist = frappe.copy_doc(test_records[1]) si_doclist[0]["update_stock"] = 1 si_doclist[0]["posting_time"] = "12:05" si_doclist[1]["warehouse"] = "_Test Warehouse No Account - _TC" @@ -555,7 +551,7 @@ class TestSalesInvoice(unittest.TestCase): self.clear_stock_account_balance() set_perpetual_inventory() - si_copy = frappe.copy_doclist(test_records[1]) + si_copy = frappe.copy_doc(test_records[1]) si_copy[1]["item_code"] = None si = frappe.bean(si_copy) si.insert() @@ -582,7 +578,7 @@ class TestSalesInvoice(unittest.TestCase): def test_sales_invoice_gl_entry_with_aii_non_stock_item(self): self.clear_stock_account_balance() set_perpetual_inventory() - si_copy = frappe.copy_doclist(test_records[1]) + si_copy = frappe.copy_doc(test_records[1]) si_copy[1]["item_code"] = "_Test Non Stock Item" si = frappe.bean(si_copy) si.insert() @@ -640,9 +636,8 @@ class TestSalesInvoice(unittest.TestCase): jv.submit() si = frappe.bean(copy=test_records[0]) - si.doclist.append({ + si.append("advance_adjustment_details", { "doctype": "Sales Invoice Advance", - "parentfield": "advance_adjustment_details", "journal_voucher": jv.doc.name, "jv_detail_no": jv.doclist[1].name, "advance_amount": 400, diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index 3805ec3468..260344c241 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -242,7 +242,7 @@ def get_company_default(company, fieldname): if not value: throw(_("Please mention default value for '") + - _(frappe.get_doctype("company").get_label(fieldname) + + _(frappe.get_meta("Company").get_label(fieldname) + _("' in Company: ") + company)) return value diff --git a/erpnext/buying/doctype/supplier/supplier.py b/erpnext/buying/doctype/supplier/supplier.py index 44dcd5fd28..0102edca64 100644 --- a/erpnext/buying/doctype/supplier/supplier.py +++ b/erpnext/buying/doctype/supplier/supplier.py @@ -7,7 +7,7 @@ import frappe.defaults from frappe.utils import cint from frappe import msgprint, _ -from frappe.model.doc import make_autoname +from frappe.model.naming import make_autoname from erpnext.accounts.party import create_party_account from erpnext.utilities.transaction_base import TransactionBase diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 35234ce568..3eac80f440 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -121,17 +121,11 @@ class AccountsController(TransactionBase): from frappe.model import default_fields tax_master = frappe.bean(tax_master_doctype, self.doc.fields.get(tax_master_field)) - for i, tax in enumerate(tax_master.doclist.get({"parentfield": tax_parentfield})): + for i, tax in enumerate(tax_master.get(tax_parentfield)): for fieldname in default_fields: - tax.fields[fieldname] = None - - tax.fields.update({ - "doctype": tax_doctype, - "parentfield": tax_parentfield, - "idx": i+1 - }) - - self.doclist.append(tax) + tax.set(fieldname, None) + + self.append(tax_parentfield, tax) def get_other_charges(self): self.set("other_charges", []) @@ -410,9 +404,8 @@ class AccountsController(TransactionBase): self.set(parentfield, []) for d in res: - self.doclist.append({ + self.append(parentfield, { "doctype": child_doctype, - "parentfield": parentfield, "journal_voucher": d.jv_no, "jv_detail_no": d.jv_detail_no, "remarks": d.remark, diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index 655b101a12..6392e58cd4 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -230,7 +230,6 @@ class BuyingController(StockController): for item in bom_items: required_qty = flt(item.qty_consumed_per_unit) * flt(d.qty) * flt(d.conversion_factor) rm_doclist = { - "parentfield": raw_material_table, "doctype": self.doc.doctype + " Item Supplied", "reference_name": d.name, "bom_detail_no": item.name, @@ -248,7 +247,7 @@ class BuyingController(StockController): "description": item.description, }) - self.doclist.append(rm_doclist) + self.append(raw_material_table, rm_doclist) raw_materials_cost += required_qty * flt(item.rate) diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index 5e0ea659f5..a3d140bd1e 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -59,9 +59,8 @@ class SellingController(StockController): shipping_amount = condition.shipping_amount break - self.doclist.append({ + self.append("other_charges", { "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", "charge_type": "Actual", "account_head": shipping_rule.doc.account, "cost_center": shipping_rule.doc.cost_center, diff --git a/erpnext/home/__init__.py b/erpnext/home/__init__.py index 2aae0b0b0c..75fab1c9ea 100644 --- a/erpnext/home/__init__.py +++ b/erpnext/home/__init__.py @@ -59,8 +59,7 @@ feed_dict = { def make_feed(feedtype, doctype, name, owner, subject, color): "makes a new Feed record" #msgprint(subject) - from frappe.model.doc import Document - from frappe.utils import get_fullname + from frappe.utils import get_fullname if feedtype in ('Login', 'Comment', 'Assignment'): # delete old login, comment feed @@ -72,7 +71,7 @@ def make_feed(feedtype, doctype, name, owner, subject, color): where doc_type=%s and doc_name=%s and ifnull(feed_type,'') != 'Comment'""", (doctype, name)) - f = Document('Feed') + f = frappe.get_doc('Feed') f.owner = owner f.feed_type = feedtype f.doc_type = doctype diff --git a/erpnext/hr/doctype/employee/employee.py b/erpnext/hr/doctype/employee/employee.py index aacb2aa44b..d6f1241a21 100644 --- a/erpnext/hr/doctype/employee/employee.py +++ b/erpnext/hr/doctype/employee/employee.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import frappe from frappe.utils import getdate, validate_email_add, cstr, cint -from frappe.model.doc import make_autoname +from frappe.model.naming import make_autoname from frappe import msgprint, throw, _ import frappe.permissions from frappe.defaults import get_restrictions diff --git a/erpnext/hr/doctype/holiday_list/holiday_list.py b/erpnext/hr/doctype/holiday_list/holiday_list.py index c0f1b1b83e..80c14130fa 100644 --- a/erpnext/hr/doctype/holiday_list/holiday_list.py +++ b/erpnext/hr/doctype/holiday_list/holiday_list.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import frappe from frappe.utils import add_days, add_years, cint, getdate -from frappe.model.doc import make_autoname +from frappe.model.naming import make_autoname from frappe import msgprint, throw, _ import datetime diff --git a/erpnext/hr/doctype/leave_application/test_leave_application.py b/erpnext/hr/doctype/leave_application/test_leave_application.py index 30f0cb7db9..cb8f77ef1a 100644 --- a/erpnext/hr/doctype/leave_application/test_leave_application.py +++ b/erpnext/hr/doctype/leave_application/test_leave_application.py @@ -24,9 +24,8 @@ class TestLeaveApplication(unittest.TestCase): temp_session_user = frappe.session.user frappe.set_user("Administrator") employee = frappe.bean("Employee", employee) - employee.doclist.append({ + employee.append("employee_leave_approvers", { "doctype": "Employee Leave Approver", - "parentfield": "employee_leave_approvers", "leave_approver": leave_approver }) employee.save() diff --git a/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py index f3aace2e5c..bf912655ba 100644 --- a/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py +++ b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py @@ -5,7 +5,6 @@ from __future__ import unicode_literals import frappe from frappe.utils import cint, cstr, flt, nowdate -from frappe.model.doc import Document from frappe.model.code import get_obj from frappe import msgprint, _ @@ -38,10 +37,9 @@ class LeaveControlPanel(Document): return e def validate_values(self): - meta = frappe.get_doctype(self.doc.doctype) for f in ["fiscal_year", "leave_type", "no_of_days"]: - if not self.doc.fields[f]: - frappe.throw(_(meta.get_label(f)) + _(" is mandatory")) + if not self.get(f): + frappe.throw(_(self.meta.get_label(f)) + _(" is mandatory")) def allocate_leave(self): self.validate_values() @@ -52,7 +50,8 @@ class LeaveControlPanel(Document): for d in self.get_employees(): try: - la = Document('Leave Allocation') + la = frappe.get_doc('Leave Allocation') + la.set("__islocal", 1) la.employee = cstr(d[0]) la.employee_name = frappe.db.get_value('Employee',cstr(d[0]),'employee_name') la.leave_type = self.doc.leave_type @@ -60,11 +59,8 @@ class LeaveControlPanel(Document): la.posting_date = nowdate() la.carry_forward = cint(self.doc.carry_forward) la.new_leaves_allocated = flt(self.doc.no_of_days) - la_obj = get_obj(doc=la) - la_obj.doc.docstatus = 1 - la_obj.validate() - la_obj.on_update() - la_obj.doc.save(1) + la.docstatus = 1 + la.save() leave_allocated_for.append(d[0]) except: pass diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py index a7c4f8df16..e167835ad5 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.py +++ b/erpnext/hr/doctype/salary_slip/salary_slip.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import frappe from frappe.utils import add_days, cint, cstr, flt, getdate, nowdate, _round -from frappe.model.doc import make_autoname +from frappe.model.naming import make_autoname from frappe.model.bean import getlist from frappe.model.code import get_obj from frappe import msgprint, _ diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.py b/erpnext/hr/doctype/salary_structure/salary_structure.py index ae103945fc..ab73a09510 100644 --- a/erpnext/hr/doctype/salary_structure/salary_structure.py +++ b/erpnext/hr/doctype/salary_structure/salary_structure.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import frappe from frappe.utils import cstr, flt -from frappe.model.doc import make_autoname +from frappe.model.naming import make_autoname from frappe import msgprint, _ diff --git a/erpnext/hr/doctype/upload_attendance/upload_attendance.py b/erpnext/hr/doctype/upload_attendance/upload_attendance.py index 844806ecb7..8a54415832 100644 --- a/erpnext/hr/doctype/upload_attendance/upload_attendance.py +++ b/erpnext/hr/doctype/upload_attendance/upload_attendance.py @@ -120,7 +120,7 @@ def upload(): error = False from frappe.utils.datautils import check_record, import_doc - doctype_dl = frappe.get_doctype("Attendance") + doctype_dl = frappe.get_meta("Attendance") for i, row in enumerate(rows[5:]): if not row: continue @@ -131,7 +131,7 @@ def upload(): d["docstatus"] = frappe.db.get_value("Attendance", d.name, "docstatus") try: - check_record(d, doctype_dl=doctype_dl) + check_record(d) ret.append(import_doc(d, "Attendance", 1, row_idx, submit=True)) except Exception, e: error = True diff --git a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py index 89fafbcab7..9f14b2cc4e 100644 --- a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py +++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py @@ -366,7 +366,7 @@ class ProductionPlanningTool(Document): if items_to_be_requested: for item in items_to_be_requested: item_wrapper = frappe.bean("Item", item) - pr_doclist = [{ + pr_doc = frappe.get_doc({ "doctype": "Material Request", "__islocal": 1, "naming_series": "IDT", @@ -376,12 +376,11 @@ class ProductionPlanningTool(Document): "fiscal_year": fiscal_year, "requested_by": frappe.session.user, "material_request_type": "Purchase" - }] + }) for sales_order, requested_qty in items_to_be_requested[item].items(): - pr_doclist.append({ + pr_doc.append("indent_details", { "doctype": "Material Request Item", "__islocal": 1, - "parentfield": "indent_details", "item_code": item, "item_name": item_wrapper.doc.item_name, "description": item_wrapper.doc.description, @@ -394,10 +393,9 @@ class ProductionPlanningTool(Document): "sales_order_no": sales_order if sales_order!="No Sales Order" else None }) - pr_wrapper = frappe.bean(pr_doclist) - pr_wrapper.ignore_permissions = 1 - pr_wrapper.submit() - purchase_request_list.append(pr_wrapper.doc.name) + pr_doc.ignore_permissions = 1 + pr_doc.submit() + purchase_request_list.append(pr_doc.name) if purchase_request_list: pur_req = ["""%s""" % \ diff --git a/erpnext/patches/4_0/update_user_properties.py b/erpnext/patches/4_0/update_user_properties.py index 6dac125c1c..262f7b8230 100644 --- a/erpnext/patches/4_0/update_user_properties.py +++ b/erpnext/patches/4_0/update_user_properties.py @@ -39,7 +39,7 @@ def update_user_match(): doctype_matches.setdefault(doctype, []).append(match) for doctype, user_matches in doctype_matches.items(): - meta = frappe.get_doctype(doctype) + meta = frappe.get_meta(doctype) # for each user with roles of this doctype, check if match condition applies for user in frappe.db.sql_list("""select name from `tabUser` diff --git a/erpnext/projects/doctype/time_log/test_time_log.py b/erpnext/projects/doctype/time_log/test_time_log.py index b6e2741723..973e89ba59 100644 --- a/erpnext/projects/doctype/time_log/test_time_log.py +++ b/erpnext/projects/doctype/time_log/test_time_log.py @@ -8,7 +8,7 @@ from erpnext.projects.doctype.time_log.time_log import OverlapError class TestTimeLog(unittest.TestCase): def test_duplication(self): - ts = frappe.bean(frappe.copy_doclist(test_records[0])) + ts = frappe.bean(frappe.copy_doc(test_records[0])) self.assertRaises(OverlapError, ts.insert) test_records = [[{ diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py index 1fc2613d1f..1ab827d0e2 100644 --- a/erpnext/selling/doctype/customer/customer.py +++ b/erpnext/selling/doctype/customer/customer.py @@ -3,7 +3,7 @@ from __future__ import unicode_literals import frappe -from frappe.model.doc import Document, make_autoname +from frappe.model.naming import make_autoname from frappe import msgprint, _ import frappe.defaults @@ -56,7 +56,8 @@ class Customer(TransactionBase): (self.doc.name, self.doc.customer_name, self.doc.lead_name)) lead = frappe.db.get_value("Lead", self.doc.lead_name, ["lead_name", "email_id", "phone", "mobile_no"], as_dict=True) - c = Document('Contact') + c = frappe.get_doc('Contact') + c.set("__islocal", 1) c.first_name = lead.lead_name c.email_id = lead.email_id c.phone = lead.phone @@ -65,7 +66,7 @@ class Customer(TransactionBase): c.customer_name = self.doc.customer_name c.is_primary_contact = 1 try: - c.save(1) + c.save() except NameError, e: pass diff --git a/erpnext/selling/doctype/sales_order/test_sales_order.py b/erpnext/selling/doctype/sales_order/test_sales_order.py index e325aeb1ea..869350cd5c 100644 --- a/erpnext/selling/doctype/sales_order/test_sales_order.py +++ b/erpnext/selling/doctype/sales_order/test_sales_order.py @@ -80,7 +80,7 @@ class TestSalesOrder(unittest.TestCase): _insert_purchase_receipt(so.doclist[1].item_code) - dn = frappe.bean(frappe.copy_doclist(dn_test_records[0])) + dn = frappe.bean(frappe.copy_doc(dn_test_records[0])) dn.doclist[1].item_code = so.doclist[1].item_code dn.doclist[1].against_sales_order = so.doc.name dn.doclist[1].prevdoc_detail_docname = so.doclist[1].name @@ -199,7 +199,7 @@ class TestSalesOrder(unittest.TestCase): # change item in test so record - test_record = frappe.copy_doclist(test_records[0]) + test_record = frappe.copy_doc(test_records[0]) test_record[1]["item_code"] = "_Test Sales BOM Item" # reset bin @@ -248,7 +248,7 @@ class TestSalesOrder(unittest.TestCase): from erpnext.selling.doctype.sales_bom.test_sales_bom import test_records as sbom_test_records # change item in test so record - test_record = frappe.copy_doclist(test_records[0]) + test_record = frappe.copy_doc(test_records[0]) test_record[1]["item_code"] = "_Test Sales BOM Item" # reset bin diff --git a/erpnext/selling/page/sales_browser/sales_browser.py b/erpnext/selling/page/sales_browser/sales_browser.py index e53515c22e..42839f3e4e 100644 --- a/erpnext/selling/page/sales_browser/sales_browser.py +++ b/erpnext/selling/page/sales_browser/sales_browser.py @@ -21,8 +21,7 @@ def get_children(): @frappe.whitelist() def add_node(): - # from frappe.model.doc import Document - ctype = frappe.form_dict.get('ctype') + # ctype = frappe.form_dict.get('ctype') parent_field = 'parent_' + ctype.lower().replace(' ', '_') name_field = ctype.lower().replace(' ', '_') + '_name' diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py index 9c980684e8..a7e884eb58 100644 --- a/erpnext/setup/doctype/company/company.py +++ b/erpnext/setup/doctype/company/company.py @@ -86,15 +86,13 @@ class Company(Document): website_settings.doc.home_page = webpage.doc.name website_settings.doc.brand_html = self.doc.name website_settings.doc.copyright = self.doc.name - website_settings.doclist.append({ + website_settings.append("top_bar_items", { "doctype": "Top Bar Item", - "parentfield": "top_bar_items", "label":"Contact", "url": "contact" }) - website_settings.doclist.append({ + website_settings.append("top_bar_items", { "doctype": "Top Bar Item", - "parentfield": "top_bar_items", "label":"Blog", "url": "blog" }) diff --git a/erpnext/setup/doctype/naming_series/naming_series.py b/erpnext/setup/doctype/naming_series/naming_series.py index 454b38a349..d1608fc581 100644 --- a/erpnext/setup/doctype/naming_series/naming_series.py +++ b/erpnext/setup/doctype/naming_series/naming_series.py @@ -56,26 +56,27 @@ class NamingSeries(Document): default = options[0] # update in property setter - from frappe.model.doc import Document - prop_dict = {'options': "\n".join(options), 'default': default} + prop_dict = {'options': "\n".join(options), 'default': default} for prop in prop_dict: ps_exists = frappe.db.sql("""SELECT name FROM `tabProperty Setter` WHERE doc_type = %s AND field_name = 'naming_series' AND property = %s""", (doctype, prop)) if ps_exists: - ps = Document('Property Setter', ps_exists[0][0]) + ps = frappe.get_doc('Property Setter', ps_exists[0][0]) ps.value = prop_dict[prop] ps.save() else: - ps = Document('Property Setter', fielddata = { + ps = frappe.get_doc({ + 'doctype': 'Property Setter', 'doctype_or_field': 'DocField', 'doc_type': doctype, 'field_name': 'naming_series', 'property': prop, 'value': prop_dict[prop], 'property_type': 'Select', + '__islocal': 1 }) - ps.save(1) + ps.save() self.doc.set_options = "\n".join(options) diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index 3a20d8cdf5..2074925e8c 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -18,7 +18,7 @@ class Item(DocListController): def autoname(self): if frappe.db.get_default("item_naming_by")=="Naming Series": - from frappe.model.doc import make_autoname + from frappe.model.naming import make_autoname self.doc.item_code = make_autoname(self.doc.naming_series+'.#####') elif not self.doc.item_code: msgprint(_("Item Code (item_code) is mandatory because Item naming is not sequential."), raise_exception=1) @@ -272,7 +272,7 @@ def validate_end_of_life(item_code, end_of_life=None, verbose=1): "in Item master") % { "item_code": item_code, "date": formatdate(end_of_life), - "end_of_life_label": frappe.get_doctype("Item").get_label("end_of_life") + "end_of_life_label": frappe.get_meta("Item").get_label("end_of_life") } _msgprint(msg, verbose) diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py index c05a8d87b2..fda6849e21 100644 --- a/erpnext/stock/doctype/material_request/material_request.py +++ b/erpnext/stock/doctype/material_request/material_request.py @@ -177,7 +177,7 @@ def update_completed_qty(bean, method): for mr_name, mr_items in material_request_map.items(): mr_obj = frappe.get_obj("Material Request", mr_name, with_children=1) - mr_doctype = frappe.get_doctype("Material Request") + mr_doctype = frappe.get_meta("Material Request") if mr_obj.doc.status in ["Stopped", "Cancelled"]: frappe.throw(_("Material Request") + ": %s, " % mr_obj.doc.name diff --git a/erpnext/stock/doctype/price_list/price_list.py b/erpnext/stock/doctype/price_list/price_list.py index 420c6c5ffc..bf49a51994 100644 --- a/erpnext/stock/doctype/price_list/price_list.py +++ b/erpnext/stock/doctype/price_list/price_list.py @@ -16,9 +16,8 @@ class PriceList(DocListController): if not self.get("valid_for_territories"): # if no territory, set default territory if frappe.defaults.get_user_default("territory"): - self.doclist.append({ + self.append("valid_for_territories", { "doctype": "Applicable Territory", - "parentfield": "valid_for_territories", "territory": frappe.defaults.get_user_default("territory") }) else: diff --git a/erpnext/stock/doctype/serial_no/serial_no.py b/erpnext/stock/doctype/serial_no/serial_no.py index d8bdb77142..50b1d00406 100644 --- a/erpnext/stock/doctype/serial_no/serial_no.py +++ b/erpnext/stock/doctype/serial_no/serial_no.py @@ -254,7 +254,7 @@ def validate_serial_no(sle, item_det): def update_serial_nos(sle, item_det): if sle.is_cancelled == "No" and not sle.serial_no and sle.actual_qty > 0 and item_det.serial_no_series: - from frappe.model.doc import make_autoname + from frappe.model.naming import make_autoname serial_nos = [] for i in xrange(cint(sle.actual_qty)): serial_nos.append(make_autoname(item_det.serial_no_series)) diff --git a/erpnext/stock/doctype/stock_ledger/stock_ledger.py b/erpnext/stock/doctype/stock_ledger/stock_ledger.py index 452ad35879..966e7ab656 100644 --- a/erpnext/stock/doctype/stock_ledger/stock_ledger.py +++ b/erpnext/stock/doctype/stock_ledger/stock_ledger.py @@ -5,7 +5,6 @@ from __future__ import unicode_literals import frappe from frappe.utils import add_days, cstr, flt, nowdate, cint, now -from frappe.model.doc import Document from frappe.model.bean import getlist from frappe.model.code import get_obj from frappe import session, msgprint diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index 8bfc083629..3cd49d94b3 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -158,7 +158,7 @@ def get_basic_details(args, item_bean): return out def get_price_list_rate(args, item_bean, out): - meta = frappe.get_doctype(args.doctype) + meta = frappe.get_meta(args.doctype) if meta.get_field("currency"): validate_price_list(args) diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index 822c8f288d..4628b5b221 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -116,7 +116,7 @@ def update_entries_after(args, verbose=1): # rounding as per precision from frappe.model.meta import get_field_precision - meta = frappe.get_doctype("Stock Ledger Entry") + meta = frappe.get_meta("Stock Ledger Entry") stock_value = flt(stock_value, get_field_precision(meta.get_field("stock_value"), frappe._dict({"fields": sle}))) diff --git a/erpnext/support/doctype/support_email_settings/support_email_settings.py b/erpnext/support/doctype/support_email_settings/support_email_settings.py index 65edf23940..011a94368c 100644 --- a/erpnext/support/doctype/support_email_settings/support_email_settings.py +++ b/erpnext/support/doctype/support_email_settings/support_email_settings.py @@ -16,11 +16,10 @@ class SupportEmailSettings(Document): """ if self.doc.sync_support_mails and self.doc.mail_server: from frappe.utils.email_lib.receive import POP3Mailbox - from frappe.model.doc import Document - import _socket, poplib + import _socket, poplib - inc_email = Document('Incoming Email Settings') - inc_email.encode() + inc_email = frappe.get_doc('Incoming Email Settings') + # inc_email.encode() inc_email.host = self.doc.mail_server inc_email.use_ssl = self.doc.use_ssl try: diff --git a/erpnext/utilities/doctype/address/address.py b/erpnext/utilities/doctype/address/address.py index b698658eac..778451b073 100644 --- a/erpnext/utilities/doctype/address/address.py +++ b/erpnext/utilities/doctype/address/address.py @@ -56,7 +56,7 @@ def get_address_display(address_dict): if not isinstance(address_dict, dict): address_dict = frappe.db.get_value("Address", address_dict, "*", as_dict=True) or {} - meta = frappe.get_doctype("Address") + meta = frappe.get_meta("Address") sequence = (("", "address_line1"), ("\n", "address_line2"), ("\n", "city"), diff --git a/erpnext/utilities/doctype/sms_control/sms_control.py b/erpnext/utilities/doctype/sms_control/sms_control.py index b160ad9139..3a23558573 100644 --- a/erpnext/utilities/doctype/sms_control/sms_control.py +++ b/erpnext/utilities/doctype/sms_control/sms_control.py @@ -6,7 +6,6 @@ import frappe, json from frappe.utils import nowdate, cstr from frappe.model.code import get_obj -from frappe.model.doc import Document from frappe import msgprint, throw, _ from frappe.model.bean import getlist @@ -109,11 +108,11 @@ class SmsControl(Document): # Create SMS Log # ========================================================= def create_sms_log(self, arg, sent_sms): - sl = Document('SMS Log') + sl = frappe.get_doc('SMS Log') sl.sender_name = arg['sender_name'] sl.sent_on = nowdate() sl.receiver_list = cstr(arg['receiver_list']) sl.message = arg['message'] sl.no_of_requested_sms = len(arg['receiver_list']) sl.no_of_sent_sms = sent_sms - sl.save(new=1) + sl.save() diff --git a/erpnext/utilities/transaction_base.py b/erpnext/utilities/transaction_base.py index 11dfc5252b..ee78cede9a 100644 --- a/erpnext/utilities/transaction_base.py +++ b/erpnext/utilities/transaction_base.py @@ -36,7 +36,7 @@ class TransactionBase(StatusUpdater): opts = frappe._dict(opts) if self.doc.contact_date: - event_doclist = [{ + event_doclist = frappe.get_doc({ "doctype": "Event", "owner": opts.owner or self.doc.owner, "subject": opts.subject, @@ -45,16 +45,15 @@ class TransactionBase(StatusUpdater): "event_type": "Private", "ref_type": self.doc.doctype, "ref_name": self.doc.name - }] + }) if frappe.db.exists("User", self.doc.contact_by): - event_doclist.append({ + event_doclist.append("event_individuals", { "doctype": "Event User", - "parentfield": "event_individuals", "person": self.doc.contact_by }) - frappe.bean(event_doclist).insert() + event_doclist.insert() def validate_uom_is_integer(self, uom_field, qty_fields): validate_uom_is_integer(self.doclist, uom_field, qty_fields) From daae7436082f84a4e18b13c6cf7218f4db0b3784 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 27 Mar 2014 17:54:18 +0530 Subject: [PATCH 05/42] frappe/frappe#478 --- .../Cheque Printing Format.txt | 35 +- .../Print Format/POS Invoice/POS Invoice.txt | 37 +- .../Payment Receipt Voucher.txt | 35 +- .../Sales Invoice Classic.txt | 37 +- .../Sales Invoice Modern.txt | 37 +- .../Sales Invoice Spartan.txt | 37 +- .../SalesInvoice/SalesInvoice.txt | 33 +- erpnext/accounts/doctype/account/account.txt | 643 ++--- .../accounts_settings/accounts_settings.txt | 151 +- .../bank_reconciliation.txt | 211 +- .../bank_reconciliation_detail.txt | 217 +- .../doctype/budget_detail/budget_detail.txt | 113 +- .../budget_distribution.txt | 177 +- .../budget_distribution_detail.txt | 82 +- erpnext/accounts/doctype/c_form/c_form.txt | 371 ++- .../c_form_invoice_detail.txt | 145 +- .../chart_of_accounts/chart_of_accounts.txt | 137 +- .../doctype/cost_center/cost_center.txt | 392 ++- .../doctype/fiscal_year/fiscal_year.txt | 180 +- .../accounts/doctype/gl_entry/gl_entry.txt | 463 ++-- .../journal_voucher/journal_voucher.txt | 995 ++++--- .../journal_voucher_detail.txt | 345 ++- .../mode_of_payment/mode_of_payment.txt | 133 +- .../payment_to_invoice_matching_tool.txt | 384 ++- ...ayment_to_invoice_matching_tool_detail.txt | 189 +- .../period_closing_voucher.txt | 281 +- .../doctype/pos_setting/pos_setting.txt | 480 ++-- .../doctype/pricing_rule/pricing_rule.txt | 519 ++-- .../purchase_invoice/purchase_invoice.txt | 1655 ++++++----- .../purchase_invoice_advance.txt | 189 +- .../purchase_invoice_item.txt | 887 +++--- .../purchase_taxes_and_charges.txt | 337 ++- .../purchase_taxes_and_charges_master.txt | 179 +- .../doctype/sales_invoice/sales_invoice.txt | 2467 ++++++++--------- .../sales_invoice_advance.txt | 189 +- .../sales_invoice_item/sales_invoice_item.txt | 941 ++++--- .../sales_taxes_and_charges.txt | 319 +-- .../sales_taxes_and_charges_master.txt | 247 +- .../doctype/shipping_rule/shipping_rule.txt | 315 +-- .../shipping_rule_condition.txt | 91 +- .../accounts_browser/accounts_browser.txt | 58 +- .../financial_analytics.txt | 60 +- .../page/trial_balance/trial_balance.txt | 60 +- .../accounts_payable/accounts_payable.txt | 39 +- .../accounts_receivable.txt | 39 +- .../bank_clearance_summary.txt | 37 +- .../bank_reconciliation_statement.txt | 39 +- .../budget_variance_report.txt | 37 +- .../customer_account_head.txt | 37 +- .../delivered_items_to_be_billed.txt | 39 +- .../report/general_ledger/general_ledger.txt | 37 +- .../report/gross_profit/gross_profit.txt | 37 +- .../item_wise_purchase_register.txt | 39 +- .../item_wise_sales_register.txt | 39 +- .../ordered_items_to_be_billed.txt | 39 +- .../payment_period_based_on_invoice_date.txt | 39 +- .../purchase_invoice_trends.txt | 37 +- .../purchase_order_items_to_be_billed.txt | 41 +- .../purchase_register/purchase_register.txt | 39 +- .../received_items_to_be_billed.txt | 39 +- .../sales_invoice_trends.txt | 37 +- .../sales_partners_commission.txt | 39 +- .../report/sales_register/sales_register.txt | 39 +- .../supplier_account_head.txt | 37 +- .../Purchase Order Classic.txt | 37 +- .../Purchase Order Modern.txt | 37 +- .../Purchase Order Spartan.txt | 37 +- .../buying_settings/buying_settings.txt | 169 +- .../purchase_common/purchase_common.txt | 31 +- .../doctype/purchase_order/purchase_order.txt | 1407 +++++----- .../purchase_order_item.txt | 977 ++++--- .../purchase_order_item_supplied.txt | 229 +- .../purchase_receipt_item_supplied.txt | 303 +- .../quality_inspection/quality_inspection.txt | 475 ++-- .../quality_inspection_reading.txt | 269 +- erpnext/buying/doctype/supplier/supplier.txt | 456 ++- .../supplier_quotation/supplier_quotation.txt | 1291 +++++---- .../supplier_quotation_item.txt | 737 +++-- .../purchase_analytics/purchase_analytics.txt | 60 +- .../item_wise_purchase_history.txt | 41 +- .../purchase_order_trends.txt | 37 +- .../requested_items_to_be_ordered.txt | 41 +- .../supplier_addresses_and_contacts.txt | 39 +- erpnext/home/doctype/feed/feed.txt | 141 +- erpnext/home/page/activity/activity.txt | 53 +- erpnext/hr/doctype/appraisal/appraisal.txt | 505 ++-- .../doctype/appraisal_goal/appraisal_goal.txt | 144 +- .../appraisal_template/appraisal_template.txt | 145 +- .../appraisal_template_goal.txt | 91 +- erpnext/hr/doctype/attendance/attendance.txt | 359 ++- erpnext/hr/doctype/branch/branch.txt | 138 +- .../doctype/deduction_type/deduction_type.txt | 139 +- erpnext/hr/doctype/department/department.txt | 135 +- .../hr/doctype/designation/designation.txt | 121 +- .../hr/doctype/earning_type/earning_type.txt | 181 +- erpnext/hr/doctype/employee/employee.txt | 1559 ++++++----- .../employee_education/employee_education.txt | 150 +- .../employee_external_work_history.txt | 146 +- .../employee_internal_work_history.txt | 152 +- .../employee_leave_approver.txt | 67 +- .../employment_type/employment_type.txt | 136 +- .../doctype/expense_claim/expense_claim.txt | 483 ++-- .../expense_claim_detail.txt | 163 +- .../expense_claim_type/expense_claim_type.txt | 117 +- erpnext/hr/doctype/grade/grade.txt | 101 +- erpnext/hr/doctype/holiday/holiday.txt | 76 +- .../hr/doctype/holiday_list/holiday_list.txt | 219 +- .../hr/doctype/hr_settings/hr_settings.txt | 143 +- .../doctype/job_applicant/job_applicant.txt | 195 +- .../hr/doctype/job_opening/job_opening.txt | 123 +- .../leave_allocation/leave_allocation.txt | 353 ++- .../leave_application/leave_application.txt | 572 ++-- .../leave_block_list/leave_block_list.txt | 193 +- .../leave_block_list_allow.txt | 63 +- .../leave_block_list_date.txt | 77 +- .../leave_control_panel.txt | 263 +- erpnext/hr/doctype/leave_type/leave_type.txt | 216 +- .../doctype/salary_manager/salary_manager.txt | 351 ++- .../hr/doctype/salary_slip/salary_slip.txt | 796 +++--- .../salary_slip_deduction.txt | 114 +- .../salary_slip_earning.txt | 114 +- .../salary_structure/salary_structure.txt | 557 ++-- .../salary_structure_deduction.txt | 105 +- .../salary_structure_earning.txt | 109 +- .../upload_attendance/upload_attendance.txt | 192 +- .../employee_birthday/employee_birthday.txt | 37 +- .../employee_information.txt | 39 +- .../employee_leave_balance.txt | 37 +- .../monthly_attendance_sheet.txt | 39 +- .../monthly_salary_register.txt | 39 +- erpnext/manufacturing/doctype/bom/bom.txt | 552 ++-- .../bom_explosion_item/bom_explosion_item.txt | 189 +- .../doctype/bom_item/bom_item.txt | 295 +- .../doctype/bom_operation/bom_operation.txt | 175 +- .../bom_replace_tool/bom_replace_tool.txt | 143 +- .../production_order/production_order.txt | 515 ++-- .../production_plan_item.txt | 237 +- .../production_plan_sales_order.txt | 132 +- .../production_planning_tool.txt | 373 ++- .../doctype/workstation/workstation.txt | 317 +-- .../completed_production_orders.txt | 39 +- .../issued_items_against_production_order.txt | 41 +- .../open_production_orders.txt | 39 +- .../production_orders_in_progress.txt | 39 +- .../doctype/activity_type/activity_type.txt | 107 +- erpnext/projects/doctype/project/project.txt | 603 ++-- .../project_milestone/project_milestone.txt | 101 +- erpnext/projects/doctype/task/task.txt | 505 ++-- .../projects/doctype/time_log/time_log.txt | 404 ++- .../doctype/time_log_batch/time_log_batch.txt | 233 +- .../time_log_batch_detail.txt | 108 +- .../daily_time_log_summary.txt | 37 +- .../project_wise_stock_tracking.txt | 37 +- .../Quotation Classic/Quotation Classic.txt | 37 +- .../Quotation Modern/Quotation Modern.txt | 37 +- .../Quotation Spartan/Quotation Spartan.txt | 37 +- .../Sales Order Classic.txt | 37 +- .../Sales Order Modern/Sales Order Modern.txt | 37 +- .../Sales Order Spartan.txt | 37 +- erpnext/selling/doctype/campaign/campaign.txt | 203 +- erpnext/selling/doctype/customer/customer.txt | 711 +++-- .../doctype/industry_type/industry_type.txt | 123 +- .../installation_note/installation_note.txt | 553 ++-- .../installation_note_item.txt | 229 +- erpnext/selling/doctype/lead/lead.txt | 812 +++--- .../doctype/opportunity/opportunity.txt | 905 +++--- .../opportunity_item/opportunity_item.txt | 259 +- .../selling/doctype/quotation/quotation.txt | 1803 ++++++------ .../doctype/quotation_item/quotation_item.txt | 735 +++-- .../selling/doctype/sales_bom/sales_bom.txt | 199 +- .../doctype/sales_bom_item/sales_bom_item.txt | 149 +- .../doctype/sales_order/sales_order.txt | 1874 +++++++------ .../sales_order_item/sales_order_item.txt | 907 +++--- .../selling/doctype/sales_team/sales_team.txt | 227 +- .../selling_settings/selling_settings.txt | 199 +- .../selling/doctype/sms_center/sms_center.txt | 277 +- .../page/sales_analytics/sales_analytics.txt | 67 +- .../page/sales_browser/sales_browser.txt | 93 +- .../page/sales_funnel/sales_funnel.txt | 53 +- .../available_stock_for_packing_items.txt | 37 +- .../customer_acquisition_and_loyalty.txt | 39 +- .../customer_addresses_and_contacts.txt | 39 +- .../customers_not_buying_since_long_time.txt | 37 +- .../item_wise_sales_history.txt | 43 +- .../report/lead_details/lead_details.txt | 39 +- .../pending_so_items_for_purchase_request.txt | 39 +- .../quotation_trends/quotation_trends.txt | 39 +- .../sales_order_trends/sales_order_trends.txt | 37 +- ...person_target_variance_item_group_wise.txt | 37 +- .../sales_person_wise_transaction_summary.txt | 39 +- ...ritory_target_variance_item_group_wise.txt | 37 +- .../applicable_territory.txt | 61 +- .../authorization_control.txt | 31 +- .../authorization_rule/authorization_rule.txt | 313 +-- .../doctype/backup_manager/backup_manager.txt | 337 ++- erpnext/setup/doctype/brand/brand.txt | 188 +- erpnext/setup/doctype/company/company.txt | 770 +++-- .../contact_control/contact_control.txt | 111 +- erpnext/setup/doctype/country/country.txt | 207 +- erpnext/setup/doctype/currency/currency.txt | 245 +- .../currency_exchange/currency_exchange.txt | 167 +- .../doctype/customer_group/customer_group.txt | 325 ++- .../doctype/email_digest/email_digest.txt | 720 +++-- .../doctype/features_setup/features_setup.txt | 494 ++-- .../global_defaults/global_defaults.txt | 367 ++- .../setup/doctype/item_group/item_group.txt | 467 ++-- .../jobs_email_settings.txt | 165 +- .../doctype/naming_series/naming_series.txt | 215 +- .../notification_control.txt | 418 ++- .../doctype/print_heading/print_heading.txt | 141 +- .../quotation_lost_reason.txt | 121 +- .../sales_email_settings.txt | 165 +- .../doctype/sales_partner/sales_partner.txt | 497 ++-- .../doctype/sales_person/sales_person.txt | 391 ++- .../doctype/sms_parameter/sms_parameter.txt | 76 +- .../doctype/sms_settings/sms_settings.txt | 169 +- .../doctype/supplier_type/supplier_type.txt | 165 +- .../doctype/target_detail/target_detail.txt | 134 +- .../terms_and_conditions.txt | 207 +- erpnext/setup/doctype/territory/territory.txt | 397 ++- erpnext/setup/doctype/uom/uom.txt | 159 +- .../website_item_group/website_item_group.txt | 65 +- .../setup/page/setup_wizard/setup_wizard.txt | 51 +- .../Delivery Note Classic.txt | 37 +- .../Delivery Note Modern.txt | 37 +- .../Delivery Note Packing List Wise.txt | 33 +- .../Delivery Note Spartan.txt | 37 +- erpnext/stock/doctype/batch/batch.txt | 199 +- erpnext/stock/doctype/bin/bin.txt | 407 +-- .../doctype/delivery_note/delivery_note.txt | 2155 +++++++------- .../delivery_note_item/delivery_note_item.txt | 903 +++--- erpnext/stock/doctype/item/item.txt | 1777 ++++++------ .../item_customer_detail.txt | 103 +- .../stock/doctype/item_price/item_price.txt | 291 +- .../item_quality_inspection_parameter.txt | 86 +- .../doctype/item_reorder/item_reorder.txt | 113 +- .../doctype/item_supplier/item_supplier.txt | 74 +- erpnext/stock/doctype/item_tax/item_tax.txt | 82 +- .../item_website_specification.txt | 78 +- .../landed_cost_item/landed_cost_item.txt | 124 +- .../landed_cost_purchase_receipt.txt | 65 +- .../landed_cost_wizard/landed_cost_wizard.txt | 178 +- .../material_request/material_request.txt | 583 ++-- .../material_request_item.txt | 493 ++-- .../stock/doctype/packed_item/packed_item.txt | 327 ++- .../doctype/packing_slip/packing_slip.txt | 497 ++-- .../packing_slip_item/packing_slip_item.txt | 207 +- .../stock/doctype/price_list/price_list.txt | 265 +- .../purchase_receipt/purchase_receipt.txt | 1699 ++++++------ .../purchase_receipt_item.txt | 1135 ++++---- erpnext/stock/doctype/serial_no/serial_no.txt | 947 ++++--- .../stock/doctype/stock_entry/stock_entry.txt | 1287 ++++----- .../stock_entry_detail/stock_entry_detail.txt | 629 ++--- .../stock_ledger_entry/stock_ledger_entry.txt | 590 ++-- .../stock_reconciliation.txt | 305 +- .../doctype/stock_settings/stock_settings.txt | 255 +- .../stock_uom_replace_utility.txt | 164 +- .../uom_conversion_detail.txt | 80 +- erpnext/stock/doctype/warehouse/warehouse.txt | 433 ++- .../doctype/warehouse_user/warehouse_user.txt | 63 +- .../stock/page/stock_ageing/stock_ageing.txt | 60 +- .../page/stock_analytics/stock_analytics.txt | 60 +- .../page/stock_balance/stock_balance.txt | 60 +- .../stock/page/stock_ledger/stock_ledger.txt | 67 +- .../stock/page/stock_level/stock_level.txt | 60 +- .../batch_wise_balance_history.txt | 37 +- .../delivery_note_trends.txt | 37 +- .../stock/report/item_prices/item_prices.txt | 37 +- .../item_shortage_report.txt | 39 +- .../item_wise_price_list_rate.txt | 39 +- .../items_to_be_requested.txt | 39 +- .../itemwise_recommended_reorder_level.txt | 37 +- ...ch_supplier_quotations_are_not_created.txt | 39 +- .../ordered_items_to_be_delivered.txt | 39 +- .../purchase_in_transit.txt | 39 +- .../purchase_order_items_to_be_received.txt | 41 +- .../purchase_receipt_trends.txt | 37 +- .../requested_items_to_be_transferred.txt | 41 +- .../serial_no_service_contract_expiry.txt | 39 +- .../serial_no_status/serial_no_status.txt | 39 +- .../serial_no_warranty_expiry.txt | 39 +- .../report/stock_ageing/stock_ageing.txt | 37 +- .../report/stock_ledger/stock_ledger.txt | 37 +- .../stock_projected_qty.txt | 39 +- .../supplier_wise_sales_analytics.txt | 39 +- .../warehouse_wise_stock_balance.txt | 37 +- .../doctype/customer_issue/customer_issue.txt | 857 +++--- .../maintenance_schedule.txt | 505 ++-- .../maintenance_schedule_detail.txt | 207 +- .../maintenance_schedule_item.txt | 295 +- .../maintenance_visit/maintenance_visit.txt | 623 ++--- .../maintenance_visit_purpose.txt | 271 +- .../support/doctype/newsletter/newsletter.txt | 348 ++- .../support_email_settings.txt | 203 +- .../doctype/support_ticket/support_ticket.txt | 581 ++-- .../support_analytics/support_analytics.txt | 53 +- .../maintenance_schedules.txt | 39 +- erpnext/utilities/doctype/address/address.txt | 516 ++-- erpnext/utilities/doctype/contact/contact.txt | 663 +++-- erpnext/utilities/doctype/note/note.txt | 157 +- .../utilities/doctype/note_user/note_user.txt | 80 +- .../doctype/rename_tool/rename_tool.txt | 121 +- .../doctype/sms_control/sms_control.txt | 71 +- erpnext/utilities/doctype/sms_log/sms_log.txt | 169 +- 304 files changed, 38833 insertions(+), 41979 deletions(-) diff --git a/erpnext/accounts/Print Format/Cheque Printing Format/Cheque Printing Format.txt b/erpnext/accounts/Print Format/Cheque Printing Format/Cheque Printing Format.txt index 19456a920a..a0a25cd16c 100755 --- a/erpnext/accounts/Print Format/Cheque Printing Format/Cheque Printing Format.txt +++ b/erpnext/accounts/Print Format/Cheque Printing Format/Cheque Printing Format.txt @@ -1,21 +1,14 @@ -[ - { - "owner": "Administrator", - "docstatus": 0, - "creation": "2012-04-11 13:16:56", - "modified_by": "Administrator", - "modified": "2012-04-13 12:24:20" - }, - { - "doc_type": "Journal Voucher", - "name": "__common__", - "module": "Accounts", - "doctype": "Print Format", - "html": "\n
\n



\n
\nPAYMENT ADVICE

\n\n\n\n\n\n\n\n
To :
\n\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Voucher No :\n\n
Voucher Date :\n\n
Cheque No :\n\n
Cheque Date :\n\n
\n
\n
We are pleased to enclose our cheque in full/part Settlement of your under noted bills
\n
\n\n\n\n\n\n\n\n\n\n\n\n
 Total :\n\n
Narration :\n\n


\n
Prepared By
\n
Authorised Signatory
\n
Received Payment as Above
\n
_____________
\n
A/c Payee
\n
_____________
\n
\n\n
\n
\n\n
\n
\n\n
\n
\n\n
\n
", - "standard": "Yes" - }, - { - "name": "Cheque Printing Format", - "doctype": "Print Format" - } -] \ No newline at end of file +{ + "creation": "2012-04-11 13:16:56", + "doc_type": "Journal Voucher", + "docstatus": 0, + "doctype": "Print Format", + "html": "\n
\n



\n
\nPAYMENT ADVICE

\n\n\n\n\n\n\n\n
To :
\n\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Voucher No :\n\n
Voucher Date :\n\n
Cheque No :\n\n
Cheque Date :\n\n
\n
\n
We are pleased to enclose our cheque in full/part Settlement of your under noted bills
\n
\n\n\n\n\n\n\n\n\n\n\n\n
 Total :\n\n
Narration :\n\n


\n
Prepared By
\n
Authorised Signatory
\n
Received Payment as Above
\n
_____________
\n
A/c Payee
\n
_____________
\n
\n\n
\n
\n\n
\n
\n\n
\n
\n\n
\n
", + "idx": 1, + "modified": "2012-04-13 12:24:20", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Cheque Printing Format", + "owner": "Administrator", + "standard": "Yes" +} \ No newline at end of file diff --git a/erpnext/accounts/Print Format/POS Invoice/POS Invoice.txt b/erpnext/accounts/Print Format/POS Invoice/POS Invoice.txt index 4f20ac245b..136856c0b7 100644 --- a/erpnext/accounts/Print Format/POS Invoice/POS Invoice.txt +++ b/erpnext/accounts/Print Format/POS Invoice/POS Invoice.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2011-12-21 11:08:55", - "docstatus": 0, - "modified": "2014-01-27 17:26:10", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doc_type": "Sales Invoice", - "doctype": "Print Format", - "html": "\n\t\n\n\t\t\n\t\t\n\n\t\t\n\t\t\n\t\n\n\t\n\t\t\n\t\t
\n\t\t
\n\t\t
\n\t\t
\n\t\t
\n\t\n", - "module": "Accounts", - "name": "__common__", - "print_format_type": "Client", - "standard": "Yes" - }, - { - "doctype": "Print Format", - "name": "POS Invoice" - } -] \ No newline at end of file +{ + "creation": "2011-12-21 11:08:55", + "doc_type": "Sales Invoice", + "docstatus": 0, + "doctype": "Print Format", + "html": "\n\t\n\n\t\t\n\t\t\n\n\t\t\n\t\t\n\t\n\n\t\n\t\t\n\t\t
\n\t\t
\n\t\t
\n\t\t
\n\t\t
\n\t\n", + "idx": 1, + "modified": "2014-01-27 17:26:10", + "modified_by": "Administrator", + "module": "Accounts", + "name": "POS Invoice", + "owner": "Administrator", + "print_format_type": "Client", + "standard": "Yes" +} \ No newline at end of file diff --git a/erpnext/accounts/Print Format/Payment Receipt Voucher/Payment Receipt Voucher.txt b/erpnext/accounts/Print Format/Payment Receipt Voucher/Payment Receipt Voucher.txt index 73bc63b790..da1bcd7810 100755 --- a/erpnext/accounts/Print Format/Payment Receipt Voucher/Payment Receipt Voucher.txt +++ b/erpnext/accounts/Print Format/Payment Receipt Voucher/Payment Receipt Voucher.txt @@ -1,21 +1,14 @@ -[ - { - "creation": "2012-05-01 12:46:31", - "docstatus": 0, - "modified": "2013-01-21 18:40:20", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doc_type": "Journal Voucher", - "doctype": "Print Format", - "html": "

\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n\n\n\n\n
Receipt No.:
Date :
Remark:
Received From:
\n
\n\n
\n\n\n\n

For ,


(Authorised Signatory)
", - "module": "Accounts", - "name": "__common__", - "standard": "Yes" - }, - { - "doctype": "Print Format", - "name": "Payment Receipt Voucher" - } -] \ No newline at end of file +{ + "creation": "2012-05-01 12:46:31", + "doc_type": "Journal Voucher", + "docstatus": 0, + "doctype": "Print Format", + "html": "

\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n\n\n\n\n
Receipt No.:
Date :
Remark:
Received From:
\n
\n\n
\n\n\n\n

For ,


(Authorised Signatory)
", + "idx": 1, + "modified": "2013-01-21 18:40:20", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Payment Receipt Voucher", + "owner": "Administrator", + "standard": "Yes" +} \ No newline at end of file diff --git a/erpnext/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.txt b/erpnext/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.txt index 5bf9bf3203..cc3aef2fd5 100644 --- a/erpnext/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.txt +++ b/erpnext/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-04-19 13:30:27", - "docstatus": 0, - "modified": "2014-02-11 17:33:08", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doc_type": "Sales Invoice", - "doctype": "Print Format", - "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", - "module": "Accounts", - "name": "__common__", - "print_format_type": "Client", - "standard": "Yes" - }, - { - "doctype": "Print Format", - "name": "Sales Invoice Classic" - } -] \ No newline at end of file +{ + "creation": "2013-04-19 13:30:27", + "doc_type": "Sales Invoice", + "docstatus": 0, + "doctype": "Print Format", + "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", + "idx": 1, + "modified": "2014-02-11 17:33:08", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Sales Invoice Classic", + "owner": "Administrator", + "print_format_type": "Client", + "standard": "Yes" +} \ No newline at end of file diff --git a/erpnext/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.txt b/erpnext/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.txt index f36f4a588f..e166ae4035 100644 --- a/erpnext/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.txt +++ b/erpnext/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-04-19 13:30:27", - "docstatus": 0, - "modified": "2014-02-11 17:33:05", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doc_type": "Sales Invoice", - "doctype": "Print Format", - "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", - "module": "Accounts", - "name": "__common__", - "print_format_type": "Client", - "standard": "Yes" - }, - { - "doctype": "Print Format", - "name": "Sales Invoice Modern" - } -] \ No newline at end of file +{ + "creation": "2013-04-19 13:30:27", + "doc_type": "Sales Invoice", + "docstatus": 0, + "doctype": "Print Format", + "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", + "idx": 1, + "modified": "2014-02-11 17:33:05", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Sales Invoice Modern", + "owner": "Administrator", + "print_format_type": "Client", + "standard": "Yes" +} \ No newline at end of file diff --git a/erpnext/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.txt b/erpnext/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.txt index e60f8a099b..b56e547478 100644 --- a/erpnext/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.txt +++ b/erpnext/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-04-19 13:30:27", - "docstatus": 0, - "modified": "2014-02-11 17:34:00", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doc_type": "Sales Invoice", - "doctype": "Print Format", - "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", - "module": "Accounts", - "name": "__common__", - "print_format_type": "Client", - "standard": "Yes" - }, - { - "doctype": "Print Format", - "name": "Sales Invoice Spartan" - } -] \ No newline at end of file +{ + "creation": "2013-04-19 13:30:27", + "doc_type": "Sales Invoice", + "docstatus": 0, + "doctype": "Print Format", + "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", + "idx": 1, + "modified": "2014-02-11 17:34:00", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Sales Invoice Spartan", + "owner": "Administrator", + "print_format_type": "Client", + "standard": "Yes" +} \ No newline at end of file diff --git a/erpnext/accounts/Print Format/SalesInvoice/SalesInvoice.txt b/erpnext/accounts/Print Format/SalesInvoice/SalesInvoice.txt index d2b1cdbaf4..60897e57c4 100644 --- a/erpnext/accounts/Print Format/SalesInvoice/SalesInvoice.txt +++ b/erpnext/accounts/Print Format/SalesInvoice/SalesInvoice.txt @@ -1,20 +1,13 @@ -[ - { - "creation": "2013-03-21 15:24:28", - "docstatus": 0, - "modified": "2013-03-21 15:26:21", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doc_type": "Sales Invoice", - "doctype": "Print Format", - "module": "Accounts", - "name": "__common__", - "standard": "Yes" - }, - { - "doctype": "Print Format", - "name": "SalesInvoice" - } -] \ No newline at end of file +{ + "creation": "2013-03-21 15:24:28", + "doc_type": "Sales Invoice", + "docstatus": 0, + "doctype": "Print Format", + "idx": 1, + "modified": "2013-03-21 15:26:21", + "modified_by": "Administrator", + "module": "Accounts", + "name": "SalesInvoice", + "owner": "Administrator", + "standard": "Yes" +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/account/account.txt b/erpnext/accounts/doctype/account/account.txt index 17d77f936a..5778d5aa39 100644 --- a/erpnext/accounts/doctype/account/account.txt +++ b/erpnext/accounts/doctype/account/account.txt @@ -1,317 +1,326 @@ -[ - { - "creation": "2013-01-30 12:49:46", - "docstatus": 0, - "modified": "2014-03-19 12:07:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_copy": 1, - "allow_rename": 1, - "description": "Heads (or groups) against which Accounting Entries are made and balances are maintained.", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-money", - "in_create": 1, - "module": "Accounts", - "name": "__common__", - "search_fields": "group_or_ledger" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Account", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "amend": 0, - "cancel": 0, - "doctype": "DocPerm", - "name": "__common__", - "parent": "Account", - "parentfield": "permissions", - "parenttype": "DocType", - "read": 1, - "report": 1, - "submit": 0 - }, - { - "doctype": "DocType", - "name": "Account" - }, - { - "doctype": "DocField", - "fieldname": "properties", - "fieldtype": "Section Break", - "label": "Account Details", - "oldfieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "account_name", - "fieldtype": "Data", - "in_filter": 1, - "label": "Account Name", - "no_copy": 1, - "oldfieldname": "account_name", - "oldfieldtype": "Data", - "read_only": 1, - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "level", - "fieldtype": "Int", - "hidden": 1, - "label": "Level", - "oldfieldname": "level", - "oldfieldtype": "Int", - "print_hide": 1, - "read_only": 1 - }, - { - "default": "Ledger", - "doctype": "DocField", - "fieldname": "group_or_ledger", - "fieldtype": "Select", - "in_filter": 1, - "label": "Group or Ledger", - "oldfieldname": "group_or_ledger", - "oldfieldtype": "Select", - "options": "\nLedger\nGroup", - "read_only": 1, - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "in_filter": 1, - "label": "Company", - "oldfieldname": "company", - "oldfieldtype": "Link", - "options": "Company", - "read_only": 1, - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "parent_account", - "fieldtype": "Link", - "ignore_restrictions": 1, - "label": "Parent Account", - "oldfieldname": "parent_account", - "oldfieldtype": "Link", - "options": "Account", - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "report_type", - "fieldtype": "Select", - "label": "Report Type", - "options": "\nBalance Sheet\nProfit and Loss" - }, - { - "description": "Setting Account Type helps in selecting this Account in transactions.", - "doctype": "DocField", - "fieldname": "account_type", - "fieldtype": "Select", - "in_filter": 1, - "label": "Account Type", - "oldfieldname": "account_type", - "oldfieldtype": "Select", - "options": "Bank\nCash\nTax\nChargeable\nWarehouse\nReceivable\nPayable\nEquity\nFixed Asset\nCost of Goods Sold\nExpense Account\nIncome Account\nStock Received But Not Billed\nExpenses Included In Valuation\nStock Adjustment", - "search_index": 0 - }, - { - "description": "Rate at which this tax is applied", - "doctype": "DocField", - "fieldname": "tax_rate", - "fieldtype": "Float", - "hidden": 0, - "label": "Rate", - "oldfieldname": "tax_rate", - "oldfieldtype": "Currency", - "reqd": 0 - }, - { - "description": "If the account is frozen, entries are allowed to restricted users.", - "doctype": "DocField", - "fieldname": "freeze_account", - "fieldtype": "Select", - "label": "Frozen", - "oldfieldname": "freeze_account", - "oldfieldtype": "Select", - "options": "No\nYes" - }, - { - "doctype": "DocField", - "fieldname": "credit_days", - "fieldtype": "Int", - "hidden": 1, - "label": "Credit Days", - "oldfieldname": "credit_days", - "oldfieldtype": "Int", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "credit_limit", - "fieldtype": "Currency", - "hidden": 1, - "label": "Credit Limit", - "oldfieldname": "credit_limit", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1 - }, - { - "description": "If this Account represents a Customer, Supplier or Employee, set it here.", - "doctype": "DocField", - "fieldname": "master_type", - "fieldtype": "Select", - "label": "Master Type", - "oldfieldname": "master_type", - "oldfieldtype": "Select", - "options": "\nSupplier\nCustomer\nEmployee" - }, - { - "doctype": "DocField", - "fieldname": "master_name", - "fieldtype": "Link", - "label": "Master Name", - "oldfieldname": "master_name", - "oldfieldtype": "Link", - "options": "[Select]" - }, - { - "doctype": "DocField", - "fieldname": "balance_must_be", - "fieldtype": "Select", - "label": "Balance must be", - "options": "\nDebit\nCredit" - }, - { - "doctype": "DocField", - "fieldname": "lft", - "fieldtype": "Int", - "hidden": 1, - "label": "Lft", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "rgt", - "fieldtype": "Int", - "hidden": 1, - "label": "Rgt", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "old_parent", - "fieldtype": "Data", - "hidden": 1, - "label": "Old Parent", - "print_hide": 1, - "read_only": 1 - }, - { - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "permlevel": 0, - "print": 1, - "role": "Accounts User", - "write": 1 - }, - { - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "email": 1, - "permlevel": 0, - "print": 1, - "role": "Auditor", - "write": 0 - }, - { - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "email": 1, - "permlevel": 0, - "print": 1, - "role": "Sales User", - "write": 0 - }, - { - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "email": 1, - "permlevel": 0, - "print": 1, - "role": "Purchase User", - "write": 0 - }, - { - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "permlevel": 2, - "role": "Auditor", - "write": 0 - }, - { - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "export": 0, - "import": 0, - "permlevel": 0, - "print": 1, - "restrict": 1, - "role": "Accounts Manager", - "write": 1 - }, - { - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "permlevel": 2, - "role": "Accounts Manager", - "write": 1 - }, - { - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "permlevel": 2, - "role": "Accounts User", - "write": 0 - } -] \ No newline at end of file +{ + "allow_copy": 1, + "allow_rename": 1, + "creation": "2013-01-30 12:49:46", + "description": "Heads (or groups) against which Accounting Entries are made and balances are maintained.", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "properties", + "fieldtype": "Section Break", + "label": "Account Details", + "oldfieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "account_name", + "fieldtype": "Data", + "in_filter": 1, + "label": "Account Name", + "no_copy": 1, + "oldfieldname": "account_name", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "level", + "fieldtype": "Int", + "hidden": 1, + "label": "Level", + "oldfieldname": "level", + "oldfieldtype": "Int", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "default": "Ledger", + "fieldname": "group_or_ledger", + "fieldtype": "Select", + "in_filter": 1, + "label": "Group or Ledger", + "oldfieldname": "group_or_ledger", + "oldfieldtype": "Select", + "options": "\nLedger\nGroup", + "permlevel": 0, + "read_only": 1, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "company", + "fieldtype": "Link", + "in_filter": 1, + "label": "Company", + "oldfieldname": "company", + "oldfieldtype": "Link", + "options": "Company", + "permlevel": 0, + "read_only": 1, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "parent_account", + "fieldtype": "Link", + "ignore_restrictions": 1, + "label": "Parent Account", + "oldfieldname": "parent_account", + "oldfieldtype": "Link", + "options": "Account", + "permlevel": 0, + "search_index": 1 + }, + { + "fieldname": "report_type", + "fieldtype": "Select", + "label": "Report Type", + "options": "\nBalance Sheet\nProfit and Loss", + "permlevel": 0 + }, + { + "description": "Setting Account Type helps in selecting this Account in transactions.", + "fieldname": "account_type", + "fieldtype": "Select", + "in_filter": 1, + "label": "Account Type", + "oldfieldname": "account_type", + "oldfieldtype": "Select", + "options": "Bank\nCash\nTax\nChargeable\nWarehouse\nReceivable\nPayable\nEquity\nFixed Asset\nCost of Goods Sold\nExpense Account\nIncome Account\nStock Received But Not Billed\nExpenses Included In Valuation\nStock Adjustment", + "permlevel": 0, + "search_index": 0 + }, + { + "description": "Rate at which this tax is applied", + "fieldname": "tax_rate", + "fieldtype": "Float", + "hidden": 0, + "label": "Rate", + "oldfieldname": "tax_rate", + "oldfieldtype": "Currency", + "permlevel": 0, + "reqd": 0 + }, + { + "description": "If the account is frozen, entries are allowed to restricted users.", + "fieldname": "freeze_account", + "fieldtype": "Select", + "label": "Frozen", + "oldfieldname": "freeze_account", + "oldfieldtype": "Select", + "options": "No\nYes", + "permlevel": 0 + }, + { + "fieldname": "credit_days", + "fieldtype": "Int", + "hidden": 1, + "label": "Credit Days", + "oldfieldname": "credit_days", + "oldfieldtype": "Int", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "credit_limit", + "fieldtype": "Currency", + "hidden": 1, + "label": "Credit Limit", + "oldfieldname": "credit_limit", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1 + }, + { + "description": "If this Account represents a Customer, Supplier or Employee, set it here.", + "fieldname": "master_type", + "fieldtype": "Select", + "label": "Master Type", + "oldfieldname": "master_type", + "oldfieldtype": "Select", + "options": "\nSupplier\nCustomer\nEmployee", + "permlevel": 0 + }, + { + "fieldname": "master_name", + "fieldtype": "Link", + "label": "Master Name", + "oldfieldname": "master_name", + "oldfieldtype": "Link", + "options": "[Select]", + "permlevel": 0 + }, + { + "fieldname": "balance_must_be", + "fieldtype": "Select", + "label": "Balance must be", + "options": "\nDebit\nCredit", + "permlevel": 0 + }, + { + "fieldname": "lft", + "fieldtype": "Int", + "hidden": 1, + "label": "Lft", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "rgt", + "fieldtype": "Int", + "hidden": 1, + "label": "Rgt", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "old_parent", + "fieldtype": "Data", + "hidden": 1, + "label": "Old Parent", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + } + ], + "icon": "icon-money", + "idx": 1, + "in_create": 1, + "modified": "2014-03-19 12:07:27", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Account", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts User", + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Auditor", + "submit": 0, + "write": 0 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales User", + "submit": 0, + "write": 0 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase User", + "submit": 0, + "write": 0 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "permlevel": 2, + "read": 1, + "report": 1, + "role": "Auditor", + "submit": 0, + "write": 0 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "export": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "restrict": 1, + "role": "Accounts Manager", + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "permlevel": 2, + "read": 1, + "report": 1, + "role": "Accounts Manager", + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "permlevel": 2, + "read": 1, + "report": 1, + "role": "Accounts User", + "submit": 0, + "write": 0 + } + ], + "search_fields": "group_or_ledger" +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/accounts_settings/accounts_settings.txt b/erpnext/accounts/doctype/accounts_settings/accounts_settings.txt index f36e21840d..32646133b5 100644 --- a/erpnext/accounts/doctype/accounts_settings/accounts_settings.txt +++ b/erpnext/accounts/doctype/accounts_settings/accounts_settings.txt @@ -1,85 +1,66 @@ -[ - { - "creation": "2013-06-24 15:49:57", - "docstatus": 0, - "modified": "2013-12-20 19:22:52", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "description": "Settings for Accounts", - "doctype": "DocType", - "icon": "icon-cog", - "issingle": 1, - "module": "Accounts", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Accounts Settings", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Accounts Settings", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "role": "Accounts Manager", - "write": 1 - }, - { - "doctype": "DocType", - "name": "Accounts Settings" - }, - { - "default": "1", - "description": "If enabled, the system will post accounting entries for inventory automatically.", - "doctype": "DocField", - "fieldname": "auto_accounting_for_stock", - "fieldtype": "Check", - "label": "Make Accounting Entry For Every Stock Movement" - }, - { - "description": "Accounting entry frozen up to this date, nobody can do / modify entry except role specified below.", - "doctype": "DocField", - "fieldname": "acc_frozen_upto", - "fieldtype": "Date", - "label": "Accounts Frozen Upto" - }, - { - "description": "Users with this role are allowed to create / modify accounting entry before frozen date", - "doctype": "DocField", - "fieldname": "bde_auth_role", - "fieldtype": "Link", - "label": "Allowed Role to Edit Entries Before Frozen Date", - "options": "Role" - }, - { - "description": "Users with this role are allowed to set frozen accounts and create / modify accounting entries against frozen accounts", - "doctype": "DocField", - "fieldname": "frozen_accounts_modifier", - "fieldtype": "Link", - "label": "Frozen Accounts Modifier", - "options": "Role" - }, - { - "description": "Role that is allowed to submit transactions that exceed credit limits set.", - "doctype": "DocField", - "fieldname": "credit_controller", - "fieldtype": "Link", - "label": "Credit Controller", - "options": "Role" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "creation": "2013-06-24 15:49:57", + "description": "Settings for Accounts", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "default": "1", + "description": "If enabled, the system will post accounting entries for inventory automatically.", + "fieldname": "auto_accounting_for_stock", + "fieldtype": "Check", + "label": "Make Accounting Entry For Every Stock Movement", + "permlevel": 0 + }, + { + "description": "Accounting entry frozen up to this date, nobody can do / modify entry except role specified below.", + "fieldname": "acc_frozen_upto", + "fieldtype": "Date", + "label": "Accounts Frozen Upto", + "permlevel": 0 + }, + { + "description": "Users with this role are allowed to create / modify accounting entry before frozen date", + "fieldname": "bde_auth_role", + "fieldtype": "Link", + "label": "Allowed Role to Edit Entries Before Frozen Date", + "options": "Role", + "permlevel": 0 + }, + { + "description": "Users with this role are allowed to set frozen accounts and create / modify accounting entries against frozen accounts", + "fieldname": "frozen_accounts_modifier", + "fieldtype": "Link", + "label": "Frozen Accounts Modifier", + "options": "Role", + "permlevel": 0 + }, + { + "description": "Role that is allowed to submit transactions that exceed credit limits set.", + "fieldname": "credit_controller", + "fieldtype": "Link", + "label": "Credit Controller", + "options": "Role", + "permlevel": 0 + } + ], + "icon": "icon-cog", + "idx": 1, + "issingle": 1, + "modified": "2013-12-20 19:22:52", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Accounts Settings", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "role": "Accounts Manager", + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.txt b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.txt index 3cd385b493..783c2954ce 100644 --- a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.txt +++ b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.txt @@ -1,115 +1,96 @@ -[ - { - "creation": "2013-01-10 16:34:05", - "docstatus": 0, - "modified": "2013-07-05 14:26:22", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_copy": 1, - "allow_email": 1, - "allow_print": 1, - "doctype": "DocType", - "hide_heading": 1, - "hide_toolbar": 1, - "icon": "icon-check", - "issingle": 1, - "module": "Accounts", - "name": "__common__", - "read_only": 1 - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Bank Reconciliation", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "amend": 0, - "cancel": 0, - "create": 1, - "doctype": "DocPerm", - "name": "__common__", - "parent": "Bank Reconciliation", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "read": 1, - "report": 0, - "role": "Accounts User", - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Bank Reconciliation" - }, - { - "description": "Select account head of the bank where cheque was deposited.", - "doctype": "DocField", - "fieldname": "bank_account", - "fieldtype": "Link", - "label": "Bank Account", - "options": "Account", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "hidden": 1, - "label": "Company", - "options": "Company", - "print_hide": 1, - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "from_date", - "fieldtype": "Date", - "label": "From Date", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "to_date", - "fieldtype": "Date", - "label": "To Date", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "get_non_reconciled_entries", - "fieldtype": "Button", - "label": "Get Non Reconciled Entries", - "options": "get_details" - }, - { - "doctype": "DocField", - "fieldname": "entries", - "fieldtype": "Table", - "label": "Entries", - "options": "Bank Reconciliation Detail" - }, - { - "doctype": "DocField", - "fieldname": "update_clearance_date", - "fieldtype": "Button", - "label": "Update Clearance Date", - "options": "update_details" - }, - { - "doctype": "DocField", - "fieldname": "total_amount", - "fieldtype": "Currency", - "label": "Total Amount", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "allow_copy": 1, + "allow_email": 1, + "allow_print": 1, + "creation": "2013-01-10 16:34:05", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "description": "Select account head of the bank where cheque was deposited.", + "fieldname": "bank_account", + "fieldtype": "Link", + "label": "Bank Account", + "options": "Account", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "company", + "fieldtype": "Link", + "hidden": 1, + "label": "Company", + "options": "Company", + "permlevel": 0, + "print_hide": 1, + "reqd": 0 + }, + { + "fieldname": "from_date", + "fieldtype": "Date", + "label": "From Date", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "to_date", + "fieldtype": "Date", + "label": "To Date", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "get_non_reconciled_entries", + "fieldtype": "Button", + "label": "Get Non Reconciled Entries", + "options": "get_details", + "permlevel": 0 + }, + { + "fieldname": "entries", + "fieldtype": "Table", + "label": "Entries", + "options": "Bank Reconciliation Detail", + "permlevel": 0 + }, + { + "fieldname": "update_clearance_date", + "fieldtype": "Button", + "label": "Update Clearance Date", + "options": "update_details", + "permlevel": 0 + }, + { + "fieldname": "total_amount", + "fieldtype": "Currency", + "label": "Total Amount", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1 + } + ], + "hide_heading": 1, + "hide_toolbar": 1, + "icon": "icon-check", + "idx": 1, + "issingle": 1, + "modified": "2013-07-05 14:26:22", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Bank Reconciliation", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "permlevel": 0, + "read": 1, + "report": 0, + "role": "Accounts User", + "submit": 0, + "write": 1 + } + ], + "read_only": 1 +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.txt b/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.txt index 47ff4f1344..386e3b7627 100644 --- a/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.txt +++ b/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.txt @@ -1,108 +1,109 @@ -[ - { - "creation": "2013-02-22 01:27:37", - "docstatus": 0, - "modified": "2013-12-20 19:22:55", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "istable": 1, - "module": "Accounts", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "no_copy": 0, - "parent": "Bank Reconciliation Detail", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0, - "search_index": 0 - }, - { - "doctype": "DocType", - "name": "Bank Reconciliation Detail" - }, - { - "doctype": "DocField", - "fieldname": "voucher_id", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Voucher ID", - "oldfieldname": "voucher_id", - "oldfieldtype": "Link", - "options": "Journal Voucher" - }, - { - "doctype": "DocField", - "fieldname": "against_account", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Against Account", - "oldfieldname": "against_account", - "oldfieldtype": "Data", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "posting_date", - "fieldtype": "Date", - "in_list_view": 1, - "label": "Posting Date", - "oldfieldname": "posting_date", - "oldfieldtype": "Date", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "clearance_date", - "fieldtype": "Date", - "in_list_view": 1, - "label": "Clearance Date", - "oldfieldname": "clearance_date", - "oldfieldtype": "Date" - }, - { - "doctype": "DocField", - "fieldname": "cheque_number", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Cheque Number", - "oldfieldname": "cheque_number", - "oldfieldtype": "Data", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "cheque_date", - "fieldtype": "Date", - "in_list_view": 1, - "label": "Cheque Date", - "oldfieldname": "cheque_date", - "oldfieldtype": "Date", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "debit", - "fieldtype": "Currency", - "label": "Debit", - "oldfieldname": "debit", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "credit", - "fieldtype": "Currency", - "label": "Credit", - "oldfieldname": "credit", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "read_only": 1 - } -] \ No newline at end of file +{ + "creation": "2013-02-22 01:27:37", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "voucher_id", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Voucher ID", + "no_copy": 0, + "oldfieldname": "voucher_id", + "oldfieldtype": "Link", + "options": "Journal Voucher", + "permlevel": 0, + "search_index": 0 + }, + { + "fieldname": "against_account", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Against Account", + "no_copy": 0, + "oldfieldname": "against_account", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1, + "search_index": 0 + }, + { + "fieldname": "posting_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "Posting Date", + "no_copy": 0, + "oldfieldname": "posting_date", + "oldfieldtype": "Date", + "permlevel": 0, + "read_only": 1, + "search_index": 0 + }, + { + "fieldname": "clearance_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "Clearance Date", + "no_copy": 0, + "oldfieldname": "clearance_date", + "oldfieldtype": "Date", + "permlevel": 0, + "search_index": 0 + }, + { + "fieldname": "cheque_number", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Cheque Number", + "no_copy": 0, + "oldfieldname": "cheque_number", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1, + "search_index": 0 + }, + { + "fieldname": "cheque_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "Cheque Date", + "no_copy": 0, + "oldfieldname": "cheque_date", + "oldfieldtype": "Date", + "permlevel": 0, + "read_only": 1, + "search_index": 0 + }, + { + "fieldname": "debit", + "fieldtype": "Currency", + "label": "Debit", + "no_copy": 0, + "oldfieldname": "debit", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1, + "search_index": 0 + }, + { + "fieldname": "credit", + "fieldtype": "Currency", + "label": "Credit", + "no_copy": 0, + "oldfieldname": "credit", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1, + "search_index": 0 + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:22:55", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Bank Reconciliation Detail", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/budget_detail/budget_detail.txt b/erpnext/accounts/doctype/budget_detail/budget_detail.txt index 31312c9208..0a95bc1e61 100644 --- a/erpnext/accounts/doctype/budget_detail/budget_detail.txt +++ b/erpnext/accounts/doctype/budget_detail/budget_detail.txt @@ -1,61 +1,52 @@ -[ - { - "creation": "2013-03-07 11:55:04", - "docstatus": 0, - "modified": "2013-12-20 19:22:59", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "CBD/.######", - "doctype": "DocType", - "istable": 1, - "module": "Accounts", - "name": "__common__" - }, - { - "doctype": "DocField", - "in_list_view": 1, - "name": "__common__", - "parent": "Budget Detail", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0, - "reqd": 1 - }, - { - "doctype": "DocType", - "name": "Budget Detail" - }, - { - "doctype": "DocField", - "fieldname": "account", - "fieldtype": "Link", - "in_filter": 1, - "label": "Account", - "oldfieldname": "account", - "oldfieldtype": "Link", - "options": "Account", - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "budget_allocated", - "fieldtype": "Currency", - "label": "Budget Allocated", - "oldfieldname": "budget_allocated", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency" - }, - { - "doctype": "DocField", - "fieldname": "fiscal_year", - "fieldtype": "Select", - "in_filter": 1, - "label": "Fiscal Year", - "oldfieldname": "fiscal_year", - "oldfieldtype": "Select", - "options": "link:Fiscal Year", - "search_index": 1 - } -] \ No newline at end of file +{ + "autoname": "CBD/.######", + "creation": "2013-03-07 11:55:04", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "account", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Account", + "oldfieldname": "account", + "oldfieldtype": "Link", + "options": "Account", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "budget_allocated", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Budget Allocated", + "oldfieldname": "budget_allocated", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Select", + "in_filter": 1, + "in_list_view": 1, + "label": "Fiscal Year", + "oldfieldname": "fiscal_year", + "oldfieldtype": "Select", + "options": "link:Fiscal Year", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:22:59", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Budget Detail", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/budget_distribution/budget_distribution.txt b/erpnext/accounts/doctype/budget_distribution/budget_distribution.txt index 48d6e7b54a..4034b1d146 100644 --- a/erpnext/accounts/doctype/budget_distribution/budget_distribution.txt +++ b/erpnext/accounts/doctype/budget_distribution/budget_distribution.txt @@ -1,96 +1,81 @@ -[ - { - "creation": "2013-01-10 16:34:05", - "docstatus": 0, - "modified": "2014-01-20 17:48:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "field:distribution_id", - "description": "**Budget Distribution** helps you distribute your budget across months if you have seasonality in your business.\n\nTo distribute a budget using this distribution, set this **Budget Distribution** in the **Cost Center**", - "doctype": "DocType", - "icon": "icon-bar-chart", - "module": "Accounts", - "name": "__common__", - "name_case": "Title Case" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Budget Distribution", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "cancel": 0, - "doctype": "DocPerm", - "name": "__common__", - "parent": "Budget Distribution", - "parentfield": "permissions", - "parenttype": "DocType", - "read": 1, - "report": 1, - "role": "Accounts Manager", - "submit": 0 - }, - { - "doctype": "DocType", - "name": "Budget Distribution" - }, - { - "description": "Name of the Budget Distribution", - "doctype": "DocField", - "fieldname": "distribution_id", - "fieldtype": "Data", - "label": "Distribution Name", - "oldfieldname": "distribution_id", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "fiscal_year", - "fieldtype": "Select", - "in_filter": 1, - "label": "Fiscal Year", - "oldfieldname": "fiscal_year", - "oldfieldtype": "Select", - "options": "link:Fiscal Year", - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "budget_distribution_details", - "fieldtype": "Table", - "label": "Budget Distribution Details", - "oldfieldname": "budget_distribution_details", - "oldfieldtype": "Table", - "options": "Budget Distribution Detail" - }, - { - "doctype": "DocField", - "fieldname": "trash_reason", - "fieldtype": "Small Text", - "label": "Trash Reason", - "oldfieldname": "trash_reason", - "oldfieldtype": "Small Text", - "read_only": 1 - }, - { - "amend": 0, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "permlevel": 0, - "print": 1, - "write": 1 - }, - { - "delete": 0, - "doctype": "DocPerm", - "permlevel": 2 - } -] \ No newline at end of file +{ + "autoname": "field:distribution_id", + "creation": "2013-01-10 16:34:05", + "description": "**Budget Distribution** helps you distribute your budget across months if you have seasonality in your business.\n\nTo distribute a budget using this distribution, set this **Budget Distribution** in the **Cost Center**", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "description": "Name of the Budget Distribution", + "fieldname": "distribution_id", + "fieldtype": "Data", + "label": "Distribution Name", + "oldfieldname": "distribution_id", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Select", + "in_filter": 1, + "label": "Fiscal Year", + "oldfieldname": "fiscal_year", + "oldfieldtype": "Select", + "options": "link:Fiscal Year", + "permlevel": 0, + "search_index": 1 + }, + { + "fieldname": "budget_distribution_details", + "fieldtype": "Table", + "label": "Budget Distribution Details", + "oldfieldname": "budget_distribution_details", + "oldfieldtype": "Table", + "options": "Budget Distribution Detail", + "permlevel": 0 + }, + { + "fieldname": "trash_reason", + "fieldtype": "Small Text", + "label": "Trash Reason", + "oldfieldname": "trash_reason", + "oldfieldtype": "Small Text", + "permlevel": 0, + "read_only": 1 + } + ], + "icon": "icon-bar-chart", + "idx": 1, + "modified": "2014-01-20 17:48:27", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Budget Distribution", + "name_case": "Title Case", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts Manager", + "submit": 0, + "write": 1 + }, + { + "cancel": 0, + "delete": 0, + "permlevel": 2, + "read": 1, + "report": 1, + "role": "Accounts Manager", + "submit": 0 + } + ] +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.txt b/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.txt index a171bf69cc..a36dd179c9 100644 --- a/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.txt +++ b/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.txt @@ -1,47 +1,35 @@ -[ - { - "creation": "2013-02-22 01:27:38", - "docstatus": 0, - "modified": "2013-12-20 19:22:59", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "BDD/.#####", - "doctype": "DocType", - "istable": 1, - "module": "Accounts", - "name": "__common__" - }, - { - "doctype": "DocField", - "in_list_view": 1, - "name": "__common__", - "parent": "Budget Distribution Detail", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Budget Distribution Detail" - }, - { - "doctype": "DocField", - "fieldname": "month", - "fieldtype": "Data", - "label": "Month", - "oldfieldname": "month", - "oldfieldtype": "Data", - "read_only": 1, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "percentage_allocation", - "fieldtype": "Float", - "label": "Percentage Allocation", - "oldfieldname": "percentage_allocation", - "oldfieldtype": "Currency" - } -] \ No newline at end of file +{ + "autoname": "BDD/.#####", + "creation": "2013-02-22 01:27:38", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "month", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Month", + "oldfieldname": "month", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1, + "reqd": 1 + }, + { + "fieldname": "percentage_allocation", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Percentage Allocation", + "oldfieldname": "percentage_allocation", + "oldfieldtype": "Currency", + "permlevel": 0 + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:22:59", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Budget Distribution Detail", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/c_form/c_form.txt b/erpnext/accounts/doctype/c_form/c_form.txt index d5ff32b33b..6445aeec16 100644 --- a/erpnext/accounts/doctype/c_form/c_form.txt +++ b/erpnext/accounts/doctype/c_form/c_form.txt @@ -1,193 +1,178 @@ -[ - { - "creation": "2013-03-07 11:55:06", - "docstatus": 0, - "modified": "2013-12-20 19:23:58", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_attach": 1, - "autoname": "naming_series:", - "doctype": "DocType", - "icon": "icon-file-text", - "is_submittable": 1, - "max_attachments": 3, - "module": "Accounts", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "C-Form", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocPerm", - "name": "__common__", - "parent": "C-Form", - "parentfield": "permissions", - "parenttype": "DocType", - "read": 1, - "report": 1, - "submit": 0 - }, - { - "doctype": "DocType", - "name": "C-Form" - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "print_width": "50%", - "read_only": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "naming_series", - "fieldtype": "Select", - "label": "Series", - "options": "\nC-FORM/", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "c_form_no", - "fieldtype": "Data", - "label": "C-Form No", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "received_date", - "fieldtype": "Date", - "label": "Received Date", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "customer", - "fieldtype": "Link", - "label": "Customer", - "options": "Customer", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "print_width": "50%", - "read_only": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Select", - "label": "Company", - "options": "link:Company", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "fiscal_year", - "fieldtype": "Select", - "label": "Fiscal Year", - "options": "link:Fiscal Year", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "quarter", - "fieldtype": "Select", - "label": "Quarter", - "options": "\nI\nII\nIII\nIV", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "total_amount", - "fieldtype": "Currency", - "label": "Total Amount", - "options": "Company:company:default_currency", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "state", - "fieldtype": "Data", - "label": "State", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "section_break0", - "fieldtype": "Section Break", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "invoice_details", - "fieldtype": "Table", - "label": "Invoice Details", - "options": "C-Form Invoice Detail", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "total_invoiced_amount", - "fieldtype": "Currency", - "label": "Total Invoiced Amount", - "options": "Company:company:default_currency", - "print_hide": 0, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "amended_from", - "fieldtype": "Link", - "ignore_restrictions": 1, - "label": "Amended From", - "no_copy": 1, - "options": "C-Form", - "print_hide": 1, - "read_only": 1 - }, - { - "create": 1, - "doctype": "DocPerm", - "email": 1, - "permlevel": 0, - "print": 1, - "role": "Accounts User", - "write": 1 - }, - { - "create": 1, - "doctype": "DocPerm", - "email": 1, - "permlevel": 0, - "print": 1, - "role": "Accounts Manager", - "write": 1 - }, - { - "amend": 0, - "cancel": 0, - "create": 0, - "doctype": "DocPerm", - "permlevel": 1, - "role": "All" - } -] \ No newline at end of file +{ + "allow_attach": 1, + "autoname": "naming_series:", + "creation": "2013-03-07 11:55:06", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "permlevel": 0, + "print_width": "50%", + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "naming_series", + "fieldtype": "Select", + "label": "Series", + "options": "\nC-FORM/", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "c_form_no", + "fieldtype": "Data", + "label": "C-Form No", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "received_date", + "fieldtype": "Date", + "label": "Received Date", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "customer", + "fieldtype": "Link", + "label": "Customer", + "options": "Customer", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "permlevel": 0, + "print_width": "50%", + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "company", + "fieldtype": "Select", + "label": "Company", + "options": "link:Company", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Select", + "label": "Fiscal Year", + "options": "link:Fiscal Year", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "quarter", + "fieldtype": "Select", + "label": "Quarter", + "options": "\nI\nII\nIII\nIV", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "total_amount", + "fieldtype": "Currency", + "label": "Total Amount", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "state", + "fieldtype": "Data", + "label": "State", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "section_break0", + "fieldtype": "Section Break", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "invoice_details", + "fieldtype": "Table", + "label": "Invoice Details", + "options": "C-Form Invoice Detail", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "total_invoiced_amount", + "fieldtype": "Currency", + "label": "Total Invoiced Amount", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 1 + }, + { + "fieldname": "amended_from", + "fieldtype": "Link", + "ignore_restrictions": 1, + "label": "Amended From", + "no_copy": 1, + "options": "C-Form", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + } + ], + "icon": "icon-file-text", + "idx": 1, + "is_submittable": 1, + "max_attachments": 3, + "modified": "2013-12-20 19:23:58", + "modified_by": "Administrator", + "module": "Accounts", + "name": "C-Form", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts User", + "submit": 0, + "write": 1 + }, + { + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts Manager", + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "permlevel": 1, + "read": 1, + "report": 1, + "role": "All", + "submit": 0 + } + ] +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.txt b/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.txt index 77dfa72430..97eef30534 100644 --- a/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.txt +++ b/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.txt @@ -1,77 +1,68 @@ -[ - { - "creation": "2013-02-22 01:27:38", - "docstatus": 0, - "modified": "2013-12-20 19:23:00", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "istable": 1, - "module": "Accounts", - "name": "__common__" - }, - { - "doctype": "DocField", - "in_list_view": 1, - "name": "__common__", - "parent": "C-Form Invoice Detail", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "C-Form Invoice Detail" - }, - { - "doctype": "DocField", - "fieldname": "invoice_no", - "fieldtype": "Link", - "label": "Invoice No", - "options": "Sales Invoice", - "print_width": "160px", - "width": "160px" - }, - { - "doctype": "DocField", - "fieldname": "invoice_date", - "fieldtype": "Date", - "label": "Invoice Date", - "print_width": "120px", - "read_only": 1, - "width": "120px" - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "territory", - "fieldtype": "Link", - "label": "Territory", - "options": "Territory", - "print_width": "120px", - "read_only": 1, - "width": "120px" - }, - { - "doctype": "DocField", - "fieldname": "net_total", - "fieldtype": "Currency", - "label": "Net Total", - "options": "Company:company:default_currency", - "print_width": "120px", - "read_only": 1, - "width": "120px" - }, - { - "doctype": "DocField", - "fieldname": "grand_total", - "fieldtype": "Currency", - "label": "Grand Total", - "options": "Company:company:default_currency", - "print_width": "120px", - "read_only": 1, - "width": "120px" - } -] \ No newline at end of file +{ + "creation": "2013-02-22 01:27:38", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "invoice_no", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Invoice No", + "options": "Sales Invoice", + "permlevel": 0, + "print_width": "160px", + "width": "160px" + }, + { + "fieldname": "invoice_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "Invoice Date", + "permlevel": 0, + "print_width": "120px", + "read_only": 1, + "width": "120px" + }, + { + "description": "Add / Edit", + "fieldname": "territory", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Territory", + "options": "Territory", + "permlevel": 0, + "print_width": "120px", + "read_only": 1, + "width": "120px" + }, + { + "fieldname": "net_total", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Net Total", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_width": "120px", + "read_only": 1, + "width": "120px" + }, + { + "fieldname": "grand_total", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Grand Total", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_width": "120px", + "read_only": 1, + "width": "120px" + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:23:00", + "modified_by": "Administrator", + "module": "Accounts", + "name": "C-Form Invoice Detail", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.txt b/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.txt index fc2a742791..4be1e9d3bc 100644 --- a/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.txt +++ b/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.txt @@ -1,78 +1,59 @@ -[ - { - "creation": "2014-03-05 14:11:31", - "docstatus": 0, - "modified": "2014-03-05 14:51:05", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "field:chart_name", - "description": "Financial Chart of Accounts. Imported from file.", - "doctype": "DocType", - "document_type": "Master", - "in_create": 1, - "module": "Accounts", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Chart of Accounts", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocPerm", - "export": 0, - "name": "__common__", - "parent": "Chart of Accounts", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Accounts Manager" - }, - { - "doctype": "DocType", - "name": "Chart of Accounts" - }, - { - "doctype": "DocField", - "fieldname": "chart_name", - "fieldtype": "Data", - "in_list_view": 0, - "label": "Chart Name", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "country", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Country", - "options": "Country", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "preview", - "fieldtype": "HTML", - "label": "Preview" - }, - { - "doctype": "DocField", - "fieldname": "source_file", - "fieldtype": "Data", - "hidden": 1, - "label": "Source File", - "read_only": 1, - "reqd": 0 - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "autoname": "field:chart_name", + "creation": "2014-03-05 14:11:31", + "description": "Financial Chart of Accounts. Imported from file.", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "chart_name", + "fieldtype": "Data", + "in_list_view": 0, + "label": "Chart Name", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "country", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Country", + "options": "Country", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "preview", + "fieldtype": "HTML", + "label": "Preview", + "permlevel": 0 + }, + { + "fieldname": "source_file", + "fieldtype": "Data", + "hidden": 1, + "label": "Source File", + "permlevel": 0, + "read_only": 1, + "reqd": 0 + } + ], + "idx": 1, + "in_create": 1, + "modified": "2014-03-05 14:51:05", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Chart of Accounts", + "owner": "Administrator", + "permissions": [ + { + "export": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts Manager" + } + ] +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/cost_center/cost_center.txt b/erpnext/accounts/doctype/cost_center/cost_center.txt index 66864bce4c..8201d3451e 100644 --- a/erpnext/accounts/doctype/cost_center/cost_center.txt +++ b/erpnext/accounts/doctype/cost_center/cost_center.txt @@ -1,202 +1,190 @@ -[ - { - "creation": "2013-01-23 19:57:17", - "docstatus": 0, - "modified": "2014-01-20 17:48:30", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_copy": 1, - "allow_import": 1, - "allow_rename": 1, - "autoname": "field:cost_center_name", - "description": "Track separate Income and Expense for product verticals or divisions.", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-money", - "in_create": 1, - "module": "Accounts", - "name": "__common__", - "search_fields": "name,parent_cost_center" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Cost Center", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "amend": 0, - "cancel": 0, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Cost Center", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 0 - }, - { - "doctype": "DocType", - "name": "Cost Center" - }, - { - "doctype": "DocField", - "fieldname": "sb0", - "fieldtype": "Section Break", - "label": "Cost Center Details" - }, - { - "doctype": "DocField", - "fieldname": "trash_reason", - "fieldtype": "Small Text", - "label": "Trash Reason", - "oldfieldname": "trash_reason", - "oldfieldtype": "Small Text", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "cost_center_name", - "fieldtype": "Data", - "in_filter": 0, - "label": "Cost Center Name", - "no_copy": 1, - "oldfieldname": "cost_center_name", - "oldfieldtype": "Data", - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "parent_cost_center", - "fieldtype": "Link", - "ignore_restrictions": 1, - "label": "Parent Cost Center", - "oldfieldname": "parent_cost_center", - "oldfieldtype": "Link", - "options": "Cost Center", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "label": "Company", - "oldfieldname": "company_name", - "oldfieldtype": "Link", - "options": "Company", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "cb0", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "group_or_ledger", - "fieldtype": "Select", - "hidden": 0, - "label": "Group or Ledger", - "no_copy": 1, - "oldfieldname": "group_or_ledger", - "oldfieldtype": "Select", - "options": "\nGroup\nLedger", - "print_hide": 1, - "report_hide": 1, - "reqd": 1 - }, - { - "description": "Define Budget for this Cost Center. To set budget action, see Company Master", - "doctype": "DocField", - "fieldname": "sb1", - "fieldtype": "Section Break", - "label": "Budget" - }, - { - "description": "Select Budget Distribution, if you want to track based on seasonality.", - "doctype": "DocField", - "fieldname": "distribution_id", - "fieldtype": "Link", - "label": "Distribution Id", - "oldfieldname": "distribution_id", - "oldfieldtype": "Link", - "options": "Budget Distribution" - }, - { - "description": "Add rows to set annual budgets on Accounts.", - "doctype": "DocField", - "fieldname": "budget_details", - "fieldtype": "Table", - "label": "Budget Details", - "oldfieldname": "budget_details", - "oldfieldtype": "Table", - "options": "Budget Detail" - }, - { - "doctype": "DocField", - "fieldname": "lft", - "fieldtype": "Int", - "hidden": 1, - "in_filter": 1, - "label": "lft", - "no_copy": 1, - "oldfieldname": "lft", - "oldfieldtype": "Int", - "print_hide": 1, - "report_hide": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "rgt", - "fieldtype": "Int", - "hidden": 1, - "in_filter": 1, - "label": "rgt", - "no_copy": 1, - "oldfieldname": "rgt", - "oldfieldtype": "Int", - "print_hide": 1, - "report_hide": 1, - "reqd": 0, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "old_parent", - "fieldtype": "Link", - "hidden": 1, - "ignore_restrictions": 1, - "label": "old_parent", - "no_copy": 1, - "oldfieldname": "old_parent", - "oldfieldtype": "Data", - "options": "Cost Center", - "print_hide": 1, - "report_hide": 1 - }, - { - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Accounts Manager", - "write": 1 - }, - { - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Accounts User", - "write": 0 - } -] \ No newline at end of file +{ + "allow_copy": 1, + "allow_import": 1, + "allow_rename": 1, + "autoname": "field:cost_center_name", + "creation": "2013-01-23 19:57:17", + "description": "Track separate Income and Expense for product verticals or divisions.", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "sb0", + "fieldtype": "Section Break", + "label": "Cost Center Details", + "permlevel": 0 + }, + { + "fieldname": "trash_reason", + "fieldtype": "Small Text", + "label": "Trash Reason", + "oldfieldname": "trash_reason", + "oldfieldtype": "Small Text", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "cost_center_name", + "fieldtype": "Data", + "in_filter": 0, + "label": "Cost Center Name", + "no_copy": 1, + "oldfieldname": "cost_center_name", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "parent_cost_center", + "fieldtype": "Link", + "ignore_restrictions": 1, + "label": "Parent Cost Center", + "oldfieldname": "parent_cost_center", + "oldfieldtype": "Link", + "options": "Cost Center", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "company", + "fieldtype": "Link", + "label": "Company", + "oldfieldname": "company_name", + "oldfieldtype": "Link", + "options": "Company", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "cb0", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "group_or_ledger", + "fieldtype": "Select", + "hidden": 0, + "label": "Group or Ledger", + "no_copy": 1, + "oldfieldname": "group_or_ledger", + "oldfieldtype": "Select", + "options": "\nGroup\nLedger", + "permlevel": 0, + "print_hide": 1, + "report_hide": 1, + "reqd": 1 + }, + { + "description": "Define Budget for this Cost Center. To set budget action, see Company Master", + "fieldname": "sb1", + "fieldtype": "Section Break", + "label": "Budget", + "permlevel": 0 + }, + { + "description": "Select Budget Distribution, if you want to track based on seasonality.", + "fieldname": "distribution_id", + "fieldtype": "Link", + "label": "Distribution Id", + "oldfieldname": "distribution_id", + "oldfieldtype": "Link", + "options": "Budget Distribution", + "permlevel": 0 + }, + { + "description": "Add rows to set annual budgets on Accounts.", + "fieldname": "budget_details", + "fieldtype": "Table", + "label": "Budget Details", + "oldfieldname": "budget_details", + "oldfieldtype": "Table", + "options": "Budget Detail", + "permlevel": 0 + }, + { + "fieldname": "lft", + "fieldtype": "Int", + "hidden": 1, + "in_filter": 1, + "label": "lft", + "no_copy": 1, + "oldfieldname": "lft", + "oldfieldtype": "Int", + "permlevel": 0, + "print_hide": 1, + "report_hide": 1, + "search_index": 1 + }, + { + "fieldname": "rgt", + "fieldtype": "Int", + "hidden": 1, + "in_filter": 1, + "label": "rgt", + "no_copy": 1, + "oldfieldname": "rgt", + "oldfieldtype": "Int", + "permlevel": 0, + "print_hide": 1, + "report_hide": 1, + "reqd": 0, + "search_index": 1 + }, + { + "fieldname": "old_parent", + "fieldtype": "Link", + "hidden": 1, + "ignore_restrictions": 1, + "label": "old_parent", + "no_copy": 1, + "oldfieldname": "old_parent", + "oldfieldtype": "Data", + "options": "Cost Center", + "permlevel": 0, + "print_hide": 1, + "report_hide": 1 + } + ], + "icon": "icon-money", + "idx": 1, + "in_create": 1, + "modified": "2014-01-20 17:48:30", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Cost Center", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts Manager", + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts User", + "submit": 0, + "write": 0 + } + ], + "search_fields": "name,parent_cost_center" +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/fiscal_year/fiscal_year.txt b/erpnext/accounts/doctype/fiscal_year/fiscal_year.txt index 27fac8df25..639b2764f4 100644 --- a/erpnext/accounts/doctype/fiscal_year/fiscal_year.txt +++ b/erpnext/accounts/doctype/fiscal_year/fiscal_year.txt @@ -1,98 +1,82 @@ -[ - { - "creation": "2013-01-22 16:50:25", - "docstatus": 0, - "modified": "2014-01-20 17:48:46", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "autoname": "field:year", - "description": "**Fiscal Year** represents a Financial Year. All accounting entries and other major transactions are tracked against **Fiscal Year**.", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-calendar", - "module": "Accounts", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Fiscal Year", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Fiscal Year", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1 - }, - { - "doctype": "DocType", - "name": "Fiscal Year" - }, - { - "description": "For e.g. 2012, 2012-13", - "doctype": "DocField", - "fieldname": "year", - "fieldtype": "Data", - "label": "Year Name", - "oldfieldname": "year", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "year_start_date", - "fieldtype": "Date", - "label": "Year Start Date", - "no_copy": 1, - "oldfieldname": "year_start_date", - "oldfieldtype": "Date", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "year_end_date", - "fieldtype": "Date", - "label": "Year End Date", - "no_copy": 1, - "reqd": 1 - }, - { - "default": "No", - "description": "Entries are not allowed against this Fiscal Year if the year is closed.", - "doctype": "DocField", - "fieldname": "is_fiscal_year_closed", - "fieldtype": "Select", - "label": "Year Closed", - "no_copy": 1, - "oldfieldname": "is_fiscal_year_closed", - "oldfieldtype": "Select", - "options": "\nNo\nYes", - "reqd": 0 - }, - { - "cancel": 0, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "report": 1, - "role": "System Manager", - "submit": 0, - "write": 1 - }, - { - "delete": 0, - "doctype": "DocPerm", - "role": "All" - } -] \ No newline at end of file +{ + "allow_import": 1, + "autoname": "field:year", + "creation": "2013-01-22 16:50:25", + "description": "**Fiscal Year** represents a Financial Year. All accounting entries and other major transactions are tracked against **Fiscal Year**.", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "description": "For e.g. 2012, 2012-13", + "fieldname": "year", + "fieldtype": "Data", + "label": "Year Name", + "oldfieldname": "year", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "year_start_date", + "fieldtype": "Date", + "label": "Year Start Date", + "no_copy": 1, + "oldfieldname": "year_start_date", + "oldfieldtype": "Date", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "year_end_date", + "fieldtype": "Date", + "label": "Year End Date", + "no_copy": 1, + "permlevel": 0, + "reqd": 1 + }, + { + "default": "No", + "description": "Entries are not allowed against this Fiscal Year if the year is closed.", + "fieldname": "is_fiscal_year_closed", + "fieldtype": "Select", + "label": "Year Closed", + "no_copy": 1, + "oldfieldname": "is_fiscal_year_closed", + "oldfieldtype": "Select", + "options": "\nNo\nYes", + "permlevel": 0, + "reqd": 0 + } + ], + "icon": "icon-calendar", + "idx": 1, + "modified": "2014-01-20 17:48:46", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Fiscal Year", + "owner": "Administrator", + "permissions": [ + { + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "submit": 0, + "write": 1 + }, + { + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "role": "All" + } + ] +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.txt b/erpnext/accounts/doctype/gl_entry/gl_entry.txt index 3ec5ec6c74..66c9f6c3c2 100644 --- a/erpnext/accounts/doctype/gl_entry/gl_entry.txt +++ b/erpnext/accounts/doctype/gl_entry/gl_entry.txt @@ -1,234 +1,229 @@ -[ - { - "creation": "2013-01-10 16:34:06", - "docstatus": 0, - "modified": "2013-12-20 19:24:08", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "GL.#######", - "doctype": "DocType", - "icon": "icon-list", - "in_create": 1, - "module": "Accounts", - "name": "__common__", - "search_fields": "voucher_no,account,posting_date,against_voucher" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "GL Entry", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "create": 0, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "GL Entry", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 0, - "write": 0 - }, - { - "doctype": "DocType", - "name": "GL Entry" - }, - { - "doctype": "DocField", - "fieldname": "posting_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Posting Date", - "oldfieldname": "posting_date", - "oldfieldtype": "Date", - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "transaction_date", - "fieldtype": "Date", - "label": "Transaction Date", - "oldfieldname": "transaction_date", - "oldfieldtype": "Date" - }, - { - "doctype": "DocField", - "fieldname": "aging_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Aging Date", - "oldfieldname": "aging_date", - "oldfieldtype": "Date", - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "account", - "fieldtype": "Link", - "in_filter": 1, - "label": "Account", - "oldfieldname": "account", - "oldfieldtype": "Link", - "options": "Account", - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "cost_center", - "fieldtype": "Link", - "in_filter": 1, - "label": "Cost Center", - "oldfieldname": "cost_center", - "oldfieldtype": "Link", - "options": "Cost Center", - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "debit", - "fieldtype": "Currency", - "label": "Debit Amt", - "oldfieldname": "debit", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency" - }, - { - "doctype": "DocField", - "fieldname": "credit", - "fieldtype": "Currency", - "label": "Credit Amt", - "oldfieldname": "credit", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency" - }, - { - "doctype": "DocField", - "fieldname": "against", - "fieldtype": "Text", - "in_filter": 1, - "label": "Against", - "oldfieldname": "against", - "oldfieldtype": "Text" - }, - { - "doctype": "DocField", - "fieldname": "against_voucher", - "fieldtype": "Data", - "in_filter": 1, - "label": "Against Voucher", - "oldfieldname": "against_voucher", - "oldfieldtype": "Data", - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "against_voucher_type", - "fieldtype": "Data", - "in_filter": 0, - "label": "Against Voucher Type", - "oldfieldname": "against_voucher_type", - "oldfieldtype": "Data", - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "voucher_type", - "fieldtype": "Select", - "in_filter": 1, - "label": "Voucher Type", - "oldfieldname": "voucher_type", - "oldfieldtype": "Select", - "options": "Journal Voucher\nSales Invoice\nPurchase Invoice", - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "voucher_no", - "fieldtype": "Data", - "in_filter": 1, - "label": "Voucher No", - "oldfieldname": "voucher_no", - "oldfieldtype": "Data", - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "remarks", - "fieldtype": "Text", - "in_filter": 1, - "label": "Remarks", - "no_copy": 1, - "oldfieldname": "remarks", - "oldfieldtype": "Text", - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "is_opening", - "fieldtype": "Select", - "in_filter": 1, - "label": "Is Opening", - "oldfieldname": "is_opening", - "oldfieldtype": "Select", - "options": "No\nYes", - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "is_advance", - "fieldtype": "Select", - "in_filter": 0, - "label": "Is Advance", - "oldfieldname": "is_advance", - "oldfieldtype": "Select", - "options": "No\nYes", - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "fiscal_year", - "fieldtype": "Select", - "in_filter": 1, - "label": "Fiscal Year", - "oldfieldname": "fiscal_year", - "oldfieldtype": "Select", - "options": "link:Fiscal Year", - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "in_filter": 1, - "label": "Company", - "oldfieldname": "company", - "oldfieldtype": "Link", - "options": "Company", - "search_index": 0 - }, - { - "amend": 0, - "cancel": 0, - "doctype": "DocPerm", - "role": "Accounts User" - }, - { - "amend": 0, - "cancel": 0, - "doctype": "DocPerm", - "role": "Accounts Manager" - }, - { - "doctype": "DocPerm", - "role": "System Manager" - } -] \ No newline at end of file +{ + "autoname": "GL.#######", + "creation": "2013-01-10 16:34:06", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "posting_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Posting Date", + "oldfieldname": "posting_date", + "oldfieldtype": "Date", + "permlevel": 0, + "search_index": 1 + }, + { + "fieldname": "transaction_date", + "fieldtype": "Date", + "label": "Transaction Date", + "oldfieldname": "transaction_date", + "oldfieldtype": "Date", + "permlevel": 0 + }, + { + "fieldname": "aging_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Aging Date", + "oldfieldname": "aging_date", + "oldfieldtype": "Date", + "permlevel": 0, + "search_index": 0 + }, + { + "fieldname": "account", + "fieldtype": "Link", + "in_filter": 1, + "label": "Account", + "oldfieldname": "account", + "oldfieldtype": "Link", + "options": "Account", + "permlevel": 0, + "search_index": 1 + }, + { + "fieldname": "cost_center", + "fieldtype": "Link", + "in_filter": 1, + "label": "Cost Center", + "oldfieldname": "cost_center", + "oldfieldtype": "Link", + "options": "Cost Center", + "permlevel": 0, + "search_index": 0 + }, + { + "fieldname": "debit", + "fieldtype": "Currency", + "label": "Debit Amt", + "oldfieldname": "debit", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0 + }, + { + "fieldname": "credit", + "fieldtype": "Currency", + "label": "Credit Amt", + "oldfieldname": "credit", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0 + }, + { + "fieldname": "against", + "fieldtype": "Text", + "in_filter": 1, + "label": "Against", + "oldfieldname": "against", + "oldfieldtype": "Text", + "permlevel": 0 + }, + { + "fieldname": "against_voucher", + "fieldtype": "Data", + "in_filter": 1, + "label": "Against Voucher", + "oldfieldname": "against_voucher", + "oldfieldtype": "Data", + "permlevel": 0, + "search_index": 0 + }, + { + "fieldname": "against_voucher_type", + "fieldtype": "Data", + "in_filter": 0, + "label": "Against Voucher Type", + "oldfieldname": "against_voucher_type", + "oldfieldtype": "Data", + "permlevel": 0, + "search_index": 0 + }, + { + "fieldname": "voucher_type", + "fieldtype": "Select", + "in_filter": 1, + "label": "Voucher Type", + "oldfieldname": "voucher_type", + "oldfieldtype": "Select", + "options": "Journal Voucher\nSales Invoice\nPurchase Invoice", + "permlevel": 0, + "search_index": 0 + }, + { + "fieldname": "voucher_no", + "fieldtype": "Data", + "in_filter": 1, + "label": "Voucher No", + "oldfieldname": "voucher_no", + "oldfieldtype": "Data", + "permlevel": 0, + "search_index": 1 + }, + { + "fieldname": "remarks", + "fieldtype": "Text", + "in_filter": 1, + "label": "Remarks", + "no_copy": 1, + "oldfieldname": "remarks", + "oldfieldtype": "Text", + "permlevel": 0, + "search_index": 0 + }, + { + "fieldname": "is_opening", + "fieldtype": "Select", + "in_filter": 1, + "label": "Is Opening", + "oldfieldname": "is_opening", + "oldfieldtype": "Select", + "options": "No\nYes", + "permlevel": 0, + "search_index": 0 + }, + { + "fieldname": "is_advance", + "fieldtype": "Select", + "in_filter": 0, + "label": "Is Advance", + "oldfieldname": "is_advance", + "oldfieldtype": "Select", + "options": "No\nYes", + "permlevel": 0, + "search_index": 0 + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Select", + "in_filter": 1, + "label": "Fiscal Year", + "oldfieldname": "fiscal_year", + "oldfieldtype": "Select", + "options": "link:Fiscal Year", + "permlevel": 0, + "search_index": 0 + }, + { + "fieldname": "company", + "fieldtype": "Link", + "in_filter": 1, + "label": "Company", + "oldfieldname": "company", + "oldfieldtype": "Link", + "options": "Company", + "permlevel": 0, + "search_index": 0 + } + ], + "icon": "icon-list", + "idx": 1, + "in_create": 1, + "modified": "2013-12-20 19:24:08", + "modified_by": "Administrator", + "module": "Accounts", + "name": "GL Entry", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts User", + "submit": 0, + "write": 0 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts Manager", + "submit": 0, + "write": 0 + }, + { + "create": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "submit": 0, + "write": 0 + } + ], + "search_fields": "voucher_no,account,posting_date,against_voucher" +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher.txt b/erpnext/accounts/doctype/journal_voucher/journal_voucher.txt index 73710f935d..72fdc4817d 100644 --- a/erpnext/accounts/doctype/journal_voucher/journal_voucher.txt +++ b/erpnext/accounts/doctype/journal_voucher/journal_voucher.txt @@ -1,503 +1,492 @@ -[ - { - "creation": "2013-03-25 10:53:52", - "docstatus": 0, - "modified": "2014-01-20 17:48:51", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "autoname": "naming_series:", - "doctype": "DocType", - "icon": "icon-file-text", - "is_submittable": 1, - "module": "Accounts", - "name": "__common__", - "read_only_onload": 1, - "search_fields": "voucher_type,posting_date, due_date, cheque_no" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Journal Voucher", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Journal Voucher", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1 - }, - { - "doctype": "DocType", - "name": "Journal Voucher" - }, - { - "doctype": "DocField", - "fieldname": "voucher_type_and_date", - "fieldtype": "Section Break", - "label": "Voucher Type and Date", - "options": "icon-flag" - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "naming_series", - "fieldtype": "Select", - "label": "Series", - "no_copy": 1, - "oldfieldname": "naming_series", - "oldfieldtype": "Select", - "options": "JV", - "print_hide": 1, - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "voucher_type", - "fieldtype": "Select", - "in_filter": 1, - "in_list_view": 1, - "label": "Voucher Type", - "oldfieldname": "voucher_type", - "oldfieldtype": "Select", - "options": "\nJournal Entry\nBank Voucher\nCash Voucher\nCredit Card Voucher\nDebit Note\nCredit Note\nContra Voucher\nExcise Voucher\nWrite Off Voucher\nOpening Entry", - "print_hide": 0, - "read_only": 0, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "posting_date", - "fieldtype": "Date", - "in_filter": 1, - "in_list_view": 1, - "label": "Posting Date", - "no_copy": 1, - "oldfieldname": "posting_date", - "oldfieldtype": "Date", - "read_only": 0, - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "2_add_edit_gl_entries", - "fieldtype": "Section Break", - "label": "Journal Entries", - "oldfieldtype": "Section Break", - "options": "icon-table", - "read_only": 0 - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "entries", - "fieldtype": "Table", - "label": "Entries", - "oldfieldname": "entries", - "oldfieldtype": "Table", - "options": "Journal Voucher Detail", - "print_hide": 0, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "section_break99", - "fieldtype": "Section Break", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "total_debit", - "fieldtype": "Currency", - "in_filter": 1, - "in_list_view": 1, - "label": "Total Debit", - "no_copy": 1, - "oldfieldname": "total_debit", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "total_credit", - "fieldtype": "Currency", - "in_filter": 1, - "label": "Total Credit", - "no_copy": 1, - "oldfieldname": "total_credit", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break99", - "fieldtype": "Column Break", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "difference", - "fieldtype": "Currency", - "label": "Difference", - "no_copy": 1, - "oldfieldname": "difference", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "get_balance", - "fieldtype": "Button", - "label": "Make Difference Entry", - "oldfieldtype": "Button", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "reference", - "fieldtype": "Section Break", - "label": "Reference", - "options": "icon-pushpin", - "read_only": 0 - }, - { - "description": "eg. Cheque Number", - "doctype": "DocField", - "fieldname": "cheque_no", - "fieldtype": "Data", - "in_filter": 1, - "in_list_view": 1, - "label": "Reference Number", - "no_copy": 1, - "oldfieldname": "cheque_no", - "oldfieldtype": "Data", - "read_only": 0, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "cheque_date", - "fieldtype": "Date", - "label": "Reference Date", - "no_copy": 1, - "oldfieldname": "cheque_date", - "oldfieldtype": "Date", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "clearance_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Clearance Date", - "no_copy": 1, - "oldfieldname": "clearance_date", - "oldfieldtype": "Date", - "print_hide": 0, - "read_only": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break98", - "fieldtype": "Column Break", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "user_remark", - "fieldtype": "Small Text", - "in_filter": 1, - "label": "User Remark", - "no_copy": 1, - "oldfieldname": "user_remark", - "oldfieldtype": "Small Text", - "read_only": 0 - }, - { - "description": "User Remark will be added to Auto Remark", - "doctype": "DocField", - "fieldname": "remark", - "fieldtype": "Small Text", - "in_list_view": 0, - "label": "Remark", - "no_copy": 1, - "oldfieldname": "remark", - "oldfieldtype": "Small Text", - "read_only": 1, - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "bill_no", - "fieldtype": "Data", - "in_list_view": 0, - "label": "Bill No", - "oldfieldname": "bill_no", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "bill_date", - "fieldtype": "Date", - "label": "Bill Date", - "oldfieldname": "bill_date", - "oldfieldtype": "Date", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "due_date", - "fieldtype": "Date", - "label": "Due Date", - "oldfieldname": "due_date", - "oldfieldtype": "Date", - "print_hide": 0, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "addtional_info", - "fieldtype": "Section Break", - "label": "More Info", - "oldfieldtype": "Section Break", - "options": "icon-file-text", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break2", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "default": "No", - "description": "Considered as Opening Balance", - "doctype": "DocField", - "fieldname": "is_opening", - "fieldtype": "Select", - "in_filter": 1, - "label": "Is Opening", - "oldfieldname": "is_opening", - "oldfieldtype": "Select", - "options": "No\nYes", - "print_hide": 1, - "read_only": 0, - "search_index": 1 - }, - { - "description": "Actual Posting Date", - "doctype": "DocField", - "fieldname": "aging_date", - "fieldtype": "Date", - "label": "Aging Date", - "no_copy": 0, - "oldfieldname": "aging_date", - "oldfieldtype": "Date", - "print_hide": 1, - "read_only": 0 - }, - { - "default": "Accounts Receivable", - "depends_on": "eval:doc.voucher_type == 'Write Off Voucher'", - "doctype": "DocField", - "fieldname": "write_off_based_on", - "fieldtype": "Select", - "label": "Write Off Based On", - "options": "Accounts Receivable\nAccounts Payable", - "print_hide": 1, - "read_only": 0, - "report_hide": 1 - }, - { - "depends_on": "eval:doc.voucher_type == 'Write Off Voucher'", - "doctype": "DocField", - "fieldname": "write_off_amount", - "fieldtype": "Currency", - "label": "Write Off Amount <=", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 0, - "report_hide": 1 - }, - { - "depends_on": "eval:doc.voucher_type == 'Write Off Voucher'", - "doctype": "DocField", - "fieldname": "get_outstanding_invoices", - "fieldtype": "Button", - "label": "Get Outstanding Invoices", - "options": "get_outstanding_invoices", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "letter_head", - "fieldtype": "Link", - "label": "Letter Head", - "options": "Letter Head" - }, - { - "doctype": "DocField", - "fieldname": "column_break3", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "pay_to_recd_from", - "fieldtype": "Data", - "hidden": 0, - "label": "Pay To / Recd From", - "no_copy": 1, - "print_hide": 0, - "read_only": 0, - "report_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "total_amount", - "fieldtype": "Data", - "hidden": 1, - "in_list_view": 0, - "label": "Total Amount", - "no_copy": 1, - "print_hide": 1, - "read_only": 1, - "report_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "total_amount_in_words", - "fieldtype": "Data", - "hidden": 1, - "label": "Total Amount in Words", - "no_copy": 1, - "print_hide": 1, - "read_only": 1, - "report_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "fiscal_year", - "fieldtype": "Select", - "in_filter": 1, - "label": "Fiscal Year", - "oldfieldname": "fiscal_year", - "oldfieldtype": "Select", - "options": "link:Fiscal Year", - "print_hide": 1, - "read_only": 0, - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "in_filter": 1, - "label": "Company", - "oldfieldname": "company", - "oldfieldtype": "Link", - "options": "Company", - "print_hide": 1, - "read_only": 0, - "reqd": 1, - "search_index": 1 - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "select_print_heading", - "fieldtype": "Link", - "label": "Print Heading", - "no_copy": 1, - "oldfieldname": "select_print_heading", - "oldfieldtype": "Link", - "options": "Print Heading", - "print_hide": 1, - "read_only": 0, - "report_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "amended_from", - "fieldtype": "Link", - "ignore_restrictions": 1, - "label": "Amended From", - "no_copy": 1, - "oldfieldname": "amended_from", - "oldfieldtype": "Link", - "options": "Journal Voucher", - "print_hide": 1, - "read_only": 1 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Accounts User", - "submit": 1, - "write": 1 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Accounts Manager", - "submit": 1, - "write": 1 - }, - { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Auditor", - "submit": 0, - "write": 0 - } -] \ No newline at end of file +{ + "allow_import": 1, + "autoname": "naming_series:", + "creation": "2013-03-25 10:53:52", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "voucher_type_and_date", + "fieldtype": "Section Break", + "label": "Voucher Type and Date", + "options": "icon-flag", + "permlevel": 0 + }, + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "naming_series", + "fieldtype": "Select", + "label": "Series", + "no_copy": 1, + "oldfieldname": "naming_series", + "oldfieldtype": "Select", + "options": "JV", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "voucher_type", + "fieldtype": "Select", + "in_filter": 1, + "in_list_view": 1, + "label": "Voucher Type", + "oldfieldname": "voucher_type", + "oldfieldtype": "Select", + "options": "\nJournal Entry\nBank Voucher\nCash Voucher\nCredit Card Voucher\nDebit Note\nCredit Note\nContra Voucher\nExcise Voucher\nWrite Off Voucher\nOpening Entry", + "permlevel": 0, + "print_hide": 0, + "read_only": 0, + "search_index": 1 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "posting_date", + "fieldtype": "Date", + "in_filter": 1, + "in_list_view": 1, + "label": "Posting Date", + "no_copy": 1, + "oldfieldname": "posting_date", + "oldfieldtype": "Date", + "permlevel": 0, + "read_only": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "2_add_edit_gl_entries", + "fieldtype": "Section Break", + "label": "Journal Entries", + "oldfieldtype": "Section Break", + "options": "icon-table", + "permlevel": 0, + "read_only": 0 + }, + { + "allow_on_submit": 1, + "fieldname": "entries", + "fieldtype": "Table", + "label": "Entries", + "oldfieldname": "entries", + "oldfieldtype": "Table", + "options": "Journal Voucher Detail", + "permlevel": 0, + "print_hide": 0, + "read_only": 0 + }, + { + "fieldname": "section_break99", + "fieldtype": "Section Break", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "total_debit", + "fieldtype": "Currency", + "in_filter": 1, + "in_list_view": 1, + "label": "Total Debit", + "no_copy": 1, + "oldfieldname": "total_debit", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "total_credit", + "fieldtype": "Currency", + "in_filter": 1, + "label": "Total Credit", + "no_copy": 1, + "oldfieldname": "total_credit", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "column_break99", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "difference", + "fieldtype": "Currency", + "label": "Difference", + "no_copy": 1, + "oldfieldname": "difference", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "get_balance", + "fieldtype": "Button", + "label": "Make Difference Entry", + "oldfieldtype": "Button", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "reference", + "fieldtype": "Section Break", + "label": "Reference", + "options": "icon-pushpin", + "permlevel": 0, + "read_only": 0 + }, + { + "description": "eg. Cheque Number", + "fieldname": "cheque_no", + "fieldtype": "Data", + "in_filter": 1, + "in_list_view": 1, + "label": "Reference Number", + "no_copy": 1, + "oldfieldname": "cheque_no", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 0, + "search_index": 1 + }, + { + "fieldname": "cheque_date", + "fieldtype": "Date", + "label": "Reference Date", + "no_copy": 1, + "oldfieldname": "cheque_date", + "oldfieldtype": "Date", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "clearance_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Clearance Date", + "no_copy": 1, + "oldfieldname": "clearance_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 0, + "read_only": 1, + "search_index": 1 + }, + { + "fieldname": "column_break98", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "user_remark", + "fieldtype": "Small Text", + "in_filter": 1, + "label": "User Remark", + "no_copy": 1, + "oldfieldname": "user_remark", + "oldfieldtype": "Small Text", + "permlevel": 0, + "read_only": 0 + }, + { + "description": "User Remark will be added to Auto Remark", + "fieldname": "remark", + "fieldtype": "Small Text", + "in_list_view": 0, + "label": "Remark", + "no_copy": 1, + "oldfieldname": "remark", + "oldfieldtype": "Small Text", + "permlevel": 0, + "read_only": 1, + "reqd": 0 + }, + { + "fieldname": "bill_no", + "fieldtype": "Data", + "in_list_view": 0, + "label": "Bill No", + "oldfieldname": "bill_no", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "bill_date", + "fieldtype": "Date", + "label": "Bill Date", + "oldfieldname": "bill_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "due_date", + "fieldtype": "Date", + "label": "Due Date", + "oldfieldname": "due_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 0, + "read_only": 0 + }, + { + "fieldname": "addtional_info", + "fieldtype": "Section Break", + "label": "More Info", + "oldfieldtype": "Section Break", + "options": "icon-file-text", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "column_break2", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "default": "No", + "description": "Considered as Opening Balance", + "fieldname": "is_opening", + "fieldtype": "Select", + "in_filter": 1, + "label": "Is Opening", + "oldfieldname": "is_opening", + "oldfieldtype": "Select", + "options": "No\nYes", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "search_index": 1 + }, + { + "description": "Actual Posting Date", + "fieldname": "aging_date", + "fieldtype": "Date", + "label": "Aging Date", + "no_copy": 0, + "oldfieldname": "aging_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "default": "Accounts Receivable", + "depends_on": "eval:doc.voucher_type == 'Write Off Voucher'", + "fieldname": "write_off_based_on", + "fieldtype": "Select", + "label": "Write Off Based On", + "options": "Accounts Receivable\nAccounts Payable", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 1 + }, + { + "depends_on": "eval:doc.voucher_type == 'Write Off Voucher'", + "fieldname": "write_off_amount", + "fieldtype": "Currency", + "label": "Write Off Amount <=", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 1 + }, + { + "depends_on": "eval:doc.voucher_type == 'Write Off Voucher'", + "fieldname": "get_outstanding_invoices", + "fieldtype": "Button", + "label": "Get Outstanding Invoices", + "options": "get_outstanding_invoices", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "letter_head", + "fieldtype": "Link", + "label": "Letter Head", + "options": "Letter Head", + "permlevel": 0 + }, + { + "fieldname": "column_break3", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "pay_to_recd_from", + "fieldtype": "Data", + "hidden": 0, + "label": "Pay To / Recd From", + "no_copy": 1, + "permlevel": 0, + "print_hide": 0, + "read_only": 0, + "report_hide": 1 + }, + { + "fieldname": "total_amount", + "fieldtype": "Data", + "hidden": 1, + "in_list_view": 0, + "label": "Total Amount", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "report_hide": 1 + }, + { + "fieldname": "total_amount_in_words", + "fieldtype": "Data", + "hidden": 1, + "label": "Total Amount in Words", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "report_hide": 1 + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Select", + "in_filter": 1, + "label": "Fiscal Year", + "oldfieldname": "fiscal_year", + "oldfieldtype": "Select", + "options": "link:Fiscal Year", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "company", + "fieldtype": "Link", + "in_filter": 1, + "label": "Company", + "oldfieldname": "company", + "oldfieldtype": "Link", + "options": "Company", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1, + "search_index": 1 + }, + { + "allow_on_submit": 1, + "fieldname": "select_print_heading", + "fieldtype": "Link", + "label": "Print Heading", + "no_copy": 1, + "oldfieldname": "select_print_heading", + "oldfieldtype": "Link", + "options": "Print Heading", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 1 + }, + { + "fieldname": "amended_from", + "fieldtype": "Link", + "ignore_restrictions": 1, + "label": "Amended From", + "no_copy": 1, + "oldfieldname": "amended_from", + "oldfieldtype": "Link", + "options": "Journal Voucher", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + } + ], + "icon": "icon-file-text", + "idx": 1, + "is_submittable": 1, + "modified": "2014-01-20 17:48:51", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Journal Voucher", + "owner": "Administrator", + "permissions": [ + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts User", + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts Manager", + "submit": 1, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Auditor", + "submit": 0, + "write": 0 + } + ], + "read_only_onload": 1, + "search_fields": "voucher_type,posting_date, due_date, cheque_no" +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt b/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt index c03e025c07..aa4dda6d3b 100644 --- a/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt +++ b/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt @@ -1,179 +1,166 @@ -[ - { - "creation": "2013-02-22 01:27:39", - "docstatus": 0, - "modified": "2014-02-03 12:44:31", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "JVD.######", - "doctype": "DocType", - "istable": 1, - "module": "Accounts", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Journal Voucher Detail", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Journal Voucher Detail" - }, - { - "doctype": "DocField", - "fieldname": "account", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "Account", - "oldfieldname": "account", - "oldfieldtype": "Link", - "options": "Account", - "print_width": "250px", - "reqd": 1, - "search_index": 1, - "width": "250px" - }, - { - "default": ":Company", - "description": "If Income or Expense", - "doctype": "DocField", - "fieldname": "cost_center", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "Cost Center", - "oldfieldname": "cost_center", - "oldfieldtype": "Link", - "options": "Cost Center", - "print_width": "180px", - "search_index": 0, - "width": "180px" - }, - { - "doctype": "DocField", - "fieldname": "col_break1", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "balance", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Account Balance", - "no_copy": 1, - "oldfieldname": "balance", - "oldfieldtype": "Data", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "sec_break1", - "fieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "debit", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Debit", - "oldfieldname": "debit", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency" - }, - { - "doctype": "DocField", - "fieldname": "col_break2", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "credit", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Credit", - "oldfieldname": "credit", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency" - }, - { - "doctype": "DocField", - "fieldname": "reference", - "fieldtype": "Section Break", - "label": "Reference" - }, - { - "doctype": "DocField", - "fieldname": "against_invoice", - "fieldtype": "Link", - "in_filter": 1, - "label": "Against Sales Invoice", - "no_copy": 1, - "oldfieldname": "against_invoice", - "oldfieldtype": "Link", - "options": "Sales Invoice", - "print_hide": 0, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "against_voucher", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "Against Purchase Invoice", - "no_copy": 1, - "oldfieldname": "against_voucher", - "oldfieldtype": "Link", - "options": "Purchase Invoice", - "print_hide": 0, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "col_break3", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "against_jv", - "fieldtype": "Link", - "in_filter": 1, - "label": "Against Journal Voucher", - "no_copy": 1, - "oldfieldname": "against_jv", - "oldfieldtype": "Link", - "options": "Journal Voucher", - "print_hide": 0, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "is_advance", - "fieldtype": "Select", - "label": "Is Advance", - "no_copy": 1, - "oldfieldname": "is_advance", - "oldfieldtype": "Select", - "options": "No\nYes", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "against_account", - "fieldtype": "Text", - "hidden": 1, - "label": "Against Account", - "no_copy": 1, - "oldfieldname": "against_account", - "oldfieldtype": "Text", - "print_hide": 1 - } -] \ No newline at end of file +{ + "autoname": "JVD.######", + "creation": "2013-02-22 01:27:39", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "account", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Account", + "oldfieldname": "account", + "oldfieldtype": "Link", + "options": "Account", + "permlevel": 0, + "print_width": "250px", + "reqd": 1, + "search_index": 1, + "width": "250px" + }, + { + "default": ":Company", + "description": "If Income or Expense", + "fieldname": "cost_center", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Cost Center", + "oldfieldname": "cost_center", + "oldfieldtype": "Link", + "options": "Cost Center", + "permlevel": 0, + "print_width": "180px", + "search_index": 0, + "width": "180px" + }, + { + "fieldname": "col_break1", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "balance", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Account Balance", + "no_copy": 1, + "oldfieldname": "balance", + "oldfieldtype": "Data", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "sec_break1", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "debit", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Debit", + "oldfieldname": "debit", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0 + }, + { + "fieldname": "col_break2", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "credit", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Credit", + "oldfieldname": "credit", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0 + }, + { + "fieldname": "reference", + "fieldtype": "Section Break", + "label": "Reference", + "permlevel": 0 + }, + { + "fieldname": "against_invoice", + "fieldtype": "Link", + "in_filter": 1, + "label": "Against Sales Invoice", + "no_copy": 1, + "oldfieldname": "against_invoice", + "oldfieldtype": "Link", + "options": "Sales Invoice", + "permlevel": 0, + "print_hide": 0, + "search_index": 1 + }, + { + "fieldname": "against_voucher", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Against Purchase Invoice", + "no_copy": 1, + "oldfieldname": "against_voucher", + "oldfieldtype": "Link", + "options": "Purchase Invoice", + "permlevel": 0, + "print_hide": 0, + "search_index": 1 + }, + { + "fieldname": "col_break3", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "against_jv", + "fieldtype": "Link", + "in_filter": 1, + "label": "Against Journal Voucher", + "no_copy": 1, + "oldfieldname": "against_jv", + "oldfieldtype": "Link", + "options": "Journal Voucher", + "permlevel": 0, + "print_hide": 0, + "search_index": 1 + }, + { + "fieldname": "is_advance", + "fieldtype": "Select", + "label": "Is Advance", + "no_copy": 1, + "oldfieldname": "is_advance", + "oldfieldtype": "Select", + "options": "No\nYes", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "against_account", + "fieldtype": "Text", + "hidden": 1, + "label": "Against Account", + "no_copy": 1, + "oldfieldname": "against_account", + "oldfieldtype": "Text", + "permlevel": 0, + "print_hide": 1 + } + ], + "idx": 1, + "istable": 1, + "modified": "2014-02-03 12:44:31", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Journal Voucher Detail", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.txt b/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.txt index 58300306f1..0dfe957003 100644 --- a/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.txt +++ b/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.txt @@ -1,75 +1,58 @@ -[ - { - "creation": "2012-12-04 17:49:20", - "docstatus": 0, - "modified": "2013-12-20 19:24:14", - "modified_by": "Administrator", - "owner": "harshada@webnotestech.com" - }, - { - "allow_import": 1, - "allow_rename": 1, - "autoname": "field:mode_of_payment", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-credit-card", - "module": "Accounts", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Mode of Payment", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0, - "read_only": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Mode of Payment", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Accounts Manager", - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Mode of Payment" - }, - { - "doctype": "DocField", - "fieldname": "mode_of_payment", - "fieldtype": "Data", - "label": "Mode of Payment", - "oldfieldname": "mode_of_payment", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "label": "Company", - "options": "Company" - }, - { - "description": "Default Bank / Cash account will be automatically updated in POS Invoice when this mode is selected.", - "doctype": "DocField", - "fieldname": "default_account", - "fieldtype": "Link", - "label": "Default Account", - "options": "Account" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "allow_import": 1, + "allow_rename": 1, + "autoname": "field:mode_of_payment", + "creation": "2012-12-04 17:49:20", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "mode_of_payment", + "fieldtype": "Data", + "label": "Mode of Payment", + "oldfieldname": "mode_of_payment", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "company", + "fieldtype": "Link", + "label": "Company", + "options": "Company", + "permlevel": 0, + "read_only": 0 + }, + { + "description": "Default Bank / Cash account will be automatically updated in POS Invoice when this mode is selected.", + "fieldname": "default_account", + "fieldtype": "Link", + "label": "Default Account", + "options": "Account", + "permlevel": 0, + "read_only": 0 + } + ], + "icon": "icon-credit-card", + "idx": 1, + "modified": "2013-12-20 19:24:14", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Mode of Payment", + "owner": "harshada@webnotestech.com", + "permissions": [ + { + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts Manager", + "submit": 0, + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.txt b/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.txt index bc4e0f7d92..42981dec90 100644 --- a/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.txt +++ b/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.txt @@ -1,198 +1,186 @@ -[ - { - "creation": "2013-01-30 12:49:46", - "docstatus": 0, - "modified": "2013-12-20 19:23:24", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "document_type": "Other", - "hide_toolbar": 1, - "icon": "icon-magic", - "issingle": 1, - "module": "Accounts", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Payment to Invoice Matching Tool", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Payment to Invoice Matching Tool", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 0, - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Payment to Invoice Matching Tool" - }, - { - "doctype": "DocField", - "fieldname": "account", - "fieldtype": "Link", - "label": "Account", - "options": "Account", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "account_type", - "fieldtype": "Data", - "hidden": 1, - "label": "Account Type", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "hidden": 1, - "label": "Company", - "options": "Company", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "voucher_type", - "fieldtype": "Select", - "label": "Voucher Type", - "options": "Sales Invoice\nPurchase Invoice\nJournal Voucher", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "voucher_no", - "fieldtype": "Link", - "label": "Voucher No", - "options": "[Select]", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "pull_payment_entries", - "fieldtype": "Button", - "label": "Pull Payment Entries", - "options": "get_payment_entries" - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "print_width": "50%", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "total_amount", - "fieldtype": "Currency", - "label": "Total Amount", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "pending_amt_to_reconcile", - "fieldtype": "Currency", - "label": "Outstanding Amount", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "payment_entries", - "fieldtype": "Section Break", - "label": "Payment Entries" - }, - { - "description": "Update allocated amount in the above table and then click \"Allocate\" button", - "doctype": "DocField", - "fieldname": "ir_payment_details", - "fieldtype": "Table", - "label": "Payment Entries", - "options": "Payment to Invoice Matching Tool Detail" - }, - { - "doctype": "DocField", - "fieldname": "reconcile", - "fieldtype": "Button", - "label": "Allocate", - "options": "reconcile" - }, - { - "doctype": "DocField", - "fieldname": "section_break0", - "fieldtype": "Section Break", - "options": "Simple" - }, - { - "doctype": "DocField", - "fieldname": "column_break2", - "fieldtype": "Column Break", - "label": "Filter By Date", - "print_width": "50%", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "from_date", - "fieldtype": "Date", - "label": "From Date" - }, - { - "doctype": "DocField", - "fieldname": "to_date", - "fieldtype": "Date", - "label": "To Date" - }, - { - "doctype": "DocField", - "fieldname": "help_html", - "fieldtype": "HTML", - "label": "Help HTML", - "options": "Click \"Pull Payment Entries\" to refresh the table with filters." - }, - { - "doctype": "DocField", - "fieldname": "column_break3", - "fieldtype": "Column Break", - "label": "Filter By Amount", - "print_width": "50%", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "amt_greater_than", - "fieldtype": "Data", - "label": "Amount >=" - }, - { - "doctype": "DocField", - "fieldname": "amt_less_than", - "fieldtype": "Data", - "label": "Amount <=" - }, - { - "doctype": "DocPerm", - "role": "Accounts Manager" - }, - { - "doctype": "DocPerm", - "role": "Accounts User" - } -] \ No newline at end of file +{ + "creation": "2013-01-30 12:49:46", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Other", + "fields": [ + { + "fieldname": "account", + "fieldtype": "Link", + "label": "Account", + "options": "Account", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "account_type", + "fieldtype": "Data", + "hidden": 1, + "label": "Account Type", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "company", + "fieldtype": "Link", + "hidden": 1, + "label": "Company", + "options": "Company", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "voucher_type", + "fieldtype": "Select", + "label": "Voucher Type", + "options": "Sales Invoice\nPurchase Invoice\nJournal Voucher", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "voucher_no", + "fieldtype": "Link", + "label": "Voucher No", + "options": "[Select]", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "pull_payment_entries", + "fieldtype": "Button", + "label": "Pull Payment Entries", + "options": "get_payment_entries", + "permlevel": 0 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "permlevel": 0, + "print_width": "50%", + "width": "50%" + }, + { + "fieldname": "total_amount", + "fieldtype": "Currency", + "label": "Total Amount", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "pending_amt_to_reconcile", + "fieldtype": "Currency", + "label": "Outstanding Amount", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "payment_entries", + "fieldtype": "Section Break", + "label": "Payment Entries", + "permlevel": 0 + }, + { + "description": "Update allocated amount in the above table and then click \"Allocate\" button", + "fieldname": "ir_payment_details", + "fieldtype": "Table", + "label": "Payment Entries", + "options": "Payment to Invoice Matching Tool Detail", + "permlevel": 0 + }, + { + "fieldname": "reconcile", + "fieldtype": "Button", + "label": "Allocate", + "options": "reconcile", + "permlevel": 0 + }, + { + "fieldname": "section_break0", + "fieldtype": "Section Break", + "options": "Simple", + "permlevel": 0 + }, + { + "fieldname": "column_break2", + "fieldtype": "Column Break", + "label": "Filter By Date", + "permlevel": 0, + "print_width": "50%", + "width": "50%" + }, + { + "fieldname": "from_date", + "fieldtype": "Date", + "label": "From Date", + "permlevel": 0 + }, + { + "fieldname": "to_date", + "fieldtype": "Date", + "label": "To Date", + "permlevel": 0 + }, + { + "fieldname": "help_html", + "fieldtype": "HTML", + "label": "Help HTML", + "options": "Click \"Pull Payment Entries\" to refresh the table with filters.", + "permlevel": 0 + }, + { + "fieldname": "column_break3", + "fieldtype": "Column Break", + "label": "Filter By Amount", + "permlevel": 0, + "print_width": "50%", + "width": "50%" + }, + { + "fieldname": "amt_greater_than", + "fieldtype": "Data", + "label": "Amount >=", + "permlevel": 0 + }, + { + "fieldname": "amt_less_than", + "fieldtype": "Data", + "label": "Amount <=", + "permlevel": 0 + } + ], + "hide_toolbar": 1, + "icon": "icon-magic", + "idx": 1, + "issingle": 1, + "modified": "2013-12-20 19:23:24", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Payment to Invoice Matching Tool", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 0, + "role": "Accounts Manager", + "submit": 0, + "write": 1 + }, + { + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 0, + "role": "Accounts User", + "submit": 0, + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.txt b/erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.txt index 1017a98ef5..419ee52d45 100644 --- a/erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.txt +++ b/erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.txt @@ -1,101 +1,88 @@ -[ - { - "creation": "2013-02-22 01:27:39", - "docstatus": 0, - "modified": "2013-12-20 19:23:24", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "istable": 1, - "module": "Accounts", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Payment to Invoice Matching Tool Detail", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Payment to Invoice Matching Tool Detail" - }, - { - "doctype": "DocField", - "fieldname": "voucher_no", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Voucher No", - "options": "Journal Voucher", - "print_width": "140px", - "read_only": 1, - "reqd": 0, - "width": "140px" - }, - { - "doctype": "DocField", - "fieldname": "amt_due", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Unmatched Amount", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "amt_to_be_reconciled", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Allocated Amount", - "options": "Company:company:default_currency", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "posting_date", - "fieldtype": "Date", - "in_list_view": 1, - "label": "Posting Date", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "total_amt", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Total Amount", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "against_account", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Against Account", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "remarks", - "fieldtype": "Small Text", - "label": "Remarks", - "print_width": "200px", - "read_only": 1, - "width": "200px" - }, - { - "doctype": "DocField", - "fieldname": "voucher_detail_no", - "fieldtype": "Data", - "hidden": 1, - "label": "Voucher Detail No", - "print_hide": 1, - "read_only": 1, - "reqd": 0 - } -] \ No newline at end of file +{ + "creation": "2013-02-22 01:27:39", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "voucher_no", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Voucher No", + "options": "Journal Voucher", + "permlevel": 0, + "print_width": "140px", + "read_only": 1, + "reqd": 0, + "width": "140px" + }, + { + "fieldname": "amt_due", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Unmatched Amount", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "amt_to_be_reconciled", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Allocated Amount", + "options": "Company:company:default_currency", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "posting_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "Posting Date", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "total_amt", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Total Amount", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "against_account", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Against Account", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "remarks", + "fieldtype": "Small Text", + "label": "Remarks", + "permlevel": 0, + "print_width": "200px", + "read_only": 1, + "width": "200px" + }, + { + "fieldname": "voucher_detail_no", + "fieldtype": "Data", + "hidden": 1, + "label": "Voucher Detail No", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 0 + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:23:24", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Payment to Invoice Matching Tool Detail", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.txt b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.txt index 170f49f1fa..a4fa8b5c84 100644 --- a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.txt +++ b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.txt @@ -1,145 +1,136 @@ -[ - { - "creation": "2013-01-10 16:34:07", - "docstatus": 0, - "modified": "2014-01-20 17:48:59", - "modified_by": "Administrator", - "owner": "jai@webnotestech.com" - }, - { - "autoname": "PCE/.###", - "doctype": "DocType", - "icon": "icon-file-text", - "is_submittable": 1, - "module": "Accounts", - "name": "__common__", - "search_fields": "posting_date, fiscal_year" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Period Closing Voucher", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Period Closing Voucher", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 1, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Period Closing Voucher" - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "transaction_date", - "fieldtype": "Date", - "label": "Transaction Date", - "oldfieldname": "transaction_date", - "oldfieldtype": "Date" - }, - { - "doctype": "DocField", - "fieldname": "posting_date", - "fieldtype": "Date", - "label": "Posting Date", - "oldfieldname": "posting_date", - "oldfieldtype": "Date", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "fiscal_year", - "fieldtype": "Select", - "label": "Closing Fiscal Year", - "oldfieldname": "fiscal_year", - "oldfieldtype": "Select", - "options": "link:Fiscal Year", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "amended_from", - "fieldtype": "Data", - "ignore_restrictions": 1, - "label": "Amended From", - "no_copy": 1, - "oldfieldname": "amended_from", - "oldfieldtype": "Data", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Select", - "label": "Company", - "oldfieldname": "company", - "oldfieldtype": "Select", - "options": "link:Company", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break" - }, - { - "description": "The account head under Liability, in which Profit/Loss will be booked", - "doctype": "DocField", - "fieldname": "closing_account_head", - "fieldtype": "Link", - "label": "Closing Account Head", - "oldfieldname": "closing_account_head", - "oldfieldtype": "Link", - "options": "Account", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "coa_help", - "fieldtype": "HTML", - "label": "CoA Help", - "oldfieldtype": "HTML", - "options": "To manage Account Head, click here" - }, - { - "doctype": "DocField", - "fieldname": "remarks", - "fieldtype": "Small Text", - "label": "Remarks", - "oldfieldname": "remarks", - "oldfieldtype": "Small Text", - "reqd": 1 - }, - { - "doctype": "DocPerm", - "role": "System Manager" - }, - { - "doctype": "DocPerm", - "role": "Accounts Manager" - } -] \ No newline at end of file +{ + "autoname": "PCE/.###", + "creation": "2013-01-10 16:34:07", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "transaction_date", + "fieldtype": "Date", + "label": "Transaction Date", + "oldfieldname": "transaction_date", + "oldfieldtype": "Date", + "permlevel": 0 + }, + { + "fieldname": "posting_date", + "fieldtype": "Date", + "label": "Posting Date", + "oldfieldname": "posting_date", + "oldfieldtype": "Date", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Select", + "label": "Closing Fiscal Year", + "oldfieldname": "fiscal_year", + "oldfieldtype": "Select", + "options": "link:Fiscal Year", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "amended_from", + "fieldtype": "Data", + "ignore_restrictions": 1, + "label": "Amended From", + "no_copy": 1, + "oldfieldname": "amended_from", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "company", + "fieldtype": "Select", + "label": "Company", + "oldfieldname": "company", + "oldfieldtype": "Select", + "options": "link:Company", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0 + }, + { + "description": "The account head under Liability, in which Profit/Loss will be booked", + "fieldname": "closing_account_head", + "fieldtype": "Link", + "label": "Closing Account Head", + "oldfieldname": "closing_account_head", + "oldfieldtype": "Link", + "options": "Account", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "coa_help", + "fieldtype": "HTML", + "label": "CoA Help", + "oldfieldtype": "HTML", + "options": "To manage Account Head, click here", + "permlevel": 0 + }, + { + "fieldname": "remarks", + "fieldtype": "Small Text", + "label": "Remarks", + "oldfieldname": "remarks", + "oldfieldtype": "Small Text", + "permlevel": 0, + "reqd": 1 + } + ], + "icon": "icon-file-text", + "idx": 1, + "is_submittable": 1, + "modified": "2014-01-20 17:48:59", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Period Closing Voucher", + "owner": "jai@webnotestech.com", + "permissions": [ + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts Manager", + "submit": 1, + "write": 1 + } + ], + "search_fields": "posting_date, fiscal_year" +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/pos_setting/pos_setting.txt b/erpnext/accounts/doctype/pos_setting/pos_setting.txt index bad0d7eb59..03c984ac58 100755 --- a/erpnext/accounts/doctype/pos_setting/pos_setting.txt +++ b/erpnext/accounts/doctype/pos_setting/pos_setting.txt @@ -1,246 +1,234 @@ -[ - { - "creation": "2013-05-24 12:15:51", - "docstatus": 0, - "modified": "2014-01-29 13:08:25", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "POS/.####", - "doctype": "DocType", - "icon": "icon-cog", - "module": "Accounts", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "POS Setting", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "cancel": 0, - "delete": 0, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "POS Setting", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 0 - }, - { - "doctype": "DocType", - "name": "POS Setting" - }, - { - "doctype": "DocField", - "fieldname": "user", - "fieldtype": "Link", - "in_list_view": 1, - "label": "User", - "oldfieldname": "user", - "oldfieldtype": "Link", - "options": "User", - "read_only": 0 - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "territory", - "fieldtype": "Link", - "label": "Territory", - "oldfieldname": "territory", - "oldfieldtype": "Link", - "options": "Territory", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "naming_series", - "fieldtype": "Select", - "label": "Series", - "no_copy": 1, - "oldfieldname": "naming_series", - "oldfieldtype": "Select", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "currency", - "fieldtype": "Link", - "label": "Currency", - "oldfieldname": "currency", - "oldfieldtype": "Select", - "options": "Currency", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "selling_price_list", - "fieldtype": "Link", - "label": "Price List", - "oldfieldname": "price_list_name", - "oldfieldtype": "Select", - "options": "Price List", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Company", - "oldfieldname": "company", - "oldfieldtype": "Link", - "options": "Company", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "read_only": 0 - }, - { - "default": "1", - "description": "Create Stock Ledger Entries when you submit a Sales Invoice", - "doctype": "DocField", - "fieldname": "update_stock", - "fieldtype": "Check", - "label": "Update Stock", - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "customer", - "fieldtype": "Link", - "label": "Customer", - "oldfieldname": "customer_account", - "oldfieldtype": "Link", - "options": "Customer", - "read_only": 0, - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "cash_bank_account", - "fieldtype": "Link", - "label": "Cash/Bank Account", - "oldfieldname": "cash_bank_account", - "oldfieldtype": "Link", - "options": "Account", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "income_account", - "fieldtype": "Link", - "label": "Income Account", - "oldfieldname": "income_account", - "oldfieldtype": "Link", - "options": "Account", - "read_only": 0, - "reqd": 1 - }, - { - "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)", - "doctype": "DocField", - "fieldname": "expense_account", - "fieldtype": "Link", - "hidden": 0, - "label": "Expense Account", - "options": "Account", - "print_hide": 1, - "read_only": 0, - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "warehouse", - "fieldtype": "Link", - "label": "Warehouse", - "oldfieldname": "warehouse", - "oldfieldtype": "Link", - "options": "Warehouse", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "cost_center", - "fieldtype": "Link", - "label": "Cost Center", - "oldfieldname": "cost_center", - "oldfieldtype": "Link", - "options": "Cost Center", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "taxes_and_charges", - "fieldtype": "Link", - "label": "Taxes and Charges", - "oldfieldname": "charge", - "oldfieldtype": "Link", - "options": "Sales Taxes and Charges Master", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "letter_head", - "fieldtype": "Select", - "label": "Letter Head", - "oldfieldname": "letter_head", - "oldfieldtype": "Select", - "options": "link:Letter Head", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "tc_name", - "fieldtype": "Link", - "label": "Terms and Conditions", - "oldfieldname": "tc_name", - "oldfieldtype": "Link", - "options": "Terms and Conditions", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "select_print_heading", - "fieldtype": "Select", - "in_filter": 0, - "label": "Print Heading", - "oldfieldname": "select_print_heading", - "oldfieldtype": "Select", - "options": "link:Print Heading", - "read_only": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "role": "Accounts Manager", - "write": 1 - }, - { - "doctype": "DocPerm", - "role": "Accounts User" - } -] \ No newline at end of file +{ + "autoname": "POS/.####", + "creation": "2013-05-24 12:15:51", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "user", + "fieldtype": "Link", + "in_list_view": 1, + "label": "User", + "oldfieldname": "user", + "oldfieldtype": "Link", + "options": "User", + "permlevel": 0, + "read_only": 0 + }, + { + "description": "Add / Edit", + "fieldname": "territory", + "fieldtype": "Link", + "label": "Territory", + "oldfieldname": "territory", + "oldfieldtype": "Link", + "options": "Territory", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "naming_series", + "fieldtype": "Select", + "label": "Series", + "no_copy": 1, + "oldfieldname": "naming_series", + "oldfieldtype": "Select", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "currency", + "fieldtype": "Link", + "label": "Currency", + "oldfieldname": "currency", + "oldfieldtype": "Select", + "options": "Currency", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "selling_price_list", + "fieldtype": "Link", + "label": "Price List", + "oldfieldname": "price_list_name", + "oldfieldtype": "Select", + "options": "Price List", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "company", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Company", + "oldfieldname": "company", + "oldfieldtype": "Link", + "options": "Company", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 0 + }, + { + "default": "1", + "description": "Create Stock Ledger Entries when you submit a Sales Invoice", + "fieldname": "update_stock", + "fieldtype": "Check", + "label": "Update Stock", + "permlevel": 0, + "reqd": 0 + }, + { + "fieldname": "customer", + "fieldtype": "Link", + "label": "Customer", + "oldfieldname": "customer_account", + "oldfieldtype": "Link", + "options": "Customer", + "permlevel": 0, + "read_only": 0, + "reqd": 0 + }, + { + "fieldname": "cash_bank_account", + "fieldtype": "Link", + "label": "Cash/Bank Account", + "oldfieldname": "cash_bank_account", + "oldfieldtype": "Link", + "options": "Account", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "income_account", + "fieldtype": "Link", + "label": "Income Account", + "oldfieldname": "income_account", + "oldfieldtype": "Link", + "options": "Account", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)", + "fieldname": "expense_account", + "fieldtype": "Link", + "hidden": 0, + "label": "Expense Account", + "options": "Account", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 0 + }, + { + "fieldname": "warehouse", + "fieldtype": "Link", + "label": "Warehouse", + "oldfieldname": "warehouse", + "oldfieldtype": "Link", + "options": "Warehouse", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "cost_center", + "fieldtype": "Link", + "label": "Cost Center", + "oldfieldname": "cost_center", + "oldfieldtype": "Link", + "options": "Cost Center", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "taxes_and_charges", + "fieldtype": "Link", + "label": "Taxes and Charges", + "oldfieldname": "charge", + "oldfieldtype": "Link", + "options": "Sales Taxes and Charges Master", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "letter_head", + "fieldtype": "Select", + "label": "Letter Head", + "oldfieldname": "letter_head", + "oldfieldtype": "Select", + "options": "link:Letter Head", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "tc_name", + "fieldtype": "Link", + "label": "Terms and Conditions", + "oldfieldname": "tc_name", + "oldfieldtype": "Link", + "options": "Terms and Conditions", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "select_print_heading", + "fieldtype": "Select", + "in_filter": 0, + "label": "Print Heading", + "oldfieldname": "select_print_heading", + "oldfieldtype": "Select", + "options": "link:Print Heading", + "permlevel": 0, + "read_only": 0 + } + ], + "icon": "icon-cog", + "idx": 1, + "modified": "2014-01-29 13:08:25", + "modified_by": "Administrator", + "module": "Accounts", + "name": "POS Setting", + "owner": "Administrator", + "permissions": [ + { + "cancel": 0, + "create": 1, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts Manager", + "submit": 0, + "write": 1 + }, + { + "cancel": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts User", + "submit": 0 + } + ] +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.txt b/erpnext/accounts/doctype/pricing_rule/pricing_rule.txt index 413405c962..3094569803 100644 --- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.txt +++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.txt @@ -1,261 +1,258 @@ -[ - { - "creation": "2014-02-21 15:02:51", - "docstatus": 0, - "modified": "2014-03-05 18:23:34", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "PRULE.#####", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-gift", - "istable": 0, - "module": "Accounts", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Pricing Rule", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "name": "__common__", - "parent": "Pricing Rule", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "read": 1, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Pricing Rule" - }, - { - "doctype": "DocField", - "fieldname": "basic_section", - "fieldtype": "Section Break", - "label": "Basic Section" - }, - { - "default": "Today", - "doctype": "DocField", - "fieldname": "valid_from", - "fieldtype": "Date", - "label": "Valid From" - }, - { - "doctype": "DocField", - "fieldname": "valid_upto", - "fieldtype": "Date", - "label": "Valid Upto" - }, - { - "doctype": "DocField", - "fieldname": "col_break1", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "priority", - "fieldtype": "Select", - "label": "Priority", - "options": "\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20" - }, - { - "doctype": "DocField", - "fieldname": "disable", - "fieldtype": "Check", - "label": "Disable" - }, - { - "doctype": "DocField", - "fieldname": "price_discount_section", - "fieldtype": "Section Break", - "label": "Price / Discount" - }, - { - "default": "Discount Percentage", - "doctype": "DocField", - "fieldname": "price_or_discount", - "fieldtype": "Select", - "label": "Price or Discount", - "options": "\nPrice\nDiscount Percentage", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "col_break2", - "fieldtype": "Column Break" - }, - { - "depends_on": "eval:doc.price_or_discount==\"Price\"", - "doctype": "DocField", - "fieldname": "price", - "fieldtype": "Float", - "label": "Price" - }, - { - "depends_on": "eval:doc.price_or_discount==\"Discount Percentage\"", - "doctype": "DocField", - "fieldname": "discount_percentage", - "fieldtype": "Float", - "label": "Discount Percentage" - }, - { - "depends_on": "eval:doc.price_or_discount==\"Discount Percentage\"", - "doctype": "DocField", - "fieldname": "for_price_list", - "fieldtype": "Link", - "label": "For Price List", - "options": "Price List" - }, - { - "doctype": "DocField", - "fieldname": "applicability_section", - "fieldtype": "Section Break", - "label": "Applicability" - }, - { - "default": "Item Code", - "doctype": "DocField", - "fieldname": "apply_on", - "fieldtype": "Select", - "label": "Apply On", - "options": "\nItem Code\nItem Group\nBrand", - "reqd": 1 - }, - { - "depends_on": "eval:doc.apply_on==\"Item Code\"", - "doctype": "DocField", - "fieldname": "item_code", - "fieldtype": "Link", - "label": "Item Code", - "options": "Item", - "reqd": 0 - }, - { - "depends_on": "eval:doc.apply_on==\"Item Group\"", - "doctype": "DocField", - "fieldname": "item_group", - "fieldtype": "Link", - "label": "Item Group", - "options": "Item Group" - }, - { - "depends_on": "eval:doc.apply_on==\"Brand\"", - "doctype": "DocField", - "fieldname": "brand", - "fieldtype": "Link", - "label": "Brand", - "options": "Brand" - }, - { - "doctype": "DocField", - "fieldname": "col_break3", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "applicable_for", - "fieldtype": "Select", - "label": "Applicable For", - "options": "\nCustomer\nCustomer Group\nTerritory\nSales Partner\nCampaign\nSupplier\nSupplier Type" - }, - { - "depends_on": "eval:doc.applicable_for==\"Customer\"", - "doctype": "DocField", - "fieldname": "customer", - "fieldtype": "Link", - "label": "Customer", - "options": "Customer" - }, - { - "depends_on": "eval:doc.applicable_for==\"Customer Group\"", - "doctype": "DocField", - "fieldname": "customer_group", - "fieldtype": "Link", - "label": "Customer Group", - "options": "Customer Group" - }, - { - "depends_on": "eval:doc.applicable_for==\"Territory\"", - "doctype": "DocField", - "fieldname": "territory", - "fieldtype": "Link", - "label": "Territory", - "options": "Territory" - }, - { - "depends_on": "eval:doc.applicable_for==\"Sales Partner\"", - "doctype": "DocField", - "fieldname": "sales_partner", - "fieldtype": "Link", - "label": "Sales Partner", - "options": "Sales Partner" - }, - { - "depends_on": "eval:doc.applicable_for==\"Campaign\"", - "doctype": "DocField", - "fieldname": "campaign", - "fieldtype": "Link", - "label": "Campaign", - "options": "Campaign" - }, - { - "depends_on": "eval:doc.applicable_for==\"Supplier\"", - "doctype": "DocField", - "fieldname": "supplier", - "fieldtype": "Link", - "label": "Supplier", - "options": "Supplier" - }, - { - "depends_on": "eval:doc.applicable_for==\"Supplier Type\"", - "doctype": "DocField", - "fieldname": "supplier_type", - "fieldtype": "Link", - "label": "Supplier Type", - "options": "Supplier Type" - }, - { - "doctype": "DocField", - "fieldname": "min_qty", - "fieldtype": "Float", - "label": "Min Qty" - }, - { - "doctype": "DocField", - "fieldname": "max_qty", - "fieldtype": "Float", - "label": "Max Qty" - }, - { - "doctype": "DocPerm", - "role": "Accounts Manager" - }, - { - "doctype": "DocPerm", - "role": "Sales Manager" - }, - { - "doctype": "DocPerm", - "role": "Purchase Manager" - }, - { - "doctype": "DocPerm", - "role": "Website Manager" - }, - { - "doctype": "DocPerm", - "role": "System Manager" - } -] \ No newline at end of file +{ + "autoname": "PRULE.#####", + "creation": "2014-02-21 15:02:51", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "basic_section", + "fieldtype": "Section Break", + "label": "Basic Section", + "permlevel": 0 + }, + { + "default": "Today", + "fieldname": "valid_from", + "fieldtype": "Date", + "label": "Valid From", + "permlevel": 0 + }, + { + "fieldname": "valid_upto", + "fieldtype": "Date", + "label": "Valid Upto", + "permlevel": 0 + }, + { + "fieldname": "col_break1", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "priority", + "fieldtype": "Select", + "label": "Priority", + "options": "\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10\n11\n12\n13\n14\n15\n16\n17\n18\n19\n20", + "permlevel": 0 + }, + { + "fieldname": "disable", + "fieldtype": "Check", + "label": "Disable", + "permlevel": 0 + }, + { + "fieldname": "price_discount_section", + "fieldtype": "Section Break", + "label": "Price / Discount", + "permlevel": 0 + }, + { + "default": "Discount Percentage", + "fieldname": "price_or_discount", + "fieldtype": "Select", + "label": "Price or Discount", + "options": "\nPrice\nDiscount Percentage", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "col_break2", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "depends_on": "eval:doc.price_or_discount==\"Price\"", + "fieldname": "price", + "fieldtype": "Float", + "label": "Price", + "permlevel": 0 + }, + { + "depends_on": "eval:doc.price_or_discount==\"Discount Percentage\"", + "fieldname": "discount_percentage", + "fieldtype": "Float", + "label": "Discount Percentage", + "permlevel": 0 + }, + { + "depends_on": "eval:doc.price_or_discount==\"Discount Percentage\"", + "fieldname": "for_price_list", + "fieldtype": "Link", + "label": "For Price List", + "options": "Price List", + "permlevel": 0 + }, + { + "fieldname": "applicability_section", + "fieldtype": "Section Break", + "label": "Applicability", + "permlevel": 0 + }, + { + "default": "Item Code", + "fieldname": "apply_on", + "fieldtype": "Select", + "label": "Apply On", + "options": "\nItem Code\nItem Group\nBrand", + "permlevel": 0, + "reqd": 1 + }, + { + "depends_on": "eval:doc.apply_on==\"Item Code\"", + "fieldname": "item_code", + "fieldtype": "Link", + "label": "Item Code", + "options": "Item", + "permlevel": 0, + "reqd": 0 + }, + { + "depends_on": "eval:doc.apply_on==\"Item Group\"", + "fieldname": "item_group", + "fieldtype": "Link", + "label": "Item Group", + "options": "Item Group", + "permlevel": 0 + }, + { + "depends_on": "eval:doc.apply_on==\"Brand\"", + "fieldname": "brand", + "fieldtype": "Link", + "label": "Brand", + "options": "Brand", + "permlevel": 0 + }, + { + "fieldname": "col_break3", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "applicable_for", + "fieldtype": "Select", + "label": "Applicable For", + "options": "\nCustomer\nCustomer Group\nTerritory\nSales Partner\nCampaign\nSupplier\nSupplier Type", + "permlevel": 0 + }, + { + "depends_on": "eval:doc.applicable_for==\"Customer\"", + "fieldname": "customer", + "fieldtype": "Link", + "label": "Customer", + "options": "Customer", + "permlevel": 0 + }, + { + "depends_on": "eval:doc.applicable_for==\"Customer Group\"", + "fieldname": "customer_group", + "fieldtype": "Link", + "label": "Customer Group", + "options": "Customer Group", + "permlevel": 0 + }, + { + "depends_on": "eval:doc.applicable_for==\"Territory\"", + "fieldname": "territory", + "fieldtype": "Link", + "label": "Territory", + "options": "Territory", + "permlevel": 0 + }, + { + "depends_on": "eval:doc.applicable_for==\"Sales Partner\"", + "fieldname": "sales_partner", + "fieldtype": "Link", + "label": "Sales Partner", + "options": "Sales Partner", + "permlevel": 0 + }, + { + "depends_on": "eval:doc.applicable_for==\"Campaign\"", + "fieldname": "campaign", + "fieldtype": "Link", + "label": "Campaign", + "options": "Campaign", + "permlevel": 0 + }, + { + "depends_on": "eval:doc.applicable_for==\"Supplier\"", + "fieldname": "supplier", + "fieldtype": "Link", + "label": "Supplier", + "options": "Supplier", + "permlevel": 0 + }, + { + "depends_on": "eval:doc.applicable_for==\"Supplier Type\"", + "fieldname": "supplier_type", + "fieldtype": "Link", + "label": "Supplier Type", + "options": "Supplier Type", + "permlevel": 0 + }, + { + "fieldname": "min_qty", + "fieldtype": "Float", + "label": "Min Qty", + "permlevel": 0 + }, + { + "fieldname": "max_qty", + "fieldtype": "Float", + "label": "Max Qty", + "permlevel": 0 + } + ], + "icon": "icon-gift", + "idx": 1, + "istable": 0, + "modified": "2014-03-05 18:23:34", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Pricing Rule", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "permlevel": 0, + "read": 1, + "role": "Accounts Manager", + "write": 1 + }, + { + "create": 1, + "delete": 1, + "permlevel": 0, + "read": 1, + "role": "Sales Manager", + "write": 1 + }, + { + "create": 1, + "delete": 1, + "permlevel": 0, + "read": 1, + "role": "Purchase Manager", + "write": 1 + }, + { + "create": 1, + "delete": 1, + "permlevel": 0, + "read": 1, + "role": "Website Manager", + "write": 1 + }, + { + "create": 1, + "delete": 1, + "permlevel": 0, + "read": 1, + "role": "System Manager", + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.txt b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.txt index 1ad767e31c..c70cc6c531 100755 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.txt +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.txt @@ -1,829 +1,826 @@ -[ - { - "creation": "2013-05-21 16:16:39", - "docstatus": 0, - "modified": "2014-02-17 12:01:59", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_attach": 1, - "allow_import": 1, - "autoname": "naming_series:", - "doctype": "DocType", - "icon": "icon-file-text", - "is_submittable": 1, - "module": "Accounts", - "name": "__common__", - "read_only_onload": 1, - "search_fields": "posting_date, credit_to, fiscal_year, bill_no, grand_total, outstanding_amount" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Purchase Invoice", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Purchase Invoice", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1 - }, - { - "doctype": "DocType", - "name": "Purchase Invoice" - }, - { - "doctype": "DocField", - "fieldname": "supplier_section", - "fieldtype": "Section Break", - "label": "Supplier", - "options": "icon-user" - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "naming_series", - "fieldtype": "Select", - "label": "Series", - "no_copy": 1, - "oldfieldname": "naming_series", - "oldfieldtype": "Select", - "options": "BILL\nBILLJ", - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "supplier", - "fieldtype": "Link", - "hidden": 0, - "label": "Supplier", - "oldfieldname": "supplier", - "oldfieldtype": "Link", - "options": "Supplier", - "print_hide": 1, - "read_only": 0 - }, - { - "depends_on": "supplier", - "doctype": "DocField", - "fieldname": "supplier_name", - "fieldtype": "Data", - "hidden": 0, - "in_list_view": 1, - "label": "Name", - "oldfieldname": "supplier_name", - "oldfieldtype": "Data", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "address_display", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Address", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "contact_display", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Contact", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "contact_mobile", - "fieldtype": "Text", - "hidden": 1, - "label": "Mobile No", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "contact_email", - "fieldtype": "Text", - "hidden": 1, - "label": "Contact Email", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "read_only": 0, - "reqd": 0, - "width": "50%" - }, - { - "default": "Today", - "doctype": "DocField", - "fieldname": "posting_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Posting Date", - "no_copy": 0, - "oldfieldname": "posting_date", - "oldfieldtype": "Date", - "print_hide": 1, - "read_only": 0, - "reqd": 1, - "search_index": 1 - }, - { - "description": "If not applicable please enter: NA", - "doctype": "DocField", - "fieldname": "bill_no", - "fieldtype": "Data", - "in_filter": 1, - "label": "Supplier Invoice No", - "oldfieldname": "bill_no", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 0, - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "bill_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Supplier Invoice Date", - "oldfieldname": "bill_date", - "oldfieldtype": "Date", - "print_hide": 1, - "read_only": 0, - "reqd": 0, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "amended_from", - "fieldtype": "Link", - "ignore_restrictions": 1, - "label": "Amended From", - "no_copy": 1, - "oldfieldname": "amended_from", - "oldfieldtype": "Link", - "options": "Purchase Invoice", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "in_filter": 1, - "label": "Company", - "oldfieldname": "company", - "oldfieldtype": "Link", - "options": "Company", - "print_hide": 1, - "read_only": 0, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "currency_price_list", - "fieldtype": "Section Break", - "label": "Currency and Price List", - "options": "icon-tag", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "currency", - "fieldtype": "Link", - "label": "Currency", - "oldfieldname": "currency", - "oldfieldtype": "Select", - "options": "Currency", - "print_hide": 1, - "read_only": 0 - }, - { - "description": "The rate at which Bill Currency is converted into company's base currency", - "doctype": "DocField", - "fieldname": "conversion_rate", - "fieldtype": "Float", - "label": "Exchange Rate", - "oldfieldname": "conversion_rate", - "oldfieldtype": "Currency", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break2", - "fieldtype": "Column Break", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "buying_price_list", - "fieldtype": "Link", - "label": "Price List", - "options": "Price List", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "price_list_currency", - "fieldtype": "Link", - "label": "Price List Currency", - "options": "Currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "plc_conversion_rate", - "fieldtype": "Float", - "label": "Price List Exchange Rate", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "items", - "fieldtype": "Section Break", - "label": "Items", - "oldfieldtype": "Section Break", - "options": "icon-shopping-cart", - "read_only": 0 - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "entries", - "fieldtype": "Table", - "label": "Entries", - "oldfieldname": "entries", - "oldfieldtype": "Table", - "options": "Purchase Invoice Item", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "section_break_26", - "fieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "net_total_import", - "fieldtype": "Currency", - "label": "Net Total", - "oldfieldname": "net_total_import", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 0, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break_28", - "fieldtype": "Column Break" - }, - { - "description": "Will be calculated automatically when you enter the details", - "doctype": "DocField", - "fieldname": "net_total", - "fieldtype": "Currency", - "label": "Net Total (Company Currency)", - "oldfieldname": "net_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "taxes", - "fieldtype": "Section Break", - "label": "Taxes and Charges", - "oldfieldtype": "Section Break", - "options": "icon-money", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "taxes_and_charges", - "fieldtype": "Link", - "label": "Taxes and Charges", - "oldfieldname": "purchase_other_charges", - "oldfieldtype": "Link", - "options": "Purchase Taxes and Charges Master", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "other_charges", - "fieldtype": "Table", - "label": "Purchase Taxes and Charges", - "oldfieldname": "purchase_tax_details", - "oldfieldtype": "Table", - "options": "Purchase Taxes and Charges", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "other_charges_calculation", - "fieldtype": "HTML", - "label": "Taxes and Charges Calculation", - "oldfieldtype": "HTML", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "totals", - "fieldtype": "Section Break", - "label": "Totals", - "oldfieldtype": "Section Break", - "options": "icon-money", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "other_charges_added_import", - "fieldtype": "Currency", - "label": "Taxes and Charges Added", - "oldfieldname": "other_charges_added_import", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "other_charges_deducted_import", - "fieldtype": "Currency", - "label": "Taxes and Charges Deducted", - "oldfieldname": "other_charges_deducted_import", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "grand_total_import", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Grand Total", - "oldfieldname": "grand_total_import", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 0, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "in_words_import", - "fieldtype": "Data", - "label": "In Words", - "oldfieldname": "in_words_import", - "oldfieldtype": "Data", - "print_hide": 0, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "total_amount_to_pay", - "fieldtype": "Currency", - "hidden": 0, - "label": "Total Amount To Pay", - "no_copy": 1, - "oldfieldname": "total_amount_to_pay", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "total_advance", - "fieldtype": "Currency", - "label": "Total Advance", - "no_copy": 1, - "oldfieldname": "total_advance", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "outstanding_amount", - "fieldtype": "Currency", - "in_filter": 1, - "in_list_view": 1, - "label": "Outstanding Amount", - "no_copy": 1, - "oldfieldname": "outstanding_amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break8", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "print_hide": 1, - "read_only": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "total_tax", - "fieldtype": "Currency", - "label": "Total Tax (Company Currency)", - "oldfieldname": "total_tax", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "other_charges_added", - "fieldtype": "Currency", - "label": "Taxes and Charges Added (Company Currency)", - "oldfieldname": "other_charges_added", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "other_charges_deducted", - "fieldtype": "Currency", - "label": "Taxes and Charges Deducted (Company Currency)", - "oldfieldname": "other_charges_deducted", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "grand_total", - "fieldtype": "Currency", - "label": "Grand Total (Company Currency)", - "oldfieldname": "grand_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "description": "In Words will be visible once you save the Purchase Invoice.", - "doctype": "DocField", - "fieldname": "in_words", - "fieldtype": "Data", - "label": "In Words (Company Currency)", - "oldfieldname": "in_words", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "write_off_amount", - "fieldtype": "Currency", - "label": "Write Off Amount", - "no_copy": 1, - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 0 - }, - { - "depends_on": "eval:flt(doc.write_off_amount)!=0", - "doctype": "DocField", - "fieldname": "write_off_account", - "fieldtype": "Link", - "label": "Write Off Account", - "no_copy": 1, - "options": "Account", - "print_hide": 1, - "read_only": 0 - }, - { - "depends_on": "eval:flt(doc.write_off_amount)!=0", - "doctype": "DocField", - "fieldname": "write_off_cost_center", - "fieldtype": "Link", - "label": "Write Off Cost Center", - "no_copy": 1, - "options": "Cost Center", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "against_expense_account", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Against Expense Account", - "no_copy": 1, - "oldfieldname": "against_expense_account", - "oldfieldtype": "Small Text", - "print_hide": 1, - "read_only": 0, - "report_hide": 0 - }, - { - "doctype": "DocField", - "fieldname": "advances", - "fieldtype": "Section Break", - "label": "Advances", - "oldfieldtype": "Section Break", - "options": "icon-money", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "get_advances_paid", - "fieldtype": "Button", - "label": "Get Advances Paid", - "oldfieldtype": "Button", - "options": "get_advances", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "advance_allocation_details", - "fieldtype": "Table", - "label": "Purchase Invoice Advances", - "no_copy": 1, - "oldfieldname": "advance_allocation_details", - "oldfieldtype": "Table", - "options": "Purchase Invoice Advance", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "terms_section_break", - "fieldtype": "Section Break", - "label": "Terms and Conditions", - "options": "icon-legal" - }, - { - "doctype": "DocField", - "fieldname": "tc_name", - "fieldtype": "Link", - "label": "Terms", - "options": "Terms and Conditions", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "terms", - "fieldtype": "Text Editor", - "label": "Terms and Conditions1" - }, - { - "depends_on": "supplier", - "doctype": "DocField", - "fieldname": "contact_section", - "fieldtype": "Section Break", - "label": "Contact Info", - "options": "icon-bullhorn", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "supplier_address", - "fieldtype": "Link", - "label": "Supplier Address", - "options": "Address", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "col_break23", - "fieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "contact_person", - "fieldtype": "Link", - "label": "Contact Person", - "options": "Contact", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "more_info", - "fieldtype": "Section Break", - "label": "More Info", - "oldfieldtype": "Section Break", - "options": "icon-file-text", - "print_hide": 1, - "read_only": 0 - }, - { - "description": "Supplier (Payable) Account", - "doctype": "DocField", - "fieldname": "credit_to", - "fieldtype": "Link", - "in_filter": 1, - "label": "Credit To", - "oldfieldname": "credit_to", - "oldfieldtype": "Link", - "options": "Account", - "print_hide": 1, - "read_only": 0, - "reqd": 1, - "search_index": 1 - }, - { - "default": "No", - "description": "Considered as Opening Balance", - "doctype": "DocField", - "fieldname": "is_opening", - "fieldtype": "Select", - "in_filter": 1, - "label": "Is Opening", - "oldfieldname": "is_opening", - "oldfieldtype": "Select", - "options": "No\nYes", - "print_hide": 1, - "read_only": 0, - "search_index": 1 - }, - { - "description": "Actual Invoice Date", - "doctype": "DocField", - "fieldname": "aging_date", - "fieldtype": "Date", - "label": "Aging Date", - "oldfieldname": "aging_date", - "oldfieldtype": "Date", - "print_hide": 1, - "read_only": 0, - "search_index": 0 - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "select_print_heading", - "fieldtype": "Link", - "label": "Print Heading", - "no_copy": 1, - "oldfieldname": "select_print_heading", - "oldfieldtype": "Link", - "options": "Print Heading", - "print_hide": 1, - "read_only": 0, - "report_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "due_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Due Date", - "no_copy": 0, - "oldfieldname": "due_date", - "oldfieldtype": "Date", - "print_hide": 0, - "read_only": 0, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "mode_of_payment", - "fieldtype": "Select", - "label": "Mode of Payment", - "oldfieldname": "mode_of_payment", - "oldfieldtype": "Select", - "options": "link:Mode of Payment", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break_63", - "fieldtype": "Column Break", - "read_only": 0 - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "letter_head", - "fieldtype": "Select", - "label": "Letter Head", - "options": "link:Letter Head", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "fiscal_year", - "fieldtype": "Select", - "in_filter": 1, - "label": "Fiscal Year", - "oldfieldname": "fiscal_year", - "oldfieldtype": "Select", - "options": "link:Fiscal Year", - "print_hide": 1, - "read_only": 0, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "remarks", - "fieldtype": "Small Text", - "label": "Remarks", - "no_copy": 1, - "oldfieldname": "remarks", - "oldfieldtype": "Text", - "print_hide": 1, - "read_only": 0, - "reqd": 0 - }, - { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Accounts User", - "submit": 0, - "write": 0 - }, - { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Purchase User", - "submit": 0, - "write": 0 - }, - { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Supplier", - "submit": 0, - "write": 0 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Accounts Manager", - "submit": 1, - "write": 1 - }, - { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Auditor", - "submit": 0, - "write": 0 - } -] +{ + "allow_attach": 1, + "allow_import": 1, + "autoname": "naming_series:", + "creation": "2013-05-21 16:16:39", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "supplier_section", + "fieldtype": "Section Break", + "label": "Supplier", + "options": "icon-user", + "permlevel": 0 + }, + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "naming_series", + "fieldtype": "Select", + "label": "Series", + "no_copy": 1, + "oldfieldname": "naming_series", + "oldfieldtype": "Select", + "options": "BILL\nBILLJ", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 0, + "reqd": 1 + }, + { + "fieldname": "supplier", + "fieldtype": "Link", + "hidden": 0, + "label": "Supplier", + "oldfieldname": "supplier", + "oldfieldtype": "Link", + "options": "Supplier", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "depends_on": "supplier", + "fieldname": "supplier_name", + "fieldtype": "Data", + "hidden": 0, + "in_list_view": 1, + "label": "Name", + "oldfieldname": "supplier_name", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "address_display", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Address", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "contact_display", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Contact", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "contact_mobile", + "fieldtype": "Text", + "hidden": 1, + "label": "Mobile No", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "contact_email", + "fieldtype": "Text", + "hidden": 1, + "label": "Contact Email", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "reqd": 0, + "width": "50%" + }, + { + "default": "Today", + "fieldname": "posting_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Posting Date", + "no_copy": 0, + "oldfieldname": "posting_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1, + "search_index": 1 + }, + { + "description": "If not applicable please enter: NA", + "fieldname": "bill_no", + "fieldtype": "Data", + "in_filter": 1, + "label": "Supplier Invoice No", + "oldfieldname": "bill_no", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "bill_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Supplier Invoice Date", + "oldfieldname": "bill_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 0, + "search_index": 1 + }, + { + "fieldname": "amended_from", + "fieldtype": "Link", + "ignore_restrictions": 1, + "label": "Amended From", + "no_copy": 1, + "oldfieldname": "amended_from", + "oldfieldtype": "Link", + "options": "Purchase Invoice", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "company", + "fieldtype": "Link", + "in_filter": 1, + "label": "Company", + "oldfieldname": "company", + "oldfieldtype": "Link", + "options": "Company", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "search_index": 1 + }, + { + "fieldname": "currency_price_list", + "fieldtype": "Section Break", + "label": "Currency and Price List", + "options": "icon-tag", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "currency", + "fieldtype": "Link", + "label": "Currency", + "oldfieldname": "currency", + "oldfieldtype": "Select", + "options": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "description": "The rate at which Bill Currency is converted into company's base currency", + "fieldname": "conversion_rate", + "fieldtype": "Float", + "label": "Exchange Rate", + "oldfieldname": "conversion_rate", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "column_break2", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "buying_price_list", + "fieldtype": "Link", + "label": "Price List", + "options": "Price List", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "price_list_currency", + "fieldtype": "Link", + "label": "Price List Currency", + "options": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "plc_conversion_rate", + "fieldtype": "Float", + "label": "Price List Exchange Rate", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "items", + "fieldtype": "Section Break", + "label": "Items", + "oldfieldtype": "Section Break", + "options": "icon-shopping-cart", + "permlevel": 0, + "read_only": 0 + }, + { + "allow_on_submit": 1, + "fieldname": "entries", + "fieldtype": "Table", + "label": "Entries", + "oldfieldname": "entries", + "oldfieldtype": "Table", + "options": "Purchase Invoice Item", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "section_break_26", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "net_total_import", + "fieldtype": "Currency", + "label": "Net Total", + "oldfieldname": "net_total_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 1 + }, + { + "fieldname": "column_break_28", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "description": "Will be calculated automatically when you enter the details", + "fieldname": "net_total", + "fieldtype": "Currency", + "label": "Net Total (Company Currency)", + "oldfieldname": "net_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "taxes", + "fieldtype": "Section Break", + "label": "Taxes and Charges", + "oldfieldtype": "Section Break", + "options": "icon-money", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "taxes_and_charges", + "fieldtype": "Link", + "label": "Taxes and Charges", + "oldfieldname": "purchase_other_charges", + "oldfieldtype": "Link", + "options": "Purchase Taxes and Charges Master", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "other_charges", + "fieldtype": "Table", + "label": "Purchase Taxes and Charges", + "oldfieldname": "purchase_tax_details", + "oldfieldtype": "Table", + "options": "Purchase Taxes and Charges", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "other_charges_calculation", + "fieldtype": "HTML", + "label": "Taxes and Charges Calculation", + "oldfieldtype": "HTML", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "totals", + "fieldtype": "Section Break", + "label": "Totals", + "oldfieldtype": "Section Break", + "options": "icon-money", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "other_charges_added_import", + "fieldtype": "Currency", + "label": "Taxes and Charges Added", + "oldfieldname": "other_charges_added_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "other_charges_deducted_import", + "fieldtype": "Currency", + "label": "Taxes and Charges Deducted", + "oldfieldname": "other_charges_deducted_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "grand_total_import", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Grand Total", + "oldfieldname": "grand_total_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 1 + }, + { + "fieldname": "in_words_import", + "fieldtype": "Data", + "label": "In Words", + "oldfieldname": "in_words_import", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 0, + "read_only": 1 + }, + { + "fieldname": "total_amount_to_pay", + "fieldtype": "Currency", + "hidden": 0, + "label": "Total Amount To Pay", + "no_copy": 1, + "oldfieldname": "total_amount_to_pay", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "total_advance", + "fieldtype": "Currency", + "label": "Total Advance", + "no_copy": 1, + "oldfieldname": "total_advance", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "outstanding_amount", + "fieldtype": "Currency", + "in_filter": 1, + "in_list_view": 1, + "label": "Outstanding Amount", + "no_copy": 1, + "oldfieldname": "outstanding_amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "search_index": 1 + }, + { + "fieldname": "column_break8", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "total_tax", + "fieldtype": "Currency", + "label": "Total Tax (Company Currency)", + "oldfieldname": "total_tax", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "other_charges_added", + "fieldtype": "Currency", + "label": "Taxes and Charges Added (Company Currency)", + "oldfieldname": "other_charges_added", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "other_charges_deducted", + "fieldtype": "Currency", + "label": "Taxes and Charges Deducted (Company Currency)", + "oldfieldname": "other_charges_deducted", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "grand_total", + "fieldtype": "Currency", + "label": "Grand Total (Company Currency)", + "oldfieldname": "grand_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "description": "In Words will be visible once you save the Purchase Invoice.", + "fieldname": "in_words", + "fieldtype": "Data", + "label": "In Words (Company Currency)", + "oldfieldname": "in_words", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "write_off_amount", + "fieldtype": "Currency", + "label": "Write Off Amount", + "no_copy": 1, + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "depends_on": "eval:flt(doc.write_off_amount)!=0", + "fieldname": "write_off_account", + "fieldtype": "Link", + "label": "Write Off Account", + "no_copy": 1, + "options": "Account", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "depends_on": "eval:flt(doc.write_off_amount)!=0", + "fieldname": "write_off_cost_center", + "fieldtype": "Link", + "label": "Write Off Cost Center", + "no_copy": 1, + "options": "Cost Center", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "against_expense_account", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Against Expense Account", + "no_copy": 1, + "oldfieldname": "against_expense_account", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 0 + }, + { + "fieldname": "advances", + "fieldtype": "Section Break", + "label": "Advances", + "oldfieldtype": "Section Break", + "options": "icon-money", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "get_advances_paid", + "fieldtype": "Button", + "label": "Get Advances Paid", + "oldfieldtype": "Button", + "options": "get_advances", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "advance_allocation_details", + "fieldtype": "Table", + "label": "Purchase Invoice Advances", + "no_copy": 1, + "oldfieldname": "advance_allocation_details", + "oldfieldtype": "Table", + "options": "Purchase Invoice Advance", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "terms_section_break", + "fieldtype": "Section Break", + "label": "Terms and Conditions", + "options": "icon-legal", + "permlevel": 0 + }, + { + "fieldname": "tc_name", + "fieldtype": "Link", + "label": "Terms", + "options": "Terms and Conditions", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "terms", + "fieldtype": "Text Editor", + "label": "Terms and Conditions1", + "permlevel": 0 + }, + { + "depends_on": "supplier", + "fieldname": "contact_section", + "fieldtype": "Section Break", + "label": "Contact Info", + "options": "icon-bullhorn", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "supplier_address", + "fieldtype": "Link", + "label": "Supplier Address", + "options": "Address", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "col_break23", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "contact_person", + "fieldtype": "Link", + "label": "Contact Person", + "options": "Contact", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "more_info", + "fieldtype": "Section Break", + "label": "More Info", + "oldfieldtype": "Section Break", + "options": "icon-file-text", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "description": "Supplier (Payable) Account", + "fieldname": "credit_to", + "fieldtype": "Link", + "in_filter": 1, + "label": "Credit To", + "oldfieldname": "credit_to", + "oldfieldtype": "Link", + "options": "Account", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1, + "search_index": 1 + }, + { + "default": "No", + "description": "Considered as Opening Balance", + "fieldname": "is_opening", + "fieldtype": "Select", + "in_filter": 1, + "label": "Is Opening", + "oldfieldname": "is_opening", + "oldfieldtype": "Select", + "options": "No\nYes", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "search_index": 1 + }, + { + "description": "Actual Invoice Date", + "fieldname": "aging_date", + "fieldtype": "Date", + "label": "Aging Date", + "oldfieldname": "aging_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "search_index": 0 + }, + { + "allow_on_submit": 1, + "fieldname": "select_print_heading", + "fieldtype": "Link", + "label": "Print Heading", + "no_copy": 1, + "oldfieldname": "select_print_heading", + "oldfieldtype": "Link", + "options": "Print Heading", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 1 + }, + { + "fieldname": "due_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Due Date", + "no_copy": 0, + "oldfieldname": "due_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 0, + "read_only": 0, + "search_index": 1 + }, + { + "fieldname": "mode_of_payment", + "fieldtype": "Select", + "label": "Mode of Payment", + "oldfieldname": "mode_of_payment", + "oldfieldtype": "Select", + "options": "link:Mode of Payment", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "column_break_63", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0 + }, + { + "allow_on_submit": 1, + "fieldname": "letter_head", + "fieldtype": "Select", + "label": "Letter Head", + "options": "link:Letter Head", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Select", + "in_filter": 1, + "label": "Fiscal Year", + "oldfieldname": "fiscal_year", + "oldfieldtype": "Select", + "options": "link:Fiscal Year", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "search_index": 1 + }, + { + "fieldname": "remarks", + "fieldtype": "Small Text", + "label": "Remarks", + "no_copy": 1, + "oldfieldname": "remarks", + "oldfieldtype": "Text", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 0 + } + ], + "icon": "icon-file-text", + "idx": 1, + "is_submittable": 1, + "modified": "2014-02-17 12:01:59", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Purchase Invoice", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts User", + "submit": 0, + "write": 0 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase User", + "submit": 0, + "write": 0 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Supplier", + "submit": 0, + "write": 0 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts Manager", + "submit": 1, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Auditor", + "submit": 0, + "write": 0 + } + ], + "read_only_onload": 1, + "search_fields": "posting_date, credit_to, fiscal_year, bill_no, grand_total, outstanding_amount" +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.txt b/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.txt index 98c8587755..8b6c697766 100644 --- a/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.txt +++ b/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.txt @@ -1,101 +1,88 @@ -[ - { - "creation": "2013-03-08 15:36:46", - "docstatus": 0, - "modified": "2014-02-03 12:38:24", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "istable": 1, - "module": "Accounts", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Purchase Invoice Advance", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Purchase Invoice Advance" - }, - { - "doctype": "DocField", - "fieldname": "journal_voucher", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Journal Voucher", - "no_copy": 1, - "oldfieldname": "journal_voucher", - "oldfieldtype": "Link", - "options": "Journal Voucher", - "print_width": "180px", - "read_only": 1, - "width": "180px" - }, - { - "doctype": "DocField", - "fieldname": "jv_detail_no", - "fieldtype": "Data", - "hidden": 1, - "in_list_view": 0, - "label": "Journal Voucher Detail No", - "no_copy": 1, - "oldfieldname": "jv_detail_no", - "oldfieldtype": "Date", - "print_hide": 1, - "print_width": "80px", - "read_only": 1, - "width": "80px" - }, - { - "doctype": "DocField", - "fieldname": "remarks", - "fieldtype": "Small Text", - "in_list_view": 1, - "label": "Remarks", - "no_copy": 1, - "oldfieldname": "remarks", - "oldfieldtype": "Small Text", - "print_width": "150px", - "read_only": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "col_break1", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "advance_amount", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Advance Amount", - "no_copy": 1, - "oldfieldname": "advance_amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_width": "100px", - "read_only": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "allocated_amount", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Allocated Amount", - "no_copy": 1, - "oldfieldname": "allocated_amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_width": "100px", - "width": "100px" - } -] \ No newline at end of file +{ + "creation": "2013-03-08 15:36:46", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "journal_voucher", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Journal Voucher", + "no_copy": 1, + "oldfieldname": "journal_voucher", + "oldfieldtype": "Link", + "options": "Journal Voucher", + "permlevel": 0, + "print_width": "180px", + "read_only": 1, + "width": "180px" + }, + { + "fieldname": "jv_detail_no", + "fieldtype": "Data", + "hidden": 1, + "in_list_view": 0, + "label": "Journal Voucher Detail No", + "no_copy": 1, + "oldfieldname": "jv_detail_no", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 1, + "print_width": "80px", + "read_only": 1, + "width": "80px" + }, + { + "fieldname": "remarks", + "fieldtype": "Small Text", + "in_list_view": 1, + "label": "Remarks", + "no_copy": 1, + "oldfieldname": "remarks", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_width": "150px", + "read_only": 1, + "width": "150px" + }, + { + "fieldname": "col_break1", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "advance_amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Advance Amount", + "no_copy": 1, + "oldfieldname": "advance_amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_width": "100px", + "read_only": 1, + "width": "100px" + }, + { + "fieldname": "allocated_amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Allocated Amount", + "no_copy": 1, + "oldfieldname": "allocated_amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_width": "100px", + "width": "100px" + } + ], + "idx": 1, + "istable": 1, + "modified": "2014-02-03 12:38:24", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Purchase Invoice Advance", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt index b3562b3747..1071f2291d 100755 --- a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt +++ b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt @@ -1,450 +1,437 @@ -[ - { - "creation": "2013-05-22 12:43:10", - "docstatus": 0, - "modified": "2014-02-28 11:27:53", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "EVD.######", - "doctype": "DocType", - "istable": 1, - "module": "Accounts", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Purchase Invoice Item", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Purchase Invoice Item" - }, - { - "doctype": "DocField", - "fieldname": "item_code", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 0, - "label": "Item", - "oldfieldname": "item_code", - "oldfieldtype": "Link", - "options": "Item", - "print_hide": 1, - "read_only": 0, - "reqd": 0, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "item_name", - "fieldtype": "Data", - "in_filter": 0, - "in_list_view": 1, - "label": "Item Name", - "oldfieldname": "item_name", - "oldfieldtype": "Data", - "read_only": 0, - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "col_break1", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Text", - "in_list_view": 1, - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Text", - "print_width": "300px", - "read_only": 0, - "width": "300px" - }, - { - "doctype": "DocField", - "fieldname": "quantity_and_rate", - "fieldtype": "Section Break", - "in_list_view": 0, - "label": "Quantity and Rate" - }, - { - "doctype": "DocField", - "fieldname": "qty", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Qty", - "oldfieldname": "qty", - "oldfieldtype": "Currency", - "print_hide": 0, - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "col_break2", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "uom", - "fieldtype": "Link", - "in_list_view": 0, - "label": "UOM", - "options": "UOM", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "conversion_factor", - "fieldtype": "Float", - "in_list_view": 0, - "label": "Conversion Factor", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "sec_break1", - "fieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "price_list_rate", - "fieldtype": "Currency", - "in_list_view": 0, - "label": "Price List Rate", - "options": "currency", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "discount_percentage", - "fieldtype": "Float", - "in_list_view": 0, - "label": "Discount %", - "print_hide": 0, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "col_break3", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "base_price_list_rate", - "fieldtype": "Currency", - "in_list_view": 0, - "label": "Price List Rate (Company Currency)", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "sec_break2", - "fieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "rate", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Rate ", - "oldfieldname": "import_rate", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 0, - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "amount", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Amount", - "oldfieldname": "import_amount", - "oldfieldtype": "Currency", - "options": "currency", - "read_only": 1, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "col_break4", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "base_rate", - "fieldtype": "Currency", - "in_list_view": 0, - "label": "Rate (Company Currency)", - "oldfieldname": "rate", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "base_amount", - "fieldtype": "Currency", - "in_list_view": 0, - "label": "Amount (Company Currency)", - "oldfieldname": "amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "pricing_rule_for_price", - "fieldtype": "Link", - "label": "Pricing Rule For Price", - "options": "Pricing Rule", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "pricing_rule_for_discount", - "fieldtype": "Link", - "label": "Pricing Rule For Discount", - "options": "Pricing Rule", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "accounting", - "fieldtype": "Section Break", - "in_list_view": 0, - "label": "Accounting" - }, - { - "doctype": "DocField", - "fieldname": "expense_account", - "fieldtype": "Link", - "in_list_view": 0, - "label": "Expense Head", - "oldfieldname": "expense_head", - "oldfieldtype": "Link", - "options": "Account", - "print_hide": 1, - "print_width": "120px", - "read_only": 0, - "reqd": 0, - "width": "120px" - }, - { - "doctype": "DocField", - "fieldname": "col_break5", - "fieldtype": "Column Break" - }, - { - "default": ":Company", - "doctype": "DocField", - "fieldname": "cost_center", - "fieldtype": "Link", - "in_list_view": 0, - "label": "Cost Center", - "oldfieldname": "cost_center", - "oldfieldtype": "Link", - "options": "Cost Center", - "print_hide": 1, - "print_width": "120px", - "read_only": 0, - "width": "120px" - }, - { - "doctype": "DocField", - "fieldname": "reference", - "fieldtype": "Section Break", - "in_list_view": 0, - "label": "Reference" - }, - { - "doctype": "DocField", - "fieldname": "project_name", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 0, - "label": "Project Name", - "options": "Project", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "brand", - "fieldtype": "Data", - "hidden": 1, - "in_list_view": 0, - "label": "Brand", - "oldfieldname": "brand", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 0 - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "item_group", - "fieldtype": "Link", - "hidden": 1, - "in_filter": 1, - "in_list_view": 0, - "label": "Item Group", - "oldfieldname": "item_group", - "oldfieldtype": "Link", - "options": "Item Group", - "print_hide": 1, - "read_only": 1, - "search_index": 1 - }, - { - "description": "Tax detail table fetched from item master as a string and stored in this field.\nUsed for Taxes and Charges", - "doctype": "DocField", - "fieldname": "item_tax_rate", - "fieldtype": "Small Text", - "hidden": 1, - "in_list_view": 0, - "label": "Item Tax Rate", - "oldfieldname": "item_tax_rate", - "oldfieldtype": "Small Text", - "print_hide": 1, - "read_only": 1, - "report_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "item_tax_amount", - "fieldtype": "Currency", - "hidden": 1, - "in_list_view": 0, - "label": "Item Tax Amount", - "no_copy": 1, - "options": "Company:company:default_currency", - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "search_index": 0, - "width": "150px" - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "page_break", - "fieldtype": "Check", - "in_list_view": 0, - "label": "Page Break", - "no_copy": 1, - "print_hide": 1, - "read_only": 0, - "report_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "col_break6", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "purchase_order", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 0, - "label": "Purchase Order", - "no_copy": 1, - "oldfieldname": "purchase_order", - "oldfieldtype": "Link", - "options": "Purchase Order", - "print_hide": 1, - "read_only": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "po_detail", - "fieldtype": "Data", - "hidden": 1, - "in_filter": 1, - "in_list_view": 0, - "label": "Purchase Order Item", - "no_copy": 1, - "oldfieldname": "po_detail", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "purchase_receipt", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 0, - "label": "Purchase Receipt", - "no_copy": 1, - "oldfieldname": "purchase_receipt", - "oldfieldtype": "Link", - "options": "Purchase Receipt", - "print_hide": 1, - "read_only": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "pr_detail", - "fieldtype": "Data", - "hidden": 1, - "in_filter": 1, - "in_list_view": 0, - "label": "PR Detail", - "no_copy": 1, - "oldfieldname": "pr_detail", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "valuation_rate", - "fieldtype": "Currency", - "hidden": 1, - "in_list_view": 0, - "label": "Valuation Rate", - "no_copy": 1, - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "rm_supp_cost", - "fieldtype": "Currency", - "hidden": 1, - "in_list_view": 0, - "label": "Raw Materials Supplied Cost", - "no_copy": 1, - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - } -] \ No newline at end of file +{ + "autoname": "EVD.######", + "creation": "2013-05-22 12:43:10", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "item_code", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 0, + "label": "Item", + "oldfieldname": "item_code", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 0, + "search_index": 1 + }, + { + "fieldname": "item_name", + "fieldtype": "Data", + "in_filter": 0, + "in_list_view": 1, + "label": "Item Name", + "oldfieldname": "item_name", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 0, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "col_break1", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "description", + "fieldtype": "Text", + "in_list_view": 1, + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Text", + "permlevel": 0, + "print_width": "300px", + "read_only": 0, + "width": "300px" + }, + { + "fieldname": "quantity_and_rate", + "fieldtype": "Section Break", + "in_list_view": 0, + "label": "Quantity and Rate", + "permlevel": 0 + }, + { + "fieldname": "qty", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Qty", + "oldfieldname": "qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "col_break2", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "uom", + "fieldtype": "Link", + "in_list_view": 0, + "label": "UOM", + "options": "UOM", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "conversion_factor", + "fieldtype": "Float", + "in_list_view": 0, + "label": "Conversion Factor", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "sec_break1", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "price_list_rate", + "fieldtype": "Currency", + "in_list_view": 0, + "label": "Price List Rate", + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "discount_percentage", + "fieldtype": "Float", + "in_list_view": 0, + "label": "Discount %", + "permlevel": 0, + "print_hide": 0, + "read_only": 0 + }, + { + "fieldname": "col_break3", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "base_price_list_rate", + "fieldtype": "Currency", + "in_list_view": 0, + "label": "Price List Rate (Company Currency)", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "sec_break2", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "rate", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Rate ", + "oldfieldname": "import_rate", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Amount", + "oldfieldname": "import_amount", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "read_only": 1, + "reqd": 1 + }, + { + "fieldname": "col_break4", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "base_rate", + "fieldtype": "Currency", + "in_list_view": 0, + "label": "Rate (Company Currency)", + "oldfieldname": "rate", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 1 + }, + { + "fieldname": "base_amount", + "fieldtype": "Currency", + "in_list_view": 0, + "label": "Amount (Company Currency)", + "oldfieldname": "amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 1 + }, + { + "fieldname": "pricing_rule_for_price", + "fieldtype": "Link", + "label": "Pricing Rule For Price", + "options": "Pricing Rule", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "pricing_rule_for_discount", + "fieldtype": "Link", + "label": "Pricing Rule For Discount", + "options": "Pricing Rule", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "accounting", + "fieldtype": "Section Break", + "in_list_view": 0, + "label": "Accounting", + "permlevel": 0 + }, + { + "fieldname": "expense_account", + "fieldtype": "Link", + "in_list_view": 0, + "label": "Expense Head", + "oldfieldname": "expense_head", + "oldfieldtype": "Link", + "options": "Account", + "permlevel": 0, + "print_hide": 1, + "print_width": "120px", + "read_only": 0, + "reqd": 0, + "width": "120px" + }, + { + "fieldname": "col_break5", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "default": ":Company", + "fieldname": "cost_center", + "fieldtype": "Link", + "in_list_view": 0, + "label": "Cost Center", + "oldfieldname": "cost_center", + "oldfieldtype": "Link", + "options": "Cost Center", + "permlevel": 0, + "print_hide": 1, + "print_width": "120px", + "read_only": 0, + "width": "120px" + }, + { + "fieldname": "reference", + "fieldtype": "Section Break", + "in_list_view": 0, + "label": "Reference", + "permlevel": 0 + }, + { + "fieldname": "project_name", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 0, + "label": "Project Name", + "options": "Project", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "brand", + "fieldtype": "Data", + "hidden": 1, + "in_list_view": 0, + "label": "Brand", + "oldfieldname": "brand", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "description": "Add / Edit", + "fieldname": "item_group", + "fieldtype": "Link", + "hidden": 1, + "in_filter": 1, + "in_list_view": 0, + "label": "Item Group", + "oldfieldname": "item_group", + "oldfieldtype": "Link", + "options": "Item Group", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "search_index": 1 + }, + { + "description": "Tax detail table fetched from item master as a string and stored in this field.\nUsed for Taxes and Charges", + "fieldname": "item_tax_rate", + "fieldtype": "Small Text", + "hidden": 1, + "in_list_view": 0, + "label": "Item Tax Rate", + "oldfieldname": "item_tax_rate", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "report_hide": 1 + }, + { + "fieldname": "item_tax_amount", + "fieldtype": "Currency", + "hidden": 1, + "in_list_view": 0, + "label": "Item Tax Amount", + "no_copy": 1, + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 1, + "search_index": 0, + "width": "150px" + }, + { + "allow_on_submit": 1, + "fieldname": "page_break", + "fieldtype": "Check", + "in_list_view": 0, + "label": "Page Break", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 1 + }, + { + "fieldname": "col_break6", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "purchase_order", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 0, + "label": "Purchase Order", + "no_copy": 1, + "oldfieldname": "purchase_order", + "oldfieldtype": "Link", + "options": "Purchase Order", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "search_index": 1 + }, + { + "fieldname": "po_detail", + "fieldtype": "Data", + "hidden": 1, + "in_filter": 1, + "in_list_view": 0, + "label": "Purchase Order Item", + "no_copy": 1, + "oldfieldname": "po_detail", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "search_index": 1 + }, + { + "fieldname": "purchase_receipt", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 0, + "label": "Purchase Receipt", + "no_copy": 1, + "oldfieldname": "purchase_receipt", + "oldfieldtype": "Link", + "options": "Purchase Receipt", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "search_index": 1 + }, + { + "fieldname": "pr_detail", + "fieldtype": "Data", + "hidden": 1, + "in_filter": 1, + "in_list_view": 0, + "label": "PR Detail", + "no_copy": 1, + "oldfieldname": "pr_detail", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "search_index": 1 + }, + { + "fieldname": "valuation_rate", + "fieldtype": "Currency", + "hidden": 1, + "in_list_view": 0, + "label": "Valuation Rate", + "no_copy": 1, + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "rm_supp_cost", + "fieldtype": "Currency", + "hidden": 1, + "in_list_view": 0, + "label": "Raw Materials Supplied Cost", + "no_copy": 1, + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + } + ], + "idx": 1, + "istable": 1, + "modified": "2014-02-28 11:27:53", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Purchase Invoice Item", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.txt b/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.txt index c5768c6651..f95d36167c 100644 --- a/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.txt +++ b/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.txt @@ -1,175 +1,162 @@ -[ - { - "creation": "2013-05-21 16:16:04", - "docstatus": 0, - "modified": "2014-02-03 12:36:04", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "PVTD.######", - "doctype": "DocType", - "hide_heading": 1, - "istable": 1, - "module": "Accounts", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Purchase Taxes and Charges", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Purchase Taxes and Charges" - }, - { - "default": "Valuation and Total", - "doctype": "DocField", - "fieldname": "category", - "fieldtype": "Select", - "in_list_view": 0, - "label": "Consider Tax or Charge for", - "oldfieldname": "category", - "oldfieldtype": "Select", - "options": "Valuation and Total\nValuation\nTotal", - "read_only": 0, - "reqd": 1 - }, - { - "default": "Add", - "doctype": "DocField", - "fieldname": "add_deduct_tax", - "fieldtype": "Select", - "label": "Add or Deduct", - "oldfieldname": "add_deduct_tax", - "oldfieldtype": "Select", - "options": "Add\nDeduct", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "charge_type", - "fieldtype": "Select", - "in_list_view": 1, - "label": "Type", - "oldfieldname": "charge_type", - "oldfieldtype": "Select", - "options": "\nActual\nOn Net Total\nOn Previous Row Amount\nOn Previous Row Total", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "row_id", - "fieldtype": "Data", - "hidden": 0, - "label": "Enter Row", - "oldfieldname": "row_id", - "oldfieldtype": "Data", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Small Text", - "in_list_view": 1, - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Small Text", - "print_width": "300px", - "read_only": 0, - "reqd": 1, - "width": "300px" - }, - { - "doctype": "DocField", - "fieldname": "col_break1", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "account_head", - "fieldtype": "Link", - "in_list_view": 0, - "label": "Account Head", - "oldfieldname": "account_head", - "oldfieldtype": "Link", - "options": "Account", - "read_only": 0, - "reqd": 1 - }, - { - "default": ":Company", - "doctype": "DocField", - "fieldname": "cost_center", - "fieldtype": "Link", - "in_list_view": 0, - "label": "Cost Center", - "oldfieldname": "cost_center", - "oldfieldtype": "Link", - "options": "Cost Center", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "rate", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Rate", - "oldfieldname": "rate", - "oldfieldtype": "Currency", - "read_only": 0, - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "tax_amount", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Amount", - "oldfieldname": "tax_amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "read_only": 1, - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "total", - "fieldtype": "Currency", - "label": "Total", - "oldfieldname": "total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "item_wise_tax_detail", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Item Wise Tax Detail ", - "oldfieldname": "item_wise_tax_detail", - "oldfieldtype": "Small Text", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "parenttype", - "fieldtype": "Data", - "hidden": 1, - "in_filter": 1, - "label": "Parenttype", - "oldfieldname": "parenttype", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 0, - "search_index": 0 - } -] \ No newline at end of file +{ + "autoname": "PVTD.######", + "creation": "2013-05-21 16:16:04", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "default": "Valuation and Total", + "fieldname": "category", + "fieldtype": "Select", + "in_list_view": 0, + "label": "Consider Tax or Charge for", + "oldfieldname": "category", + "oldfieldtype": "Select", + "options": "Valuation and Total\nValuation\nTotal", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "default": "Add", + "fieldname": "add_deduct_tax", + "fieldtype": "Select", + "label": "Add or Deduct", + "oldfieldname": "add_deduct_tax", + "oldfieldtype": "Select", + "options": "Add\nDeduct", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "charge_type", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Type", + "oldfieldname": "charge_type", + "oldfieldtype": "Select", + "options": "\nActual\nOn Net Total\nOn Previous Row Amount\nOn Previous Row Total", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "row_id", + "fieldtype": "Data", + "hidden": 0, + "label": "Enter Row", + "oldfieldname": "row_id", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "description", + "fieldtype": "Small Text", + "in_list_view": 1, + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_width": "300px", + "read_only": 0, + "reqd": 1, + "width": "300px" + }, + { + "fieldname": "col_break1", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "account_head", + "fieldtype": "Link", + "in_list_view": 0, + "label": "Account Head", + "oldfieldname": "account_head", + "oldfieldtype": "Link", + "options": "Account", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "default": ":Company", + "fieldname": "cost_center", + "fieldtype": "Link", + "in_list_view": 0, + "label": "Cost Center", + "oldfieldname": "cost_center", + "oldfieldtype": "Link", + "options": "Cost Center", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "rate", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Rate", + "oldfieldname": "rate", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 0, + "reqd": 0 + }, + { + "fieldname": "tax_amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Amount", + "oldfieldname": "tax_amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1, + "reqd": 0 + }, + { + "fieldname": "total", + "fieldtype": "Currency", + "label": "Total", + "oldfieldname": "total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "item_wise_tax_detail", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Item Wise Tax Detail ", + "oldfieldname": "item_wise_tax_detail", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "parenttype", + "fieldtype": "Data", + "hidden": 1, + "in_filter": 1, + "label": "Parenttype", + "oldfieldname": "parenttype", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "search_index": 0 + } + ], + "hide_heading": 1, + "idx": 1, + "istable": 1, + "modified": "2014-02-03 12:36:04", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Purchase Taxes and Charges", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.txt b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.txt index 346dd0e284..4edc055995 100644 --- a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.txt +++ b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.txt @@ -1,96 +1,83 @@ -[ - { - "creation": "2013-01-10 16:34:08", - "docstatus": 0, - "modified": "2014-01-29 12:26:38", - "modified_by": "Administrator", - "owner": "wasim@webnotestech.com" - }, - { - "allow_import": 1, - "allow_rename": 1, - "autoname": "field:title", - "description": "Standard tax template that can be applied to all Purchase Transactions. This template can contain list of tax heads and also other expense heads like \"Shipping\", \"Insurance\", \"Handling\" etc.\n\n#### Note\n\nThe tax rate you define here will be the standard tax rate for all **Items**. If there are **Items** that have different rates, they must be added in the **Item Tax** table in the **Item** master.\n\n#### Description of Columns\n\n1. Calculation Type: \n - This can be on **Net Total** (that is the sum of basic amount).\n - **On Previous Row Total / Amount** (for cumulative taxes or charges). If you select this option, the tax will be applied as a percentage of the previous row (in the tax table) amount or total.\n - **Actual** (as mentioned).\n2. Account Head: The Account ledger under which this tax will be booked\n3. Cost Center: If the tax / charge is an income (like shipping) or expense it needs to be booked against a Cost Center.\n4. Description: Description of the tax (that will be printed in invoices / quotes).\n5. Rate: Tax rate.\n6. Amount: Tax amount.\n7. Total: Cumulative total to this point.\n8. Enter Row: If based on \"Previous Row Total\" you can select the row number which will be taken as a base for this calculation (default is the previous row).\n9. Consider Tax or Charge for: In this section you can specify if the tax / charge is only for valuation (not a part of total) or only for total (does not add value to the item) or for both.\n10. Add or Deduct: Whether you want to add or deduct the tax.", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-money", - "module": "Accounts", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Purchase Taxes and Charges Master", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "cancel": 0, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Purchase Taxes and Charges Master", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 0 - }, - { - "doctype": "DocType", - "name": "Purchase Taxes and Charges Master" - }, - { - "doctype": "DocField", - "fieldname": "title", - "fieldtype": "Data", - "in_filter": 1, - "label": "Title", - "oldfieldname": "title", - "oldfieldtype": "Data", - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "is_default", - "fieldtype": "Check", - "label": "Default" - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "in_filter": 1, - "label": "Company", - "options": "Company", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "other_charges", - "fieldtype": "Table", - "label": "Purchase Taxes and Charges", - "oldfieldname": "purchase_tax_details", - "oldfieldtype": "Table", - "options": "Purchase Taxes and Charges" - }, - { - "amend": 0, - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Purchase Manager", - "write": 0 - }, - { - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Purchase Master Manager", - "write": 1 - } -] \ No newline at end of file +{ + "allow_import": 1, + "allow_rename": 1, + "autoname": "field:title", + "creation": "2013-01-10 16:34:08", + "description": "Standard tax template that can be applied to all Purchase Transactions. This template can contain list of tax heads and also other expense heads like \"Shipping\", \"Insurance\", \"Handling\" etc.\n\n#### Note\n\nThe tax rate you define here will be the standard tax rate for all **Items**. If there are **Items** that have different rates, they must be added in the **Item Tax** table in the **Item** master.\n\n#### Description of Columns\n\n1. Calculation Type: \n - This can be on **Net Total** (that is the sum of basic amount).\n - **On Previous Row Total / Amount** (for cumulative taxes or charges). If you select this option, the tax will be applied as a percentage of the previous row (in the tax table) amount or total.\n - **Actual** (as mentioned).\n2. Account Head: The Account ledger under which this tax will be booked\n3. Cost Center: If the tax / charge is an income (like shipping) or expense it needs to be booked against a Cost Center.\n4. Description: Description of the tax (that will be printed in invoices / quotes).\n5. Rate: Tax rate.\n6. Amount: Tax amount.\n7. Total: Cumulative total to this point.\n8. Enter Row: If based on \"Previous Row Total\" you can select the row number which will be taken as a base for this calculation (default is the previous row).\n9. Consider Tax or Charge for: In this section you can specify if the tax / charge is only for valuation (not a part of total) or only for total (does not add value to the item) or for both.\n10. Add or Deduct: Whether you want to add or deduct the tax.", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "title", + "fieldtype": "Data", + "in_filter": 1, + "label": "Title", + "oldfieldname": "title", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "is_default", + "fieldtype": "Check", + "label": "Default", + "permlevel": 0 + }, + { + "fieldname": "company", + "fieldtype": "Link", + "in_filter": 1, + "label": "Company", + "options": "Company", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "other_charges", + "fieldtype": "Table", + "label": "Purchase Taxes and Charges", + "oldfieldname": "purchase_tax_details", + "oldfieldtype": "Table", + "options": "Purchase Taxes and Charges", + "permlevel": 0 + } + ], + "icon": "icon-money", + "idx": 1, + "modified": "2014-01-29 12:26:38", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Purchase Taxes and Charges Master", + "owner": "wasim@webnotestech.com", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase Manager", + "submit": 0, + "write": 0 + }, + { + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase Master Manager", + "submit": 0, + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt b/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt index 49cc213349..1da1c39dde 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt @@ -1,1239 +1,1228 @@ -[ - { - "creation": "2013-05-24 19:29:05", - "docstatus": 0, - "modified": "2014-01-28 18:43:10", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_attach": 1, - "allow_import": 1, - "autoname": "naming_series:", - "default_print_format": "Standard", - "doctype": "DocType", - "document_type": "Transaction", - "icon": "icon-file-text", - "is_submittable": 1, - "module": "Accounts", - "name": "__common__", - "read_only_onload": 1, - "search_fields": "posting_date, due_date, debit_to, fiscal_year, grand_total, outstanding_amount" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Sales Invoice", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Sales Invoice", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1 - }, - { - "doctype": "DocType", - "name": "Sales Invoice" - }, - { - "doctype": "DocField", - "fieldname": "customer_section", - "fieldtype": "Section Break", - "label": "Customer", - "options": "icon-user" - }, - { - "doctype": "DocField", - "fieldname": "naming_series", - "fieldtype": "Select", - "label": "Series", - "no_copy": 1, - "oldfieldname": "naming_series", - "oldfieldtype": "Select", - "options": "INV\nINV/10-11/", - "print_hide": 1, - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "customer", - "fieldtype": "Link", - "hidden": 0, - "label": "Customer", - "no_copy": 0, - "oldfieldname": "customer", - "oldfieldtype": "Link", - "options": "Customer", - "print_hide": 1, - "read_only": 0 - }, - { - "depends_on": "customer", - "doctype": "DocField", - "fieldname": "customer_name", - "fieldtype": "Data", - "hidden": 0, - "in_list_view": 1, - "label": "Name", - "oldfieldname": "customer_name", - "oldfieldtype": "Data", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "address_display", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Address", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "contact_display", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Contact", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "contact_mobile", - "fieldtype": "Text", - "hidden": 1, - "label": "Mobile No", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "contact_email", - "fieldtype": "Text", - "hidden": 1, - "label": "Contact Email", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "is_pos", - "fieldtype": "Check", - "label": "Is POS", - "oldfieldname": "is_pos", - "oldfieldtype": "Check", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "amended_from", - "fieldtype": "Link", - "ignore_restrictions": 1, - "label": "Amended From", - "no_copy": 1, - "oldfieldname": "amended_from", - "oldfieldtype": "Link", - "options": "Sales Invoice", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "in_filter": 1, - "label": "Company", - "oldfieldname": "company", - "oldfieldtype": "Link", - "options": "Company", - "print_hide": 1, - "read_only": 0, - "reqd": 1, - "search_index": 0 - }, - { - "default": "Today", - "doctype": "DocField", - "fieldname": "posting_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Posting Date", - "no_copy": 1, - "oldfieldname": "posting_date", - "oldfieldtype": "Date", - "print_hide": 0, - "read_only": 0, - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "due_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Payment Due Date", - "no_copy": 1, - "oldfieldname": "due_date", - "oldfieldtype": "Date", - "read_only": 0, - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "mode_of_payment", - "fieldtype": "Select", - "label": "Mode of Payment", - "no_copy": 0, - "oldfieldname": "mode_of_payment", - "oldfieldtype": "Select", - "options": "link:Mode of Payment", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "currency_section", - "fieldtype": "Section Break", - "label": "Currency and Price List", - "options": "icon-tag", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "currency", - "fieldtype": "Link", - "label": "Currency", - "oldfieldname": "currency", - "oldfieldtype": "Select", - "options": "Currency", - "print_hide": 1, - "read_only": 0, - "reqd": 1 - }, - { - "description": "Rate at which Customer Currency is converted to customer's base currency", - "doctype": "DocField", - "fieldname": "conversion_rate", - "fieldtype": "Float", - "label": "Exchange Rate", - "oldfieldname": "conversion_rate", - "oldfieldtype": "Currency", - "print_hide": 1, - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break2", - "fieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "selling_price_list", - "fieldtype": "Link", - "label": "Price List", - "oldfieldname": "price_list_name", - "oldfieldtype": "Select", - "options": "Price List", - "print_hide": 1, - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "price_list_currency", - "fieldtype": "Link", - "label": "Price List Currency", - "options": "Currency", - "print_hide": 1, - "read_only": 1, - "reqd": 1 - }, - { - "description": "Rate at which Price list currency is converted to customer's base currency", - "doctype": "DocField", - "fieldname": "plc_conversion_rate", - "fieldtype": "Float", - "label": "Price List Exchange Rate", - "no_copy": 0, - "print_hide": 1, - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "items", - "fieldtype": "Section Break", - "label": "Items", - "oldfieldtype": "Section Break", - "options": "icon-shopping-cart", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "update_stock", - "fieldtype": "Check", - "label": "Update Stock", - "oldfieldname": "update_stock", - "oldfieldtype": "Check", - "print_hide": 1, - "read_only": 0 - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "entries", - "fieldtype": "Table", - "label": "Sales Invoice Items", - "oldfieldname": "entries", - "oldfieldtype": "Table", - "options": "Sales Invoice Item", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "packing_list", - "fieldtype": "Section Break", - "label": "Packing List", - "options": "icon-suitcase", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "packing_details", - "fieldtype": "Table", - "label": "Packing Details", - "options": "Packed Item", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "sales_bom_help", - "fieldtype": "HTML", - "label": "Sales BOM Help", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "section_break_30", - "fieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "net_total_export", - "fieldtype": "Currency", - "label": "Net Total", - "options": "currency", - "print_hide": 0, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break_32", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "net_total", - "fieldtype": "Currency", - "label": "Net Total (Company Currency)", - "oldfieldname": "net_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "taxes", - "fieldtype": "Section Break", - "label": "Taxes and Charges", - "oldfieldtype": "Section Break", - "options": "icon-money", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "taxes_and_charges", - "fieldtype": "Link", - "label": "Taxes and Charges", - "oldfieldname": "charge", - "oldfieldtype": "Link", - "options": "Sales Taxes and Charges Master", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break_38", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "shipping_rule", - "fieldtype": "Link", - "label": "Shipping Rule", - "oldfieldtype": "Button", - "options": "Shipping Rule", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "section_break_40", - "fieldtype": "Section Break" - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "other_charges", - "fieldtype": "Table", - "label": "Sales Taxes and Charges", - "oldfieldname": "other_charges", - "oldfieldtype": "Table", - "options": "Sales Taxes and Charges", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "other_charges_calculation", - "fieldtype": "HTML", - "label": "Taxes and Charges Calculation", - "oldfieldtype": "HTML", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "section_break_43", - "fieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "other_charges_total_export", - "fieldtype": "Currency", - "label": "Total Taxes and Charges", - "options": "currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break_45", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "other_charges_total", - "fieldtype": "Currency", - "label": "Total Taxes and Charges (Company Currency)", - "oldfieldname": "other_charges_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "discount_amount", - "fieldtype": "Currency", - "label": "Discount Amount", - "options": "Company:company:default_currency", - "print_hide": 0 - }, - { - "doctype": "DocField", - "fieldname": "totals", - "fieldtype": "Section Break", - "label": "Totals", - "oldfieldtype": "Section Break", - "options": "icon-money", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "grand_total_export", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Grand Total", - "oldfieldname": "grand_total_export", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 0, - "read_only": 1, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "rounded_total_export", - "fieldtype": "Currency", - "label": "Rounded Total", - "oldfieldname": "rounded_total_export", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 0, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "in_words_export", - "fieldtype": "Data", - "label": "In Words", - "oldfieldname": "in_words_export", - "oldfieldtype": "Data", - "print_hide": 0, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "gross_profit", - "fieldtype": "Currency", - "label": "Gross Profit", - "oldfieldname": "gross_profit", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "gross_profit_percent", - "fieldtype": "Float", - "label": "Gross Profit (%)", - "oldfieldname": "gross_profit_percent", - "oldfieldtype": "Currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break5", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "print_hide": 1, - "read_only": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "grand_total", - "fieldtype": "Currency", - "in_filter": 1, - "label": "Grand Total (Company Currency)", - "oldfieldname": "grand_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1, - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "rounded_total", - "fieldtype": "Currency", - "label": "Rounded Total (Company Currency)", - "oldfieldname": "rounded_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "description": "In Words will be visible once you save the Sales Invoice.", - "doctype": "DocField", - "fieldname": "in_words", - "fieldtype": "Data", - "label": "In Words (Company Currency)", - "oldfieldname": "in_words", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "total_advance", - "fieldtype": "Currency", - "label": "Total Advance", - "oldfieldname": "total_advance", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "outstanding_amount", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Outstanding Amount", - "no_copy": 1, - "oldfieldname": "outstanding_amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "advances", - "fieldtype": "Section Break", - "label": "Advances", - "oldfieldtype": "Section Break", - "options": "icon-money", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "get_advances_received", - "fieldtype": "Button", - "label": "Get Advances Received", - "oldfieldtype": "Button", - "options": "get_advances", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "advance_adjustment_details", - "fieldtype": "Table", - "label": "Sales Invoice Advance", - "oldfieldname": "advance_adjustment_details", - "oldfieldtype": "Table", - "options": "Sales Invoice Advance", - "print_hide": 1, - "read_only": 0 - }, - { - "depends_on": "is_pos", - "doctype": "DocField", - "fieldname": "payments_section", - "fieldtype": "Section Break", - "label": "Payments", - "options": "icon-money", - "read_only": 0 - }, - { - "depends_on": "is_pos", - "doctype": "DocField", - "fieldname": "column_break3", - "fieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "depends_on": "is_pos", - "doctype": "DocField", - "fieldname": "paid_amount", - "fieldtype": "Currency", - "label": "Paid Amount", - "oldfieldname": "paid_amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 0 - }, - { - "depends_on": "is_pos", - "doctype": "DocField", - "fieldname": "cash_bank_account", - "fieldtype": "Link", - "label": "Cash/Bank Account", - "oldfieldname": "cash_bank_account", - "oldfieldtype": "Link", - "options": "Account", - "print_hide": 1, - "read_only": 0 - }, - { - "depends_on": "is_pos", - "doctype": "DocField", - "fieldname": "column_break4", - "fieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "depends_on": "is_pos", - "doctype": "DocField", - "fieldname": "write_off_outstanding_amount_automatically", - "fieldtype": "Check", - "label": "Write Off Outstanding Amount", - "print_hide": 1, - "read_only": 0 - }, - { - "depends_on": "is_pos", - "doctype": "DocField", - "fieldname": "write_off_amount", - "fieldtype": "Currency", - "label": "Write Off Amount", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 0 - }, - { - "depends_on": "is_pos", - "doctype": "DocField", - "fieldname": "write_off_account", - "fieldtype": "Link", - "label": "Write Off Account", - "options": "Account", - "print_hide": 1, - "read_only": 0 - }, - { - "depends_on": "is_pos", - "doctype": "DocField", - "fieldname": "write_off_cost_center", - "fieldtype": "Link", - "label": "Write Off Cost Center", - "options": "Cost Center", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "terms_section_break", - "fieldtype": "Section Break", - "label": "Terms and Conditions", - "oldfieldtype": "Section Break", - "options": "icon-legal", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "tc_name", - "fieldtype": "Link", - "label": "Terms", - "oldfieldname": "tc_name", - "oldfieldtype": "Link", - "options": "Terms and Conditions", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "terms", - "fieldtype": "Text Editor", - "label": "Terms and Conditions Details", - "oldfieldname": "terms", - "oldfieldtype": "Text Editor", - "read_only": 0 - }, - { - "depends_on": "customer", - "doctype": "DocField", - "fieldname": "contact_section", - "fieldtype": "Section Break", - "hidden": 0, - "label": "Contact Info", - "options": "icon-bullhorn", - "read_only": 0 - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "territory", - "fieldtype": "Link", - "in_filter": 1, - "label": "Territory", - "options": "Territory", - "print_hide": 1, - "read_only": 0, - "reqd": 1, - "search_index": 0 - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "customer_group", - "fieldtype": "Link", - "in_filter": 1, - "label": "Customer Group", - "options": "Customer Group", - "print_hide": 1, - "read_only": 0, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "col_break23", - "fieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "customer_address", - "fieldtype": "Link", - "label": "Customer Address", - "options": "Address", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "contact_person", - "fieldtype": "Link", - "label": "Contact Person", - "options": "Contact", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "more_info", - "fieldtype": "Section Break", - "label": "More Info", - "oldfieldtype": "Section Break", - "options": "icon-file-text", - "print_hide": 1, - "read_only": 0 - }, - { - "description": "Customer (Receivable) Account", - "doctype": "DocField", - "fieldname": "debit_to", - "fieldtype": "Link", - "in_filter": 1, - "label": "Debit To", - "oldfieldname": "debit_to", - "oldfieldtype": "Link", - "options": "Account", - "print_hide": 1, - "read_only": 0, - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "project_name", - "fieldtype": "Link", - "in_filter": 1, - "label": "Project Name", - "oldfieldname": "project_name", - "oldfieldtype": "Link", - "options": "Project", - "read_only": 0, - "search_index": 1 - }, - { - "depends_on": "eval:doc.source == 'Campaign'", - "doctype": "DocField", - "fieldname": "campaign", - "fieldtype": "Link", - "label": "Campaign", - "oldfieldname": "campaign", - "oldfieldtype": "Link", - "options": "Campaign", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "source", - "fieldtype": "Select", - "label": "Source", - "oldfieldname": "source", - "oldfieldtype": "Select", - "options": "\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign", - "print_hide": 1, - "read_only": 0 - }, - { - "default": "No", - "description": "Considered as an Opening Balance", - "doctype": "DocField", - "fieldname": "is_opening", - "fieldtype": "Select", - "in_filter": 1, - "label": "Is Opening Entry", - "oldfieldname": "is_opening", - "oldfieldtype": "Select", - "options": "No\nYes", - "print_hide": 1, - "read_only": 0, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "c_form_applicable", - "fieldtype": "Select", - "label": "C-Form Applicable", - "no_copy": 1, - "options": "No\nYes", - "print_hide": 1, - "read_only": 0, - "report_hide": 0 - }, - { - "doctype": "DocField", - "fieldname": "c_form_no", - "fieldtype": "Link", - "label": "C-Form No", - "no_copy": 1, - "options": "C-Form", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break8", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "print_hide": 1, - "read_only": 0 - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "letter_head", - "fieldtype": "Select", - "label": "Letter Head", - "oldfieldname": "letter_head", - "oldfieldtype": "Select", - "options": "link:Letter Head", - "print_hide": 1, - "read_only": 0 - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "select_print_heading", - "fieldtype": "Link", - "label": "Print Heading", - "no_copy": 1, - "oldfieldname": "select_print_heading", - "oldfieldtype": "Link", - "options": "Print Heading", - "print_hide": 1, - "read_only": 0, - "report_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "posting_time", - "fieldtype": "Time", - "label": "Posting Time", - "no_copy": 1, - "oldfieldname": "posting_time", - "oldfieldtype": "Time", - "print_hide": 1, - "read_only": 0 - }, - { - "description": "Actual Invoice Date", - "doctype": "DocField", - "fieldname": "aging_date", - "fieldtype": "Date", - "label": "Aging Date", - "oldfieldname": "aging_date", - "oldfieldtype": "Date", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "fiscal_year", - "fieldtype": "Select", - "in_filter": 1, - "label": "Fiscal Year", - "no_copy": 0, - "oldfieldname": "fiscal_year", - "oldfieldtype": "Select", - "options": "link:Fiscal Year", - "print_hide": 1, - "read_only": 0, - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "remarks", - "fieldtype": "Small Text", - "label": "Remarks", - "no_copy": 1, - "oldfieldname": "remarks", - "oldfieldtype": "Text", - "print_hide": 1, - "read_only": 0, - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "sales_team_section_break", - "fieldtype": "Section Break", - "label": "Sales Team", - "oldfieldtype": "Section Break", - "options": "icon-group", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break9", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "print_hide": 1, - "read_only": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "sales_partner", - "fieldtype": "Link", - "in_filter": 1, - "label": "Sales Partner", - "oldfieldname": "sales_partner", - "oldfieldtype": "Link", - "options": "Sales Partner", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break10", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "print_hide": 1, - "read_only": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "commission_rate", - "fieldtype": "Float", - "label": "Commission Rate (%)", - "oldfieldname": "commission_rate", - "oldfieldtype": "Currency", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "total_commission", - "fieldtype": "Currency", - "label": "Total Commission", - "oldfieldname": "total_commission", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "section_break2", - "fieldtype": "Section Break", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "sales_team", - "fieldtype": "Table", - "label": "Sales Team1", - "oldfieldname": "sales_team", - "oldfieldtype": "Table", - "options": "Sales Team", - "print_hide": 1, - "read_only": 0 - }, - { - "depends_on": "eval:doc.docstatus<2", - "doctype": "DocField", - "fieldname": "recurring_invoice", - "fieldtype": "Section Break", - "label": "Recurring Invoice", - "options": "icon-time", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break11", - "fieldtype": "Column Break", - "print_hide": 1, - "read_only": 0, - "width": "50%" - }, - { - "allow_on_submit": 1, - "depends_on": "eval:doc.docstatus<2", - "description": "Check if recurring invoice, uncheck to stop recurring or put proper End Date", - "doctype": "DocField", - "fieldname": "convert_into_recurring_invoice", - "fieldtype": "Check", - "label": "Convert into Recurring Invoice", - "no_copy": 1, - "print_hide": 1, - "read_only": 0 - }, - { - "allow_on_submit": 1, - "depends_on": "eval:doc.convert_into_recurring_invoice==1", - "description": "Select the period when the invoice will be generated automatically", - "doctype": "DocField", - "fieldname": "recurring_type", - "fieldtype": "Select", - "label": "Recurring Type", - "no_copy": 1, - "options": "\nMonthly\nQuarterly\nHalf-yearly\nYearly", - "print_hide": 1, - "read_only": 0 - }, - { - "allow_on_submit": 1, - "depends_on": "eval:doc.convert_into_recurring_invoice==1", - "description": "The day of the month on which auto invoice will be generated e.g. 05, 28 etc ", - "doctype": "DocField", - "fieldname": "repeat_on_day_of_month", - "fieldtype": "Int", - "label": "Repeat on Day of Month", - "no_copy": 1, - "print_hide": 1, - "read_only": 0 - }, - { - "allow_on_submit": 1, - "depends_on": "eval:doc.convert_into_recurring_invoice==1", - "description": "Start date of current invoice's period", - "doctype": "DocField", - "fieldname": "invoice_period_from_date", - "fieldtype": "Date", - "label": "Invoice Period From Date", - "no_copy": 1, - "print_hide": 1, - "read_only": 0 - }, - { - "allow_on_submit": 1, - "depends_on": "eval:doc.convert_into_recurring_invoice==1", - "description": "End date of current invoice's period", - "doctype": "DocField", - "fieldname": "invoice_period_to_date", - "fieldtype": "Date", - "label": "Invoice Period To Date", - "no_copy": 1, - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break12", - "fieldtype": "Column Break", - "no_copy": 0, - "print_hide": 1, - "read_only": 0, - "width": "50%" - }, - { - "allow_on_submit": 1, - "depends_on": "eval:doc.convert_into_recurring_invoice==1", - "description": "Enter email id separated by commas, invoice will be mailed automatically on particular date", - "doctype": "DocField", - "fieldname": "notification_email_address", - "fieldtype": "Small Text", - "label": "Notification Email Address", - "no_copy": 1, - "print_hide": 1, - "read_only": 0 - }, - { - "depends_on": "eval:doc.convert_into_recurring_invoice==1", - "description": "The unique id for tracking all recurring invoices.\u00a0It is generated on submit.", - "doctype": "DocField", - "fieldname": "recurring_id", - "fieldtype": "Data", - "label": "Recurring Id", - "no_copy": 1, - "print_hide": 1, - "read_only": 1 - }, - { - "depends_on": "eval:doc.convert_into_recurring_invoice==1", - "description": "The date on which next invoice will be generated. It is generated on submit.\n", - "doctype": "DocField", - "fieldname": "next_date", - "fieldtype": "Date", - "label": "Next Date", - "no_copy": 1, - "print_hide": 1, - "read_only": 1 - }, - { - "allow_on_submit": 1, - "depends_on": "eval:doc.convert_into_recurring_invoice==1", - "description": "The date on which recurring invoice will be stop", - "doctype": "DocField", - "fieldname": "end_date", - "fieldtype": "Date", - "label": "End Date", - "no_copy": 1, - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "against_income_account", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Against Income Account", - "no_copy": 1, - "oldfieldname": "against_income_account", - "oldfieldtype": "Small Text", - "print_hide": 1, - "read_only": 0, - "report_hide": 1 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Accounts Manager", - "submit": 1, - "write": 1 - }, - { - "amend": 1, - "cancel": 0, - "create": 1, - "delete": 0, - "doctype": "DocPerm", - "role": "Accounts User", - "submit": 1, - "write": 1 - }, - { - "cancel": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Customer" - } -] \ No newline at end of file +{ + "allow_attach": 1, + "allow_import": 1, + "autoname": "naming_series:", + "creation": "2013-05-24 19:29:05", + "default_print_format": "Standard", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Transaction", + "fields": [ + { + "fieldname": "customer_section", + "fieldtype": "Section Break", + "label": "Customer", + "options": "icon-user", + "permlevel": 0 + }, + { + "fieldname": "naming_series", + "fieldtype": "Select", + "label": "Series", + "no_copy": 1, + "oldfieldname": "naming_series", + "oldfieldtype": "Select", + "options": "INV\nINV/10-11/", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "customer", + "fieldtype": "Link", + "hidden": 0, + "label": "Customer", + "no_copy": 0, + "oldfieldname": "customer", + "oldfieldtype": "Link", + "options": "Customer", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "depends_on": "customer", + "fieldname": "customer_name", + "fieldtype": "Data", + "hidden": 0, + "in_list_view": 1, + "label": "Name", + "oldfieldname": "customer_name", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "address_display", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Address", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "contact_display", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Contact", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "contact_mobile", + "fieldtype": "Text", + "hidden": 1, + "label": "Mobile No", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "contact_email", + "fieldtype": "Text", + "hidden": 1, + "label": "Contact Email", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "is_pos", + "fieldtype": "Check", + "label": "Is POS", + "oldfieldname": "is_pos", + "oldfieldtype": "Check", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "amended_from", + "fieldtype": "Link", + "ignore_restrictions": 1, + "label": "Amended From", + "no_copy": 1, + "oldfieldname": "amended_from", + "oldfieldtype": "Link", + "options": "Sales Invoice", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "company", + "fieldtype": "Link", + "in_filter": 1, + "label": "Company", + "oldfieldname": "company", + "oldfieldtype": "Link", + "options": "Company", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1, + "search_index": 0 + }, + { + "default": "Today", + "fieldname": "posting_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Posting Date", + "no_copy": 1, + "oldfieldname": "posting_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 0, + "read_only": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "due_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Payment Due Date", + "no_copy": 1, + "oldfieldname": "due_date", + "oldfieldtype": "Date", + "permlevel": 0, + "read_only": 0, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "mode_of_payment", + "fieldtype": "Select", + "label": "Mode of Payment", + "no_copy": 0, + "oldfieldname": "mode_of_payment", + "oldfieldtype": "Select", + "options": "link:Mode of Payment", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "currency_section", + "fieldtype": "Section Break", + "label": "Currency and Price List", + "options": "icon-tag", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "currency", + "fieldtype": "Link", + "label": "Currency", + "oldfieldname": "currency", + "oldfieldtype": "Select", + "options": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1 + }, + { + "description": "Rate at which Customer Currency is converted to customer's base currency", + "fieldname": "conversion_rate", + "fieldtype": "Float", + "label": "Exchange Rate", + "oldfieldname": "conversion_rate", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "column_break2", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "selling_price_list", + "fieldtype": "Link", + "label": "Price List", + "oldfieldname": "price_list_name", + "oldfieldtype": "Select", + "options": "Price List", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "price_list_currency", + "fieldtype": "Link", + "label": "Price List Currency", + "options": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 1 + }, + { + "description": "Rate at which Price list currency is converted to customer's base currency", + "fieldname": "plc_conversion_rate", + "fieldtype": "Float", + "label": "Price List Exchange Rate", + "no_copy": 0, + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "items", + "fieldtype": "Section Break", + "label": "Items", + "oldfieldtype": "Section Break", + "options": "icon-shopping-cart", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "update_stock", + "fieldtype": "Check", + "label": "Update Stock", + "oldfieldname": "update_stock", + "oldfieldtype": "Check", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "allow_on_submit": 1, + "fieldname": "entries", + "fieldtype": "Table", + "label": "Sales Invoice Items", + "oldfieldname": "entries", + "oldfieldtype": "Table", + "options": "Sales Invoice Item", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "packing_list", + "fieldtype": "Section Break", + "label": "Packing List", + "options": "icon-suitcase", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "packing_details", + "fieldtype": "Table", + "label": "Packing Details", + "options": "Packed Item", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "sales_bom_help", + "fieldtype": "HTML", + "label": "Sales BOM Help", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "section_break_30", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "net_total_export", + "fieldtype": "Currency", + "label": "Net Total", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 1 + }, + { + "fieldname": "column_break_32", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "net_total", + "fieldtype": "Currency", + "label": "Net Total (Company Currency)", + "oldfieldname": "net_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 1 + }, + { + "fieldname": "taxes", + "fieldtype": "Section Break", + "label": "Taxes and Charges", + "oldfieldtype": "Section Break", + "options": "icon-money", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "taxes_and_charges", + "fieldtype": "Link", + "label": "Taxes and Charges", + "oldfieldname": "charge", + "oldfieldtype": "Link", + "options": "Sales Taxes and Charges Master", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "column_break_38", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "shipping_rule", + "fieldtype": "Link", + "label": "Shipping Rule", + "oldfieldtype": "Button", + "options": "Shipping Rule", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "section_break_40", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "allow_on_submit": 1, + "fieldname": "other_charges", + "fieldtype": "Table", + "label": "Sales Taxes and Charges", + "oldfieldname": "other_charges", + "oldfieldtype": "Table", + "options": "Sales Taxes and Charges", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "other_charges_calculation", + "fieldtype": "HTML", + "label": "Taxes and Charges Calculation", + "oldfieldtype": "HTML", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "section_break_43", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "other_charges_total_export", + "fieldtype": "Currency", + "label": "Total Taxes and Charges", + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "column_break_45", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "other_charges_total", + "fieldtype": "Currency", + "label": "Total Taxes and Charges (Company Currency)", + "oldfieldname": "other_charges_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "discount_amount", + "fieldtype": "Currency", + "label": "Discount Amount", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 0 + }, + { + "fieldname": "totals", + "fieldtype": "Section Break", + "label": "Totals", + "oldfieldtype": "Section Break", + "options": "icon-money", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "grand_total_export", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Grand Total", + "oldfieldname": "grand_total_export", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 1, + "reqd": 1 + }, + { + "fieldname": "rounded_total_export", + "fieldtype": "Currency", + "label": "Rounded Total", + "oldfieldname": "rounded_total_export", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 1 + }, + { + "fieldname": "in_words_export", + "fieldtype": "Data", + "label": "In Words", + "oldfieldname": "in_words_export", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 0, + "read_only": 1 + }, + { + "fieldname": "gross_profit", + "fieldtype": "Currency", + "label": "Gross Profit", + "oldfieldname": "gross_profit", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "gross_profit_percent", + "fieldtype": "Float", + "label": "Gross Profit (%)", + "oldfieldname": "gross_profit_percent", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "column_break5", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "grand_total", + "fieldtype": "Currency", + "in_filter": 1, + "label": "Grand Total (Company Currency)", + "oldfieldname": "grand_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "rounded_total", + "fieldtype": "Currency", + "label": "Rounded Total (Company Currency)", + "oldfieldname": "rounded_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "description": "In Words will be visible once you save the Sales Invoice.", + "fieldname": "in_words", + "fieldtype": "Data", + "label": "In Words (Company Currency)", + "oldfieldname": "in_words", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "total_advance", + "fieldtype": "Currency", + "label": "Total Advance", + "oldfieldname": "total_advance", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "outstanding_amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Outstanding Amount", + "no_copy": 1, + "oldfieldname": "outstanding_amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "advances", + "fieldtype": "Section Break", + "label": "Advances", + "oldfieldtype": "Section Break", + "options": "icon-money", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "get_advances_received", + "fieldtype": "Button", + "label": "Get Advances Received", + "oldfieldtype": "Button", + "options": "get_advances", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "advance_adjustment_details", + "fieldtype": "Table", + "label": "Sales Invoice Advance", + "oldfieldname": "advance_adjustment_details", + "oldfieldtype": "Table", + "options": "Sales Invoice Advance", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "depends_on": "is_pos", + "fieldname": "payments_section", + "fieldtype": "Section Break", + "label": "Payments", + "options": "icon-money", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "is_pos", + "fieldname": "column_break3", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "depends_on": "is_pos", + "fieldname": "paid_amount", + "fieldtype": "Currency", + "label": "Paid Amount", + "oldfieldname": "paid_amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "depends_on": "is_pos", + "fieldname": "cash_bank_account", + "fieldtype": "Link", + "label": "Cash/Bank Account", + "oldfieldname": "cash_bank_account", + "oldfieldtype": "Link", + "options": "Account", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "depends_on": "is_pos", + "fieldname": "column_break4", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "depends_on": "is_pos", + "fieldname": "write_off_outstanding_amount_automatically", + "fieldtype": "Check", + "label": "Write Off Outstanding Amount", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "depends_on": "is_pos", + "fieldname": "write_off_amount", + "fieldtype": "Currency", + "label": "Write Off Amount", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "depends_on": "is_pos", + "fieldname": "write_off_account", + "fieldtype": "Link", + "label": "Write Off Account", + "options": "Account", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "depends_on": "is_pos", + "fieldname": "write_off_cost_center", + "fieldtype": "Link", + "label": "Write Off Cost Center", + "options": "Cost Center", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "terms_section_break", + "fieldtype": "Section Break", + "label": "Terms and Conditions", + "oldfieldtype": "Section Break", + "options": "icon-legal", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "tc_name", + "fieldtype": "Link", + "label": "Terms", + "oldfieldname": "tc_name", + "oldfieldtype": "Link", + "options": "Terms and Conditions", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "terms", + "fieldtype": "Text Editor", + "label": "Terms and Conditions Details", + "oldfieldname": "terms", + "oldfieldtype": "Text Editor", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "customer", + "fieldname": "contact_section", + "fieldtype": "Section Break", + "hidden": 0, + "label": "Contact Info", + "options": "icon-bullhorn", + "permlevel": 0, + "read_only": 0 + }, + { + "description": "Add / Edit", + "fieldname": "territory", + "fieldtype": "Link", + "in_filter": 1, + "label": "Territory", + "options": "Territory", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1, + "search_index": 0 + }, + { + "description": "Add / Edit", + "fieldname": "customer_group", + "fieldtype": "Link", + "in_filter": 1, + "label": "Customer Group", + "options": "Customer Group", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "search_index": 0 + }, + { + "fieldname": "col_break23", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "customer_address", + "fieldtype": "Link", + "label": "Customer Address", + "options": "Address", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "contact_person", + "fieldtype": "Link", + "label": "Contact Person", + "options": "Contact", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "more_info", + "fieldtype": "Section Break", + "label": "More Info", + "oldfieldtype": "Section Break", + "options": "icon-file-text", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "description": "Customer (Receivable) Account", + "fieldname": "debit_to", + "fieldtype": "Link", + "in_filter": 1, + "label": "Debit To", + "oldfieldname": "debit_to", + "oldfieldtype": "Link", + "options": "Account", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "project_name", + "fieldtype": "Link", + "in_filter": 1, + "label": "Project Name", + "oldfieldname": "project_name", + "oldfieldtype": "Link", + "options": "Project", + "permlevel": 0, + "read_only": 0, + "search_index": 1 + }, + { + "depends_on": "eval:doc.source == 'Campaign'", + "fieldname": "campaign", + "fieldtype": "Link", + "label": "Campaign", + "oldfieldname": "campaign", + "oldfieldtype": "Link", + "options": "Campaign", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "source", + "fieldtype": "Select", + "label": "Source", + "oldfieldname": "source", + "oldfieldtype": "Select", + "options": "\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "default": "No", + "description": "Considered as an Opening Balance", + "fieldname": "is_opening", + "fieldtype": "Select", + "in_filter": 1, + "label": "Is Opening Entry", + "oldfieldname": "is_opening", + "oldfieldtype": "Select", + "options": "No\nYes", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "search_index": 0 + }, + { + "fieldname": "c_form_applicable", + "fieldtype": "Select", + "label": "C-Form Applicable", + "no_copy": 1, + "options": "No\nYes", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 0 + }, + { + "fieldname": "c_form_no", + "fieldtype": "Link", + "label": "C-Form No", + "no_copy": 1, + "options": "C-Form", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "column_break8", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "allow_on_submit": 1, + "fieldname": "letter_head", + "fieldtype": "Select", + "label": "Letter Head", + "oldfieldname": "letter_head", + "oldfieldtype": "Select", + "options": "link:Letter Head", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "allow_on_submit": 1, + "fieldname": "select_print_heading", + "fieldtype": "Link", + "label": "Print Heading", + "no_copy": 1, + "oldfieldname": "select_print_heading", + "oldfieldtype": "Link", + "options": "Print Heading", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 1 + }, + { + "fieldname": "posting_time", + "fieldtype": "Time", + "label": "Posting Time", + "no_copy": 1, + "oldfieldname": "posting_time", + "oldfieldtype": "Time", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "description": "Actual Invoice Date", + "fieldname": "aging_date", + "fieldtype": "Date", + "label": "Aging Date", + "oldfieldname": "aging_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Select", + "in_filter": 1, + "label": "Fiscal Year", + "no_copy": 0, + "oldfieldname": "fiscal_year", + "oldfieldtype": "Select", + "options": "link:Fiscal Year", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "remarks", + "fieldtype": "Small Text", + "label": "Remarks", + "no_copy": 1, + "oldfieldname": "remarks", + "oldfieldtype": "Text", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 0 + }, + { + "fieldname": "sales_team_section_break", + "fieldtype": "Section Break", + "label": "Sales Team", + "oldfieldtype": "Section Break", + "options": "icon-group", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "column_break9", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "sales_partner", + "fieldtype": "Link", + "in_filter": 1, + "label": "Sales Partner", + "oldfieldname": "sales_partner", + "oldfieldtype": "Link", + "options": "Sales Partner", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "column_break10", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "commission_rate", + "fieldtype": "Float", + "label": "Commission Rate (%)", + "oldfieldname": "commission_rate", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "total_commission", + "fieldtype": "Currency", + "label": "Total Commission", + "oldfieldname": "total_commission", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "section_break2", + "fieldtype": "Section Break", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "sales_team", + "fieldtype": "Table", + "label": "Sales Team1", + "oldfieldname": "sales_team", + "oldfieldtype": "Table", + "options": "Sales Team", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "depends_on": "eval:doc.docstatus<2", + "fieldname": "recurring_invoice", + "fieldtype": "Section Break", + "label": "Recurring Invoice", + "options": "icon-time", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "column_break11", + "fieldtype": "Column Break", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "width": "50%" + }, + { + "allow_on_submit": 1, + "depends_on": "eval:doc.docstatus<2", + "description": "Check if recurring invoice, uncheck to stop recurring or put proper End Date", + "fieldname": "convert_into_recurring_invoice", + "fieldtype": "Check", + "label": "Convert into Recurring Invoice", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "allow_on_submit": 1, + "depends_on": "eval:doc.convert_into_recurring_invoice==1", + "description": "Select the period when the invoice will be generated automatically", + "fieldname": "recurring_type", + "fieldtype": "Select", + "label": "Recurring Type", + "no_copy": 1, + "options": "\nMonthly\nQuarterly\nHalf-yearly\nYearly", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "allow_on_submit": 1, + "depends_on": "eval:doc.convert_into_recurring_invoice==1", + "description": "The day of the month on which auto invoice will be generated e.g. 05, 28 etc ", + "fieldname": "repeat_on_day_of_month", + "fieldtype": "Int", + "label": "Repeat on Day of Month", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "allow_on_submit": 1, + "depends_on": "eval:doc.convert_into_recurring_invoice==1", + "description": "Start date of current invoice's period", + "fieldname": "invoice_period_from_date", + "fieldtype": "Date", + "label": "Invoice Period From Date", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "allow_on_submit": 1, + "depends_on": "eval:doc.convert_into_recurring_invoice==1", + "description": "End date of current invoice's period", + "fieldname": "invoice_period_to_date", + "fieldtype": "Date", + "label": "Invoice Period To Date", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "column_break12", + "fieldtype": "Column Break", + "no_copy": 0, + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "width": "50%" + }, + { + "allow_on_submit": 1, + "depends_on": "eval:doc.convert_into_recurring_invoice==1", + "description": "Enter email id separated by commas, invoice will be mailed automatically on particular date", + "fieldname": "notification_email_address", + "fieldtype": "Small Text", + "label": "Notification Email Address", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "depends_on": "eval:doc.convert_into_recurring_invoice==1", + "description": "The unique id for tracking all recurring invoices.\u00a0It is generated on submit.", + "fieldname": "recurring_id", + "fieldtype": "Data", + "label": "Recurring Id", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "depends_on": "eval:doc.convert_into_recurring_invoice==1", + "description": "The date on which next invoice will be generated. It is generated on submit.\n", + "fieldname": "next_date", + "fieldtype": "Date", + "label": "Next Date", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "allow_on_submit": 1, + "depends_on": "eval:doc.convert_into_recurring_invoice==1", + "description": "The date on which recurring invoice will be stop", + "fieldname": "end_date", + "fieldtype": "Date", + "label": "End Date", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "against_income_account", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Against Income Account", + "no_copy": 1, + "oldfieldname": "against_income_account", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 1 + } + ], + "icon": "icon-file-text", + "idx": 1, + "is_submittable": 1, + "modified": "2014-01-28 18:43:10", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Sales Invoice", + "owner": "Administrator", + "permissions": [ + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts Manager", + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "cancel": 0, + "create": 1, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts User", + "submit": 1, + "write": 1 + }, + { + "cancel": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Customer" + } + ], + "read_only_onload": 1, + "search_fields": "posting_date, due_date, debit_to, fiscal_year, grand_total, outstanding_amount" +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.txt b/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.txt index f0f361d098..13a5642a30 100644 --- a/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.txt +++ b/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.txt @@ -1,101 +1,88 @@ -[ - { - "creation": "2013-02-22 01:27:41", - "docstatus": 0, - "modified": "2014-02-03 12:38:53", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "istable": 1, - "module": "Accounts", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Sales Invoice Advance", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Sales Invoice Advance" - }, - { - "doctype": "DocField", - "fieldname": "journal_voucher", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Journal Voucher", - "no_copy": 1, - "oldfieldname": "journal_voucher", - "oldfieldtype": "Link", - "options": "Journal Voucher", - "print_width": "250px", - "read_only": 1, - "width": "250px" - }, - { - "doctype": "DocField", - "fieldname": "remarks", - "fieldtype": "Small Text", - "in_list_view": 1, - "label": "Remarks", - "no_copy": 1, - "oldfieldname": "remarks", - "oldfieldtype": "Small Text", - "print_width": "150px", - "read_only": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "jv_detail_no", - "fieldtype": "Data", - "hidden": 1, - "in_list_view": 0, - "label": "Journal Voucher Detail No", - "no_copy": 1, - "oldfieldname": "jv_detail_no", - "oldfieldtype": "Data", - "print_hide": 1, - "print_width": "120px", - "read_only": 1, - "width": "120px" - }, - { - "doctype": "DocField", - "fieldname": "col_break1", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "advance_amount", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Advance amount", - "no_copy": 1, - "oldfieldname": "advance_amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_width": "120px", - "read_only": 1, - "width": "120px" - }, - { - "doctype": "DocField", - "fieldname": "allocated_amount", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Allocated amount", - "no_copy": 1, - "oldfieldname": "allocated_amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_width": "120px", - "width": "120px" - } -] \ No newline at end of file +{ + "creation": "2013-02-22 01:27:41", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "journal_voucher", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Journal Voucher", + "no_copy": 1, + "oldfieldname": "journal_voucher", + "oldfieldtype": "Link", + "options": "Journal Voucher", + "permlevel": 0, + "print_width": "250px", + "read_only": 1, + "width": "250px" + }, + { + "fieldname": "remarks", + "fieldtype": "Small Text", + "in_list_view": 1, + "label": "Remarks", + "no_copy": 1, + "oldfieldname": "remarks", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_width": "150px", + "read_only": 1, + "width": "150px" + }, + { + "fieldname": "jv_detail_no", + "fieldtype": "Data", + "hidden": 1, + "in_list_view": 0, + "label": "Journal Voucher Detail No", + "no_copy": 1, + "oldfieldname": "jv_detail_no", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "print_width": "120px", + "read_only": 1, + "width": "120px" + }, + { + "fieldname": "col_break1", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "advance_amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Advance amount", + "no_copy": 1, + "oldfieldname": "advance_amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_width": "120px", + "read_only": 1, + "width": "120px" + }, + { + "fieldname": "allocated_amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Allocated amount", + "no_copy": 1, + "oldfieldname": "allocated_amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_width": "120px", + "width": "120px" + } + ], + "idx": 1, + "istable": 1, + "modified": "2014-02-03 12:38:53", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Sales Invoice Advance", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.txt b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.txt index 224f7b7c69..5c59ebcd64 100644 --- a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.txt +++ b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.txt @@ -1,477 +1,464 @@ -[ - { - "creation": "2013-06-04 11:02:19", - "docstatus": 0, - "modified": "2014-02-28 11:04:19", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "INVD.######", - "doctype": "DocType", - "istable": 1, - "module": "Accounts", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Sales Invoice Item", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Sales Invoice Item" - }, - { - "doctype": "DocField", - "fieldname": "barcode", - "fieldtype": "Data", - "in_list_view": 0, - "label": "Barcode", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "item_code", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "Item", - "oldfieldname": "item_code", - "oldfieldtype": "Link", - "options": "Item", - "print_hide": 0, - "read_only": 0, - "reqd": 0, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "item_name", - "fieldtype": "Data", - "in_filter": 0, - "in_list_view": 0, - "label": "Item Name", - "oldfieldname": "item_name", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 0, - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "col_break1", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "customer_item_code", - "fieldtype": "Data", - "hidden": 1, - "in_list_view": 0, - "label": "Customer's Item Code", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Text", - "in_list_view": 1, - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Text", - "print_width": "200px", - "read_only": 0, - "reqd": 1, - "width": "200px" - }, - { - "doctype": "DocField", - "fieldname": "quantity_and_rate", - "fieldtype": "Section Break", - "in_list_view": 0, - "label": "Quantity and Rate" - }, - { - "doctype": "DocField", - "fieldname": "qty", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Quantity", - "oldfieldname": "qty", - "oldfieldtype": "Currency", - "read_only": 0, - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "price_list_rate", - "fieldtype": "Currency", - "in_list_view": 0, - "label": "Price List Rate", - "oldfieldname": "ref_rate", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 1, - "read_only": 1, - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "discount_percentage", - "fieldtype": "Float", - "in_list_view": 0, - "label": "Discount (%)", - "oldfieldname": "adj_rate", - "oldfieldtype": "Float", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "col_break2", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "stock_uom", - "fieldtype": "Link", - "in_list_view": 0, - "label": "UOM", - "options": "UOM", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "base_price_list_rate", - "fieldtype": "Currency", - "in_list_view": 0, - "label": "Price List Rate (Company Currency)", - "oldfieldname": "base_ref_rate", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "section_break1", - "fieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "rate", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Rate", - "oldfieldname": "export_rate", - "oldfieldtype": "Currency", - "options": "currency", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "amount", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Amount", - "oldfieldname": "export_amount", - "oldfieldtype": "Currency", - "options": "currency", - "read_only": 1, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "col_break3", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "base_rate", - "fieldtype": "Currency", - "in_filter": 0, - "in_list_view": 0, - "label": "Rate (Company Currency)", - "oldfieldname": "basic_rate", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1, - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "base_amount", - "fieldtype": "Currency", - "in_list_view": 0, - "label": "Amount (Company Currency)", - "oldfieldname": "amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "pricing_rule_for_price", - "fieldtype": "Link", - "label": "Pricing Rule For Price", - "options": "Pricing Rule", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "pricing_rule_for_discount", - "fieldtype": "Link", - "label": "Pricing Rule For Discount", - "options": "Pricing Rule", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "accounting", - "fieldtype": "Section Break", - "in_list_view": 0, - "label": "Accounting" - }, - { - "doctype": "DocField", - "fieldname": "income_account", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 0, - "label": "Income Account", - "oldfieldname": "income_account", - "oldfieldtype": "Link", - "options": "Account", - "print_hide": 1, - "print_width": "120px", - "read_only": 0, - "reqd": 1, - "width": "120px" - }, - { - "doctype": "DocField", - "fieldname": "expense_account", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 1, - "in_list_view": 0, - "label": "Expense Account", - "options": "Account", - "print_hide": 1, - "read_only": 0, - "width": "120px" - }, - { - "doctype": "DocField", - "fieldname": "col_break4", - "fieldtype": "Column Break" - }, - { - "default": ":Company", - "doctype": "DocField", - "fieldname": "cost_center", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 0, - "label": "Cost Center", - "oldfieldname": "cost_center", - "oldfieldtype": "Link", - "options": "Cost Center", - "print_hide": 1, - "print_width": "120px", - "read_only": 0, - "reqd": 0, - "width": "120px" - }, - { - "doctype": "DocField", - "fieldname": "warehouse_and_reference", - "fieldtype": "Section Break", - "in_list_view": 0, - "label": "Warehouse and Reference" - }, - { - "doctype": "DocField", - "fieldname": "warehouse", - "fieldtype": "Link", - "hidden": 0, - "in_list_view": 0, - "label": "Warehouse", - "oldfieldname": "warehouse", - "oldfieldtype": "Link", - "options": "Warehouse", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "serial_no", - "fieldtype": "Small Text", - "in_filter": 1, - "in_list_view": 1, - "label": "Serial No", - "oldfieldname": "serial_no", - "oldfieldtype": "Small Text", - "print_hide": 0, - "read_only": 0, - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "batch_no", - "fieldtype": "Link", - "label": "Batch No", - "options": "Batch", - "print_hide": 1, - "read_only": 0 - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "item_group", - "fieldtype": "Link", - "hidden": 1, - "in_filter": 1, - "label": "Item Group", - "oldfieldname": "item_group", - "oldfieldtype": "Link", - "options": "Item Group", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "brand", - "fieldtype": "Data", - "hidden": 1, - "in_filter": 1, - "label": "Brand Name", - "oldfieldname": "brand", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "item_tax_rate", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Item Tax Rate", - "oldfieldname": "item_tax_rate", - "oldfieldtype": "Small Text", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "col_break5", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "actual_qty", - "fieldtype": "Float", - "label": "Available Qty at Warehouse", - "oldfieldname": "actual_qty", - "oldfieldtype": "Currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "time_log_batch", - "fieldtype": "Link", - "label": "Time Log Batch", - "options": "Time Log Batch", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "sales_order", - "fieldtype": "Link", - "in_filter": 1, - "label": "Sales Order", - "no_copy": 1, - "oldfieldname": "sales_order", - "oldfieldtype": "Link", - "options": "Sales Order", - "print_hide": 1, - "read_only": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "so_detail", - "fieldtype": "Data", - "hidden": 1, - "in_filter": 1, - "label": "Sales Order Item", - "no_copy": 1, - "oldfieldname": "so_detail", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "delivery_note", - "fieldtype": "Link", - "in_filter": 1, - "label": "Delivery Note", - "no_copy": 1, - "oldfieldname": "delivery_note", - "oldfieldtype": "Link", - "options": "Delivery Note", - "print_hide": 1, - "read_only": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "dn_detail", - "fieldtype": "Data", - "hidden": 1, - "in_filter": 1, - "label": "Delivery Note Item", - "no_copy": 1, - "oldfieldname": "dn_detail", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "delivered_qty", - "fieldtype": "Float", - "label": "Delivered Qty", - "oldfieldname": "delivered_qty", - "oldfieldtype": "Currency", - "print_hide": 1, - "read_only": 1 - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "page_break", - "fieldtype": "Check", - "label": "Page Break", - "no_copy": 1, - "print_hide": 1, - "read_only": 0, - "report_hide": 1 - } -] \ No newline at end of file +{ + "autoname": "INVD.######", + "creation": "2013-06-04 11:02:19", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "barcode", + "fieldtype": "Data", + "in_list_view": 0, + "label": "Barcode", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "item_code", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Item", + "oldfieldname": "item_code", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0, + "print_hide": 0, + "read_only": 0, + "reqd": 0, + "search_index": 1 + }, + { + "fieldname": "item_name", + "fieldtype": "Data", + "in_filter": 0, + "in_list_view": 0, + "label": "Item Name", + "oldfieldname": "item_name", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "col_break1", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "customer_item_code", + "fieldtype": "Data", + "hidden": 1, + "in_list_view": 0, + "label": "Customer's Item Code", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "description", + "fieldtype": "Text", + "in_list_view": 1, + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Text", + "permlevel": 0, + "print_width": "200px", + "read_only": 0, + "reqd": 1, + "width": "200px" + }, + { + "fieldname": "quantity_and_rate", + "fieldtype": "Section Break", + "in_list_view": 0, + "label": "Quantity and Rate", + "permlevel": 0 + }, + { + "fieldname": "qty", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Quantity", + "oldfieldname": "qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 0, + "reqd": 0 + }, + { + "fieldname": "price_list_rate", + "fieldtype": "Currency", + "in_list_view": 0, + "label": "Price List Rate", + "oldfieldname": "ref_rate", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 0 + }, + { + "fieldname": "discount_percentage", + "fieldtype": "Float", + "in_list_view": 0, + "label": "Discount (%)", + "oldfieldname": "adj_rate", + "oldfieldtype": "Float", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "col_break2", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "stock_uom", + "fieldtype": "Link", + "in_list_view": 0, + "label": "UOM", + "options": "UOM", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "base_price_list_rate", + "fieldtype": "Currency", + "in_list_view": 0, + "label": "Price List Rate (Company Currency)", + "oldfieldname": "base_ref_rate", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "section_break1", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "rate", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Rate", + "oldfieldname": "export_rate", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Amount", + "oldfieldname": "export_amount", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "read_only": 1, + "reqd": 1 + }, + { + "fieldname": "col_break3", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "base_rate", + "fieldtype": "Currency", + "in_filter": 0, + "in_list_view": 0, + "label": "Rate (Company Currency)", + "oldfieldname": "basic_rate", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "base_amount", + "fieldtype": "Currency", + "in_list_view": 0, + "label": "Amount (Company Currency)", + "oldfieldname": "amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 1 + }, + { + "fieldname": "pricing_rule_for_price", + "fieldtype": "Link", + "label": "Pricing Rule For Price", + "options": "Pricing Rule", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "pricing_rule_for_discount", + "fieldtype": "Link", + "label": "Pricing Rule For Discount", + "options": "Pricing Rule", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "accounting", + "fieldtype": "Section Break", + "in_list_view": 0, + "label": "Accounting", + "permlevel": 0 + }, + { + "fieldname": "income_account", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 0, + "label": "Income Account", + "oldfieldname": "income_account", + "oldfieldtype": "Link", + "options": "Account", + "permlevel": 0, + "print_hide": 1, + "print_width": "120px", + "read_only": 0, + "reqd": 1, + "width": "120px" + }, + { + "fieldname": "expense_account", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 1, + "in_list_view": 0, + "label": "Expense Account", + "options": "Account", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "width": "120px" + }, + { + "fieldname": "col_break4", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "default": ":Company", + "fieldname": "cost_center", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 0, + "label": "Cost Center", + "oldfieldname": "cost_center", + "oldfieldtype": "Link", + "options": "Cost Center", + "permlevel": 0, + "print_hide": 1, + "print_width": "120px", + "read_only": 0, + "reqd": 0, + "width": "120px" + }, + { + "fieldname": "warehouse_and_reference", + "fieldtype": "Section Break", + "in_list_view": 0, + "label": "Warehouse and Reference", + "permlevel": 0 + }, + { + "fieldname": "warehouse", + "fieldtype": "Link", + "hidden": 0, + "in_list_view": 0, + "label": "Warehouse", + "oldfieldname": "warehouse", + "oldfieldtype": "Link", + "options": "Warehouse", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "serial_no", + "fieldtype": "Small Text", + "in_filter": 1, + "in_list_view": 1, + "label": "Serial No", + "oldfieldname": "serial_no", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_hide": 0, + "read_only": 0, + "reqd": 0 + }, + { + "fieldname": "batch_no", + "fieldtype": "Link", + "label": "Batch No", + "options": "Batch", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "description": "Add / Edit", + "fieldname": "item_group", + "fieldtype": "Link", + "hidden": 1, + "in_filter": 1, + "label": "Item Group", + "oldfieldname": "item_group", + "oldfieldtype": "Link", + "options": "Item Group", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "brand", + "fieldtype": "Data", + "hidden": 1, + "in_filter": 1, + "label": "Brand Name", + "oldfieldname": "brand", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "item_tax_rate", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Item Tax Rate", + "oldfieldname": "item_tax_rate", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "col_break5", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "actual_qty", + "fieldtype": "Float", + "label": "Available Qty at Warehouse", + "oldfieldname": "actual_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "time_log_batch", + "fieldtype": "Link", + "label": "Time Log Batch", + "options": "Time Log Batch", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "sales_order", + "fieldtype": "Link", + "in_filter": 1, + "label": "Sales Order", + "no_copy": 1, + "oldfieldname": "sales_order", + "oldfieldtype": "Link", + "options": "Sales Order", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "search_index": 1 + }, + { + "fieldname": "so_detail", + "fieldtype": "Data", + "hidden": 1, + "in_filter": 1, + "label": "Sales Order Item", + "no_copy": 1, + "oldfieldname": "so_detail", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "search_index": 1 + }, + { + "fieldname": "delivery_note", + "fieldtype": "Link", + "in_filter": 1, + "label": "Delivery Note", + "no_copy": 1, + "oldfieldname": "delivery_note", + "oldfieldtype": "Link", + "options": "Delivery Note", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "search_index": 1 + }, + { + "fieldname": "dn_detail", + "fieldtype": "Data", + "hidden": 1, + "in_filter": 1, + "label": "Delivery Note Item", + "no_copy": 1, + "oldfieldname": "dn_detail", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "search_index": 1 + }, + { + "fieldname": "delivered_qty", + "fieldtype": "Float", + "label": "Delivered Qty", + "oldfieldname": "delivered_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "allow_on_submit": 1, + "fieldname": "page_break", + "fieldtype": "Check", + "label": "Page Break", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 1 + } + ], + "idx": 1, + "istable": 1, + "modified": "2014-02-28 11:04:19", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Sales Invoice Item", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.txt b/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.txt index 8bb154cb7f..95241c65f1 100644 --- a/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.txt +++ b/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.txt @@ -1,166 +1,153 @@ -[ - { - "creation": "2013-04-24 11:39:32", - "docstatus": 0, - "modified": "2014-01-03 15:04:25", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "INVTD.######", - "doctype": "DocType", - "hide_heading": 1, - "istable": 1, - "module": "Accounts", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Sales Taxes and Charges", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Sales Taxes and Charges" - }, - { - "doctype": "DocField", - "fieldname": "charge_type", - "fieldtype": "Select", - "in_list_view": 1, - "label": "Type", - "oldfieldname": "charge_type", - "oldfieldtype": "Select", - "options": "\nActual\nOn Net Total\nOn Previous Row Amount\nOn Previous Row Total", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "row_id", - "fieldtype": "Data", - "hidden": 0, - "label": "Enter Row", - "oldfieldname": "row_id", - "oldfieldtype": "Data" - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Small Text", - "in_list_view": 1, - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Small Text", - "print_width": "300px", - "reqd": 1, - "width": "300px" - }, - { - "doctype": "DocField", - "fieldname": "col_break_1", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "account_head", - "fieldtype": "Link", - "in_list_view": 0, - "label": "Account Head", - "oldfieldname": "account_head", - "oldfieldtype": "Link", - "options": "Account", - "reqd": 1, - "search_index": 1 - }, - { - "default": ":Company", - "doctype": "DocField", - "fieldname": "cost_center", - "fieldtype": "Link", - "in_list_view": 0, - "label": "Cost Center", - "oldfieldname": "cost_center_other_charges", - "oldfieldtype": "Link", - "options": "Cost Center" - }, - { - "doctype": "DocField", - "fieldname": "rate", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Rate", - "oldfieldname": "rate", - "oldfieldtype": "Currency", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "tax_amount", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Amount", - "oldfieldname": "tax_amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "read_only": 1, - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "total", - "fieldtype": "Currency", - "label": "Total", - "oldfieldname": "total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "allow_on_submit": 0, - "description": "If checked, the tax amount will be considered as already included in the Print Rate / Print Amount", - "doctype": "DocField", - "fieldname": "included_in_print_rate", - "fieldtype": "Check", - "label": "Is this Tax included in Basic Rate?", - "no_copy": 0, - "print_hide": 1, - "print_width": "150px", - "report_hide": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "tax_amount_after_discount_amount", - "fieldtype": "Currency", - "hidden": 1, - "label": "Tax Amount After Discount Amount", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "item_wise_tax_detail", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Item Wise Tax Detail", - "oldfieldname": "item_wise_tax_detail", - "oldfieldtype": "Small Text", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "parenttype", - "fieldtype": "Data", - "hidden": 1, - "in_filter": 1, - "label": "Parenttype", - "oldfieldname": "parenttype", - "oldfieldtype": "Data", - "print_hide": 1, - "search_index": 1 - } -] \ No newline at end of file +{ + "autoname": "INVTD.######", + "creation": "2013-04-24 11:39:32", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "charge_type", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Type", + "oldfieldname": "charge_type", + "oldfieldtype": "Select", + "options": "\nActual\nOn Net Total\nOn Previous Row Amount\nOn Previous Row Total", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "row_id", + "fieldtype": "Data", + "hidden": 0, + "label": "Enter Row", + "oldfieldname": "row_id", + "oldfieldtype": "Data", + "permlevel": 0 + }, + { + "fieldname": "description", + "fieldtype": "Small Text", + "in_list_view": 1, + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_width": "300px", + "reqd": 1, + "width": "300px" + }, + { + "fieldname": "col_break_1", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "account_head", + "fieldtype": "Link", + "in_list_view": 0, + "label": "Account Head", + "oldfieldname": "account_head", + "oldfieldtype": "Link", + "options": "Account", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "default": ":Company", + "fieldname": "cost_center", + "fieldtype": "Link", + "in_list_view": 0, + "label": "Cost Center", + "oldfieldname": "cost_center_other_charges", + "oldfieldtype": "Link", + "options": "Cost Center", + "permlevel": 0 + }, + { + "fieldname": "rate", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Rate", + "oldfieldname": "rate", + "oldfieldtype": "Currency", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "tax_amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Amount", + "oldfieldname": "tax_amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1, + "reqd": 0 + }, + { + "fieldname": "total", + "fieldtype": "Currency", + "label": "Total", + "oldfieldname": "total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1 + }, + { + "allow_on_submit": 0, + "description": "If checked, the tax amount will be considered as already included in the Print Rate / Print Amount", + "fieldname": "included_in_print_rate", + "fieldtype": "Check", + "label": "Is this Tax included in Basic Rate?", + "no_copy": 0, + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "report_hide": 1, + "width": "150px" + }, + { + "fieldname": "tax_amount_after_discount_amount", + "fieldtype": "Currency", + "hidden": 1, + "label": "Tax Amount After Discount Amount", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "item_wise_tax_detail", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Item Wise Tax Detail", + "oldfieldname": "item_wise_tax_detail", + "oldfieldtype": "Small Text", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "parenttype", + "fieldtype": "Data", + "hidden": 1, + "in_filter": 1, + "label": "Parenttype", + "oldfieldname": "parenttype", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "search_index": 1 + } + ], + "hide_heading": 1, + "idx": 1, + "istable": 1, + "modified": "2014-01-03 15:04:25", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Sales Taxes and Charges", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.txt b/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.txt index db83cce268..a8cc0a255b 100644 --- a/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.txt +++ b/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.txt @@ -1,126 +1,121 @@ -[ - { - "creation": "2013-01-10 16:34:09", - "docstatus": 0, - "modified": "2014-01-28 12:28:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "allow_rename": 1, - "autoname": "field:title", - "description": "Standard tax template that can be applied to all Sales Transactions. This template can contain list of tax heads and also other expense / income heads like \"Shipping\", \"Insurance\", \"Handling\" etc.\n\n#### Note\n\nThe tax rate you define here will be the standard tax rate for all **Items**. If there are **Items** that have different rates, they must be added in the **Item Tax** table in the **Item** master.\n\n#### Description of Columns\n\n1. Calculation Type: \n - This can be on **Net Total** (that is the sum of basic amount).\n - **On Previous Row Total / Amount** (for cumulative taxes or charges). If you select this option, the tax will be applied as a percentage of the previous row (in the tax table) amount or total.\n - **Actual** (as mentioned).\n2. Account Head: The Account ledger under which this tax will be booked\n3. Cost Center: If the tax / charge is an income (like shipping) or expense it needs to be booked against a Cost Center.\n4. Description: Description of the tax (that will be printed in invoices / quotes).\n5. Rate: Tax rate.\n6. Amount: Tax amount.\n7. Total: Cumulative total to this point.\n8. Enter Row: If based on \"Previous Row Total\" you can select the row number which will be taken as a base for this calculation (default is the previous row).\n9. Is this Tax included in Basic Rate?: If you check this, it means that this tax will not be shown below the item table, but will be included in the Basic Rate in your main item table. This is useful where you want give a flat price (inclusive of all taxes) price to customers.", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-money", - "module": "Accounts", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Sales Taxes and Charges Master", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "amend": 0, - "cancel": 0, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Sales Taxes and Charges Master", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 0 - }, - { - "doctype": "DocType", - "name": "Sales Taxes and Charges Master" - }, - { - "doctype": "DocField", - "fieldname": "title", - "fieldtype": "Data", - "in_filter": 1, - "label": "Title", - "oldfieldname": "title", - "oldfieldtype": "Data", - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "is_default", - "fieldtype": "Check", - "label": "Default" - }, - { - "doctype": "DocField", - "fieldname": "column_break_3", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "in_filter": 1, - "label": "Company", - "oldfieldname": "company", - "oldfieldtype": "Link", - "options": "Company", - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "section_break_5", - "fieldtype": "Section Break" - }, - { - "description": "* Will be calculated in the transaction.", - "doctype": "DocField", - "fieldname": "other_charges", - "fieldtype": "Table", - "label": "Sales Taxes and Charges Master", - "oldfieldname": "other_charges", - "oldfieldtype": "Table", - "options": "Sales Taxes and Charges" - }, - { - "description": "Specify a list of Territories, for which, this Taxes Master is valid", - "doctype": "DocField", - "fieldname": "valid_for_territories", - "fieldtype": "Table", - "label": "Valid for Territories", - "options": "Applicable Territory", - "reqd": 1 - }, - { - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Sales User", - "write": 0 - }, - { - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Accounts Manager", - "write": 1 - }, - { - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Sales Master Manager", - "write": 1 - } -] \ No newline at end of file +{ + "allow_import": 1, + "allow_rename": 1, + "autoname": "field:title", + "creation": "2013-01-10 16:34:09", + "description": "Standard tax template that can be applied to all Sales Transactions. This template can contain list of tax heads and also other expense / income heads like \"Shipping\", \"Insurance\", \"Handling\" etc.\n\n#### Note\n\nThe tax rate you define here will be the standard tax rate for all **Items**. If there are **Items** that have different rates, they must be added in the **Item Tax** table in the **Item** master.\n\n#### Description of Columns\n\n1. Calculation Type: \n - This can be on **Net Total** (that is the sum of basic amount).\n - **On Previous Row Total / Amount** (for cumulative taxes or charges). If you select this option, the tax will be applied as a percentage of the previous row (in the tax table) amount or total.\n - **Actual** (as mentioned).\n2. Account Head: The Account ledger under which this tax will be booked\n3. Cost Center: If the tax / charge is an income (like shipping) or expense it needs to be booked against a Cost Center.\n4. Description: Description of the tax (that will be printed in invoices / quotes).\n5. Rate: Tax rate.\n6. Amount: Tax amount.\n7. Total: Cumulative total to this point.\n8. Enter Row: If based on \"Previous Row Total\" you can select the row number which will be taken as a base for this calculation (default is the previous row).\n9. Is this Tax included in Basic Rate?: If you check this, it means that this tax will not be shown below the item table, but will be included in the Basic Rate in your main item table. This is useful where you want give a flat price (inclusive of all taxes) price to customers.", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "title", + "fieldtype": "Data", + "in_filter": 1, + "label": "Title", + "oldfieldname": "title", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "is_default", + "fieldtype": "Check", + "label": "Default", + "permlevel": 0 + }, + { + "fieldname": "column_break_3", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "company", + "fieldtype": "Link", + "in_filter": 1, + "label": "Company", + "oldfieldname": "company", + "oldfieldtype": "Link", + "options": "Company", + "permlevel": 0, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "section_break_5", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "description": "* Will be calculated in the transaction.", + "fieldname": "other_charges", + "fieldtype": "Table", + "label": "Sales Taxes and Charges Master", + "oldfieldname": "other_charges", + "oldfieldtype": "Table", + "options": "Sales Taxes and Charges", + "permlevel": 0 + }, + { + "description": "Specify a list of Territories, for which, this Taxes Master is valid", + "fieldname": "valid_for_territories", + "fieldtype": "Table", + "label": "Valid for Territories", + "options": "Applicable Territory", + "permlevel": 0, + "reqd": 1 + } + ], + "icon": "icon-money", + "idx": 1, + "modified": "2014-01-28 12:28:27", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Sales Taxes and Charges Master", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales User", + "submit": 0, + "write": 0 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts Manager", + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales Master Manager", + "submit": 0, + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/shipping_rule/shipping_rule.txt b/erpnext/accounts/doctype/shipping_rule/shipping_rule.txt index c1e2e90bb7..a059c7b293 100644 --- a/erpnext/accounts/doctype/shipping_rule/shipping_rule.txt +++ b/erpnext/accounts/doctype/shipping_rule/shipping_rule.txt @@ -1,161 +1,154 @@ -[ - { - "creation": "2013-06-25 11:48:03", - "docstatus": 0, - "modified": "2014-01-20 17:49:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "Prompt", - "description": "Specify conditions to calculate shipping amount", - "doctype": "DocType", - "icon": "icon-truck", - "module": "Accounts", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Shipping Rule", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Shipping Rule", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1 - }, - { - "doctype": "DocType", - "name": "Shipping Rule" - }, - { - "description": "example: Next Day Shipping", - "doctype": "DocField", - "fieldname": "label", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Shipping Rule Label", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break_2", - "fieldtype": "Column Break" - }, - { - "default": "Net Total", - "doctype": "DocField", - "fieldname": "calculate_based_on", - "fieldtype": "Select", - "hidden": 1, - "in_list_view": 1, - "label": "Calculate Based On", - "options": "Net Total\nNet Weight", - "read_only": 1, - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "rule_conditions_section", - "fieldtype": "Section Break", - "label": "Shipping Rule Conditions" - }, - { - "doctype": "DocField", - "fieldname": "shipping_rule_conditions", - "fieldtype": "Table", - "label": "Shipping Rule Conditions", - "options": "Shipping Rule Condition", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "section_break_6", - "fieldtype": "Section Break" - }, - { - "description": "Specify a list of Territories, for which, this Shipping Rule is valid", - "doctype": "DocField", - "fieldname": "valid_for_territories", - "fieldtype": "Table", - "label": "Valid For Territories", - "options": "Applicable Territory", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break_8", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "in_list_view": 0, - "label": "Company", - "options": "Company", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "section_break_10", - "fieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "account", - "fieldtype": "Link", - "label": "Shipping Account", - "options": "Account", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break_12", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "cost_center", - "fieldtype": "Link", - "label": "Cost Center", - "options": "Cost Center", - "reqd": 1 - }, - { - "delete": 0, - "doctype": "DocPerm", - "role": "Accounts User" - }, - { - "delete": 0, - "doctype": "DocPerm", - "role": "Sales User" - }, - { - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Accounts Manager", - "write": 1 - }, - { - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Sales Master Manager", - "write": 1 - } -] \ No newline at end of file +{ + "autoname": "Prompt", + "creation": "2013-06-25 11:48:03", + "description": "Specify conditions to calculate shipping amount", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "description": "example: Next Day Shipping", + "fieldname": "label", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Shipping Rule Label", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "column_break_2", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "default": "Net Total", + "fieldname": "calculate_based_on", + "fieldtype": "Select", + "hidden": 1, + "in_list_view": 1, + "label": "Calculate Based On", + "options": "Net Total\nNet Weight", + "permlevel": 0, + "read_only": 1, + "reqd": 0 + }, + { + "fieldname": "rule_conditions_section", + "fieldtype": "Section Break", + "label": "Shipping Rule Conditions", + "permlevel": 0 + }, + { + "fieldname": "shipping_rule_conditions", + "fieldtype": "Table", + "label": "Shipping Rule Conditions", + "options": "Shipping Rule Condition", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "section_break_6", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "description": "Specify a list of Territories, for which, this Shipping Rule is valid", + "fieldname": "valid_for_territories", + "fieldtype": "Table", + "label": "Valid For Territories", + "options": "Applicable Territory", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "column_break_8", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "company", + "fieldtype": "Link", + "in_list_view": 0, + "label": "Company", + "options": "Company", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "section_break_10", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "account", + "fieldtype": "Link", + "label": "Shipping Account", + "options": "Account", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "column_break_12", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "cost_center", + "fieldtype": "Link", + "label": "Cost Center", + "options": "Cost Center", + "permlevel": 0, + "reqd": 1 + } + ], + "icon": "icon-truck", + "idx": 1, + "modified": "2014-01-20 17:49:27", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Shipping Rule", + "owner": "Administrator", + "permissions": [ + { + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts User" + }, + { + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales User" + }, + { + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts Manager", + "write": 1 + }, + { + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales Master Manager", + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.txt b/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.txt index 22af554466..6b3fd2bbff 100644 --- a/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.txt +++ b/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.txt @@ -1,51 +1,40 @@ -[ - { - "creation": "2013-06-25 11:54:50", - "docstatus": 0, - "modified": "2013-12-20 19:21:46", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "description": "A condition for a Shipping Rule", - "doctype": "DocType", - "istable": 1, - "module": "Accounts", - "name": "__common__" - }, - { - "doctype": "DocField", - "in_list_view": 1, - "name": "__common__", - "parent": "Shipping Rule Condition", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Shipping Rule Condition" - }, - { - "doctype": "DocField", - "fieldname": "from_value", - "fieldtype": "Float", - "label": "From Value", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "to_value", - "fieldtype": "Float", - "label": "To Value", - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "shipping_amount", - "fieldtype": "Currency", - "label": "Shipping Amount", - "options": "Company:company:default_currency", - "reqd": 1 - } -] \ No newline at end of file +{ + "creation": "2013-06-25 11:54:50", + "description": "A condition for a Shipping Rule", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "from_value", + "fieldtype": "Float", + "in_list_view": 1, + "label": "From Value", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "to_value", + "fieldtype": "Float", + "in_list_view": 1, + "label": "To Value", + "permlevel": 0, + "reqd": 0 + }, + { + "fieldname": "shipping_amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Shipping Amount", + "options": "Company:company:default_currency", + "permlevel": 0, + "reqd": 1 + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:21:46", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Shipping Rule Condition", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/accounts/page/accounts_browser/accounts_browser.txt b/erpnext/accounts/page/accounts_browser/accounts_browser.txt index e83759c44e..d4b5f3c204 100644 --- a/erpnext/accounts/page/accounts_browser/accounts_browser.txt +++ b/erpnext/accounts/page/accounts_browser/accounts_browser.txt @@ -1,36 +1,22 @@ -[ - { - "creation": "2012-06-14 15:07:28", - "docstatus": 0, - "modified": "2013-07-11 14:39:42", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Page", - "icon": "icon-sitemap", - "module": "Accounts", - "name": "__common__", - "page_name": "Accounts Browser", - "standard": "Yes" - }, - { - "doctype": "Page Role", - "name": "__common__", - "parent": "Accounts Browser", - "parentfield": "roles", - "parenttype": "Page" - }, - { - "doctype": "Page", - "name": "Accounts Browser" - }, - { - "doctype": "Page Role", - "role": "Accounts User" - }, - { - "doctype": "Page Role", - "role": "Accounts Manager" - } -] \ No newline at end of file +{ + "creation": "2012-06-14 15:07:28", + "docstatus": 0, + "doctype": "Page", + "icon": "icon-sitemap", + "idx": 1, + "modified": "2013-07-11 14:39:42", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Accounts Browser", + "owner": "Administrator", + "page_name": "Accounts Browser", + "roles": [ + { + "role": "Accounts User" + }, + { + "role": "Accounts Manager" + } + ], + "standard": "Yes" +} \ No newline at end of file diff --git a/erpnext/accounts/page/financial_analytics/financial_analytics.txt b/erpnext/accounts/page/financial_analytics/financial_analytics.txt index 94a9b8e1bf..75642f36bf 100644 --- a/erpnext/accounts/page/financial_analytics/financial_analytics.txt +++ b/erpnext/accounts/page/financial_analytics/financial_analytics.txt @@ -1,37 +1,23 @@ -[ - { - "creation": "2013-01-27 16:30:52", - "docstatus": 0, - "modified": "2013-07-11 14:42:16", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Page", - "icon": "icon-bar-chart", - "module": "Accounts", - "name": "__common__", - "page_name": "financial-analytics", - "standard": "Yes", - "title": "Financial Analytics" - }, - { - "doctype": "Page Role", - "name": "__common__", - "parent": "financial-analytics", - "parentfield": "roles", - "parenttype": "Page" - }, - { - "doctype": "Page", - "name": "financial-analytics" - }, - { - "doctype": "Page Role", - "role": "Analytics" - }, - { - "doctype": "Page Role", - "role": "Accounts Manager" - } -] \ No newline at end of file +{ + "creation": "2013-01-27 16:30:52", + "docstatus": 0, + "doctype": "Page", + "icon": "icon-bar-chart", + "idx": 1, + "modified": "2013-07-11 14:42:16", + "modified_by": "Administrator", + "module": "Accounts", + "name": "financial-analytics", + "owner": "Administrator", + "page_name": "financial-analytics", + "roles": [ + { + "role": "Analytics" + }, + { + "role": "Accounts Manager" + } + ], + "standard": "Yes", + "title": "Financial Analytics" +} \ No newline at end of file diff --git a/erpnext/accounts/page/trial_balance/trial_balance.txt b/erpnext/accounts/page/trial_balance/trial_balance.txt index f65146c8b2..ed1dfdd234 100644 --- a/erpnext/accounts/page/trial_balance/trial_balance.txt +++ b/erpnext/accounts/page/trial_balance/trial_balance.txt @@ -1,37 +1,23 @@ -[ - { - "creation": "2013-01-27 16:30:52", - "docstatus": 0, - "modified": "2013-07-11 14:44:49", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Page", - "icon": "icon-table", - "module": "Accounts", - "name": "__common__", - "page_name": "trial-balance", - "standard": "Yes", - "title": "Trial Balance" - }, - { - "doctype": "Page Role", - "name": "__common__", - "parent": "trial-balance", - "parentfield": "roles", - "parenttype": "Page" - }, - { - "doctype": "Page", - "name": "trial-balance" - }, - { - "doctype": "Page Role", - "role": "Analytics" - }, - { - "doctype": "Page Role", - "role": "Accounts Manager" - } -] \ No newline at end of file +{ + "creation": "2013-01-27 16:30:52", + "docstatus": 0, + "doctype": "Page", + "icon": "icon-table", + "idx": 1, + "modified": "2013-07-11 14:44:49", + "modified_by": "Administrator", + "module": "Accounts", + "name": "trial-balance", + "owner": "Administrator", + "page_name": "trial-balance", + "roles": [ + { + "role": "Analytics" + }, + { + "role": "Accounts Manager" + } + ], + "standard": "Yes", + "title": "Trial Balance" +} \ No newline at end of file diff --git a/erpnext/accounts/report/accounts_payable/accounts_payable.txt b/erpnext/accounts/report/accounts_payable/accounts_payable.txt index 9d20510314..41c63fc038 100644 --- a/erpnext/accounts/report/accounts_payable/accounts_payable.txt +++ b/erpnext/accounts/report/accounts_payable/accounts_payable.txt @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-04-22 16:16:03", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "add_total_row": 1, - "doctype": "Report", - "is_standard": "Yes", - "module": "Accounts", - "name": "__common__", - "ref_doctype": "Purchase Invoice", - "report_name": "Accounts Payable", - "report_type": "Report Builder" - }, - { - "doctype": "Report", - "name": "Accounts Payable" - } -] \ No newline at end of file +{ + "add_total_row": 1, + "creation": "2013-04-22 16:16:03", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Accounts Payable", + "owner": "Administrator", + "ref_doctype": "Purchase Invoice", + "report_name": "Accounts Payable", + "report_type": "Report Builder" +} \ No newline at end of file diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.txt b/erpnext/accounts/report/accounts_receivable/accounts_receivable.txt index 6da3088abe..3e6229d770 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.txt +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.txt @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-04-16 11:31:13", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "add_total_row": 1, - "doctype": "Report", - "is_standard": "Yes", - "module": "Accounts", - "name": "__common__", - "ref_doctype": "Sales Invoice", - "report_name": "Accounts Receivable", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Accounts Receivable" - } -] \ No newline at end of file +{ + "add_total_row": 1, + "creation": "2013-04-16 11:31:13", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Accounts Receivable", + "owner": "Administrator", + "ref_doctype": "Sales Invoice", + "report_name": "Accounts Receivable", + "report_type": "Script Report" +} \ No newline at end of file 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 3b462a0114..ab2bfe6b04 100644 --- a/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.txt +++ b/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-05-01 12:13:25", - "docstatus": 0, - "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", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Bank Clearance Summary" - } -] \ No newline at end of file +{ + "creation": "2013-05-01 12:13:25", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Bank Clearance Summary", + "owner": "Administrator", + "ref_doctype": "Journal Voucher", + "report_name": "Bank Clearance Summary", + "report_type": "Script Report" +} \ No newline at end of file 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 a2436a8eb0..8eda364822 100644 --- a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.txt +++ b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.txt @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-04-30 18:30:21", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "add_total_row": 0, - "doctype": "Report", - "is_standard": "Yes", - "module": "Accounts", - "name": "__common__", - "ref_doctype": "Journal Voucher", - "report_name": "Bank Reconciliation Statement", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Bank Reconciliation Statement" - } -] \ No newline at end of file +{ + "add_total_row": 0, + "creation": "2013-04-30 18:30:21", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Bank Reconciliation Statement", + "owner": "Administrator", + "ref_doctype": "Journal Voucher", + "report_name": "Bank Reconciliation Statement", + "report_type": "Script Report" +} \ No newline at end of file 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 be9ce13a22..6d738b6e93 100644 --- a/erpnext/accounts/report/budget_variance_report/budget_variance_report.txt +++ b/erpnext/accounts/report/budget_variance_report/budget_variance_report.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-06-18 12:56:36", - "docstatus": 0, - "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", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Budget Variance Report" - } -] \ No newline at end of file +{ + "creation": "2013-06-18 12:56:36", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Budget Variance Report", + "owner": "Administrator", + "ref_doctype": "Cost Center", + "report_name": "Budget Variance Report", + "report_type": "Script Report" +} \ No newline at end of file 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 c2a856bb94..c73a7f9b50 100644 --- a/erpnext/accounts/report/customer_account_head/customer_account_head.txt +++ b/erpnext/accounts/report/customer_account_head/customer_account_head.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-06-03 16:17:34", - "docstatus": 0, - "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", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Customer Account Head" - } -] \ No newline at end of file +{ + "creation": "2013-06-03 16:17:34", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Customer Account Head", + "owner": "Administrator", + "ref_doctype": "Account", + "report_name": "Customer Account Head", + "report_type": "Script Report" +} \ No newline at end of file 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 a525d2df58..3d75039794 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 @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-07-30 17:28:49", - "docstatus": 0, - "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", - "report_name": "Delivered Items To Be Billed", - "report_type": "Query Report" - }, - { - "doctype": "Report", - "name": "Delivered Items To Be Billed" - } -] \ No newline at end of file +{ + "creation": "2013-07-30 17:28:49", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Delivered Items To Be Billed", + "owner": "Administrator", + "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", + "report_name": "Delivered Items To Be Billed", + "report_type": "Query Report" +} \ No newline at end of file diff --git a/erpnext/accounts/report/general_ledger/general_ledger.txt b/erpnext/accounts/report/general_ledger/general_ledger.txt index cdfb033d0a..04f020d5d1 100644 --- a/erpnext/accounts/report/general_ledger/general_ledger.txt +++ b/erpnext/accounts/report/general_ledger/general_ledger.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-12-06 13:22:23", - "docstatus": 0, - "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", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "General Ledger" - } -] \ No newline at end of file +{ + "creation": "2013-12-06 13:22:23", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Accounts", + "name": "General Ledger", + "owner": "Administrator", + "ref_doctype": "GL Entry", + "report_name": "General Ledger", + "report_type": "Script Report" +} \ No newline at end of file diff --git a/erpnext/accounts/report/gross_profit/gross_profit.txt b/erpnext/accounts/report/gross_profit/gross_profit.txt index 56776600eb..c09d7b3b32 100644 --- a/erpnext/accounts/report/gross_profit/gross_profit.txt +++ b/erpnext/accounts/report/gross_profit/gross_profit.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-02-25 17:03:34", - "docstatus": 0, - "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", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Gross Profit" - } -] \ No newline at end of file +{ + "creation": "2013-02-25 17:03:34", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Gross Profit", + "owner": "Administrator", + "ref_doctype": "Sales Invoice", + "report_name": "Gross Profit", + "report_type": "Script Report" +} \ No newline at end of file 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 3dbd53614b..9c1c55ee8d 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 @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-06-05 15:37:30", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "add_total_row": 1, - "doctype": "Report", - "is_standard": "Yes", - "module": "Accounts", - "name": "__common__", - "ref_doctype": "Purchase Invoice", - "report_name": "Item-wise Purchase Register", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Item-wise Purchase Register" - } -] \ No newline at end of file +{ + "add_total_row": 1, + "creation": "2013-06-05 15:37:30", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Item-wise Purchase Register", + "owner": "Administrator", + "ref_doctype": "Purchase Invoice", + "report_name": "Item-wise Purchase Register", + "report_type": "Script Report" +} \ No newline at end of file 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 8d30644c39..3a4f296a33 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 @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-05-13 17:50:55", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "add_total_row": 1, - "doctype": "Report", - "is_standard": "Yes", - "module": "Accounts", - "name": "__common__", - "ref_doctype": "Sales Invoice", - "report_name": "Item-wise Sales Register", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Item-wise Sales Register" - } -] \ No newline at end of file +{ + "add_total_row": 1, + "creation": "2013-05-13 17:50:55", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Item-wise Sales Register", + "owner": "Administrator", + "ref_doctype": "Sales Invoice", + "report_name": "Item-wise Sales Register", + "report_type": "Script Report" +} \ No newline at end of file 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 09b6cff971..cc62acd55f 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 @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-02-21 14:26:44", - "docstatus": 0, - "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", - "report_name": "Ordered Items To Be Billed", - "report_type": "Query Report" - }, - { - "doctype": "Report", - "name": "Ordered Items To Be Billed" - } -] \ No newline at end of file +{ + "creation": "2013-02-21 14:26:44", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Ordered Items To Be Billed", + "owner": "Administrator", + "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", + "report_name": "Ordered Items To Be Billed", + "report_type": "Query Report" +} \ No newline at end of file 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 e48ea69ecc..9e3ce55419 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 @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-12-02 17:06:37", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "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", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Payment Period Based On Invoice Date" - } -] \ No newline at end of file +{ + "add_total_row": 1, + "creation": "2013-12-02 17:06:37", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Payment Period Based On Invoice Date", + "owner": "Administrator", + "ref_doctype": "Journal Voucher", + "report_name": "Payment Period Based On Invoice Date", + "report_type": "Script Report" +} \ No newline at end of file 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 20e5a53f51..36d081954d 100644 --- a/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.txt +++ b/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-06-13 18:46:55", - "docstatus": 0, - "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", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Purchase Invoice Trends" - } -] \ No newline at end of file +{ + "creation": "2013-06-13 18:46:55", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Purchase Invoice Trends", + "owner": "Administrator", + "ref_doctype": "Purchase Invoice", + "report_name": "Purchase Invoice Trends", + "report_type": "Script Report" +} \ No newline at end of file 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 88990cb6d1..ed03bc0c15 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 @@ -1,24 +1,17 @@ -[ - { - "creation": "2013-05-28 15:54:16", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "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", - "report_name": "Purchase Order Items To Be Billed", - "report_type": "Query Report" - }, - { - "doctype": "Report", - "name": "Purchase Order Items To Be Billed" - } -] \ No newline at end of file +{ + "add_total_row": 1, + "creation": "2013-05-28 15:54:16", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Purchase Order Items To Be Billed", + "owner": "Administrator", + "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", + "report_name": "Purchase Order Items To Be Billed", + "report_type": "Query Report" +} \ No newline at end of file diff --git a/erpnext/accounts/report/purchase_register/purchase_register.txt b/erpnext/accounts/report/purchase_register/purchase_register.txt index f04f8e6498..f6e603ab7d 100644 --- a/erpnext/accounts/report/purchase_register/purchase_register.txt +++ b/erpnext/accounts/report/purchase_register/purchase_register.txt @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-04-29 16:13:11", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "add_total_row": 1, - "doctype": "Report", - "is_standard": "Yes", - "module": "Accounts", - "name": "__common__", - "ref_doctype": "Purchase Invoice", - "report_name": "Purchase Register", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Purchase Register" - } -] \ No newline at end of file +{ + "add_total_row": 1, + "creation": "2013-04-29 16:13:11", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Purchase Register", + "owner": "Administrator", + "ref_doctype": "Purchase Invoice", + "report_name": "Purchase Register", + "report_type": "Script Report" +} \ No newline at end of file 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 3ecb2d8879..b39b88557a 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 @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-07-30 18:35:10", - "docstatus": 0, - "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", - "report_name": "Received Items To Be Billed", - "report_type": "Query Report" - }, - { - "doctype": "Report", - "name": "Received Items To Be Billed" - } -] \ No newline at end of file +{ + "creation": "2013-07-30 18:35:10", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Received Items To Be Billed", + "owner": "Administrator", + "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", + "report_name": "Received Items To Be Billed", + "report_type": "Query Report" +} \ No newline at end of file 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 4ffc3499bf..e0df867287 100644 --- a/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.txt +++ b/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-06-13 18:44:21", - "docstatus": 0, - "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", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Sales Invoice Trends" - } -] \ No newline at end of file +{ + "creation": "2013-06-13 18:44:21", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Sales Invoice Trends", + "owner": "Administrator", + "ref_doctype": "Sales Invoice", + "report_name": "Sales Invoice Trends", + "report_type": "Script Report" +} \ No newline at end of file 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 e79d415b96..d8785a36c3 100644 --- a/erpnext/accounts/report/sales_partners_commission/sales_partners_commission.txt +++ b/erpnext/accounts/report/sales_partners_commission/sales_partners_commission.txt @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-05-06 12:28:23", - "docstatus": 0, - "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", - "report_name": "Sales Partners Commission", - "report_type": "Query Report" - }, - { - "doctype": "Report", - "name": "Sales Partners Commission" - } -] \ No newline at end of file +{ + "creation": "2013-05-06 12:28:23", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Sales Partners Commission", + "owner": "Administrator", + "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", + "report_name": "Sales Partners Commission", + "report_type": "Query Report" +} \ No newline at end of file diff --git a/erpnext/accounts/report/sales_register/sales_register.txt b/erpnext/accounts/report/sales_register/sales_register.txt index 40ac3b5018..b87c24dc25 100644 --- a/erpnext/accounts/report/sales_register/sales_register.txt +++ b/erpnext/accounts/report/sales_register/sales_register.txt @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-04-23 18:15:29", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "add_total_row": 1, - "doctype": "Report", - "is_standard": "Yes", - "module": "Accounts", - "name": "__common__", - "ref_doctype": "Sales Invoice", - "report_name": "Sales Register", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Sales Register" - } -] \ No newline at end of file +{ + "add_total_row": 1, + "creation": "2013-04-23 18:15:29", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Sales Register", + "owner": "Administrator", + "ref_doctype": "Sales Invoice", + "report_name": "Sales Register", + "report_type": "Script Report" +} \ No newline at end of file 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 cf6e322016..5734bb72c1 100644 --- a/erpnext/accounts/report/supplier_account_head/supplier_account_head.txt +++ b/erpnext/accounts/report/supplier_account_head/supplier_account_head.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-06-04 12:56:17", - "docstatus": 0, - "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", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Supplier Account Head" - } -] \ No newline at end of file +{ + "creation": "2013-06-04 12:56:17", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Accounts", + "name": "Supplier Account Head", + "owner": "Administrator", + "ref_doctype": "Account", + "report_name": "Supplier Account Head", + "report_type": "Script Report" +} \ No newline at end of file diff --git a/erpnext/buying/Print Format/Purchase Order Classic/Purchase Order Classic.txt b/erpnext/buying/Print Format/Purchase Order Classic/Purchase Order Classic.txt index 88d750efc2..58d95f8231 100644 --- a/erpnext/buying/Print Format/Purchase Order Classic/Purchase Order Classic.txt +++ b/erpnext/buying/Print Format/Purchase Order Classic/Purchase Order Classic.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2012-04-17 11:29:12", - "docstatus": 0, - "modified": "2014-02-11 20:00:45", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doc_type": "Purchase Order", - "doctype": "Print Format", - "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n\n", - "module": "Buying", - "name": "__common__", - "print_format_type": "Client", - "standard": "Yes" - }, - { - "doctype": "Print Format", - "name": "Purchase Order Classic" - } -] \ No newline at end of file +{ + "creation": "2012-04-17 11:29:12", + "doc_type": "Purchase Order", + "docstatus": 0, + "doctype": "Print Format", + "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n\n", + "idx": 1, + "modified": "2014-02-11 20:00:45", + "modified_by": "Administrator", + "module": "Buying", + "name": "Purchase Order Classic", + "owner": "Administrator", + "print_format_type": "Client", + "standard": "Yes" +} \ No newline at end of file diff --git a/erpnext/buying/Print Format/Purchase Order Modern/Purchase Order Modern.txt b/erpnext/buying/Print Format/Purchase Order Modern/Purchase Order Modern.txt index 73f850a0b0..7d46e2547a 100644 --- a/erpnext/buying/Print Format/Purchase Order Modern/Purchase Order Modern.txt +++ b/erpnext/buying/Print Format/Purchase Order Modern/Purchase Order Modern.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2012-04-17 11:29:12", - "docstatus": 0, - "modified": "2014-02-11 20:12:05", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doc_type": "Purchase Order", - "doctype": "Print Format", - "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n\n", - "module": "Buying", - "name": "__common__", - "print_format_type": "Client", - "standard": "Yes" - }, - { - "doctype": "Print Format", - "name": "Purchase Order Modern" - } -] \ No newline at end of file +{ + "creation": "2012-04-17 11:29:12", + "doc_type": "Purchase Order", + "docstatus": 0, + "doctype": "Print Format", + "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n\n", + "idx": 1, + "modified": "2014-02-11 20:12:05", + "modified_by": "Administrator", + "module": "Buying", + "name": "Purchase Order Modern", + "owner": "Administrator", + "print_format_type": "Client", + "standard": "Yes" +} \ No newline at end of file diff --git a/erpnext/buying/Print Format/Purchase Order Spartan/Purchase Order Spartan.txt b/erpnext/buying/Print Format/Purchase Order Spartan/Purchase Order Spartan.txt index 1d6168ed0c..e5ce80ac65 100644 --- a/erpnext/buying/Print Format/Purchase Order Spartan/Purchase Order Spartan.txt +++ b/erpnext/buying/Print Format/Purchase Order Spartan/Purchase Order Spartan.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2012-04-17 11:29:12", - "docstatus": 0, - "modified": "2014-02-11 20:01:38", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doc_type": "Purchase Order", - "doctype": "Print Format", - "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n\n", - "module": "Buying", - "name": "__common__", - "print_format_type": "Client", - "standard": "Yes" - }, - { - "doctype": "Print Format", - "name": "Purchase Order Spartan" - } -] \ No newline at end of file +{ + "creation": "2012-04-17 11:29:12", + "doc_type": "Purchase Order", + "docstatus": 0, + "doctype": "Print Format", + "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n\n", + "idx": 1, + "modified": "2014-02-11 20:01:38", + "modified_by": "Administrator", + "module": "Buying", + "name": "Purchase Order Spartan", + "owner": "Administrator", + "print_format_type": "Client", + "standard": "Yes" +} \ No newline at end of file diff --git a/erpnext/buying/doctype/buying_settings/buying_settings.txt b/erpnext/buying/doctype/buying_settings/buying_settings.txt index fbbe367a68..53f40922ec 100644 --- a/erpnext/buying/doctype/buying_settings/buying_settings.txt +++ b/erpnext/buying/doctype/buying_settings/buying_settings.txt @@ -1,94 +1,75 @@ -[ - { - "creation": "2013-06-25 11:04:03", - "docstatus": 0, - "modified": "2014-02-19 19:02:00", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "description": "Settings for Buying Module", - "doctype": "DocType", - "document_type": "Other", - "icon": "icon-cog", - "issingle": 1, - "module": "Buying", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Buying Settings", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Buying Settings", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "role": "System Manager", - "write": 1 - }, - { - "doctype": "DocType", - "name": "Buying Settings" - }, - { - "default": "Supplier Name", - "doctype": "DocField", - "fieldname": "supp_master_name", - "fieldtype": "Select", - "label": "Supplier Naming By", - "options": "Supplier Name\nNaming Series" - }, - { - "doctype": "DocField", - "fieldname": "supplier_type", - "fieldtype": "Link", - "label": "Default Supplier Type", - "options": "Supplier Type" - }, - { - "doctype": "DocField", - "fieldname": "buying_price_list", - "fieldtype": "Link", - "label": "Default Buying Price List", - "options": "Price List" - }, - { - "doctype": "DocField", - "fieldname": "column_break_3", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "maintain_same_rate", - "fieldtype": "Check", - "label": "Maintain same rate throughout purchase cycle" - }, - { - "doctype": "DocField", - "fieldname": "po_required", - "fieldtype": "Select", - "label": "Purchase Order Required", - "options": "No\nYes" - }, - { - "doctype": "DocField", - "fieldname": "pr_required", - "fieldtype": "Select", - "label": "Purchase Receipt Required", - "options": "No\nYes" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "creation": "2013-06-25 11:04:03", + "description": "Settings for Buying Module", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Other", + "fields": [ + { + "default": "Supplier Name", + "fieldname": "supp_master_name", + "fieldtype": "Select", + "label": "Supplier Naming By", + "options": "Supplier Name\nNaming Series", + "permlevel": 0 + }, + { + "fieldname": "supplier_type", + "fieldtype": "Link", + "label": "Default Supplier Type", + "options": "Supplier Type", + "permlevel": 0 + }, + { + "fieldname": "buying_price_list", + "fieldtype": "Link", + "label": "Default Buying Price List", + "options": "Price List", + "permlevel": 0 + }, + { + "fieldname": "column_break_3", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "maintain_same_rate", + "fieldtype": "Check", + "label": "Maintain same rate throughout purchase cycle", + "permlevel": 0 + }, + { + "fieldname": "po_required", + "fieldtype": "Select", + "label": "Purchase Order Required", + "options": "No\nYes", + "permlevel": 0 + }, + { + "fieldname": "pr_required", + "fieldtype": "Select", + "label": "Purchase Receipt Required", + "options": "No\nYes", + "permlevel": 0 + } + ], + "icon": "icon-cog", + "idx": 1, + "issingle": 1, + "modified": "2014-02-19 19:02:00", + "modified_by": "Administrator", + "module": "Buying", + "name": "Buying Settings", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "role": "System Manager", + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.txt b/erpnext/buying/doctype/purchase_common/purchase_common.txt index c796c042a9..5a7de618f8 100644 --- a/erpnext/buying/doctype/purchase_common/purchase_common.txt +++ b/erpnext/buying/doctype/purchase_common/purchase_common.txt @@ -1,19 +1,12 @@ -[ - { - "creation": "2012-03-27 14:35:51", - "docstatus": 0, - "modified": "2013-12-20 19:23:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "issingle": 1, - "module": "Buying", - "name": "__common__" - }, - { - "doctype": "DocType", - "name": "Purchase Common" - } -] \ No newline at end of file +{ + "creation": "2012-03-27 14:35:51", + "docstatus": 0, + "doctype": "DocType", + "idx": 1, + "issingle": 1, + "modified": "2013-12-20 19:23:27", + "modified_by": "Administrator", + "module": "Buying", + "name": "Purchase Common", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.txt b/erpnext/buying/doctype/purchase_order/purchase_order.txt index 2dbafd228a..71a14f3f62 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.txt +++ b/erpnext/buying/doctype/purchase_order/purchase_order.txt @@ -1,707 +1,700 @@ -[ - { - "creation": "2013-05-21 16:16:39", - "docstatus": 0, - "modified": "2014-01-29 15:26:21", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_attach": 1, - "allow_import": 1, - "autoname": "naming_series:", - "doctype": "DocType", - "document_type": "Transaction", - "icon": "icon-file-text", - "is_submittable": 1, - "module": "Buying", - "name": "__common__", - "read_only_onload": 1, - "search_fields": "status, transaction_date, supplier,grand_total" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Purchase Order", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Purchase Order", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1 - }, - { - "doctype": "DocType", - "name": "Purchase Order" - }, - { - "doctype": "DocField", - "fieldname": "supplier_section", - "fieldtype": "Section Break", - "label": "Supplier", - "options": "icon-user" - }, - { - "doctype": "DocField", - "fieldname": "naming_series", - "fieldtype": "Select", - "label": "Series", - "no_copy": 1, - "oldfieldname": "naming_series", - "oldfieldtype": "Select", - "options": "\nPO", - "print_hide": 1, - "reqd": 1 - }, - { - "description": "Supplier (vendor) name as entered in supplier master", - "doctype": "DocField", - "fieldname": "supplier", - "fieldtype": "Link", - "in_filter": 1, - "label": "Supplier", - "oldfieldname": "supplier", - "oldfieldtype": "Link", - "options": "Supplier", - "print_hide": 1, - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "supplier_name", - "fieldtype": "Data", - "hidden": 0, - "in_list_view": 1, - "label": "Name", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "address_display", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Address", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "contact_display", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Contact", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "contact_mobile", - "fieldtype": "Text", - "hidden": 1, - "label": "Mobile No", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "contact_email", - "fieldtype": "Text", - "hidden": 1, - "label": "Contact Email", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "print_hide": 0, - "print_width": "50%", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "transaction_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Purchase Order Date", - "oldfieldname": "transaction_date", - "oldfieldtype": "Date", - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "amended_from", - "fieldtype": "Data", - "hidden": 0, - "ignore_restrictions": 1, - "label": "Amended From", - "no_copy": 1, - "oldfieldname": "amended_from", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 1, - "report_hide": 0 - }, - { - "description": "Select the relevant company name if you have multiple companies", - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "in_filter": 1, - "label": "Company", - "no_copy": 0, - "oldfieldname": "company", - "oldfieldtype": "Link", - "options": "Company", - "print_hide": 1, - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "price_list_and_currency", - "fieldtype": "Section Break", - "label": "Currency and Price List", - "options": "icon-tag" - }, - { - "doctype": "DocField", - "fieldname": "cb_currency", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "currency", - "fieldtype": "Link", - "label": "Currency", - "no_copy": 0, - "oldfieldname": "currency", - "oldfieldtype": "Select", - "options": "Currency", - "print_hide": 1, - "reqd": 1 - }, - { - "description": "Rate at which supplier's currency is converted to company's base currency", - "doctype": "DocField", - "fieldname": "conversion_rate", - "fieldtype": "Float", - "hidden": 0, - "label": "Exchange Rate", - "no_copy": 0, - "oldfieldname": "conversion_rate", - "oldfieldtype": "Currency", - "print_hide": 1, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "cb_price_list", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "buying_price_list", - "fieldtype": "Link", - "label": "Price List", - "options": "Price List", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "price_list_currency", - "fieldtype": "Link", - "label": "Price List Currency", - "options": "Currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "plc_conversion_rate", - "fieldtype": "Float", - "label": "Price List Exchange Rate", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "items", - "fieldtype": "Section Break", - "label": "Items", - "oldfieldtype": "Section Break", - "options": "icon-shopping-cart" - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "po_details", - "fieldtype": "Table", - "label": "Purchase Order Items", - "no_copy": 0, - "oldfieldname": "po_details", - "oldfieldtype": "Table", - "options": "Purchase Order Item" - }, - { - "doctype": "DocField", - "fieldname": "sb_last_purchase", - "fieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "net_total_import", - "fieldtype": "Currency", - "label": "Net Total", - "no_copy": 0, - "oldfieldname": "net_total_import", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 0, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "get_last_purchase_rate", - "fieldtype": "Button", - "label": "Get Last Purchase Rate", - "oldfieldtype": "Button", - "print_hide": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break_26", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "net_total", - "fieldtype": "Currency", - "label": "Net Total (Company Currency)", - "no_copy": 1, - "oldfieldname": "net_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1, - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "taxes", - "fieldtype": "Section Break", - "label": "Taxes and Charges", - "oldfieldtype": "Section Break", - "options": "icon-money", - "print_hide": 0 - }, - { - "description": "If you have created a standard template in Purchase Taxes and Charges Master, select one and click on the button below.", - "doctype": "DocField", - "fieldname": "taxes_and_charges", - "fieldtype": "Link", - "label": "Taxes and Charges", - "no_copy": 0, - "oldfieldname": "purchase_other_charges", - "oldfieldtype": "Link", - "options": "Purchase Taxes and Charges Master", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "other_charges", - "fieldtype": "Table", - "label": "Purchase Taxes and Charges", - "no_copy": 0, - "oldfieldname": "purchase_tax_details", - "oldfieldtype": "Table", - "options": "Purchase Taxes and Charges" - }, - { - "doctype": "DocField", - "fieldname": "other_charges_calculation", - "fieldtype": "HTML", - "label": "Taxes and Charges Calculation", - "no_copy": 1, - "oldfieldtype": "HTML", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "totals", - "fieldtype": "Section Break", - "label": "Totals", - "oldfieldtype": "Section Break", - "options": "icon-money" - }, - { - "doctype": "DocField", - "fieldname": "other_charges_added_import", - "fieldtype": "Currency", - "label": "Taxes and Charges Added", - "no_copy": 0, - "oldfieldname": "other_charges_added_import", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 1, - "read_only": 1, - "report_hide": 0 - }, - { - "doctype": "DocField", - "fieldname": "other_charges_deducted_import", - "fieldtype": "Currency", - "label": "Taxes and Charges Deducted", - "no_copy": 0, - "oldfieldname": "other_charges_deducted_import", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 1, - "read_only": 1, - "report_hide": 0 - }, - { - "doctype": "DocField", - "fieldname": "grand_total_import", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Grand Total", - "no_copy": 0, - "oldfieldname": "grand_total_import", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 0, - "read_only": 1, - "report_hide": 0 - }, - { - "doctype": "DocField", - "fieldname": "in_words_import", - "fieldtype": "Data", - "label": "In Words", - "oldfieldname": "in_words_import", - "oldfieldtype": "Data", - "print_hide": 0, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break4", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "print_hide": 0 - }, - { - "doctype": "DocField", - "fieldname": "other_charges_added", - "fieldtype": "Currency", - "label": "Taxes and Charges Added (Company Currency)", - "no_copy": 0, - "oldfieldname": "other_charges_added", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "other_charges_deducted", - "fieldtype": "Currency", - "label": "Taxes and Charges Deducted (Company Currency)", - "no_copy": 0, - "oldfieldname": "other_charges_deducted", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "total_tax", - "fieldtype": "Currency", - "label": "Total Tax (Company Currency)", - "no_copy": 1, - "oldfieldname": "total_tax", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "grand_total", - "fieldtype": "Currency", - "label": "Grand Total (Company Currency)", - "no_copy": 1, - "oldfieldname": "grand_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "rounded_total", - "fieldtype": "Currency", - "label": "Rounded Total (Company Currency)", - "oldfieldname": "rounded_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "description": "In Words will be visible once you save the Purchase Order.", - "doctype": "DocField", - "fieldname": "in_words", - "fieldtype": "Data", - "label": "In Words (Company Currency)", - "oldfieldname": "in_words", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "terms_section_break", - "fieldtype": "Section Break", - "label": "Terms and Conditions", - "oldfieldtype": "Section Break", - "options": "icon-legal" - }, - { - "doctype": "DocField", - "fieldname": "tc_name", - "fieldtype": "Link", - "label": "Terms", - "oldfieldname": "tc_name", - "oldfieldtype": "Link", - "options": "Terms and Conditions", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "terms", - "fieldtype": "Text Editor", - "label": "Terms and Conditions", - "oldfieldname": "terms", - "oldfieldtype": "Text Editor" - }, - { - "depends_on": "supplier", - "doctype": "DocField", - "fieldname": "contact_section", - "fieldtype": "Section Break", - "label": "Contact Info", - "options": "icon-bullhorn" - }, - { - "doctype": "DocField", - "fieldname": "supplier_address", - "fieldtype": "Link", - "in_filter": 1, - "label": "Supplier Address", - "options": "Address", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "cb_contact", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "contact_person", - "fieldtype": "Link", - "in_filter": 1, - "label": "Contact Person", - "options": "Contact", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "more_info", - "fieldtype": "Section Break", - "label": "More Info", - "oldfieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "status", - "fieldtype": "Select", - "in_filter": 1, - "label": "Status", - "no_copy": 1, - "oldfieldname": "status", - "oldfieldtype": "Select", - "options": "\nDraft\nSubmitted\nStopped\nCancelled", - "print_hide": 1, - "read_only": 1, - "reqd": 1, - "search_index": 1 - }, - { - "default": "No", - "doctype": "DocField", - "fieldname": "is_subcontracted", - "fieldtype": "Select", - "label": "Is Subcontracted", - "options": "\nYes\nNo", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "ref_sq", - "fieldtype": "Data", - "hidden": 1, - "label": "Ref SQ", - "no_copy": 1, - "oldfieldname": "ref_sq", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 1 - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "letter_head", - "fieldtype": "Select", - "label": "Letter Head", - "oldfieldname": "letter_head", - "oldfieldtype": "Select", - "options": "link:Letter Head", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "fiscal_year", - "fieldtype": "Select", - "in_filter": 1, - "label": "Fiscal Year", - "no_copy": 0, - "oldfieldname": "fiscal_year", - "oldfieldtype": "Select", - "options": "link:Fiscal Year", - "print_hide": 1, - "reqd": 1, - "search_index": 1 - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "select_print_heading", - "fieldtype": "Link", - "label": "Print Heading", - "no_copy": 1, - "oldfieldname": "select_print_heading", - "oldfieldtype": "Link", - "options": "Print Heading", - "print_hide": 1, - "report_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break5", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "print_hide": 1, - "print_width": "50%", - "width": "50%" - }, - { - "depends_on": "eval:!doc.__islocal", - "description": "% of materials received against this Purchase Order", - "doctype": "DocField", - "fieldname": "per_received", - "fieldtype": "Percent", - "in_list_view": 1, - "label": "% Received", - "no_copy": 1, - "oldfieldname": "per_received", - "oldfieldtype": "Currency", - "print_hide": 1, - "read_only": 1 - }, - { - "depends_on": "eval:!doc.__islocal", - "description": "% of materials billed against this Purchase Order.", - "doctype": "DocField", - "fieldname": "per_billed", - "fieldtype": "Percent", - "in_list_view": 1, - "label": "% Billed", - "no_copy": 1, - "oldfieldname": "per_billed", - "oldfieldtype": "Currency", - "print_hide": 1, - "read_only": 1 - }, - { - "description": "Required raw materials issued to the supplier for producing a sub - contracted item.", - "doctype": "DocField", - "fieldname": "raw_material_details", - "fieldtype": "Section Break", - "label": "Raw Materials Supplied", - "oldfieldtype": "Section Break", - "options": "icon-truck", - "print_hide": 1 - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "po_raw_material_details", - "fieldtype": "Table", - "label": "Purchase Order Items Supplied", - "no_copy": 0, - "oldfieldname": "po_raw_material_details", - "oldfieldtype": "Table", - "options": "Purchase Order Item Supplied", - "print_hide": 1, - "read_only": 1 - }, - { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Material User", - "submit": 0, - "write": 0 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Purchase Manager", - "submit": 1, - "write": 1 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Purchase User", - "submit": 1, - "write": 1 - }, - { - "cancel": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Supplier" - } -] \ No newline at end of file +{ + "allow_attach": 1, + "allow_import": 1, + "autoname": "naming_series:", + "creation": "2013-05-21 16:16:39", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Transaction", + "fields": [ + { + "fieldname": "supplier_section", + "fieldtype": "Section Break", + "label": "Supplier", + "options": "icon-user", + "permlevel": 0 + }, + { + "fieldname": "naming_series", + "fieldtype": "Select", + "label": "Series", + "no_copy": 1, + "oldfieldname": "naming_series", + "oldfieldtype": "Select", + "options": "\nPO", + "permlevel": 0, + "print_hide": 1, + "reqd": 1 + }, + { + "description": "Supplier (vendor) name as entered in supplier master", + "fieldname": "supplier", + "fieldtype": "Link", + "in_filter": 1, + "label": "Supplier", + "oldfieldname": "supplier", + "oldfieldtype": "Link", + "options": "Supplier", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "supplier_name", + "fieldtype": "Data", + "hidden": 0, + "in_list_view": 1, + "label": "Name", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "address_display", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Address", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "contact_display", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Contact", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "contact_mobile", + "fieldtype": "Text", + "hidden": 1, + "label": "Mobile No", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "contact_email", + "fieldtype": "Text", + "hidden": 1, + "label": "Contact Email", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 0, + "print_width": "50%", + "width": "50%" + }, + { + "fieldname": "transaction_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Purchase Order Date", + "oldfieldname": "transaction_date", + "oldfieldtype": "Date", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "amended_from", + "fieldtype": "Data", + "hidden": 0, + "ignore_restrictions": 1, + "label": "Amended From", + "no_copy": 1, + "oldfieldname": "amended_from", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "report_hide": 0 + }, + { + "description": "Select the relevant company name if you have multiple companies", + "fieldname": "company", + "fieldtype": "Link", + "in_filter": 1, + "label": "Company", + "no_copy": 0, + "oldfieldname": "company", + "oldfieldtype": "Link", + "options": "Company", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "price_list_and_currency", + "fieldtype": "Section Break", + "label": "Currency and Price List", + "options": "icon-tag", + "permlevel": 0 + }, + { + "fieldname": "cb_currency", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "currency", + "fieldtype": "Link", + "label": "Currency", + "no_copy": 0, + "oldfieldname": "currency", + "oldfieldtype": "Select", + "options": "Currency", + "permlevel": 0, + "print_hide": 1, + "reqd": 1 + }, + { + "description": "Rate at which supplier's currency is converted to company's base currency", + "fieldname": "conversion_rate", + "fieldtype": "Float", + "hidden": 0, + "label": "Exchange Rate", + "no_copy": 0, + "oldfieldname": "conversion_rate", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "reqd": 1 + }, + { + "fieldname": "cb_price_list", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "buying_price_list", + "fieldtype": "Link", + "label": "Price List", + "options": "Price List", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "price_list_currency", + "fieldtype": "Link", + "label": "Price List Currency", + "options": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "plc_conversion_rate", + "fieldtype": "Float", + "label": "Price List Exchange Rate", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "items", + "fieldtype": "Section Break", + "label": "Items", + "oldfieldtype": "Section Break", + "options": "icon-shopping-cart", + "permlevel": 0 + }, + { + "allow_on_submit": 1, + "fieldname": "po_details", + "fieldtype": "Table", + "label": "Purchase Order Items", + "no_copy": 0, + "oldfieldname": "po_details", + "oldfieldtype": "Table", + "options": "Purchase Order Item", + "permlevel": 0 + }, + { + "fieldname": "sb_last_purchase", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "net_total_import", + "fieldtype": "Currency", + "label": "Net Total", + "no_copy": 0, + "oldfieldname": "net_total_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 1 + }, + { + "fieldname": "get_last_purchase_rate", + "fieldtype": "Button", + "label": "Get Last Purchase Rate", + "oldfieldtype": "Button", + "permlevel": 0, + "print_hide": 0 + }, + { + "fieldname": "column_break_26", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "net_total", + "fieldtype": "Currency", + "label": "Net Total (Company Currency)", + "no_copy": 1, + "oldfieldname": "net_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 0 + }, + { + "fieldname": "taxes", + "fieldtype": "Section Break", + "label": "Taxes and Charges", + "oldfieldtype": "Section Break", + "options": "icon-money", + "permlevel": 0, + "print_hide": 0 + }, + { + "description": "If you have created a standard template in Purchase Taxes and Charges Master, select one and click on the button below.", + "fieldname": "taxes_and_charges", + "fieldtype": "Link", + "label": "Taxes and Charges", + "no_copy": 0, + "oldfieldname": "purchase_other_charges", + "oldfieldtype": "Link", + "options": "Purchase Taxes and Charges Master", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "other_charges", + "fieldtype": "Table", + "label": "Purchase Taxes and Charges", + "no_copy": 0, + "oldfieldname": "purchase_tax_details", + "oldfieldtype": "Table", + "options": "Purchase Taxes and Charges", + "permlevel": 0 + }, + { + "fieldname": "other_charges_calculation", + "fieldtype": "HTML", + "label": "Taxes and Charges Calculation", + "no_copy": 1, + "oldfieldtype": "HTML", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "totals", + "fieldtype": "Section Break", + "label": "Totals", + "oldfieldtype": "Section Break", + "options": "icon-money", + "permlevel": 0 + }, + { + "fieldname": "other_charges_added_import", + "fieldtype": "Currency", + "label": "Taxes and Charges Added", + "no_copy": 0, + "oldfieldname": "other_charges_added_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "report_hide": 0 + }, + { + "fieldname": "other_charges_deducted_import", + "fieldtype": "Currency", + "label": "Taxes and Charges Deducted", + "no_copy": 0, + "oldfieldname": "other_charges_deducted_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "report_hide": 0 + }, + { + "fieldname": "grand_total_import", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Grand Total", + "no_copy": 0, + "oldfieldname": "grand_total_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 1, + "report_hide": 0 + }, + { + "fieldname": "in_words_import", + "fieldtype": "Data", + "label": "In Words", + "oldfieldname": "in_words_import", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 0, + "read_only": 1 + }, + { + "fieldname": "column_break4", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 0 + }, + { + "fieldname": "other_charges_added", + "fieldtype": "Currency", + "label": "Taxes and Charges Added (Company Currency)", + "no_copy": 0, + "oldfieldname": "other_charges_added", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "other_charges_deducted", + "fieldtype": "Currency", + "label": "Taxes and Charges Deducted (Company Currency)", + "no_copy": 0, + "oldfieldname": "other_charges_deducted", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "total_tax", + "fieldtype": "Currency", + "label": "Total Tax (Company Currency)", + "no_copy": 1, + "oldfieldname": "total_tax", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "grand_total", + "fieldtype": "Currency", + "label": "Grand Total (Company Currency)", + "no_copy": 1, + "oldfieldname": "grand_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "rounded_total", + "fieldtype": "Currency", + "label": "Rounded Total (Company Currency)", + "oldfieldname": "rounded_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "description": "In Words will be visible once you save the Purchase Order.", + "fieldname": "in_words", + "fieldtype": "Data", + "label": "In Words (Company Currency)", + "oldfieldname": "in_words", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "terms_section_break", + "fieldtype": "Section Break", + "label": "Terms and Conditions", + "oldfieldtype": "Section Break", + "options": "icon-legal", + "permlevel": 0 + }, + { + "fieldname": "tc_name", + "fieldtype": "Link", + "label": "Terms", + "oldfieldname": "tc_name", + "oldfieldtype": "Link", + "options": "Terms and Conditions", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "terms", + "fieldtype": "Text Editor", + "label": "Terms and Conditions", + "oldfieldname": "terms", + "oldfieldtype": "Text Editor", + "permlevel": 0 + }, + { + "depends_on": "supplier", + "fieldname": "contact_section", + "fieldtype": "Section Break", + "label": "Contact Info", + "options": "icon-bullhorn", + "permlevel": 0 + }, + { + "fieldname": "supplier_address", + "fieldtype": "Link", + "in_filter": 1, + "label": "Supplier Address", + "options": "Address", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "cb_contact", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "contact_person", + "fieldtype": "Link", + "in_filter": 1, + "label": "Contact Person", + "options": "Contact", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "more_info", + "fieldtype": "Section Break", + "label": "More Info", + "oldfieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "status", + "fieldtype": "Select", + "in_filter": 1, + "label": "Status", + "no_copy": 1, + "oldfieldname": "status", + "oldfieldtype": "Select", + "options": "\nDraft\nSubmitted\nStopped\nCancelled", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 1, + "search_index": 1 + }, + { + "default": "No", + "fieldname": "is_subcontracted", + "fieldtype": "Select", + "label": "Is Subcontracted", + "options": "\nYes\nNo", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "ref_sq", + "fieldtype": "Data", + "hidden": 1, + "label": "Ref SQ", + "no_copy": 1, + "oldfieldname": "ref_sq", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "allow_on_submit": 1, + "fieldname": "letter_head", + "fieldtype": "Select", + "label": "Letter Head", + "oldfieldname": "letter_head", + "oldfieldtype": "Select", + "options": "link:Letter Head", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Select", + "in_filter": 1, + "label": "Fiscal Year", + "no_copy": 0, + "oldfieldname": "fiscal_year", + "oldfieldtype": "Select", + "options": "link:Fiscal Year", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, + "search_index": 1 + }, + { + "allow_on_submit": 1, + "fieldname": "select_print_heading", + "fieldtype": "Link", + "label": "Print Heading", + "no_copy": 1, + "oldfieldname": "select_print_heading", + "oldfieldtype": "Link", + "options": "Print Heading", + "permlevel": 0, + "print_hide": 1, + "report_hide": 1 + }, + { + "fieldname": "column_break5", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 1, + "print_width": "50%", + "width": "50%" + }, + { + "depends_on": "eval:!doc.__islocal", + "description": "% of materials received against this Purchase Order", + "fieldname": "per_received", + "fieldtype": "Percent", + "in_list_view": 1, + "label": "% Received", + "no_copy": 1, + "oldfieldname": "per_received", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "depends_on": "eval:!doc.__islocal", + "description": "% of materials billed against this Purchase Order.", + "fieldname": "per_billed", + "fieldtype": "Percent", + "in_list_view": 1, + "label": "% Billed", + "no_copy": 1, + "oldfieldname": "per_billed", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "description": "Required raw materials issued to the supplier for producing a sub - contracted item.", + "fieldname": "raw_material_details", + "fieldtype": "Section Break", + "label": "Raw Materials Supplied", + "oldfieldtype": "Section Break", + "options": "icon-truck", + "permlevel": 0, + "print_hide": 1 + }, + { + "allow_on_submit": 1, + "fieldname": "po_raw_material_details", + "fieldtype": "Table", + "label": "Purchase Order Items Supplied", + "no_copy": 0, + "oldfieldname": "po_raw_material_details", + "oldfieldtype": "Table", + "options": "Purchase Order Item Supplied", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + } + ], + "icon": "icon-file-text", + "idx": 1, + "is_submittable": 1, + "modified": "2014-01-29 15:26:21", + "modified_by": "Administrator", + "module": "Buying", + "name": "Purchase Order", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material User", + "submit": 0, + "write": 0 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase Manager", + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase User", + "submit": 1, + "write": 1 + }, + { + "cancel": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Supplier" + } + ], + "read_only_onload": 1, + "search_fields": "status, transaction_date, supplier,grand_total" +} \ No newline at end of file diff --git a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.txt b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.txt index 192b206461..fc41a7b6ef 100755 --- a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.txt +++ b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.txt @@ -1,495 +1,482 @@ -[ - { - "creation": "2013-05-24 19:29:06", - "docstatus": 0, - "modified": "2014-02-28 11:26:25", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "POD/.#####", - "doctype": "DocType", - "istable": 1, - "module": "Buying", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Purchase Order Item", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Purchase Order Item" - }, - { - "doctype": "DocField", - "fieldname": "item_code", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "Item Code", - "oldfieldname": "item_code", - "oldfieldtype": "Link", - "options": "Item", - "print_hide": 0, - "read_only": 0, - "reqd": 1, - "search_index": 1 - }, - { - "description": "If Supplier Part Number exists for given Item, it gets stored here", - "doctype": "DocField", - "fieldname": "supplier_part_no", - "fieldtype": "Data", - "hidden": 1, - "in_list_view": 0, - "label": "Supplier Part Number", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "item_name", - "fieldtype": "Data", - "hidden": 0, - "in_filter": 1, - "in_list_view": 0, - "label": "Item Name", - "oldfieldname": "item_name", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 0, - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "schedule_date", - "fieldtype": "Date", - "hidden": 0, - "in_filter": 1, - "in_list_view": 0, - "label": "Reqd By Date", - "no_copy": 0, - "oldfieldname": "schedule_date", - "oldfieldtype": "Date", - "print_hide": 1, - "read_only": 0, - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "col_break1", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Small Text", - "in_list_view": 1, - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Small Text", - "print_width": "300px", - "read_only": 0, - "reqd": 1, - "width": "300px" - }, - { - "doctype": "DocField", - "fieldname": "quantity_and_rate", - "fieldtype": "Section Break", - "in_list_view": 0, - "label": "Quantity and Rate" - }, - { - "doctype": "DocField", - "fieldname": "qty", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Quantity", - "oldfieldname": "qty", - "oldfieldtype": "Currency", - "print_width": "60px", - "read_only": 0, - "reqd": 1, - "width": "60px" - }, - { - "doctype": "DocField", - "fieldname": "uom", - "fieldtype": "Link", - "in_list_view": 0, - "label": "UOM", - "oldfieldname": "uom", - "oldfieldtype": "Link", - "options": "UOM", - "print_hide": 0, - "print_width": "100px", - "read_only": 0, - "reqd": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "col_break2", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "stock_uom", - "fieldtype": "Link", - "hidden": 0, - "in_list_view": 0, - "label": "Stock UOM", - "oldfieldname": "stock_uom", - "oldfieldtype": "Data", - "options": "UOM", - "print_hide": 1, - "print_width": "100px", - "read_only": 1, - "reqd": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "conversion_factor", - "fieldtype": "Float", - "hidden": 0, - "in_list_view": 0, - "label": "UOM Conversion Factor", - "oldfieldname": "conversion_factor", - "oldfieldtype": "Currency", - "print_hide": 1, - "print_width": "100px", - "read_only": 0, - "reqd": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "sec_break1", - "fieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "price_list_rate", - "fieldtype": "Currency", - "in_list_view": 0, - "label": "Price List Rate", - "options": "currency", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "discount_percentage", - "fieldtype": "Float", - "in_list_view": 0, - "label": "Discount %", - "print_hide": 0, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "col_break3", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "base_price_list_rate", - "fieldtype": "Currency", - "in_list_view": 0, - "label": "Price List Rate (Company Currency)", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "sec_break2", - "fieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "rate", - "fieldtype": "Currency", - "hidden": 0, - "in_list_view": 1, - "label": "Rate ", - "oldfieldname": "import_rate", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 0, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "amount", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Amount", - "oldfieldname": "import_amount", - "oldfieldtype": "Currency", - "options": "currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "col_break4", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "base_rate", - "fieldtype": "Currency", - "in_list_view": 0, - "label": "Rate (Company Currency)", - "oldfieldname": "purchase_rate", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "print_width": "100px", - "read_only": 1, - "reqd": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "base_amount", - "fieldtype": "Currency", - "in_list_view": 0, - "label": "Amount (Company Currency)", - "oldfieldname": "amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "pricing_rule_for_price", - "fieldtype": "Link", - "label": "Pricing Rule For Price", - "options": "Pricing Rule", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "pricing_rule_for_discount", - "fieldtype": "Link", - "label": "Pricing Rule For Discount", - "options": "Pricing Rule", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "warehouse_and_reference", - "fieldtype": "Section Break", - "in_list_view": 0, - "label": "Warehouse and Reference" - }, - { - "doctype": "DocField", - "fieldname": "warehouse", - "fieldtype": "Link", - "hidden": 0, - "in_list_view": 0, - "label": "Warehouse", - "oldfieldname": "warehouse", - "oldfieldtype": "Link", - "options": "Warehouse", - "print_hide": 1, - "read_only": 0, - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "project_name", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 0, - "label": "Project Name", - "options": "Project", - "print_hide": 1, - "read_only": 0, - "report_hide": 0 - }, - { - "doctype": "DocField", - "fieldname": "prevdoc_doctype", - "fieldtype": "Data", - "hidden": 1, - "in_list_view": 0, - "label": "Prevdoc DocType", - "no_copy": 1, - "oldfieldname": "prevdoc_doctype", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "prevdoc_docname", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 1, - "in_list_view": 0, - "label": "Material Request No", - "no_copy": 1, - "oldfieldname": "prevdoc_docname", - "oldfieldtype": "Link", - "options": "Material Request", - "print_hide": 1, - "print_width": "120px", - "read_only": 1, - "search_index": 1, - "width": "120px" - }, - { - "doctype": "DocField", - "fieldname": "prevdoc_detail_docname", - "fieldtype": "Data", - "hidden": 1, - "in_filter": 1, - "in_list_view": 0, - "label": "Material Request Detail No", - "no_copy": 1, - "oldfieldname": "prevdoc_detail_docname", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "supplier_quotation", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Supplier Quotation", - "no_copy": 1, - "options": "Supplier Quotation", - "read_only": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "supplier_quotation_item", - "fieldtype": "Link", - "hidden": 1, - "in_list_view": 1, - "label": "Supplier Quotation Item", - "no_copy": 1, - "options": "Supplier Quotation Item", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "col_break5", - "fieldtype": "Column Break" - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "item_group", - "fieldtype": "Link", - "hidden": 1, - "in_filter": 1, - "in_list_view": 1, - "label": "Item Group", - "oldfieldname": "item_group", - "oldfieldtype": "Link", - "options": "Item Group", - "print_hide": 1, - "read_only": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "brand", - "fieldtype": "Link", - "hidden": 1, - "in_list_view": 1, - "label": "Brand", - "oldfieldname": "brand", - "oldfieldtype": "Link", - "options": "Brand", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "stock_qty", - "fieldtype": "Float", - "hidden": 0, - "in_list_view": 1, - "label": "Qty as per Stock UOM", - "no_copy": 1, - "oldfieldname": "stock_qty", - "oldfieldtype": "Currency", - "print_hide": 1, - "print_width": "100px", - "read_only": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "received_qty", - "fieldtype": "Float", - "hidden": 0, - "in_list_view": 1, - "label": "Received Qty", - "no_copy": 1, - "oldfieldname": "received_qty", - "oldfieldtype": "Currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "billed_amt", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Billed Amt", - "no_copy": 1, - "options": "currency", - "print_hide": 1, - "read_only": 1 - }, - { - "description": "Tax detail table fetched from item master as a string and stored in this field.\nUsed for Taxes and Charges", - "doctype": "DocField", - "fieldname": "item_tax_rate", - "fieldtype": "Small Text", - "hidden": 1, - "in_list_view": 1, - "label": "Item Tax Rate", - "oldfieldname": "item_tax_rate", - "oldfieldtype": "Small Text", - "print_hide": 1, - "read_only": 1, - "report_hide": 1 - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "page_break", - "fieldtype": "Check", - "hidden": 0, - "in_list_view": 1, - "label": "Page Break", - "no_copy": 1, - "oldfieldname": "page_break", - "oldfieldtype": "Check", - "print_hide": 1, - "read_only": 0 - } -] \ No newline at end of file +{ + "autoname": "POD/.#####", + "creation": "2013-05-24 19:29:06", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "item_code", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Item Code", + "oldfieldname": "item_code", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0, + "print_hide": 0, + "read_only": 0, + "reqd": 1, + "search_index": 1 + }, + { + "description": "If Supplier Part Number exists for given Item, it gets stored here", + "fieldname": "supplier_part_no", + "fieldtype": "Data", + "hidden": 1, + "in_list_view": 0, + "label": "Supplier Part Number", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "item_name", + "fieldtype": "Data", + "hidden": 0, + "in_filter": 1, + "in_list_view": 0, + "label": "Item Name", + "oldfieldname": "item_name", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "schedule_date", + "fieldtype": "Date", + "hidden": 0, + "in_filter": 1, + "in_list_view": 0, + "label": "Reqd By Date", + "no_copy": 0, + "oldfieldname": "schedule_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "col_break1", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "description", + "fieldtype": "Small Text", + "in_list_view": 1, + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_width": "300px", + "read_only": 0, + "reqd": 1, + "width": "300px" + }, + { + "fieldname": "quantity_and_rate", + "fieldtype": "Section Break", + "in_list_view": 0, + "label": "Quantity and Rate", + "permlevel": 0 + }, + { + "fieldname": "qty", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Quantity", + "oldfieldname": "qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_width": "60px", + "read_only": 0, + "reqd": 1, + "width": "60px" + }, + { + "fieldname": "uom", + "fieldtype": "Link", + "in_list_view": 0, + "label": "UOM", + "oldfieldname": "uom", + "oldfieldtype": "Link", + "options": "UOM", + "permlevel": 0, + "print_hide": 0, + "print_width": "100px", + "read_only": 0, + "reqd": 1, + "width": "100px" + }, + { + "fieldname": "col_break2", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "stock_uom", + "fieldtype": "Link", + "hidden": 0, + "in_list_view": 0, + "label": "Stock UOM", + "oldfieldname": "stock_uom", + "oldfieldtype": "Data", + "options": "UOM", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 1, + "reqd": 1, + "width": "100px" + }, + { + "fieldname": "conversion_factor", + "fieldtype": "Float", + "hidden": 0, + "in_list_view": 0, + "label": "UOM Conversion Factor", + "oldfieldname": "conversion_factor", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 0, + "reqd": 1, + "width": "100px" + }, + { + "fieldname": "sec_break1", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "price_list_rate", + "fieldtype": "Currency", + "in_list_view": 0, + "label": "Price List Rate", + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "discount_percentage", + "fieldtype": "Float", + "in_list_view": 0, + "label": "Discount %", + "permlevel": 0, + "print_hide": 0, + "read_only": 0 + }, + { + "fieldname": "col_break3", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "base_price_list_rate", + "fieldtype": "Currency", + "in_list_view": 0, + "label": "Price List Rate (Company Currency)", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "sec_break2", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "rate", + "fieldtype": "Currency", + "hidden": 0, + "in_list_view": 1, + "label": "Rate ", + "oldfieldname": "import_rate", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 0 + }, + { + "fieldname": "amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Amount", + "oldfieldname": "import_amount", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "col_break4", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "base_rate", + "fieldtype": "Currency", + "in_list_view": 0, + "label": "Rate (Company Currency)", + "oldfieldname": "purchase_rate", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 1, + "reqd": 1, + "width": "100px" + }, + { + "fieldname": "base_amount", + "fieldtype": "Currency", + "in_list_view": 0, + "label": "Amount (Company Currency)", + "oldfieldname": "amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 1 + }, + { + "fieldname": "pricing_rule_for_price", + "fieldtype": "Link", + "label": "Pricing Rule For Price", + "options": "Pricing Rule", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "pricing_rule_for_discount", + "fieldtype": "Link", + "label": "Pricing Rule For Discount", + "options": "Pricing Rule", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "warehouse_and_reference", + "fieldtype": "Section Break", + "in_list_view": 0, + "label": "Warehouse and Reference", + "permlevel": 0 + }, + { + "fieldname": "warehouse", + "fieldtype": "Link", + "hidden": 0, + "in_list_view": 0, + "label": "Warehouse", + "oldfieldname": "warehouse", + "oldfieldtype": "Link", + "options": "Warehouse", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 0 + }, + { + "fieldname": "project_name", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 0, + "label": "Project Name", + "options": "Project", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 0 + }, + { + "fieldname": "prevdoc_doctype", + "fieldtype": "Data", + "hidden": 1, + "in_list_view": 0, + "label": "Prevdoc DocType", + "no_copy": 1, + "oldfieldname": "prevdoc_doctype", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "prevdoc_docname", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 1, + "in_list_view": 0, + "label": "Material Request No", + "no_copy": 1, + "oldfieldname": "prevdoc_docname", + "oldfieldtype": "Link", + "options": "Material Request", + "permlevel": 0, + "print_hide": 1, + "print_width": "120px", + "read_only": 1, + "search_index": 1, + "width": "120px" + }, + { + "fieldname": "prevdoc_detail_docname", + "fieldtype": "Data", + "hidden": 1, + "in_filter": 1, + "in_list_view": 0, + "label": "Material Request Detail No", + "no_copy": 1, + "oldfieldname": "prevdoc_detail_docname", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "search_index": 1 + }, + { + "fieldname": "supplier_quotation", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Supplier Quotation", + "no_copy": 1, + "options": "Supplier Quotation", + "permlevel": 0, + "read_only": 1, + "search_index": 0 + }, + { + "fieldname": "supplier_quotation_item", + "fieldtype": "Link", + "hidden": 1, + "in_list_view": 1, + "label": "Supplier Quotation Item", + "no_copy": 1, + "options": "Supplier Quotation Item", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "col_break5", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "description": "Add / Edit", + "fieldname": "item_group", + "fieldtype": "Link", + "hidden": 1, + "in_filter": 1, + "in_list_view": 1, + "label": "Item Group", + "oldfieldname": "item_group", + "oldfieldtype": "Link", + "options": "Item Group", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "search_index": 0 + }, + { + "fieldname": "brand", + "fieldtype": "Link", + "hidden": 1, + "in_list_view": 1, + "label": "Brand", + "oldfieldname": "brand", + "oldfieldtype": "Link", + "options": "Brand", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "stock_qty", + "fieldtype": "Float", + "hidden": 0, + "in_list_view": 1, + "label": "Qty as per Stock UOM", + "no_copy": 1, + "oldfieldname": "stock_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 1, + "width": "100px" + }, + { + "fieldname": "received_qty", + "fieldtype": "Float", + "hidden": 0, + "in_list_view": 1, + "label": "Received Qty", + "no_copy": 1, + "oldfieldname": "received_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "billed_amt", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Billed Amt", + "no_copy": 1, + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "description": "Tax detail table fetched from item master as a string and stored in this field.\nUsed for Taxes and Charges", + "fieldname": "item_tax_rate", + "fieldtype": "Small Text", + "hidden": 1, + "in_list_view": 1, + "label": "Item Tax Rate", + "oldfieldname": "item_tax_rate", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "report_hide": 1 + }, + { + "allow_on_submit": 1, + "fieldname": "page_break", + "fieldtype": "Check", + "hidden": 0, + "in_list_view": 1, + "label": "Page Break", + "no_copy": 1, + "oldfieldname": "page_break", + "oldfieldtype": "Check", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + } + ], + "idx": 1, + "istable": 1, + "modified": "2014-02-28 11:26:25", + "modified_by": "Administrator", + "module": "Buying", + "name": "Purchase Order Item", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.txt b/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.txt index f2860cde54..3bcd474017 100644 --- a/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.txt +++ b/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.txt @@ -1,121 +1,108 @@ -[ - { - "creation": "2013-02-22 01:27:42", - "docstatus": 0, - "modified": "2013-12-20 19:23:33", - "modified_by": "Administrator", - "owner": "dhanalekshmi@webnotestech.com" - }, - { - "doctype": "DocType", - "hide_toolbar": 1, - "istable": 1, - "module": "Buying", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Purchase Order Item Supplied", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Purchase Order Item Supplied" - }, - { - "doctype": "DocField", - "fieldname": "reference_name", - "fieldtype": "Data", - "hidden": 0, - "in_filter": 0, - "in_list_view": 1, - "label": "Reference Name", - "oldfieldname": "reference_name", - "oldfieldtype": "Data", - "read_only": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "bom_detail_no", - "fieldtype": "Data", - "in_list_view": 1, - "label": "BOM Detail No", - "oldfieldname": "bom_detail_no", - "oldfieldtype": "Data", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "main_item_code", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Item Code", - "oldfieldname": "main_item_code", - "oldfieldtype": "Data", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "rm_item_code", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Raw Material Item Code", - "oldfieldname": "rm_item_code", - "oldfieldtype": "Data", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "required_qty", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Required Qty", - "oldfieldname": "required_qty", - "oldfieldtype": "Currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "rate", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Rate", - "oldfieldname": "rate", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency" - }, - { - "doctype": "DocField", - "fieldname": "amount", - "fieldtype": "Currency", - "label": "Amount", - "oldfieldname": "amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "conversion_factor", - "fieldtype": "Float", - "hidden": 1, - "label": "Conversion Factor", - "oldfieldname": "conversion_factor", - "oldfieldtype": "Currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "stock_uom", - "fieldtype": "Link", - "label": "Stock Uom", - "oldfieldname": "stock_uom", - "oldfieldtype": "Data", - "options": "UOM", - "read_only": 1 - } -] \ No newline at end of file +{ + "creation": "2013-02-22 01:27:42", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "reference_name", + "fieldtype": "Data", + "hidden": 0, + "in_filter": 0, + "in_list_view": 1, + "label": "Reference Name", + "oldfieldname": "reference_name", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1, + "search_index": 0 + }, + { + "fieldname": "bom_detail_no", + "fieldtype": "Data", + "in_list_view": 1, + "label": "BOM Detail No", + "oldfieldname": "bom_detail_no", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "main_item_code", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Item Code", + "oldfieldname": "main_item_code", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "rm_item_code", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Raw Material Item Code", + "oldfieldname": "rm_item_code", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "required_qty", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Required Qty", + "oldfieldname": "required_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "rate", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Rate", + "oldfieldname": "rate", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0 + }, + { + "fieldname": "amount", + "fieldtype": "Currency", + "label": "Amount", + "oldfieldname": "amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "conversion_factor", + "fieldtype": "Float", + "hidden": 1, + "label": "Conversion Factor", + "oldfieldname": "conversion_factor", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "stock_uom", + "fieldtype": "Link", + "label": "Stock Uom", + "oldfieldname": "stock_uom", + "oldfieldtype": "Data", + "options": "UOM", + "permlevel": 0, + "read_only": 1 + } + ], + "hide_toolbar": 1, + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:23:33", + "modified_by": "Administrator", + "module": "Buying", + "name": "Purchase Order Item Supplied", + "owner": "dhanalekshmi@webnotestech.com" +} \ No newline at end of file diff --git a/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.txt b/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.txt index e28bdb7b26..8bee52eb7b 100644 --- a/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.txt +++ b/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.txt @@ -1,158 +1,145 @@ -[ - { - "creation": "2013-02-22 01:27:42", - "docstatus": 0, - "modified": "2014-02-13 11:29:35", - "modified_by": "Administrator", - "owner": "wasim@webnotestech.com" - }, - { - "doctype": "DocType", - "hide_toolbar": 0, - "istable": 1, - "module": "Buying", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Purchase Receipt Item Supplied", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Purchase Receipt Item Supplied" - }, - { - "doctype": "DocField", - "fieldname": "main_item_code", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Item Code", - "oldfieldname": "main_item_code", - "oldfieldtype": "Data", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "rm_item_code", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Raw Material Item Code", - "oldfieldname": "rm_item_code", - "oldfieldtype": "Data", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Text", - "in_list_view": 1, - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Data", - "print_width": "300px", - "read_only": 1, - "width": "300px" - }, - { - "doctype": "DocField", - "fieldname": "col_break1", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "required_qty", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Required Qty", - "oldfieldname": "required_qty", - "oldfieldtype": "Currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "consumed_qty", - "fieldtype": "Float", - "label": "Consumed Qty", - "oldfieldname": "consumed_qty", - "oldfieldtype": "Currency", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "stock_uom", - "fieldtype": "Link", - "label": "Stock Uom", - "oldfieldname": "stock_uom", - "oldfieldtype": "Data", - "options": "UOM", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "rate", - "fieldtype": "Currency", - "label": "Rate", - "oldfieldname": "rate", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "amount", - "fieldtype": "Currency", - "label": "Amount", - "oldfieldname": "amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "conversion_factor", - "fieldtype": "Float", - "hidden": 1, - "label": "Conversion Factor", - "oldfieldname": "conversion_factor", - "oldfieldtype": "Currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "current_stock", - "fieldtype": "Float", - "hidden": 1, - "label": "Current Stock", - "oldfieldname": "current_stock", - "oldfieldtype": "Currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "reference_name", - "fieldtype": "Data", - "hidden": 1, - "in_filter": 0, - "in_list_view": 1, - "label": "Reference Name", - "oldfieldname": "reference_name", - "oldfieldtype": "Data", - "read_only": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "bom_detail_no", - "fieldtype": "Data", - "hidden": 1, - "in_list_view": 1, - "label": "BOM Detail No", - "oldfieldname": "bom_detail_no", - "oldfieldtype": "Data", - "read_only": 1 - } -] \ No newline at end of file +{ + "creation": "2013-02-22 01:27:42", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "main_item_code", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Item Code", + "oldfieldname": "main_item_code", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "rm_item_code", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Raw Material Item Code", + "oldfieldname": "rm_item_code", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "description", + "fieldtype": "Text", + "in_list_view": 1, + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Data", + "permlevel": 0, + "print_width": "300px", + "read_only": 1, + "width": "300px" + }, + { + "fieldname": "col_break1", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "required_qty", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Required Qty", + "oldfieldname": "required_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "consumed_qty", + "fieldtype": "Float", + "label": "Consumed Qty", + "oldfieldname": "consumed_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "stock_uom", + "fieldtype": "Link", + "label": "Stock Uom", + "oldfieldname": "stock_uom", + "oldfieldtype": "Data", + "options": "UOM", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "rate", + "fieldtype": "Currency", + "label": "Rate", + "oldfieldname": "rate", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "amount", + "fieldtype": "Currency", + "label": "Amount", + "oldfieldname": "amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "conversion_factor", + "fieldtype": "Float", + "hidden": 1, + "label": "Conversion Factor", + "oldfieldname": "conversion_factor", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "current_stock", + "fieldtype": "Float", + "hidden": 1, + "label": "Current Stock", + "oldfieldname": "current_stock", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "reference_name", + "fieldtype": "Data", + "hidden": 1, + "in_filter": 0, + "in_list_view": 1, + "label": "Reference Name", + "oldfieldname": "reference_name", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1, + "search_index": 0 + }, + { + "fieldname": "bom_detail_no", + "fieldtype": "Data", + "hidden": 1, + "in_list_view": 1, + "label": "BOM Detail No", + "oldfieldname": "bom_detail_no", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1 + } + ], + "hide_toolbar": 0, + "idx": 1, + "istable": 1, + "modified": "2014-02-13 11:29:35", + "modified_by": "Administrator", + "module": "Buying", + "name": "Purchase Receipt Item Supplied", + "owner": "wasim@webnotestech.com" +} \ No newline at end of file diff --git a/erpnext/buying/doctype/quality_inspection/quality_inspection.txt b/erpnext/buying/doctype/quality_inspection/quality_inspection.txt index 899d3f863d..a3e68aef97 100644 --- a/erpnext/buying/doctype/quality_inspection/quality_inspection.txt +++ b/erpnext/buying/doctype/quality_inspection/quality_inspection.txt @@ -1,247 +1,228 @@ -[ - { - "creation": "2013-04-30 13:13:03", - "docstatus": 0, - "modified": "2014-01-20 17:49:14", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "naming_series:", - "doctype": "DocType", - "icon": "icon-search", - "is_submittable": 1, - "module": "Buying", - "name": "__common__", - "search_fields": "item_code, report_date, purchase_receipt_no, delivery_note_no" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Quality Inspection", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Quality Inspection", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Quality Manager", - "submit": 1, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Quality Inspection" - }, - { - "doctype": "DocField", - "fieldname": "qa_inspection", - "fieldtype": "Section Break", - "label": "QA Inspection", - "no_copy": 0, - "oldfieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "naming_series", - "fieldtype": "Select", - "label": "Series", - "no_copy": 1, - "options": "\nQAI/11-12/", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "inspection_type", - "fieldtype": "Select", - "in_filter": 1, - "label": "Inspection Type", - "oldfieldname": "inspection_type", - "oldfieldtype": "Select", - "options": "\nIncoming\nOutgoing\nIn Process", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "report_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Report Date", - "oldfieldname": "report_date", - "oldfieldtype": "Date", - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "item_code", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 1, - "label": "Item Code", - "oldfieldname": "item_code", - "oldfieldtype": "Link", - "options": "Item", - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "sample_size", - "fieldtype": "Float", - "in_filter": 0, - "label": "Sample Size", - "oldfieldname": "sample_size", - "oldfieldtype": "Currency", - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Small Text", - "in_filter": 1, - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Small Text", - "search_index": 0, - "width": "300px" - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "item_serial_no", - "fieldtype": "Link", - "hidden": 0, - "label": "Item Serial No", - "oldfieldname": "item_serial_no", - "oldfieldtype": "Link", - "options": "Serial No", - "print_hide": 0 - }, - { - "doctype": "DocField", - "fieldname": "batch_no", - "fieldtype": "Link", - "label": "Batch No", - "oldfieldname": "batch_no", - "oldfieldtype": "Link", - "options": "Batch" - }, - { - "doctype": "DocField", - "fieldname": "purchase_receipt_no", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 1, - "label": "Purchase Receipt No", - "oldfieldname": "purchase_receipt_no", - "oldfieldtype": "Link", - "options": "Purchase Receipt", - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "delivery_note_no", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 1, - "label": "Delivery Note No", - "oldfieldname": "delivery_note_no", - "oldfieldtype": "Link", - "options": "Delivery Note", - "print_hide": 0, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "inspected_by", - "fieldtype": "Data", - "label": "Inspected By", - "oldfieldname": "inspected_by", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "remarks", - "fieldtype": "Text", - "label": "Remarks", - "no_copy": 1, - "oldfieldname": "remarks", - "oldfieldtype": "Text" - }, - { - "doctype": "DocField", - "fieldname": "verified_by", - "fieldtype": "Data", - "label": "Verified By", - "oldfieldname": "verified_by", - "oldfieldtype": "Data" - }, - { - "doctype": "DocField", - "fieldname": "amended_from", - "fieldtype": "Data", - "ignore_restrictions": 1, - "label": "Amended From", - "no_copy": 1, - "oldfieldname": "amended_from", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "specification_details", - "fieldtype": "Section Break", - "label": "Specification Details", - "oldfieldtype": "Section Break", - "options": "Simple" - }, - { - "doctype": "DocField", - "fieldname": "get_specification_details", - "fieldtype": "Button", - "label": "Get Specification Details", - "options": "get_item_specification_details" - }, - { - "doctype": "DocField", - "fieldname": "qa_specification_details", - "fieldtype": "Table", - "label": "Quality Inspection Readings", - "oldfieldname": "qa_specification_details", - "oldfieldtype": "Table", - "options": "Quality Inspection Reading" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "autoname": "naming_series:", + "creation": "2013-04-30 13:13:03", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "qa_inspection", + "fieldtype": "Section Break", + "label": "QA Inspection", + "no_copy": 0, + "oldfieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "naming_series", + "fieldtype": "Select", + "label": "Series", + "no_copy": 1, + "options": "\nQAI/11-12/", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "inspection_type", + "fieldtype": "Select", + "in_filter": 1, + "label": "Inspection Type", + "oldfieldname": "inspection_type", + "oldfieldtype": "Select", + "options": "\nIncoming\nOutgoing\nIn Process", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "report_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Report Date", + "oldfieldname": "report_date", + "oldfieldtype": "Date", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "item_code", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 1, + "label": "Item Code", + "oldfieldname": "item_code", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "sample_size", + "fieldtype": "Float", + "in_filter": 0, + "label": "Sample Size", + "oldfieldname": "sample_size", + "oldfieldtype": "Currency", + "permlevel": 0, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "description", + "fieldtype": "Small Text", + "in_filter": 1, + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Small Text", + "permlevel": 0, + "search_index": 0, + "width": "300px" + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "item_serial_no", + "fieldtype": "Link", + "hidden": 0, + "label": "Item Serial No", + "oldfieldname": "item_serial_no", + "oldfieldtype": "Link", + "options": "Serial No", + "permlevel": 0, + "print_hide": 0 + }, + { + "fieldname": "batch_no", + "fieldtype": "Link", + "label": "Batch No", + "oldfieldname": "batch_no", + "oldfieldtype": "Link", + "options": "Batch", + "permlevel": 0 + }, + { + "fieldname": "purchase_receipt_no", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 1, + "label": "Purchase Receipt No", + "oldfieldname": "purchase_receipt_no", + "oldfieldtype": "Link", + "options": "Purchase Receipt", + "permlevel": 0, + "search_index": 1 + }, + { + "fieldname": "delivery_note_no", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 1, + "label": "Delivery Note No", + "oldfieldname": "delivery_note_no", + "oldfieldtype": "Link", + "options": "Delivery Note", + "permlevel": 0, + "print_hide": 0, + "search_index": 1 + }, + { + "fieldname": "inspected_by", + "fieldtype": "Data", + "label": "Inspected By", + "oldfieldname": "inspected_by", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "remarks", + "fieldtype": "Text", + "label": "Remarks", + "no_copy": 1, + "oldfieldname": "remarks", + "oldfieldtype": "Text", + "permlevel": 0 + }, + { + "fieldname": "verified_by", + "fieldtype": "Data", + "label": "Verified By", + "oldfieldname": "verified_by", + "oldfieldtype": "Data", + "permlevel": 0 + }, + { + "fieldname": "amended_from", + "fieldtype": "Data", + "ignore_restrictions": 1, + "label": "Amended From", + "no_copy": 1, + "oldfieldname": "amended_from", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "specification_details", + "fieldtype": "Section Break", + "label": "Specification Details", + "oldfieldtype": "Section Break", + "options": "Simple", + "permlevel": 0 + }, + { + "fieldname": "get_specification_details", + "fieldtype": "Button", + "label": "Get Specification Details", + "options": "get_item_specification_details", + "permlevel": 0 + }, + { + "fieldname": "qa_specification_details", + "fieldtype": "Table", + "label": "Quality Inspection Readings", + "oldfieldname": "qa_specification_details", + "oldfieldtype": "Table", + "options": "Quality Inspection Reading", + "permlevel": 0 + } + ], + "icon": "icon-search", + "idx": 1, + "is_submittable": 1, + "modified": "2014-01-20 17:49:14", + "modified_by": "Administrator", + "module": "Buying", + "name": "Quality Inspection", + "owner": "Administrator", + "permissions": [ + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Quality Manager", + "submit": 1, + "write": 1 + } + ], + "search_fields": "item_code, report_date, purchase_receipt_no, delivery_note_no" +} \ No newline at end of file diff --git a/erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.txt b/erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.txt index f08e7cd5d2..2ca4d92a86 100644 --- a/erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.txt +++ b/erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.txt @@ -1,141 +1,128 @@ -[ - { - "creation": "2013-02-22 01:27:43", - "docstatus": 0, - "modified": "2013-12-20 19:23:39", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "QASD/.#####", - "doctype": "DocType", - "istable": 1, - "module": "Buying", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Quality Inspection Reading", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Quality Inspection Reading" - }, - { - "doctype": "DocField", - "fieldname": "specification", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Parameter", - "oldfieldname": "specification", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "value", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Acceptance Criteria", - "oldfieldname": "value", - "oldfieldtype": "Data" - }, - { - "doctype": "DocField", - "fieldname": "reading_1", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Reading 1", - "oldfieldname": "reading_1", - "oldfieldtype": "Data" - }, - { - "doctype": "DocField", - "fieldname": "reading_2", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Reading 2", - "oldfieldname": "reading_2", - "oldfieldtype": "Data" - }, - { - "doctype": "DocField", - "fieldname": "reading_3", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Reading 3", - "oldfieldname": "reading_3", - "oldfieldtype": "Data" - }, - { - "doctype": "DocField", - "fieldname": "reading_4", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Reading 4", - "oldfieldname": "reading_4", - "oldfieldtype": "Data" - }, - { - "doctype": "DocField", - "fieldname": "reading_5", - "fieldtype": "Data", - "label": "Reading 5", - "oldfieldname": "reading_5", - "oldfieldtype": "Data" - }, - { - "doctype": "DocField", - "fieldname": "reading_6", - "fieldtype": "Data", - "label": "Reading 6", - "oldfieldname": "reading_6", - "oldfieldtype": "Data" - }, - { - "doctype": "DocField", - "fieldname": "reading_7", - "fieldtype": "Data", - "label": "Reading 7", - "oldfieldname": "reading_7", - "oldfieldtype": "Data" - }, - { - "doctype": "DocField", - "fieldname": "reading_8", - "fieldtype": "Data", - "label": "Reading 8", - "oldfieldname": "reading_8", - "oldfieldtype": "Data" - }, - { - "doctype": "DocField", - "fieldname": "reading_9", - "fieldtype": "Data", - "label": "Reading 9", - "oldfieldname": "reading_9", - "oldfieldtype": "Data" - }, - { - "doctype": "DocField", - "fieldname": "reading_10", - "fieldtype": "Data", - "label": "Reading 10", - "oldfieldname": "reading_10", - "oldfieldtype": "Data" - }, - { - "default": "Accepted", - "doctype": "DocField", - "fieldname": "status", - "fieldtype": "Select", - "label": "Status", - "oldfieldname": "status", - "oldfieldtype": "Select", - "options": "Accepted\nRejected" - } -] \ No newline at end of file +{ + "autoname": "QASD/.#####", + "creation": "2013-02-22 01:27:43", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "specification", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Parameter", + "oldfieldname": "specification", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "value", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Acceptance Criteria", + "oldfieldname": "value", + "oldfieldtype": "Data", + "permlevel": 0 + }, + { + "fieldname": "reading_1", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Reading 1", + "oldfieldname": "reading_1", + "oldfieldtype": "Data", + "permlevel": 0 + }, + { + "fieldname": "reading_2", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Reading 2", + "oldfieldname": "reading_2", + "oldfieldtype": "Data", + "permlevel": 0 + }, + { + "fieldname": "reading_3", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Reading 3", + "oldfieldname": "reading_3", + "oldfieldtype": "Data", + "permlevel": 0 + }, + { + "fieldname": "reading_4", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Reading 4", + "oldfieldname": "reading_4", + "oldfieldtype": "Data", + "permlevel": 0 + }, + { + "fieldname": "reading_5", + "fieldtype": "Data", + "label": "Reading 5", + "oldfieldname": "reading_5", + "oldfieldtype": "Data", + "permlevel": 0 + }, + { + "fieldname": "reading_6", + "fieldtype": "Data", + "label": "Reading 6", + "oldfieldname": "reading_6", + "oldfieldtype": "Data", + "permlevel": 0 + }, + { + "fieldname": "reading_7", + "fieldtype": "Data", + "label": "Reading 7", + "oldfieldname": "reading_7", + "oldfieldtype": "Data", + "permlevel": 0 + }, + { + "fieldname": "reading_8", + "fieldtype": "Data", + "label": "Reading 8", + "oldfieldname": "reading_8", + "oldfieldtype": "Data", + "permlevel": 0 + }, + { + "fieldname": "reading_9", + "fieldtype": "Data", + "label": "Reading 9", + "oldfieldname": "reading_9", + "oldfieldtype": "Data", + "permlevel": 0 + }, + { + "fieldname": "reading_10", + "fieldtype": "Data", + "label": "Reading 10", + "oldfieldname": "reading_10", + "oldfieldtype": "Data", + "permlevel": 0 + }, + { + "default": "Accepted", + "fieldname": "status", + "fieldtype": "Select", + "label": "Status", + "oldfieldname": "status", + "oldfieldtype": "Select", + "options": "Accepted\nRejected", + "permlevel": 0 + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:23:39", + "modified_by": "Administrator", + "module": "Buying", + "name": "Quality Inspection Reading", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/buying/doctype/supplier/supplier.txt b/erpnext/buying/doctype/supplier/supplier.txt index a5d100fdd5..f241278006 100644 --- a/erpnext/buying/doctype/supplier/supplier.txt +++ b/erpnext/buying/doctype/supplier/supplier.txt @@ -1,234 +1,222 @@ -[ - { - "creation": "2013-01-10 16:34:11", - "docstatus": 0, - "modified": "2014-01-28 19:05:55", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "allow_rename": 1, - "autoname": "naming_series:", - "description": "Supplier of Goods or Services.", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-user", - "module": "Buying", - "name": "__common__", - "search_fields": "supplier_name,supplier_type" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Supplier", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "amend": 0, - "cancel": 0, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Supplier", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 0 - }, - { - "doctype": "DocType", - "name": "Supplier" - }, - { - "doctype": "DocField", - "fieldname": "basic_info", - "fieldtype": "Section Break", - "label": "Basic Info", - "oldfieldtype": "Section Break", - "options": "icon-user" - }, - { - "doctype": "DocField", - "fieldname": "naming_series", - "fieldtype": "Select", - "label": "Series", - "no_copy": 1, - "oldfieldname": "naming_series", - "oldfieldtype": "Select", - "options": "\nSUPP\nSUPP/10-11/" - }, - { - "doctype": "DocField", - "fieldname": "supplier_name", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Supplier Name", - "no_copy": 1, - "oldfieldname": "supplier_name", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "supplier_type", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Supplier Type", - "oldfieldname": "supplier_type", - "oldfieldtype": "Link", - "options": "Supplier Type", - "reqd": 1 - }, - { - "depends_on": "eval:!doc.__islocal", - "doctype": "DocField", - "fieldname": "address_contacts", - "fieldtype": "Section Break", - "label": "Address & Contacts", - "oldfieldtype": "Column Break", - "options": "icon-map-marker" - }, - { - "doctype": "DocField", - "fieldname": "address_html", - "fieldtype": "HTML", - "label": "Address HTML", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "contact_html", - "fieldtype": "HTML", - "label": "Contact HTML", - "read_only": 1 - }, - { - "depends_on": "eval:!doc.__islocal", - "doctype": "DocField", - "fieldname": "communication_history", - "fieldtype": "Section Break", - "label": "Communication History", - "options": "icon-comments", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "communication_html", - "fieldtype": "HTML", - "label": "Communication HTML", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "more_info", - "fieldtype": "Section Break", - "label": "More Info", - "oldfieldtype": "Section Break", - "options": "icon-file-text" - }, - { - "description": "Enter the company name under which Account Head will be created for this Supplier", - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "in_filter": 1, - "label": "Company", - "oldfieldname": "company", - "oldfieldtype": "Link", - "options": "Company", - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "default_currency", - "fieldtype": "Link", - "label": "Default Currency", - "no_copy": 1, - "options": "Currency" - }, - { - "doctype": "DocField", - "fieldname": "default_price_list", - "fieldtype": "Link", - "label": "Price List", - "options": "Price List" - }, - { - "doctype": "DocField", - "fieldname": "default_taxes_and_charges", - "fieldtype": "Link", - "label": "Taxes and Charges", - "options": "Purchase Taxes and Charges Master" - }, - { - "doctype": "DocField", - "fieldname": "credit_days", - "fieldtype": "Int", - "label": "Credit Days" - }, - { - "doctype": "DocField", - "fieldname": "column_break2", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "website", - "fieldtype": "Data", - "label": "Website", - "oldfieldname": "website", - "oldfieldtype": "Data" - }, - { - "description": "Statutory info and other general information about your Supplier", - "doctype": "DocField", - "fieldname": "supplier_details", - "fieldtype": "Text", - "label": "Supplier Details", - "oldfieldname": "supplier_details", - "oldfieldtype": "Code" - }, - { - "doctype": "DocField", - "fieldname": "communications", - "fieldtype": "Table", - "hidden": 1, - "label": "Communications", - "options": "Communication", - "print_hide": 1 - }, - { - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Purchase Manager", - "write": 0 - }, - { - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Purchase Master Manager", - "write": 1 - } -] \ No newline at end of file +{ + "allow_import": 1, + "allow_rename": 1, + "autoname": "naming_series:", + "creation": "2013-01-10 16:34:11", + "description": "Supplier of Goods or Services.", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "basic_info", + "fieldtype": "Section Break", + "label": "Basic Info", + "oldfieldtype": "Section Break", + "options": "icon-user", + "permlevel": 0 + }, + { + "fieldname": "naming_series", + "fieldtype": "Select", + "label": "Series", + "no_copy": 1, + "oldfieldname": "naming_series", + "oldfieldtype": "Select", + "options": "\nSUPP\nSUPP/10-11/", + "permlevel": 0 + }, + { + "fieldname": "supplier_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Supplier Name", + "no_copy": 1, + "oldfieldname": "supplier_name", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "supplier_type", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Supplier Type", + "oldfieldname": "supplier_type", + "oldfieldtype": "Link", + "options": "Supplier Type", + "permlevel": 0, + "reqd": 1 + }, + { + "depends_on": "eval:!doc.__islocal", + "fieldname": "address_contacts", + "fieldtype": "Section Break", + "label": "Address & Contacts", + "oldfieldtype": "Column Break", + "options": "icon-map-marker", + "permlevel": 0 + }, + { + "fieldname": "address_html", + "fieldtype": "HTML", + "label": "Address HTML", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "contact_html", + "fieldtype": "HTML", + "label": "Contact HTML", + "permlevel": 0, + "read_only": 1 + }, + { + "depends_on": "eval:!doc.__islocal", + "fieldname": "communication_history", + "fieldtype": "Section Break", + "label": "Communication History", + "options": "icon-comments", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "communication_html", + "fieldtype": "HTML", + "label": "Communication HTML", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "more_info", + "fieldtype": "Section Break", + "label": "More Info", + "oldfieldtype": "Section Break", + "options": "icon-file-text", + "permlevel": 0 + }, + { + "description": "Enter the company name under which Account Head will be created for this Supplier", + "fieldname": "company", + "fieldtype": "Link", + "in_filter": 1, + "label": "Company", + "oldfieldname": "company", + "oldfieldtype": "Link", + "options": "Company", + "permlevel": 0, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "default_currency", + "fieldtype": "Link", + "label": "Default Currency", + "no_copy": 1, + "options": "Currency", + "permlevel": 0 + }, + { + "fieldname": "default_price_list", + "fieldtype": "Link", + "label": "Price List", + "options": "Price List", + "permlevel": 0 + }, + { + "fieldname": "default_taxes_and_charges", + "fieldtype": "Link", + "label": "Taxes and Charges", + "options": "Purchase Taxes and Charges Master", + "permlevel": 0 + }, + { + "fieldname": "credit_days", + "fieldtype": "Int", + "label": "Credit Days", + "permlevel": 0 + }, + { + "fieldname": "column_break2", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "website", + "fieldtype": "Data", + "label": "Website", + "oldfieldname": "website", + "oldfieldtype": "Data", + "permlevel": 0 + }, + { + "description": "Statutory info and other general information about your Supplier", + "fieldname": "supplier_details", + "fieldtype": "Text", + "label": "Supplier Details", + "oldfieldname": "supplier_details", + "oldfieldtype": "Code", + "permlevel": 0 + }, + { + "fieldname": "communications", + "fieldtype": "Table", + "hidden": 1, + "label": "Communications", + "options": "Communication", + "permlevel": 0, + "print_hide": 1 + } + ], + "icon": "icon-user", + "idx": 1, + "modified": "2014-01-28 19:05:55", + "modified_by": "Administrator", + "module": "Buying", + "name": "Supplier", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase Manager", + "submit": 0, + "write": 0 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase Master Manager", + "submit": 0, + "write": 1 + } + ], + "search_fields": "supplier_name,supplier_type" +} \ No newline at end of file diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.txt b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.txt index 0a4a3ec663..d59283bcec 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.txt +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.txt @@ -1,647 +1,644 @@ -[ - { - "creation": "2013-05-21 16:16:45", - "docstatus": 0, - "modified": "2014-01-29 15:25:52", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_attach": 1, - "allow_import": 1, - "autoname": "naming_series:", - "doctype": "DocType", - "document_type": "Transaction", - "icon": "icon-shopping-cart", - "is_submittable": 1, - "module": "Buying", - "name": "__common__", - "read_only_onload": 1, - "search_fields": "status, transaction_date, supplier,grand_total" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Supplier Quotation", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Supplier Quotation", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1 - }, - { - "doctype": "DocType", - "name": "Supplier Quotation" - }, - { - "doctype": "DocField", - "fieldname": "supplier_section", - "fieldtype": "Section Break", - "label": "Supplier", - "options": "icon-user" - }, - { - "doctype": "DocField", - "fieldname": "naming_series", - "fieldtype": "Select", - "label": "Series", - "no_copy": 1, - "oldfieldname": "naming_series", - "oldfieldtype": "Select", - "options": "SQTN", - "print_hide": 1, - "reqd": 1 - }, - { - "description": "Supplier (vendor) name as entered in supplier master", - "doctype": "DocField", - "fieldname": "supplier", - "fieldtype": "Link", - "in_filter": 1, - "label": "Supplier", - "oldfieldname": "supplier", - "oldfieldtype": "Link", - "options": "Supplier", - "print_hide": 1, - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "supplier_name", - "fieldtype": "Data", - "hidden": 0, - "in_list_view": 1, - "label": "Name", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "address_display", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Address", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "contact_display", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Contact", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "contact_mobile", - "fieldtype": "Text", - "hidden": 1, - "label": "Mobile No", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "contact_email", - "fieldtype": "Text", - "hidden": 1, - "label": "Contact Email", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "print_hide": 0, - "print_width": "50%", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "transaction_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Quotation Date", - "oldfieldname": "transaction_date", - "oldfieldtype": "Date", - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "amended_from", - "fieldtype": "Data", - "hidden": 1, - "ignore_restrictions": 1, - "label": "Amended From", - "no_copy": 1, - "oldfieldname": "amended_from", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 1, - "report_hide": 0 - }, - { - "description": "Select the relevant company name if you have multiple companies", - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "in_filter": 1, - "label": "Company", - "no_copy": 0, - "oldfieldname": "company", - "oldfieldtype": "Link", - "options": "Company", - "print_hide": 1, - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "currency_price_list", - "fieldtype": "Section Break", - "label": "Currency and Price List", - "options": "icon-tag" - }, - { - "doctype": "DocField", - "fieldname": "currency", - "fieldtype": "Link", - "label": "Currency", - "no_copy": 0, - "oldfieldname": "currency", - "oldfieldtype": "Select", - "options": "Currency", - "print_hide": 1, - "reqd": 1 - }, - { - "description": "Rate at which supplier's currency is converted to company's base currency", - "doctype": "DocField", - "fieldname": "conversion_rate", - "fieldtype": "Float", - "hidden": 0, - "label": "Exchange Rate", - "no_copy": 1, - "oldfieldname": "conversion_rate", - "oldfieldtype": "Currency", - "print_hide": 1, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "cb_price_list", - "fieldtype": "Column Break", - "print_width": "50%", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "buying_price_list", - "fieldtype": "Link", - "label": "Price List", - "options": "Price List", - "print_hide": 1 - }, - { - "depends_on": "buying_price_list", - "doctype": "DocField", - "fieldname": "price_list_currency", - "fieldtype": "Link", - "label": "Price List Currency", - "options": "Currency", - "print_hide": 1, - "read_only": 1 - }, - { - "depends_on": "buying_price_list", - "doctype": "DocField", - "fieldname": "plc_conversion_rate", - "fieldtype": "Float", - "label": "Price List Exchange Rate", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "items", - "fieldtype": "Section Break", - "label": "Items", - "oldfieldtype": "Section Break", - "options": "icon-shopping-cart" - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "quotation_items", - "fieldtype": "Table", - "label": "Quotation Items", - "no_copy": 0, - "oldfieldname": "po_details", - "oldfieldtype": "Table", - "options": "Supplier Quotation Item" - }, - { - "doctype": "DocField", - "fieldname": "section_break_22", - "fieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "net_total_import", - "fieldtype": "Currency", - "label": "Net Total", - "no_copy": 0, - "oldfieldname": "net_total_import", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 0, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break_24", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "net_total", - "fieldtype": "Currency", - "label": "Net Total (Company Currency)", - "no_copy": 1, - "oldfieldname": "net_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1, - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "taxes", - "fieldtype": "Section Break", - "label": "Taxes and Charges", - "oldfieldtype": "Section Break", - "options": "icon-money" - }, - { - "description": "If you have created a standard template in Purchase Taxes and Charges Master, select one and click on the button below.", - "doctype": "DocField", - "fieldname": "taxes_and_charges", - "fieldtype": "Link", - "label": "Taxes and Charges", - "no_copy": 1, - "oldfieldname": "purchase_other_charges", - "oldfieldtype": "Link", - "options": "Purchase Taxes and Charges Master", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "other_charges", - "fieldtype": "Table", - "label": "Purchase Taxes and Charges", - "no_copy": 0, - "oldfieldname": "purchase_tax_details", - "oldfieldtype": "Table", - "options": "Purchase Taxes and Charges" - }, - { - "doctype": "DocField", - "fieldname": "other_charges_calculation", - "fieldtype": "HTML", - "label": "Taxes and Charges Calculation", - "no_copy": 1, - "oldfieldtype": "HTML", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "totals", - "fieldtype": "Section Break", - "label": "Totals", - "oldfieldtype": "Section Break", - "options": "icon-money" - }, - { - "doctype": "DocField", - "fieldname": "other_charges_added_import", - "fieldtype": "Currency", - "label": "Taxes and Charges Added", - "no_copy": 0, - "oldfieldname": "other_charges_added_import", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 1, - "read_only": 1, - "report_hide": 0 - }, - { - "doctype": "DocField", - "fieldname": "other_charges_deducted_import", - "fieldtype": "Currency", - "label": "Taxes and Charges Deducted", - "no_copy": 0, - "oldfieldname": "other_charges_deducted_import", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 1, - "read_only": 1, - "report_hide": 0 - }, - { - "doctype": "DocField", - "fieldname": "grand_total_import", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Grand Total", - "no_copy": 0, - "oldfieldname": "grand_total_import", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 0, - "read_only": 1, - "report_hide": 0 - }, - { - "doctype": "DocField", - "fieldname": "in_words_import", - "fieldtype": "Data", - "label": "In Words", - "oldfieldname": "in_words_import", - "oldfieldtype": "Data", - "print_hide": 0, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break4", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "print_hide": 0 - }, - { - "doctype": "DocField", - "fieldname": "other_charges_added", - "fieldtype": "Currency", - "label": "Taxes and Charges Added (Company Currency)", - "no_copy": 0, - "oldfieldname": "other_charges_added", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "other_charges_deducted", - "fieldtype": "Currency", - "label": "Taxes and Charges Deducted (Company Currency)", - "no_copy": 0, - "oldfieldname": "other_charges_deducted", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "total_tax", - "fieldtype": "Currency", - "label": "Total Tax (Company Currency)", - "no_copy": 1, - "oldfieldname": "total_tax", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "grand_total", - "fieldtype": "Currency", - "label": "Grand Total (Company Currency)", - "no_copy": 1, - "oldfieldname": "grand_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "rounded_total", - "fieldtype": "Currency", - "label": "Rounded Total (Company Currency)", - "oldfieldname": "rounded_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "description": "In Words will be visible once you save the Purchase Order.", - "doctype": "DocField", - "fieldname": "in_words", - "fieldtype": "Data", - "label": "In Words (Company Currency)", - "oldfieldname": "in_words", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "terms_section_break", - "fieldtype": "Section Break", - "label": "Terms and Conditions", - "oldfieldtype": "Section Break", - "options": "icon-legal" - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "letter_head", - "fieldtype": "Select", - "label": "Letter Head", - "oldfieldname": "letter_head", - "oldfieldtype": "Select", - "options": "link:Letter Head", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "tc_name", - "fieldtype": "Link", - "label": "Terms", - "oldfieldname": "tc_name", - "oldfieldtype": "Link", - "options": "Terms and Conditions", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "get_terms", - "fieldtype": "Button", - "label": "Get Terms and Conditions", - "oldfieldtype": "Button" - }, - { - "doctype": "DocField", - "fieldname": "terms", - "fieldtype": "Text Editor", - "label": "Terms and Conditions", - "oldfieldname": "terms", - "oldfieldtype": "Text Editor" - }, - { - "depends_on": "supplier", - "doctype": "DocField", - "fieldname": "contact_section", - "fieldtype": "Section Break", - "label": "Contact Info", - "options": "icon-bullhorn" - }, - { - "doctype": "DocField", - "fieldname": "supplier_address", - "fieldtype": "Link", - "in_filter": 1, - "label": "Supplier Address", - "options": "Address", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "contact_person", - "fieldtype": "Link", - "in_filter": 1, - "label": "Contact Person", - "options": "Contact", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "more_info", - "fieldtype": "Section Break", - "label": "More Info", - "oldfieldtype": "Section Break", - "options": "icon-file-text" - }, - { - "doctype": "DocField", - "fieldname": "status", - "fieldtype": "Select", - "in_filter": 1, - "label": "Status", - "no_copy": 1, - "oldfieldname": "status", - "oldfieldtype": "Select", - "options": "\nDraft\nSubmitted\nStopped\nCancelled", - "print_hide": 1, - "read_only": 1, - "reqd": 1, - "search_index": 1 - }, - { - "default": "No", - "doctype": "DocField", - "fieldname": "is_subcontracted", - "fieldtype": "Select", - "label": "Is Subcontracted", - "options": "\nYes\nNo", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break_57", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "fiscal_year", - "fieldtype": "Select", - "in_filter": 1, - "label": "Fiscal Year", - "no_copy": 0, - "oldfieldname": "fiscal_year", - "oldfieldtype": "Select", - "options": "link:Fiscal Year", - "print_hide": 1, - "reqd": 1, - "search_index": 1 - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "select_print_heading", - "fieldtype": "Link", - "label": "Print Heading", - "no_copy": 1, - "oldfieldname": "select_print_heading", - "oldfieldtype": "Link", - "options": "Print Heading", - "print_hide": 1, - "report_hide": 1 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Manufacturing Manager", - "submit": 1, - "write": 1 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Purchase Manager", - "submit": 1, - "write": 1 - }, - { - "amend": 1, - "cancel": 0, - "create": 1, - "delete": 0, - "doctype": "DocPerm", - "role": "Purchase User", - "submit": 0, - "write": 1 - }, - { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Material User", - "submit": 0, - "write": 0 - }, - { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Supplier", - "submit": 0, - "write": 0 - } -] \ No newline at end of file +{ + "allow_attach": 1, + "allow_import": 1, + "autoname": "naming_series:", + "creation": "2013-05-21 16:16:45", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Transaction", + "fields": [ + { + "fieldname": "supplier_section", + "fieldtype": "Section Break", + "label": "Supplier", + "options": "icon-user", + "permlevel": 0 + }, + { + "fieldname": "naming_series", + "fieldtype": "Select", + "label": "Series", + "no_copy": 1, + "oldfieldname": "naming_series", + "oldfieldtype": "Select", + "options": "SQTN", + "permlevel": 0, + "print_hide": 1, + "reqd": 1 + }, + { + "description": "Supplier (vendor) name as entered in supplier master", + "fieldname": "supplier", + "fieldtype": "Link", + "in_filter": 1, + "label": "Supplier", + "oldfieldname": "supplier", + "oldfieldtype": "Link", + "options": "Supplier", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "supplier_name", + "fieldtype": "Data", + "hidden": 0, + "in_list_view": 1, + "label": "Name", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "address_display", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Address", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "contact_display", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Contact", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "contact_mobile", + "fieldtype": "Text", + "hidden": 1, + "label": "Mobile No", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "contact_email", + "fieldtype": "Text", + "hidden": 1, + "label": "Contact Email", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 0, + "print_width": "50%", + "width": "50%" + }, + { + "fieldname": "transaction_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Quotation Date", + "oldfieldname": "transaction_date", + "oldfieldtype": "Date", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "amended_from", + "fieldtype": "Data", + "hidden": 1, + "ignore_restrictions": 1, + "label": "Amended From", + "no_copy": 1, + "oldfieldname": "amended_from", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "report_hide": 0 + }, + { + "description": "Select the relevant company name if you have multiple companies", + "fieldname": "company", + "fieldtype": "Link", + "in_filter": 1, + "label": "Company", + "no_copy": 0, + "oldfieldname": "company", + "oldfieldtype": "Link", + "options": "Company", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "currency_price_list", + "fieldtype": "Section Break", + "label": "Currency and Price List", + "options": "icon-tag", + "permlevel": 0 + }, + { + "fieldname": "currency", + "fieldtype": "Link", + "label": "Currency", + "no_copy": 0, + "oldfieldname": "currency", + "oldfieldtype": "Select", + "options": "Currency", + "permlevel": 0, + "print_hide": 1, + "reqd": 1 + }, + { + "description": "Rate at which supplier's currency is converted to company's base currency", + "fieldname": "conversion_rate", + "fieldtype": "Float", + "hidden": 0, + "label": "Exchange Rate", + "no_copy": 1, + "oldfieldname": "conversion_rate", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "reqd": 1 + }, + { + "fieldname": "cb_price_list", + "fieldtype": "Column Break", + "permlevel": 0, + "print_width": "50%", + "width": "50%" + }, + { + "fieldname": "buying_price_list", + "fieldtype": "Link", + "label": "Price List", + "options": "Price List", + "permlevel": 0, + "print_hide": 1 + }, + { + "depends_on": "buying_price_list", + "fieldname": "price_list_currency", + "fieldtype": "Link", + "label": "Price List Currency", + "options": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "depends_on": "buying_price_list", + "fieldname": "plc_conversion_rate", + "fieldtype": "Float", + "label": "Price List Exchange Rate", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "items", + "fieldtype": "Section Break", + "label": "Items", + "oldfieldtype": "Section Break", + "options": "icon-shopping-cart", + "permlevel": 0 + }, + { + "allow_on_submit": 1, + "fieldname": "quotation_items", + "fieldtype": "Table", + "label": "Quotation Items", + "no_copy": 0, + "oldfieldname": "po_details", + "oldfieldtype": "Table", + "options": "Supplier Quotation Item", + "permlevel": 0 + }, + { + "fieldname": "section_break_22", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "net_total_import", + "fieldtype": "Currency", + "label": "Net Total", + "no_copy": 0, + "oldfieldname": "net_total_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 1 + }, + { + "fieldname": "column_break_24", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "net_total", + "fieldtype": "Currency", + "label": "Net Total (Company Currency)", + "no_copy": 1, + "oldfieldname": "net_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 0 + }, + { + "fieldname": "taxes", + "fieldtype": "Section Break", + "label": "Taxes and Charges", + "oldfieldtype": "Section Break", + "options": "icon-money", + "permlevel": 0 + }, + { + "description": "If you have created a standard template in Purchase Taxes and Charges Master, select one and click on the button below.", + "fieldname": "taxes_and_charges", + "fieldtype": "Link", + "label": "Taxes and Charges", + "no_copy": 1, + "oldfieldname": "purchase_other_charges", + "oldfieldtype": "Link", + "options": "Purchase Taxes and Charges Master", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "other_charges", + "fieldtype": "Table", + "label": "Purchase Taxes and Charges", + "no_copy": 0, + "oldfieldname": "purchase_tax_details", + "oldfieldtype": "Table", + "options": "Purchase Taxes and Charges", + "permlevel": 0 + }, + { + "fieldname": "other_charges_calculation", + "fieldtype": "HTML", + "label": "Taxes and Charges Calculation", + "no_copy": 1, + "oldfieldtype": "HTML", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "totals", + "fieldtype": "Section Break", + "label": "Totals", + "oldfieldtype": "Section Break", + "options": "icon-money", + "permlevel": 0 + }, + { + "fieldname": "other_charges_added_import", + "fieldtype": "Currency", + "label": "Taxes and Charges Added", + "no_copy": 0, + "oldfieldname": "other_charges_added_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "report_hide": 0 + }, + { + "fieldname": "other_charges_deducted_import", + "fieldtype": "Currency", + "label": "Taxes and Charges Deducted", + "no_copy": 0, + "oldfieldname": "other_charges_deducted_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "report_hide": 0 + }, + { + "fieldname": "grand_total_import", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Grand Total", + "no_copy": 0, + "oldfieldname": "grand_total_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 1, + "report_hide": 0 + }, + { + "fieldname": "in_words_import", + "fieldtype": "Data", + "label": "In Words", + "oldfieldname": "in_words_import", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 0, + "read_only": 1 + }, + { + "fieldname": "column_break4", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 0 + }, + { + "fieldname": "other_charges_added", + "fieldtype": "Currency", + "label": "Taxes and Charges Added (Company Currency)", + "no_copy": 0, + "oldfieldname": "other_charges_added", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "other_charges_deducted", + "fieldtype": "Currency", + "label": "Taxes and Charges Deducted (Company Currency)", + "no_copy": 0, + "oldfieldname": "other_charges_deducted", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "total_tax", + "fieldtype": "Currency", + "label": "Total Tax (Company Currency)", + "no_copy": 1, + "oldfieldname": "total_tax", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "grand_total", + "fieldtype": "Currency", + "label": "Grand Total (Company Currency)", + "no_copy": 1, + "oldfieldname": "grand_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "rounded_total", + "fieldtype": "Currency", + "label": "Rounded Total (Company Currency)", + "oldfieldname": "rounded_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "description": "In Words will be visible once you save the Purchase Order.", + "fieldname": "in_words", + "fieldtype": "Data", + "label": "In Words (Company Currency)", + "oldfieldname": "in_words", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "terms_section_break", + "fieldtype": "Section Break", + "label": "Terms and Conditions", + "oldfieldtype": "Section Break", + "options": "icon-legal", + "permlevel": 0 + }, + { + "allow_on_submit": 1, + "fieldname": "letter_head", + "fieldtype": "Select", + "label": "Letter Head", + "oldfieldname": "letter_head", + "oldfieldtype": "Select", + "options": "link:Letter Head", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "tc_name", + "fieldtype": "Link", + "label": "Terms", + "oldfieldname": "tc_name", + "oldfieldtype": "Link", + "options": "Terms and Conditions", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "get_terms", + "fieldtype": "Button", + "label": "Get Terms and Conditions", + "oldfieldtype": "Button", + "permlevel": 0 + }, + { + "fieldname": "terms", + "fieldtype": "Text Editor", + "label": "Terms and Conditions", + "oldfieldname": "terms", + "oldfieldtype": "Text Editor", + "permlevel": 0 + }, + { + "depends_on": "supplier", + "fieldname": "contact_section", + "fieldtype": "Section Break", + "label": "Contact Info", + "options": "icon-bullhorn", + "permlevel": 0 + }, + { + "fieldname": "supplier_address", + "fieldtype": "Link", + "in_filter": 1, + "label": "Supplier Address", + "options": "Address", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "contact_person", + "fieldtype": "Link", + "in_filter": 1, + "label": "Contact Person", + "options": "Contact", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "more_info", + "fieldtype": "Section Break", + "label": "More Info", + "oldfieldtype": "Section Break", + "options": "icon-file-text", + "permlevel": 0 + }, + { + "fieldname": "status", + "fieldtype": "Select", + "in_filter": 1, + "label": "Status", + "no_copy": 1, + "oldfieldname": "status", + "oldfieldtype": "Select", + "options": "\nDraft\nSubmitted\nStopped\nCancelled", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 1, + "search_index": 1 + }, + { + "default": "No", + "fieldname": "is_subcontracted", + "fieldtype": "Select", + "label": "Is Subcontracted", + "options": "\nYes\nNo", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "column_break_57", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Select", + "in_filter": 1, + "label": "Fiscal Year", + "no_copy": 0, + "oldfieldname": "fiscal_year", + "oldfieldtype": "Select", + "options": "link:Fiscal Year", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, + "search_index": 1 + }, + { + "allow_on_submit": 1, + "fieldname": "select_print_heading", + "fieldtype": "Link", + "label": "Print Heading", + "no_copy": 1, + "oldfieldname": "select_print_heading", + "oldfieldtype": "Link", + "options": "Print Heading", + "permlevel": 0, + "print_hide": 1, + "report_hide": 1 + } + ], + "icon": "icon-shopping-cart", + "idx": 1, + "is_submittable": 1, + "modified": "2014-01-29 15:25:52", + "modified_by": "Administrator", + "module": "Buying", + "name": "Supplier Quotation", + "owner": "Administrator", + "permissions": [ + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Manufacturing Manager", + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase Manager", + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "cancel": 0, + "create": 1, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase User", + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material User", + "submit": 0, + "write": 0 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Supplier", + "submit": 0, + "write": 0 + } + ], + "read_only_onload": 1, + "search_fields": "status, transaction_date, supplier,grand_total" +} \ No newline at end of file diff --git a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt index 18b9216daf..8ede81d6b3 100644 --- a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt +++ b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt @@ -1,375 +1,362 @@ -[ - { - "creation": "2013-05-22 12:43:10", - "docstatus": 0, - "modified": "2014-02-28 11:25:38", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "SQI-.#####", - "doctype": "DocType", - "istable": 1, - "module": "Buying", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Supplier Quotation Item", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Supplier Quotation Item" - }, - { - "doctype": "DocField", - "fieldname": "item_code", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "Item Code", - "oldfieldname": "item_code", - "oldfieldtype": "Link", - "options": "Item", - "print_hide": 0, - "read_only": 0, - "reqd": 1, - "search_index": 1 - }, - { - "description": "If Supplier Part Number exists for given Item, it gets stored here", - "doctype": "DocField", - "fieldname": "supplier_part_no", - "fieldtype": "Data", - "hidden": 1, - "in_list_view": 0, - "label": "Supplier Part Number", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "item_name", - "fieldtype": "Data", - "hidden": 0, - "in_filter": 1, - "in_list_view": 0, - "label": "Item Name", - "oldfieldname": "item_name", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 0, - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "col_break1", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Small Text", - "in_list_view": 1, - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Small Text", - "print_width": "300px", - "read_only": 0, - "reqd": 1, - "width": "300px" - }, - { - "doctype": "DocField", - "fieldname": "quantity_and_rate", - "fieldtype": "Section Break", - "in_list_view": 0, - "label": "Quantity and Rate" - }, - { - "doctype": "DocField", - "fieldname": "qty", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Quantity", - "oldfieldname": "qty", - "oldfieldtype": "Currency", - "print_width": "60px", - "read_only": 0, - "reqd": 1, - "width": "60px" - }, - { - "doctype": "DocField", - "fieldname": "price_list_rate", - "fieldtype": "Currency", - "in_list_view": 0, - "label": "Price List Rate", - "options": "currency", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "discount_percentage", - "fieldtype": "Float", - "in_list_view": 0, - "label": "Discount %", - "print_hide": 0, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "col_break2", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "uom", - "fieldtype": "Link", - "in_list_view": 0, - "label": "UOM", - "oldfieldname": "uom", - "oldfieldtype": "Link", - "options": "UOM", - "print_hide": 0, - "print_width": "100px", - "read_only": 0, - "reqd": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "base_price_list_rate", - "fieldtype": "Currency", - "in_list_view": 0, - "label": "Price List Rate (Company Currency)", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "sec_break1", - "fieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "rate", - "fieldtype": "Currency", - "hidden": 0, - "in_list_view": 1, - "label": "Rate ", - "oldfieldname": "import_rate", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 0, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "amount", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Amount", - "oldfieldname": "import_amount", - "oldfieldtype": "Currency", - "options": "currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "col_break3", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "base_rate", - "fieldtype": "Currency", - "in_list_view": 0, - "label": "Rate (Company Currency)", - "oldfieldname": "purchase_rate", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "print_width": "100px", - "read_only": 1, - "reqd": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "base_amount", - "fieldtype": "Currency", - "in_list_view": 0, - "label": "Amount (Company Currency)", - "oldfieldname": "amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "pricing_rule_for_price", - "fieldtype": "Link", - "label": "Pricing Rule For Price", - "options": "Pricing Rule", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "pricing_rule_for_discount", - "fieldtype": "Link", - "label": "Pricing Rule For Discount", - "options": "Pricing Rule", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "warehouse_and_reference", - "fieldtype": "Section Break", - "in_list_view": 0, - "label": "Warehouse and Reference" - }, - { - "doctype": "DocField", - "fieldname": "warehouse", - "fieldtype": "Link", - "hidden": 0, - "in_list_view": 0, - "label": "Warehouse", - "oldfieldname": "warehouse", - "oldfieldtype": "Link", - "options": "Warehouse", - "print_hide": 1, - "read_only": 0, - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "project_name", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 0, - "label": "Project Name", - "options": "Project", - "print_hide": 1, - "read_only": 0, - "report_hide": 0 - }, - { - "doctype": "DocField", - "fieldname": "prevdoc_doctype", - "fieldtype": "Data", - "hidden": 1, - "in_list_view": 0, - "label": "Prevdoc DocType", - "no_copy": 1, - "oldfieldname": "prevdoc_doctype", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "prevdoc_docname", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 1, - "in_list_view": 0, - "label": "Material Request No", - "no_copy": 1, - "oldfieldname": "prevdoc_docname", - "oldfieldtype": "Link", - "options": "Material Request", - "print_hide": 1, - "print_width": "120px", - "read_only": 1, - "search_index": 1, - "width": "120px" - }, - { - "doctype": "DocField", - "fieldname": "col_break4", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "prevdoc_detail_docname", - "fieldtype": "Data", - "hidden": 1, - "in_filter": 1, - "in_list_view": 0, - "label": "Material Request Detail No", - "no_copy": 1, - "oldfieldname": "prevdoc_detail_docname", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "brand", - "fieldtype": "Link", - "hidden": 0, - "in_list_view": 0, - "label": "Brand", - "oldfieldname": "brand", - "oldfieldtype": "Link", - "options": "Brand", - "print_hide": 1, - "read_only": 1 - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "item_group", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 1, - "in_list_view": 0, - "label": "Item Group", - "oldfieldname": "item_group", - "oldfieldtype": "Link", - "options": "Item Group", - "print_hide": 1, - "read_only": 1, - "search_index": 0 - }, - { - "description": "Tax detail table fetched from item master as a string and stored in this field.\nUsed for Taxes and Charges", - "doctype": "DocField", - "fieldname": "item_tax_rate", - "fieldtype": "Small Text", - "hidden": 1, - "in_list_view": 0, - "label": "Item Tax Rate", - "oldfieldname": "item_tax_rate", - "oldfieldtype": "Small Text", - "print_hide": 1, - "read_only": 1, - "report_hide": 1 - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "page_break", - "fieldtype": "Check", - "hidden": 0, - "in_list_view": 0, - "label": "Page Break", - "no_copy": 1, - "oldfieldname": "page_break", - "oldfieldtype": "Check", - "print_hide": 1, - "read_only": 0 - } -] \ No newline at end of file +{ + "autoname": "SQI-.#####", + "creation": "2013-05-22 12:43:10", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "item_code", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Item Code", + "oldfieldname": "item_code", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0, + "print_hide": 0, + "read_only": 0, + "reqd": 1, + "search_index": 1 + }, + { + "description": "If Supplier Part Number exists for given Item, it gets stored here", + "fieldname": "supplier_part_no", + "fieldtype": "Data", + "hidden": 1, + "in_list_view": 0, + "label": "Supplier Part Number", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "item_name", + "fieldtype": "Data", + "hidden": 0, + "in_filter": 1, + "in_list_view": 0, + "label": "Item Name", + "oldfieldname": "item_name", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "col_break1", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "description", + "fieldtype": "Small Text", + "in_list_view": 1, + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_width": "300px", + "read_only": 0, + "reqd": 1, + "width": "300px" + }, + { + "fieldname": "quantity_and_rate", + "fieldtype": "Section Break", + "in_list_view": 0, + "label": "Quantity and Rate", + "permlevel": 0 + }, + { + "fieldname": "qty", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Quantity", + "oldfieldname": "qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_width": "60px", + "read_only": 0, + "reqd": 1, + "width": "60px" + }, + { + "fieldname": "price_list_rate", + "fieldtype": "Currency", + "in_list_view": 0, + "label": "Price List Rate", + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "discount_percentage", + "fieldtype": "Float", + "in_list_view": 0, + "label": "Discount %", + "permlevel": 0, + "print_hide": 0, + "read_only": 0 + }, + { + "fieldname": "col_break2", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "uom", + "fieldtype": "Link", + "in_list_view": 0, + "label": "UOM", + "oldfieldname": "uom", + "oldfieldtype": "Link", + "options": "UOM", + "permlevel": 0, + "print_hide": 0, + "print_width": "100px", + "read_only": 0, + "reqd": 1, + "width": "100px" + }, + { + "fieldname": "base_price_list_rate", + "fieldtype": "Currency", + "in_list_view": 0, + "label": "Price List Rate (Company Currency)", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "sec_break1", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "rate", + "fieldtype": "Currency", + "hidden": 0, + "in_list_view": 1, + "label": "Rate ", + "oldfieldname": "import_rate", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 0 + }, + { + "fieldname": "amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Amount", + "oldfieldname": "import_amount", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "col_break3", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "base_rate", + "fieldtype": "Currency", + "in_list_view": 0, + "label": "Rate (Company Currency)", + "oldfieldname": "purchase_rate", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 1, + "reqd": 1, + "width": "100px" + }, + { + "fieldname": "base_amount", + "fieldtype": "Currency", + "in_list_view": 0, + "label": "Amount (Company Currency)", + "oldfieldname": "amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 1 + }, + { + "fieldname": "pricing_rule_for_price", + "fieldtype": "Link", + "label": "Pricing Rule For Price", + "options": "Pricing Rule", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "pricing_rule_for_discount", + "fieldtype": "Link", + "label": "Pricing Rule For Discount", + "options": "Pricing Rule", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "warehouse_and_reference", + "fieldtype": "Section Break", + "in_list_view": 0, + "label": "Warehouse and Reference", + "permlevel": 0 + }, + { + "fieldname": "warehouse", + "fieldtype": "Link", + "hidden": 0, + "in_list_view": 0, + "label": "Warehouse", + "oldfieldname": "warehouse", + "oldfieldtype": "Link", + "options": "Warehouse", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 0 + }, + { + "fieldname": "project_name", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 0, + "label": "Project Name", + "options": "Project", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 0 + }, + { + "fieldname": "prevdoc_doctype", + "fieldtype": "Data", + "hidden": 1, + "in_list_view": 0, + "label": "Prevdoc DocType", + "no_copy": 1, + "oldfieldname": "prevdoc_doctype", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "prevdoc_docname", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 1, + "in_list_view": 0, + "label": "Material Request No", + "no_copy": 1, + "oldfieldname": "prevdoc_docname", + "oldfieldtype": "Link", + "options": "Material Request", + "permlevel": 0, + "print_hide": 1, + "print_width": "120px", + "read_only": 1, + "search_index": 1, + "width": "120px" + }, + { + "fieldname": "col_break4", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "prevdoc_detail_docname", + "fieldtype": "Data", + "hidden": 1, + "in_filter": 1, + "in_list_view": 0, + "label": "Material Request Detail No", + "no_copy": 1, + "oldfieldname": "prevdoc_detail_docname", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "search_index": 1 + }, + { + "fieldname": "brand", + "fieldtype": "Link", + "hidden": 0, + "in_list_view": 0, + "label": "Brand", + "oldfieldname": "brand", + "oldfieldtype": "Link", + "options": "Brand", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "description": "Add / Edit", + "fieldname": "item_group", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 1, + "in_list_view": 0, + "label": "Item Group", + "oldfieldname": "item_group", + "oldfieldtype": "Link", + "options": "Item Group", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "search_index": 0 + }, + { + "description": "Tax detail table fetched from item master as a string and stored in this field.\nUsed for Taxes and Charges", + "fieldname": "item_tax_rate", + "fieldtype": "Small Text", + "hidden": 1, + "in_list_view": 0, + "label": "Item Tax Rate", + "oldfieldname": "item_tax_rate", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "report_hide": 1 + }, + { + "allow_on_submit": 1, + "fieldname": "page_break", + "fieldtype": "Check", + "hidden": 0, + "in_list_view": 0, + "label": "Page Break", + "no_copy": 1, + "oldfieldname": "page_break", + "oldfieldtype": "Check", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + } + ], + "idx": 1, + "istable": 1, + "modified": "2014-02-28 11:25:38", + "modified_by": "Administrator", + "module": "Buying", + "name": "Supplier Quotation Item", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/buying/page/purchase_analytics/purchase_analytics.txt b/erpnext/buying/page/purchase_analytics/purchase_analytics.txt index 34ba8e1a8b..1bf216e7a2 100644 --- a/erpnext/buying/page/purchase_analytics/purchase_analytics.txt +++ b/erpnext/buying/page/purchase_analytics/purchase_analytics.txt @@ -1,37 +1,23 @@ -[ - { - "creation": "2012-09-21 20:15:16", - "docstatus": 0, - "modified": "2013-07-11 14:43:52", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Page", - "icon": "icon-bar-chart", - "module": "Buying", - "name": "__common__", - "page_name": "purchase-analytics", - "standard": "Yes", - "title": "Purchase Analytics" - }, - { - "doctype": "Page Role", - "name": "__common__", - "parent": "purchase-analytics", - "parentfield": "roles", - "parenttype": "Page" - }, - { - "doctype": "Page", - "name": "purchase-analytics" - }, - { - "doctype": "Page Role", - "role": "Analytics" - }, - { - "doctype": "Page Role", - "role": "Purchase Manager" - } -] \ No newline at end of file +{ + "creation": "2012-09-21 20:15:16", + "docstatus": 0, + "doctype": "Page", + "icon": "icon-bar-chart", + "idx": 1, + "modified": "2013-07-11 14:43:52", + "modified_by": "Administrator", + "module": "Buying", + "name": "purchase-analytics", + "owner": "Administrator", + "page_name": "purchase-analytics", + "roles": [ + { + "role": "Analytics" + }, + { + "role": "Purchase Manager" + } + ], + "standard": "Yes", + "title": "Purchase Analytics" +} \ No newline at end of file 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 199599005d..59b28ebdd4 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 @@ -1,24 +1,17 @@ -[ - { - "creation": "2013-05-03 14:55:53", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "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", - "report_name": "Item-wise Purchase History", - "report_type": "Query Report" - }, - { - "doctype": "Report", - "name": "Item-wise Purchase History" - } -] \ No newline at end of file +{ + "add_total_row": 1, + "creation": "2013-05-03 14:55:53", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Buying", + "name": "Item-wise Purchase History", + "owner": "Administrator", + "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", + "report_name": "Item-wise Purchase History", + "report_type": "Query Report" +} \ No newline at end of file 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 683279fc20..57eccc263f 100644 --- a/erpnext/buying/report/purchase_order_trends/purchase_order_trends.txt +++ b/erpnext/buying/report/purchase_order_trends/purchase_order_trends.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-06-13 18:45:01", - "docstatus": 0, - "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", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Purchase Order Trends" - } -] \ No newline at end of file +{ + "creation": "2013-06-13 18:45:01", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Buying", + "name": "Purchase Order Trends", + "owner": "Administrator", + "ref_doctype": "Purchase Order", + "report_name": "Purchase Order Trends", + "report_type": "Script Report" +} \ No newline at end of file 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 c3e91ae29d..11cd43294f 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 @@ -1,24 +1,17 @@ -[ - { - "creation": "2013-05-13 16:10:02", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "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", - "report_name": "Requested Items To Be Ordered", - "report_type": "Query Report" - }, - { - "doctype": "Report", - "name": "Requested Items To Be Ordered" - } -] \ No newline at end of file +{ + "add_total_row": 1, + "creation": "2013-05-13 16:10:02", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Buying", + "name": "Requested Items To Be Ordered", + "owner": "Administrator", + "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", + "report_name": "Requested Items To Be Ordered", + "report_type": "Query Report" +} \ No newline at end of file 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 25c11e73c3..e2a62b4b16 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 @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-10-09 10:38:40", - "docstatus": 0, - "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", - "report_name": "Supplier Addresses and Contacts", - "report_type": "Query Report" - }, - { - "doctype": "Report", - "name": "Supplier Addresses and Contacts" - } -] \ No newline at end of file +{ + "creation": "2013-10-09 10:38:40", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Buying", + "name": "Supplier Addresses and Contacts", + "owner": "Administrator", + "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", + "report_name": "Supplier Addresses and Contacts", + "report_type": "Query Report" +} \ No newline at end of file diff --git a/erpnext/home/doctype/feed/feed.txt b/erpnext/home/doctype/feed/feed.txt index 8821b7d36f..725d94178b 100644 --- a/erpnext/home/doctype/feed/feed.txt +++ b/erpnext/home/doctype/feed/feed.txt @@ -1,80 +1,61 @@ -[ - { - "creation": "2012-07-03 13:29:42", - "docstatus": 0, - "modified": "2013-12-20 19:24:07", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "_FEED.#####", - "doctype": "DocType", - "icon": "icon-rss", - "module": "Home", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Feed", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Feed", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "System Manager" - }, - { - "doctype": "DocType", - "name": "Feed" - }, - { - "doctype": "DocField", - "fieldname": "feed_type", - "fieldtype": "Select", - "label": "Feed Type" - }, - { - "doctype": "DocField", - "fieldname": "doc_type", - "fieldtype": "Data", - "label": "Doc Type" - }, - { - "doctype": "DocField", - "fieldname": "doc_name", - "fieldtype": "Data", - "label": "Doc Name" - }, - { - "doctype": "DocField", - "fieldname": "subject", - "fieldtype": "Data", - "label": "Subject" - }, - { - "doctype": "DocField", - "fieldname": "color", - "fieldtype": "Data", - "label": "Color" - }, - { - "doctype": "DocField", - "fieldname": "full_name", - "fieldtype": "Data", - "label": "Full Name" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "autoname": "_FEED.#####", + "creation": "2012-07-03 13:29:42", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "feed_type", + "fieldtype": "Select", + "label": "Feed Type", + "permlevel": 0 + }, + { + "fieldname": "doc_type", + "fieldtype": "Data", + "label": "Doc Type", + "permlevel": 0 + }, + { + "fieldname": "doc_name", + "fieldtype": "Data", + "label": "Doc Name", + "permlevel": 0 + }, + { + "fieldname": "subject", + "fieldtype": "Data", + "label": "Subject", + "permlevel": 0 + }, + { + "fieldname": "color", + "fieldtype": "Data", + "label": "Color", + "permlevel": 0 + }, + { + "fieldname": "full_name", + "fieldtype": "Data", + "label": "Full Name", + "permlevel": 0 + } + ], + "icon": "icon-rss", + "idx": 1, + "modified": "2013-12-20 19:24:07", + "modified_by": "Administrator", + "module": "Home", + "name": "Feed", + "owner": "Administrator", + "permissions": [ + { + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager" + } + ] +} \ No newline at end of file diff --git a/erpnext/home/page/activity/activity.txt b/erpnext/home/page/activity/activity.txt index 7c9783dbea..8f967fdabe 100644 --- a/erpnext/home/page/activity/activity.txt +++ b/erpnext/home/page/activity/activity.txt @@ -1,33 +1,20 @@ -[ - { - "creation": "2013-04-09 11:45:31", - "docstatus": 0, - "modified": "2013-07-11 14:40:20", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Page", - "icon": "icon-play", - "module": "Home", - "name": "__common__", - "page_name": "activity", - "standard": "Yes", - "title": "Activity" - }, - { - "doctype": "Page Role", - "name": "__common__", - "parent": "activity", - "parentfield": "roles", - "parenttype": "Page", - "role": "All" - }, - { - "doctype": "Page", - "name": "activity" - }, - { - "doctype": "Page Role" - } -] \ No newline at end of file +{ + "creation": "2013-04-09 11:45:31", + "docstatus": 0, + "doctype": "Page", + "icon": "icon-play", + "idx": 1, + "modified": "2013-07-11 14:40:20", + "modified_by": "Administrator", + "module": "Home", + "name": "activity", + "owner": "Administrator", + "page_name": "activity", + "roles": [ + { + "role": "All" + } + ], + "standard": "Yes", + "title": "Activity" +} \ No newline at end of file diff --git a/erpnext/hr/doctype/appraisal/appraisal.txt b/erpnext/hr/doctype/appraisal/appraisal.txt index da57097b52..fc63bca8e7 100644 --- a/erpnext/hr/doctype/appraisal/appraisal.txt +++ b/erpnext/hr/doctype/appraisal/appraisal.txt @@ -1,256 +1,249 @@ -[ - { - "creation": "2013-01-10 16:34:12", - "docstatus": 0, - "modified": "2014-01-22 16:05:34", - "modified_by": "Administrator", - "owner": "ashwini@webnotestech.com" - }, - { - "autoname": "APRSL.#####", - "doctype": "DocType", - "icon": "icon-thumbs-up", - "is_submittable": 1, - "module": "HR", - "name": "__common__", - "search_fields": "status, employee, employee_name" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Appraisal", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Appraisal", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Appraisal" - }, - { - "doctype": "DocField", - "fieldname": "employee_details", - "fieldtype": "Section Break", - "label": "Employee Details", - "oldfieldtype": "Section Break" - }, - { - "description": "Select template from which you want to get the Goals", - "doctype": "DocField", - "fieldname": "kra_template", - "fieldtype": "Link", - "label": "Appraisal Template", - "oldfieldname": "kra_template", - "oldfieldtype": "Link", - "options": "Appraisal Template", - "reqd": 1 - }, - { - "depends_on": "kra_template", - "description": "Select the Employee for whom you are creating the Appraisal.", - "doctype": "DocField", - "fieldname": "employee", - "fieldtype": "Link", - "in_filter": 1, - "label": "For Employee", - "oldfieldname": "employee", - "oldfieldtype": "Link", - "options": "Employee", - "reqd": 1, - "search_index": 1 - }, - { - "depends_on": "kra_template", - "doctype": "DocField", - "fieldname": "employee_name", - "fieldtype": "Data", - "in_filter": 1, - "in_list_view": 1, - "label": "For Employee Name", - "oldfieldname": "employee_name", - "oldfieldtype": "Data", - "read_only": 1 - }, - { - "depends_on": "kra_template", - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "width": "50%" - }, - { - "default": "Draft", - "depends_on": "kra_template", - "doctype": "DocField", - "fieldname": "status", - "fieldtype": "Select", - "in_filter": 1, - "in_list_view": 1, - "label": "Status", - "no_copy": 1, - "oldfieldname": "status", - "oldfieldtype": "Select", - "options": "\nDraft\nSubmitted\nCompleted\nCancelled", - "read_only": 1, - "reqd": 1, - "search_index": 1 - }, - { - "depends_on": "kra_template", - "doctype": "DocField", - "fieldname": "start_date", - "fieldtype": "Date", - "in_filter": 1, - "in_list_view": 1, - "label": "Start Date", - "oldfieldname": "start_date", - "oldfieldtype": "Date", - "reqd": 1 - }, - { - "depends_on": "kra_template", - "doctype": "DocField", - "fieldname": "end_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "End Date", - "oldfieldname": "end_date", - "oldfieldtype": "Date", - "reqd": 1 - }, - { - "depends_on": "kra_template", - "doctype": "DocField", - "fieldname": "section_break0", - "fieldtype": "Section Break", - "label": "Goals", - "oldfieldtype": "Section Break", - "options": "Simple" - }, - { - "allow_on_submit": 0, - "doctype": "DocField", - "fieldname": "appraisal_details", - "fieldtype": "Table", - "label": "Appraisal Goals", - "oldfieldname": "appraisal_details", - "oldfieldtype": "Table", - "options": "Appraisal Goal" - }, - { - "allow_on_submit": 0, - "doctype": "DocField", - "fieldname": "calculate_total_score", - "fieldtype": "Button", - "label": "Calculate Total Score", - "oldfieldtype": "Button", - "options": "calculate_total" - }, - { - "doctype": "DocField", - "fieldname": "total_score", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Total Score (Out of 5)", - "no_copy": 1, - "oldfieldname": "total_score", - "oldfieldtype": "Currency", - "read_only": 1 - }, - { - "depends_on": "kra_template", - "doctype": "DocField", - "fieldname": "section_break1", - "fieldtype": "Section Break" - }, - { - "description": "Any other comments, noteworthy effort that should go in the records.", - "doctype": "DocField", - "fieldname": "comments", - "fieldtype": "Text", - "label": "Comments" - }, - { - "depends_on": "kra_template", - "doctype": "DocField", - "fieldname": "other_details", - "fieldtype": "Section Break", - "label": "Other Details" - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Select", - "in_filter": 1, - "label": "Company", - "oldfieldname": "company", - "oldfieldtype": "Link", - "options": "link:Company", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "fiscal_year", - "fieldtype": "Select", - "in_filter": 1, - "label": "Fiscal Year", - "oldfieldname": "fiscal_year", - "oldfieldtype": "Select", - "options": "link:Fiscal Year", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "amended_from", - "fieldtype": "Data", - "hidden": 1, - "ignore_restrictions": 1, - "label": "Amended From", - "no_copy": 1, - "oldfieldname": "amended_from", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 1, - "report_hide": 1, - "width": "150px" - }, - { - "cancel": 0, - "delete": 0, - "doctype": "DocPerm", - "restricted": 1, - "role": "Employee", - "submit": 0 - }, - { - "amend": 1, - "cancel": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "System Manager", - "submit": 1 - }, - { - "amend": 1, - "cancel": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "HR User", - "submit": 1 - } -] \ No newline at end of file +{ + "autoname": "APRSL.#####", + "creation": "2013-01-10 16:34:12", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "employee_details", + "fieldtype": "Section Break", + "label": "Employee Details", + "oldfieldtype": "Section Break", + "permlevel": 0 + }, + { + "description": "Select template from which you want to get the Goals", + "fieldname": "kra_template", + "fieldtype": "Link", + "label": "Appraisal Template", + "oldfieldname": "kra_template", + "oldfieldtype": "Link", + "options": "Appraisal Template", + "permlevel": 0, + "reqd": 1 + }, + { + "depends_on": "kra_template", + "description": "Select the Employee for whom you are creating the Appraisal.", + "fieldname": "employee", + "fieldtype": "Link", + "in_filter": 1, + "label": "For Employee", + "oldfieldname": "employee", + "oldfieldtype": "Link", + "options": "Employee", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "depends_on": "kra_template", + "fieldname": "employee_name", + "fieldtype": "Data", + "in_filter": 1, + "in_list_view": 1, + "label": "For Employee Name", + "oldfieldname": "employee_name", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1 + }, + { + "depends_on": "kra_template", + "fieldname": "column_break0", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "default": "Draft", + "depends_on": "kra_template", + "fieldname": "status", + "fieldtype": "Select", + "in_filter": 1, + "in_list_view": 1, + "label": "Status", + "no_copy": 1, + "oldfieldname": "status", + "oldfieldtype": "Select", + "options": "\nDraft\nSubmitted\nCompleted\nCancelled", + "permlevel": 0, + "read_only": 1, + "reqd": 1, + "search_index": 1 + }, + { + "depends_on": "kra_template", + "fieldname": "start_date", + "fieldtype": "Date", + "in_filter": 1, + "in_list_view": 1, + "label": "Start Date", + "oldfieldname": "start_date", + "oldfieldtype": "Date", + "permlevel": 0, + "reqd": 1 + }, + { + "depends_on": "kra_template", + "fieldname": "end_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "End Date", + "oldfieldname": "end_date", + "oldfieldtype": "Date", + "permlevel": 0, + "reqd": 1 + }, + { + "depends_on": "kra_template", + "fieldname": "section_break0", + "fieldtype": "Section Break", + "label": "Goals", + "oldfieldtype": "Section Break", + "options": "Simple", + "permlevel": 0 + }, + { + "allow_on_submit": 0, + "fieldname": "appraisal_details", + "fieldtype": "Table", + "label": "Appraisal Goals", + "oldfieldname": "appraisal_details", + "oldfieldtype": "Table", + "options": "Appraisal Goal", + "permlevel": 0 + }, + { + "allow_on_submit": 0, + "fieldname": "calculate_total_score", + "fieldtype": "Button", + "label": "Calculate Total Score", + "oldfieldtype": "Button", + "options": "calculate_total", + "permlevel": 0 + }, + { + "fieldname": "total_score", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Total Score (Out of 5)", + "no_copy": 1, + "oldfieldname": "total_score", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 1 + }, + { + "depends_on": "kra_template", + "fieldname": "section_break1", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "description": "Any other comments, noteworthy effort that should go in the records.", + "fieldname": "comments", + "fieldtype": "Text", + "label": "Comments", + "permlevel": 0 + }, + { + "depends_on": "kra_template", + "fieldname": "other_details", + "fieldtype": "Section Break", + "label": "Other Details", + "permlevel": 0 + }, + { + "fieldname": "company", + "fieldtype": "Select", + "in_filter": 1, + "label": "Company", + "oldfieldname": "company", + "oldfieldtype": "Link", + "options": "link:Company", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Select", + "in_filter": 1, + "label": "Fiscal Year", + "oldfieldname": "fiscal_year", + "oldfieldtype": "Select", + "options": "link:Fiscal Year", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "amended_from", + "fieldtype": "Data", + "hidden": 1, + "ignore_restrictions": 1, + "label": "Amended From", + "no_copy": 1, + "oldfieldname": "amended_from", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "report_hide": 1, + "width": "150px" + } + ], + "icon": "icon-thumbs-up", + "idx": 1, + "is_submittable": 1, + "modified": "2014-01-22 16:05:34", + "modified_by": "Administrator", + "module": "HR", + "name": "Appraisal", + "owner": "ashwini@webnotestech.com", + "permissions": [ + { + "cancel": 0, + "create": 1, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "restricted": 1, + "role": "Employee", + "submit": 0, + "write": 1 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "HR User", + "submit": 1, + "write": 1 + } + ], + "search_fields": "status, employee, employee_name" +} \ No newline at end of file diff --git a/erpnext/hr/doctype/appraisal_goal/appraisal_goal.txt b/erpnext/hr/doctype/appraisal_goal/appraisal_goal.txt index 5c15ac6edc..f075f76fb1 100644 --- a/erpnext/hr/doctype/appraisal_goal/appraisal_goal.txt +++ b/erpnext/hr/doctype/appraisal_goal/appraisal_goal.txt @@ -1,77 +1,67 @@ -[ - { - "creation": "2013-02-22 01:27:44", - "docstatus": 0, - "modified": "2013-12-20 19:22:53", - "modified_by": "Administrator", - "owner": "ashwini@webnotestech.com" - }, - { - "autoname": "APRSLD.#####", - "doctype": "DocType", - "istable": 1, - "module": "HR", - "name": "__common__" - }, - { - "doctype": "DocField", - "in_list_view": 1, - "name": "__common__", - "parent": "Appraisal Goal", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Appraisal Goal" - }, - { - "description": "Key Responsibility Area", - "doctype": "DocField", - "fieldname": "kra", - "fieldtype": "Small Text", - "label": "Goal", - "oldfieldname": "kra", - "oldfieldtype": "Small Text", - "print_width": "240px", - "reqd": 1, - "width": "240px" - }, - { - "doctype": "DocField", - "fieldname": "per_weightage", - "fieldtype": "Float", - "label": "Weightage (%)", - "oldfieldname": "per_weightage", - "oldfieldtype": "Currency", - "print_width": "70px", - "reqd": 1, - "width": "70px" - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "score", - "fieldtype": "Float", - "label": "Score (0-5)", - "no_copy": 1, - "oldfieldname": "score", - "oldfieldtype": "Select", - "options": "\n0\n1\n2\n3\n4\n5", - "print_width": "70px", - "width": "70px" - }, - { - "doctype": "DocField", - "fieldname": "score_earned", - "fieldtype": "Float", - "label": "Score Earned", - "no_copy": 1, - "oldfieldname": "score_earned", - "oldfieldtype": "Currency", - "print_width": "70px", - "read_only": 1, - "width": "70px" - } -] \ No newline at end of file +{ + "autoname": "APRSLD.#####", + "creation": "2013-02-22 01:27:44", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "description": "Key Responsibility Area", + "fieldname": "kra", + "fieldtype": "Small Text", + "in_list_view": 1, + "label": "Goal", + "oldfieldname": "kra", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_width": "240px", + "reqd": 1, + "width": "240px" + }, + { + "fieldname": "per_weightage", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Weightage (%)", + "oldfieldname": "per_weightage", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_width": "70px", + "reqd": 1, + "width": "70px" + }, + { + "allow_on_submit": 1, + "fieldname": "score", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Score (0-5)", + "no_copy": 1, + "oldfieldname": "score", + "oldfieldtype": "Select", + "options": "\n0\n1\n2\n3\n4\n5", + "permlevel": 0, + "print_width": "70px", + "width": "70px" + }, + { + "fieldname": "score_earned", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Score Earned", + "no_copy": 1, + "oldfieldname": "score_earned", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_width": "70px", + "read_only": 1, + "width": "70px" + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:22:53", + "modified_by": "Administrator", + "module": "HR", + "name": "Appraisal Goal", + "owner": "ashwini@webnotestech.com" +} \ No newline at end of file diff --git a/erpnext/hr/doctype/appraisal_template/appraisal_template.txt b/erpnext/hr/doctype/appraisal_template/appraisal_template.txt index ff887c449a..5b543cf195 100644 --- a/erpnext/hr/doctype/appraisal_template/appraisal_template.txt +++ b/erpnext/hr/doctype/appraisal_template/appraisal_template.txt @@ -1,82 +1,63 @@ -[ - { - "creation": "2012-07-03 13:30:39", - "docstatus": 0, - "modified": "2013-12-20 19:23:55", - "modified_by": "Administrator", - "owner": "ashwini@webnotestech.com" - }, - { - "allow_import": 1, - "autoname": "field:kra_title", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-file-text", - "module": "HR", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Appraisal Template", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Appraisal Template", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "HR User", - "write": 1 - }, - { - "doctype": "DocType", - "name": "Appraisal Template" - }, - { - "doctype": "DocField", - "fieldname": "kra_title", - "fieldtype": "Data", - "label": "Appraisal Template Title", - "oldfieldname": "kra_title", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Small Text", - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Small Text", - "print_width": "300px", - "width": "300px" - }, - { - "doctype": "DocField", - "fieldname": "kra_sheet", - "fieldtype": "Table", - "label": "Appraisal Template Goal", - "oldfieldname": "kra_sheet", - "oldfieldtype": "Table", - "options": "Appraisal Template Goal" - }, - { - "doctype": "DocField", - "fieldname": "total_points", - "fieldtype": "Int", - "label": "Total Points" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "allow_import": 1, + "autoname": "field:kra_title", + "creation": "2012-07-03 13:30:39", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "kra_title", + "fieldtype": "Data", + "label": "Appraisal Template Title", + "oldfieldname": "kra_title", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "description", + "fieldtype": "Small Text", + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_width": "300px", + "width": "300px" + }, + { + "fieldname": "kra_sheet", + "fieldtype": "Table", + "label": "Appraisal Template Goal", + "oldfieldname": "kra_sheet", + "oldfieldtype": "Table", + "options": "Appraisal Template Goal", + "permlevel": 0 + }, + { + "fieldname": "total_points", + "fieldtype": "Int", + "label": "Total Points", + "permlevel": 0 + } + ], + "icon": "icon-file-text", + "idx": 1, + "modified": "2013-12-20 19:23:55", + "modified_by": "Administrator", + "module": "HR", + "name": "Appraisal Template", + "owner": "ashwini@webnotestech.com", + "permissions": [ + { + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "HR User", + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.txt b/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.txt index 0657f64e1c..70e4d9f583 100644 --- a/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.txt +++ b/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.txt @@ -1,51 +1,40 @@ -[ - { - "creation": "2013-02-22 01:27:44", - "docstatus": 0, - "modified": "2013-12-20 19:22:54", - "modified_by": "Administrator", - "owner": "ashwini@webnotestech.com" - }, - { - "autoname": "KSHEET.#####", - "doctype": "DocType", - "istable": 1, - "module": "HR", - "name": "__common__" - }, - { - "doctype": "DocField", - "in_list_view": 1, - "name": "__common__", - "parent": "Appraisal Template Goal", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0, - "reqd": 1 - }, - { - "doctype": "DocType", - "name": "Appraisal Template Goal" - }, - { - "description": "Key Performance Area", - "doctype": "DocField", - "fieldname": "kra", - "fieldtype": "Small Text", - "label": "KRA", - "oldfieldname": "kra", - "oldfieldtype": "Small Text", - "print_width": "200px", - "width": "200px" - }, - { - "doctype": "DocField", - "fieldname": "per_weightage", - "fieldtype": "Float", - "label": "Weightage (%)", - "oldfieldname": "per_weightage", - "oldfieldtype": "Currency", - "print_width": "100px", - "width": "100px" - } -] \ No newline at end of file +{ + "autoname": "KSHEET.#####", + "creation": "2013-02-22 01:27:44", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "description": "Key Performance Area", + "fieldname": "kra", + "fieldtype": "Small Text", + "in_list_view": 1, + "label": "KRA", + "oldfieldname": "kra", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_width": "200px", + "reqd": 1, + "width": "200px" + }, + { + "fieldname": "per_weightage", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Weightage (%)", + "oldfieldname": "per_weightage", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_width": "100px", + "reqd": 1, + "width": "100px" + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:22:54", + "modified_by": "Administrator", + "module": "HR", + "name": "Appraisal Template Goal", + "owner": "ashwini@webnotestech.com" +} \ No newline at end of file diff --git a/erpnext/hr/doctype/attendance/attendance.txt b/erpnext/hr/doctype/attendance/attendance.txt index 894e981860..952dcfe73e 100644 --- a/erpnext/hr/doctype/attendance/attendance.txt +++ b/erpnext/hr/doctype/attendance/attendance.txt @@ -1,180 +1,179 @@ -[ - { - "creation": "2013-01-10 16:34:13", - "docstatus": 0, - "modified": "2014-01-20 17:48:23", - "modified_by": "Administrator", - "owner": "ashwini@webnotestech.com" - }, - { - "allow_import": 1, - "autoname": "naming_series:", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-ok", - "is_submittable": 1, - "module": "HR", - "name": "__common__", - "search_fields": "employee, employee_name, att_date, status" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Attendance", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Attendance", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 1, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Attendance" - }, - { - "doctype": "DocField", - "fieldname": "attendance_details", - "fieldtype": "Section Break", - "label": "Attendance Details", - "oldfieldtype": "Section Break", - "options": "Simple" - }, - { - "doctype": "DocField", - "fieldname": "naming_series", - "fieldtype": "Select", - "label": "Series", - "no_copy": 1, - "oldfieldname": "naming_series", - "oldfieldtype": "Select", - "options": "ATT", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "employee", - "fieldtype": "Link", - "in_filter": 1, - "label": "Employee", - "oldfieldname": "employee", - "oldfieldtype": "Link", - "options": "Employee", - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "employee_name", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Employee Name", - "oldfieldname": "employee_name", - "oldfieldtype": "Data" - }, - { - "default": "Present", - "doctype": "DocField", - "fieldname": "status", - "fieldtype": "Select", - "in_filter": 1, - "in_list_view": 1, - "label": "Status", - "no_copy": 1, - "oldfieldname": "status", - "oldfieldtype": "Select", - "options": "\nPresent\nAbsent\nHalf Day", - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "leave_type", - "fieldtype": "Link", - "hidden": 1, - "in_list_view": 1, - "label": "Leave Type", - "oldfieldname": "leave_type", - "oldfieldtype": "Link", - "options": "Leave Type", - "print_hide": 1, - "report_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "att_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Attendance Date", - "oldfieldname": "att_date", - "oldfieldtype": "Date", - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "fiscal_year", - "fieldtype": "Select", - "in_filter": 1, - "label": "Fiscal Year", - "oldfieldname": "fiscal_year", - "oldfieldtype": "Select", - "options": "link:Fiscal Year", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Select", - "in_filter": 1, - "label": "Company", - "oldfieldname": "company", - "oldfieldtype": "Link", - "options": "link:Company", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "amended_from", - "fieldtype": "Link", - "ignore_restrictions": 1, - "label": "Amended From", - "no_copy": 1, - "options": "Attendance", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocPerm", - "role": "System Manager" - }, - { - "doctype": "DocPerm", - "role": "HR User" - }, - { - "doctype": "DocPerm", - "role": "HR Manager" - } -] \ No newline at end of file +{ + "allow_import": 1, + "autoname": "naming_series:", + "creation": "2013-01-10 16:34:13", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "attendance_details", + "fieldtype": "Section Break", + "label": "Attendance Details", + "oldfieldtype": "Section Break", + "options": "Simple", + "permlevel": 0 + }, + { + "fieldname": "naming_series", + "fieldtype": "Select", + "label": "Series", + "no_copy": 1, + "oldfieldname": "naming_series", + "oldfieldtype": "Select", + "options": "ATT", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "employee", + "fieldtype": "Link", + "in_filter": 1, + "label": "Employee", + "oldfieldname": "employee", + "oldfieldtype": "Link", + "options": "Employee", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "employee_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Employee Name", + "oldfieldname": "employee_name", + "oldfieldtype": "Data", + "permlevel": 0 + }, + { + "default": "Present", + "fieldname": "status", + "fieldtype": "Select", + "in_filter": 1, + "in_list_view": 1, + "label": "Status", + "no_copy": 1, + "oldfieldname": "status", + "oldfieldtype": "Select", + "options": "\nPresent\nAbsent\nHalf Day", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "leave_type", + "fieldtype": "Link", + "hidden": 1, + "in_list_view": 1, + "label": "Leave Type", + "oldfieldname": "leave_type", + "oldfieldtype": "Link", + "options": "Leave Type", + "permlevel": 0, + "print_hide": 1, + "report_hide": 1 + }, + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "att_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Attendance Date", + "oldfieldname": "att_date", + "oldfieldtype": "Date", + "permlevel": 0, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Select", + "in_filter": 1, + "label": "Fiscal Year", + "oldfieldname": "fiscal_year", + "oldfieldtype": "Select", + "options": "link:Fiscal Year", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "company", + "fieldtype": "Select", + "in_filter": 1, + "label": "Company", + "oldfieldname": "company", + "oldfieldtype": "Link", + "options": "link:Company", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "amended_from", + "fieldtype": "Link", + "ignore_restrictions": 1, + "label": "Amended From", + "no_copy": 1, + "options": "Attendance", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + } + ], + "icon": "icon-ok", + "idx": 1, + "is_submittable": 1, + "modified": "2014-01-20 17:48:23", + "modified_by": "Administrator", + "module": "HR", + "name": "Attendance", + "owner": "ashwini@webnotestech.com", + "permissions": [ + { + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "submit": 1, + "write": 1 + }, + { + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "HR User", + "submit": 1, + "write": 1 + }, + { + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "HR Manager", + "submit": 1, + "write": 1 + } + ], + "search_fields": "employee, employee_name, att_date, status" +} \ No newline at end of file diff --git a/erpnext/hr/doctype/branch/branch.txt b/erpnext/hr/doctype/branch/branch.txt index 6ef13e2abb..f4cc5d04bd 100644 --- a/erpnext/hr/doctype/branch/branch.txt +++ b/erpnext/hr/doctype/branch/branch.txt @@ -1,74 +1,64 @@ -[ - { - "creation": "2013-01-10 16:34:13", - "docstatus": 0, - "modified": "2014-01-20 17:48:26", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "allow_rename": 1, - "autoname": "field:branch", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-code-fork", - "module": "HR", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Branch", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "cancel": 0, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Branch", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Branch" - }, - { - "doctype": "DocField", - "fieldname": "trash_reason", - "fieldtype": "Small Text", - "label": "Trash Reason", - "oldfieldname": "trash_reason", - "oldfieldtype": "Small Text", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "branch", - "fieldtype": "Data", - "label": "Branch", - "oldfieldname": "branch", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "doctype": "DocPerm", - "role": "HR User" - }, - { - "doctype": "DocPerm", - "role": "HR Manager" - } -] \ No newline at end of file +{ + "allow_import": 1, + "allow_rename": 1, + "autoname": "field:branch", + "creation": "2013-01-10 16:34:13", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "trash_reason", + "fieldtype": "Small Text", + "label": "Trash Reason", + "oldfieldname": "trash_reason", + "oldfieldtype": "Small Text", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "branch", + "fieldtype": "Data", + "label": "Branch", + "oldfieldname": "branch", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + } + ], + "icon": "icon-code-fork", + "idx": 1, + "modified": "2014-01-20 17:48:26", + "modified_by": "Administrator", + "module": "HR", + "name": "Branch", + "owner": "Administrator", + "permissions": [ + { + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "HR User", + "submit": 0, + "write": 1 + }, + { + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "HR Manager", + "submit": 0, + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/hr/doctype/deduction_type/deduction_type.txt b/erpnext/hr/doctype/deduction_type/deduction_type.txt index b70cf35b91..af93bcd9b4 100644 --- a/erpnext/hr/doctype/deduction_type/deduction_type.txt +++ b/erpnext/hr/doctype/deduction_type/deduction_type.txt @@ -1,79 +1,60 @@ -[ - { - "creation": "2013-01-22 16:50:30", - "docstatus": 0, - "modified": "2014-01-20 17:48:34", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "allow_rename": 1, - "autoname": "field:deduction_name", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-flag", - "module": "HR", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Deduction Type", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "cancel": 0, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Deduction Type", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "HR User", - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Deduction Type" - }, - { - "doctype": "DocField", - "fieldname": "trash_reason", - "fieldtype": "Small Text", - "label": "Trash Reason", - "oldfieldname": "trash_reason", - "oldfieldtype": "Small Text", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "deduction_name", - "fieldtype": "Data", - "label": "Name", - "oldfieldname": "deduction_name", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Small Text", - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Small Text", - "width": "300px" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "allow_import": 1, + "allow_rename": 1, + "autoname": "field:deduction_name", + "creation": "2013-01-22 16:50:30", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "trash_reason", + "fieldtype": "Small Text", + "label": "Trash Reason", + "oldfieldname": "trash_reason", + "oldfieldtype": "Small Text", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "deduction_name", + "fieldtype": "Data", + "label": "Name", + "oldfieldname": "deduction_name", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "description", + "fieldtype": "Small Text", + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Small Text", + "permlevel": 0, + "width": "300px" + } + ], + "icon": "icon-flag", + "idx": 1, + "modified": "2014-01-20 17:48:34", + "modified_by": "Administrator", + "module": "HR", + "name": "Deduction Type", + "owner": "Administrator", + "permissions": [ + { + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "HR User", + "submit": 0, + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/hr/doctype/department/department.txt b/erpnext/hr/doctype/department/department.txt index 269afa758f..3e43d7def8 100644 --- a/erpnext/hr/doctype/department/department.txt +++ b/erpnext/hr/doctype/department/department.txt @@ -1,77 +1,58 @@ -[ - { - "creation": "2013-02-05 11:48:26", - "docstatus": 0, - "modified": "2014-01-20 17:48:38", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "autoname": "field:department_name", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-sitemap", - "module": "HR", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Department", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "cancel": 0, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Department", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "HR User", - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Department" - }, - { - "doctype": "DocField", - "fieldname": "trash_reason", - "fieldtype": "Small Text", - "label": "Trash Reason", - "oldfieldname": "trash_reason", - "oldfieldtype": "Small Text", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "department_name", - "fieldtype": "Data", - "label": "Department", - "oldfieldname": "department_name", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "description": "Days for which Holidays are blocked for this department.", - "doctype": "DocField", - "fieldname": "leave_block_list", - "fieldtype": "Link", - "label": "Leave Block List", - "options": "Leave Block List" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "allow_import": 1, + "autoname": "field:department_name", + "creation": "2013-02-05 11:48:26", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "trash_reason", + "fieldtype": "Small Text", + "label": "Trash Reason", + "oldfieldname": "trash_reason", + "oldfieldtype": "Small Text", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "department_name", + "fieldtype": "Data", + "label": "Department", + "oldfieldname": "department_name", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + }, + { + "description": "Days for which Holidays are blocked for this department.", + "fieldname": "leave_block_list", + "fieldtype": "Link", + "label": "Leave Block List", + "options": "Leave Block List", + "permlevel": 0 + } + ], + "icon": "icon-sitemap", + "idx": 1, + "modified": "2014-01-20 17:48:38", + "modified_by": "Administrator", + "module": "HR", + "name": "Department", + "owner": "Administrator", + "permissions": [ + { + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "HR User", + "submit": 0, + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/hr/doctype/designation/designation.txt b/erpnext/hr/doctype/designation/designation.txt index e8debd1b2f..9fa591ce19 100644 --- a/erpnext/hr/doctype/designation/designation.txt +++ b/erpnext/hr/doctype/designation/designation.txt @@ -1,70 +1,51 @@ -[ - { - "creation": "2013-01-10 16:34:13", - "docstatus": 0, - "modified": "2014-01-20 17:48:38", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "allow_rename": 1, - "autoname": "field:designation_name", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-bookmark", - "module": "HR", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Designation", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "cancel": 0, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Designation", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "HR User", - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Designation" - }, - { - "doctype": "DocField", - "fieldname": "trash_reason", - "fieldtype": "Small Text", - "label": "Trash Reason", - "oldfieldname": "trash_reason", - "oldfieldtype": "Small Text", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "designation_name", - "fieldtype": "Data", - "label": "Designation", - "oldfieldname": "designation_name", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "allow_import": 1, + "allow_rename": 1, + "autoname": "field:designation_name", + "creation": "2013-01-10 16:34:13", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "trash_reason", + "fieldtype": "Small Text", + "label": "Trash Reason", + "oldfieldname": "trash_reason", + "oldfieldtype": "Small Text", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "designation_name", + "fieldtype": "Data", + "label": "Designation", + "oldfieldname": "designation_name", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + } + ], + "icon": "icon-bookmark", + "idx": 1, + "modified": "2014-01-20 17:48:38", + "modified_by": "Administrator", + "module": "HR", + "name": "Designation", + "owner": "Administrator", + "permissions": [ + { + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "HR User", + "submit": 0, + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/hr/doctype/earning_type/earning_type.txt b/erpnext/hr/doctype/earning_type/earning_type.txt index 9d3b90f80f..0d23a369bb 100644 --- a/erpnext/hr/doctype/earning_type/earning_type.txt +++ b/erpnext/hr/doctype/earning_type/earning_type.txt @@ -1,100 +1,81 @@ -[ - { - "creation": "2013-01-24 11:03:32", - "docstatus": 0, - "modified": "2014-01-20 17:48:38", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "allow_rename": 1, - "autoname": "field:earning_name", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-flag", - "module": "HR", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Earning Type", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "cancel": 0, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Earning Type", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "HR User", - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Earning Type" - }, - { - "doctype": "DocField", - "fieldname": "trash_reason", - "fieldtype": "Small Text", - "label": "Trash Reason", - "oldfieldname": "trash_reason", - "oldfieldtype": "Small Text", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "earning_name", - "fieldtype": "Data", - "label": "Name", - "oldfieldname": "earning_name", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Small Text", - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Small Text", - "reqd": 0, - "width": "300px" - }, - { - "doctype": "DocField", - "fieldname": "taxable", - "fieldtype": "Select", - "label": "Taxable", - "oldfieldname": "taxable", - "oldfieldtype": "Select", - "options": "\nYes\nNo", - "reqd": 1 - }, - { - "depends_on": "eval:doc.taxable=='No'", - "doctype": "DocField", - "fieldname": "exemption_limit", - "fieldtype": "Float", - "hidden": 0, - "label": "Exemption Limit", - "oldfieldname": "exemption_limit", - "oldfieldtype": "Currency" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "allow_import": 1, + "allow_rename": 1, + "autoname": "field:earning_name", + "creation": "2013-01-24 11:03:32", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "trash_reason", + "fieldtype": "Small Text", + "label": "Trash Reason", + "oldfieldname": "trash_reason", + "oldfieldtype": "Small Text", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "earning_name", + "fieldtype": "Data", + "label": "Name", + "oldfieldname": "earning_name", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "description", + "fieldtype": "Small Text", + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Small Text", + "permlevel": 0, + "reqd": 0, + "width": "300px" + }, + { + "fieldname": "taxable", + "fieldtype": "Select", + "label": "Taxable", + "oldfieldname": "taxable", + "oldfieldtype": "Select", + "options": "\nYes\nNo", + "permlevel": 0, + "reqd": 1 + }, + { + "depends_on": "eval:doc.taxable=='No'", + "fieldname": "exemption_limit", + "fieldtype": "Float", + "hidden": 0, + "label": "Exemption Limit", + "oldfieldname": "exemption_limit", + "oldfieldtype": "Currency", + "permlevel": 0 + } + ], + "icon": "icon-flag", + "idx": 1, + "modified": "2014-01-20 17:48:38", + "modified_by": "Administrator", + "module": "HR", + "name": "Earning Type", + "owner": "Administrator", + "permissions": [ + { + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "HR User", + "submit": 0, + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/hr/doctype/employee/employee.txt b/erpnext/hr/doctype/employee/employee.txt index bc21ff95a0..f8f32db7df 100644 --- a/erpnext/hr/doctype/employee/employee.txt +++ b/erpnext/hr/doctype/employee/employee.txt @@ -1,782 +1,777 @@ -[ - { - "creation": "2013-03-07 09:04:18", - "docstatus": 0, - "modified": "2014-02-03 18:06:04", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_attach": 1, - "allow_import": 1, - "allow_rename": 1, - "autoname": "naming_series:", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-user", - "module": "HR", - "name": "__common__", - "search_fields": "employee_name" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Employee", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "amend": 0, - "cancel": 0, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Employee", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 0 - }, - { - "doctype": "DocType", - "name": "Employee" - }, - { - "doctype": "DocField", - "fieldname": "basic_information", - "fieldtype": "Section Break", - "label": "Basic Information", - "oldfieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "image_view", - "fieldtype": "Image", - "in_list_view": 0, - "label": "Image View", - "options": "image" - }, - { - "doctype": "DocField", - "fieldname": "employee", - "fieldtype": "Data", - "hidden": 1, - "label": "Employee", - "no_copy": 1, - "print_hide": 1, - "report_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "naming_series", - "fieldtype": "Select", - "label": "Series", - "no_copy": 1, - "oldfieldname": "naming_series", - "oldfieldtype": "Select", - "options": "EMP/", - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "salutation", - "fieldtype": "Select", - "label": "Salutation", - "oldfieldname": "salutation", - "oldfieldtype": "Select", - "options": "\nMr\nMs", - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "employee_name", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Full Name", - "oldfieldname": "employee_name", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "image", - "fieldtype": "Select", - "label": "Image", - "options": "attach_files:" - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "description": "System User (login) ID. If set, it will become default for all HR forms.", - "doctype": "DocField", - "fieldname": "user_id", - "fieldtype": "Link", - "label": "User ID", - "options": "User" - }, - { - "doctype": "DocField", - "fieldname": "employee_number", - "fieldtype": "Data", - "in_filter": 1, - "label": "Employee Number", - "oldfieldname": "employee_number", - "oldfieldtype": "Data", - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "date_of_joining", - "fieldtype": "Date", - "label": "Date of Joining", - "oldfieldname": "date_of_joining", - "oldfieldtype": "Date", - "reqd": 1 - }, - { - "description": "You can enter any date manually", - "doctype": "DocField", - "fieldname": "date_of_birth", - "fieldtype": "Date", - "in_filter": 1, - "label": "Date of Birth", - "oldfieldname": "date_of_birth", - "oldfieldtype": "Date", - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "gender", - "fieldtype": "Select", - "in_filter": 1, - "label": "Gender", - "oldfieldname": "gender", - "oldfieldtype": "Select", - "options": "\nMale\nFemale", - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Select", - "in_filter": 1, - "label": "Company", - "options": "link:Company", - "print_hide": 1, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "employment_details", - "fieldtype": "Section Break", - "label": "Employment Details" - }, - { - "doctype": "DocField", - "fieldname": "col_break_21", - "fieldtype": "Column Break" - }, - { - "default": "Active", - "doctype": "DocField", - "fieldname": "status", - "fieldtype": "Select", - "in_filter": 1, - "in_list_view": 1, - "label": "Status", - "oldfieldname": "status", - "oldfieldtype": "Select", - "options": "\nActive\nLeft", - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "employment_type", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "Employment Type", - "oldfieldname": "employment_type", - "oldfieldtype": "Link", - "options": "Employment Type", - "search_index": 0 - }, - { - "description": "Applicable Holiday List", - "doctype": "DocField", - "fieldname": "holiday_list", - "fieldtype": "Link", - "label": "Holiday List", - "oldfieldname": "holiday_list", - "oldfieldtype": "Link", - "options": "Holiday List" - }, - { - "doctype": "DocField", - "fieldname": "col_break_22", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "scheduled_confirmation_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Offer Date", - "oldfieldname": "scheduled_confirmation_date", - "oldfieldtype": "Date", - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "final_confirmation_date", - "fieldtype": "Date", - "label": "Confirmation Date", - "oldfieldname": "final_confirmation_date", - "oldfieldtype": "Date", - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "contract_end_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Contract End Date", - "oldfieldname": "contract_end_date", - "oldfieldtype": "Date", - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "date_of_retirement", - "fieldtype": "Date", - "label": "Date Of Retirement", - "oldfieldname": "date_of_retirement", - "oldfieldtype": "Date" - }, - { - "doctype": "DocField", - "fieldname": "job_profile", - "fieldtype": "Section Break", - "label": "Job Profile" - }, - { - "doctype": "DocField", - "fieldname": "column_break2", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "branch", - "fieldtype": "Link", - "in_filter": 1, - "label": "Branch", - "oldfieldname": "branch", - "oldfieldtype": "Link", - "options": "Branch", - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "department", - "fieldtype": "Link", - "in_filter": 1, - "label": "Department", - "oldfieldname": "department", - "oldfieldtype": "Link", - "options": "Department", - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "designation", - "fieldtype": "Link", - "in_filter": 1, - "label": "Designation", - "oldfieldname": "designation", - "oldfieldtype": "Link", - "options": "Designation", - "reqd": 0, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "grade", - "fieldtype": "Link", - "in_filter": 1, - "label": "Grade", - "oldfieldname": "grade", - "oldfieldtype": "Link", - "options": "Grade", - "reqd": 0 - }, - { - "description": "Provide email id registered in company", - "doctype": "DocField", - "fieldname": "company_email", - "fieldtype": "Data", - "in_filter": 1, - "label": "Company Email", - "oldfieldname": "company_email", - "oldfieldtype": "Data", - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "notice_number_of_days", - "fieldtype": "Int", - "label": "Notice (days)", - "oldfieldname": "notice_number_of_days", - "oldfieldtype": "Int" - }, - { - "doctype": "DocField", - "fieldname": "salary_information", - "fieldtype": "Column Break", - "label": "Salary Information", - "oldfieldtype": "Section Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "salary_mode", - "fieldtype": "Select", - "label": "Salary Mode", - "oldfieldname": "salary_mode", - "oldfieldtype": "Select", - "options": "\nBank\nCash\nCheque" - }, - { - "depends_on": "eval:doc.salary_mode == 'Bank'", - "doctype": "DocField", - "fieldname": "bank_name", - "fieldtype": "Data", - "hidden": 0, - "in_filter": 1, - "label": "Bank Name", - "oldfieldname": "bank_name", - "oldfieldtype": "Link", - "options": "Suggest" - }, - { - "depends_on": "eval:doc.salary_mode == 'Bank'", - "doctype": "DocField", - "fieldname": "bank_ac_no", - "fieldtype": "Data", - "hidden": 0, - "label": "Bank A/C No.", - "oldfieldname": "bank_ac_no", - "oldfieldtype": "Data" - }, - { - "doctype": "DocField", - "fieldname": "esic_card_no", - "fieldtype": "Data", - "label": "ESIC CARD No", - "oldfieldname": "esic_card_no", - "oldfieldtype": "Data" - }, - { - "doctype": "DocField", - "fieldname": "pf_number", - "fieldtype": "Data", - "label": "PF Number", - "oldfieldname": "pf_number", - "oldfieldtype": "Data" - }, - { - "doctype": "DocField", - "fieldname": "gratuity_lic_id", - "fieldtype": "Data", - "label": "Gratuity LIC ID", - "oldfieldname": "gratuity_lic_id", - "oldfieldtype": "Data" - }, - { - "doctype": "DocField", - "fieldname": "organization_profile", - "fieldtype": "Section Break", - "label": "Organization Profile" - }, - { - "doctype": "DocField", - "fieldname": "reports_to", - "fieldtype": "Link", - "ignore_restrictions": 1, - "label": "Reports to", - "oldfieldname": "reports_to", - "oldfieldtype": "Link", - "options": "Employee" - }, - { - "description": "The first Leave Approver in the list will be set as the default Leave Approver", - "doctype": "DocField", - "fieldname": "employee_leave_approvers", - "fieldtype": "Table", - "label": "Leave Approvers", - "options": "Employee Leave Approver" - }, - { - "doctype": "DocField", - "fieldname": "contact_details", - "fieldtype": "Section Break", - "label": "Contact Details" - }, - { - "doctype": "DocField", - "fieldname": "column_break3", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "cell_number", - "fieldtype": "Data", - "label": "Cell Number" - }, - { - "doctype": "DocField", - "fieldname": "personal_email", - "fieldtype": "Data", - "label": "Personal Email" - }, - { - "doctype": "DocField", - "fieldname": "unsubscribed", - "fieldtype": "Check", - "label": "Unsubscribed" - }, - { - "doctype": "DocField", - "fieldname": "emergency_contact_details", - "fieldtype": "HTML", - "label": "Emergency Contact Details", - "options": "

Emergency Contact Details

" - }, - { - "doctype": "DocField", - "fieldname": "person_to_be_contacted", - "fieldtype": "Data", - "label": "Emergency Contact" - }, - { - "doctype": "DocField", - "fieldname": "relation", - "fieldtype": "Data", - "label": "Relation" - }, - { - "doctype": "DocField", - "fieldname": "emergency_phone_number", - "fieldtype": "Data", - "label": "Emergency Phone" - }, - { - "doctype": "DocField", - "fieldname": "column_break4", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "permanent_accommodation_type", - "fieldtype": "Select", - "label": "Permanent Address Is", - "options": "\nRented\nOwned" - }, - { - "doctype": "DocField", - "fieldname": "permanent_address", - "fieldtype": "Small Text", - "label": "Permanent Address" - }, - { - "doctype": "DocField", - "fieldname": "current_accommodation_type", - "fieldtype": "Select", - "label": "Current Address Is", - "options": "\nRented\nOwned" - }, - { - "doctype": "DocField", - "fieldname": "current_address", - "fieldtype": "Small Text", - "label": "Current Address" - }, - { - "doctype": "DocField", - "fieldname": "sb53", - "fieldtype": "Section Break", - "label": "Bio" - }, - { - "description": "Short biography for website and other publications.", - "doctype": "DocField", - "fieldname": "bio", - "fieldtype": "Text Editor", - "label": "Bio" - }, - { - "doctype": "DocField", - "fieldname": "personal_details", - "fieldtype": "Section Break", - "label": "Personal Details" - }, - { - "doctype": "DocField", - "fieldname": "column_break5", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "pan_number", - "fieldtype": "Data", - "label": "PAN Number" - }, - { - "doctype": "DocField", - "fieldname": "passport_number", - "fieldtype": "Data", - "label": "Passport Number" - }, - { - "doctype": "DocField", - "fieldname": "date_of_issue", - "fieldtype": "Date", - "label": "Date of Issue" - }, - { - "doctype": "DocField", - "fieldname": "valid_upto", - "fieldtype": "Date", - "label": "Valid Upto" - }, - { - "doctype": "DocField", - "fieldname": "place_of_issue", - "fieldtype": "Data", - "label": "Place of Issue" - }, - { - "doctype": "DocField", - "fieldname": "column_break6", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "marital_status", - "fieldtype": "Select", - "label": "Marital Status", - "options": "\nSingle\nMarried\nDivorced\nWidowed" - }, - { - "doctype": "DocField", - "fieldname": "blood_group", - "fieldtype": "Select", - "label": "Blood Group", - "options": "\nA+\nA-\nB+\nB-\nAB+\nAB-\nO+\nO-" - }, - { - "description": "Here you can maintain family details like name and occupation of parent, spouse and children", - "doctype": "DocField", - "fieldname": "family_background", - "fieldtype": "Small Text", - "label": "Family Background" - }, - { - "description": "Here you can maintain height, weight, allergies, medical concerns etc", - "doctype": "DocField", - "fieldname": "health_details", - "fieldtype": "Small Text", - "label": "Health Details" - }, - { - "doctype": "DocField", - "fieldname": "educational_qualification", - "fieldtype": "Section Break", - "label": "Educational Qualification" - }, - { - "doctype": "DocField", - "fieldname": "educational_qualification_details", - "fieldtype": "Table", - "label": "Educational Qualification Details", - "options": "Employee Education" - }, - { - "doctype": "DocField", - "fieldname": "previous_work_experience", - "fieldtype": "Section Break", - "label": "Previous Work Experience", - "options": "Simple" - }, - { - "doctype": "DocField", - "fieldname": "previous_experience_details", - "fieldtype": "Table", - "label": "Employee External Work History", - "options": "Employee External Work History" - }, - { - "doctype": "DocField", - "fieldname": "history_in_company", - "fieldtype": "Section Break", - "label": "History In Company", - "options": "Simple" - }, - { - "doctype": "DocField", - "fieldname": "experience_in_company_details", - "fieldtype": "Table", - "label": "Employee Internal Work Historys", - "options": "Employee Internal Work History" - }, - { - "doctype": "DocField", - "fieldname": "exit", - "fieldtype": "Section Break", - "label": "Exit", - "oldfieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "column_break7", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "resignation_letter_date", - "fieldtype": "Date", - "label": "Resignation Letter Date", - "oldfieldname": "resignation_letter_date", - "oldfieldtype": "Date" - }, - { - "doctype": "DocField", - "fieldname": "relieving_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Relieving Date", - "oldfieldname": "relieving_date", - "oldfieldtype": "Date" - }, - { - "doctype": "DocField", - "fieldname": "reason_for_leaving", - "fieldtype": "Data", - "label": "Reason for Leaving", - "oldfieldname": "reason_for_leaving", - "oldfieldtype": "Data" - }, - { - "doctype": "DocField", - "fieldname": "leave_encashed", - "fieldtype": "Select", - "label": "Leave Encashed?", - "oldfieldname": "leave_encashed", - "oldfieldtype": "Select", - "options": "\nYes\nNo" - }, - { - "doctype": "DocField", - "fieldname": "encashment_date", - "fieldtype": "Date", - "label": "Encashment Date", - "oldfieldname": "encashment_date", - "oldfieldtype": "Date" - }, - { - "doctype": "DocField", - "fieldname": "exit_interview_details", - "fieldtype": "Column Break", - "label": "Exit Interview Details", - "oldfieldname": "col_brk6", - "oldfieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "held_on", - "fieldtype": "Date", - "label": "Held On", - "oldfieldname": "held_on", - "oldfieldtype": "Date" - }, - { - "doctype": "DocField", - "fieldname": "reason_for_resignation", - "fieldtype": "Select", - "label": "Reason for Resignation", - "oldfieldname": "reason_for_resignation", - "oldfieldtype": "Select", - "options": "\nBetter Prospects\nHealth Concerns" - }, - { - "doctype": "DocField", - "fieldname": "new_workplace", - "fieldtype": "Data", - "label": "New Workplace", - "oldfieldname": "new_workplace", - "oldfieldtype": "Data" - }, - { - "doctype": "DocField", - "fieldname": "feedback", - "fieldtype": "Small Text", - "label": "Feedback", - "oldfieldname": "feedback", - "oldfieldtype": "Text" - }, - { - "doctype": "DocField", - "fieldname": "trash_reason", - "fieldtype": "Small Text", - "label": "Trash Reason", - "oldfieldname": "trash_reason", - "oldfieldtype": "Small Text", - "read_only": 1 - }, - { - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Employee", - "write": 0 - }, - { - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "restrict": 0, - "role": "HR User", - "write": 1 - }, - { - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "restrict": 1, - "role": "HR Manager", - "write": 1 - } -] \ No newline at end of file +{ + "allow_attach": 1, + "allow_import": 1, + "allow_rename": 1, + "autoname": "naming_series:", + "creation": "2013-03-07 09:04:18", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "basic_information", + "fieldtype": "Section Break", + "label": "Basic Information", + "oldfieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "image_view", + "fieldtype": "Image", + "in_list_view": 0, + "label": "Image View", + "options": "image", + "permlevel": 0 + }, + { + "fieldname": "employee", + "fieldtype": "Data", + "hidden": 1, + "label": "Employee", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, + "report_hide": 1 + }, + { + "fieldname": "naming_series", + "fieldtype": "Select", + "label": "Series", + "no_copy": 1, + "oldfieldname": "naming_series", + "oldfieldtype": "Select", + "options": "EMP/", + "permlevel": 0, + "reqd": 0 + }, + { + "fieldname": "salutation", + "fieldtype": "Select", + "label": "Salutation", + "oldfieldname": "salutation", + "oldfieldtype": "Select", + "options": "\nMr\nMs", + "permlevel": 0, + "search_index": 0 + }, + { + "fieldname": "employee_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Full Name", + "oldfieldname": "employee_name", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "image", + "fieldtype": "Select", + "label": "Image", + "options": "attach_files:", + "permlevel": 0 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "description": "System User (login) ID. If set, it will become default for all HR forms.", + "fieldname": "user_id", + "fieldtype": "Link", + "label": "User ID", + "options": "User", + "permlevel": 0 + }, + { + "fieldname": "employee_number", + "fieldtype": "Data", + "in_filter": 1, + "label": "Employee Number", + "oldfieldname": "employee_number", + "oldfieldtype": "Data", + "permlevel": 0, + "search_index": 0 + }, + { + "fieldname": "date_of_joining", + "fieldtype": "Date", + "label": "Date of Joining", + "oldfieldname": "date_of_joining", + "oldfieldtype": "Date", + "permlevel": 0, + "reqd": 1 + }, + { + "description": "You can enter any date manually", + "fieldname": "date_of_birth", + "fieldtype": "Date", + "in_filter": 1, + "label": "Date of Birth", + "oldfieldname": "date_of_birth", + "oldfieldtype": "Date", + "permlevel": 0, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "gender", + "fieldtype": "Select", + "in_filter": 1, + "label": "Gender", + "oldfieldname": "gender", + "oldfieldtype": "Select", + "options": "\nMale\nFemale", + "permlevel": 0, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "company", + "fieldtype": "Select", + "in_filter": 1, + "label": "Company", + "options": "link:Company", + "permlevel": 0, + "print_hide": 1, + "reqd": 1 + }, + { + "fieldname": "employment_details", + "fieldtype": "Section Break", + "label": "Employment Details", + "permlevel": 0 + }, + { + "fieldname": "col_break_21", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "default": "Active", + "fieldname": "status", + "fieldtype": "Select", + "in_filter": 1, + "in_list_view": 1, + "label": "Status", + "oldfieldname": "status", + "oldfieldtype": "Select", + "options": "\nActive\nLeft", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "employment_type", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Employment Type", + "oldfieldname": "employment_type", + "oldfieldtype": "Link", + "options": "Employment Type", + "permlevel": 0, + "search_index": 0 + }, + { + "description": "Applicable Holiday List", + "fieldname": "holiday_list", + "fieldtype": "Link", + "label": "Holiday List", + "oldfieldname": "holiday_list", + "oldfieldtype": "Link", + "options": "Holiday List", + "permlevel": 0 + }, + { + "fieldname": "col_break_22", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "scheduled_confirmation_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Offer Date", + "oldfieldname": "scheduled_confirmation_date", + "oldfieldtype": "Date", + "permlevel": 0, + "search_index": 0 + }, + { + "fieldname": "final_confirmation_date", + "fieldtype": "Date", + "label": "Confirmation Date", + "oldfieldname": "final_confirmation_date", + "oldfieldtype": "Date", + "permlevel": 0, + "search_index": 0 + }, + { + "fieldname": "contract_end_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Contract End Date", + "oldfieldname": "contract_end_date", + "oldfieldtype": "Date", + "permlevel": 0, + "search_index": 0 + }, + { + "fieldname": "date_of_retirement", + "fieldtype": "Date", + "label": "Date Of Retirement", + "oldfieldname": "date_of_retirement", + "oldfieldtype": "Date", + "permlevel": 0 + }, + { + "fieldname": "job_profile", + "fieldtype": "Section Break", + "label": "Job Profile", + "permlevel": 0 + }, + { + "fieldname": "column_break2", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "branch", + "fieldtype": "Link", + "in_filter": 1, + "label": "Branch", + "oldfieldname": "branch", + "oldfieldtype": "Link", + "options": "Branch", + "permlevel": 0, + "reqd": 0 + }, + { + "fieldname": "department", + "fieldtype": "Link", + "in_filter": 1, + "label": "Department", + "oldfieldname": "department", + "oldfieldtype": "Link", + "options": "Department", + "permlevel": 0, + "reqd": 0 + }, + { + "fieldname": "designation", + "fieldtype": "Link", + "in_filter": 1, + "label": "Designation", + "oldfieldname": "designation", + "oldfieldtype": "Link", + "options": "Designation", + "permlevel": 0, + "reqd": 0, + "search_index": 1 + }, + { + "fieldname": "grade", + "fieldtype": "Link", + "in_filter": 1, + "label": "Grade", + "oldfieldname": "grade", + "oldfieldtype": "Link", + "options": "Grade", + "permlevel": 0, + "reqd": 0 + }, + { + "description": "Provide email id registered in company", + "fieldname": "company_email", + "fieldtype": "Data", + "in_filter": 1, + "label": "Company Email", + "oldfieldname": "company_email", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 0 + }, + { + "fieldname": "notice_number_of_days", + "fieldtype": "Int", + "label": "Notice (days)", + "oldfieldname": "notice_number_of_days", + "oldfieldtype": "Int", + "permlevel": 0 + }, + { + "fieldname": "salary_information", + "fieldtype": "Column Break", + "label": "Salary Information", + "oldfieldtype": "Section Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "salary_mode", + "fieldtype": "Select", + "label": "Salary Mode", + "oldfieldname": "salary_mode", + "oldfieldtype": "Select", + "options": "\nBank\nCash\nCheque", + "permlevel": 0 + }, + { + "depends_on": "eval:doc.salary_mode == 'Bank'", + "fieldname": "bank_name", + "fieldtype": "Data", + "hidden": 0, + "in_filter": 1, + "label": "Bank Name", + "oldfieldname": "bank_name", + "oldfieldtype": "Link", + "options": "Suggest", + "permlevel": 0 + }, + { + "depends_on": "eval:doc.salary_mode == 'Bank'", + "fieldname": "bank_ac_no", + "fieldtype": "Data", + "hidden": 0, + "label": "Bank A/C No.", + "oldfieldname": "bank_ac_no", + "oldfieldtype": "Data", + "permlevel": 0 + }, + { + "fieldname": "esic_card_no", + "fieldtype": "Data", + "label": "ESIC CARD No", + "oldfieldname": "esic_card_no", + "oldfieldtype": "Data", + "permlevel": 0 + }, + { + "fieldname": "pf_number", + "fieldtype": "Data", + "label": "PF Number", + "oldfieldname": "pf_number", + "oldfieldtype": "Data", + "permlevel": 0 + }, + { + "fieldname": "gratuity_lic_id", + "fieldtype": "Data", + "label": "Gratuity LIC ID", + "oldfieldname": "gratuity_lic_id", + "oldfieldtype": "Data", + "permlevel": 0 + }, + { + "fieldname": "organization_profile", + "fieldtype": "Section Break", + "label": "Organization Profile", + "permlevel": 0 + }, + { + "fieldname": "reports_to", + "fieldtype": "Link", + "ignore_restrictions": 1, + "label": "Reports to", + "oldfieldname": "reports_to", + "oldfieldtype": "Link", + "options": "Employee", + "permlevel": 0 + }, + { + "description": "The first Leave Approver in the list will be set as the default Leave Approver", + "fieldname": "employee_leave_approvers", + "fieldtype": "Table", + "label": "Leave Approvers", + "options": "Employee Leave Approver", + "permlevel": 0 + }, + { + "fieldname": "contact_details", + "fieldtype": "Section Break", + "label": "Contact Details", + "permlevel": 0 + }, + { + "fieldname": "column_break3", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "cell_number", + "fieldtype": "Data", + "label": "Cell Number", + "permlevel": 0 + }, + { + "fieldname": "personal_email", + "fieldtype": "Data", + "label": "Personal Email", + "permlevel": 0 + }, + { + "fieldname": "unsubscribed", + "fieldtype": "Check", + "label": "Unsubscribed", + "permlevel": 0 + }, + { + "fieldname": "emergency_contact_details", + "fieldtype": "HTML", + "label": "Emergency Contact Details", + "options": "

Emergency Contact Details

", + "permlevel": 0 + }, + { + "fieldname": "person_to_be_contacted", + "fieldtype": "Data", + "label": "Emergency Contact", + "permlevel": 0 + }, + { + "fieldname": "relation", + "fieldtype": "Data", + "label": "Relation", + "permlevel": 0 + }, + { + "fieldname": "emergency_phone_number", + "fieldtype": "Data", + "label": "Emergency Phone", + "permlevel": 0 + }, + { + "fieldname": "column_break4", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "permanent_accommodation_type", + "fieldtype": "Select", + "label": "Permanent Address Is", + "options": "\nRented\nOwned", + "permlevel": 0 + }, + { + "fieldname": "permanent_address", + "fieldtype": "Small Text", + "label": "Permanent Address", + "permlevel": 0 + }, + { + "fieldname": "current_accommodation_type", + "fieldtype": "Select", + "label": "Current Address Is", + "options": "\nRented\nOwned", + "permlevel": 0 + }, + { + "fieldname": "current_address", + "fieldtype": "Small Text", + "label": "Current Address", + "permlevel": 0 + }, + { + "fieldname": "sb53", + "fieldtype": "Section Break", + "label": "Bio", + "permlevel": 0 + }, + { + "description": "Short biography for website and other publications.", + "fieldname": "bio", + "fieldtype": "Text Editor", + "label": "Bio", + "permlevel": 0 + }, + { + "fieldname": "personal_details", + "fieldtype": "Section Break", + "label": "Personal Details", + "permlevel": 0 + }, + { + "fieldname": "column_break5", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "pan_number", + "fieldtype": "Data", + "label": "PAN Number", + "permlevel": 0 + }, + { + "fieldname": "passport_number", + "fieldtype": "Data", + "label": "Passport Number", + "permlevel": 0 + }, + { + "fieldname": "date_of_issue", + "fieldtype": "Date", + "label": "Date of Issue", + "permlevel": 0 + }, + { + "fieldname": "valid_upto", + "fieldtype": "Date", + "label": "Valid Upto", + "permlevel": 0 + }, + { + "fieldname": "place_of_issue", + "fieldtype": "Data", + "label": "Place of Issue", + "permlevel": 0 + }, + { + "fieldname": "column_break6", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "marital_status", + "fieldtype": "Select", + "label": "Marital Status", + "options": "\nSingle\nMarried\nDivorced\nWidowed", + "permlevel": 0 + }, + { + "fieldname": "blood_group", + "fieldtype": "Select", + "label": "Blood Group", + "options": "\nA+\nA-\nB+\nB-\nAB+\nAB-\nO+\nO-", + "permlevel": 0 + }, + { + "description": "Here you can maintain family details like name and occupation of parent, spouse and children", + "fieldname": "family_background", + "fieldtype": "Small Text", + "label": "Family Background", + "permlevel": 0 + }, + { + "description": "Here you can maintain height, weight, allergies, medical concerns etc", + "fieldname": "health_details", + "fieldtype": "Small Text", + "label": "Health Details", + "permlevel": 0 + }, + { + "fieldname": "educational_qualification", + "fieldtype": "Section Break", + "label": "Educational Qualification", + "permlevel": 0 + }, + { + "fieldname": "educational_qualification_details", + "fieldtype": "Table", + "label": "Educational Qualification Details", + "options": "Employee Education", + "permlevel": 0 + }, + { + "fieldname": "previous_work_experience", + "fieldtype": "Section Break", + "label": "Previous Work Experience", + "options": "Simple", + "permlevel": 0 + }, + { + "fieldname": "previous_experience_details", + "fieldtype": "Table", + "label": "Employee External Work History", + "options": "Employee External Work History", + "permlevel": 0 + }, + { + "fieldname": "history_in_company", + "fieldtype": "Section Break", + "label": "History In Company", + "options": "Simple", + "permlevel": 0 + }, + { + "fieldname": "experience_in_company_details", + "fieldtype": "Table", + "label": "Employee Internal Work Historys", + "options": "Employee Internal Work History", + "permlevel": 0 + }, + { + "fieldname": "exit", + "fieldtype": "Section Break", + "label": "Exit", + "oldfieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "column_break7", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "resignation_letter_date", + "fieldtype": "Date", + "label": "Resignation Letter Date", + "oldfieldname": "resignation_letter_date", + "oldfieldtype": "Date", + "permlevel": 0 + }, + { + "fieldname": "relieving_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Relieving Date", + "oldfieldname": "relieving_date", + "oldfieldtype": "Date", + "permlevel": 0 + }, + { + "fieldname": "reason_for_leaving", + "fieldtype": "Data", + "label": "Reason for Leaving", + "oldfieldname": "reason_for_leaving", + "oldfieldtype": "Data", + "permlevel": 0 + }, + { + "fieldname": "leave_encashed", + "fieldtype": "Select", + "label": "Leave Encashed?", + "oldfieldname": "leave_encashed", + "oldfieldtype": "Select", + "options": "\nYes\nNo", + "permlevel": 0 + }, + { + "fieldname": "encashment_date", + "fieldtype": "Date", + "label": "Encashment Date", + "oldfieldname": "encashment_date", + "oldfieldtype": "Date", + "permlevel": 0 + }, + { + "fieldname": "exit_interview_details", + "fieldtype": "Column Break", + "label": "Exit Interview Details", + "oldfieldname": "col_brk6", + "oldfieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "held_on", + "fieldtype": "Date", + "label": "Held On", + "oldfieldname": "held_on", + "oldfieldtype": "Date", + "permlevel": 0 + }, + { + "fieldname": "reason_for_resignation", + "fieldtype": "Select", + "label": "Reason for Resignation", + "oldfieldname": "reason_for_resignation", + "oldfieldtype": "Select", + "options": "\nBetter Prospects\nHealth Concerns", + "permlevel": 0 + }, + { + "fieldname": "new_workplace", + "fieldtype": "Data", + "label": "New Workplace", + "oldfieldname": "new_workplace", + "oldfieldtype": "Data", + "permlevel": 0 + }, + { + "fieldname": "feedback", + "fieldtype": "Small Text", + "label": "Feedback", + "oldfieldname": "feedback", + "oldfieldtype": "Text", + "permlevel": 0 + }, + { + "fieldname": "trash_reason", + "fieldtype": "Small Text", + "label": "Trash Reason", + "oldfieldname": "trash_reason", + "oldfieldtype": "Small Text", + "permlevel": 0, + "read_only": 1 + } + ], + "icon": "icon-user", + "idx": 1, + "modified": "2014-02-03 18:06:04", + "modified_by": "Administrator", + "module": "HR", + "name": "Employee", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Employee", + "submit": 0, + "write": 0 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "restrict": 0, + "role": "HR User", + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "restrict": 1, + "role": "HR Manager", + "submit": 0, + "write": 1 + } + ], + "search_fields": "employee_name" +} \ No newline at end of file diff --git a/erpnext/hr/doctype/employee_education/employee_education.txt b/erpnext/hr/doctype/employee_education/employee_education.txt index 9204c63779..08b93cb422 100644 --- a/erpnext/hr/doctype/employee_education/employee_education.txt +++ b/erpnext/hr/doctype/employee_education/employee_education.txt @@ -1,79 +1,71 @@ -[ - { - "creation": "2013-02-22 01:27:45", - "docstatus": 0, - "modified": "2013-12-20 19:23:12", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "istable": 1, - "module": "HR", - "name": "__common__" - }, - { - "doctype": "DocField", - "in_list_view": 1, - "name": "__common__", - "parent": "Employee Education", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Employee Education" - }, - { - "doctype": "DocField", - "fieldname": "school_univ", - "fieldtype": "Small Text", - "label": "School/University", - "oldfieldname": "school_univ", - "oldfieldtype": "Small Text" - }, - { - "doctype": "DocField", - "fieldname": "qualification", - "fieldtype": "Data", - "label": "Qualification", - "oldfieldname": "qualification", - "oldfieldtype": "Data", - "print_width": "100px", - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "level", - "fieldtype": "Select", - "label": "Level", - "oldfieldname": "level", - "oldfieldtype": "Select", - "options": "Graduate\nPost Graduate\nUnder Graduate" - }, - { - "doctype": "DocField", - "fieldname": "year_of_passing", - "fieldtype": "Int", - "label": "Year of Passing", - "oldfieldname": "year_of_passing", - "oldfieldtype": "Int" - }, - { - "doctype": "DocField", - "fieldname": "class_per", - "fieldtype": "Data", - "label": "Class / Percentage", - "oldfieldname": "class_per", - "oldfieldtype": "Data" - }, - { - "doctype": "DocField", - "fieldname": "maj_opt_subj", - "fieldtype": "Text", - "label": "Major/Optional Subjects", - "oldfieldname": "maj_opt_subj", - "oldfieldtype": "Text" - } -] \ No newline at end of file +{ + "creation": "2013-02-22 01:27:45", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "school_univ", + "fieldtype": "Small Text", + "in_list_view": 1, + "label": "School/University", + "oldfieldname": "school_univ", + "oldfieldtype": "Small Text", + "permlevel": 0 + }, + { + "fieldname": "qualification", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Qualification", + "oldfieldname": "qualification", + "oldfieldtype": "Data", + "permlevel": 0, + "print_width": "100px", + "width": "100px" + }, + { + "fieldname": "level", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Level", + "oldfieldname": "level", + "oldfieldtype": "Select", + "options": "Graduate\nPost Graduate\nUnder Graduate", + "permlevel": 0 + }, + { + "fieldname": "year_of_passing", + "fieldtype": "Int", + "in_list_view": 1, + "label": "Year of Passing", + "oldfieldname": "year_of_passing", + "oldfieldtype": "Int", + "permlevel": 0 + }, + { + "fieldname": "class_per", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Class / Percentage", + "oldfieldname": "class_per", + "oldfieldtype": "Data", + "permlevel": 0 + }, + { + "fieldname": "maj_opt_subj", + "fieldtype": "Text", + "in_list_view": 1, + "label": "Major/Optional Subjects", + "oldfieldname": "maj_opt_subj", + "oldfieldtype": "Text", + "permlevel": 0 + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:23:12", + "modified_by": "Administrator", + "module": "HR", + "name": "Employee Education", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.txt b/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.txt index 962c98194e..7ad2d8c9ab 100644 --- a/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.txt +++ b/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.txt @@ -1,77 +1,69 @@ -[ - { - "creation": "2013-02-22 01:27:45", - "docstatus": 0, - "modified": "2013-12-20 19:23:12", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "istable": 1, - "module": "HR", - "name": "__common__" - }, - { - "doctype": "DocField", - "in_list_view": 1, - "name": "__common__", - "parent": "Employee External Work History", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Employee External Work History" - }, - { - "doctype": "DocField", - "fieldname": "company_name", - "fieldtype": "Data", - "label": "Company", - "oldfieldname": "company_name", - "oldfieldtype": "Data" - }, - { - "doctype": "DocField", - "fieldname": "designation", - "fieldtype": "Data", - "label": "Designation", - "oldfieldname": "designation", - "oldfieldtype": "Data" - }, - { - "doctype": "DocField", - "fieldname": "salary", - "fieldtype": "Currency", - "label": "Salary", - "oldfieldname": "salary", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency" - }, - { - "doctype": "DocField", - "fieldname": "address", - "fieldtype": "Small Text", - "label": "Address", - "oldfieldname": "address", - "oldfieldtype": "Small Text" - }, - { - "doctype": "DocField", - "fieldname": "contact", - "fieldtype": "Data", - "label": "Contact", - "oldfieldname": "contact", - "oldfieldtype": "Data" - }, - { - "doctype": "DocField", - "fieldname": "total_experience", - "fieldtype": "Data", - "label": "Total Experience", - "oldfieldname": "total_experience", - "oldfieldtype": "Data" - } -] \ No newline at end of file +{ + "creation": "2013-02-22 01:27:45", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "company_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Company", + "oldfieldname": "company_name", + "oldfieldtype": "Data", + "permlevel": 0 + }, + { + "fieldname": "designation", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Designation", + "oldfieldname": "designation", + "oldfieldtype": "Data", + "permlevel": 0 + }, + { + "fieldname": "salary", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Salary", + "oldfieldname": "salary", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0 + }, + { + "fieldname": "address", + "fieldtype": "Small Text", + "in_list_view": 1, + "label": "Address", + "oldfieldname": "address", + "oldfieldtype": "Small Text", + "permlevel": 0 + }, + { + "fieldname": "contact", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Contact", + "oldfieldname": "contact", + "oldfieldtype": "Data", + "permlevel": 0 + }, + { + "fieldname": "total_experience", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Total Experience", + "oldfieldname": "total_experience", + "oldfieldtype": "Data", + "permlevel": 0 + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:23:12", + "modified_by": "Administrator", + "module": "HR", + "name": "Employee External Work History", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.txt b/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.txt index 2c964faba8..c9a9ab0f3b 100644 --- a/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.txt +++ b/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.txt @@ -1,80 +1,72 @@ -[ - { - "creation": "2013-02-22 01:27:45", - "docstatus": 0, - "modified": "2013-12-20 19:23:12", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "istable": 1, - "module": "HR", - "name": "__common__" - }, - { - "doctype": "DocField", - "in_list_view": 1, - "name": "__common__", - "parent": "Employee Internal Work History", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Employee Internal Work History" - }, - { - "doctype": "DocField", - "fieldname": "branch", - "fieldtype": "Select", - "label": "Branch", - "oldfieldname": "branch", - "oldfieldtype": "Select", - "options": "link:Branch" - }, - { - "doctype": "DocField", - "fieldname": "department", - "fieldtype": "Select", - "label": "Department", - "oldfieldname": "department", - "oldfieldtype": "Select", - "options": "link:Department" - }, - { - "doctype": "DocField", - "fieldname": "designation", - "fieldtype": "Select", - "label": "Designation", - "oldfieldname": "designation", - "oldfieldtype": "Select", - "options": "link:Designation" - }, - { - "doctype": "DocField", - "fieldname": "grade", - "fieldtype": "Select", - "label": "Grade", - "oldfieldname": "grade", - "oldfieldtype": "Select", - "options": "link:Grade" - }, - { - "doctype": "DocField", - "fieldname": "from_date", - "fieldtype": "Date", - "label": "From Date", - "oldfieldname": "from_date", - "oldfieldtype": "Date" - }, - { - "doctype": "DocField", - "fieldname": "to_date", - "fieldtype": "Date", - "label": "To Date", - "oldfieldname": "to_date", - "oldfieldtype": "Date" - } -] \ No newline at end of file +{ + "creation": "2013-02-22 01:27:45", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "branch", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Branch", + "oldfieldname": "branch", + "oldfieldtype": "Select", + "options": "link:Branch", + "permlevel": 0 + }, + { + "fieldname": "department", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Department", + "oldfieldname": "department", + "oldfieldtype": "Select", + "options": "link:Department", + "permlevel": 0 + }, + { + "fieldname": "designation", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Designation", + "oldfieldname": "designation", + "oldfieldtype": "Select", + "options": "link:Designation", + "permlevel": 0 + }, + { + "fieldname": "grade", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Grade", + "oldfieldname": "grade", + "oldfieldtype": "Select", + "options": "link:Grade", + "permlevel": 0 + }, + { + "fieldname": "from_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "From Date", + "oldfieldname": "from_date", + "oldfieldtype": "Date", + "permlevel": 0 + }, + { + "fieldname": "to_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "To Date", + "oldfieldname": "to_date", + "oldfieldtype": "Date", + "permlevel": 0 + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:23:12", + "modified_by": "Administrator", + "module": "HR", + "name": "Employee Internal Work History", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.txt b/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.txt index 4b176d1c0f..f3b2c298a1 100644 --- a/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.txt +++ b/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.txt @@ -1,40 +1,27 @@ -[ - { - "creation": "2013-04-12 06:56:15", - "docstatus": 0, - "modified": "2013-12-20 19:23:12", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 0, - "autoname": "LAPPR-/.#####", - "description": "Users who can approve a specific employee's leave applications", - "doctype": "DocType", - "istable": 1, - "module": "HR", - "name": "__common__" - }, - { - "doctype": "DocField", - "fieldname": "leave_approver", - "fieldtype": "Select", - "in_list_view": 1, - "label": "Leave Approver", - "name": "__common__", - "parent": "Employee Leave Approver", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0, - "print_hide": 1, - "reqd": 1, - "width": "200" - }, - { - "doctype": "DocType", - "name": "Employee Leave Approver" - }, - { - "doctype": "DocField" - } -] \ No newline at end of file +{ + "allow_import": 0, + "autoname": "LAPPR-/.#####", + "creation": "2013-04-12 06:56:15", + "description": "Users who can approve a specific employee's leave applications", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "leave_approver", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Leave Approver", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, + "width": "200" + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:23:12", + "modified_by": "Administrator", + "module": "HR", + "name": "Employee Leave Approver", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/hr/doctype/employment_type/employment_type.txt b/erpnext/hr/doctype/employment_type/employment_type.txt index a91e145a5e..435e3666e8 100644 --- a/erpnext/hr/doctype/employment_type/employment_type.txt +++ b/erpnext/hr/doctype/employment_type/employment_type.txt @@ -1,73 +1,63 @@ -[ - { - "creation": "2013-01-10 16:34:14", - "docstatus": 0, - "modified": "2014-01-20 17:48:43", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "autoname": "field:employee_type_name", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-flag", - "module": "HR", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Employment Type", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "cancel": 0, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Employment Type", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Employment Type" - }, - { - "doctype": "DocField", - "fieldname": "employee_type_name", - "fieldtype": "Data", - "label": "Employment Type", - "oldfieldname": "employee_type_name", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "trash_reason", - "fieldtype": "Small Text", - "label": "Trash Reason", - "oldfieldname": "trash_reason", - "oldfieldtype": "Small Text", - "read_only": 1 - }, - { - "doctype": "DocPerm", - "role": "HR User" - }, - { - "doctype": "DocPerm", - "role": "HR Manager" - } -] \ No newline at end of file +{ + "allow_import": 1, + "autoname": "field:employee_type_name", + "creation": "2013-01-10 16:34:14", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "employee_type_name", + "fieldtype": "Data", + "label": "Employment Type", + "oldfieldname": "employee_type_name", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "trash_reason", + "fieldtype": "Small Text", + "label": "Trash Reason", + "oldfieldname": "trash_reason", + "oldfieldtype": "Small Text", + "permlevel": 0, + "read_only": 1 + } + ], + "icon": "icon-flag", + "idx": 1, + "modified": "2014-01-20 17:48:43", + "modified_by": "Administrator", + "module": "HR", + "name": "Employment Type", + "owner": "Administrator", + "permissions": [ + { + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "HR User", + "submit": 0, + "write": 1 + }, + { + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "HR Manager", + "submit": 0, + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.txt b/erpnext/hr/doctype/expense_claim/expense_claim.txt index ac7f78861d..b73594883f 100644 --- a/erpnext/hr/doctype/expense_claim/expense_claim.txt +++ b/erpnext/hr/doctype/expense_claim/expense_claim.txt @@ -1,245 +1,238 @@ -[ - { - "creation": "2013-01-10 16:34:14", - "docstatus": 0, - "modified": "2014-01-22 16:05:34", - "modified_by": "Administrator", - "owner": "harshada@webnotestech.com" - }, - { - "autoname": "EXP.######", - "doctype": "DocType", - "icon": "icon-money", - "is_submittable": 1, - "module": "HR", - "name": "__common__", - "search_fields": "approval_status,employee,employee_name" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Expense Claim", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Expense Claim", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Expense Claim" - }, - { - "default": "Draft", - "depends_on": "eval:!doc.__islocal", - "doctype": "DocField", - "fieldname": "approval_status", - "fieldtype": "Select", - "in_filter": 1, - "in_list_view": 1, - "label": "Approval Status", - "no_copy": 1, - "oldfieldname": "approval_status", - "oldfieldtype": "Select", - "options": "Draft\nApproved\nRejected", - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "exp_approver", - "fieldtype": "Select", - "label": "Approver", - "oldfieldname": "exp_approver", - "oldfieldtype": "Select", - "width": "160px" - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "total_claimed_amount", - "fieldtype": "Currency", - "in_filter": 0, - "in_list_view": 1, - "label": "Total Claimed Amount", - "no_copy": 1, - "oldfieldname": "total_claimed_amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "read_only": 1, - "reqd": 0, - "width": "160px" - }, - { - "doctype": "DocField", - "fieldname": "total_sanctioned_amount", - "fieldtype": "Currency", - "in_filter": 0, - "in_list_view": 1, - "label": "Total Sanctioned Amount", - "no_copy": 1, - "oldfieldname": "total_sanctioned_amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "read_only": 1, - "width": "160px" - }, - { - "doctype": "DocField", - "fieldname": "expense_details", - "fieldtype": "Section Break", - "label": "Expense Details", - "oldfieldtype": "Section Break" - }, - { - "allow_on_submit": 0, - "doctype": "DocField", - "fieldname": "expense_voucher_details", - "fieldtype": "Table", - "label": "Expense Claim Details", - "oldfieldname": "expense_voucher_details", - "oldfieldtype": "Table", - "options": "Expense Claim Detail" - }, - { - "doctype": "DocField", - "fieldname": "sb1", - "fieldtype": "Section Break", - "options": "Simple" - }, - { - "doctype": "DocField", - "fieldname": "employee", - "fieldtype": "Link", - "in_filter": 1, - "label": "From Employee", - "oldfieldname": "employee", - "oldfieldtype": "Link", - "options": "Employee", - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "employee_name", - "fieldtype": "Data", - "in_filter": 1, - "in_list_view": 1, - "label": "Employee Name", - "oldfieldname": "employee_name", - "oldfieldtype": "Data", - "read_only": 1, - "search_index": 0, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "fiscal_year", - "fieldtype": "Select", - "in_filter": 1, - "label": "Fiscal Year", - "oldfieldname": "fiscal_year", - "oldfieldtype": "Select", - "options": "link:Fiscal Year", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Select", - "in_filter": 1, - "label": "Company", - "oldfieldname": "company", - "oldfieldtype": "Link", - "options": "link:Company", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "cb1", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "posting_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Posting Date", - "oldfieldname": "posting_date", - "oldfieldtype": "Date", - "reqd": 1 - }, - { - "allow_on_submit": 0, - "doctype": "DocField", - "fieldname": "remark", - "fieldtype": "Small Text", - "label": "Remark", - "no_copy": 1, - "oldfieldname": "remark", - "oldfieldtype": "Small Text" - }, - { - "doctype": "DocField", - "fieldname": "email_id", - "fieldtype": "Data", - "hidden": 1, - "label": "Employees Email Id", - "oldfieldname": "email_id", - "oldfieldtype": "Data", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "amended_from", - "fieldtype": "Data", - "ignore_restrictions": 1, - "label": "Amended From", - "no_copy": 1, - "oldfieldname": "amended_from", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 1, - "report_hide": 1, - "width": "160px" - }, - { - "delete": 0, - "doctype": "DocPerm", - "restricted": 1, - "role": "Employee" - }, - { - "amend": 1, - "cancel": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Expense Approver", - "submit": 1 - }, - { - "amend": 1, - "cancel": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "HR User", - "submit": 1 - } -] \ No newline at end of file +{ + "autoname": "EXP.######", + "creation": "2013-01-10 16:34:14", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "default": "Draft", + "depends_on": "eval:!doc.__islocal", + "fieldname": "approval_status", + "fieldtype": "Select", + "in_filter": 1, + "in_list_view": 1, + "label": "Approval Status", + "no_copy": 1, + "oldfieldname": "approval_status", + "oldfieldtype": "Select", + "options": "Draft\nApproved\nRejected", + "permlevel": 0, + "search_index": 1 + }, + { + "fieldname": "exp_approver", + "fieldtype": "Select", + "label": "Approver", + "oldfieldname": "exp_approver", + "oldfieldtype": "Select", + "permlevel": 0, + "width": "160px" + }, + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "total_claimed_amount", + "fieldtype": "Currency", + "in_filter": 0, + "in_list_view": 1, + "label": "Total Claimed Amount", + "no_copy": 1, + "oldfieldname": "total_claimed_amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1, + "reqd": 0, + "width": "160px" + }, + { + "fieldname": "total_sanctioned_amount", + "fieldtype": "Currency", + "in_filter": 0, + "in_list_view": 1, + "label": "Total Sanctioned Amount", + "no_copy": 1, + "oldfieldname": "total_sanctioned_amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1, + "width": "160px" + }, + { + "fieldname": "expense_details", + "fieldtype": "Section Break", + "label": "Expense Details", + "oldfieldtype": "Section Break", + "permlevel": 0 + }, + { + "allow_on_submit": 0, + "fieldname": "expense_voucher_details", + "fieldtype": "Table", + "label": "Expense Claim Details", + "oldfieldname": "expense_voucher_details", + "oldfieldtype": "Table", + "options": "Expense Claim Detail", + "permlevel": 0 + }, + { + "fieldname": "sb1", + "fieldtype": "Section Break", + "options": "Simple", + "permlevel": 0 + }, + { + "fieldname": "employee", + "fieldtype": "Link", + "in_filter": 1, + "label": "From Employee", + "oldfieldname": "employee", + "oldfieldtype": "Link", + "options": "Employee", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "employee_name", + "fieldtype": "Data", + "in_filter": 1, + "in_list_view": 1, + "label": "Employee Name", + "oldfieldname": "employee_name", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1, + "search_index": 0, + "width": "150px" + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Select", + "in_filter": 1, + "label": "Fiscal Year", + "oldfieldname": "fiscal_year", + "oldfieldtype": "Select", + "options": "link:Fiscal Year", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "company", + "fieldtype": "Select", + "in_filter": 1, + "label": "Company", + "oldfieldname": "company", + "oldfieldtype": "Link", + "options": "link:Company", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "cb1", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "posting_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Posting Date", + "oldfieldname": "posting_date", + "oldfieldtype": "Date", + "permlevel": 0, + "reqd": 1 + }, + { + "allow_on_submit": 0, + "fieldname": "remark", + "fieldtype": "Small Text", + "label": "Remark", + "no_copy": 1, + "oldfieldname": "remark", + "oldfieldtype": "Small Text", + "permlevel": 0 + }, + { + "fieldname": "email_id", + "fieldtype": "Data", + "hidden": 1, + "label": "Employees Email Id", + "oldfieldname": "email_id", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "amended_from", + "fieldtype": "Data", + "ignore_restrictions": 1, + "label": "Amended From", + "no_copy": 1, + "oldfieldname": "amended_from", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "report_hide": 1, + "width": "160px" + } + ], + "icon": "icon-money", + "idx": 1, + "is_submittable": 1, + "modified": "2014-01-22 16:05:34", + "modified_by": "Administrator", + "module": "HR", + "name": "Expense Claim", + "owner": "harshada@webnotestech.com", + "permissions": [ + { + "create": 1, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "restricted": 1, + "role": "Employee", + "write": 1 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Expense Approver", + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "HR User", + "submit": 1, + "write": 1 + } + ], + "search_fields": "approval_status,employee,employee_name" +} \ No newline at end of file diff --git a/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.txt b/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.txt index 18b8036b33..c04a2be7b2 100644 --- a/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.txt +++ b/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.txt @@ -1,86 +1,77 @@ -[ - { - "creation": "2013-02-22 01:27:46", - "docstatus": 0, - "modified": "2013-12-20 19:23:13", - "modified_by": "Administrator", - "owner": "harshada@webnotestech.com" - }, - { - "doctype": "DocType", - "istable": 1, - "module": "HR", - "name": "__common__" - }, - { - "doctype": "DocField", - "in_list_view": 1, - "name": "__common__", - "parent": "Expense Claim Detail", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Expense Claim Detail" - }, - { - "doctype": "DocField", - "fieldname": "expense_date", - "fieldtype": "Date", - "label": "Expense Date", - "oldfieldname": "expense_date", - "oldfieldtype": "Date", - "print_width": "150px", - "reqd": 0, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "expense_type", - "fieldtype": "Select", - "label": "Expense Claim Type", - "oldfieldname": "expense_type", - "oldfieldtype": "Link", - "options": "link:Expense Claim Type", - "print_width": "150px", - "reqd": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Small Text", - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Small Text", - "print_width": "300px", - "width": "300px" - }, - { - "doctype": "DocField", - "fieldname": "claim_amount", - "fieldtype": "Currency", - "label": "Claim Amount", - "oldfieldname": "claim_amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_width": "150px", - "reqd": 1, - "width": "150px" - }, - { - "allow_on_submit": 0, - "doctype": "DocField", - "fieldname": "sanctioned_amount", - "fieldtype": "Currency", - "label": "Sanctioned Amount", - "no_copy": 1, - "oldfieldname": "sanctioned_amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_width": "150px", - "width": "150px" - } -] \ No newline at end of file +{ + "creation": "2013-02-22 01:27:46", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "expense_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "Expense Date", + "oldfieldname": "expense_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_width": "150px", + "reqd": 0, + "width": "150px" + }, + { + "fieldname": "expense_type", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Expense Claim Type", + "oldfieldname": "expense_type", + "oldfieldtype": "Link", + "options": "link:Expense Claim Type", + "permlevel": 0, + "print_width": "150px", + "reqd": 1, + "width": "150px" + }, + { + "fieldname": "description", + "fieldtype": "Small Text", + "in_list_view": 1, + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_width": "300px", + "width": "300px" + }, + { + "fieldname": "claim_amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Claim Amount", + "oldfieldname": "claim_amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_width": "150px", + "reqd": 1, + "width": "150px" + }, + { + "allow_on_submit": 0, + "fieldname": "sanctioned_amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Sanctioned Amount", + "no_copy": 1, + "oldfieldname": "sanctioned_amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_width": "150px", + "width": "150px" + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:23:13", + "modified_by": "Administrator", + "module": "HR", + "name": "Expense Claim Detail", + "owner": "harshada@webnotestech.com" +} \ No newline at end of file diff --git a/erpnext/hr/doctype/expense_claim_type/expense_claim_type.txt b/erpnext/hr/doctype/expense_claim_type/expense_claim_type.txt index 689da6eb48..7f08f3b6e7 100644 --- a/erpnext/hr/doctype/expense_claim_type/expense_claim_type.txt +++ b/erpnext/hr/doctype/expense_claim_type/expense_claim_type.txt @@ -1,68 +1,49 @@ -[ - { - "creation": "2012-03-27 14:35:55", - "docstatus": 0, - "modified": "2013-12-20 19:24:07", - "modified_by": "Administrator", - "owner": "harshada@webnotestech.com" - }, - { - "allow_import": 1, - "autoname": "field:expense_type", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-flag", - "module": "HR", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Expense Claim Type", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Expense Claim Type", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "HR Manager", - "write": 1 - }, - { - "doctype": "DocType", - "name": "Expense Claim Type" - }, - { - "doctype": "DocField", - "fieldname": "expense_type", - "fieldtype": "Data", - "in_filter": 0, - "label": "Expense Claim Type", - "oldfieldname": "expense_type", - "oldfieldtype": "Data", - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Small Text", - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Small Text", - "width": "300px" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "allow_import": 1, + "autoname": "field:expense_type", + "creation": "2012-03-27 14:35:55", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "expense_type", + "fieldtype": "Data", + "in_filter": 0, + "label": "Expense Claim Type", + "oldfieldname": "expense_type", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "description", + "fieldtype": "Small Text", + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Small Text", + "permlevel": 0, + "width": "300px" + } + ], + "icon": "icon-flag", + "idx": 1, + "modified": "2013-12-20 19:24:07", + "modified_by": "Administrator", + "module": "HR", + "name": "Expense Claim Type", + "owner": "harshada@webnotestech.com", + "permissions": [ + { + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "HR Manager", + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/hr/doctype/grade/grade.txt b/erpnext/hr/doctype/grade/grade.txt index dcadd634a2..1f56bda8a7 100644 --- a/erpnext/hr/doctype/grade/grade.txt +++ b/erpnext/hr/doctype/grade/grade.txt @@ -1,60 +1,41 @@ -[ - { - "creation": "2013-01-10 16:34:14", - "docstatus": 0, - "modified": "2014-01-20 17:48:46", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "autoname": "field:grade_name", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-star-half-empty", - "module": "HR", - "name": "__common__" - }, - { - "doctype": "DocField", - "fieldname": "grade_name", - "fieldtype": "Data", - "label": "Grade", - "name": "__common__", - "oldfieldname": "grade_name", - "oldfieldtype": "Data", - "parent": "Grade", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0, - "reqd": 1 - }, - { - "cancel": 0, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Grade", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "HR User", - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Grade" - }, - { - "doctype": "DocField" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "allow_import": 1, + "autoname": "field:grade_name", + "creation": "2013-01-10 16:34:14", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "grade_name", + "fieldtype": "Data", + "label": "Grade", + "oldfieldname": "grade_name", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + } + ], + "icon": "icon-star-half-empty", + "idx": 1, + "modified": "2014-01-20 17:48:46", + "modified_by": "Administrator", + "module": "HR", + "name": "Grade", + "owner": "Administrator", + "permissions": [ + { + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "HR User", + "submit": 0, + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/hr/doctype/holiday/holiday.txt b/erpnext/hr/doctype/holiday/holiday.txt index ad8ddb07d3..39f93833c0 100644 --- a/erpnext/hr/doctype/holiday/holiday.txt +++ b/erpnext/hr/doctype/holiday/holiday.txt @@ -1,44 +1,32 @@ -[ - { - "creation": "2013-02-22 01:27:46", - "docstatus": 0, - "modified": "2013-12-20 19:23:14", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "istable": 1, - "module": "HR", - "name": "__common__" - }, - { - "doctype": "DocField", - "in_list_view": 1, - "name": "__common__", - "parent": "Holiday", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Holiday" - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Small Text", - "label": "Description", - "print_width": "300px", - "width": "300px" - }, - { - "doctype": "DocField", - "fieldname": "holiday_date", - "fieldtype": "Date", - "label": "Date", - "oldfieldname": "holiday_date", - "oldfieldtype": "Date" - } -] \ No newline at end of file +{ + "creation": "2013-02-22 01:27:46", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "description", + "fieldtype": "Small Text", + "in_list_view": 1, + "label": "Description", + "permlevel": 0, + "print_width": "300px", + "width": "300px" + }, + { + "fieldname": "holiday_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "Date", + "oldfieldname": "holiday_date", + "oldfieldtype": "Date", + "permlevel": 0 + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:23:14", + "modified_by": "Administrator", + "module": "HR", + "name": "Holiday", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/hr/doctype/holiday_list/holiday_list.txt b/erpnext/hr/doctype/holiday_list/holiday_list.txt index 3122583866..66e57fc424 100644 --- a/erpnext/hr/doctype/holiday_list/holiday_list.txt +++ b/erpnext/hr/doctype/holiday_list/holiday_list.txt @@ -1,119 +1,100 @@ -[ - { - "creation": "2013-01-10 16:34:14", - "docstatus": 0, - "modified": "2014-01-20 17:48:46", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-calendar", - "module": "HR", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Holiday List", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "cancel": 0, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Holiday List", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "HR Manager", - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Holiday List" - }, - { - "doctype": "DocField", - "fieldname": "trash_reason", - "fieldtype": "Small Text", - "label": "Trash Reason", - "oldfieldname": "trash_reason", - "oldfieldtype": "Small Text", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "holiday_list_name", - "fieldtype": "Data", - "label": "Holiday List Name", - "oldfieldname": "holiday_list_name", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "is_default", - "fieldtype": "Check", - "label": "Default" - }, - { - "doctype": "DocField", - "fieldname": "fiscal_year", - "fieldtype": "Select", - "in_filter": 1, - "label": "Fiscal Year", - "oldfieldname": "fiscal_year", - "oldfieldtype": "Link", - "options": "link:Fiscal Year", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "weekly_off", - "fieldtype": "Select", - "label": "Weekly Off", - "no_copy": 1, - "options": "\nSunday\nMonday\nTuesday\nWednesday\nThursday\nFriday\nSaturday", - "print_hide": 1, - "report_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "get_weekly_off_dates", - "fieldtype": "Button", - "label": "Get Weekly Off Dates", - "options": "get_weekly_off_dates" - }, - { - "doctype": "DocField", - "fieldname": "holiday_list_details", - "fieldtype": "Table", - "label": "Holidays", - "oldfieldname": "holiday_list_details", - "oldfieldtype": "Table", - "options": "Holiday", - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "clear_table", - "fieldtype": "Button", - "label": "Clear Table", - "options": "clear_table" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "allow_import": 1, + "creation": "2013-01-10 16:34:14", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "trash_reason", + "fieldtype": "Small Text", + "label": "Trash Reason", + "oldfieldname": "trash_reason", + "oldfieldtype": "Small Text", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "holiday_list_name", + "fieldtype": "Data", + "label": "Holiday List Name", + "oldfieldname": "holiday_list_name", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "is_default", + "fieldtype": "Check", + "label": "Default", + "permlevel": 0 + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Select", + "in_filter": 1, + "label": "Fiscal Year", + "oldfieldname": "fiscal_year", + "oldfieldtype": "Link", + "options": "link:Fiscal Year", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "weekly_off", + "fieldtype": "Select", + "label": "Weekly Off", + "no_copy": 1, + "options": "\nSunday\nMonday\nTuesday\nWednesday\nThursday\nFriday\nSaturday", + "permlevel": 0, + "print_hide": 1, + "report_hide": 1 + }, + { + "fieldname": "get_weekly_off_dates", + "fieldtype": "Button", + "label": "Get Weekly Off Dates", + "options": "get_weekly_off_dates", + "permlevel": 0 + }, + { + "fieldname": "holiday_list_details", + "fieldtype": "Table", + "label": "Holidays", + "oldfieldname": "holiday_list_details", + "oldfieldtype": "Table", + "options": "Holiday", + "permlevel": 0, + "reqd": 0 + }, + { + "fieldname": "clear_table", + "fieldtype": "Button", + "label": "Clear Table", + "options": "clear_table", + "permlevel": 0 + } + ], + "icon": "icon-calendar", + "idx": 1, + "modified": "2014-01-20 17:48:46", + "modified_by": "Administrator", + "module": "HR", + "name": "Holiday List", + "owner": "Administrator", + "permissions": [ + { + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "HR Manager", + "submit": 0, + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/hr/doctype/hr_settings/hr_settings.txt b/erpnext/hr/doctype/hr_settings/hr_settings.txt index d30dc0a3c2..2b94c0b9e3 100644 --- a/erpnext/hr/doctype/hr_settings/hr_settings.txt +++ b/erpnext/hr/doctype/hr_settings/hr_settings.txt @@ -1,81 +1,62 @@ -[ - { - "creation": "2013-08-02 13:45:23", - "docstatus": 0, - "modified": "2014-02-19 17:40:18", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "document_type": "Other", - "icon": "icon-cog", - "issingle": 1, - "module": "HR", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "HR Settings", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "HR Settings", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "role": "System Manager", - "write": 1 - }, - { - "doctype": "DocType", - "name": "HR Settings" - }, - { - "doctype": "DocField", - "fieldname": "employee_settings", - "fieldtype": "Section Break", - "label": "Employee Settings" - }, - { - "default": "Naming Series", - "description": "Employee record is created using selected field. ", - "doctype": "DocField", - "fieldname": "emp_created_by", - "fieldtype": "Select", - "label": "Employee Records to be created by", - "options": "Naming Series\nEmployee Number" - }, - { - "description": "Don't send Employee Birthday Reminders", - "doctype": "DocField", - "fieldname": "stop_birthday_reminders", - "fieldtype": "Check", - "label": "Stop Birthday Reminders" - }, - { - "doctype": "DocField", - "fieldname": "payroll_settings", - "fieldtype": "Section Break", - "label": "Payroll Settings" - }, - { - "description": "If checked, Total no. of Working Days will include holidays, and this will reduce the value of Salary Per Day", - "doctype": "DocField", - "fieldname": "include_holidays_in_total_working_days", - "fieldtype": "Check", - "label": "Include holidays in Total no. of Working Days" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "creation": "2013-08-02 13:45:23", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Other", + "fields": [ + { + "fieldname": "employee_settings", + "fieldtype": "Section Break", + "label": "Employee Settings", + "permlevel": 0 + }, + { + "default": "Naming Series", + "description": "Employee record is created using selected field. ", + "fieldname": "emp_created_by", + "fieldtype": "Select", + "label": "Employee Records to be created by", + "options": "Naming Series\nEmployee Number", + "permlevel": 0 + }, + { + "description": "Don't send Employee Birthday Reminders", + "fieldname": "stop_birthday_reminders", + "fieldtype": "Check", + "label": "Stop Birthday Reminders", + "permlevel": 0 + }, + { + "fieldname": "payroll_settings", + "fieldtype": "Section Break", + "label": "Payroll Settings", + "permlevel": 0 + }, + { + "description": "If checked, Total no. of Working Days will include holidays, and this will reduce the value of Salary Per Day", + "fieldname": "include_holidays_in_total_working_days", + "fieldtype": "Check", + "label": "Include holidays in Total no. of Working Days", + "permlevel": 0 + } + ], + "icon": "icon-cog", + "idx": 1, + "issingle": 1, + "modified": "2014-02-19 17:40:18", + "modified_by": "Administrator", + "module": "HR", + "name": "HR Settings", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "role": "System Manager", + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/hr/doctype/job_applicant/job_applicant.txt b/erpnext/hr/doctype/job_applicant/job_applicant.txt index fd463fb7e9..a7edcfff9d 100644 --- a/erpnext/hr/doctype/job_applicant/job_applicant.txt +++ b/erpnext/hr/doctype/job_applicant/job_applicant.txt @@ -1,107 +1,88 @@ -[ - { - "creation": "2013-01-29 19:25:37", - "docstatus": 0, - "modified": "2014-01-20 17:48:50", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_attach": 1, - "autoname": "field:applicant_name", - "description": "Applicant for a Job", - "doctype": "DocType", - "document_type": "Transaction", - "icon": "icon-user", - "module": "HR", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Job Applicant", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Job Applicant", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "HR User", - "write": 1 - }, - { - "doctype": "DocType", - "name": "Job Applicant" - }, - { - "doctype": "DocField", - "fieldname": "applicant_name", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Applicant Name", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "email_id", - "fieldtype": "Data", - "label": "Email Id" - }, - { - "doctype": "DocField", - "fieldname": "status", - "fieldtype": "Select", - "in_list_view": 1, - "label": "Status", - "options": "Open\nReplied\nRejected\nHold" - }, - { - "doctype": "DocField", - "fieldname": "column_break_3", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "job_opening", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Job Opening", - "options": "Job Opening" - }, - { - "doctype": "DocField", - "fieldname": "section_break_5", - "fieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "thread_html", - "fieldtype": "HTML", - "label": "Thread HTML" - }, - { - "doctype": "DocField", - "fieldname": "communications", - "fieldtype": "Table", - "hidden": 1, - "label": "Communications", - "options": "Communication", - "print_hide": 1 - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "allow_attach": 1, + "autoname": "field:applicant_name", + "creation": "2013-01-29 19:25:37", + "description": "Applicant for a Job", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Transaction", + "fields": [ + { + "fieldname": "applicant_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Applicant Name", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "email_id", + "fieldtype": "Data", + "label": "Email Id", + "permlevel": 0 + }, + { + "fieldname": "status", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Status", + "options": "Open\nReplied\nRejected\nHold", + "permlevel": 0 + }, + { + "fieldname": "column_break_3", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "job_opening", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Job Opening", + "options": "Job Opening", + "permlevel": 0 + }, + { + "fieldname": "section_break_5", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "thread_html", + "fieldtype": "HTML", + "label": "Thread HTML", + "permlevel": 0 + }, + { + "fieldname": "communications", + "fieldtype": "Table", + "hidden": 1, + "label": "Communications", + "options": "Communication", + "permlevel": 0, + "print_hide": 1 + } + ], + "icon": "icon-user", + "idx": 1, + "modified": "2014-01-20 17:48:50", + "modified_by": "Administrator", + "module": "HR", + "name": "Job Applicant", + "owner": "Administrator", + "permissions": [ + { + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "HR User", + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/hr/doctype/job_opening/job_opening.txt b/erpnext/hr/doctype/job_opening/job_opening.txt index b118b6a8d1..827f94c5ab 100644 --- a/erpnext/hr/doctype/job_opening/job_opening.txt +++ b/erpnext/hr/doctype/job_opening/job_opening.txt @@ -1,71 +1,52 @@ -[ - { - "creation": "2013-01-15 16:13:36", - "docstatus": 0, - "modified": "2014-01-20 17:48:51", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "field:job_title", - "description": "Description of a Job Opening", - "doctype": "DocType", - "document_type": "Transaction", - "icon": "icon-bookmark", - "module": "HR", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Job Opening", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Job Opening", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "HR User", - "write": 1 - }, - { - "doctype": "DocType", - "name": "Job Opening" - }, - { - "doctype": "DocField", - "fieldname": "job_title", - "fieldtype": "Data", - "label": "Job Title", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "status", - "fieldtype": "Select", - "label": "Status", - "options": "Open\nClosed" - }, - { - "description": "Job profile, qualifications required etc.", - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Text Editor", - "label": "Description" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "autoname": "field:job_title", + "creation": "2013-01-15 16:13:36", + "description": "Description of a Job Opening", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Transaction", + "fields": [ + { + "fieldname": "job_title", + "fieldtype": "Data", + "label": "Job Title", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "status", + "fieldtype": "Select", + "label": "Status", + "options": "Open\nClosed", + "permlevel": 0 + }, + { + "description": "Job profile, qualifications required etc.", + "fieldname": "description", + "fieldtype": "Text Editor", + "label": "Description", + "permlevel": 0 + } + ], + "icon": "icon-bookmark", + "idx": 1, + "modified": "2014-01-20 17:48:51", + "modified_by": "Administrator", + "module": "HR", + "name": "Job Opening", + "owner": "Administrator", + "permissions": [ + { + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "HR User", + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/hr/doctype/leave_allocation/leave_allocation.txt b/erpnext/hr/doctype/leave_allocation/leave_allocation.txt index 60f2523941..bf576303f0 100644 --- a/erpnext/hr/doctype/leave_allocation/leave_allocation.txt +++ b/erpnext/hr/doctype/leave_allocation/leave_allocation.txt @@ -1,181 +1,172 @@ -[ - { - "creation": "2013-02-20 19:10:38", - "docstatus": 0, - "modified": "2014-01-22 16:05:35", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "autoname": "LAL/.#####", - "doctype": "DocType", - "icon": "icon-ok", - "is_submittable": 1, - "module": "HR", - "name": "__common__", - "search_fields": "employee,employee_name,leave_type,total_leaves_allocated,fiscal_year" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Leave Allocation", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Leave Allocation", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 1, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Leave Allocation" - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "employee", - "fieldtype": "Link", - "in_filter": 1, - "label": "Employee", - "oldfieldname": "employee", - "oldfieldtype": "Link", - "options": "Employee", - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "employee_name", - "fieldtype": "Data", - "in_filter": 1, - "label": "Employee Name", - "read_only": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "leave_type", - "fieldtype": "Select", - "in_filter": 1, - "label": "Leave Type", - "oldfieldname": "leave_type", - "oldfieldtype": "Link", - "options": "link:Leave Type", - "reqd": 1, - "search_index": 1 - }, - { - "default": "Today", - "doctype": "DocField", - "fieldname": "posting_date", - "fieldtype": "Date", - "hidden": 0, - "label": "Posting Date", - "no_copy": 1, - "oldfieldname": "date", - "oldfieldtype": "Date", - "read_only": 1, - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "fiscal_year", - "fieldtype": "Select", - "in_filter": 1, - "label": "Fiscal Year", - "oldfieldname": "fiscal_year", - "oldfieldtype": "Data", - "options": "link:Fiscal Year", - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Small Text", - "hidden": 0, - "label": "Description", - "oldfieldname": "reason", - "oldfieldtype": "Small Text", - "width": "300px" - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "carry_forward", - "fieldtype": "Check", - "label": "Carry Forward" - }, - { - "depends_on": "carry_forward", - "doctype": "DocField", - "fieldname": "carry_forwarded_leaves", - "fieldtype": "Float", - "label": "Carry Forwarded Leaves", - "read_only": 1 - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "new_leaves_allocated", - "fieldtype": "Float", - "label": "New Leaves Allocated" - }, - { - "doctype": "DocField", - "fieldname": "total_leaves_allocated", - "fieldtype": "Float", - "label": "Total Leaves Allocated", - "read_only": 1, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "amended_from", - "fieldtype": "Data", - "hidden": 0, - "ignore_restrictions": 1, - "label": "Amended From", - "no_copy": 1, - "oldfieldname": "amended_from", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocPerm", - "restricted": 1, - "role": "HR User" - }, - { - "doctype": "DocPerm", - "role": "HR Manager" - } -] \ No newline at end of file +{ + "allow_import": 1, + "autoname": "LAL/.#####", + "creation": "2013-02-20 19:10:38", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "employee", + "fieldtype": "Link", + "in_filter": 1, + "label": "Employee", + "oldfieldname": "employee", + "oldfieldtype": "Link", + "options": "Employee", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "employee_name", + "fieldtype": "Data", + "in_filter": 1, + "label": "Employee Name", + "permlevel": 0, + "read_only": 1, + "search_index": 1 + }, + { + "fieldname": "leave_type", + "fieldtype": "Select", + "in_filter": 1, + "label": "Leave Type", + "oldfieldname": "leave_type", + "oldfieldtype": "Link", + "options": "link:Leave Type", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "default": "Today", + "fieldname": "posting_date", + "fieldtype": "Date", + "hidden": 0, + "label": "Posting Date", + "no_copy": 1, + "oldfieldname": "date", + "oldfieldtype": "Date", + "permlevel": 0, + "read_only": 1, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Select", + "in_filter": 1, + "label": "Fiscal Year", + "oldfieldname": "fiscal_year", + "oldfieldtype": "Data", + "options": "link:Fiscal Year", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "description", + "fieldtype": "Small Text", + "hidden": 0, + "label": "Description", + "oldfieldname": "reason", + "oldfieldtype": "Small Text", + "permlevel": 0, + "width": "300px" + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "carry_forward", + "fieldtype": "Check", + "label": "Carry Forward", + "permlevel": 0 + }, + { + "depends_on": "carry_forward", + "fieldname": "carry_forwarded_leaves", + "fieldtype": "Float", + "label": "Carry Forwarded Leaves", + "permlevel": 0, + "read_only": 1 + }, + { + "allow_on_submit": 1, + "fieldname": "new_leaves_allocated", + "fieldtype": "Float", + "label": "New Leaves Allocated", + "permlevel": 0 + }, + { + "fieldname": "total_leaves_allocated", + "fieldtype": "Float", + "label": "Total Leaves Allocated", + "permlevel": 0, + "read_only": 1, + "reqd": 1 + }, + { + "fieldname": "amended_from", + "fieldtype": "Data", + "hidden": 0, + "ignore_restrictions": 1, + "label": "Amended From", + "no_copy": 1, + "oldfieldname": "amended_from", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + } + ], + "icon": "icon-ok", + "idx": 1, + "is_submittable": 1, + "modified": "2014-01-22 16:05:35", + "modified_by": "Administrator", + "module": "HR", + "name": "Leave Allocation", + "owner": "Administrator", + "permissions": [ + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "restricted": 1, + "role": "HR User", + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "HR Manager", + "submit": 1, + "write": 1 + } + ], + "search_fields": "employee,employee_name,leave_type,total_leaves_allocated,fiscal_year" +} \ 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 b56a0ed120..38160ccb85 100644 --- a/erpnext/hr/doctype/leave_application/leave_application.txt +++ b/erpnext/hr/doctype/leave_application/leave_application.txt @@ -1,305 +1,267 @@ -[ - { - "creation": "2013-02-20 11:18:11", - "docstatus": 0, - "modified": "2014-01-20 17:48:56", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_attach": 1, - "autoname": "LAP/.#####", - "description": "Apply / Approve Leaves", - "doctype": "DocType", - "document_type": "Transaction", - "icon": "icon-calendar", - "is_submittable": 1, - "max_attachments": 3, - "module": "HR", - "name": "__common__", - "search_fields": "employee,employee_name,leave_type,from_date,to_date,total_leave_days,fiscal_year" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Leave Application", - "parentfield": "fields", - "parenttype": "DocType" - }, - { - "doctype": "DocPerm", - "name": "__common__", - "parent": "Leave Application", - "parentfield": "permissions", - "parenttype": "DocType", - "read": 1 - }, - { - "doctype": "DocType", - "name": "Leave Application" - }, - { - "default": "Open", - "doctype": "DocField", - "fieldname": "status", - "fieldtype": "Select", - "in_list_view": 1, - "label": "Status", - "no_copy": 1, - "options": "Open\nApproved\nRejected", - "permlevel": 1 - }, - { - "description": "Leave can be approved by users with Role, \"Leave Approver\"", - "doctype": "DocField", - "fieldname": "leave_approver", - "fieldtype": "Select", - "label": "Leave Approver", - "options": "link:User", - "permlevel": 0 - }, - { - "doctype": "DocField", - "fieldname": "leave_type", - "fieldtype": "Select", - "in_filter": 1, - "in_list_view": 1, - "label": "Leave Type", - "options": "link:Leave Type", - "permlevel": 0, - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "from_date", - "fieldtype": "Date", - "in_list_view": 1, - "label": "From Date", - "permlevel": 0, - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "to_date", - "fieldtype": "Date", - "in_list_view": 0, - "label": "To Date", - "permlevel": 0, - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "half_day", - "fieldtype": "Check", - "label": "Half Day", - "permlevel": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "permlevel": 0, - "print_width": "50%", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Small Text", - "label": "Reason", - "permlevel": 0 - }, - { - "doctype": "DocField", - "fieldname": "employee", - "fieldtype": "Link", - "in_filter": 1, - "label": "Employee", - "options": "Employee", - "permlevel": 0, - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "employee_name", - "fieldtype": "Data", - "in_filter": 1, - "in_list_view": 1, - "label": "Employee Name", - "permlevel": 0, - "read_only": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "leave_balance", - "fieldtype": "Float", - "label": "Leave Balance Before Application", - "no_copy": 1, - "permlevel": 0, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "total_leave_days", - "fieldtype": "Float", - "label": "Total Leave Days", - "no_copy": 1, - "permlevel": 0, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "sb10", - "fieldtype": "Section Break", - "label": "More Info", - "permlevel": 0 - }, - { - "allow_on_submit": 1, - "default": "1", - "doctype": "DocField", - "fieldname": "follow_via_email", - "fieldtype": "Check", - "label": "Follow via Email", - "permlevel": 0, - "print_hide": 1 - }, - { - "default": "Today", - "doctype": "DocField", - "fieldname": "posting_date", - "fieldtype": "Date", - "label": "Posting Date", - "no_copy": 1, - "permlevel": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "fiscal_year", - "fieldtype": "Select", - "in_filter": 1, - "label": "Fiscal Year", - "options": "link:Fiscal Year", - "permlevel": 0, - "read_only": 0, - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break_17", - "fieldtype": "Column Break", - "permlevel": 0 - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "label": "Company", - "options": "Company", - "permlevel": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "letter_head", - "fieldtype": "Link", - "label": "Letter Head", - "options": "Letter Head", - "permlevel": 0, - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "amended_from", - "fieldtype": "Link", - "ignore_restrictions": 1, - "label": "Amended From", - "no_copy": 1, - "options": "Leave Application", - "permlevel": 0, - "print_hide": 1, - "read_only": 1 - }, - { - "create": 1, - "delete": 0, - "doctype": "DocPerm", - "email": 1, - "permlevel": 0, - "print": 1, - "report": 1, - "role": "Employee", - "write": 1 - }, - { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "permlevel": 1, - "role": "All", - "submit": 0 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "permlevel": 0, - "print": 1, - "report": 1, - "restrict": 1, - "role": "HR User", - "submit": 1, - "write": 1 - }, - { - "amend": 1, - "cancel": 0, - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "email": 1, - "permlevel": 0, - "print": 1, - "report": 1, - "role": "Leave Approver", - "submit": 1, - "write": 1 - }, - { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "permlevel": 1, - "report": 1, - "role": "HR User", - "submit": 0, - "write": 1 - }, - { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "permlevel": 1, - "report": 1, - "role": "Leave Approver", - "submit": 0, - "write": 1 - } -] \ No newline at end of file +{ + "allow_attach": 1, + "autoname": "LAP/.#####", + "creation": "2013-02-20 11:18:11", + "description": "Apply / Approve Leaves", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Transaction", + "fields": [ + { + "default": "Open", + "fieldname": "status", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Status", + "no_copy": 1, + "options": "Open\nApproved\nRejected", + "permlevel": 1 + }, + { + "description": "Leave can be approved by users with Role, \"Leave Approver\"", + "fieldname": "leave_approver", + "fieldtype": "Select", + "label": "Leave Approver", + "options": "link:User", + "permlevel": 0 + }, + { + "fieldname": "leave_type", + "fieldtype": "Select", + "in_filter": 1, + "in_list_view": 1, + "label": "Leave Type", + "options": "link:Leave Type", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "from_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "From Date", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "to_date", + "fieldtype": "Date", + "in_list_view": 0, + "label": "To Date", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "half_day", + "fieldtype": "Check", + "label": "Half Day", + "permlevel": 0 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "permlevel": 0, + "print_width": "50%", + "width": "50%" + }, + { + "fieldname": "description", + "fieldtype": "Small Text", + "label": "Reason", + "permlevel": 0 + }, + { + "fieldname": "employee", + "fieldtype": "Link", + "in_filter": 1, + "label": "Employee", + "options": "Employee", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "employee_name", + "fieldtype": "Data", + "in_filter": 1, + "in_list_view": 1, + "label": "Employee Name", + "permlevel": 0, + "read_only": 1, + "search_index": 0 + }, + { + "fieldname": "leave_balance", + "fieldtype": "Float", + "label": "Leave Balance Before Application", + "no_copy": 1, + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "total_leave_days", + "fieldtype": "Float", + "label": "Total Leave Days", + "no_copy": 1, + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "sb10", + "fieldtype": "Section Break", + "label": "More Info", + "permlevel": 0 + }, + { + "allow_on_submit": 1, + "default": "1", + "fieldname": "follow_via_email", + "fieldtype": "Check", + "label": "Follow via Email", + "permlevel": 0, + "print_hide": 1 + }, + { + "default": "Today", + "fieldname": "posting_date", + "fieldtype": "Date", + "label": "Posting Date", + "no_copy": 1, + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Select", + "in_filter": 1, + "label": "Fiscal Year", + "options": "link:Fiscal Year", + "permlevel": 0, + "read_only": 0, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "column_break_17", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "company", + "fieldtype": "Link", + "label": "Company", + "options": "Company", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "letter_head", + "fieldtype": "Link", + "label": "Letter Head", + "options": "Letter Head", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "amended_from", + "fieldtype": "Link", + "ignore_restrictions": 1, + "label": "Amended From", + "no_copy": 1, + "options": "Leave Application", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + } + ], + "icon": "icon-calendar", + "idx": 1, + "is_submittable": 1, + "max_attachments": 3, + "modified": "2014-01-20 17:48:56", + "modified_by": "Administrator", + "module": "HR", + "name": "Leave Application", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Employee", + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "permlevel": 1, + "read": 1, + "role": "All", + "submit": 0 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "restrict": 1, + "role": "HR User", + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Leave Approver", + "submit": 1, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "permlevel": 1, + "read": 1, + "report": 1, + "role": "HR User", + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "permlevel": 1, + "read": 1, + "report": 1, + "role": "Leave Approver", + "submit": 0, + "write": 1 + } + ], + "search_fields": "employee,employee_name,leave_type,from_date,to_date,total_leave_days,fiscal_year" +} \ No newline at end of file diff --git a/erpnext/hr/doctype/leave_block_list/leave_block_list.txt b/erpnext/hr/doctype/leave_block_list/leave_block_list.txt index 6f331b0c53..0ddab075e3 100644 --- a/erpnext/hr/doctype/leave_block_list/leave_block_list.txt +++ b/erpnext/hr/doctype/leave_block_list/leave_block_list.txt @@ -1,106 +1,87 @@ -[ - { - "creation": "2013-02-18 17:43:12", - "docstatus": 0, - "modified": "2013-12-20 19:24:13", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "autoname": "field:leave_block_list_name", - "description": "Block Holidays on important days.", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-calendar", - "module": "HR", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Leave Block List", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Leave Block List", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "role": "HR User", - "write": 1 - }, - { - "doctype": "DocType", - "name": "Leave Block List" - }, - { - "doctype": "DocField", - "fieldname": "leave_block_list_name", - "fieldtype": "Data", - "label": "Leave Block List Name", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "year", - "fieldtype": "Link", - "label": "Year", - "options": "Fiscal Year", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "label": "Company", - "options": "Company", - "reqd": 1 - }, - { - "description": "If not checked, the list will have to be added to each Department where it has to be applied.", - "doctype": "DocField", - "fieldname": "applies_to_all_departments", - "fieldtype": "Check", - "label": "Applies to Company" - }, - { - "description": "Stop users from making Leave Applications on following days.", - "doctype": "DocField", - "fieldname": "block_days", - "fieldtype": "Section Break", - "label": "Block Days" - }, - { - "doctype": "DocField", - "fieldname": "leave_block_list_dates", - "fieldtype": "Table", - "label": "Leave Block List Dates", - "options": "Leave Block List Date" - }, - { - "description": "Allow the following users to approve Leave Applications for block days.", - "doctype": "DocField", - "fieldname": "allow_list", - "fieldtype": "Section Break", - "label": "Allow Users" - }, - { - "doctype": "DocField", - "fieldname": "leave_block_list_allowed", - "fieldtype": "Table", - "label": "Leave Block List Allowed", - "options": "Leave Block List Allow" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "allow_import": 1, + "autoname": "field:leave_block_list_name", + "creation": "2013-02-18 17:43:12", + "description": "Block Holidays on important days.", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "leave_block_list_name", + "fieldtype": "Data", + "label": "Leave Block List Name", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "year", + "fieldtype": "Link", + "label": "Year", + "options": "Fiscal Year", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "company", + "fieldtype": "Link", + "label": "Company", + "options": "Company", + "permlevel": 0, + "reqd": 1 + }, + { + "description": "If not checked, the list will have to be added to each Department where it has to be applied.", + "fieldname": "applies_to_all_departments", + "fieldtype": "Check", + "label": "Applies to Company", + "permlevel": 0 + }, + { + "description": "Stop users from making Leave Applications on following days.", + "fieldname": "block_days", + "fieldtype": "Section Break", + "label": "Block Days", + "permlevel": 0 + }, + { + "fieldname": "leave_block_list_dates", + "fieldtype": "Table", + "label": "Leave Block List Dates", + "options": "Leave Block List Date", + "permlevel": 0 + }, + { + "description": "Allow the following users to approve Leave Applications for block days.", + "fieldname": "allow_list", + "fieldtype": "Section Break", + "label": "Allow Users", + "permlevel": 0 + }, + { + "fieldname": "leave_block_list_allowed", + "fieldtype": "Table", + "label": "Leave Block List Allowed", + "options": "Leave Block List Allow", + "permlevel": 0 + } + ], + "icon": "icon-calendar", + "idx": 1, + "modified": "2013-12-20 19:24:13", + "modified_by": "Administrator", + "module": "HR", + "name": "Leave Block List", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "role": "HR User", + "write": 1 + } + ] +} \ No newline at end of file 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 ea548004ce..d0f3855a32 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 @@ -1,38 +1,25 @@ -[ - { - "creation": "2013-02-22 01:27:47", - "docstatus": 0, - "modified": "2013-12-20 19:23:18", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "istable": 1, - "module": "HR", - "name": "__common__" - }, - { - "doctype": "DocField", - "fieldname": "allow_user", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Allow User", - "name": "__common__", - "options": "User", - "parent": "Leave Block List Allow", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0, - "print_width": "200px", - "reqd": 1, - "width": "200px" - }, - { - "doctype": "DocType", - "name": "Leave Block List Allow" - }, - { - "doctype": "DocField" - } -] \ No newline at end of file +{ + "creation": "2013-02-22 01:27:47", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "allow_user", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Allow User", + "options": "User", + "permlevel": 0, + "print_width": "200px", + "reqd": 1, + "width": "200px" + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:23:18", + "modified_by": "Administrator", + "module": "HR", + "name": "Leave Block List Allow", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.txt b/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.txt index 138c9e47b5..dd068a8bd9 100644 --- a/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.txt +++ b/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.txt @@ -1,43 +1,34 @@ -[ - { - "creation": "2013-02-22 01:27:47", - "docstatus": 0, - "modified": "2013-12-20 19:23:19", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "istable": 1, - "module": "HR", - "name": "__common__" - }, - { - "doctype": "DocField", - "in_list_view": 1, - "name": "__common__", - "parent": "Leave Block List Date", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0, - "print_width": "200px", - "reqd": 1, - "width": "200px" - }, - { - "doctype": "DocType", - "name": "Leave Block List Date" - }, - { - "doctype": "DocField", - "fieldname": "block_date", - "fieldtype": "Date", - "label": "Block Date" - }, - { - "doctype": "DocField", - "fieldname": "reason", - "fieldtype": "Text", - "label": "Reason" - } -] \ No newline at end of file +{ + "creation": "2013-02-22 01:27:47", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "block_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "Block Date", + "permlevel": 0, + "print_width": "200px", + "reqd": 1, + "width": "200px" + }, + { + "fieldname": "reason", + "fieldtype": "Text", + "in_list_view": 1, + "label": "Reason", + "permlevel": 0, + "print_width": "200px", + "reqd": 1, + "width": "200px" + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:23:19", + "modified_by": "Administrator", + "module": "HR", + "name": "Leave Block List Date", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/hr/doctype/leave_control_panel/leave_control_panel.txt b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.txt index bee3123399..adef0d59ba 100644 --- a/erpnext/hr/doctype/leave_control_panel/leave_control_panel.txt +++ b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.txt @@ -1,141 +1,122 @@ -[ - { - "creation": "2013-01-10 16:34:15", - "docstatus": 0, - "modified": "2013-07-05 14:44:50", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_copy": 1, - "allow_email": 1, - "allow_print": 1, - "doctype": "DocType", - "hide_heading": 0, - "hide_toolbar": 0, - "icon": "icon-cog", - "issingle": 1, - "module": "HR", - "name": "__common__", - "read_only": 1 - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Leave Control Panel", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "name": "__common__", - "parent": "Leave Control Panel", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "read": 1, - "report": 0, - "role": "HR User", - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Leave Control Panel" - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "description": "Leave blank if considered for all employee types", - "doctype": "DocField", - "fieldname": "employee_type", - "fieldtype": "Select", - "label": "Employee Type", - "options": "link:Employment Type" - }, - { - "description": "Leave blank if considered for all branches", - "doctype": "DocField", - "fieldname": "branch", - "fieldtype": "Select", - "label": "Branch", - "options": "link:Branch" - }, - { - "description": "Leave blank if considered for all departments", - "doctype": "DocField", - "fieldname": "department", - "fieldtype": "Select", - "label": "Department", - "options": "link:Department" - }, - { - "description": "Leave blank if considered for all designations", - "doctype": "DocField", - "fieldname": "designation", - "fieldtype": "Select", - "label": "Designation", - "options": "link:Designation" - }, - { - "description": "Leave blank if considered for all grades", - "doctype": "DocField", - "fieldname": "grade", - "fieldtype": "Select", - "label": "Grade", - "options": "link:Grade" - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "fiscal_year", - "fieldtype": "Select", - "in_filter": 1, - "label": "Fiscal Year", - "options": "link:Fiscal Year", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "leave_type", - "fieldtype": "Select", - "label": "Leave Type", - "options": "link:Leave Type", - "reqd": 1 - }, - { - "description": "Please select Carry Forward if you also want to include previous fiscal year's balance leaves to this fiscal year", - "doctype": "DocField", - "fieldname": "carry_forward", - "fieldtype": "Check", - "label": "Carry Forward" - }, - { - "doctype": "DocField", - "fieldname": "no_of_days", - "fieldtype": "Float", - "label": "New Leaves Allocated (In Days)", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "allocate", - "fieldtype": "Button", - "label": "Allocate", - "options": "allocate_leave" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "allow_copy": 1, + "allow_email": 1, + "allow_print": 1, + "creation": "2013-01-10 16:34:15", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "description": "Leave blank if considered for all employee types", + "fieldname": "employee_type", + "fieldtype": "Select", + "label": "Employee Type", + "options": "link:Employment Type", + "permlevel": 0 + }, + { + "description": "Leave blank if considered for all branches", + "fieldname": "branch", + "fieldtype": "Select", + "label": "Branch", + "options": "link:Branch", + "permlevel": 0 + }, + { + "description": "Leave blank if considered for all departments", + "fieldname": "department", + "fieldtype": "Select", + "label": "Department", + "options": "link:Department", + "permlevel": 0 + }, + { + "description": "Leave blank if considered for all designations", + "fieldname": "designation", + "fieldtype": "Select", + "label": "Designation", + "options": "link:Designation", + "permlevel": 0 + }, + { + "description": "Leave blank if considered for all grades", + "fieldname": "grade", + "fieldtype": "Select", + "label": "Grade", + "options": "link:Grade", + "permlevel": 0 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Select", + "in_filter": 1, + "label": "Fiscal Year", + "options": "link:Fiscal Year", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "leave_type", + "fieldtype": "Select", + "label": "Leave Type", + "options": "link:Leave Type", + "permlevel": 0, + "reqd": 1 + }, + { + "description": "Please select Carry Forward if you also want to include previous fiscal year's balance leaves to this fiscal year", + "fieldname": "carry_forward", + "fieldtype": "Check", + "label": "Carry Forward", + "permlevel": 0 + }, + { + "fieldname": "no_of_days", + "fieldtype": "Float", + "label": "New Leaves Allocated (In Days)", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "allocate", + "fieldtype": "Button", + "label": "Allocate", + "options": "allocate_leave", + "permlevel": 0 + } + ], + "hide_heading": 0, + "hide_toolbar": 0, + "icon": "icon-cog", + "idx": 1, + "issingle": 1, + "modified": "2013-07-05 14:44:50", + "modified_by": "Administrator", + "module": "HR", + "name": "Leave Control Panel", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "permlevel": 0, + "read": 1, + "report": 0, + "role": "HR User", + "submit": 0, + "write": 1 + } + ], + "read_only": 1 +} \ No newline at end of file diff --git a/erpnext/hr/doctype/leave_type/leave_type.txt b/erpnext/hr/doctype/leave_type/leave_type.txt index 13d7e725be..19eb7e791f 100644 --- a/erpnext/hr/doctype/leave_type/leave_type.txt +++ b/erpnext/hr/doctype/leave_type/leave_type.txt @@ -1,113 +1,103 @@ -[ - { - "creation": "2013-02-21 09:55:58", - "docstatus": 0, - "modified": "2014-01-20 17:48:56", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "autoname": "field:leave_type_name", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-flag", - "module": "HR", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Leave Type", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "cancel": 0, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Leave Type", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Leave Type" - }, - { - "doctype": "DocField", - "fieldname": "trash_reason", - "fieldtype": "Small Text", - "label": "Trash Reason", - "oldfieldname": "trash_reason", - "oldfieldtype": "Small Text", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "leave_type_name", - "fieldtype": "Data", - "label": "Leave Type Name", - "oldfieldname": "leave_type_name", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "max_days_allowed", - "fieldtype": "Data", - "label": "Max Days Leave Allowed", - "oldfieldname": "max_days_allowed", - "oldfieldtype": "Data", - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "is_carry_forward", - "fieldtype": "Check", - "label": "Is Carry Forward", - "oldfieldname": "is_carry_forward", - "oldfieldtype": "Check" - }, - { - "doctype": "DocField", - "fieldname": "is_encash", - "fieldtype": "Check", - "hidden": 1, - "label": "Is Encash", - "oldfieldname": "is_encash", - "oldfieldtype": "Check", - "print_hide": 1, - "report_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "is_lwp", - "fieldtype": "Check", - "label": "Is LWP" - }, - { - "doctype": "DocField", - "fieldname": "allow_negative", - "fieldtype": "Check", - "label": "Allow Negative Balance" - }, - { - "doctype": "DocPerm", - "role": "HR User" - }, - { - "doctype": "DocPerm", - "role": "HR Manager" - } -] \ No newline at end of file +{ + "allow_import": 1, + "autoname": "field:leave_type_name", + "creation": "2013-02-21 09:55:58", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "trash_reason", + "fieldtype": "Small Text", + "label": "Trash Reason", + "oldfieldname": "trash_reason", + "oldfieldtype": "Small Text", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "leave_type_name", + "fieldtype": "Data", + "label": "Leave Type Name", + "oldfieldname": "leave_type_name", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "max_days_allowed", + "fieldtype": "Data", + "label": "Max Days Leave Allowed", + "oldfieldname": "max_days_allowed", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 0 + }, + { + "fieldname": "is_carry_forward", + "fieldtype": "Check", + "label": "Is Carry Forward", + "oldfieldname": "is_carry_forward", + "oldfieldtype": "Check", + "permlevel": 0 + }, + { + "fieldname": "is_encash", + "fieldtype": "Check", + "hidden": 1, + "label": "Is Encash", + "oldfieldname": "is_encash", + "oldfieldtype": "Check", + "permlevel": 0, + "print_hide": 1, + "report_hide": 1 + }, + { + "fieldname": "is_lwp", + "fieldtype": "Check", + "label": "Is LWP", + "permlevel": 0 + }, + { + "fieldname": "allow_negative", + "fieldtype": "Check", + "label": "Allow Negative Balance", + "permlevel": 0 + } + ], + "icon": "icon-flag", + "idx": 1, + "modified": "2014-01-20 17:48:56", + "modified_by": "Administrator", + "module": "HR", + "name": "Leave Type", + "owner": "Administrator", + "permissions": [ + { + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "HR User", + "submit": 0, + "write": 1 + }, + { + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "HR Manager", + "submit": 0, + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/hr/doctype/salary_manager/salary_manager.txt b/erpnext/hr/doctype/salary_manager/salary_manager.txt index 423e789635..aa86e06299 100644 --- a/erpnext/hr/doctype/salary_manager/salary_manager.txt +++ b/erpnext/hr/doctype/salary_manager/salary_manager.txt @@ -1,185 +1,166 @@ -[ - { - "creation": "2012-03-27 14:35:59", - "docstatus": 0, - "modified": "2013-07-22 15:22:58", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_copy": 1, - "allow_email": 1, - "allow_print": 1, - "doctype": "DocType", - "document_type": "Other", - "icon": "icon-cog", - "issingle": 1, - "module": "HR", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Salary Manager", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "name": "__common__", - "parent": "Salary Manager", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "read": 1, - "role": "HR Manager", - "write": 1 - }, - { - "doctype": "DocType", - "name": "Salary Manager" - }, - { - "doctype": "DocField", - "fieldname": "document_description", - "fieldtype": "HTML", - "label": "Document Description", - "options": "
You can generate multiple salary slips based on the selected criteria, submit and mail those to the employee directly from here
" - }, - { - "doctype": "DocField", - "fieldname": "section_break0", - "fieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Select", - "label": "Company", - "options": "link:Company", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "branch", - "fieldtype": "Link", - "label": "Branch", - "options": "Branch" - }, - { - "doctype": "DocField", - "fieldname": "department", - "fieldtype": "Link", - "label": "Department", - "options": "Department" - }, - { - "doctype": "DocField", - "fieldname": "designation", - "fieldtype": "Link", - "label": "Designation", - "options": "Designation" - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "grade", - "fieldtype": "Select", - "label": "Grade", - "options": "link:Grade" - }, - { - "doctype": "DocField", - "fieldname": "fiscal_year", - "fieldtype": "Select", - "label": "Fiscal Year", - "options": "link:Fiscal Year", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "month", - "fieldtype": "Select", - "label": "Month", - "options": "\n01\n02\n03\n04\n05\n06\n07\n08\n09\n10\n11\n12", - "reqd": 1 - }, - { - "description": "Check if you want to send salary slip in mail to each employee while submitting salary slip", - "doctype": "DocField", - "fieldname": "send_email", - "fieldtype": "Check", - "label": "Send Email" - }, - { - "doctype": "DocField", - "fieldname": "section_break1", - "fieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "column_break2", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "description": "Creates salary slip for above mentioned criteria.", - "doctype": "DocField", - "fieldname": "create_salary_slip", - "fieldtype": "Button", - "label": "Create Salary Slip" - }, - { - "doctype": "DocField", - "fieldname": "column_break3", - "fieldtype": "Column Break", - "width": "25%" - }, - { - "description": "Submit all salary slips for the above selected criteria", - "doctype": "DocField", - "fieldname": "submit_salary_slip", - "fieldtype": "Button", - "label": "Submit Salary Slip" - }, - { - "doctype": "DocField", - "fieldname": "column_break4", - "fieldtype": "Column Break", - "width": "25%" - }, - { - "description": "Create Bank Voucher for the total salary paid for the above selected criteria", - "doctype": "DocField", - "fieldname": "make_bank_voucher", - "fieldtype": "Button", - "label": "Make Bank Voucher" - }, - { - "doctype": "DocField", - "fieldname": "section_break2", - "fieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "activity_log", - "fieldtype": "HTML", - "label": "Activity Log" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "allow_copy": 1, + "allow_email": 1, + "allow_print": 1, + "creation": "2012-03-27 14:35:59", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Other", + "fields": [ + { + "fieldname": "document_description", + "fieldtype": "HTML", + "label": "Document Description", + "options": "
You can generate multiple salary slips based on the selected criteria, submit and mail those to the employee directly from here
", + "permlevel": 0 + }, + { + "fieldname": "section_break0", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "company", + "fieldtype": "Select", + "label": "Company", + "options": "link:Company", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "branch", + "fieldtype": "Link", + "label": "Branch", + "options": "Branch", + "permlevel": 0 + }, + { + "fieldname": "department", + "fieldtype": "Link", + "label": "Department", + "options": "Department", + "permlevel": 0 + }, + { + "fieldname": "designation", + "fieldtype": "Link", + "label": "Designation", + "options": "Designation", + "permlevel": 0 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "grade", + "fieldtype": "Select", + "label": "Grade", + "options": "link:Grade", + "permlevel": 0 + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Select", + "label": "Fiscal Year", + "options": "link:Fiscal Year", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "month", + "fieldtype": "Select", + "label": "Month", + "options": "\n01\n02\n03\n04\n05\n06\n07\n08\n09\n10\n11\n12", + "permlevel": 0, + "reqd": 1 + }, + { + "description": "Check if you want to send salary slip in mail to each employee while submitting salary slip", + "fieldname": "send_email", + "fieldtype": "Check", + "label": "Send Email", + "permlevel": 0 + }, + { + "fieldname": "section_break1", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "column_break2", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "description": "Creates salary slip for above mentioned criteria.", + "fieldname": "create_salary_slip", + "fieldtype": "Button", + "label": "Create Salary Slip", + "permlevel": 0 + }, + { + "fieldname": "column_break3", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "25%" + }, + { + "description": "Submit all salary slips for the above selected criteria", + "fieldname": "submit_salary_slip", + "fieldtype": "Button", + "label": "Submit Salary Slip", + "permlevel": 0 + }, + { + "fieldname": "column_break4", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "25%" + }, + { + "description": "Create Bank Voucher for the total salary paid for the above selected criteria", + "fieldname": "make_bank_voucher", + "fieldtype": "Button", + "label": "Make Bank Voucher", + "permlevel": 0 + }, + { + "fieldname": "section_break2", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "activity_log", + "fieldtype": "HTML", + "label": "Activity Log", + "permlevel": 0 + } + ], + "icon": "icon-cog", + "idx": 1, + "issingle": 1, + "modified": "2013-07-22 15:22:58", + "modified_by": "Administrator", + "module": "HR", + "name": "Salary Manager", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "permlevel": 0, + "read": 1, + "role": "HR Manager", + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.txt b/erpnext/hr/doctype/salary_slip/salary_slip.txt index e47e8d834e..50779646c3 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.txt +++ b/erpnext/hr/doctype/salary_slip/salary_slip.txt @@ -1,404 +1,392 @@ -[ - { - "creation": "2013-01-10 16:34:15", - "docstatus": 0, - "modified": "2014-01-20 17:49:18", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "icon": "icon-file-text", - "is_submittable": 1, - "module": "HR", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Salary Slip", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Salary Slip", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 1, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Salary Slip" - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "employee", - "fieldtype": "Link", - "in_filter": 1, - "label": "Employee", - "oldfieldname": "employee", - "oldfieldtype": "Link", - "options": "Employee", - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "employee_name", - "fieldtype": "Data", - "in_filter": 1, - "in_list_view": 1, - "label": "Employee Name", - "oldfieldname": "employee_name", - "oldfieldtype": "Data", - "read_only": 1, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "department", - "fieldtype": "Link", - "in_filter": 1, - "label": "Department", - "oldfieldname": "department", - "oldfieldtype": "Link", - "options": "Department", - "read_only": 1, - "reqd": 0, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "designation", - "fieldtype": "Link", - "in_filter": 1, - "label": "Designation", - "oldfieldname": "designation", - "oldfieldtype": "Link", - "options": "Designation", - "read_only": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "branch", - "fieldtype": "Link", - "in_filter": 1, - "label": "Branch", - "oldfieldname": "branch", - "oldfieldtype": "Link", - "options": "Branch", - "read_only": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "grade", - "fieldtype": "Link", - "in_filter": 1, - "label": "Grade", - "oldfieldname": "grade", - "oldfieldtype": "Link", - "options": "Grade", - "read_only": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "pf_no", - "fieldtype": "Data", - "label": "PF No.", - "oldfieldname": "pf_no", - "oldfieldtype": "Data", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "esic_no", - "fieldtype": "Data", - "label": "ESIC No.", - "oldfieldname": "esic_no", - "oldfieldtype": "Data", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "letter_head", - "fieldtype": "Link", - "label": "Letter Head", - "options": "Letter Head" - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "fiscal_year", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "Fiscal Year", - "oldfieldname": "fiscal_year", - "oldfieldtype": "Data", - "options": "Fiscal Year", - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Select", - "in_filter": 1, - "label": "Company", - "options": "link:Company", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "month", - "fieldtype": "Select", - "in_filter": 1, - "in_list_view": 1, - "label": "Month", - "oldfieldname": "month", - "oldfieldtype": "Select", - "options": "\n01\n02\n03\n04\n05\n06\n07\n08\n09\n10\n11\n12", - "reqd": 1, - "search_index": 1, - "width": "37%" - }, - { - "doctype": "DocField", - "fieldname": "total_days_in_month", - "fieldtype": "Data", - "label": "Total Working Days In The Month", - "oldfieldname": "total_days_in_month", - "oldfieldtype": "Int", - "read_only": 1, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "leave_without_pay", - "fieldtype": "Float", - "label": "Leave Without Pay", - "oldfieldname": "leave_without_pay", - "oldfieldtype": "Currency" - }, - { - "doctype": "DocField", - "fieldname": "payment_days", - "fieldtype": "Float", - "label": "Payment Days", - "oldfieldname": "payment_days", - "oldfieldtype": "Float", - "read_only": 1, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "bank_name", - "fieldtype": "Data", - "label": "Bank Name", - "oldfieldname": "bank_name", - "oldfieldtype": "Data", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "bank_account_no", - "fieldtype": "Data", - "label": "Bank Account No.", - "oldfieldname": "bank_account_no", - "oldfieldtype": "Data", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "email_check", - "fieldtype": "Check", - "label": "Email", - "no_copy": 1, - "oldfieldname": "email_check", - "oldfieldtype": "Check", - "print_hide": 1, - "report_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "amended_from", - "fieldtype": "Data", - "hidden": 0, - "ignore_restrictions": 1, - "label": "Amended From", - "no_copy": 1, - "oldfieldname": "amended_from", - "oldfieldtype": "Data", - "print_hide": 1, - "report_hide": 0 - }, - { - "doctype": "DocField", - "fieldname": "earning_deduction", - "fieldtype": "Section Break", - "label": "Earning & Deduction", - "oldfieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "earning", - "fieldtype": "Column Break", - "label": "Earning", - "oldfieldtype": "Column Break", - "reqd": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "earning_details", - "fieldtype": "Table", - "label": "Salary Structure Earnings", - "oldfieldname": "earning_details", - "oldfieldtype": "Table", - "options": "Salary Slip Earning" - }, - { - "doctype": "DocField", - "fieldname": "deduction", - "fieldtype": "Column Break", - "label": "Deduction", - "oldfieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "deduction_details", - "fieldtype": "Table", - "label": "Deductions", - "oldfieldname": "deduction_details", - "oldfieldtype": "Table", - "options": "Salary Slip Deduction" - }, - { - "doctype": "DocField", - "fieldname": "totals", - "fieldtype": "Section Break", - "label": "Totals", - "oldfieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "column_break2", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "arrear_amount", - "fieldtype": "Currency", - "label": "Arrear Amount", - "oldfieldname": "arrear_amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency" - }, - { - "doctype": "DocField", - "fieldname": "leave_encashment_amount", - "fieldtype": "Currency", - "label": "Leave Encashment Amount", - "oldfieldname": "encashment_amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency" - }, - { - "doctype": "DocField", - "fieldname": "gross_pay", - "fieldtype": "Currency", - "label": "Gross Pay", - "oldfieldname": "gross_pay", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "total_deduction", - "fieldtype": "Currency", - "label": "Total Deduction", - "oldfieldname": "total_deduction", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break3", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "width": "50%" - }, - { - "description": "Gross Pay + Arrear Amount +Encashment Amount - Total Deduction", - "doctype": "DocField", - "fieldname": "net_pay", - "fieldtype": "Currency", - "label": "Net Pay", - "oldfieldname": "net_pay", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "rounded_total", - "fieldtype": "Currency", - "label": "Rounded Total", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "description": "Net Pay (in words) will be visible once you save the Salary Slip.", - "doctype": "DocField", - "fieldname": "total_in_words", - "fieldtype": "Data", - "label": "Total in words", - "oldfieldname": "net_pay_in_words", - "oldfieldtype": "Data", - "read_only": 1 - }, - { - "amend": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "HR User" - }, - { - "amend": 1, - "cancel": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "HR Manager" - } -] \ No newline at end of file +{ + "creation": "2013-01-10 16:34:15", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "employee", + "fieldtype": "Link", + "in_filter": 1, + "label": "Employee", + "oldfieldname": "employee", + "oldfieldtype": "Link", + "options": "Employee", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "employee_name", + "fieldtype": "Data", + "in_filter": 1, + "in_list_view": 1, + "label": "Employee Name", + "oldfieldname": "employee_name", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1, + "reqd": 1 + }, + { + "fieldname": "department", + "fieldtype": "Link", + "in_filter": 1, + "label": "Department", + "oldfieldname": "department", + "oldfieldtype": "Link", + "options": "Department", + "permlevel": 0, + "read_only": 1, + "reqd": 0, + "search_index": 0 + }, + { + "fieldname": "designation", + "fieldtype": "Link", + "in_filter": 1, + "label": "Designation", + "oldfieldname": "designation", + "oldfieldtype": "Link", + "options": "Designation", + "permlevel": 0, + "read_only": 1, + "search_index": 0 + }, + { + "fieldname": "branch", + "fieldtype": "Link", + "in_filter": 1, + "label": "Branch", + "oldfieldname": "branch", + "oldfieldtype": "Link", + "options": "Branch", + "permlevel": 0, + "read_only": 1, + "search_index": 0 + }, + { + "fieldname": "grade", + "fieldtype": "Link", + "in_filter": 1, + "label": "Grade", + "oldfieldname": "grade", + "oldfieldtype": "Link", + "options": "Grade", + "permlevel": 0, + "read_only": 1, + "search_index": 0 + }, + { + "fieldname": "pf_no", + "fieldtype": "Data", + "label": "PF No.", + "oldfieldname": "pf_no", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "esic_no", + "fieldtype": "Data", + "label": "ESIC No.", + "oldfieldname": "esic_no", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "letter_head", + "fieldtype": "Link", + "label": "Letter Head", + "options": "Letter Head", + "permlevel": 0 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Fiscal Year", + "oldfieldname": "fiscal_year", + "oldfieldtype": "Data", + "options": "Fiscal Year", + "permlevel": 0, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "company", + "fieldtype": "Select", + "in_filter": 1, + "label": "Company", + "options": "link:Company", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "month", + "fieldtype": "Select", + "in_filter": 1, + "in_list_view": 1, + "label": "Month", + "oldfieldname": "month", + "oldfieldtype": "Select", + "options": "\n01\n02\n03\n04\n05\n06\n07\n08\n09\n10\n11\n12", + "permlevel": 0, + "reqd": 1, + "search_index": 1, + "width": "37%" + }, + { + "fieldname": "total_days_in_month", + "fieldtype": "Data", + "label": "Total Working Days In The Month", + "oldfieldname": "total_days_in_month", + "oldfieldtype": "Int", + "permlevel": 0, + "read_only": 1, + "reqd": 1 + }, + { + "fieldname": "leave_without_pay", + "fieldtype": "Float", + "label": "Leave Without Pay", + "oldfieldname": "leave_without_pay", + "oldfieldtype": "Currency", + "permlevel": 0 + }, + { + "fieldname": "payment_days", + "fieldtype": "Float", + "label": "Payment Days", + "oldfieldname": "payment_days", + "oldfieldtype": "Float", + "permlevel": 0, + "read_only": 1, + "reqd": 1 + }, + { + "fieldname": "bank_name", + "fieldtype": "Data", + "label": "Bank Name", + "oldfieldname": "bank_name", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "bank_account_no", + "fieldtype": "Data", + "label": "Bank Account No.", + "oldfieldname": "bank_account_no", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "email_check", + "fieldtype": "Check", + "label": "Email", + "no_copy": 1, + "oldfieldname": "email_check", + "oldfieldtype": "Check", + "permlevel": 0, + "print_hide": 1, + "report_hide": 1 + }, + { + "fieldname": "amended_from", + "fieldtype": "Data", + "hidden": 0, + "ignore_restrictions": 1, + "label": "Amended From", + "no_copy": 1, + "oldfieldname": "amended_from", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "report_hide": 0 + }, + { + "fieldname": "earning_deduction", + "fieldtype": "Section Break", + "label": "Earning & Deduction", + "oldfieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "earning", + "fieldtype": "Column Break", + "label": "Earning", + "oldfieldtype": "Column Break", + "permlevel": 0, + "reqd": 0, + "width": "50%" + }, + { + "fieldname": "earning_details", + "fieldtype": "Table", + "label": "Salary Structure Earnings", + "oldfieldname": "earning_details", + "oldfieldtype": "Table", + "options": "Salary Slip Earning", + "permlevel": 0 + }, + { + "fieldname": "deduction", + "fieldtype": "Column Break", + "label": "Deduction", + "oldfieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "deduction_details", + "fieldtype": "Table", + "label": "Deductions", + "oldfieldname": "deduction_details", + "oldfieldtype": "Table", + "options": "Salary Slip Deduction", + "permlevel": 0 + }, + { + "fieldname": "totals", + "fieldtype": "Section Break", + "label": "Totals", + "oldfieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "column_break2", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "arrear_amount", + "fieldtype": "Currency", + "label": "Arrear Amount", + "oldfieldname": "arrear_amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0 + }, + { + "fieldname": "leave_encashment_amount", + "fieldtype": "Currency", + "label": "Leave Encashment Amount", + "oldfieldname": "encashment_amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0 + }, + { + "fieldname": "gross_pay", + "fieldtype": "Currency", + "label": "Gross Pay", + "oldfieldname": "gross_pay", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "total_deduction", + "fieldtype": "Currency", + "label": "Total Deduction", + "oldfieldname": "total_deduction", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "column_break3", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "description": "Gross Pay + Arrear Amount +Encashment Amount - Total Deduction", + "fieldname": "net_pay", + "fieldtype": "Currency", + "label": "Net Pay", + "oldfieldname": "net_pay", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "rounded_total", + "fieldtype": "Currency", + "label": "Rounded Total", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1 + }, + { + "description": "Net Pay (in words) will be visible once you save the Salary Slip.", + "fieldname": "total_in_words", + "fieldtype": "Data", + "label": "Total in words", + "oldfieldname": "net_pay_in_words", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1 + } + ], + "icon": "icon-file-text", + "idx": 1, + "is_submittable": 1, + "modified": "2014-01-20 17:49:18", + "modified_by": "Administrator", + "module": "HR", + "name": "Salary Slip", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "create": 1, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "HR User", + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "HR Manager", + "submit": 1, + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.txt b/erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.txt index 2b2909038c..23693ceaab 100644 --- a/erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.txt +++ b/erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.txt @@ -1,62 +1,52 @@ -[ - { - "creation": "2013-02-22 01:27:48", - "docstatus": 0, - "modified": "2013-12-20 19:23:42", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "istable": 1, - "module": "HR", - "name": "__common__" - }, - { - "doctype": "DocField", - "in_list_view": 1, - "name": "__common__", - "parent": "Salary Slip Deduction", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Salary Slip Deduction" - }, - { - "doctype": "DocField", - "fieldname": "d_type", - "fieldtype": "Link", - "label": "Type", - "oldfieldname": "d_type", - "oldfieldtype": "Data", - "options": "Deduction Type", - "print_width": "200px", - "width": "200px" - }, - { - "doctype": "DocField", - "fieldname": "d_amount", - "fieldtype": "Currency", - "label": "Amount", - "oldfieldname": "d_amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "d_modified_amount", - "fieldtype": "Currency", - "label": "Modified Amount", - "options": "Company:company:default_currency" - }, - { - "doctype": "DocField", - "fieldname": "d_depends_on_lwp", - "fieldtype": "Check", - "label": "Depends on LWP" - } -] \ No newline at end of file +{ + "creation": "2013-02-22 01:27:48", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "d_type", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Type", + "oldfieldname": "d_type", + "oldfieldtype": "Data", + "options": "Deduction Type", + "permlevel": 0, + "print_width": "200px", + "width": "200px" + }, + { + "fieldname": "d_amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Amount", + "oldfieldname": "d_amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "d_modified_amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Modified Amount", + "options": "Company:company:default_currency", + "permlevel": 0 + }, + { + "fieldname": "d_depends_on_lwp", + "fieldtype": "Check", + "in_list_view": 1, + "label": "Depends on LWP", + "permlevel": 0 + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:23:42", + "modified_by": "Administrator", + "module": "HR", + "name": "Salary Slip Deduction", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.txt b/erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.txt index 3375ab55d1..bc9684ab34 100644 --- a/erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.txt +++ b/erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.txt @@ -1,62 +1,52 @@ -[ - { - "creation": "2013-02-22 01:27:48", - "docstatus": 0, - "modified": "2013-12-20 19:23:43", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "istable": 1, - "module": "HR", - "name": "__common__" - }, - { - "doctype": "DocField", - "in_list_view": 1, - "name": "__common__", - "parent": "Salary Slip Earning", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Salary Slip Earning" - }, - { - "doctype": "DocField", - "fieldname": "e_type", - "fieldtype": "Link", - "label": "Type", - "oldfieldname": "e_type", - "oldfieldtype": "Data", - "options": "Earning Type", - "print_width": "200px", - "width": "200px" - }, - { - "doctype": "DocField", - "fieldname": "e_amount", - "fieldtype": "Currency", - "label": "Amount", - "oldfieldname": "e_amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "e_modified_amount", - "fieldtype": "Currency", - "label": "Modified Amount", - "options": "Company:company:default_currency" - }, - { - "doctype": "DocField", - "fieldname": "e_depends_on_lwp", - "fieldtype": "Check", - "label": "Depends on LWP" - } -] \ No newline at end of file +{ + "creation": "2013-02-22 01:27:48", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "e_type", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Type", + "oldfieldname": "e_type", + "oldfieldtype": "Data", + "options": "Earning Type", + "permlevel": 0, + "print_width": "200px", + "width": "200px" + }, + { + "fieldname": "e_amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Amount", + "oldfieldname": "e_amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "e_modified_amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Modified Amount", + "options": "Company:company:default_currency", + "permlevel": 0 + }, + { + "fieldname": "e_depends_on_lwp", + "fieldtype": "Check", + "in_list_view": 1, + "label": "Depends on LWP", + "permlevel": 0 + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:23:43", + "modified_by": "Administrator", + "module": "HR", + "name": "Salary Slip Earning", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.txt b/erpnext/hr/doctype/salary_structure/salary_structure.txt index e54ebd7e59..6aae2fba43 100644 --- a/erpnext/hr/doctype/salary_structure/salary_structure.txt +++ b/erpnext/hr/doctype/salary_structure/salary_structure.txt @@ -1,284 +1,273 @@ -[ - { - "creation": "2013-03-07 18:50:29", - "docstatus": 0, - "modified": "2013-12-20 19:24:28", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "doctype": "DocType", - "icon": "icon-file-text", - "module": "HR", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Salary Structure", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "amend": 0, - "create": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Salary Structure", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Salary Structure" - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "employee", - "fieldtype": "Link", - "in_filter": 1, - "label": "Employee", - "oldfieldname": "employee", - "oldfieldtype": "Link", - "options": "Employee", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "employee_name", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Employee Name", - "oldfieldname": "employee_name", - "oldfieldtype": "Data", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "branch", - "fieldtype": "Select", - "in_filter": 1, - "label": "Branch", - "oldfieldname": "branch", - "oldfieldtype": "Select", - "options": "link:Branch", - "read_only": 1, - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "designation", - "fieldtype": "Select", - "in_filter": 1, - "label": "Designation", - "oldfieldname": "designation", - "oldfieldtype": "Select", - "options": "link:Designation", - "read_only": 1, - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "department", - "fieldtype": "Select", - "in_filter": 1, - "label": "Department", - "oldfieldname": "department", - "oldfieldtype": "Select", - "options": "link:Department", - "read_only": 1, - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "grade", - "fieldtype": "Select", - "in_filter": 1, - "label": "Grade", - "oldfieldname": "grade", - "oldfieldtype": "Select", - "options": "link:Grade", - "read_only": 1, - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "default": "Yes", - "doctype": "DocField", - "fieldname": "is_active", - "fieldtype": "Select", - "in_filter": 1, - "in_list_view": 1, - "label": "Is Active", - "oldfieldname": "is_active", - "oldfieldtype": "Select", - "options": "\nYes\nNo", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "from_date", - "fieldtype": "Date", - "in_list_view": 1, - "label": "From Date", - "oldfieldname": "from_date", - "oldfieldtype": "Date", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "to_date", - "fieldtype": "Date", - "in_list_view": 1, - "label": "To Date", - "oldfieldname": "to_date", - "oldfieldtype": "Date", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Select", - "in_filter": 1, - "label": "Company", - "options": "link:Company", - "read_only": 0, - "reqd": 1 - }, - { - "description": "Salary breakup based on Earning and Deduction.", - "doctype": "DocField", - "fieldname": "earning_deduction", - "fieldtype": "Section Break", - "label": "Monthly Earning & Deduction", - "oldfieldname": "earning_deduction", - "oldfieldtype": "Section Break", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "earning", - "fieldtype": "Column Break", - "hidden": 0, - "label": "Earning", - "oldfieldname": "col_brk2", - "oldfieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "earning_details", - "fieldtype": "Table", - "hidden": 0, - "label": "Earning1", - "oldfieldname": "earning_details", - "oldfieldtype": "Table", - "options": "Salary Structure Earning", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "deduction", - "fieldtype": "Column Break", - "hidden": 0, - "label": "Deduction", - "oldfieldname": "col_brk3", - "oldfieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "deduction_details", - "fieldtype": "Table", - "hidden": 0, - "label": "Deduction1", - "oldfieldname": "deduction_details", - "oldfieldtype": "Table", - "options": "Salary Structure Deduction", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "section_break0", - "fieldtype": "Section Break", - "options": "Simple", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break2", - "fieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "total_earning", - "fieldtype": "Currency", - "label": "Total Earning", - "oldfieldname": "total_earning", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "total_deduction", - "fieldtype": "Currency", - "label": "Total Deduction", - "oldfieldname": "total_deduction", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break3", - "fieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "net_pay", - "fieldtype": "Currency", - "label": "Net Pay", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "doctype": "DocPerm", - "role": "HR User" - }, - { - "doctype": "DocPerm", - "role": "HR Manager" - } -] \ No newline at end of file +{ + "allow_import": 1, + "creation": "2013-03-07 18:50:29", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "employee", + "fieldtype": "Link", + "in_filter": 1, + "label": "Employee", + "oldfieldname": "employee", + "oldfieldtype": "Link", + "options": "Employee", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "employee_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Employee Name", + "oldfieldname": "employee_name", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "branch", + "fieldtype": "Select", + "in_filter": 1, + "label": "Branch", + "oldfieldname": "branch", + "oldfieldtype": "Select", + "options": "link:Branch", + "permlevel": 0, + "read_only": 1, + "reqd": 0 + }, + { + "fieldname": "designation", + "fieldtype": "Select", + "in_filter": 1, + "label": "Designation", + "oldfieldname": "designation", + "oldfieldtype": "Select", + "options": "link:Designation", + "permlevel": 0, + "read_only": 1, + "reqd": 0 + }, + { + "fieldname": "department", + "fieldtype": "Select", + "in_filter": 1, + "label": "Department", + "oldfieldname": "department", + "oldfieldtype": "Select", + "options": "link:Department", + "permlevel": 0, + "read_only": 1, + "reqd": 0 + }, + { + "fieldname": "grade", + "fieldtype": "Select", + "in_filter": 1, + "label": "Grade", + "oldfieldname": "grade", + "oldfieldtype": "Select", + "options": "link:Grade", + "permlevel": 0, + "read_only": 1, + "reqd": 0 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "default": "Yes", + "fieldname": "is_active", + "fieldtype": "Select", + "in_filter": 1, + "in_list_view": 1, + "label": "Is Active", + "oldfieldname": "is_active", + "oldfieldtype": "Select", + "options": "\nYes\nNo", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "from_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "From Date", + "oldfieldname": "from_date", + "oldfieldtype": "Date", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "to_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "To Date", + "oldfieldname": "to_date", + "oldfieldtype": "Date", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "company", + "fieldtype": "Select", + "in_filter": 1, + "label": "Company", + "options": "link:Company", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "description": "Salary breakup based on Earning and Deduction.", + "fieldname": "earning_deduction", + "fieldtype": "Section Break", + "label": "Monthly Earning & Deduction", + "oldfieldname": "earning_deduction", + "oldfieldtype": "Section Break", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "earning", + "fieldtype": "Column Break", + "hidden": 0, + "label": "Earning", + "oldfieldname": "col_brk2", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "earning_details", + "fieldtype": "Table", + "hidden": 0, + "label": "Earning1", + "oldfieldname": "earning_details", + "oldfieldtype": "Table", + "options": "Salary Structure Earning", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "deduction", + "fieldtype": "Column Break", + "hidden": 0, + "label": "Deduction", + "oldfieldname": "col_brk3", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "deduction_details", + "fieldtype": "Table", + "hidden": 0, + "label": "Deduction1", + "oldfieldname": "deduction_details", + "oldfieldtype": "Table", + "options": "Salary Structure Deduction", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "section_break0", + "fieldtype": "Section Break", + "options": "Simple", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "column_break2", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "total_earning", + "fieldtype": "Currency", + "label": "Total Earning", + "oldfieldname": "total_earning", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "total_deduction", + "fieldtype": "Currency", + "label": "Total Deduction", + "oldfieldname": "total_deduction", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "column_break3", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "net_pay", + "fieldtype": "Currency", + "label": "Net Pay", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1 + } + ], + "icon": "icon-file-text", + "idx": 1, + "modified": "2013-12-20 19:24:28", + "modified_by": "Administrator", + "module": "HR", + "name": "Salary Structure", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "HR User", + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "HR Manager", + "submit": 0, + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/hr/doctype/salary_structure_deduction/salary_structure_deduction.txt b/erpnext/hr/doctype/salary_structure_deduction/salary_structure_deduction.txt index 845a70fde7..7b31d861ae 100644 --- a/erpnext/hr/doctype/salary_structure_deduction/salary_structure_deduction.txt +++ b/erpnext/hr/doctype/salary_structure_deduction/salary_structure_deduction.txt @@ -1,59 +1,46 @@ -[ - { - "creation": "2013-02-22 01:27:48", - "docstatus": 0, - "modified": "2013-12-20 19:23:43", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "istable": 1, - "module": "HR", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Salary Structure Deduction", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Salary Structure Deduction" - }, - { - "doctype": "DocField", - "fieldname": "d_type", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Type", - "oldfieldname": "d_type", - "oldfieldtype": "Select", - "options": "Deduction Type", - "print_width": "200px", - "reqd": 1, - "width": "200px" - }, - { - "doctype": "DocField", - "fieldname": "d_modified_amt", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Amount", - "oldfieldname": "d_modified_amt", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency" - }, - { - "doctype": "DocField", - "fieldname": "depend_on_lwp", - "fieldtype": "Check", - "in_list_view": 0, - "label": "Reduce Deduction for Leave Without Pay (LWP)", - "oldfieldname": "depend_on_lwp", - "oldfieldtype": "Check" - } -] \ No newline at end of file +{ + "creation": "2013-02-22 01:27:48", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "d_type", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Type", + "oldfieldname": "d_type", + "oldfieldtype": "Select", + "options": "Deduction Type", + "permlevel": 0, + "print_width": "200px", + "reqd": 1, + "width": "200px" + }, + { + "fieldname": "d_modified_amt", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Amount", + "oldfieldname": "d_modified_amt", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0 + }, + { + "fieldname": "depend_on_lwp", + "fieldtype": "Check", + "in_list_view": 0, + "label": "Reduce Deduction for Leave Without Pay (LWP)", + "oldfieldname": "depend_on_lwp", + "oldfieldtype": "Check", + "permlevel": 0 + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:23:43", + "modified_by": "Administrator", + "module": "HR", + "name": "Salary Structure Deduction", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/hr/doctype/salary_structure_earning/salary_structure_earning.txt b/erpnext/hr/doctype/salary_structure_earning/salary_structure_earning.txt index d90c3cdd3b..b0e91bf41b 100644 --- a/erpnext/hr/doctype/salary_structure_earning/salary_structure_earning.txt +++ b/erpnext/hr/doctype/salary_structure_earning/salary_structure_earning.txt @@ -1,61 +1,48 @@ -[ - { - "creation": "2013-02-22 01:27:48", - "docstatus": 0, - "modified": "2013-12-20 19:23:43", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "hide_heading": 0, - "hide_toolbar": 0, - "istable": 1, - "module": "HR", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Salary Structure Earning", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Salary Structure Earning" - }, - { - "doctype": "DocField", - "fieldname": "e_type", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Type", - "oldfieldname": "e_type", - "oldfieldtype": "Data", - "options": "Earning Type", - "print_width": "200px", - "reqd": 1, - "width": "200px" - }, - { - "doctype": "DocField", - "fieldname": "modified_value", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Amount", - "oldfieldname": "modified_value", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency" - }, - { - "doctype": "DocField", - "fieldname": "depend_on_lwp", - "fieldtype": "Check", - "in_list_view": 0, - "label": "Reduce Earning for Leave Without Pay (LWP)", - "oldfieldname": "depend_on_lwp", - "oldfieldtype": "Check" - } -] \ No newline at end of file +{ + "creation": "2013-02-22 01:27:48", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "e_type", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Type", + "oldfieldname": "e_type", + "oldfieldtype": "Data", + "options": "Earning Type", + "permlevel": 0, + "print_width": "200px", + "reqd": 1, + "width": "200px" + }, + { + "fieldname": "modified_value", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Amount", + "oldfieldname": "modified_value", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0 + }, + { + "fieldname": "depend_on_lwp", + "fieldtype": "Check", + "in_list_view": 0, + "label": "Reduce Earning for Leave Without Pay (LWP)", + "oldfieldname": "depend_on_lwp", + "oldfieldtype": "Check", + "permlevel": 0 + } + ], + "hide_heading": 0, + "hide_toolbar": 0, + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:23:43", + "modified_by": "Administrator", + "module": "HR", + "name": "Salary Structure Earning", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/hr/doctype/upload_attendance/upload_attendance.txt b/erpnext/hr/doctype/upload_attendance/upload_attendance.txt index 5c727619ed..a1b632adbe 100644 --- a/erpnext/hr/doctype/upload_attendance/upload_attendance.txt +++ b/erpnext/hr/doctype/upload_attendance/upload_attendance.txt @@ -1,102 +1,90 @@ -[ - { - "creation": "2013-01-25 11:34:53", - "docstatus": 0, - "modified": "2013-12-20 19:21:54", - "modified_by": "Administrator", - "owner": "harshada@webnotestech.com" - }, - { - "allow_attach": 0, - "doctype": "DocType", - "icon": "icon-upload-alt", - "issingle": 1, - "max_attachments": 1, - "module": "HR", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Upload Attendance", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Upload Attendance", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 0, - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Upload Attendance" - }, - { - "description": "Download the Template, fill appropriate data and attach the modified file.\nAll dates and employee combination in the selected period will come in the template, with existing attendance records", - "doctype": "DocField", - "fieldname": "download_template", - "fieldtype": "Section Break", - "label": "Download Template" - }, - { - "doctype": "DocField", - "fieldname": "att_fr_date", - "fieldtype": "Date", - "label": "Attendance From Date", - "oldfieldname": "attenadnce_date", - "oldfieldtype": "Date", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "att_to_date", - "fieldtype": "Date", - "label": "Attendance To Date", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "get_template", - "fieldtype": "Button", - "label": "Get Template", - "oldfieldtype": "Button" - }, - { - "doctype": "DocField", - "fieldname": "upload_attendance_data", - "fieldtype": "Section Break", - "label": "Import Attendance" - }, - { - "doctype": "DocField", - "fieldname": "upload_html", - "fieldtype": "HTML", - "label": "Upload HTML" - }, - { - "doctype": "DocField", - "fieldname": "import_log", - "fieldtype": "HTML", - "hidden": 0, - "label": "Import Log" - }, - { - "doctype": "DocPerm", - "role": "HR User" - }, - { - "doctype": "DocPerm", - "role": "HR Manager" - } -] \ No newline at end of file +{ + "allow_attach": 0, + "creation": "2013-01-25 11:34:53", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "description": "Download the Template, fill appropriate data and attach the modified file.\nAll dates and employee combination in the selected period will come in the template, with existing attendance records", + "fieldname": "download_template", + "fieldtype": "Section Break", + "label": "Download Template", + "permlevel": 0 + }, + { + "fieldname": "att_fr_date", + "fieldtype": "Date", + "label": "Attendance From Date", + "oldfieldname": "attenadnce_date", + "oldfieldtype": "Date", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "att_to_date", + "fieldtype": "Date", + "label": "Attendance To Date", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "get_template", + "fieldtype": "Button", + "label": "Get Template", + "oldfieldtype": "Button", + "permlevel": 0 + }, + { + "fieldname": "upload_attendance_data", + "fieldtype": "Section Break", + "label": "Import Attendance", + "permlevel": 0 + }, + { + "fieldname": "upload_html", + "fieldtype": "HTML", + "label": "Upload HTML", + "permlevel": 0 + }, + { + "fieldname": "import_log", + "fieldtype": "HTML", + "hidden": 0, + "label": "Import Log", + "permlevel": 0 + } + ], + "icon": "icon-upload-alt", + "idx": 1, + "issingle": 1, + "max_attachments": 1, + "modified": "2013-12-20 19:21:54", + "modified_by": "Administrator", + "module": "HR", + "name": "Upload Attendance", + "owner": "harshada@webnotestech.com", + "permissions": [ + { + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 0, + "role": "HR User", + "submit": 0, + "write": 1 + }, + { + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 0, + "role": "HR Manager", + "submit": 0, + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/hr/report/employee_birthday/employee_birthday.txt b/erpnext/hr/report/employee_birthday/employee_birthday.txt index a114e5c181..8bff51ccfd 100644 --- a/erpnext/hr/report/employee_birthday/employee_birthday.txt +++ b/erpnext/hr/report/employee_birthday/employee_birthday.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-05-06 17:56:03", - "docstatus": 0, - "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", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Employee Birthday" - } -] \ No newline at end of file +{ + "creation": "2013-05-06 17:56:03", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "HR", + "name": "Employee Birthday", + "owner": "Administrator", + "ref_doctype": "Employee", + "report_name": "Employee Birthday", + "report_type": "Script Report" +} \ No newline at end of file diff --git a/erpnext/hr/report/employee_information/employee_information.txt b/erpnext/hr/report/employee_information/employee_information.txt index 8bd3c4c268..a92d5816d4 100644 --- a/erpnext/hr/report/employee_information/employee_information.txt +++ b/erpnext/hr/report/employee_information/employee_information.txt @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-05-06 18:43:53", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "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", - "report_type": "Report Builder" - }, - { - "doctype": "Report", - "name": "Employee Information" - } -] \ No newline at end of file +{ + "creation": "2013-05-06 18:43:53", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "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\"}", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "HR", + "name": "Employee Information", + "owner": "Administrator", + "ref_doctype": "Employee", + "report_name": "Employee Information", + "report_type": "Report Builder" +} \ No newline at end of file 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 f682c64217..dfee82d60e 100644 --- a/erpnext/hr/report/employee_leave_balance/employee_leave_balance.txt +++ b/erpnext/hr/report/employee_leave_balance/employee_leave_balance.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-02-22 15:29:34", - "docstatus": 0, - "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", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Employee Leave Balance" - } -] \ No newline at end of file +{ + "creation": "2013-02-22 15:29:34", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "HR", + "name": "Employee Leave Balance", + "owner": "Administrator", + "ref_doctype": "Employee", + "report_name": "Employee Leave Balance", + "report_type": "Script Report" +} \ No newline at end of file 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 5c51c4ba6e..2bc4e86e67 100644 --- a/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.txt +++ b/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.txt @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-05-13 14:04:03", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "add_total_row": 0, - "doctype": "Report", - "is_standard": "Yes", - "module": "HR", - "name": "__common__", - "ref_doctype": "Attendance", - "report_name": "Monthly Attendance Sheet", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Monthly Attendance Sheet" - } -] \ No newline at end of file +{ + "add_total_row": 0, + "creation": "2013-05-13 14:04:03", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "HR", + "name": "Monthly Attendance Sheet", + "owner": "Administrator", + "ref_doctype": "Attendance", + "report_name": "Monthly Attendance Sheet", + "report_type": "Script Report" +} \ No newline at end of file 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 80b0c136a7..f03fdeed7a 100644 --- a/erpnext/hr/report/monthly_salary_register/monthly_salary_register.txt +++ b/erpnext/hr/report/monthly_salary_register/monthly_salary_register.txt @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-05-07 18:09:42", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "add_total_row": 1, - "doctype": "Report", - "is_standard": "Yes", - "module": "HR", - "name": "__common__", - "ref_doctype": "Salary Slip", - "report_name": "Monthly Salary Register", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Monthly Salary Register" - } -] \ No newline at end of file +{ + "add_total_row": 1, + "creation": "2013-05-07 18:09:42", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "HR", + "name": "Monthly Salary Register", + "owner": "Administrator", + "ref_doctype": "Salary Slip", + "report_name": "Monthly Salary Register", + "report_type": "Script Report" +} \ No newline at end of file diff --git a/erpnext/manufacturing/doctype/bom/bom.txt b/erpnext/manufacturing/doctype/bom/bom.txt index 4afc160fb8..14f8dd4e00 100644 --- a/erpnext/manufacturing/doctype/bom/bom.txt +++ b/erpnext/manufacturing/doctype/bom/bom.txt @@ -1,281 +1,271 @@ -[ - { - "creation": "2013-01-22 15:11:38", - "docstatus": 0, - "modified": "2014-01-20 17:48:26", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_attach": 0, - "allow_copy": 0, - "allow_import": 1, - "allow_rename": 0, - "doctype": "DocType", - "document_type": "Master", - "hide_heading": 0, - "hide_toolbar": 0, - "icon": "icon-sitemap", - "in_create": 0, - "is_submittable": 1, - "issingle": 0, - "istable": 0, - "module": "Manufacturing", - "name": "__common__", - "read_only": 0, - "search_fields": "item" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "BOM", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "BOM", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 1, - "write": 1 - }, - { - "doctype": "DocType", - "name": "BOM" - }, - { - "description": "Item to be manufactured or repacked", - "doctype": "DocField", - "fieldname": "item", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 0, - "label": "Item", - "oldfieldname": "item", - "oldfieldtype": "Link", - "options": "Item", - "reqd": 1, - "search_index": 1 - }, - { - "allow_on_submit": 1, - "default": "1", - "doctype": "DocField", - "fieldname": "is_active", - "fieldtype": "Check", - "hidden": 0, - "in_list_view": 1, - "label": "Is Active", - "no_copy": 1, - "oldfieldname": "is_active", - "oldfieldtype": "Select", - "reqd": 0 - }, - { - "allow_on_submit": 1, - "default": "1", - "doctype": "DocField", - "fieldname": "is_default", - "fieldtype": "Check", - "in_list_view": 1, - "label": "Is Default", - "no_copy": 1, - "oldfieldname": "is_default", - "oldfieldtype": "Check" - }, - { - "doctype": "DocField", - "fieldname": "cb0", - "fieldtype": "Column Break" - }, - { - "description": "Manage cost of operations", - "doctype": "DocField", - "fieldname": "with_operations", - "fieldtype": "Check", - "label": "With Operations" - }, - { - "doctype": "DocField", - "fieldname": "rm_cost_as_per", - "fieldtype": "Select", - "label": "Rate Of Materials Based On", - "options": "Valuation Rate\nLast Purchase Rate\nPrice List" - }, - { - "depends_on": "eval:doc.rm_cost_as_per===\"Price List\"", - "doctype": "DocField", - "fieldname": "buying_price_list", - "fieldtype": "Link", - "label": "Price List", - "options": "Price List" - }, - { - "depends_on": "with_operations", - "description": "Specify the operations, operating cost and give a unique Operation no to your operations.", - "doctype": "DocField", - "fieldname": "operations", - "fieldtype": "Section Break", - "label": "Operations", - "oldfieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "bom_operations", - "fieldtype": "Table", - "label": "BOM Operations", - "oldfieldname": "bom_operations", - "oldfieldtype": "Table", - "options": "BOM Operation" - }, - { - "doctype": "DocField", - "fieldname": "materials", - "fieldtype": "Section Break", - "label": "Materials", - "oldfieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "bom_materials", - "fieldtype": "Table", - "label": "BOM Item", - "oldfieldname": "bom_materials", - "oldfieldtype": "Table", - "options": "BOM Item" - }, - { - "doctype": "DocField", - "fieldname": "costing", - "fieldtype": "Section Break", - "label": "Costing", - "oldfieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "total_cost", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Total Cost", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "cb1", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "raw_material_cost", - "fieldtype": "Float", - "label": "Total Raw Material Cost", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "operating_cost", - "fieldtype": "Float", - "label": "Total Operating Cost", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "more_info_section", - "fieldtype": "Section Break", - "label": "More Info" - }, - { - "default": "1", - "description": "Quantity of item obtained after manufacturing / repacking from given quantities of raw materials", - "doctype": "DocField", - "fieldname": "quantity", - "fieldtype": "Float", - "label": "Quantity", - "oldfieldname": "quantity", - "oldfieldtype": "Currency", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "uom", - "fieldtype": "Select", - "label": "Item UOM", - "options": "link:UOM", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "col_break23", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "project_name", - "fieldtype": "Link", - "in_filter": 1, - "label": "Project Name", - "oldfieldname": "project_name", - "oldfieldtype": "Link", - "options": "Project" - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Small Text", - "in_list_view": 1, - "label": "Item Desription", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "amended_from", - "fieldtype": "Link", - "ignore_restrictions": 1, - "label": "Amended From", - "no_copy": 1, - "options": "BOM", - "print_hide": 1, - "read_only": 1 - }, - { - "depends_on": "eval:!doc.__islocal", - "doctype": "DocField", - "fieldname": "section_break0", - "fieldtype": "Section Break", - "hidden": 0, - "label": "Materials Required (Exploded)", - "print_hide": 0 - }, - { - "doctype": "DocField", - "fieldname": "flat_bom_details", - "fieldtype": "Table", - "hidden": 0, - "label": "Materials Required (Exploded)", - "no_copy": 1, - "oldfieldname": "flat_bom_details", - "oldfieldtype": "Table", - "options": "BOM Explosion Item", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocPerm", - "role": "Manufacturing Manager" - }, - { - "doctype": "DocPerm", - "role": "Manufacturing User" - } -] \ No newline at end of file +{ + "allow_attach": 0, + "allow_copy": 0, + "allow_import": 1, + "allow_rename": 0, + "creation": "2013-01-22 15:11:38", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "description": "Item to be manufactured or repacked", + "fieldname": "item", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 0, + "label": "Item", + "oldfieldname": "item", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "allow_on_submit": 1, + "default": "1", + "fieldname": "is_active", + "fieldtype": "Check", + "hidden": 0, + "in_list_view": 1, + "label": "Is Active", + "no_copy": 1, + "oldfieldname": "is_active", + "oldfieldtype": "Select", + "permlevel": 0, + "reqd": 0 + }, + { + "allow_on_submit": 1, + "default": "1", + "fieldname": "is_default", + "fieldtype": "Check", + "in_list_view": 1, + "label": "Is Default", + "no_copy": 1, + "oldfieldname": "is_default", + "oldfieldtype": "Check", + "permlevel": 0 + }, + { + "fieldname": "cb0", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "description": "Manage cost of operations", + "fieldname": "with_operations", + "fieldtype": "Check", + "label": "With Operations", + "permlevel": 0 + }, + { + "fieldname": "rm_cost_as_per", + "fieldtype": "Select", + "label": "Rate Of Materials Based On", + "options": "Valuation Rate\nLast Purchase Rate\nPrice List", + "permlevel": 0 + }, + { + "depends_on": "eval:doc.rm_cost_as_per===\"Price List\"", + "fieldname": "buying_price_list", + "fieldtype": "Link", + "label": "Price List", + "options": "Price List", + "permlevel": 0 + }, + { + "depends_on": "with_operations", + "description": "Specify the operations, operating cost and give a unique Operation no to your operations.", + "fieldname": "operations", + "fieldtype": "Section Break", + "label": "Operations", + "oldfieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "bom_operations", + "fieldtype": "Table", + "label": "BOM Operations", + "oldfieldname": "bom_operations", + "oldfieldtype": "Table", + "options": "BOM Operation", + "permlevel": 0 + }, + { + "fieldname": "materials", + "fieldtype": "Section Break", + "label": "Materials", + "oldfieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "bom_materials", + "fieldtype": "Table", + "label": "BOM Item", + "oldfieldname": "bom_materials", + "oldfieldtype": "Table", + "options": "BOM Item", + "permlevel": 0 + }, + { + "fieldname": "costing", + "fieldtype": "Section Break", + "label": "Costing", + "oldfieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "total_cost", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Total Cost", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "cb1", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "raw_material_cost", + "fieldtype": "Float", + "label": "Total Raw Material Cost", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "operating_cost", + "fieldtype": "Float", + "label": "Total Operating Cost", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "more_info_section", + "fieldtype": "Section Break", + "label": "More Info", + "permlevel": 0 + }, + { + "default": "1", + "description": "Quantity of item obtained after manufacturing / repacking from given quantities of raw materials", + "fieldname": "quantity", + "fieldtype": "Float", + "label": "Quantity", + "oldfieldname": "quantity", + "oldfieldtype": "Currency", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "uom", + "fieldtype": "Select", + "label": "Item UOM", + "options": "link:UOM", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "col_break23", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "project_name", + "fieldtype": "Link", + "in_filter": 1, + "label": "Project Name", + "oldfieldname": "project_name", + "oldfieldtype": "Link", + "options": "Project", + "permlevel": 0 + }, + { + "fieldname": "description", + "fieldtype": "Small Text", + "in_list_view": 1, + "label": "Item Desription", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "amended_from", + "fieldtype": "Link", + "ignore_restrictions": 1, + "label": "Amended From", + "no_copy": 1, + "options": "BOM", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "depends_on": "eval:!doc.__islocal", + "fieldname": "section_break0", + "fieldtype": "Section Break", + "hidden": 0, + "label": "Materials Required (Exploded)", + "permlevel": 0, + "print_hide": 0 + }, + { + "fieldname": "flat_bom_details", + "fieldtype": "Table", + "hidden": 0, + "label": "Materials Required (Exploded)", + "no_copy": 1, + "oldfieldname": "flat_bom_details", + "oldfieldtype": "Table", + "options": "BOM Explosion Item", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + } + ], + "hide_heading": 0, + "hide_toolbar": 0, + "icon": "icon-sitemap", + "idx": 1, + "in_create": 0, + "is_submittable": 1, + "issingle": 0, + "istable": 0, + "modified": "2014-01-20 17:48:26", + "modified_by": "Administrator", + "module": "Manufacturing", + "name": "BOM", + "owner": "Administrator", + "permissions": [ + { + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Manufacturing Manager", + "submit": 1, + "write": 1 + }, + { + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Manufacturing User", + "submit": 1, + "write": 1 + } + ], + "read_only": 0, + "search_fields": "item" +} \ No newline at end of file diff --git a/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.txt b/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.txt index 55342aa59f..c0bd7798fe 100644 --- a/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.txt +++ b/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.txt @@ -1,98 +1,91 @@ -[ - { - "creation": "2013-03-07 11:42:57", - "docstatus": 0, - "modified": "2013-12-20 19:22:57", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "FBD/.######", - "default_print_format": "Standard", - "doctype": "DocType", - "istable": 1, - "module": "Manufacturing", - "name": "__common__", - "read_only": 0 - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "BOM Explosion Item", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0, - "read_only": 1 - }, - { - "doctype": "DocType", - "name": "BOM Explosion Item" - }, - { - "doctype": "DocField", - "fieldname": "item_code", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Item Code", - "oldfieldname": "item_code", - "oldfieldtype": "Link", - "options": "Item" - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Text", - "in_list_view": 1, - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Text", - "print_width": "300px", - "width": "300px" - }, - { - "doctype": "DocField", - "fieldname": "qty", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Qty", - "oldfieldname": "qty", - "oldfieldtype": "Currency" - }, - { - "doctype": "DocField", - "fieldname": "rate", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Rate", - "oldfieldname": "standard_rate", - "oldfieldtype": "Currency" - }, - { - "doctype": "DocField", - "fieldname": "amount", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Amount", - "oldfieldname": "amount_as_per_sr", - "oldfieldtype": "Currency" - }, - { - "doctype": "DocField", - "fieldname": "stock_uom", - "fieldtype": "Link", - "in_list_view": 0, - "label": "Stock UOM", - "oldfieldname": "stock_uom", - "oldfieldtype": "Link", - "options": "UOM" - }, - { - "doctype": "DocField", - "fieldname": "qty_consumed_per_unit", - "fieldtype": "Float", - "hidden": 0, - "in_list_view": 1, - "label": "Qty Consumed Per Unit", - "no_copy": 0 - } -] \ No newline at end of file +{ + "autoname": "FBD/.######", + "creation": "2013-03-07 11:42:57", + "default_print_format": "Standard", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "item_code", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Item Code", + "oldfieldname": "item_code", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "description", + "fieldtype": "Text", + "in_list_view": 1, + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Text", + "permlevel": 0, + "print_width": "300px", + "read_only": 1, + "width": "300px" + }, + { + "fieldname": "qty", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Qty", + "oldfieldname": "qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "rate", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Rate", + "oldfieldname": "standard_rate", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "amount", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Amount", + "oldfieldname": "amount_as_per_sr", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "stock_uom", + "fieldtype": "Link", + "in_list_view": 0, + "label": "Stock UOM", + "oldfieldname": "stock_uom", + "oldfieldtype": "Link", + "options": "UOM", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "qty_consumed_per_unit", + "fieldtype": "Float", + "hidden": 0, + "in_list_view": 1, + "label": "Qty Consumed Per Unit", + "no_copy": 0, + "permlevel": 0, + "read_only": 1 + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:22:57", + "modified_by": "Administrator", + "module": "Manufacturing", + "name": "BOM Explosion Item", + "owner": "Administrator", + "read_only": 0 +} \ No newline at end of file diff --git a/erpnext/manufacturing/doctype/bom_item/bom_item.txt b/erpnext/manufacturing/doctype/bom_item/bom_item.txt index 6949b75e4f..2e504359b4 100644 --- a/erpnext/manufacturing/doctype/bom_item/bom_item.txt +++ b/erpnext/manufacturing/doctype/bom_item/bom_item.txt @@ -1,154 +1,141 @@ -[ - { - "creation": "2013-02-22 01:27:49", - "docstatus": 0, - "modified": "2014-02-03 12:47:39", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "istable": 1, - "module": "Manufacturing", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "BOM Item", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "BOM Item" - }, - { - "doctype": "DocField", - "fieldname": "operation_no", - "fieldtype": "Select", - "in_list_view": 1, - "label": "Operation No", - "oldfieldname": "operation_no", - "oldfieldtype": "Data", - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "item_code", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "Item Code", - "oldfieldname": "item_code", - "oldfieldtype": "Link", - "options": "Item", - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "bom_no", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "BOM No", - "oldfieldname": "bom_no", - "oldfieldtype": "Link", - "options": "BOM", - "print_width": "150px", - "reqd": 0, - "search_index": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "col_break1", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Text", - "label": "Item Description", - "oldfieldname": "description", - "oldfieldtype": "Text", - "print_width": "250px", - "reqd": 0, - "width": "250px" - }, - { - "doctype": "DocField", - "fieldname": "quantity_and_rate", - "fieldtype": "Section Break", - "label": "Quantity and Rate" - }, - { - "doctype": "DocField", - "fieldname": "qty", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Qty", - "oldfieldname": "qty", - "oldfieldtype": "Currency", - "reqd": 1 - }, - { - "description": "See \"Rate Of Materials Based On\" in Costing Section", - "doctype": "DocField", - "fieldname": "rate", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Rate" - }, - { - "doctype": "DocField", - "fieldname": "col_break2", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "stock_uom", - "fieldtype": "Link", - "in_list_view": 0, - "label": "Stock UOM", - "oldfieldname": "stock_uom", - "oldfieldtype": "Data", - "options": "UOM", - "read_only": 1, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "amount", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Amount", - "oldfieldname": "amount_as_per_mar", - "oldfieldtype": "Currency", - "print_width": "150px", - "read_only": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "scrap", - "fieldtype": "Float", - "label": "Scrap %", - "oldfieldname": "scrap", - "oldfieldtype": "Currency", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "qty_consumed_per_unit", - "fieldtype": "Float", - "hidden": 1, - "label": "Qty Consumed Per Unit", - "oldfieldname": "qty_consumed_per_unit", - "oldfieldtype": "Float", - "print_hide": 1, - "read_only": 1 - } -] \ No newline at end of file +{ + "creation": "2013-02-22 01:27:49", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "operation_no", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Operation No", + "oldfieldname": "operation_no", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 0 + }, + { + "fieldname": "item_code", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Item Code", + "oldfieldname": "item_code", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "bom_no", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "BOM No", + "oldfieldname": "bom_no", + "oldfieldtype": "Link", + "options": "BOM", + "permlevel": 0, + "print_width": "150px", + "reqd": 0, + "search_index": 1, + "width": "150px" + }, + { + "fieldname": "col_break1", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "description", + "fieldtype": "Text", + "label": "Item Description", + "oldfieldname": "description", + "oldfieldtype": "Text", + "permlevel": 0, + "print_width": "250px", + "reqd": 0, + "width": "250px" + }, + { + "fieldname": "quantity_and_rate", + "fieldtype": "Section Break", + "label": "Quantity and Rate", + "permlevel": 0 + }, + { + "fieldname": "qty", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Qty", + "oldfieldname": "qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "reqd": 1 + }, + { + "description": "See \"Rate Of Materials Based On\" in Costing Section", + "fieldname": "rate", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Rate", + "permlevel": 0 + }, + { + "fieldname": "col_break2", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "stock_uom", + "fieldtype": "Link", + "in_list_view": 0, + "label": "Stock UOM", + "oldfieldname": "stock_uom", + "oldfieldtype": "Data", + "options": "UOM", + "permlevel": 0, + "read_only": 1, + "reqd": 1 + }, + { + "fieldname": "amount", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Amount", + "oldfieldname": "amount_as_per_mar", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_width": "150px", + "read_only": 1, + "width": "150px" + }, + { + "fieldname": "scrap", + "fieldtype": "Float", + "label": "Scrap %", + "oldfieldname": "scrap", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "qty_consumed_per_unit", + "fieldtype": "Float", + "hidden": 1, + "label": "Qty Consumed Per Unit", + "oldfieldname": "qty_consumed_per_unit", + "oldfieldtype": "Float", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + } + ], + "idx": 1, + "istable": 1, + "modified": "2014-02-03 12:47:39", + "modified_by": "Administrator", + "module": "Manufacturing", + "name": "BOM Item", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/manufacturing/doctype/bom_operation/bom_operation.txt b/erpnext/manufacturing/doctype/bom_operation/bom_operation.txt index b2628c1415..e164e10fc2 100644 --- a/erpnext/manufacturing/doctype/bom_operation/bom_operation.txt +++ b/erpnext/manufacturing/doctype/bom_operation/bom_operation.txt @@ -1,94 +1,81 @@ -[ - { - "creation": "2013-02-22 01:27:49", - "docstatus": 0, - "modified": "2014-02-03 12:53:03", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "istable": 1, - "module": "Manufacturing", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "BOM Operation", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "BOM Operation" - }, - { - "doctype": "DocField", - "fieldname": "operation_no", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Operation No", - "oldfieldname": "operation_no", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "opn_description", - "fieldtype": "Text", - "in_list_view": 1, - "label": "Operation Description", - "oldfieldname": "opn_description", - "oldfieldtype": "Text", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "col_break1", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "workstation", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Workstation", - "oldfieldname": "workstation", - "oldfieldtype": "Link", - "options": "Workstation", - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "hour_rate", - "fieldtype": "Float", - "in_list_view": 0, - "label": "Hour Rate", - "oldfieldname": "hour_rate", - "oldfieldtype": "Currency", - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "time_in_mins", - "fieldtype": "Float", - "in_list_view": 0, - "label": "Operation Time (mins)", - "oldfieldname": "time_in_mins", - "oldfieldtype": "Currency", - "reqd": 0 - }, - { - "allow_on_submit": 0, - "doctype": "DocField", - "fieldname": "operating_cost", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Operating Cost", - "oldfieldname": "operating_cost", - "oldfieldtype": "Currency", - "reqd": 0 - } -] \ No newline at end of file +{ + "creation": "2013-02-22 01:27:49", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "operation_no", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Operation No", + "oldfieldname": "operation_no", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "opn_description", + "fieldtype": "Text", + "in_list_view": 1, + "label": "Operation Description", + "oldfieldname": "opn_description", + "oldfieldtype": "Text", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "col_break1", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "workstation", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Workstation", + "oldfieldname": "workstation", + "oldfieldtype": "Link", + "options": "Workstation", + "permlevel": 0, + "reqd": 0 + }, + { + "fieldname": "hour_rate", + "fieldtype": "Float", + "in_list_view": 0, + "label": "Hour Rate", + "oldfieldname": "hour_rate", + "oldfieldtype": "Currency", + "permlevel": 0, + "reqd": 0 + }, + { + "fieldname": "time_in_mins", + "fieldtype": "Float", + "in_list_view": 0, + "label": "Operation Time (mins)", + "oldfieldname": "time_in_mins", + "oldfieldtype": "Currency", + "permlevel": 0, + "reqd": 0 + }, + { + "allow_on_submit": 0, + "fieldname": "operating_cost", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Operating Cost", + "oldfieldname": "operating_cost", + "oldfieldtype": "Currency", + "permlevel": 0, + "reqd": 0 + } + ], + "idx": 1, + "istable": 1, + "modified": "2014-02-03 12:53:03", + "modified_by": "Administrator", + "module": "Manufacturing", + "name": "BOM Operation", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.txt b/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.txt index cdb65ee24a..872881bbbc 100644 --- a/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.txt +++ b/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.txt @@ -1,80 +1,63 @@ -[ - { - "creation": "2012-12-06 12:10:10", - "docstatus": 0, - "modified": "2013-07-05 14:27:52", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_copy": 1, - "allow_email": 1, - "allow_print": 1, - "description": "Replace a particular BOM in all other BOMs where it is used. It will replace the old BOM link, update cost and regenerate \"BOM Explosion Item\" table as per new BOM", - "doctype": "DocType", - "document_type": "Other", - "hide_heading": 1, - "hide_toolbar": 1, - "icon": "icon-magic", - "in_create": 1, - "issingle": 1, - "module": "Manufacturing", - "name": "__common__", - "read_only": 1 - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "BOM Replace Tool", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0, - "read_only": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "name": "__common__", - "parent": "BOM Replace Tool", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "read": 1, - "report": 0, - "role": "Manufacturing Manager", - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "BOM Replace Tool" - }, - { - "description": "The BOM which will be replaced", - "doctype": "DocField", - "fieldname": "current_bom", - "fieldtype": "Link", - "label": "Current BOM", - "options": "BOM", - "reqd": 1 - }, - { - "description": "The new BOM after replacement", - "doctype": "DocField", - "fieldname": "new_bom", - "fieldtype": "Link", - "label": "New BOM", - "options": "BOM", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "replace", - "fieldtype": "Button", - "label": "Replace", - "options": "replace_bom" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "allow_copy": 1, + "allow_email": 1, + "allow_print": 1, + "creation": "2012-12-06 12:10:10", + "description": "Replace a particular BOM in all other BOMs where it is used. It will replace the old BOM link, update cost and regenerate \"BOM Explosion Item\" table as per new BOM", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Other", + "fields": [ + { + "description": "The BOM which will be replaced", + "fieldname": "current_bom", + "fieldtype": "Link", + "label": "Current BOM", + "options": "BOM", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "description": "The new BOM after replacement", + "fieldname": "new_bom", + "fieldtype": "Link", + "label": "New BOM", + "options": "BOM", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "replace", + "fieldtype": "Button", + "label": "Replace", + "options": "replace_bom", + "permlevel": 0, + "read_only": 0 + } + ], + "hide_heading": 1, + "hide_toolbar": 1, + "icon": "icon-magic", + "idx": 1, + "in_create": 1, + "issingle": 1, + "modified": "2013-07-05 14:27:52", + "modified_by": "Administrator", + "module": "Manufacturing", + "name": "BOM Replace Tool", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "permlevel": 0, + "read": 1, + "report": 0, + "role": "Manufacturing Manager", + "submit": 0, + "write": 1 + } + ], + "read_only": 1 +} \ No newline at end of file diff --git a/erpnext/manufacturing/doctype/production_order/production_order.txt b/erpnext/manufacturing/doctype/production_order/production_order.txt index 41ef1ce639..539d919f15 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.txt +++ b/erpnext/manufacturing/doctype/production_order/production_order.txt @@ -1,267 +1,248 @@ -[ - { - "creation": "2013-01-10 16:34:16", - "docstatus": 0, - "modified": "2014-01-20 17:49:01", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "autoname": "naming_series:", - "doctype": "DocType", - "icon": "icon-cogs", - "in_create": 0, - "is_submittable": 1, - "module": "Manufacturing", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Production Order", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Production Order", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Manufacturing User", - "submit": 1, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Production Order" - }, - { - "doctype": "DocField", - "fieldname": "item", - "fieldtype": "Section Break", - "label": "Item", - "options": "icon-gift" - }, - { - "default": "PRO", - "doctype": "DocField", - "fieldname": "naming_series", - "fieldtype": "Select", - "label": "Series", - "options": "\nPRO", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "production_item", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "Item To Manufacture", - "oldfieldname": "production_item", - "oldfieldtype": "Link", - "options": "Item", - "read_only": 0, - "reqd": 1 - }, - { - "depends_on": "production_item", - "description": "Bill of Material to be considered for manufacturing", - "doctype": "DocField", - "fieldname": "bom_no", - "fieldtype": "Link", - "in_list_view": 1, - "label": "BOM No", - "oldfieldname": "bom_no", - "oldfieldtype": "Link", - "options": "BOM", - "read_only": 0, - "reqd": 1 - }, - { - "default": "1", - "description": "If checked, BOM for sub-assembly items will be considered for getting raw materials. Otherwise, all sub-assembly items will be treated as a raw material.", - "doctype": "DocField", - "fieldname": "use_multi_level_bom", - "fieldtype": "Check", - "label": "Use Multi-Level BOM" - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "description": "Manufacture against Sales Order", - "doctype": "DocField", - "fieldname": "sales_order", - "fieldtype": "Link", - "label": "Sales Order", - "options": "Sales Order", - "read_only": 0 - }, - { - "depends_on": "production_item", - "doctype": "DocField", - "fieldname": "qty", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Qty To Manufacture", - "oldfieldname": "qty", - "oldfieldtype": "Currency", - "read_only": 0, - "reqd": 1 - }, - { - "depends_on": "eval:doc.docstatus==1", - "description": "Automatically updated via Stock Entry of type Manufacture/Repack", - "doctype": "DocField", - "fieldname": "produced_qty", - "fieldtype": "Float", - "label": "Manufactured Qty", - "no_copy": 1, - "oldfieldname": "produced_qty", - "oldfieldtype": "Currency", - "read_only": 1 - }, - { - "depends_on": "sales_order", - "doctype": "DocField", - "fieldname": "expected_delivery_date", - "fieldtype": "Date", - "label": "Expected Delivery Date", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "warehouses", - "fieldtype": "Section Break", - "label": "Warehouses", - "options": "icon-building" - }, - { - "depends_on": "production_item", - "description": "Manufactured quantity will be updated in this warehouse", - "doctype": "DocField", - "fieldname": "fg_warehouse", - "fieldtype": "Link", - "in_list_view": 1, - "label": "For Warehouse", - "options": "Warehouse", - "read_only": 0, - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break_12", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "wip_warehouse", - "fieldtype": "Link", - "label": "Work-in-Progress Warehouse", - "options": "Warehouse", - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "more_info", - "fieldtype": "Section Break", - "label": "More Info", - "options": "icon-file-text", - "read_only": 0 - }, - { - "depends_on": "eval:!doc.__islocal", - "doctype": "DocField", - "fieldname": "status", - "fieldtype": "Select", - "in_filter": 1, - "in_list_view": 1, - "label": "Status", - "no_copy": 1, - "oldfieldname": "status", - "oldfieldtype": "Select", - "options": "\nDraft\nSubmitted\nStopped\nIn Process\nCompleted\nCancelled", - "read_only": 1, - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Small Text", - "label": "Item Description", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "project_name", - "fieldtype": "Link", - "in_filter": 1, - "label": "Project Name", - "oldfieldname": "project_name", - "oldfieldtype": "Link", - "options": "Project", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break2", - "fieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "depends_on": "production_item", - "doctype": "DocField", - "fieldname": "stock_uom", - "fieldtype": "Link", - "label": "Stock UOM", - "oldfieldname": "stock_uom", - "oldfieldtype": "Data", - "options": "UOM", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "label": "Company", - "oldfieldname": "company", - "oldfieldtype": "Link", - "options": "Company", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "amended_from", - "fieldtype": "Data", - "ignore_restrictions": 1, - "label": "Amended From", - "no_copy": 1, - "oldfieldname": "amended_from", - "oldfieldtype": "Data", - "read_only": 1 - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "allow_import": 1, + "autoname": "naming_series:", + "creation": "2013-01-10 16:34:16", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "item", + "fieldtype": "Section Break", + "label": "Item", + "options": "icon-gift", + "permlevel": 0 + }, + { + "default": "PRO", + "fieldname": "naming_series", + "fieldtype": "Select", + "label": "Series", + "options": "\nPRO", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "production_item", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Item To Manufacture", + "oldfieldname": "production_item", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "depends_on": "production_item", + "description": "Bill of Material to be considered for manufacturing", + "fieldname": "bom_no", + "fieldtype": "Link", + "in_list_view": 1, + "label": "BOM No", + "oldfieldname": "bom_no", + "oldfieldtype": "Link", + "options": "BOM", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "default": "1", + "description": "If checked, BOM for sub-assembly items will be considered for getting raw materials. Otherwise, all sub-assembly items will be treated as a raw material.", + "fieldname": "use_multi_level_bom", + "fieldtype": "Check", + "label": "Use Multi-Level BOM", + "permlevel": 0 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "description": "Manufacture against Sales Order", + "fieldname": "sales_order", + "fieldtype": "Link", + "label": "Sales Order", + "options": "Sales Order", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "production_item", + "fieldname": "qty", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Qty To Manufacture", + "oldfieldname": "qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "depends_on": "eval:doc.docstatus==1", + "description": "Automatically updated via Stock Entry of type Manufacture/Repack", + "fieldname": "produced_qty", + "fieldtype": "Float", + "label": "Manufactured Qty", + "no_copy": 1, + "oldfieldname": "produced_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 1 + }, + { + "depends_on": "sales_order", + "fieldname": "expected_delivery_date", + "fieldtype": "Date", + "label": "Expected Delivery Date", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "warehouses", + "fieldtype": "Section Break", + "label": "Warehouses", + "options": "icon-building", + "permlevel": 0 + }, + { + "depends_on": "production_item", + "description": "Manufactured quantity will be updated in this warehouse", + "fieldname": "fg_warehouse", + "fieldtype": "Link", + "in_list_view": 1, + "label": "For Warehouse", + "options": "Warehouse", + "permlevel": 0, + "read_only": 0, + "reqd": 0 + }, + { + "fieldname": "column_break_12", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "wip_warehouse", + "fieldtype": "Link", + "label": "Work-in-Progress Warehouse", + "options": "Warehouse", + "permlevel": 0, + "reqd": 0 + }, + { + "fieldname": "more_info", + "fieldtype": "Section Break", + "label": "More Info", + "options": "icon-file-text", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "eval:!doc.__islocal", + "fieldname": "status", + "fieldtype": "Select", + "in_filter": 1, + "in_list_view": 1, + "label": "Status", + "no_copy": 1, + "oldfieldname": "status", + "oldfieldtype": "Select", + "options": "\nDraft\nSubmitted\nStopped\nIn Process\nCompleted\nCancelled", + "permlevel": 0, + "read_only": 1, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "description", + "fieldtype": "Small Text", + "label": "Item Description", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "project_name", + "fieldtype": "Link", + "in_filter": 1, + "label": "Project Name", + "oldfieldname": "project_name", + "oldfieldtype": "Link", + "options": "Project", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "column_break2", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "depends_on": "production_item", + "fieldname": "stock_uom", + "fieldtype": "Link", + "label": "Stock UOM", + "oldfieldname": "stock_uom", + "oldfieldtype": "Data", + "options": "UOM", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "company", + "fieldtype": "Link", + "label": "Company", + "oldfieldname": "company", + "oldfieldtype": "Link", + "options": "Company", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "amended_from", + "fieldtype": "Data", + "ignore_restrictions": 1, + "label": "Amended From", + "no_copy": 1, + "oldfieldname": "amended_from", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1 + } + ], + "icon": "icon-cogs", + "idx": 1, + "in_create": 0, + "is_submittable": 1, + "modified": "2014-01-20 17:49:01", + "modified_by": "Administrator", + "module": "Manufacturing", + "name": "Production Order", + "owner": "Administrator", + "permissions": [ + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Manufacturing User", + "submit": 1, + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.txt b/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.txt index 20681881c3..16ff1414e9 100644 --- a/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.txt +++ b/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.txt @@ -1,125 +1,112 @@ -[ - { - "creation": "2013-02-22 01:27:49", - "docstatus": 0, - "modified": "2013-12-20 19:23:25", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "PPID/.#####", - "doctype": "DocType", - "istable": 1, - "module": "Manufacturing", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Production Plan Item", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Production Plan Item" - }, - { - "doctype": "DocField", - "fieldname": "item_code", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Item Code", - "oldfieldname": "item_code", - "oldfieldtype": "Link", - "options": "Item", - "print_width": "150px", - "reqd": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "bom_no", - "fieldtype": "Link", - "in_list_view": 1, - "label": "BOM No", - "oldfieldname": "bom_no", - "oldfieldtype": "Link", - "options": "BOM", - "print_width": "100px", - "reqd": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "planned_qty", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Planned Qty", - "oldfieldname": "planned_qty", - "oldfieldtype": "Currency", - "print_width": "100px", - "reqd": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "sales_order", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Sales Order", - "oldfieldname": "source_docname", - "oldfieldtype": "Data", - "options": "Sales Order", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "so_pending_qty", - "fieldtype": "Float", - "in_list_view": 1, - "label": "SO Pending Qty", - "oldfieldname": "prevdoc_reqd_qty", - "oldfieldtype": "Currency", - "print_width": "100px", - "read_only": 1, - "reqd": 0, - "width": "100px" - }, - { - "description": "Reserved Warehouse in Sales Order / Finished Goods Warehouse", - "doctype": "DocField", - "fieldname": "warehouse", - "fieldtype": "Link", - "label": "Warehouse", - "options": "Warehouse", - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "stock_uom", - "fieldtype": "Link", - "in_list_view": 0, - "label": "UOM", - "oldfieldname": "stock_uom", - "oldfieldtype": "Data", - "options": "UOM", - "print_width": "80px", - "read_only": 1, - "reqd": 1, - "width": "80px" - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Text", - "in_list_view": 1, - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Text", - "print_width": "200px", - "read_only": 1, - "width": "200px" - } -] \ No newline at end of file +{ + "autoname": "PPID/.#####", + "creation": "2013-02-22 01:27:49", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "item_code", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Item Code", + "oldfieldname": "item_code", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0, + "print_width": "150px", + "reqd": 1, + "width": "150px" + }, + { + "fieldname": "bom_no", + "fieldtype": "Link", + "in_list_view": 1, + "label": "BOM No", + "oldfieldname": "bom_no", + "oldfieldtype": "Link", + "options": "BOM", + "permlevel": 0, + "print_width": "100px", + "reqd": 1, + "width": "100px" + }, + { + "fieldname": "planned_qty", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Planned Qty", + "oldfieldname": "planned_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_width": "100px", + "reqd": 1, + "width": "100px" + }, + { + "fieldname": "sales_order", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Sales Order", + "oldfieldname": "source_docname", + "oldfieldtype": "Data", + "options": "Sales Order", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "so_pending_qty", + "fieldtype": "Float", + "in_list_view": 1, + "label": "SO Pending Qty", + "oldfieldname": "prevdoc_reqd_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_width": "100px", + "read_only": 1, + "reqd": 0, + "width": "100px" + }, + { + "description": "Reserved Warehouse in Sales Order / Finished Goods Warehouse", + "fieldname": "warehouse", + "fieldtype": "Link", + "label": "Warehouse", + "options": "Warehouse", + "permlevel": 0, + "reqd": 0 + }, + { + "fieldname": "stock_uom", + "fieldtype": "Link", + "in_list_view": 0, + "label": "UOM", + "oldfieldname": "stock_uom", + "oldfieldtype": "Data", + "options": "UOM", + "permlevel": 0, + "print_width": "80px", + "read_only": 1, + "reqd": 1, + "width": "80px" + }, + { + "fieldname": "description", + "fieldtype": "Text", + "in_list_view": 1, + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Text", + "permlevel": 0, + "print_width": "200px", + "read_only": 1, + "width": "200px" + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:23:25", + "modified_by": "Administrator", + "module": "Manufacturing", + "name": "Production Plan Item", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.txt b/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.txt index 11a02a56aa..38241eafb4 100644 --- a/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.txt +++ b/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.txt @@ -1,71 +1,61 @@ -[ - { - "creation": "2013-02-22 01:27:49", - "docstatus": 0, - "modified": "2013-12-20 19:23:25", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "PP/.SO/.#####", - "doctype": "DocType", - "istable": 1, - "module": "Manufacturing", - "name": "__common__" - }, - { - "doctype": "DocField", - "in_list_view": 1, - "name": "__common__", - "parent": "Production Plan Sales Order", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Production Plan Sales Order" - }, - { - "doctype": "DocField", - "fieldname": "sales_order", - "fieldtype": "Link", - "label": "Sales Order", - "oldfieldname": "prevdoc_docname", - "oldfieldtype": "Data", - "options": "Sales Order", - "print_width": "150px", - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "sales_order_date", - "fieldtype": "Date", - "label": "SO Date", - "oldfieldname": "document_date", - "oldfieldtype": "Date", - "print_width": "120px", - "read_only": 1, - "width": "120px" - }, - { - "doctype": "DocField", - "fieldname": "customer", - "fieldtype": "Link", - "label": "Customer", - "options": "Customer", - "print_width": "150px", - "read_only": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "grand_total", - "fieldtype": "Currency", - "label": "Grand Total", - "options": "Company:company:default_currency", - "print_width": "120px", - "read_only": 1, - "width": "120px" - } -] \ No newline at end of file +{ + "autoname": "PP/.SO/.#####", + "creation": "2013-02-22 01:27:49", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "sales_order", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Sales Order", + "oldfieldname": "prevdoc_docname", + "oldfieldtype": "Data", + "options": "Sales Order", + "permlevel": 0, + "print_width": "150px", + "width": "150px" + }, + { + "fieldname": "sales_order_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "SO Date", + "oldfieldname": "document_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_width": "120px", + "read_only": 1, + "width": "120px" + }, + { + "fieldname": "customer", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Customer", + "options": "Customer", + "permlevel": 0, + "print_width": "150px", + "read_only": 1, + "width": "150px" + }, + { + "fieldname": "grand_total", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Grand Total", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_width": "120px", + "read_only": 1, + "width": "120px" + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:23:25", + "modified_by": "Administrator", + "module": "Manufacturing", + "name": "Production Plan Sales Order", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.txt b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.txt index 4c3b065f4a..b758c1a7b9 100644 --- a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.txt +++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.txt @@ -1,196 +1,177 @@ -[ - { - "creation": "2013-01-21 12:03:47", - "docstatus": 0, - "modified": "2013-12-20 19:23:25", - "modified_by": "Administrator", - "owner": "jai@webnotestech.com" - }, - { - "default_print_format": "Standard", - "doctype": "DocType", - "icon": "icon-calendar", - "in_create": 1, - "issingle": 1, - "module": "Manufacturing", - "name": "__common__", - "read_only": 1 - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Production Planning Tool", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Production Planning Tool", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 0, - "role": "Manufacturing User", - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Production Planning Tool" - }, - { - "description": "Select Sales Orders from which you want to create Production Orders.", - "doctype": "DocField", - "fieldname": "select_sales_orders", - "fieldtype": "Section Break", - "label": "Select Sales Orders" - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "fg_item", - "fieldtype": "Link", - "label": "Filter based on item", - "options": "Item" - }, - { - "doctype": "DocField", - "fieldname": "customer", - "fieldtype": "Link", - "label": "Filter based on customer", - "options": "Customer" - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "label": "Company", - "options": "Company", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "from_date", - "fieldtype": "Date", - "label": "From Date" - }, - { - "doctype": "DocField", - "fieldname": "to_date", - "fieldtype": "Date", - "label": "To Date" - }, - { - "doctype": "DocField", - "fieldname": "section_break1", - "fieldtype": "Section Break", - "options": "Simple" - }, - { - "description": "Pull sales orders (pending to deliver) based on the above criteria", - "doctype": "DocField", - "fieldname": "get_sales_orders", - "fieldtype": "Button", - "label": "Get Sales Orders", - "options": "get_open_sales_orders" - }, - { - "doctype": "DocField", - "fieldname": "pp_so_details", - "fieldtype": "Table", - "label": "Production Plan Sales Orders", - "options": "Production Plan Sales Order" - }, - { - "doctype": "DocField", - "fieldname": "items_for_production", - "fieldtype": "Section Break", - "label": "Select Items" - }, - { - "doctype": "DocField", - "fieldname": "get_items_from_so", - "fieldtype": "Button", - "label": "Get Items From Sales Orders", - "options": "get_items_from_so" - }, - { - "default": "1", - "description": "If checked, BOM for sub-assembly items will be considered for getting raw materials. Otherwise, all sub-assembly items will be treated as a raw material.", - "doctype": "DocField", - "fieldname": "use_multi_level_bom", - "fieldtype": "Check", - "label": "Use Multi-Level BOM", - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "pp_details", - "fieldtype": "Table", - "label": "Production Plan Items", - "options": "Production Plan Item" - }, - { - "description": "Enter items and planned qty for which you want to raise production orders or download raw materials for analysis.", - "doctype": "DocField", - "fieldname": "create_production_orders", - "fieldtype": "Section Break", - "label": "Production Orders" - }, - { - "description": "Separate production order will be created for each finished good item.", - "doctype": "DocField", - "fieldname": "raise_production_order", - "fieldtype": "Button", - "label": "Create Production Orders", - "options": "raise_production_order" - }, - { - "doctype": "DocField", - "fieldname": "sb5", - "fieldtype": "Section Break", - "label": "Material Requirement" - }, - { - "doctype": "DocField", - "fieldname": "purchase_request_for_warehouse", - "fieldtype": "Link", - "label": "Material Request For Warehouse", - "options": "Warehouse" - }, - { - "description": "Items to be requested which are \"Out of Stock\" considering all warehouses based on projected qty and minimum order qty", - "doctype": "DocField", - "fieldname": "raise_purchase_request", - "fieldtype": "Button", - "label": "Create Material Requests", - "options": "raise_purchase_request" - }, - { - "description": "Download a report containing all raw materials with their latest inventory status", - "doctype": "DocField", - "fieldname": "download_materials_required", - "fieldtype": "Button", - "label": "Download Materials Required" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "creation": "2013-01-21 12:03:47", + "default_print_format": "Standard", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "description": "Select Sales Orders from which you want to create Production Orders.", + "fieldname": "select_sales_orders", + "fieldtype": "Section Break", + "label": "Select Sales Orders", + "permlevel": 0 + }, + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "fg_item", + "fieldtype": "Link", + "label": "Filter based on item", + "options": "Item", + "permlevel": 0 + }, + { + "fieldname": "customer", + "fieldtype": "Link", + "label": "Filter based on customer", + "options": "Customer", + "permlevel": 0 + }, + { + "fieldname": "company", + "fieldtype": "Link", + "label": "Company", + "options": "Company", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "from_date", + "fieldtype": "Date", + "label": "From Date", + "permlevel": 0 + }, + { + "fieldname": "to_date", + "fieldtype": "Date", + "label": "To Date", + "permlevel": 0 + }, + { + "fieldname": "section_break1", + "fieldtype": "Section Break", + "options": "Simple", + "permlevel": 0 + }, + { + "description": "Pull sales orders (pending to deliver) based on the above criteria", + "fieldname": "get_sales_orders", + "fieldtype": "Button", + "label": "Get Sales Orders", + "options": "get_open_sales_orders", + "permlevel": 0 + }, + { + "fieldname": "pp_so_details", + "fieldtype": "Table", + "label": "Production Plan Sales Orders", + "options": "Production Plan Sales Order", + "permlevel": 0 + }, + { + "fieldname": "items_for_production", + "fieldtype": "Section Break", + "label": "Select Items", + "permlevel": 0 + }, + { + "fieldname": "get_items_from_so", + "fieldtype": "Button", + "label": "Get Items From Sales Orders", + "options": "get_items_from_so", + "permlevel": 0 + }, + { + "default": "1", + "description": "If checked, BOM for sub-assembly items will be considered for getting raw materials. Otherwise, all sub-assembly items will be treated as a raw material.", + "fieldname": "use_multi_level_bom", + "fieldtype": "Check", + "label": "Use Multi-Level BOM", + "permlevel": 0, + "reqd": 0 + }, + { + "fieldname": "pp_details", + "fieldtype": "Table", + "label": "Production Plan Items", + "options": "Production Plan Item", + "permlevel": 0 + }, + { + "description": "Enter items and planned qty for which you want to raise production orders or download raw materials for analysis.", + "fieldname": "create_production_orders", + "fieldtype": "Section Break", + "label": "Production Orders", + "permlevel": 0 + }, + { + "description": "Separate production order will be created for each finished good item.", + "fieldname": "raise_production_order", + "fieldtype": "Button", + "label": "Create Production Orders", + "options": "raise_production_order", + "permlevel": 0 + }, + { + "fieldname": "sb5", + "fieldtype": "Section Break", + "label": "Material Requirement", + "permlevel": 0 + }, + { + "fieldname": "purchase_request_for_warehouse", + "fieldtype": "Link", + "label": "Material Request For Warehouse", + "options": "Warehouse", + "permlevel": 0 + }, + { + "description": "Items to be requested which are \"Out of Stock\" considering all warehouses based on projected qty and minimum order qty", + "fieldname": "raise_purchase_request", + "fieldtype": "Button", + "label": "Create Material Requests", + "options": "raise_purchase_request", + "permlevel": 0 + }, + { + "description": "Download a report containing all raw materials with their latest inventory status", + "fieldname": "download_materials_required", + "fieldtype": "Button", + "label": "Download Materials Required", + "permlevel": 0 + } + ], + "icon": "icon-calendar", + "idx": 1, + "in_create": 1, + "issingle": 1, + "modified": "2013-12-20 19:23:25", + "modified_by": "Administrator", + "module": "Manufacturing", + "name": "Production Planning Tool", + "owner": "jai@webnotestech.com", + "permissions": [ + { + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 0, + "role": "Manufacturing User", + "submit": 0, + "write": 1 + } + ], + "read_only": 1 +} \ No newline at end of file diff --git a/erpnext/manufacturing/doctype/workstation/workstation.txt b/erpnext/manufacturing/doctype/workstation/workstation.txt index b8355bfe6d..d4da5864ce 100644 --- a/erpnext/manufacturing/doctype/workstation/workstation.txt +++ b/erpnext/manufacturing/doctype/workstation/workstation.txt @@ -1,168 +1,149 @@ -[ - { - "creation": "2013-01-10 16:34:17", - "docstatus": 0, - "modified": "2014-01-20 17:49:35", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "autoname": "field:workstation_name", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-wrench", - "module": "Manufacturing", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Workstation", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "cancel": 0, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Workstation", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Manufacturing User", - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Workstation" - }, - { - "doctype": "DocField", - "fieldname": "workstation_name", - "fieldtype": "Data", - "label": "Workstation Name", - "oldfieldname": "workstation_name", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "warehouse", - "fieldtype": "Link", - "label": "Warehouse", - "oldfieldname": "warehouse", - "oldfieldtype": "Link", - "options": "Warehouse", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Text", - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Text", - "width": "300px" - }, - { - "doctype": "DocField", - "fieldname": "capacity", - "fieldtype": "Data", - "hidden": 1, - "label": "Capacity", - "oldfieldname": "capacity", - "oldfieldtype": "Data", - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "capacity_units", - "fieldtype": "Select", - "hidden": 1, - "label": "Capacity Units", - "oldfieldname": "capacity_units", - "oldfieldtype": "Select", - "options": "\nUnits/Shifts\nUnits/Hour", - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "hour_rate_labour", - "fieldtype": "Float", - "label": "Hour Rate Labour", - "oldfieldname": "hour_rate_labour", - "oldfieldtype": "Currency", - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "over_heads", - "fieldtype": "Section Break", - "label": "Overheads", - "oldfieldtype": "Section Break" - }, - { - "description": "Electricity cost per hour", - "doctype": "DocField", - "fieldname": "hour_rate_electricity", - "fieldtype": "Float", - "label": "Electricity Cost", - "oldfieldname": "hour_rate_electricity", - "oldfieldtype": "Currency" - }, - { - "description": "Consumable cost per hour", - "doctype": "DocField", - "fieldname": "hour_rate_consumable", - "fieldtype": "Float", - "label": "Consumable Cost", - "oldfieldname": "hour_rate_consumable", - "oldfieldtype": "Currency" - }, - { - "description": "Rent per hour", - "doctype": "DocField", - "fieldname": "hour_rate_rent", - "fieldtype": "Float", - "label": "Rent Cost", - "oldfieldname": "hour_rate_rent", - "oldfieldtype": "Currency" - }, - { - "doctype": "DocField", - "fieldname": "overhead", - "fieldtype": "Float", - "label": "Overhead", - "oldfieldname": "overhead", - "oldfieldtype": "Currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "hour_rate_section_break", - "fieldtype": "Section Break", - "label": "Hour Rate", - "oldfieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "hour_rate", - "fieldtype": "Float", - "label": "Hour Rate", - "oldfieldname": "hour_rate", - "oldfieldtype": "Currency", - "read_only": 1 - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "allow_import": 1, + "autoname": "field:workstation_name", + "creation": "2013-01-10 16:34:17", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "workstation_name", + "fieldtype": "Data", + "label": "Workstation Name", + "oldfieldname": "workstation_name", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "warehouse", + "fieldtype": "Link", + "label": "Warehouse", + "oldfieldname": "warehouse", + "oldfieldtype": "Link", + "options": "Warehouse", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "description", + "fieldtype": "Text", + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Text", + "permlevel": 0, + "width": "300px" + }, + { + "fieldname": "capacity", + "fieldtype": "Data", + "hidden": 1, + "label": "Capacity", + "oldfieldname": "capacity", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 0 + }, + { + "fieldname": "capacity_units", + "fieldtype": "Select", + "hidden": 1, + "label": "Capacity Units", + "oldfieldname": "capacity_units", + "oldfieldtype": "Select", + "options": "\nUnits/Shifts\nUnits/Hour", + "permlevel": 0, + "reqd": 0 + }, + { + "fieldname": "hour_rate_labour", + "fieldtype": "Float", + "label": "Hour Rate Labour", + "oldfieldname": "hour_rate_labour", + "oldfieldtype": "Currency", + "permlevel": 0, + "reqd": 0 + }, + { + "fieldname": "over_heads", + "fieldtype": "Section Break", + "label": "Overheads", + "oldfieldtype": "Section Break", + "permlevel": 0 + }, + { + "description": "Electricity cost per hour", + "fieldname": "hour_rate_electricity", + "fieldtype": "Float", + "label": "Electricity Cost", + "oldfieldname": "hour_rate_electricity", + "oldfieldtype": "Currency", + "permlevel": 0 + }, + { + "description": "Consumable cost per hour", + "fieldname": "hour_rate_consumable", + "fieldtype": "Float", + "label": "Consumable Cost", + "oldfieldname": "hour_rate_consumable", + "oldfieldtype": "Currency", + "permlevel": 0 + }, + { + "description": "Rent per hour", + "fieldname": "hour_rate_rent", + "fieldtype": "Float", + "label": "Rent Cost", + "oldfieldname": "hour_rate_rent", + "oldfieldtype": "Currency", + "permlevel": 0 + }, + { + "fieldname": "overhead", + "fieldtype": "Float", + "label": "Overhead", + "oldfieldname": "overhead", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "hour_rate_section_break", + "fieldtype": "Section Break", + "label": "Hour Rate", + "oldfieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "hour_rate", + "fieldtype": "Float", + "label": "Hour Rate", + "oldfieldname": "hour_rate", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 1 + } + ], + "icon": "icon-wrench", + "idx": 1, + "modified": "2014-01-20 17:49:35", + "modified_by": "Administrator", + "module": "Manufacturing", + "name": "Workstation", + "owner": "Administrator", + "permissions": [ + { + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Manufacturing User", + "submit": 0, + "write": 1 + } + ] +} \ No newline at end of file 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 558ef3eedd..7fd484736f 100644 --- a/erpnext/manufacturing/report/completed_production_orders/completed_production_orders.txt +++ b/erpnext/manufacturing/report/completed_production_orders/completed_production_orders.txt @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-08-12 12:44:27", - "docstatus": 0, - "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", - "report_name": "Completed Production Orders", - "report_type": "Query Report" - }, - { - "doctype": "Report", - "name": "Completed Production Orders" - } -] \ No newline at end of file +{ + "creation": "2013-08-12 12:44:27", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Manufacturing", + "name": "Completed Production Orders", + "owner": "Administrator", + "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", + "report_name": "Completed Production Orders", + "report_type": "Query Report" +} \ No newline at end of file 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 cb0808b9fd..032db0b3f4 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 @@ -1,24 +1,17 @@ -[ - { - "creation": "2013-05-03 17:48:46", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "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", - "report_name": "Issued Items Against Production Order", - "report_type": "Query Report" - }, - { - "doctype": "Report", - "name": "Issued Items Against Production Order" - } -] \ No newline at end of file +{ + "add_total_row": 0, + "creation": "2013-05-03 17:48:46", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Manufacturing", + "name": "Issued Items Against Production Order", + "owner": "Administrator", + "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", + "report_name": "Issued Items Against Production Order", + "report_type": "Query Report" +} \ No newline at end of file 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 861392548a..e952a20c5a 100644 --- a/erpnext/manufacturing/report/open_production_orders/open_production_orders.txt +++ b/erpnext/manufacturing/report/open_production_orders/open_production_orders.txt @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-08-12 12:32:30", - "docstatus": 0, - "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", - "report_name": "Open Production Orders", - "report_type": "Query Report" - }, - { - "doctype": "Report", - "name": "Open Production Orders" - } -] \ No newline at end of file +{ + "creation": "2013-08-12 12:32:30", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Manufacturing", + "name": "Open Production Orders", + "owner": "Administrator", + "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", + "report_name": "Open Production Orders", + "report_type": "Query Report" +} \ No newline at end of file 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 8c4e1d2fbf..b0412073a7 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 @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-08-12 12:43:47", - "docstatus": 0, - "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", - "report_name": "Production Orders in Progress", - "report_type": "Query Report" - }, - { - "doctype": "Report", - "name": "Production Orders in Progress" - } -] \ No newline at end of file +{ + "creation": "2013-08-12 12:43:47", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Manufacturing", + "name": "Production Orders in Progress", + "owner": "Administrator", + "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", + "report_name": "Production Orders in Progress", + "report_type": "Query Report" +} \ No newline at end of file diff --git a/erpnext/projects/doctype/activity_type/activity_type.txt b/erpnext/projects/doctype/activity_type/activity_type.txt index d8a50c519d..7f76abcf5c 100644 --- a/erpnext/projects/doctype/activity_type/activity_type.txt +++ b/erpnext/projects/doctype/activity_type/activity_type.txt @@ -1,60 +1,47 @@ -[ - { - "creation": "2013-03-05 10:14:59", - "docstatus": 0, - "modified": "2013-12-20 19:23:54", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "autoname": "field:activity_type", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-flag", - "in_dialog": 0, - "module": "Projects", - "name": "__common__" - }, - { - "doctype": "DocField", - "fieldname": "activity_type", - "fieldtype": "Data", - "label": "Activity Type", - "name": "__common__", - "parent": "Activity Type", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0, - "reqd": 1 - }, - { - "create": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Activity Type", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Activity Type" - }, - { - "doctype": "DocField" - }, - { - "doctype": "DocPerm", - "role": "System Manager" - }, - { - "doctype": "DocPerm", - "role": "Projects User" - } -] \ No newline at end of file +{ + "allow_import": 1, + "autoname": "field:activity_type", + "creation": "2013-03-05 10:14:59", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "activity_type", + "fieldtype": "Data", + "label": "Activity Type", + "permlevel": 0, + "reqd": 1 + } + ], + "icon": "icon-flag", + "idx": 1, + "in_dialog": 0, + "modified": "2013-12-20 19:23:54", + "modified_by": "Administrator", + "module": "Projects", + "name": "Activity Type", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "write": 1 + }, + { + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Projects User", + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/projects/doctype/project/project.txt b/erpnext/projects/doctype/project/project.txt index 4f7e38dcc3..e1b2414005 100644 --- a/erpnext/projects/doctype/project/project.txt +++ b/erpnext/projects/doctype/project/project.txt @@ -1,309 +1,294 @@ -[ - { - "creation": "2013-03-07 11:55:07", - "docstatus": 0, - "modified": "2014-01-20 17:49:02", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_attach": 1, - "allow_import": 1, - "autoname": "field:project_name", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-puzzle-piece", - "max_attachments": 4, - "module": "Projects", - "name": "__common__", - "search_fields": "customer, status, priority, is_active" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Project", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "amend": 0, - "cancel": 0, - "doctype": "DocPerm", - "name": "__common__", - "parent": "Project", - "parentfield": "permissions", - "parenttype": "DocType", - "read": 1, - "report": 1, - "submit": 0 - }, - { - "doctype": "DocType", - "name": "Project" - }, - { - "doctype": "DocField", - "fieldname": "overview", - "fieldtype": "Section Break", - "label": "Overview", - "options": "icon-file" - }, - { - "doctype": "DocField", - "fieldname": "cb_project_status", - "fieldtype": "Column Break", - "label": "Status" - }, - { - "description": "Project will get saved and will be searchable with project name given", - "doctype": "DocField", - "fieldname": "project_name", - "fieldtype": "Data", - "label": "Project Name", - "no_copy": 0, - "oldfieldname": "project_name", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "default": "Open", - "doctype": "DocField", - "fieldname": "status", - "fieldtype": "Select", - "in_filter": 1, - "label": "Status", - "no_copy": 1, - "oldfieldname": "status", - "oldfieldtype": "Select", - "options": "Open\nCompleted\nCancelled", - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "is_active", - "fieldtype": "Select", - "label": "Is Active", - "no_copy": 0, - "oldfieldname": "is_active", - "oldfieldtype": "Select", - "options": "Yes\nNo", - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "priority", - "fieldtype": "Select", - "label": "Priority", - "no_copy": 0, - "oldfieldname": "priority", - "oldfieldtype": "Select", - "options": "Medium\nLow\nHigh", - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "cb_project_dates", - "fieldtype": "Column Break", - "label": "Dates" - }, - { - "doctype": "DocField", - "fieldname": "project_start_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Project Start Date", - "no_copy": 0, - "oldfieldname": "project_start_date", - "oldfieldtype": "Date", - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "completion_date", - "fieldtype": "Date", - "label": "Completion Date", - "no_copy": 0, - "oldfieldname": "completion_date", - "oldfieldtype": "Date", - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "act_completion_date", - "fieldtype": "Date", - "label": "Actual Completion Date", - "no_copy": 0, - "oldfieldname": "act_completion_date", - "oldfieldtype": "Date", - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "project_type", - "fieldtype": "Select", - "label": "Project Type", - "no_copy": 0, - "oldfieldname": "project_type", - "oldfieldtype": "Data", - "options": "Internal\nExternal\nOther", - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "sb_milestones", - "fieldtype": "Section Break", - "label": "Milestones", - "oldfieldtype": "Section Break", - "options": "icon-flag" - }, - { - "description": "Milestones will be added as Events in the Calendar", - "doctype": "DocField", - "fieldname": "project_milestones", - "fieldtype": "Table", - "label": "Project Milestones", - "no_copy": 0, - "oldfieldname": "project_milestones", - "oldfieldtype": "Table", - "options": "Project Milestone", - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "section_break0", - "fieldtype": "Section Break", - "label": "Project Details", - "oldfieldtype": "Section Break", - "options": "icon-list" - }, - { - "doctype": "DocField", - "fieldname": "notes", - "fieldtype": "Text Editor", - "label": "Notes", - "no_copy": 0, - "oldfieldname": "notes", - "oldfieldtype": "Text Editor", - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "percent_complete", - "fieldtype": "Percent", - "in_list_view": 1, - "label": "Percent Complete", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "label": "Company", - "options": "Company" - }, - { - "doctype": "DocField", - "fieldname": "project_details", - "fieldtype": "Section Break", - "label": "Project Costing", - "oldfieldtype": "Section Break", - "options": "icon-money" - }, - { - "doctype": "DocField", - "fieldname": "project_value", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Project Value", - "no_copy": 0, - "oldfieldname": "project_value", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "reqd": 0, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "est_material_cost", - "fieldtype": "Currency", - "label": "Estimated Material Cost", - "no_copy": 0, - "oldfieldname": "est_material_cost", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "label": "Margin", - "oldfieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "gross_margin_value", - "fieldtype": "Currency", - "label": "Gross Margin Value", - "no_copy": 0, - "oldfieldname": "gross_margin_value", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "reqd": 0, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "per_gross_margin", - "fieldtype": "Currency", - "label": "Gross Margin %", - "no_copy": 0, - "oldfieldname": "per_gross_margin", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "reqd": 0, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "customer_details", - "fieldtype": "Section Break", - "label": "Customer Details", - "oldfieldtype": "Section Break", - "options": "icon-user" - }, - { - "doctype": "DocField", - "fieldname": "customer", - "fieldtype": "Link", - "in_filter": 1, - "label": "Customer", - "no_copy": 0, - "oldfieldname": "customer", - "oldfieldtype": "Link", - "options": "Customer", - "print_hide": 1, - "reqd": 0, - "search_index": 1 - }, - { - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "permlevel": 0, - "print": 1, - "role": "Projects User", - "write": 1 - }, - { - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "permlevel": 1, - "role": "All" - } -] \ No newline at end of file +{ + "allow_attach": 1, + "allow_import": 1, + "autoname": "field:project_name", + "creation": "2013-03-07 11:55:07", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "overview", + "fieldtype": "Section Break", + "label": "Overview", + "options": "icon-file", + "permlevel": 0 + }, + { + "fieldname": "cb_project_status", + "fieldtype": "Column Break", + "label": "Status", + "permlevel": 0 + }, + { + "description": "Project will get saved and will be searchable with project name given", + "fieldname": "project_name", + "fieldtype": "Data", + "label": "Project Name", + "no_copy": 0, + "oldfieldname": "project_name", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + }, + { + "default": "Open", + "fieldname": "status", + "fieldtype": "Select", + "in_filter": 1, + "label": "Status", + "no_copy": 1, + "oldfieldname": "status", + "oldfieldtype": "Select", + "options": "Open\nCompleted\nCancelled", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "is_active", + "fieldtype": "Select", + "label": "Is Active", + "no_copy": 0, + "oldfieldname": "is_active", + "oldfieldtype": "Select", + "options": "Yes\nNo", + "permlevel": 0, + "search_index": 0 + }, + { + "fieldname": "priority", + "fieldtype": "Select", + "label": "Priority", + "no_copy": 0, + "oldfieldname": "priority", + "oldfieldtype": "Select", + "options": "Medium\nLow\nHigh", + "permlevel": 0, + "search_index": 0 + }, + { + "fieldname": "cb_project_dates", + "fieldtype": "Column Break", + "label": "Dates", + "permlevel": 0 + }, + { + "fieldname": "project_start_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Project Start Date", + "no_copy": 0, + "oldfieldname": "project_start_date", + "oldfieldtype": "Date", + "permlevel": 0, + "search_index": 0 + }, + { + "fieldname": "completion_date", + "fieldtype": "Date", + "label": "Completion Date", + "no_copy": 0, + "oldfieldname": "completion_date", + "oldfieldtype": "Date", + "permlevel": 0, + "search_index": 0 + }, + { + "fieldname": "act_completion_date", + "fieldtype": "Date", + "label": "Actual Completion Date", + "no_copy": 0, + "oldfieldname": "act_completion_date", + "oldfieldtype": "Date", + "permlevel": 0, + "search_index": 0 + }, + { + "fieldname": "project_type", + "fieldtype": "Select", + "label": "Project Type", + "no_copy": 0, + "oldfieldname": "project_type", + "oldfieldtype": "Data", + "options": "Internal\nExternal\nOther", + "permlevel": 0, + "search_index": 0 + }, + { + "fieldname": "sb_milestones", + "fieldtype": "Section Break", + "label": "Milestones", + "oldfieldtype": "Section Break", + "options": "icon-flag", + "permlevel": 0 + }, + { + "description": "Milestones will be added as Events in the Calendar", + "fieldname": "project_milestones", + "fieldtype": "Table", + "label": "Project Milestones", + "no_copy": 0, + "oldfieldname": "project_milestones", + "oldfieldtype": "Table", + "options": "Project Milestone", + "permlevel": 0, + "search_index": 0 + }, + { + "fieldname": "section_break0", + "fieldtype": "Section Break", + "label": "Project Details", + "oldfieldtype": "Section Break", + "options": "icon-list", + "permlevel": 0 + }, + { + "fieldname": "notes", + "fieldtype": "Text Editor", + "label": "Notes", + "no_copy": 0, + "oldfieldname": "notes", + "oldfieldtype": "Text Editor", + "permlevel": 0, + "search_index": 0 + }, + { + "fieldname": "percent_complete", + "fieldtype": "Percent", + "in_list_view": 1, + "label": "Percent Complete", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "company", + "fieldtype": "Link", + "label": "Company", + "options": "Company", + "permlevel": 0 + }, + { + "fieldname": "project_details", + "fieldtype": "Section Break", + "label": "Project Costing", + "oldfieldtype": "Section Break", + "options": "icon-money", + "permlevel": 0 + }, + { + "fieldname": "project_value", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Project Value", + "no_copy": 0, + "oldfieldname": "project_value", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "reqd": 0, + "search_index": 0 + }, + { + "fieldname": "est_material_cost", + "fieldtype": "Currency", + "label": "Estimated Material Cost", + "no_copy": 0, + "oldfieldname": "est_material_cost", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "search_index": 0 + }, + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "label": "Margin", + "oldfieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "gross_margin_value", + "fieldtype": "Currency", + "label": "Gross Margin Value", + "no_copy": 0, + "oldfieldname": "gross_margin_value", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "reqd": 0, + "search_index": 0 + }, + { + "fieldname": "per_gross_margin", + "fieldtype": "Currency", + "label": "Gross Margin %", + "no_copy": 0, + "oldfieldname": "per_gross_margin", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "reqd": 0, + "search_index": 0 + }, + { + "fieldname": "customer_details", + "fieldtype": "Section Break", + "label": "Customer Details", + "oldfieldtype": "Section Break", + "options": "icon-user", + "permlevel": 0 + }, + { + "fieldname": "customer", + "fieldtype": "Link", + "in_filter": 1, + "label": "Customer", + "no_copy": 0, + "oldfieldname": "customer", + "oldfieldtype": "Link", + "options": "Customer", + "permlevel": 0, + "print_hide": 1, + "reqd": 0, + "search_index": 1 + } + ], + "icon": "icon-puzzle-piece", + "idx": 1, + "max_attachments": 4, + "modified": "2014-01-20 17:49:02", + "modified_by": "Administrator", + "module": "Projects", + "name": "Project", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Projects User", + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "permlevel": 1, + "read": 1, + "report": 1, + "role": "All", + "submit": 0 + } + ], + "search_fields": "customer, status, priority, is_active" +} \ No newline at end of file diff --git a/erpnext/projects/doctype/project_milestone/project_milestone.txt b/erpnext/projects/doctype/project_milestone/project_milestone.txt index d5be81e9d8..3c79108cfa 100644 --- a/erpnext/projects/doctype/project_milestone/project_milestone.txt +++ b/erpnext/projects/doctype/project_milestone/project_milestone.txt @@ -1,56 +1,45 @@ -[ - { - "creation": "2013-02-22 01:27:50", - "docstatus": 0, - "modified": "2013-12-20 19:23:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "istable": 1, - "module": "Projects", - "name": "__common__" - }, - { - "doctype": "DocField", - "in_list_view": 1, - "name": "__common__", - "parent": "Project Milestone", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Project Milestone" - }, - { - "doctype": "DocField", - "fieldname": "milestone_date", - "fieldtype": "Date", - "label": "Milestone Date", - "oldfieldname": "milestone_date", - "oldfieldtype": "Date" - }, - { - "doctype": "DocField", - "fieldname": "milestone", - "fieldtype": "Text", - "label": "Milestone", - "oldfieldname": "milestone", - "oldfieldtype": "Text", - "print_width": "300px", - "width": "300px" - }, - { - "doctype": "DocField", - "fieldname": "status", - "fieldtype": "Select", - "label": "Status", - "no_copy": 1, - "oldfieldname": "status", - "oldfieldtype": "Select", - "options": "Pending\nCompleted" - } -] \ No newline at end of file +{ + "creation": "2013-02-22 01:27:50", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "milestone_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "Milestone Date", + "oldfieldname": "milestone_date", + "oldfieldtype": "Date", + "permlevel": 0 + }, + { + "fieldname": "milestone", + "fieldtype": "Text", + "in_list_view": 1, + "label": "Milestone", + "oldfieldname": "milestone", + "oldfieldtype": "Text", + "permlevel": 0, + "print_width": "300px", + "width": "300px" + }, + { + "fieldname": "status", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Status", + "no_copy": 1, + "oldfieldname": "status", + "oldfieldtype": "Select", + "options": "Pending\nCompleted", + "permlevel": 0 + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:23:27", + "modified_by": "Administrator", + "module": "Projects", + "name": "Project Milestone", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/projects/doctype/task/task.txt b/erpnext/projects/doctype/task/task.txt index 2dce94f921..6dbd0a4a53 100644 --- a/erpnext/projects/doctype/task/task.txt +++ b/erpnext/projects/doctype/task/task.txt @@ -1,262 +1,243 @@ -[ - { - "creation": "2013-01-29 19:25:50", - "docstatus": 0, - "modified": "2014-01-24 13:01:46", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_attach": 1, - "allow_import": 1, - "autoname": "TASK.#####", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-check", - "max_attachments": 5, - "module": "Projects", - "name": "__common__", - "search_fields": "subject", - "title_field": "subject" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Task", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "cancel": 0, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Task", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Projects User", - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Task" - }, - { - "doctype": "DocField", - "fieldname": "task_details", - "fieldtype": "Section Break", - "label": "Task Details", - "oldfieldtype": "Section Break", - "print_width": "50%", - "search_index": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "subject", - "fieldtype": "Data", - "in_filter": 1, - "in_list_view": 1, - "label": "Subject", - "oldfieldname": "subject", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "exp_start_date", - "fieldtype": "Date", - "label": "Expected Start Date", - "oldfieldname": "exp_start_date", - "oldfieldtype": "Date", - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "exp_end_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Expected End Date", - "oldfieldname": "exp_end_date", - "oldfieldtype": "Date", - "reqd": 0, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "print_width": "50%", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "project", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Project", - "oldfieldname": "project", - "oldfieldtype": "Link", - "options": "Project" - }, - { - "doctype": "DocField", - "fieldname": "status", - "fieldtype": "Select", - "in_list_view": 1, - "label": "Status", - "no_copy": 1, - "oldfieldname": "status", - "oldfieldtype": "Select", - "options": "Open\nWorking\nPending Review\nClosed\nCancelled" - }, - { - "doctype": "DocField", - "fieldname": "priority", - "fieldtype": "Select", - "in_filter": 1, - "in_list_view": 1, - "label": "Priority", - "oldfieldname": "priority", - "oldfieldtype": "Select", - "options": "Low\nMedium\nHigh\nUrgent", - "reqd": 0, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "section_break0", - "fieldtype": "Section Break", - "oldfieldtype": "Section Break", - "options": "Simple" - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Text Editor", - "label": "Details", - "oldfieldname": "description", - "oldfieldtype": "Text Editor", - "print_width": "300px", - "reqd": 0, - "width": "300px" - }, - { - "doctype": "DocField", - "fieldname": "time_and_budget", - "fieldtype": "Section Break", - "label": "Time and Budget", - "oldfieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "expected", - "fieldtype": "Column Break", - "label": "Expected", - "oldfieldtype": "Column Break", - "print_width": "50%", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "exp_total_hrs", - "fieldtype": "Data", - "label": "Total Hours (Expected)", - "oldfieldname": "exp_total_hrs", - "oldfieldtype": "Data", - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "allocated_budget", - "fieldtype": "Currency", - "label": "Allocated Budget", - "oldfieldname": "allocated_budget", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency" - }, - { - "doctype": "DocField", - "fieldname": "actual", - "fieldtype": "Column Break", - "label": "Actual", - "oldfieldtype": "Column Break", - "print_width": "50%", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "act_start_date", - "fieldtype": "Date", - "label": "Actual Start Date", - "oldfieldname": "act_start_date", - "oldfieldtype": "Date" - }, - { - "doctype": "DocField", - "fieldname": "act_end_date", - "fieldtype": "Date", - "label": "Actual End Date", - "oldfieldname": "act_end_date", - "oldfieldtype": "Date" - }, - { - "doctype": "DocField", - "fieldname": "actual_budget", - "fieldtype": "Currency", - "label": "Actual Budget", - "oldfieldname": "actual_budget", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency" - }, - { - "doctype": "DocField", - "fieldname": "more_details", - "fieldtype": "Section Break", - "label": "More Details" - }, - { - "depends_on": "eval:doc.status == \"Closed\" || doc.status == \"Pending Review\"", - "doctype": "DocField", - "fieldname": "review_date", - "fieldtype": "Date", - "hidden": 0, - "label": "Review Date", - "oldfieldname": "review_date", - "oldfieldtype": "Date" - }, - { - "depends_on": "eval:doc.status == \"Closed\"", - "doctype": "DocField", - "fieldname": "closing_date", - "fieldtype": "Date", - "hidden": 0, - "label": "Closing Date", - "oldfieldname": "closing_date", - "oldfieldtype": "Date" - }, - { - "doctype": "DocField", - "fieldname": "column_break_22", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "label": "Company", - "options": "Company" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "allow_attach": 1, + "allow_import": 1, + "autoname": "TASK.#####", + "creation": "2013-01-29 19:25:50", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "task_details", + "fieldtype": "Section Break", + "label": "Task Details", + "oldfieldtype": "Section Break", + "permlevel": 0, + "print_width": "50%", + "search_index": 0, + "width": "50%" + }, + { + "fieldname": "subject", + "fieldtype": "Data", + "in_filter": 1, + "in_list_view": 1, + "label": "Subject", + "oldfieldname": "subject", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "exp_start_date", + "fieldtype": "Date", + "label": "Expected Start Date", + "oldfieldname": "exp_start_date", + "oldfieldtype": "Date", + "permlevel": 0, + "reqd": 0 + }, + { + "fieldname": "exp_end_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Expected End Date", + "oldfieldname": "exp_end_date", + "oldfieldtype": "Date", + "permlevel": 0, + "reqd": 0, + "search_index": 1 + }, + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_width": "50%", + "width": "50%" + }, + { + "fieldname": "project", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Project", + "oldfieldname": "project", + "oldfieldtype": "Link", + "options": "Project", + "permlevel": 0 + }, + { + "fieldname": "status", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Status", + "no_copy": 1, + "oldfieldname": "status", + "oldfieldtype": "Select", + "options": "Open\nWorking\nPending Review\nClosed\nCancelled", + "permlevel": 0 + }, + { + "fieldname": "priority", + "fieldtype": "Select", + "in_filter": 1, + "in_list_view": 1, + "label": "Priority", + "oldfieldname": "priority", + "oldfieldtype": "Select", + "options": "Low\nMedium\nHigh\nUrgent", + "permlevel": 0, + "reqd": 0, + "search_index": 1 + }, + { + "fieldname": "section_break0", + "fieldtype": "Section Break", + "oldfieldtype": "Section Break", + "options": "Simple", + "permlevel": 0 + }, + { + "fieldname": "description", + "fieldtype": "Text Editor", + "label": "Details", + "oldfieldname": "description", + "oldfieldtype": "Text Editor", + "permlevel": 0, + "print_width": "300px", + "reqd": 0, + "width": "300px" + }, + { + "fieldname": "time_and_budget", + "fieldtype": "Section Break", + "label": "Time and Budget", + "oldfieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "expected", + "fieldtype": "Column Break", + "label": "Expected", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_width": "50%", + "width": "50%" + }, + { + "fieldname": "exp_total_hrs", + "fieldtype": "Data", + "label": "Total Hours (Expected)", + "oldfieldname": "exp_total_hrs", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 0 + }, + { + "fieldname": "allocated_budget", + "fieldtype": "Currency", + "label": "Allocated Budget", + "oldfieldname": "allocated_budget", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0 + }, + { + "fieldname": "actual", + "fieldtype": "Column Break", + "label": "Actual", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_width": "50%", + "width": "50%" + }, + { + "fieldname": "act_start_date", + "fieldtype": "Date", + "label": "Actual Start Date", + "oldfieldname": "act_start_date", + "oldfieldtype": "Date", + "permlevel": 0 + }, + { + "fieldname": "act_end_date", + "fieldtype": "Date", + "label": "Actual End Date", + "oldfieldname": "act_end_date", + "oldfieldtype": "Date", + "permlevel": 0 + }, + { + "fieldname": "actual_budget", + "fieldtype": "Currency", + "label": "Actual Budget", + "oldfieldname": "actual_budget", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0 + }, + { + "fieldname": "more_details", + "fieldtype": "Section Break", + "label": "More Details", + "permlevel": 0 + }, + { + "depends_on": "eval:doc.status == \"Closed\" || doc.status == \"Pending Review\"", + "fieldname": "review_date", + "fieldtype": "Date", + "hidden": 0, + "label": "Review Date", + "oldfieldname": "review_date", + "oldfieldtype": "Date", + "permlevel": 0 + }, + { + "depends_on": "eval:doc.status == \"Closed\"", + "fieldname": "closing_date", + "fieldtype": "Date", + "hidden": 0, + "label": "Closing Date", + "oldfieldname": "closing_date", + "oldfieldtype": "Date", + "permlevel": 0 + }, + { + "fieldname": "column_break_22", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "company", + "fieldtype": "Link", + "label": "Company", + "options": "Company", + "permlevel": 0 + } + ], + "icon": "icon-check", + "idx": 1, + "max_attachments": 5, + "modified": "2014-01-24 13:01:46", + "modified_by": "Administrator", + "module": "Projects", + "name": "Task", + "owner": "Administrator", + "permissions": [ + { + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Projects User", + "submit": 0, + "write": 1 + } + ], + "search_fields": "subject", + "title_field": "subject" +} \ No newline at end of file diff --git a/erpnext/projects/doctype/time_log/time_log.txt b/erpnext/projects/doctype/time_log/time_log.txt index 11fa7d6e6e..137ad86ea3 100644 --- a/erpnext/projects/doctype/time_log/time_log.txt +++ b/erpnext/projects/doctype/time_log/time_log.txt @@ -1,215 +1,189 @@ -[ - { - "creation": "2013-04-03 16:38:41", - "docstatus": 0, - "modified": "2014-01-22 16:05:35", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_attach": 1, - "allow_import": 1, - "autoname": "naming_series:", - "description": "Log of Activities performed by users against Tasks that can be used for tracking time, billing.", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-time", - "is_submittable": 1, - "module": "Projects", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Time Log", - "parentfield": "fields", - "parenttype": "DocType" - }, - { - "amend": 1, - "cancel": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Time Log", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 1, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Time Log" - }, - { - "doctype": "DocField", - "fieldname": "naming_series", - "fieldtype": "Select", - "label": "Series", - "options": "TL-", - "permlevel": 0, - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "from_time", - "fieldtype": "Datetime", - "in_list_view": 1, - "label": "From Time", - "permlevel": 0, - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "to_time", - "fieldtype": "Datetime", - "in_list_view": 0, - "label": "To Time", - "permlevel": 0, - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "hours", - "fieldtype": "Float", - "label": "Hours", - "permlevel": 0, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break_3", - "fieldtype": "Column Break", - "permlevel": 0, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "status", - "fieldtype": "Select", - "in_list_view": 1, - "label": "Status", - "options": "Draft\nSubmitted\nBatched for Billing\nBilled\nCancelled", - "permlevel": 0, - "read_only": 1, - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "activity_type", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Activity Type", - "options": "Activity Type", - "permlevel": 0, - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "task", - "fieldtype": "Link", - "label": "Task", - "options": "Task", - "permlevel": 0, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "billable", - "fieldtype": "Check", - "in_list_view": 1, - "label": "Billable", - "permlevel": 0, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "section_break_7", - "fieldtype": "Section Break", - "permlevel": 0, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "note", - "fieldtype": "Text Editor", - "label": "Note", - "permlevel": 0, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "section_break_9", - "fieldtype": "Section Break", - "permlevel": 0, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "project", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Project", - "options": "Project", - "permlevel": 0, - "read_only": 0 - }, - { - "description": "Will be updated when batched.", - "doctype": "DocField", - "fieldname": "time_log_batch", - "fieldtype": "Link", - "label": "Time Log Batch", - "options": "Time Log Batch", - "permlevel": 0, - "read_only": 1 - }, - { - "description": "Will be updated when billed.", - "doctype": "DocField", - "fieldname": "sales_invoice", - "fieldtype": "Link", - "label": "Sales Invoice", - "options": "Sales Invoice", - "permlevel": 0, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break_16", - "fieldtype": "Column Break", - "permlevel": 0, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "amended_from", - "fieldtype": "Link", - "ignore_restrictions": 1, - "label": "Amended From", - "no_copy": 1, - "options": "Time Log", - "permlevel": 1, - "print_hide": 1, - "read_only": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "restricted": 1, - "role": "Projects User" - }, - { - "doctype": "DocPerm", - "role": "Projects Manager" - } -] \ No newline at end of file +{ + "allow_attach": 1, + "allow_import": 1, + "autoname": "naming_series:", + "creation": "2013-04-03 16:38:41", + "description": "Log of Activities performed by users against Tasks that can be used for tracking time, billing.", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "naming_series", + "fieldtype": "Select", + "label": "Series", + "options": "TL-", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "from_time", + "fieldtype": "Datetime", + "in_list_view": 1, + "label": "From Time", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "to_time", + "fieldtype": "Datetime", + "in_list_view": 0, + "label": "To Time", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "hours", + "fieldtype": "Float", + "label": "Hours", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "column_break_3", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "status", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Status", + "options": "Draft\nSubmitted\nBatched for Billing\nBilled\nCancelled", + "permlevel": 0, + "read_only": 1, + "reqd": 0 + }, + { + "fieldname": "activity_type", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Activity Type", + "options": "Activity Type", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "task", + "fieldtype": "Link", + "label": "Task", + "options": "Task", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "billable", + "fieldtype": "Check", + "in_list_view": 1, + "label": "Billable", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "section_break_7", + "fieldtype": "Section Break", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "note", + "fieldtype": "Text Editor", + "label": "Note", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "section_break_9", + "fieldtype": "Section Break", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "project", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Project", + "options": "Project", + "permlevel": 0, + "read_only": 0 + }, + { + "description": "Will be updated when batched.", + "fieldname": "time_log_batch", + "fieldtype": "Link", + "label": "Time Log Batch", + "options": "Time Log Batch", + "permlevel": 0, + "read_only": 1 + }, + { + "description": "Will be updated when billed.", + "fieldname": "sales_invoice", + "fieldtype": "Link", + "label": "Sales Invoice", + "options": "Sales Invoice", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "column_break_16", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "amended_from", + "fieldtype": "Link", + "ignore_restrictions": 1, + "label": "Amended From", + "no_copy": 1, + "options": "Time Log", + "permlevel": 1, + "print_hide": 1, + "read_only": 0 + } + ], + "icon": "icon-time", + "idx": 1, + "is_submittable": 1, + "modified": "2014-01-22 16:05:35", + "modified_by": "Administrator", + "module": "Projects", + "name": "Time Log", + "owner": "Administrator", + "permissions": [ + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "restricted": 1, + "role": "Projects User", + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "cancel": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Projects Manager", + "submit": 1, + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/projects/doctype/time_log_batch/time_log_batch.txt b/erpnext/projects/doctype/time_log_batch/time_log_batch.txt index bc803ea2b6..36761175dd 100644 --- a/erpnext/projects/doctype/time_log_batch/time_log_batch.txt +++ b/erpnext/projects/doctype/time_log_batch/time_log_batch.txt @@ -1,126 +1,107 @@ -[ - { - "creation": "2013-02-28 17:57:33", - "docstatus": 0, - "modified": "2014-01-20 17:49:34", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "naming_series:", - "description": "Batch Time Logs for Billing.", - "doctype": "DocType", - "document_type": "Transaction", - "icon": "icon-time", - "is_submittable": 1, - "module": "Projects", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Time Log Batch", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Time Log Batch", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Projects User", - "submit": 1, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Time Log Batch" - }, - { - "doctype": "DocField", - "fieldname": "naming_series", - "fieldtype": "Select", - "label": "Series", - "options": "TLB-", - "reqd": 1 - }, - { - "description": "For Sales Invoice", - "doctype": "DocField", - "fieldname": "rate", - "fieldtype": "Currency", - "label": "Rate" - }, - { - "doctype": "DocField", - "fieldname": "column_break_3", - "fieldtype": "Column Break" - }, - { - "default": "Draft", - "doctype": "DocField", - "fieldname": "status", - "fieldtype": "Select", - "in_list_view": 1, - "label": "Status", - "options": "Draft\nSubmitted\nBilled\nCancelled", - "read_only": 1 - }, - { - "description": "Will be updated after Sales Invoice is Submitted.", - "doctype": "DocField", - "fieldname": "sales_invoice", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Sales Invoice", - "options": "Sales Invoice", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "section_break_5", - "fieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "time_log_batch_details", - "fieldtype": "Table", - "label": "Time Log Batch Details", - "options": "Time Log Batch Detail", - "reqd": 1 - }, - { - "description": "In Hours", - "doctype": "DocField", - "fieldname": "total_hours", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Total Hours", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "amended_from", - "fieldtype": "Link", - "ignore_restrictions": 1, - "label": "Amended From", - "no_copy": 1, - "options": "Time Log Batch", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "autoname": "naming_series:", + "creation": "2013-02-28 17:57:33", + "description": "Batch Time Logs for Billing.", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Transaction", + "fields": [ + { + "fieldname": "naming_series", + "fieldtype": "Select", + "label": "Series", + "options": "TLB-", + "permlevel": 0, + "reqd": 1 + }, + { + "description": "For Sales Invoice", + "fieldname": "rate", + "fieldtype": "Currency", + "label": "Rate", + "permlevel": 0 + }, + { + "fieldname": "column_break_3", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "default": "Draft", + "fieldname": "status", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Status", + "options": "Draft\nSubmitted\nBilled\nCancelled", + "permlevel": 0, + "read_only": 1 + }, + { + "description": "Will be updated after Sales Invoice is Submitted.", + "fieldname": "sales_invoice", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Sales Invoice", + "options": "Sales Invoice", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "section_break_5", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "time_log_batch_details", + "fieldtype": "Table", + "label": "Time Log Batch Details", + "options": "Time Log Batch Detail", + "permlevel": 0, + "reqd": 1 + }, + { + "description": "In Hours", + "fieldname": "total_hours", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Total Hours", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "amended_from", + "fieldtype": "Link", + "ignore_restrictions": 1, + "label": "Amended From", + "no_copy": 1, + "options": "Time Log Batch", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + } + ], + "icon": "icon-time", + "idx": 1, + "is_submittable": 1, + "modified": "2014-01-20 17:49:34", + "modified_by": "Administrator", + "module": "Projects", + "name": "Time Log Batch", + "owner": "Administrator", + "permissions": [ + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Projects User", + "submit": 1, + "write": 1 + } + ] +} \ 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 3531a877df..565402a560 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 @@ -1,59 +1,49 @@ -[ - { - "creation": "2013-03-05 09:11:06", - "docstatus": 0, - "modified": "2013-12-20 19:21:54", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "istable": 1, - "module": "Projects", - "name": "__common__" - }, - { - "doctype": "DocField", - "in_list_view": 1, - "name": "__common__", - "parent": "Time Log Batch Detail", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Time Log Batch Detail" - }, - { - "doctype": "DocField", - "fieldname": "time_log", - "fieldtype": "Link", - "label": "Time Log", - "options": "Time Log", - "print_width": "200px", - "reqd": 1, - "width": "200px" - }, - { - "doctype": "DocField", - "fieldname": "created_by", - "fieldtype": "Link", - "label": "Created By", - "options": "User", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "activity_type", - "fieldtype": "Data", - "label": "Activity Type", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "hours", - "fieldtype": "Float", - "label": "Hours" - } -] \ No newline at end of file +{ + "creation": "2013-03-05 09:11:06", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "time_log", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Time Log", + "options": "Time Log", + "permlevel": 0, + "print_width": "200px", + "reqd": 1, + "width": "200px" + }, + { + "fieldname": "created_by", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Created By", + "options": "User", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "activity_type", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Activity Type", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "hours", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Hours", + "permlevel": 0 + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:21:54", + "modified_by": "Administrator", + "module": "Projects", + "name": "Time Log Batch Detail", + "owner": "Administrator" +} \ No newline at end of file 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 fe8feb0a5b..3422010c96 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 @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-04-03 11:27:52", - "docstatus": 0, - "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", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Daily Time Log Summary" - } -] \ No newline at end of file +{ + "creation": "2013-04-03 11:27:52", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Projects", + "name": "Daily Time Log Summary", + "owner": "Administrator", + "ref_doctype": "Time Log", + "report_name": "Daily Time Log Summary", + "report_type": "Script Report" +} \ No newline at end of file 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 4a8953696d..5296920f62 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 @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-06-03 17:37:41", - "docstatus": 0, - "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 ", - "report_type": "Report Builder" - }, - { - "doctype": "Report", - "name": "Project wise Stock Tracking" - } -] \ No newline at end of file +{ + "creation": "2013-06-03 17:37:41", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Projects", + "name": "Project wise Stock Tracking", + "owner": "Administrator", + "ref_doctype": "Project", + "report_name": "Project wise Stock Tracking ", + "report_type": "Report Builder" +} \ No newline at end of file diff --git a/erpnext/selling/Print Format/Quotation Classic/Quotation Classic.txt b/erpnext/selling/Print Format/Quotation Classic/Quotation Classic.txt index c858c26cd7..220f1ead77 100644 --- a/erpnext/selling/Print Format/Quotation Classic/Quotation Classic.txt +++ b/erpnext/selling/Print Format/Quotation Classic/Quotation Classic.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-04-19 13:30:51", - "docstatus": 0, - "modified": "2014-02-11 17:45:37", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doc_type": "Quotation", - "doctype": "Print Format", - "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", - "module": "Selling", - "name": "__common__", - "print_format_type": "Client", - "standard": "Yes" - }, - { - "doctype": "Print Format", - "name": "Quotation Classic" - } -] \ No newline at end of file +{ + "creation": "2013-04-19 13:30:51", + "doc_type": "Quotation", + "docstatus": 0, + "doctype": "Print Format", + "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", + "idx": 1, + "modified": "2014-02-11 17:45:37", + "modified_by": "Administrator", + "module": "Selling", + "name": "Quotation Classic", + "owner": "Administrator", + "print_format_type": "Client", + "standard": "Yes" +} \ No newline at end of file diff --git a/erpnext/selling/Print Format/Quotation Modern/Quotation Modern.txt b/erpnext/selling/Print Format/Quotation Modern/Quotation Modern.txt index b7c3830808..2073a9ea52 100644 --- a/erpnext/selling/Print Format/Quotation Modern/Quotation Modern.txt +++ b/erpnext/selling/Print Format/Quotation Modern/Quotation Modern.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-04-19 13:30:51", - "docstatus": 0, - "modified": "2014-02-11 17:45:15", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doc_type": "Quotation", - "doctype": "Print Format", - "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", - "module": "Selling", - "name": "__common__", - "print_format_type": "Client", - "standard": "Yes" - }, - { - "doctype": "Print Format", - "name": "Quotation Modern" - } -] \ No newline at end of file +{ + "creation": "2013-04-19 13:30:51", + "doc_type": "Quotation", + "docstatus": 0, + "doctype": "Print Format", + "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", + "idx": 1, + "modified": "2014-02-11 17:45:15", + "modified_by": "Administrator", + "module": "Selling", + "name": "Quotation Modern", + "owner": "Administrator", + "print_format_type": "Client", + "standard": "Yes" +} \ No newline at end of file diff --git a/erpnext/selling/Print Format/Quotation Spartan/Quotation Spartan.txt b/erpnext/selling/Print Format/Quotation Spartan/Quotation Spartan.txt index f4be36e561..1ace24649e 100644 --- a/erpnext/selling/Print Format/Quotation Spartan/Quotation Spartan.txt +++ b/erpnext/selling/Print Format/Quotation Spartan/Quotation Spartan.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-04-19 13:30:51", - "docstatus": 0, - "modified": "2014-02-11 17:45:50", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doc_type": "Quotation", - "doctype": "Print Format", - "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", - "module": "Selling", - "name": "__common__", - "print_format_type": "Client", - "standard": "Yes" - }, - { - "doctype": "Print Format", - "name": "Quotation Spartan" - } -] \ No newline at end of file +{ + "creation": "2013-04-19 13:30:51", + "doc_type": "Quotation", + "docstatus": 0, + "doctype": "Print Format", + "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", + "idx": 1, + "modified": "2014-02-11 17:45:50", + "modified_by": "Administrator", + "module": "Selling", + "name": "Quotation Spartan", + "owner": "Administrator", + "print_format_type": "Client", + "standard": "Yes" +} \ No newline at end of file diff --git a/erpnext/selling/Print Format/Sales Order Classic/Sales Order Classic.txt b/erpnext/selling/Print Format/Sales Order Classic/Sales Order Classic.txt index 8c0b807036..2e9abb3c21 100644 --- a/erpnext/selling/Print Format/Sales Order Classic/Sales Order Classic.txt +++ b/erpnext/selling/Print Format/Sales Order Classic/Sales Order Classic.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-04-19 13:30:51", - "docstatus": 0, - "modified": "2014-02-11 17:35:51", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doc_type": "Sales Order", - "doctype": "Print Format", - "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", - "module": "Selling", - "name": "__common__", - "print_format_type": "Client", - "standard": "Yes" - }, - { - "doctype": "Print Format", - "name": "Sales Order Classic" - } -] \ No newline at end of file +{ + "creation": "2013-04-19 13:30:51", + "doc_type": "Sales Order", + "docstatus": 0, + "doctype": "Print Format", + "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", + "idx": 1, + "modified": "2014-02-11 17:35:51", + "modified_by": "Administrator", + "module": "Selling", + "name": "Sales Order Classic", + "owner": "Administrator", + "print_format_type": "Client", + "standard": "Yes" +} \ No newline at end of file diff --git a/erpnext/selling/Print Format/Sales Order Modern/Sales Order Modern.txt b/erpnext/selling/Print Format/Sales Order Modern/Sales Order Modern.txt index a901ae25cd..1a7432c397 100644 --- a/erpnext/selling/Print Format/Sales Order Modern/Sales Order Modern.txt +++ b/erpnext/selling/Print Format/Sales Order Modern/Sales Order Modern.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-04-19 13:30:51", - "docstatus": 0, - "modified": "2014-02-11 17:34:24", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doc_type": "Sales Order", - "doctype": "Print Format", - "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", - "module": "Selling", - "name": "__common__", - "print_format_type": "Client", - "standard": "Yes" - }, - { - "doctype": "Print Format", - "name": "Sales Order Modern" - } -] \ No newline at end of file +{ + "creation": "2013-04-19 13:30:51", + "doc_type": "Sales Order", + "docstatus": 0, + "doctype": "Print Format", + "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", + "idx": 1, + "modified": "2014-02-11 17:34:24", + "modified_by": "Administrator", + "module": "Selling", + "name": "Sales Order Modern", + "owner": "Administrator", + "print_format_type": "Client", + "standard": "Yes" +} \ No newline at end of file diff --git a/erpnext/selling/Print Format/Sales Order Spartan/Sales Order Spartan.txt b/erpnext/selling/Print Format/Sales Order Spartan/Sales Order Spartan.txt index 481da0d5e5..1e51dd3997 100644 --- a/erpnext/selling/Print Format/Sales Order Spartan/Sales Order Spartan.txt +++ b/erpnext/selling/Print Format/Sales Order Spartan/Sales Order Spartan.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-04-19 13:30:51", - "docstatus": 0, - "modified": "2014-02-11 17:35:29", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doc_type": "Sales Order", - "doctype": "Print Format", - "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", - "module": "Selling", - "name": "__common__", - "print_format_type": "Client", - "standard": "Yes" - }, - { - "doctype": "Print Format", - "name": "Sales Order Spartan" - } -] \ No newline at end of file +{ + "creation": "2013-04-19 13:30:51", + "doc_type": "Sales Order", + "docstatus": 0, + "doctype": "Print Format", + "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", + "idx": 1, + "modified": "2014-02-11 17:35:29", + "modified_by": "Administrator", + "module": "Selling", + "name": "Sales Order Spartan", + "owner": "Administrator", + "print_format_type": "Client", + "standard": "Yes" +} \ No newline at end of file diff --git a/erpnext/selling/doctype/campaign/campaign.txt b/erpnext/selling/doctype/campaign/campaign.txt index 55c459cea3..f7895fc29d 100644 --- a/erpnext/selling/doctype/campaign/campaign.txt +++ b/erpnext/selling/doctype/campaign/campaign.txt @@ -1,105 +1,98 @@ -[ - { - "creation": "2013-01-10 16:34:18", - "docstatus": 0, - "modified": "2014-01-20 17:48:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "allow_rename": 1, - "autoname": "field:campaign_name", - "description": "Keep Track of Sales Campaigns. Keep track of Leads, Quotations, Sales Order etc from Campaigns to gauge Return on Investment. ", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-bullhorn", - "module": "Selling", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Campaign", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "amend": 0, - "cancel": 0, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Campaign", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "submit": 0 - }, - { - "doctype": "DocType", - "name": "Campaign" - }, - { - "doctype": "DocField", - "fieldname": "trash_reason", - "fieldtype": "Small Text", - "label": "Trash Reason", - "oldfieldname": "trash_reason", - "oldfieldtype": "Small Text", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "campaign", - "fieldtype": "Section Break", - "label": "Campaign", - "oldfieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "campaign_name", - "fieldtype": "Data", - "label": "Campaign Name", - "oldfieldname": "campaign_name", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Text", - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Text", - "width": "300px" - }, - { - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "import": 0, - "report": 0, - "role": "Sales Manager", - "write": 0 - }, - { - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "report": 1, - "role": "Sales User", - "write": 0 - }, - { - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "report": 1, - "role": "Sales Master Manager", - "write": 1 - } -] \ No newline at end of file +{ + "allow_import": 1, + "allow_rename": 1, + "autoname": "field:campaign_name", + "creation": "2013-01-10 16:34:18", + "description": "Keep Track of Sales Campaigns. Keep track of Leads, Quotations, Sales Order etc from Campaigns to gauge Return on Investment. ", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "trash_reason", + "fieldtype": "Small Text", + "label": "Trash Reason", + "oldfieldname": "trash_reason", + "oldfieldtype": "Small Text", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "campaign", + "fieldtype": "Section Break", + "label": "Campaign", + "oldfieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "campaign_name", + "fieldtype": "Data", + "label": "Campaign Name", + "oldfieldname": "campaign_name", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "description", + "fieldtype": "Text", + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Text", + "permlevel": 0, + "width": "300px" + } + ], + "icon": "icon-bullhorn", + "idx": 1, + "modified": "2014-01-20 17:48:27", + "modified_by": "Administrator", + "module": "Selling", + "name": "Campaign", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 0, + "role": "Sales Manager", + "submit": 0, + "write": 0 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales User", + "submit": 0, + "write": 0 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales Master Manager", + "submit": 0, + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/selling/doctype/customer/customer.txt b/erpnext/selling/doctype/customer/customer.txt index 56051d53c4..a2afe64e1d 100644 --- a/erpnext/selling/doctype/customer/customer.txt +++ b/erpnext/selling/doctype/customer/customer.txt @@ -1,378 +1,333 @@ -[ - { - "creation": "2013-06-11 14:26:44", - "docstatus": 0, - "modified": "2014-03-03 19:05:58", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "allow_rename": 1, - "autoname": "naming_series:", - "description": "Buyer of Goods and Services.", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-user", - "module": "Selling", - "name": "__common__", - "search_fields": "customer_name,customer_group,territory" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Customer", - "parentfield": "fields", - "parenttype": "DocType" - }, - { - "cancel": 0, - "doctype": "DocPerm", - "name": "__common__", - "parent": "Customer", - "parentfield": "permissions", - "parenttype": "DocType", - "read": 1 - }, - { - "doctype": "DocType", - "name": "Customer" - }, - { - "doctype": "DocField", - "fieldname": "basic_info", - "fieldtype": "Section Break", - "label": "Basic Info", - "oldfieldtype": "Section Break", - "options": "icon-user", - "permlevel": 0, - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "naming_series", - "fieldtype": "Select", - "label": "Series", - "no_copy": 1, - "options": "\nCUST\nCUSTMUM", - "permlevel": 0, - "print_hide": 0 - }, - { - "doctype": "DocField", - "fieldname": "customer_name", - "fieldtype": "Data", - "hidden": 0, - "in_filter": 1, - "in_list_view": 1, - "label": "Full Name", - "no_copy": 1, - "oldfieldname": "customer_name", - "oldfieldtype": "Data", - "permlevel": 0, - "print_hide": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "customer_type", - "fieldtype": "Select", - "label": "Type", - "oldfieldname": "customer_type", - "oldfieldtype": "Select", - "options": "\nCompany\nIndividual", - "permlevel": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "lead_name", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 1, - "label": "From Lead", - "no_copy": 1, - "oldfieldname": "lead_name", - "oldfieldtype": "Link", - "options": "Lead", - "permlevel": 0, - "print_hide": 1, - "report_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "permlevel": 0, - "width": "50%" - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "customer_group", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 1, - "label": "Group", - "oldfieldname": "customer_group", - "oldfieldtype": "Link", - "options": "Customer Group", - "permlevel": 0, - "print_hide": 0, - "reqd": 1, - "search_index": 1 - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "territory", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Territory", - "oldfieldname": "territory", - "oldfieldtype": "Link", - "options": "Territory", - "permlevel": 0, - "print_hide": 1, - "reqd": 1 - }, - { - "depends_on": "eval:!doc.__islocal", - "doctype": "DocField", - "fieldname": "address_contacts", - "fieldtype": "Section Break", - "label": "Address & Contacts", - "options": "icon-map-marker", - "permlevel": 0 - }, - { - "doctype": "DocField", - "fieldname": "address_html", - "fieldtype": "HTML", - "label": "Address HTML", - "permlevel": 0, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "permlevel": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "contact_html", - "fieldtype": "HTML", - "label": "Contact HTML", - "oldfieldtype": "HTML", - "permlevel": 0, - "read_only": 1 - }, - { - "depends_on": "eval:!doc.__islocal", - "doctype": "DocField", - "fieldname": "communication_history", - "fieldtype": "Section Break", - "label": "Communication History", - "options": "icon-comments", - "permlevel": 0, - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "communication_html", - "fieldtype": "HTML", - "label": "Communication HTML", - "permlevel": 0, - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "more_info", - "fieldtype": "Section Break", - "label": "More Info", - "oldfieldtype": "Section Break", - "options": "icon-file-text", - "permlevel": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break2", - "fieldtype": "Column Break", - "permlevel": 0, - "width": "50%" - }, - { - "description": "To create an Account Head under a different company, select the company and save customer.", - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "in_filter": 1, - "label": "Company", - "oldfieldname": "company", - "oldfieldtype": "Link", - "options": "Company", - "permlevel": 0, - "reqd": 1, - "search_index": 1 - }, - { - "description": "Your Customer's TAX registration numbers (if applicable) or any general information", - "doctype": "DocField", - "fieldname": "customer_details", - "fieldtype": "Text", - "label": "Customer Details", - "oldfieldname": "customer_details", - "oldfieldtype": "Code", - "permlevel": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break3", - "fieldtype": "Column Break", - "permlevel": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "default_currency", - "fieldtype": "Link", - "label": "Currency", - "no_copy": 1, - "options": "Currency", - "permlevel": 0 - }, - { - "doctype": "DocField", - "fieldname": "default_price_list", - "fieldtype": "Link", - "label": "Price List", - "options": "Price List", - "permlevel": 0 - }, - { - "doctype": "DocField", - "fieldname": "default_taxes_and_charges", - "fieldtype": "Link", - "label": "Taxes and Charges", - "options": "Sales Taxes and Charges Master", - "permlevel": 0 - }, - { - "doctype": "DocField", - "fieldname": "credit_days", - "fieldtype": "Int", - "label": "Credit Days", - "oldfieldname": "credit_days", - "oldfieldtype": "Int", - "permlevel": 1 - }, - { - "doctype": "DocField", - "fieldname": "credit_limit", - "fieldtype": "Currency", - "label": "Credit Limit", - "oldfieldname": "credit_limit", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "permlevel": 1 - }, - { - "doctype": "DocField", - "fieldname": "website", - "fieldtype": "Data", - "label": "Website", - "permlevel": 0 - }, - { - "doctype": "DocField", - "fieldname": "sales_team_section_break", - "fieldtype": "Section Break", - "label": "Sales Team", - "oldfieldtype": "Section Break", - "options": "icon-group", - "permlevel": 0 - }, - { - "doctype": "DocField", - "fieldname": "default_sales_partner", - "fieldtype": "Link", - "label": "Sales Partner", - "oldfieldname": "default_sales_partner", - "oldfieldtype": "Link", - "options": "Sales Partner", - "permlevel": 0 - }, - { - "doctype": "DocField", - "fieldname": "default_commission_rate", - "fieldtype": "Float", - "label": "Commission Rate", - "oldfieldname": "default_commission_rate", - "oldfieldtype": "Currency", - "permlevel": 0 - }, - { - "doctype": "DocField", - "fieldname": "sales_team", - "fieldtype": "Table", - "label": "Sales Team Details", - "oldfieldname": "sales_team", - "oldfieldtype": "Table", - "options": "Sales Team", - "permlevel": 0 - }, - { - "doctype": "DocField", - "fieldname": "communications", - "fieldtype": "Table", - "hidden": 1, - "label": "Communications", - "options": "Communication", - "permlevel": 0, - "print_hide": 1 - }, - { - "amend": 0, - "create": 1, - "delete": 0, - "doctype": "DocPerm", - "email": 1, - "permlevel": 0, - "print": 1, - "report": 1, - "role": "Sales User", - "submit": 0, - "write": 1 - }, - { - "delete": 0, - "doctype": "DocPerm", - "permlevel": 1, - "role": "Sales User" - }, - { - "amend": 0, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "permlevel": 0, - "print": 1, - "report": 1, - "restrict": 1, - "role": "Sales Master Manager", - "submit": 0, - "write": 1 - }, - { - "delete": 0, - "doctype": "DocPerm", - "permlevel": 1, - "role": "Sales Master Manager", - "write": 1 - } -] \ No newline at end of file +{ + "allow_import": 1, + "allow_rename": 1, + "autoname": "naming_series:", + "creation": "2013-06-11 14:26:44", + "description": "Buyer of Goods and Services.", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "basic_info", + "fieldtype": "Section Break", + "label": "Basic Info", + "oldfieldtype": "Section Break", + "options": "icon-user", + "permlevel": 0, + "reqd": 0 + }, + { + "fieldname": "naming_series", + "fieldtype": "Select", + "label": "Series", + "no_copy": 1, + "options": "\nCUST\nCUSTMUM", + "permlevel": 0, + "print_hide": 0 + }, + { + "fieldname": "customer_name", + "fieldtype": "Data", + "hidden": 0, + "in_filter": 1, + "in_list_view": 1, + "label": "Full Name", + "no_copy": 1, + "oldfieldname": "customer_name", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "customer_type", + "fieldtype": "Select", + "label": "Type", + "oldfieldname": "customer_type", + "oldfieldtype": "Select", + "options": "\nCompany\nIndividual", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "lead_name", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 1, + "label": "From Lead", + "no_copy": 1, + "oldfieldname": "lead_name", + "oldfieldtype": "Link", + "options": "Lead", + "permlevel": 0, + "print_hide": 1, + "report_hide": 1 + }, + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "description": "Add / Edit", + "fieldname": "customer_group", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 1, + "label": "Group", + "oldfieldname": "customer_group", + "oldfieldtype": "Link", + "options": "Customer Group", + "permlevel": 0, + "print_hide": 0, + "reqd": 1, + "search_index": 1 + }, + { + "description": "Add / Edit", + "fieldname": "territory", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Territory", + "oldfieldname": "territory", + "oldfieldtype": "Link", + "options": "Territory", + "permlevel": 0, + "print_hide": 1, + "reqd": 1 + }, + { + "depends_on": "eval:!doc.__islocal", + "fieldname": "address_contacts", + "fieldtype": "Section Break", + "label": "Address & Contacts", + "options": "icon-map-marker", + "permlevel": 0 + }, + { + "fieldname": "address_html", + "fieldtype": "HTML", + "label": "Address HTML", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "contact_html", + "fieldtype": "HTML", + "label": "Contact HTML", + "oldfieldtype": "HTML", + "permlevel": 0, + "read_only": 1 + }, + { + "depends_on": "eval:!doc.__islocal", + "fieldname": "communication_history", + "fieldtype": "Section Break", + "label": "Communication History", + "options": "icon-comments", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "communication_html", + "fieldtype": "HTML", + "label": "Communication HTML", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "more_info", + "fieldtype": "Section Break", + "label": "More Info", + "oldfieldtype": "Section Break", + "options": "icon-file-text", + "permlevel": 0 + }, + { + "fieldname": "column_break2", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "description": "To create an Account Head under a different company, select the company and save customer.", + "fieldname": "company", + "fieldtype": "Link", + "in_filter": 1, + "label": "Company", + "oldfieldname": "company", + "oldfieldtype": "Link", + "options": "Company", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "description": "Your Customer's TAX registration numbers (if applicable) or any general information", + "fieldname": "customer_details", + "fieldtype": "Text", + "label": "Customer Details", + "oldfieldname": "customer_details", + "oldfieldtype": "Code", + "permlevel": 0 + }, + { + "fieldname": "column_break3", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "default_currency", + "fieldtype": "Link", + "label": "Currency", + "no_copy": 1, + "options": "Currency", + "permlevel": 0 + }, + { + "fieldname": "default_price_list", + "fieldtype": "Link", + "label": "Price List", + "options": "Price List", + "permlevel": 0 + }, + { + "fieldname": "default_taxes_and_charges", + "fieldtype": "Link", + "label": "Taxes and Charges", + "options": "Sales Taxes and Charges Master", + "permlevel": 0 + }, + { + "fieldname": "credit_days", + "fieldtype": "Int", + "label": "Credit Days", + "oldfieldname": "credit_days", + "oldfieldtype": "Int", + "permlevel": 1 + }, + { + "fieldname": "credit_limit", + "fieldtype": "Currency", + "label": "Credit Limit", + "oldfieldname": "credit_limit", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 1 + }, + { + "fieldname": "website", + "fieldtype": "Data", + "label": "Website", + "permlevel": 0 + }, + { + "fieldname": "sales_team_section_break", + "fieldtype": "Section Break", + "label": "Sales Team", + "oldfieldtype": "Section Break", + "options": "icon-group", + "permlevel": 0 + }, + { + "fieldname": "default_sales_partner", + "fieldtype": "Link", + "label": "Sales Partner", + "oldfieldname": "default_sales_partner", + "oldfieldtype": "Link", + "options": "Sales Partner", + "permlevel": 0 + }, + { + "fieldname": "default_commission_rate", + "fieldtype": "Float", + "label": "Commission Rate", + "oldfieldname": "default_commission_rate", + "oldfieldtype": "Currency", + "permlevel": 0 + }, + { + "fieldname": "sales_team", + "fieldtype": "Table", + "label": "Sales Team Details", + "oldfieldname": "sales_team", + "oldfieldtype": "Table", + "options": "Sales Team", + "permlevel": 0 + }, + { + "fieldname": "communications", + "fieldtype": "Table", + "hidden": 1, + "label": "Communications", + "options": "Communication", + "permlevel": 0, + "print_hide": 1 + } + ], + "icon": "icon-user", + "idx": 1, + "modified": "2014-03-03 19:05:58", + "modified_by": "Administrator", + "module": "Selling", + "name": "Customer", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales User", + "submit": 0, + "write": 1 + }, + { + "cancel": 0, + "delete": 0, + "permlevel": 1, + "read": 1, + "role": "Sales User" + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "restrict": 1, + "role": "Sales Master Manager", + "submit": 0, + "write": 1 + }, + { + "cancel": 0, + "delete": 0, + "permlevel": 1, + "read": 1, + "role": "Sales Master Manager", + "write": 1 + } + ], + "search_fields": "customer_name,customer_group,territory" +} \ No newline at end of file diff --git a/erpnext/selling/doctype/industry_type/industry_type.txt b/erpnext/selling/doctype/industry_type/industry_type.txt index e65fc3812a..f55a9410d6 100644 --- a/erpnext/selling/doctype/industry_type/industry_type.txt +++ b/erpnext/selling/doctype/industry_type/industry_type.txt @@ -1,67 +1,56 @@ -[ - { - "creation": "2012-03-27 14:36:09", - "docstatus": 0, - "modified": "2013-12-20 19:24:08", - "modified_by": "Administrator", - "owner": "harshada@webnotestech.com" - }, - { - "allow_import": 1, - "autoname": "field:industry", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-flag", - "module": "Selling", - "name": "__common__" - }, - { - "doctype": "DocField", - "fieldname": "industry", - "fieldtype": "Data", - "label": "Industry", - "name": "__common__", - "oldfieldname": "industry", - "oldfieldtype": "Data", - "parent": "Industry Type", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0, - "reqd": 1 - }, - { - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Industry Type", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1 - }, - { - "doctype": "DocType", - "name": "Industry Type" - }, - { - "doctype": "DocField" - }, - { - "create": 1, - "doctype": "DocPerm", - "role": "Sales Manager", - "write": 1 - }, - { - "doctype": "DocPerm", - "role": "Sales User" - }, - { - "create": 1, - "doctype": "DocPerm", - "role": "Sales Master Manager", - "write": 1 - } -] \ No newline at end of file +{ + "allow_import": 1, + "autoname": "field:industry", + "creation": "2012-03-27 14:36:09", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "industry", + "fieldtype": "Data", + "label": "Industry", + "oldfieldname": "industry", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + } + ], + "icon": "icon-flag", + "idx": 1, + "modified": "2013-12-20 19:24:08", + "modified_by": "Administrator", + "module": "Selling", + "name": "Industry Type", + "owner": "harshada@webnotestech.com", + "permissions": [ + { + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales Manager", + "write": 1 + }, + { + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales User" + }, + { + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales Master Manager", + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/selling/doctype/installation_note/installation_note.txt b/erpnext/selling/doctype/installation_note/installation_note.txt index 5e519829df..c3e34108a6 100644 --- a/erpnext/selling/doctype/installation_note/installation_note.txt +++ b/erpnext/selling/doctype/installation_note/installation_note.txt @@ -1,285 +1,268 @@ -[ - { - "creation": "2013-04-30 13:13:06", - "docstatus": 0, - "modified": "2014-01-20 17:48:47", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "naming_series:", - "doctype": "DocType", - "icon": "icon-wrench", - "is_submittable": 1, - "module": "Selling", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Installation Note", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocPerm", - "name": "__common__", - "parent": "Installation Note", - "parentfield": "permissions", - "parenttype": "DocType", - "read": 1, - "report": 1, - "role": "Sales User" - }, - { - "doctype": "DocType", - "name": "Installation Note" - }, - { - "doctype": "DocField", - "fieldname": "installation_note", - "fieldtype": "Section Break", - "label": "Installation Note", - "oldfieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "naming_series", - "fieldtype": "Select", - "label": "Series", - "no_copy": 1, - "oldfieldname": "naming_series", - "oldfieldtype": "Select", - "options": "\nIN", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "customer", - "fieldtype": "Link", - "label": "Customer", - "oldfieldname": "customer", - "oldfieldtype": "Link", - "options": "Customer", - "print_hide": 1, - "reqd": 1, - "search_index": 1 - }, - { - "depends_on": "customer", - "doctype": "DocField", - "fieldname": "customer_address", - "fieldtype": "Link", - "label": "Customer Address", - "options": "Address", - "print_hide": 1 - }, - { - "depends_on": "customer", - "doctype": "DocField", - "fieldname": "contact_person", - "fieldtype": "Link", - "label": "Contact Person", - "options": "Contact", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "customer_name", - "fieldtype": "Data", - "label": "Name", - "oldfieldname": "customer_name", - "oldfieldtype": "Data", - "read_only": 1, - "reqd": 0, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "address_display", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Address", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "contact_display", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Contact", - "read_only": 1 - }, - { - "depends_on": "customer", - "doctype": "DocField", - "fieldname": "contact_mobile", - "fieldtype": "Text", - "label": "Mobile No", - "read_only": 1 - }, - { - "depends_on": "customer", - "doctype": "DocField", - "fieldname": "contact_email", - "fieldtype": "Text", - "label": "Contact Email", - "print_hide": 1, - "read_only": 1 - }, - { - "depends_on": "customer", - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "territory", - "fieldtype": "Link", - "in_filter": 1, - "label": "Territory", - "options": "Territory", - "print_hide": 1, - "reqd": 1, - "search_index": 1 - }, - { - "depends_on": "customer", - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "customer_group", - "fieldtype": "Link", - "label": "Customer Group", - "options": "Customer Group", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "inst_date", - "fieldtype": "Date", - "label": "Installation Date", - "oldfieldname": "inst_date", - "oldfieldtype": "Date", - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "inst_time", - "fieldtype": "Time", - "label": "Installation Time", - "oldfieldname": "inst_time", - "oldfieldtype": "Time" - }, - { - "default": "Draft", - "doctype": "DocField", - "fieldname": "status", - "fieldtype": "Select", - "label": "Status", - "no_copy": 1, - "oldfieldname": "status", - "oldfieldtype": "Select", - "options": "Draft\nSubmitted\nCancelled", - "print_hide": 1, - "read_only": 1, - "reqd": 1 - }, - { - "description": "Select the relevant company name if you have multiple companies.", - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Select", - "in_filter": 1, - "label": "Company", - "oldfieldname": "company", - "oldfieldtype": "Select", - "options": "link:Company", - "print_hide": 1, - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "fiscal_year", - "fieldtype": "Select", - "in_filter": 1, - "label": "Fiscal Year", - "oldfieldname": "fiscal_year", - "oldfieldtype": "Select", - "options": "link:Fiscal Year", - "print_hide": 1, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "amended_from", - "fieldtype": "Data", - "ignore_restrictions": 1, - "label": "Amended From", - "no_copy": 1, - "oldfieldname": "amended_from", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "remarks", - "fieldtype": "Small Text", - "label": "Remarks", - "oldfieldname": "remarks", - "oldfieldtype": "Small Text", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "item_details", - "fieldtype": "Section Break", - "label": "Item Details", - "oldfieldtype": "Section Break", - "options": "Simple" - }, - { - "doctype": "DocField", - "fieldname": "installed_item_details", - "fieldtype": "Table", - "label": "Installation Note Item", - "oldfieldname": "installed_item_details", - "oldfieldtype": "Table", - "options": "Installation Note Item" - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "permlevel": 0, - "print": 1, - "submit": 1, - "write": 1 - }, - { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "permlevel": 1, - "submit": 0 - } -] \ No newline at end of file +{ + "autoname": "naming_series:", + "creation": "2013-04-30 13:13:06", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "installation_note", + "fieldtype": "Section Break", + "label": "Installation Note", + "oldfieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "naming_series", + "fieldtype": "Select", + "label": "Series", + "no_copy": 1, + "oldfieldname": "naming_series", + "oldfieldtype": "Select", + "options": "\nIN", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "customer", + "fieldtype": "Link", + "label": "Customer", + "oldfieldname": "customer", + "oldfieldtype": "Link", + "options": "Customer", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, + "search_index": 1 + }, + { + "depends_on": "customer", + "fieldname": "customer_address", + "fieldtype": "Link", + "label": "Customer Address", + "options": "Address", + "permlevel": 0, + "print_hide": 1 + }, + { + "depends_on": "customer", + "fieldname": "contact_person", + "fieldtype": "Link", + "label": "Contact Person", + "options": "Contact", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "customer_name", + "fieldtype": "Data", + "label": "Name", + "oldfieldname": "customer_name", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1, + "reqd": 0, + "search_index": 0 + }, + { + "fieldname": "address_display", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Address", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "contact_display", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Contact", + "permlevel": 0, + "read_only": 1 + }, + { + "depends_on": "customer", + "fieldname": "contact_mobile", + "fieldtype": "Text", + "label": "Mobile No", + "permlevel": 0, + "read_only": 1 + }, + { + "depends_on": "customer", + "fieldname": "contact_email", + "fieldtype": "Text", + "label": "Contact Email", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "depends_on": "customer", + "description": "Add / Edit", + "fieldname": "territory", + "fieldtype": "Link", + "in_filter": 1, + "label": "Territory", + "options": "Territory", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, + "search_index": 1 + }, + { + "depends_on": "customer", + "description": "Add / Edit", + "fieldname": "customer_group", + "fieldtype": "Link", + "label": "Customer Group", + "options": "Customer Group", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "inst_date", + "fieldtype": "Date", + "label": "Installation Date", + "oldfieldname": "inst_date", + "oldfieldtype": "Date", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "inst_time", + "fieldtype": "Time", + "label": "Installation Time", + "oldfieldname": "inst_time", + "oldfieldtype": "Time", + "permlevel": 0 + }, + { + "default": "Draft", + "fieldname": "status", + "fieldtype": "Select", + "label": "Status", + "no_copy": 1, + "oldfieldname": "status", + "oldfieldtype": "Select", + "options": "Draft\nSubmitted\nCancelled", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 1 + }, + { + "description": "Select the relevant company name if you have multiple companies.", + "fieldname": "company", + "fieldtype": "Select", + "in_filter": 1, + "label": "Company", + "oldfieldname": "company", + "oldfieldtype": "Select", + "options": "link:Company", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Select", + "in_filter": 1, + "label": "Fiscal Year", + "oldfieldname": "fiscal_year", + "oldfieldtype": "Select", + "options": "link:Fiscal Year", + "permlevel": 0, + "print_hide": 1, + "reqd": 1 + }, + { + "fieldname": "amended_from", + "fieldtype": "Data", + "ignore_restrictions": 1, + "label": "Amended From", + "no_copy": 1, + "oldfieldname": "amended_from", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "remarks", + "fieldtype": "Small Text", + "label": "Remarks", + "oldfieldname": "remarks", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "item_details", + "fieldtype": "Section Break", + "label": "Item Details", + "oldfieldtype": "Section Break", + "options": "Simple", + "permlevel": 0 + }, + { + "fieldname": "installed_item_details", + "fieldtype": "Table", + "label": "Installation Note Item", + "oldfieldname": "installed_item_details", + "oldfieldtype": "Table", + "options": "Installation Note Item", + "permlevel": 0 + } + ], + "icon": "icon-wrench", + "idx": 1, + "is_submittable": 1, + "modified": "2014-01-20 17:48:47", + "modified_by": "Administrator", + "module": "Selling", + "name": "Installation Note", + "owner": "Administrator", + "permissions": [ + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales User", + "submit": 1, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "permlevel": 1, + "read": 1, + "report": 1, + "role": "Sales User", + "submit": 0 + } + ] +} \ No newline at end of file diff --git a/erpnext/selling/doctype/installation_note_item/installation_note_item.txt b/erpnext/selling/doctype/installation_note_item/installation_note_item.txt index 94f648e3a6..79b0980452 100644 --- a/erpnext/selling/doctype/installation_note_item/installation_note_item.txt +++ b/erpnext/selling/doctype/installation_note_item/installation_note_item.txt @@ -1,121 +1,108 @@ -[ - { - "creation": "2013-02-22 01:27:51", - "docstatus": 0, - "modified": "2013-12-20 19:23:14", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "IID/.#####", - "doctype": "DocType", - "istable": 1, - "module": "Selling", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Installation Note Item", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Installation Note Item" - }, - { - "doctype": "DocField", - "fieldname": "item_code", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Item Code", - "oldfieldname": "item_code", - "oldfieldtype": "Link", - "options": "Item", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Data", - "print_width": "300px", - "read_only": 1, - "width": "300px" - }, - { - "doctype": "DocField", - "fieldname": "serial_no", - "fieldtype": "Small Text", - "in_list_view": 1, - "label": "Serial No", - "oldfieldname": "serial_no", - "oldfieldtype": "Small Text", - "print_width": "180px", - "width": "180px" - }, - { - "doctype": "DocField", - "fieldname": "prevdoc_detail_docname", - "fieldtype": "Data", - "hidden": 1, - "in_list_view": 0, - "label": "Against Document Detail No", - "no_copy": 1, - "oldfieldname": "prevdoc_detail_docname", - "oldfieldtype": "Data", - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "prevdoc_docname", - "fieldtype": "Data", - "hidden": 1, - "in_filter": 1, - "in_list_view": 0, - "label": "Against Document No", - "no_copy": 1, - "oldfieldname": "prevdoc_docname", - "oldfieldtype": "Data", - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "search_index": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "prevdoc_doctype", - "fieldtype": "Data", - "hidden": 1, - "in_filter": 1, - "in_list_view": 0, - "label": "Document Type", - "no_copy": 1, - "oldfieldname": "prevdoc_doctype", - "oldfieldtype": "Data", - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "search_index": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "qty", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Installed Qty", - "oldfieldname": "qty", - "oldfieldtype": "Currency", - "reqd": 1 - } -] \ No newline at end of file +{ + "autoname": "IID/.#####", + "creation": "2013-02-22 01:27:51", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "item_code", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Item Code", + "oldfieldname": "item_code", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "description", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Data", + "permlevel": 0, + "print_width": "300px", + "read_only": 1, + "width": "300px" + }, + { + "fieldname": "serial_no", + "fieldtype": "Small Text", + "in_list_view": 1, + "label": "Serial No", + "oldfieldname": "serial_no", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_width": "180px", + "width": "180px" + }, + { + "fieldname": "prevdoc_detail_docname", + "fieldtype": "Data", + "hidden": 1, + "in_list_view": 0, + "label": "Against Document Detail No", + "no_copy": 1, + "oldfieldname": "prevdoc_detail_docname", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 1, + "width": "150px" + }, + { + "fieldname": "prevdoc_docname", + "fieldtype": "Data", + "hidden": 1, + "in_filter": 1, + "in_list_view": 0, + "label": "Against Document No", + "no_copy": 1, + "oldfieldname": "prevdoc_docname", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 1, + "search_index": 1, + "width": "150px" + }, + { + "fieldname": "prevdoc_doctype", + "fieldtype": "Data", + "hidden": 1, + "in_filter": 1, + "in_list_view": 0, + "label": "Document Type", + "no_copy": 1, + "oldfieldname": "prevdoc_doctype", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 1, + "search_index": 1, + "width": "150px" + }, + { + "fieldname": "qty", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Installed Qty", + "oldfieldname": "qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "reqd": 1 + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:23:14", + "modified_by": "Administrator", + "module": "Selling", + "name": "Installation Note Item", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/selling/doctype/lead/lead.txt b/erpnext/selling/doctype/lead/lead.txt index ba04cb97fd..01845e8a58 100644 --- a/erpnext/selling/doctype/lead/lead.txt +++ b/erpnext/selling/doctype/lead/lead.txt @@ -1,411 +1,401 @@ -[ - { - "creation": "2013-04-10 11:45:37", - "docstatus": 0, - "modified": "2014-01-20 17:48:54", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "autoname": "naming_series:", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-user", - "module": "Selling", - "name": "__common__", - "search_fields": "lead_name,lead_owner,status" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Lead", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "amend": 0, - "cancel": 0, - "create": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Lead", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Lead" - }, - { - "doctype": "DocField", - "fieldname": "lead_details", - "fieldtype": "Section Break", - "label": "Lead Details", - "options": "icon-user" - }, - { - "doctype": "DocField", - "fieldname": "naming_series", - "fieldtype": "Select", - "label": "Series", - "no_copy": 1, - "oldfieldname": "naming_series", - "oldfieldtype": "Select", - "options": "LEAD\nLEAD/10-11/\nLEAD/MUMBAI/", - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "lead_name", - "fieldtype": "Data", - "in_filter": 1, - "in_list_view": 1, - "label": "Contact Name", - "oldfieldname": "lead_name", - "oldfieldtype": "Data", - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "company_name", - "fieldtype": "Data", - "in_filter": 1, - "in_list_view": 1, - "label": "Organization Name", - "oldfieldname": "company_name", - "oldfieldtype": "Data", - "reqd": 0, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "email_id", - "fieldtype": "Data", - "label": "Email Id", - "oldfieldname": "email_id", - "oldfieldtype": "Data", - "reqd": 0, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "cb6", - "fieldtype": "Column Break" - }, - { - "default": "Lead", - "doctype": "DocField", - "fieldname": "status", - "fieldtype": "Select", - "in_filter": 1, - "in_list_view": 1, - "label": "Status", - "no_copy": 1, - "oldfieldname": "status", - "oldfieldtype": "Select", - "options": "Lead\nOpen\nReplied\nOpportunity\nInterested\nConverted\nDo Not Contact", - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "source", - "fieldtype": "Select", - "in_filter": 1, - "in_list_view": 1, - "label": "Source", - "no_copy": 1, - "oldfieldname": "source", - "oldfieldtype": "Select", - "options": "\nAdvertisement\nBlog Post\nCampaign\nCall\nCustomer\nExhibition\nSupplier\nWebsite\nEmail", - "reqd": 0, - "search_index": 0 - }, - { - "depends_on": "eval:doc.source == 'Customer'", - "doctype": "DocField", - "fieldname": "customer", - "fieldtype": "Link", - "hidden": 0, - "label": "From Customer", - "oldfieldname": "customer", - "oldfieldtype": "Link", - "options": "Customer" - }, - { - "depends_on": "eval:doc.source == 'Campaign'", - "description": "Enter campaign name if the source of lead is campaign.", - "doctype": "DocField", - "fieldname": "campaign_name", - "fieldtype": "Link", - "hidden": 0, - "label": "Campaign Name", - "oldfieldname": "campaign_name", - "oldfieldtype": "Link", - "options": "Campaign" - }, - { - "doctype": "DocField", - "fieldname": "communication_history", - "fieldtype": "Section Break", - "label": "Communication", - "options": "icon-comments", - "print_hide": 1 - }, - { - "default": "__user", - "doctype": "DocField", - "fieldname": "lead_owner", - "fieldtype": "Link", - "in_filter": 1, - "label": "Lead Owner", - "oldfieldname": "lead_owner", - "oldfieldtype": "Link", - "options": "User", - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "col_break123", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "allow_on_submit": 0, - "doctype": "DocField", - "fieldname": "contact_by", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 1, - "label": "Next Contact By", - "oldfieldname": "contact_by", - "oldfieldtype": "Link", - "options": "User", - "print_hide": 0, - "reqd": 0, - "width": "100px" - }, - { - "allow_on_submit": 0, - "description": "Add to calendar on this date", - "doctype": "DocField", - "fieldname": "contact_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Next Contact Date", - "no_copy": 1, - "oldfieldname": "contact_date", - "oldfieldtype": "Date", - "reqd": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "sec_break123", - "fieldtype": "Section Break", - "options": "Simple" - }, - { - "allow_on_submit": 0, - "doctype": "DocField", - "fieldname": "communication_html", - "fieldtype": "HTML", - "label": "Communication HTML", - "oldfieldname": "follow_up", - "oldfieldtype": "Table" - }, - { - "doctype": "DocField", - "fieldname": "contact_info", - "fieldtype": "Section Break", - "label": "Address & Contact", - "oldfieldtype": "Column Break", - "options": "icon-map-marker" - }, - { - "depends_on": "eval:doc.__islocal", - "doctype": "DocField", - "fieldname": "address_desc", - "fieldtype": "HTML", - "hidden": 0, - "label": "Address Desc", - "options": "Addresses will appear only when you save the lead", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "address_html", - "fieldtype": "HTML", - "hidden": 0, - "label": "Address HTML", - "print_hide": 0, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break2", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "phone", - "fieldtype": "Data", - "label": "Phone", - "oldfieldname": "contact_no", - "oldfieldtype": "Data", - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "mobile_no", - "fieldtype": "Data", - "label": "Mobile No.", - "oldfieldname": "mobile_no", - "oldfieldtype": "Data" - }, - { - "doctype": "DocField", - "fieldname": "fax", - "fieldtype": "Data", - "label": "Fax", - "oldfieldname": "fax", - "oldfieldtype": "Data" - }, - { - "doctype": "DocField", - "fieldname": "website", - "fieldtype": "Data", - "label": "Website", - "oldfieldname": "website", - "oldfieldtype": "Data" - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "territory", - "fieldtype": "Link", - "label": "Territory", - "oldfieldname": "territory", - "oldfieldtype": "Link", - "options": "Territory", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "more_info", - "fieldtype": "Section Break", - "label": "More Info", - "oldfieldtype": "Section Break", - "options": "icon-file-text" - }, - { - "doctype": "DocField", - "fieldname": "type", - "fieldtype": "Select", - "in_filter": 1, - "label": "Lead Type", - "oldfieldname": "type", - "oldfieldtype": "Select", - "options": "\nClient\nChannel Partner\nConsultant" - }, - { - "doctype": "DocField", - "fieldname": "market_segment", - "fieldtype": "Select", - "hidden": 0, - "in_filter": 1, - "label": "Market Segment", - "oldfieldname": "market_segment", - "oldfieldtype": "Select", - "options": "\nLower Income\nMiddle Income\nUpper Income", - "reqd": 0, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "industry", - "fieldtype": "Link", - "label": "Industry", - "oldfieldname": "industry", - "oldfieldtype": "Link", - "options": "Industry Type" - }, - { - "doctype": "DocField", - "fieldname": "request_type", - "fieldtype": "Select", - "label": "Request Type", - "oldfieldname": "request_type", - "oldfieldtype": "Select", - "options": "\nProduct Enquiry\nRequest for Information\nSuggestions\nOther" - }, - { - "doctype": "DocField", - "fieldname": "fiscal_year", - "fieldtype": "Select", - "hidden": 1, - "in_filter": 1, - "label": "Fiscal Year", - "oldfieldname": "fiscal_year", - "oldfieldtype": "Select", - "options": "link:Fiscal Year" - }, - { - "doctype": "DocField", - "fieldname": "column_break3", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "label": "Company", - "oldfieldname": "company", - "oldfieldtype": "Link", - "options": "Company", - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "unsubscribed", - "fieldtype": "Check", - "label": "Unsubscribed" - }, - { - "doctype": "DocField", - "fieldname": "blog_subscriber", - "fieldtype": "Check", - "label": "Blog Subscriber" - }, - { - "doctype": "DocField", - "fieldname": "communications", - "fieldtype": "Table", - "hidden": 1, - "label": "Communications", - "options": "Communication", - "print_hide": 1 - }, - { - "delete": 1, - "doctype": "DocPerm", - "role": "Sales Manager" - }, - { - "delete": 0, - "doctype": "DocPerm", - "role": "Sales User" - } -] \ No newline at end of file +{ + "allow_import": 1, + "autoname": "naming_series:", + "creation": "2013-04-10 11:45:37", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "lead_details", + "fieldtype": "Section Break", + "label": "Lead Details", + "options": "icon-user", + "permlevel": 0 + }, + { + "fieldname": "naming_series", + "fieldtype": "Select", + "label": "Series", + "no_copy": 1, + "oldfieldname": "naming_series", + "oldfieldtype": "Select", + "options": "LEAD\nLEAD/10-11/\nLEAD/MUMBAI/", + "permlevel": 0, + "reqd": 0 + }, + { + "fieldname": "lead_name", + "fieldtype": "Data", + "in_filter": 1, + "in_list_view": 1, + "label": "Contact Name", + "oldfieldname": "lead_name", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "company_name", + "fieldtype": "Data", + "in_filter": 1, + "in_list_view": 1, + "label": "Organization Name", + "oldfieldname": "company_name", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 0, + "search_index": 0 + }, + { + "fieldname": "email_id", + "fieldtype": "Data", + "label": "Email Id", + "oldfieldname": "email_id", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 0, + "search_index": 1 + }, + { + "fieldname": "cb6", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "default": "Lead", + "fieldname": "status", + "fieldtype": "Select", + "in_filter": 1, + "in_list_view": 1, + "label": "Status", + "no_copy": 1, + "oldfieldname": "status", + "oldfieldtype": "Select", + "options": "Lead\nOpen\nReplied\nOpportunity\nInterested\nConverted\nDo Not Contact", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "source", + "fieldtype": "Select", + "in_filter": 1, + "in_list_view": 1, + "label": "Source", + "no_copy": 1, + "oldfieldname": "source", + "oldfieldtype": "Select", + "options": "\nAdvertisement\nBlog Post\nCampaign\nCall\nCustomer\nExhibition\nSupplier\nWebsite\nEmail", + "permlevel": 0, + "reqd": 0, + "search_index": 0 + }, + { + "depends_on": "eval:doc.source == 'Customer'", + "fieldname": "customer", + "fieldtype": "Link", + "hidden": 0, + "label": "From Customer", + "oldfieldname": "customer", + "oldfieldtype": "Link", + "options": "Customer", + "permlevel": 0 + }, + { + "depends_on": "eval:doc.source == 'Campaign'", + "description": "Enter campaign name if the source of lead is campaign.", + "fieldname": "campaign_name", + "fieldtype": "Link", + "hidden": 0, + "label": "Campaign Name", + "oldfieldname": "campaign_name", + "oldfieldtype": "Link", + "options": "Campaign", + "permlevel": 0 + }, + { + "fieldname": "communication_history", + "fieldtype": "Section Break", + "label": "Communication", + "options": "icon-comments", + "permlevel": 0, + "print_hide": 1 + }, + { + "default": "__user", + "fieldname": "lead_owner", + "fieldtype": "Link", + "in_filter": 1, + "label": "Lead Owner", + "oldfieldname": "lead_owner", + "oldfieldtype": "Link", + "options": "User", + "permlevel": 0, + "search_index": 1 + }, + { + "fieldname": "col_break123", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "allow_on_submit": 0, + "fieldname": "contact_by", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 1, + "label": "Next Contact By", + "oldfieldname": "contact_by", + "oldfieldtype": "Link", + "options": "User", + "permlevel": 0, + "print_hide": 0, + "reqd": 0, + "width": "100px" + }, + { + "allow_on_submit": 0, + "description": "Add to calendar on this date", + "fieldname": "contact_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Next Contact Date", + "no_copy": 1, + "oldfieldname": "contact_date", + "oldfieldtype": "Date", + "permlevel": 0, + "reqd": 0, + "width": "100px" + }, + { + "fieldname": "sec_break123", + "fieldtype": "Section Break", + "options": "Simple", + "permlevel": 0 + }, + { + "allow_on_submit": 0, + "fieldname": "communication_html", + "fieldtype": "HTML", + "label": "Communication HTML", + "oldfieldname": "follow_up", + "oldfieldtype": "Table", + "permlevel": 0 + }, + { + "fieldname": "contact_info", + "fieldtype": "Section Break", + "label": "Address & Contact", + "oldfieldtype": "Column Break", + "options": "icon-map-marker", + "permlevel": 0 + }, + { + "depends_on": "eval:doc.__islocal", + "fieldname": "address_desc", + "fieldtype": "HTML", + "hidden": 0, + "label": "Address Desc", + "options": "Addresses will appear only when you save the lead", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "address_html", + "fieldtype": "HTML", + "hidden": 0, + "label": "Address HTML", + "permlevel": 0, + "print_hide": 0, + "read_only": 1 + }, + { + "fieldname": "column_break2", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "phone", + "fieldtype": "Data", + "label": "Phone", + "oldfieldname": "contact_no", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 0 + }, + { + "fieldname": "mobile_no", + "fieldtype": "Data", + "label": "Mobile No.", + "oldfieldname": "mobile_no", + "oldfieldtype": "Data", + "permlevel": 0 + }, + { + "fieldname": "fax", + "fieldtype": "Data", + "label": "Fax", + "oldfieldname": "fax", + "oldfieldtype": "Data", + "permlevel": 0 + }, + { + "fieldname": "website", + "fieldtype": "Data", + "label": "Website", + "oldfieldname": "website", + "oldfieldtype": "Data", + "permlevel": 0 + }, + { + "description": "Add / Edit", + "fieldname": "territory", + "fieldtype": "Link", + "label": "Territory", + "oldfieldname": "territory", + "oldfieldtype": "Link", + "options": "Territory", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "more_info", + "fieldtype": "Section Break", + "label": "More Info", + "oldfieldtype": "Section Break", + "options": "icon-file-text", + "permlevel": 0 + }, + { + "fieldname": "type", + "fieldtype": "Select", + "in_filter": 1, + "label": "Lead Type", + "oldfieldname": "type", + "oldfieldtype": "Select", + "options": "\nClient\nChannel Partner\nConsultant", + "permlevel": 0 + }, + { + "fieldname": "market_segment", + "fieldtype": "Select", + "hidden": 0, + "in_filter": 1, + "label": "Market Segment", + "oldfieldname": "market_segment", + "oldfieldtype": "Select", + "options": "\nLower Income\nMiddle Income\nUpper Income", + "permlevel": 0, + "reqd": 0, + "search_index": 0 + }, + { + "fieldname": "industry", + "fieldtype": "Link", + "label": "Industry", + "oldfieldname": "industry", + "oldfieldtype": "Link", + "options": "Industry Type", + "permlevel": 0 + }, + { + "fieldname": "request_type", + "fieldtype": "Select", + "label": "Request Type", + "oldfieldname": "request_type", + "oldfieldtype": "Select", + "options": "\nProduct Enquiry\nRequest for Information\nSuggestions\nOther", + "permlevel": 0 + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Select", + "hidden": 1, + "in_filter": 1, + "label": "Fiscal Year", + "oldfieldname": "fiscal_year", + "oldfieldtype": "Select", + "options": "link:Fiscal Year", + "permlevel": 0 + }, + { + "fieldname": "column_break3", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "company", + "fieldtype": "Link", + "label": "Company", + "oldfieldname": "company", + "oldfieldtype": "Link", + "options": "Company", + "permlevel": 0, + "reqd": 0 + }, + { + "fieldname": "unsubscribed", + "fieldtype": "Check", + "label": "Unsubscribed", + "permlevel": 0 + }, + { + "fieldname": "blog_subscriber", + "fieldtype": "Check", + "label": "Blog Subscriber", + "permlevel": 0 + }, + { + "fieldname": "communications", + "fieldtype": "Table", + "hidden": 1, + "label": "Communications", + "options": "Communication", + "permlevel": 0, + "print_hide": 1 + } + ], + "icon": "icon-user", + "idx": 1, + "modified": "2014-01-20 17:48:54", + "modified_by": "Administrator", + "module": "Selling", + "name": "Lead", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales Manager", + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales User", + "submit": 0, + "write": 1 + } + ], + "search_fields": "lead_name,lead_owner,status" +} \ No newline at end of file diff --git a/erpnext/selling/doctype/opportunity/opportunity.txt b/erpnext/selling/doctype/opportunity/opportunity.txt index fd59a31e92..e98648dd0c 100644 --- a/erpnext/selling/doctype/opportunity/opportunity.txt +++ b/erpnext/selling/doctype/opportunity/opportunity.txt @@ -1,457 +1,448 @@ -[ - { - "creation": "2013-03-07 18:50:30", - "docstatus": 0, - "modified": "2014-01-20 17:48:59", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "autoname": "naming_series:", - "description": "Potential Sales Deal", - "doctype": "DocType", - "document_type": "Transaction", - "icon": "icon-info-sign", - "is_submittable": 1, - "module": "Selling", - "name": "__common__", - "search_fields": "status,transaction_date,customer,lead,enquiry_type,territory,company" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Opportunity", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Opportunity", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 1, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Opportunity" - }, - { - "doctype": "DocField", - "fieldname": "from_section", - "fieldtype": "Section Break", - "label": "From", - "options": "icon-user" - }, - { - "doctype": "DocField", - "fieldname": "naming_series", - "fieldtype": "Select", - "label": "Series", - "no_copy": 1, - "oldfieldname": "naming_series", - "oldfieldtype": "Select", - "options": "OPPT", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "enquiry_from", - "fieldtype": "Select", - "label": "Opportunity From", - "oldfieldname": "enquiry_from", - "oldfieldtype": "Select", - "options": "\nLead\nCustomer", - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 1 - }, - { - "depends_on": "eval:doc.enquiry_from===\"Customer\"", - "doctype": "DocField", - "fieldname": "customer", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 1, - "in_list_view": 1, - "label": "Customer", - "oldfieldname": "customer", - "oldfieldtype": "Link", - "options": "Customer", - "print_hide": 1, - "read_only": 0, - "reqd": 0, - "search_index": 0 - }, - { - "depends_on": "eval:doc.enquiry_from===\"Lead\"", - "doctype": "DocField", - "fieldname": "lead", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 1, - "in_list_view": 1, - "label": "Lead", - "oldfieldname": "lead", - "oldfieldtype": "Link", - "options": "Lead", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "default": "Draft", - "doctype": "DocField", - "fieldname": "status", - "fieldtype": "Select", - "in_list_view": 1, - "label": "Status", - "no_copy": 1, - "oldfieldname": "status", - "oldfieldtype": "Select", - "options": "Draft\nSubmitted\nQuotation\nLost\nCancelled\nReplied\nOpen", - "read_only": 1, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "enquiry_type", - "fieldtype": "Select", - "label": "Opportunity Type", - "oldfieldname": "enquiry_type", - "oldfieldtype": "Select", - "options": "\nSales\nMaintenance", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "items", - "fieldtype": "Section Break", - "label": "Items", - "oldfieldtype": "Section Break", - "options": "icon-shopping-cart", - "read_only": 0 - }, - { - "description": "Items which do not exist in Item master can also be entered on customer's request", - "doctype": "DocField", - "fieldname": "enquiry_details", - "fieldtype": "Table", - "label": "Opportunity Items", - "oldfieldname": "enquiry_details", - "oldfieldtype": "Table", - "options": "Opportunity Item", - "read_only": 0 - }, - { - "description": "Keep a track of communication related to this enquiry which will help for future reference.", - "doctype": "DocField", - "fieldname": "communication_history", - "fieldtype": "Section Break", - "label": "Communication History", - "oldfieldtype": "Section Break", - "options": "icon-comments", - "read_only": 0 - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "communication_html", - "fieldtype": "HTML", - "label": "Communication HTML", - "oldfieldname": "follow_up", - "oldfieldtype": "Table", - "read_only": 0 - }, - { - "depends_on": "eval:doc.lead || doc.customer", - "doctype": "DocField", - "fieldname": "contact_info", - "fieldtype": "Section Break", - "label": "Contact Info", - "options": "icon-bullhorn", - "read_only": 0 - }, - { - "depends_on": "eval:doc.customer || doc.lead", - "doctype": "DocField", - "fieldname": "customer_address", - "fieldtype": "Link", - "in_filter": 1, - "label": "Customer / Lead Address", - "options": "Address", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "address_display", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Address", - "oldfieldname": "address", - "oldfieldtype": "Small Text", - "read_only": 1 - }, - { - "depends_on": "customer", - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "territory", - "fieldtype": "Link", - "in_filter": 1, - "label": "Territory", - "options": "Territory", - "print_hide": 1, - "read_only": 0, - "reqd": 0, - "search_index": 1 - }, - { - "depends_on": "customer", - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "customer_group", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 1, - "label": "Customer Group", - "oldfieldname": "customer_group", - "oldfieldtype": "Link", - "options": "Customer Group", - "print_hide": 1, - "read_only": 0, - "reqd": 0, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break3", - "fieldtype": "Column Break", - "read_only": 0 - }, - { - "depends_on": "customer", - "doctype": "DocField", - "fieldname": "customer_name", - "fieldtype": "Data", - "label": "Customer Name", - "print_hide": 0, - "read_only": 1 - }, - { - "depends_on": "eval:doc.lead || doc.customer", - "doctype": "DocField", - "fieldname": "contact_person", - "fieldtype": "Link", - "in_filter": 1, - "label": "Contact Person", - "options": "Contact", - "print_hide": 1, - "read_only": 0 - }, - { - "depends_on": "customer", - "doctype": "DocField", - "fieldname": "contact_display", - "fieldtype": "Small Text", - "label": "Contact", - "read_only": 1 - }, - { - "depends_on": "eval:doc.lead || doc.customer", - "doctype": "DocField", - "fieldname": "contact_email", - "fieldtype": "Text", - "label": "Contact Email", - "read_only": 1 - }, - { - "depends_on": "eval:doc.lead || doc.customer", - "doctype": "DocField", - "fieldname": "contact_mobile", - "fieldtype": "Text", - "label": "Contact Mobile No", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "more_info", - "fieldtype": "Section Break", - "label": "More Info", - "oldfieldtype": "Section Break", - "options": "icon-file-text", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "default": "Today", - "doctype": "DocField", - "fieldname": "transaction_date", - "fieldtype": "Date", - "label": "Opportunity Date", - "oldfieldname": "transaction_date", - "oldfieldtype": "Date", - "read_only": 0, - "reqd": 1, - "width": "50px" - }, - { - "doctype": "DocField", - "fieldname": "fiscal_year", - "fieldtype": "Select", - "in_filter": 1, - "label": "Fiscal Year", - "oldfieldname": "fiscal_year", - "oldfieldtype": "Select", - "options": "link:Fiscal Year", - "print_hide": 1, - "read_only": 0, - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "source", - "fieldtype": "Select", - "label": "Source", - "oldfieldname": "source", - "oldfieldtype": "Select", - "options": "\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign\nWalk In", - "read_only": 0 - }, - { - "description": "Enter name of campaign if source of enquiry is campaign", - "doctype": "DocField", - "fieldname": "campaign", - "fieldtype": "Link", - "label": "Campaign", - "oldfieldname": "campaign", - "oldfieldtype": "Link", - "options": "Campaign", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "in_filter": 1, - "label": "Company", - "oldfieldname": "company", - "oldfieldtype": "Link", - "options": "Company", - "print_hide": 1, - "read_only": 0, - "reqd": 1, - "search_index": 1 - }, - { - "depends_on": "eval:!doc.__islocal", - "doctype": "DocField", - "fieldname": "order_lost_reason", - "fieldtype": "Text", - "label": "Lost Reason", - "no_copy": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break2", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "description": "Your sales person who will contact the customer in future", - "doctype": "DocField", - "fieldname": "contact_by", - "fieldtype": "Link", - "in_filter": 1, - "label": "Next Contact By", - "oldfieldname": "contact_by", - "oldfieldtype": "Link", - "options": "User", - "read_only": 0, - "width": "75px" - }, - { - "description": "Your sales person will get a reminder on this date to contact the customer", - "doctype": "DocField", - "fieldname": "contact_date", - "fieldtype": "Date", - "label": "Next Contact Date", - "oldfieldname": "contact_date", - "oldfieldtype": "Date", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "to_discuss", - "fieldtype": "Small Text", - "label": "To Discuss", - "no_copy": 1, - "oldfieldname": "to_discuss", - "oldfieldtype": "Small Text", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "amended_from", - "fieldtype": "Data", - "ignore_restrictions": 1, - "label": "Amended From", - "no_copy": 1, - "oldfieldname": "amended_from", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "communications", - "fieldtype": "Table", - "hidden": 1, - "label": "Communications", - "options": "Communication", - "print_hide": 1 - }, - { - "doctype": "DocPerm", - "role": "Sales User" - }, - { - "doctype": "DocPerm", - "role": "Sales Manager" - } -] \ No newline at end of file +{ + "allow_import": 1, + "autoname": "naming_series:", + "creation": "2013-03-07 18:50:30", + "description": "Potential Sales Deal", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Transaction", + "fields": [ + { + "fieldname": "from_section", + "fieldtype": "Section Break", + "label": "From", + "options": "icon-user", + "permlevel": 0 + }, + { + "fieldname": "naming_series", + "fieldtype": "Select", + "label": "Series", + "no_copy": 1, + "oldfieldname": "naming_series", + "oldfieldtype": "Select", + "options": "OPPT", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "enquiry_from", + "fieldtype": "Select", + "label": "Opportunity From", + "oldfieldname": "enquiry_from", + "oldfieldtype": "Select", + "options": "\nLead\nCustomer", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 0, + "reqd": 1 + }, + { + "depends_on": "eval:doc.enquiry_from===\"Customer\"", + "fieldname": "customer", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 1, + "in_list_view": 1, + "label": "Customer", + "oldfieldname": "customer", + "oldfieldtype": "Link", + "options": "Customer", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 0, + "search_index": 0 + }, + { + "depends_on": "eval:doc.enquiry_from===\"Lead\"", + "fieldname": "lead", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 1, + "in_list_view": 1, + "label": "Lead", + "oldfieldname": "lead", + "oldfieldtype": "Link", + "options": "Lead", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "default": "Draft", + "fieldname": "status", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Status", + "no_copy": 1, + "oldfieldname": "status", + "oldfieldtype": "Select", + "options": "Draft\nSubmitted\nQuotation\nLost\nCancelled\nReplied\nOpen", + "permlevel": 0, + "read_only": 1, + "reqd": 1 + }, + { + "fieldname": "enquiry_type", + "fieldtype": "Select", + "label": "Opportunity Type", + "oldfieldname": "enquiry_type", + "oldfieldtype": "Select", + "options": "\nSales\nMaintenance", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "items", + "fieldtype": "Section Break", + "label": "Items", + "oldfieldtype": "Section Break", + "options": "icon-shopping-cart", + "permlevel": 0, + "read_only": 0 + }, + { + "description": "Items which do not exist in Item master can also be entered on customer's request", + "fieldname": "enquiry_details", + "fieldtype": "Table", + "label": "Opportunity Items", + "oldfieldname": "enquiry_details", + "oldfieldtype": "Table", + "options": "Opportunity Item", + "permlevel": 0, + "read_only": 0 + }, + { + "description": "Keep a track of communication related to this enquiry which will help for future reference.", + "fieldname": "communication_history", + "fieldtype": "Section Break", + "label": "Communication History", + "oldfieldtype": "Section Break", + "options": "icon-comments", + "permlevel": 0, + "read_only": 0 + }, + { + "allow_on_submit": 1, + "fieldname": "communication_html", + "fieldtype": "HTML", + "label": "Communication HTML", + "oldfieldname": "follow_up", + "oldfieldtype": "Table", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "eval:doc.lead || doc.customer", + "fieldname": "contact_info", + "fieldtype": "Section Break", + "label": "Contact Info", + "options": "icon-bullhorn", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "eval:doc.customer || doc.lead", + "fieldname": "customer_address", + "fieldtype": "Link", + "in_filter": 1, + "label": "Customer / Lead Address", + "options": "Address", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "address_display", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Address", + "oldfieldname": "address", + "oldfieldtype": "Small Text", + "permlevel": 0, + "read_only": 1 + }, + { + "depends_on": "customer", + "description": "Add / Edit", + "fieldname": "territory", + "fieldtype": "Link", + "in_filter": 1, + "label": "Territory", + "options": "Territory", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 0, + "search_index": 1 + }, + { + "depends_on": "customer", + "description": "Add / Edit", + "fieldname": "customer_group", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 1, + "label": "Customer Group", + "oldfieldname": "customer_group", + "oldfieldtype": "Link", + "options": "Customer Group", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 0, + "search_index": 1 + }, + { + "fieldname": "column_break3", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "customer", + "fieldname": "customer_name", + "fieldtype": "Data", + "label": "Customer Name", + "permlevel": 0, + "print_hide": 0, + "read_only": 1 + }, + { + "depends_on": "eval:doc.lead || doc.customer", + "fieldname": "contact_person", + "fieldtype": "Link", + "in_filter": 1, + "label": "Contact Person", + "options": "Contact", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "depends_on": "customer", + "fieldname": "contact_display", + "fieldtype": "Small Text", + "label": "Contact", + "permlevel": 0, + "read_only": 1 + }, + { + "depends_on": "eval:doc.lead || doc.customer", + "fieldname": "contact_email", + "fieldtype": "Text", + "label": "Contact Email", + "permlevel": 0, + "read_only": 1 + }, + { + "depends_on": "eval:doc.lead || doc.customer", + "fieldname": "contact_mobile", + "fieldtype": "Text", + "label": "Contact Mobile No", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "more_info", + "fieldtype": "Section Break", + "label": "More Info", + "oldfieldtype": "Section Break", + "options": "icon-file-text", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "default": "Today", + "fieldname": "transaction_date", + "fieldtype": "Date", + "label": "Opportunity Date", + "oldfieldname": "transaction_date", + "oldfieldtype": "Date", + "permlevel": 0, + "read_only": 0, + "reqd": 1, + "width": "50px" + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Select", + "in_filter": 1, + "label": "Fiscal Year", + "oldfieldname": "fiscal_year", + "oldfieldtype": "Select", + "options": "link:Fiscal Year", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "source", + "fieldtype": "Select", + "label": "Source", + "oldfieldname": "source", + "oldfieldtype": "Select", + "options": "\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign\nWalk In", + "permlevel": 0, + "read_only": 0 + }, + { + "description": "Enter name of campaign if source of enquiry is campaign", + "fieldname": "campaign", + "fieldtype": "Link", + "label": "Campaign", + "oldfieldname": "campaign", + "oldfieldtype": "Link", + "options": "Campaign", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "company", + "fieldtype": "Link", + "in_filter": 1, + "label": "Company", + "oldfieldname": "company", + "oldfieldtype": "Link", + "options": "Company", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1, + "search_index": 1 + }, + { + "depends_on": "eval:!doc.__islocal", + "fieldname": "order_lost_reason", + "fieldtype": "Text", + "label": "Lost Reason", + "no_copy": 1, + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "column_break2", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "description": "Your sales person who will contact the customer in future", + "fieldname": "contact_by", + "fieldtype": "Link", + "in_filter": 1, + "label": "Next Contact By", + "oldfieldname": "contact_by", + "oldfieldtype": "Link", + "options": "User", + "permlevel": 0, + "read_only": 0, + "width": "75px" + }, + { + "description": "Your sales person will get a reminder on this date to contact the customer", + "fieldname": "contact_date", + "fieldtype": "Date", + "label": "Next Contact Date", + "oldfieldname": "contact_date", + "oldfieldtype": "Date", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "to_discuss", + "fieldtype": "Small Text", + "label": "To Discuss", + "no_copy": 1, + "oldfieldname": "to_discuss", + "oldfieldtype": "Small Text", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "amended_from", + "fieldtype": "Data", + "ignore_restrictions": 1, + "label": "Amended From", + "no_copy": 1, + "oldfieldname": "amended_from", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "width": "150px" + }, + { + "fieldname": "communications", + "fieldtype": "Table", + "hidden": 1, + "label": "Communications", + "options": "Communication", + "permlevel": 0, + "print_hide": 1 + } + ], + "icon": "icon-info-sign", + "idx": 1, + "is_submittable": 1, + "modified": "2014-01-20 17:48:59", + "modified_by": "Administrator", + "module": "Selling", + "name": "Opportunity", + "owner": "Administrator", + "permissions": [ + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales User", + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales Manager", + "submit": 1, + "write": 1 + } + ], + "search_fields": "status,transaction_date,customer,lead,enquiry_type,territory,company" +} \ No newline at end of file diff --git a/erpnext/selling/doctype/opportunity_item/opportunity_item.txt b/erpnext/selling/doctype/opportunity_item/opportunity_item.txt index 22023ed65c..e16731b3bb 100644 --- a/erpnext/selling/doctype/opportunity_item/opportunity_item.txt +++ b/erpnext/selling/doctype/opportunity_item/opportunity_item.txt @@ -1,136 +1,123 @@ -[ - { - "creation": "2013-02-22 01:27:51", - "docstatus": 0, - "modified": "2014-02-03 12:40:44", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "istable": 1, - "module": "Selling", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Opportunity Item", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Opportunity Item" - }, - { - "doctype": "DocField", - "fieldname": "item_code", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Item Code", - "oldfieldname": "item_code", - "oldfieldtype": "Link", - "options": "Item", - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "item_name", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Item Name", - "oldfieldname": "item_name", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "item_group", - "fieldtype": "Link", - "hidden": 1, - "in_list_view": 0, - "label": "Item Group", - "oldfieldname": "item_group", - "oldfieldtype": "Link", - "options": "Item Group", - "print_hide": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "brand", - "fieldtype": "Link", - "hidden": 1, - "in_list_view": 0, - "label": "Brand", - "oldfieldname": "brand", - "oldfieldtype": "Link", - "options": "Brand", - "print_hide": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "col_break1", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Text", - "in_list_view": 1, - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Text", - "print_width": "300px", - "reqd": 1, - "width": "300px" - }, - { - "doctype": "DocField", - "fieldname": "quantity_and_rate", - "fieldtype": "Section Break", - "in_list_view": 0, - "label": "Quantity and Rate" - }, - { - "doctype": "DocField", - "fieldname": "qty", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Qty", - "oldfieldname": "qty", - "oldfieldtype": "Currency" - }, - { - "doctype": "DocField", - "fieldname": "basic_rate", - "fieldtype": "Currency", - "hidden": 1, - "in_list_view": 0, - "label": "Basic Rate", - "oldfieldname": "basic_rate", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "col_break2", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "uom", - "fieldtype": "Link", - "in_list_view": 0, - "label": "UOM", - "oldfieldname": "uom", - "oldfieldtype": "Link", - "options": "UOM", - "search_index": 0 - } -] \ No newline at end of file +{ + "creation": "2013-02-22 01:27:51", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "item_code", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Item Code", + "oldfieldname": "item_code", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0, + "reqd": 0 + }, + { + "fieldname": "item_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Item Name", + "oldfieldname": "item_name", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + }, + { + "description": "Add / Edit", + "fieldname": "item_group", + "fieldtype": "Link", + "hidden": 1, + "in_list_view": 0, + "label": "Item Group", + "oldfieldname": "item_group", + "oldfieldtype": "Link", + "options": "Item Group", + "permlevel": 0, + "print_hide": 1, + "search_index": 0 + }, + { + "fieldname": "brand", + "fieldtype": "Link", + "hidden": 1, + "in_list_view": 0, + "label": "Brand", + "oldfieldname": "brand", + "oldfieldtype": "Link", + "options": "Brand", + "permlevel": 0, + "print_hide": 1, + "search_index": 0 + }, + { + "fieldname": "col_break1", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "description", + "fieldtype": "Text", + "in_list_view": 1, + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Text", + "permlevel": 0, + "print_width": "300px", + "reqd": 1, + "width": "300px" + }, + { + "fieldname": "quantity_and_rate", + "fieldtype": "Section Break", + "in_list_view": 0, + "label": "Quantity and Rate", + "permlevel": 0 + }, + { + "fieldname": "qty", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Qty", + "oldfieldname": "qty", + "oldfieldtype": "Currency", + "permlevel": 0 + }, + { + "fieldname": "basic_rate", + "fieldtype": "Currency", + "hidden": 1, + "in_list_view": 0, + "label": "Basic Rate", + "oldfieldname": "basic_rate", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "col_break2", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "uom", + "fieldtype": "Link", + "in_list_view": 0, + "label": "UOM", + "oldfieldname": "uom", + "oldfieldtype": "Link", + "options": "UOM", + "permlevel": 0, + "search_index": 0 + } + ], + "idx": 1, + "istable": 1, + "modified": "2014-02-03 12:40:44", + "modified_by": "Administrator", + "module": "Selling", + "name": "Opportunity Item", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/selling/doctype/quotation/quotation.txt b/erpnext/selling/doctype/quotation/quotation.txt index 0508e5dbb4..753b344cba 100644 --- a/erpnext/selling/doctype/quotation/quotation.txt +++ b/erpnext/selling/doctype/quotation/quotation.txt @@ -1,903 +1,900 @@ -[ - { - "creation": "2013-05-24 19:29:08", - "docstatus": 0, - "modified": "2014-01-31 19:43:00", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_attach": 1, - "allow_import": 1, - "autoname": "naming_series:", - "doctype": "DocType", - "document_type": "Transaction", - "hide_toolbar": 0, - "icon": "icon-shopping-cart", - "is_submittable": 1, - "max_attachments": 1, - "module": "Selling", - "name": "__common__", - "read_only_onload": 1, - "search_fields": "status,transaction_date,customer,lead,order_type" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Quotation", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Quotation", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1 - }, - { - "doctype": "DocType", - "name": "Quotation" - }, - { - "doctype": "DocField", - "fieldname": "customer_section", - "fieldtype": "Section Break", - "label": "Customer", - "options": "icon-user" - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "naming_series", - "fieldtype": "Select", - "label": "Series", - "no_copy": 1, - "oldfieldname": "naming_series", - "oldfieldtype": "Select", - "options": "QTN", - "print_hide": 1, - "read_only": 0, - "reqd": 1 - }, - { - "default": "Customer", - "doctype": "DocField", - "fieldname": "quotation_to", - "fieldtype": "Select", - "in_filter": 1, - "label": "Quotation To", - "oldfieldname": "quotation_to", - "oldfieldtype": "Select", - "options": "\nLead\nCustomer", - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 1 - }, - { - "depends_on": "eval:doc.quotation_to == \"Customer\"", - "doctype": "DocField", - "fieldname": "customer", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 1, - "label": "Customer", - "oldfieldname": "customer", - "oldfieldtype": "Link", - "options": "Customer", - "print_hide": 1, - "read_only": 0, - "search_index": 1 - }, - { - "depends_on": "eval:doc.quotation_to == \"Lead\"", - "doctype": "DocField", - "fieldname": "lead", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 1, - "label": "Lead", - "oldfieldname": "lead", - "oldfieldtype": "Link", - "options": "Lead", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "customer_name", - "fieldtype": "Data", - "hidden": 1, - "in_list_view": 1, - "label": "Customer Name", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "address_display", - "fieldtype": "Small Text", - "hidden": 1, - "in_filter": 0, - "label": "Address", - "oldfieldname": "customer_address", - "oldfieldtype": "Small Text", - "print_hide": 0, - "read_only": 1, - "reqd": 0, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "contact_display", - "fieldtype": "Small Text", - "hidden": 1, - "in_filter": 0, - "label": "Contact", - "print_hide": 0, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "contact_mobile", - "fieldtype": "Text", - "hidden": 1, - "label": "Mobile No", - "print_hide": 0, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "contact_email", - "fieldtype": "Text", - "hidden": 1, - "label": "Contact Email", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "amended_from", - "fieldtype": "Data", - "ignore_restrictions": 1, - "label": "Amended From", - "no_copy": 1, - "oldfieldname": "amended_from", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 1, - "width": "150px" - }, - { - "description": "Select the relevant company name if you have multiple companies.", - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "in_filter": 1, - "label": "Company", - "oldfieldname": "company", - "oldfieldtype": "Link", - "options": "Company", - "print_hide": 1, - "read_only": 0, - "reqd": 1, - "search_index": 0, - "width": "150px" - }, - { - "default": "Today", - "doctype": "DocField", - "fieldname": "transaction_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Quotation Date", - "no_copy": 1, - "oldfieldname": "transaction_date", - "oldfieldtype": "Date", - "read_only": 0, - "reqd": 1, - "search_index": 1, - "width": "100px" - }, - { - "default": "Sales", - "doctype": "DocField", - "fieldname": "order_type", - "fieldtype": "Select", - "in_filter": 1, - "label": "Order Type", - "oldfieldname": "order_type", - "oldfieldtype": "Select", - "options": "\nSales\nMaintenance\nShopping Cart", - "print_hide": 1, - "read_only": 0, - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "section_break0", - "fieldtype": "Section Break", - "label": "Currency and Price List", - "options": "icon-tag", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "currency", - "fieldtype": "Link", - "in_filter": 1, - "label": "Currency", - "oldfieldname": "currency", - "oldfieldtype": "Select", - "options": "Currency", - "print_hide": 1, - "read_only": 0, - "reqd": 1, - "search_index": 0, - "width": "100px" - }, - { - "description": "Rate at which customer's currency is converted to company's base currency", - "doctype": "DocField", - "fieldname": "conversion_rate", - "fieldtype": "Float", - "label": "Exchange Rate", - "oldfieldname": "conversion_rate", - "oldfieldtype": "Currency", - "print_hide": 1, - "read_only": 0, - "reqd": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "column_break2", - "fieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "selling_price_list", - "fieldtype": "Link", - "in_filter": 1, - "label": "Price List", - "oldfieldname": "price_list_name", - "oldfieldtype": "Select", - "options": "Price List", - "print_hide": 1, - "read_only": 0, - "reqd": 1, - "search_index": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "price_list_currency", - "fieldtype": "Link", - "label": "Price List Currency", - "options": "Currency", - "print_hide": 1, - "read_only": 1, - "reqd": 1 - }, - { - "description": "Rate at which Price list currency is converted to company's base currency", - "doctype": "DocField", - "fieldname": "plc_conversion_rate", - "fieldtype": "Float", - "label": "Price List Exchange Rate", - "print_hide": 1, - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "items", - "fieldtype": "Section Break", - "label": "Items", - "oldfieldtype": "Section Break", - "options": "icon-shopping-cart", - "print_hide": 0, - "read_only": 0, - "search_index": 0 - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "quotation_details", - "fieldtype": "Table", - "label": "Quotation Items", - "oldfieldname": "quotation_details", - "oldfieldtype": "Table", - "options": "Quotation Item", - "read_only": 0, - "reqd": 0, - "width": "40px" - }, - { - "doctype": "DocField", - "fieldname": "sec_break23", - "fieldtype": "Section Break", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "net_total_export", - "fieldtype": "Currency", - "label": "Net Total", - "options": "currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break_28", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "net_total", - "fieldtype": "Currency", - "label": "Net Total (Company Currency)", - "no_copy": 0, - "oldfieldname": "net_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1, - "reqd": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "taxes", - "fieldtype": "Section Break", - "label": "Taxes and Charges", - "oldfieldtype": "Section Break", - "options": "icon-money", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "taxes_and_charges", - "fieldtype": "Link", - "hidden": 0, - "label": "Taxes and Charges", - "oldfieldname": "charge", - "oldfieldtype": "Link", - "options": "Sales Taxes and Charges Master", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break_34", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "shipping_rule", - "fieldtype": "Link", - "hidden": 0, - "label": "Shipping Rule", - "oldfieldtype": "Button", - "options": "Shipping Rule", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "section_break_36", - "fieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "other_charges", - "fieldtype": "Table", - "label": "Sales Taxes and Charges", - "oldfieldname": "other_charges", - "oldfieldtype": "Table", - "options": "Sales Taxes and Charges", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "other_charges_calculation", - "fieldtype": "HTML", - "label": "Taxes and Charges Calculation", - "oldfieldtype": "HTML", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "section_break_39", - "fieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "other_charges_total_export", - "fieldtype": "Currency", - "label": "Taxes and Charges Total", - "options": "currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break_42", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "other_charges_total", - "fieldtype": "Currency", - "label": "Taxes and Charges Total (Company Currency)", - "oldfieldname": "other_charges_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "discount_amount", - "fieldtype": "Currency", - "label": "Discount Amount", - "options": "Company:company:default_currency" - }, - { - "doctype": "DocField", - "fieldname": "totals", - "fieldtype": "Section Break", - "label": "Totals", - "oldfieldtype": "Section Break", - "options": "icon-money", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "grand_total_export", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Grand Total", - "no_copy": 0, - "oldfieldname": "grand_total_export", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 0, - "read_only": 1, - "reqd": 0, - "width": "200px" - }, - { - "doctype": "DocField", - "fieldname": "rounded_total_export", - "fieldtype": "Currency", - "label": "Rounded Total", - "no_copy": 0, - "oldfieldname": "rounded_total_export", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 0, - "read_only": 1, - "reqd": 0, - "width": "200px" - }, - { - "doctype": "DocField", - "fieldname": "in_words_export", - "fieldtype": "Data", - "label": "In Words", - "no_copy": 0, - "oldfieldname": "in_words_export", - "oldfieldtype": "Data", - "print_hide": 0, - "read_only": 1, - "width": "200px" - }, - { - "doctype": "DocField", - "fieldname": "column_break3", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "print_hide": 1, - "read_only": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "grand_total", - "fieldtype": "Currency", - "label": "Grand Total (Company Currency)", - "no_copy": 0, - "oldfieldname": "grand_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1, - "reqd": 0, - "width": "200px" - }, - { - "doctype": "DocField", - "fieldname": "rounded_total", - "fieldtype": "Currency", - "label": "Rounded Total (Company Currency)", - "no_copy": 0, - "oldfieldname": "rounded_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1, - "width": "200px" - }, - { - "description": "In Words will be visible once you save the Quotation.", - "doctype": "DocField", - "fieldname": "in_words", - "fieldtype": "Data", - "label": "In Words (Company Currency)", - "no_copy": 0, - "oldfieldname": "in_words", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 1, - "width": "200px" - }, - { - "doctype": "DocField", - "fieldname": "terms_section_break", - "fieldtype": "Section Break", - "label": "Terms and Conditions", - "oldfieldtype": "Section Break", - "options": "icon-legal", - "print_hide": 0, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "tc_name", - "fieldtype": "Link", - "label": "Terms", - "oldfieldname": "tc_name", - "oldfieldtype": "Link", - "options": "Terms and Conditions", - "print_hide": 1, - "read_only": 0, - "report_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "terms", - "fieldtype": "Text Editor", - "label": "Term Details", - "oldfieldname": "terms", - "oldfieldtype": "Text Editor", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "contact_section", - "fieldtype": "Section Break", - "label": "Contact Info", - "options": "icon-bullhorn", - "read_only": 0 - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "territory", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 1, - "label": "Territory", - "options": "Territory", - "print_hide": 1, - "read_only": 0, - "reqd": 1, - "search_index": 0 - }, - { - "depends_on": "customer", - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "customer_group", - "fieldtype": "Link", - "in_filter": 1, - "label": "Customer Group", - "oldfieldname": "customer_group", - "oldfieldtype": "Link", - "options": "Customer Group", - "print_hide": 1, - "read_only": 0, - "reqd": 0, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "shipping_address_name", - "fieldtype": "Link", - "hidden": 0, - "label": "Shipping Address", - "options": "Address", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "shipping_address", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Shipping Address", - "print_hide": 1, - "read_only": 1 - }, - { - "depends_on": "customer", - "doctype": "DocField", - "fieldname": "col_break98", - "fieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "customer_address", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 1, - "label": "Customer Address", - "options": "Address", - "print_hide": 1, - "read_only": 0 - }, - { - "depends_on": "eval:doc.customer", - "doctype": "DocField", - "fieldname": "contact_person", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 1, - "label": "Contact Person", - "oldfieldname": "contact_person", - "oldfieldtype": "Link", - "options": "Contact", - "print_hide": 1, - "read_only": 0, - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "more_info", - "fieldtype": "Section Break", - "label": "More Info", - "oldfieldtype": "Section Break", - "options": "icon-file-text", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "campaign", - "fieldtype": "Link", - "hidden": 0, - "label": "Campaign", - "no_copy": 0, - "oldfieldname": "campaign", - "oldfieldtype": "Link", - "options": "Campaign", - "print_hide": 1, - "read_only": 0, - "report_hide": 0 - }, - { - "doctype": "DocField", - "fieldname": "source", - "fieldtype": "Select", - "hidden": 0, - "label": "Source", - "no_copy": 0, - "oldfieldname": "source", - "oldfieldtype": "Select", - "options": "\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign", - "print_hide": 1, - "read_only": 0, - "report_hide": 0 - }, - { - "allow_on_submit": 0, - "default": "Draft", - "doctype": "DocField", - "fieldname": "status", - "fieldtype": "Select", - "in_filter": 1, - "in_list_view": 1, - "label": "Status", - "no_copy": 1, - "oldfieldname": "status", - "oldfieldtype": "Select", - "options": "Draft\nSubmitted\nOrdered\nLost\nCancelled", - "print_hide": 1, - "read_only": 1, - "reqd": 1, - "search_index": 0 - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "order_lost_reason", - "fieldtype": "Small Text", - "label": "Quotation Lost Reason", - "no_copy": 1, - "oldfieldname": "order_lost_reason", - "oldfieldtype": "Small Text", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break4", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "print_hide": 1, - "read_only": 0, - "width": "50%" - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "letter_head", - "fieldtype": "Select", - "label": "Letter Head", - "oldfieldname": "letter_head", - "oldfieldtype": "Select", - "options": "link:Letter Head", - "print_hide": 1, - "read_only": 0 - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "select_print_heading", - "fieldtype": "Link", - "label": "Print Heading", - "no_copy": 1, - "oldfieldname": "select_print_heading", - "oldfieldtype": "Link", - "options": "Print Heading", - "print_hide": 1, - "read_only": 0, - "report_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "fiscal_year", - "fieldtype": "Select", - "in_filter": 1, - "label": "Fiscal Year", - "oldfieldname": "fiscal_year", - "oldfieldtype": "Select", - "options": "link:Fiscal Year", - "print_hide": 1, - "read_only": 0, - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "enq_det", - "fieldtype": "Text", - "hidden": 1, - "label": "Opportunity Item", - "no_copy": 0, - "oldfieldname": "enq_det", - "oldfieldtype": "Text", - "print_hide": 1, - "read_only": 1, - "report_hide": 0 - }, - { - "doctype": "DocField", - "fieldname": "communication_history", - "fieldtype": "Section Break", - "label": "Communication History", - "oldfieldtype": "Section Break", - "options": "icon-comments", - "print_hide": 1, - "read_only": 0 - }, - { - "allow_on_submit": 1, - "depends_on": "eval:!doc.__islocal", - "doctype": "DocField", - "fieldname": "communication_html", - "fieldtype": "HTML", - "label": "Communication HTML", - "oldfieldname": "follow_up", - "oldfieldtype": "Table", - "print_hide": 1, - "read_only": 0, - "width": "40px" - }, - { - "doctype": "DocField", - "fieldname": "communications", - "fieldtype": "Table", - "hidden": 1, - "label": "Communications", - "options": "Communication", - "print_hide": 1 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Sales Manager", - "submit": 1, - "write": 1 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Sales User", - "submit": 1, - "write": 1 - }, - { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Customer", - "submit": 0, - "write": 0 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Maintenance Manager", - "submit": 1, - "write": 1 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Maintenance User", - "submit": 1, - "write": 1 - } -] \ No newline at end of file +{ + "allow_attach": 1, + "allow_import": 1, + "autoname": "naming_series:", + "creation": "2013-05-24 19:29:08", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Transaction", + "fields": [ + { + "fieldname": "customer_section", + "fieldtype": "Section Break", + "label": "Customer", + "options": "icon-user", + "permlevel": 0 + }, + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "naming_series", + "fieldtype": "Select", + "label": "Series", + "no_copy": 1, + "oldfieldname": "naming_series", + "oldfieldtype": "Select", + "options": "QTN", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1 + }, + { + "default": "Customer", + "fieldname": "quotation_to", + "fieldtype": "Select", + "in_filter": 1, + "label": "Quotation To", + "oldfieldname": "quotation_to", + "oldfieldtype": "Select", + "options": "\nLead\nCustomer", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 0, + "reqd": 1 + }, + { + "depends_on": "eval:doc.quotation_to == \"Customer\"", + "fieldname": "customer", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 1, + "label": "Customer", + "oldfieldname": "customer", + "oldfieldtype": "Link", + "options": "Customer", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "search_index": 1 + }, + { + "depends_on": "eval:doc.quotation_to == \"Lead\"", + "fieldname": "lead", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 1, + "label": "Lead", + "oldfieldname": "lead", + "oldfieldtype": "Link", + "options": "Lead", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "customer_name", + "fieldtype": "Data", + "hidden": 1, + "in_list_view": 1, + "label": "Customer Name", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "address_display", + "fieldtype": "Small Text", + "hidden": 1, + "in_filter": 0, + "label": "Address", + "oldfieldname": "customer_address", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_hide": 0, + "read_only": 1, + "reqd": 0, + "search_index": 0 + }, + { + "fieldname": "contact_display", + "fieldtype": "Small Text", + "hidden": 1, + "in_filter": 0, + "label": "Contact", + "permlevel": 0, + "print_hide": 0, + "read_only": 1 + }, + { + "fieldname": "contact_mobile", + "fieldtype": "Text", + "hidden": 1, + "label": "Mobile No", + "permlevel": 0, + "print_hide": 0, + "read_only": 1 + }, + { + "fieldname": "contact_email", + "fieldtype": "Text", + "hidden": 1, + "label": "Contact Email", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "amended_from", + "fieldtype": "Data", + "ignore_restrictions": 1, + "label": "Amended From", + "no_copy": 1, + "oldfieldname": "amended_from", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "width": "150px" + }, + { + "description": "Select the relevant company name if you have multiple companies.", + "fieldname": "company", + "fieldtype": "Link", + "in_filter": 1, + "label": "Company", + "oldfieldname": "company", + "oldfieldtype": "Link", + "options": "Company", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1, + "search_index": 0, + "width": "150px" + }, + { + "default": "Today", + "fieldname": "transaction_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Quotation Date", + "no_copy": 1, + "oldfieldname": "transaction_date", + "oldfieldtype": "Date", + "permlevel": 0, + "read_only": 0, + "reqd": 1, + "search_index": 1, + "width": "100px" + }, + { + "default": "Sales", + "fieldname": "order_type", + "fieldtype": "Select", + "in_filter": 1, + "label": "Order Type", + "oldfieldname": "order_type", + "oldfieldtype": "Select", + "options": "\nSales\nMaintenance\nShopping Cart", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "section_break0", + "fieldtype": "Section Break", + "label": "Currency and Price List", + "options": "icon-tag", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "currency", + "fieldtype": "Link", + "in_filter": 1, + "label": "Currency", + "oldfieldname": "currency", + "oldfieldtype": "Select", + "options": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1, + "search_index": 0, + "width": "100px" + }, + { + "description": "Rate at which customer's currency is converted to company's base currency", + "fieldname": "conversion_rate", + "fieldtype": "Float", + "label": "Exchange Rate", + "oldfieldname": "conversion_rate", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1, + "width": "100px" + }, + { + "fieldname": "column_break2", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "selling_price_list", + "fieldtype": "Link", + "in_filter": 1, + "label": "Price List", + "oldfieldname": "price_list_name", + "oldfieldtype": "Select", + "options": "Price List", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1, + "search_index": 0, + "width": "100px" + }, + { + "fieldname": "price_list_currency", + "fieldtype": "Link", + "label": "Price List Currency", + "options": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 1 + }, + { + "description": "Rate at which Price list currency is converted to company's base currency", + "fieldname": "plc_conversion_rate", + "fieldtype": "Float", + "label": "Price List Exchange Rate", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "items", + "fieldtype": "Section Break", + "label": "Items", + "oldfieldtype": "Section Break", + "options": "icon-shopping-cart", + "permlevel": 0, + "print_hide": 0, + "read_only": 0, + "search_index": 0 + }, + { + "allow_on_submit": 1, + "fieldname": "quotation_details", + "fieldtype": "Table", + "label": "Quotation Items", + "oldfieldname": "quotation_details", + "oldfieldtype": "Table", + "options": "Quotation Item", + "permlevel": 0, + "read_only": 0, + "reqd": 0, + "width": "40px" + }, + { + "fieldname": "sec_break23", + "fieldtype": "Section Break", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "net_total_export", + "fieldtype": "Currency", + "label": "Net Total", + "options": "currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "column_break_28", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "net_total", + "fieldtype": "Currency", + "label": "Net Total (Company Currency)", + "no_copy": 0, + "oldfieldname": "net_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 0, + "width": "100px" + }, + { + "fieldname": "taxes", + "fieldtype": "Section Break", + "label": "Taxes and Charges", + "oldfieldtype": "Section Break", + "options": "icon-money", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "taxes_and_charges", + "fieldtype": "Link", + "hidden": 0, + "label": "Taxes and Charges", + "oldfieldname": "charge", + "oldfieldtype": "Link", + "options": "Sales Taxes and Charges Master", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "column_break_34", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "shipping_rule", + "fieldtype": "Link", + "hidden": 0, + "label": "Shipping Rule", + "oldfieldtype": "Button", + "options": "Shipping Rule", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "section_break_36", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "other_charges", + "fieldtype": "Table", + "label": "Sales Taxes and Charges", + "oldfieldname": "other_charges", + "oldfieldtype": "Table", + "options": "Sales Taxes and Charges", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "other_charges_calculation", + "fieldtype": "HTML", + "label": "Taxes and Charges Calculation", + "oldfieldtype": "HTML", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "section_break_39", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "other_charges_total_export", + "fieldtype": "Currency", + "label": "Taxes and Charges Total", + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "column_break_42", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "other_charges_total", + "fieldtype": "Currency", + "label": "Taxes and Charges Total (Company Currency)", + "oldfieldname": "other_charges_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "discount_amount", + "fieldtype": "Currency", + "label": "Discount Amount", + "options": "Company:company:default_currency", + "permlevel": 0 + }, + { + "fieldname": "totals", + "fieldtype": "Section Break", + "label": "Totals", + "oldfieldtype": "Section Break", + "options": "icon-money", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "grand_total_export", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Grand Total", + "no_copy": 0, + "oldfieldname": "grand_total_export", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 1, + "reqd": 0, + "width": "200px" + }, + { + "fieldname": "rounded_total_export", + "fieldtype": "Currency", + "label": "Rounded Total", + "no_copy": 0, + "oldfieldname": "rounded_total_export", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 1, + "reqd": 0, + "width": "200px" + }, + { + "fieldname": "in_words_export", + "fieldtype": "Data", + "label": "In Words", + "no_copy": 0, + "oldfieldname": "in_words_export", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 0, + "read_only": 1, + "width": "200px" + }, + { + "fieldname": "column_break3", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "grand_total", + "fieldtype": "Currency", + "label": "Grand Total (Company Currency)", + "no_copy": 0, + "oldfieldname": "grand_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 0, + "width": "200px" + }, + { + "fieldname": "rounded_total", + "fieldtype": "Currency", + "label": "Rounded Total (Company Currency)", + "no_copy": 0, + "oldfieldname": "rounded_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "width": "200px" + }, + { + "description": "In Words will be visible once you save the Quotation.", + "fieldname": "in_words", + "fieldtype": "Data", + "label": "In Words (Company Currency)", + "no_copy": 0, + "oldfieldname": "in_words", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "width": "200px" + }, + { + "fieldname": "terms_section_break", + "fieldtype": "Section Break", + "label": "Terms and Conditions", + "oldfieldtype": "Section Break", + "options": "icon-legal", + "permlevel": 0, + "print_hide": 0, + "read_only": 0 + }, + { + "fieldname": "tc_name", + "fieldtype": "Link", + "label": "Terms", + "oldfieldname": "tc_name", + "oldfieldtype": "Link", + "options": "Terms and Conditions", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 1 + }, + { + "fieldname": "terms", + "fieldtype": "Text Editor", + "label": "Term Details", + "oldfieldname": "terms", + "oldfieldtype": "Text Editor", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "contact_section", + "fieldtype": "Section Break", + "label": "Contact Info", + "options": "icon-bullhorn", + "permlevel": 0, + "read_only": 0 + }, + { + "description": "Add / Edit", + "fieldname": "territory", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 1, + "label": "Territory", + "options": "Territory", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1, + "search_index": 0 + }, + { + "depends_on": "customer", + "description": "Add / Edit", + "fieldname": "customer_group", + "fieldtype": "Link", + "in_filter": 1, + "label": "Customer Group", + "oldfieldname": "customer_group", + "oldfieldtype": "Link", + "options": "Customer Group", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 0, + "search_index": 0 + }, + { + "fieldname": "shipping_address_name", + "fieldtype": "Link", + "hidden": 0, + "label": "Shipping Address", + "options": "Address", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "shipping_address", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Shipping Address", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "depends_on": "customer", + "fieldname": "col_break98", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "customer_address", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 1, + "label": "Customer Address", + "options": "Address", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "depends_on": "eval:doc.customer", + "fieldname": "contact_person", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 1, + "label": "Contact Person", + "oldfieldname": "contact_person", + "oldfieldtype": "Link", + "options": "Contact", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 0 + }, + { + "fieldname": "more_info", + "fieldtype": "Section Break", + "label": "More Info", + "oldfieldtype": "Section Break", + "options": "icon-file-text", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "campaign", + "fieldtype": "Link", + "hidden": 0, + "label": "Campaign", + "no_copy": 0, + "oldfieldname": "campaign", + "oldfieldtype": "Link", + "options": "Campaign", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 0 + }, + { + "fieldname": "source", + "fieldtype": "Select", + "hidden": 0, + "label": "Source", + "no_copy": 0, + "oldfieldname": "source", + "oldfieldtype": "Select", + "options": "\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 0 + }, + { + "allow_on_submit": 0, + "default": "Draft", + "fieldname": "status", + "fieldtype": "Select", + "in_filter": 1, + "in_list_view": 1, + "label": "Status", + "no_copy": 1, + "oldfieldname": "status", + "oldfieldtype": "Select", + "options": "Draft\nSubmitted\nOrdered\nLost\nCancelled", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 1, + "search_index": 0 + }, + { + "allow_on_submit": 1, + "fieldname": "order_lost_reason", + "fieldtype": "Small Text", + "label": "Quotation Lost Reason", + "no_copy": 1, + "oldfieldname": "order_lost_reason", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "column_break4", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "width": "50%" + }, + { + "allow_on_submit": 1, + "fieldname": "letter_head", + "fieldtype": "Select", + "label": "Letter Head", + "oldfieldname": "letter_head", + "oldfieldtype": "Select", + "options": "link:Letter Head", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "allow_on_submit": 1, + "fieldname": "select_print_heading", + "fieldtype": "Link", + "label": "Print Heading", + "no_copy": 1, + "oldfieldname": "select_print_heading", + "oldfieldtype": "Link", + "options": "Print Heading", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 1 + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Select", + "in_filter": 1, + "label": "Fiscal Year", + "oldfieldname": "fiscal_year", + "oldfieldtype": "Select", + "options": "link:Fiscal Year", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "enq_det", + "fieldtype": "Text", + "hidden": 1, + "label": "Opportunity Item", + "no_copy": 0, + "oldfieldname": "enq_det", + "oldfieldtype": "Text", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "report_hide": 0 + }, + { + "fieldname": "communication_history", + "fieldtype": "Section Break", + "label": "Communication History", + "oldfieldtype": "Section Break", + "options": "icon-comments", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "allow_on_submit": 1, + "depends_on": "eval:!doc.__islocal", + "fieldname": "communication_html", + "fieldtype": "HTML", + "label": "Communication HTML", + "oldfieldname": "follow_up", + "oldfieldtype": "Table", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "width": "40px" + }, + { + "fieldname": "communications", + "fieldtype": "Table", + "hidden": 1, + "label": "Communications", + "options": "Communication", + "permlevel": 0, + "print_hide": 1 + } + ], + "hide_toolbar": 0, + "icon": "icon-shopping-cart", + "idx": 1, + "is_submittable": 1, + "max_attachments": 1, + "modified": "2014-01-31 19:43:00", + "modified_by": "Administrator", + "module": "Selling", + "name": "Quotation", + "owner": "Administrator", + "permissions": [ + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales Manager", + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales User", + "submit": 1, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Customer", + "submit": 0, + "write": 0 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Maintenance Manager", + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Maintenance User", + "submit": 1, + "write": 1 + } + ], + "read_only_onload": 1, + "search_fields": "status,transaction_date,customer,lead,order_type" +} \ No newline at end of file diff --git a/erpnext/selling/doctype/quotation_item/quotation_item.txt b/erpnext/selling/doctype/quotation_item/quotation_item.txt index bbf953a035..fccbc5a755 100644 --- a/erpnext/selling/doctype/quotation_item/quotation_item.txt +++ b/erpnext/selling/doctype/quotation_item/quotation_item.txt @@ -1,374 +1,361 @@ -[ - { - "creation": "2013-03-07 11:42:57", - "docstatus": 0, - "modified": "2014-02-28 11:20:34", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "QUOD/.#####", - "doctype": "DocType", - "istable": 1, - "module": "Selling", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Quotation Item", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Quotation Item" - }, - { - "doctype": "DocField", - "fieldname": "item_code", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 1, - "in_list_view": 1, - "label": "Item Code", - "oldfieldname": "item_code", - "oldfieldtype": "Link", - "options": "Item", - "print_hide": 0, - "print_width": "150px", - "read_only": 0, - "reqd": 1, - "search_index": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "customer_item_code", - "fieldtype": "Data", - "hidden": 1, - "in_list_view": 0, - "label": "Customer's Item Code", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "item_name", - "fieldtype": "Data", - "in_filter": 1, - "in_list_view": 0, - "label": "Item Name", - "oldfieldname": "item_name", - "oldfieldtype": "Data", - "print_hide": 1, - "print_width": "150px", - "read_only": 0, - "reqd": 1, - "search_index": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "col_break1", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Small Text", - "in_list_view": 1, - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Small Text", - "print_hide": 0, - "print_width": "300px", - "read_only": 0, - "reqd": 1, - "width": "300px" - }, - { - "doctype": "DocField", - "fieldname": "quantity_and_rate", - "fieldtype": "Section Break", - "in_list_view": 0, - "label": "Quantity and Rate" - }, - { - "doctype": "DocField", - "fieldname": "qty", - "fieldtype": "Float", - "in_filter": 0, - "in_list_view": 1, - "label": "Quantity", - "oldfieldname": "qty", - "oldfieldtype": "Currency", - "print_hide": 0, - "print_width": "100px", - "read_only": 0, - "reqd": 1, - "search_index": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "price_list_rate", - "fieldtype": "Currency", - "in_list_view": 0, - "label": "Price List Rate", - "oldfieldname": "ref_rate", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 1, - "print_width": "100px", - "read_only": 1, - "reqd": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "discount_percentage", - "fieldtype": "Float", - "in_list_view": 0, - "label": "Discount (%)", - "oldfieldname": "adj_rate", - "oldfieldtype": "Float", - "print_hide": 1, - "print_width": "100px", - "read_only": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "col_break2", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "stock_uom", - "fieldtype": "Link", - "in_list_view": 0, - "label": "UOM", - "oldfieldname": "stock_uom", - "oldfieldtype": "Data", - "options": "UOM", - "print_hide": 0, - "print_width": "100px", - "read_only": 1, - "reqd": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "base_price_list_rate", - "fieldtype": "Currency", - "in_list_view": 0, - "label": "Price List Rate (Company Currency)", - "oldfieldname": "base_ref_rate", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "print_width": "100px", - "read_only": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "Section_break1", - "fieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "rate", - "fieldtype": "Currency", - "in_filter": 0, - "in_list_view": 1, - "label": "Rate", - "oldfieldname": "export_rate", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 0, - "print_width": "100px", - "read_only": 0, - "reqd": 0, - "search_index": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "amount", - "fieldtype": "Currency", - "in_filter": 0, - "in_list_view": 1, - "label": "Amount", - "oldfieldname": "export_amount", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 0, - "print_width": "100px", - "read_only": 1, - "reqd": 0, - "search_index": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "col_break3", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "base_rate", - "fieldtype": "Currency", - "in_filter": 0, - "in_list_view": 0, - "label": "Basic Rate (Company Currency)", - "oldfieldname": "basic_rate", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "print_width": "100px", - "read_only": 1, - "reqd": 0, - "search_index": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "base_amount", - "fieldtype": "Currency", - "in_filter": 0, - "in_list_view": 0, - "label": "Amount (Company Currency)", - "oldfieldname": "amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "print_width": "100px", - "read_only": 1, - "reqd": 0, - "search_index": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "pricing_rule_for_price", - "fieldtype": "Link", - "label": "Pricing Rule For Price", - "options": "Pricing Rule", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "pricing_rule_for_discount", - "fieldtype": "Link", - "label": "Pricing Rule For Discount", - "options": "Pricing Rule", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "reference", - "fieldtype": "Section Break", - "in_list_view": 0, - "label": "Reference" - }, - { - "doctype": "DocField", - "fieldname": "prevdoc_doctype", - "fieldtype": "Data", - "hidden": 1, - "in_list_view": 0, - "label": "Against Doctype", - "no_copy": 1, - "oldfieldname": "prevdoc_doctype", - "oldfieldtype": "Data", - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "report_hide": 0, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "prevdoc_docname", - "fieldtype": "Data", - "in_list_view": 0, - "label": "Against Docname", - "no_copy": 1, - "oldfieldname": "prevdoc_docname", - "oldfieldtype": "Data", - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "report_hide": 0, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "item_tax_rate", - "fieldtype": "Small Text", - "hidden": 1, - "in_list_view": 0, - "label": "Item Tax Rate", - "oldfieldname": "item_tax_rate", - "oldfieldtype": "Small Text", - "print_hide": 1, - "read_only": 1, - "report_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "col_break4", - "fieldtype": "Column Break" - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "page_break", - "fieldtype": "Check", - "hidden": 0, - "in_list_view": 0, - "label": "Page Break", - "no_copy": 1, - "oldfieldname": "page_break", - "oldfieldtype": "Check", - "print_hide": 1, - "read_only": 0, - "report_hide": 1 - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "item_group", - "fieldtype": "Link", - "hidden": 1, - "in_filter": 1, - "in_list_view": 0, - "label": "Item Group", - "oldfieldname": "item_group", - "oldfieldtype": "Link", - "options": "Item Group", - "print_hide": 1, - "read_only": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "brand", - "fieldtype": "Link", - "hidden": 1, - "in_filter": 1, - "in_list_view": 0, - "label": "Brand", - "oldfieldname": "brand", - "oldfieldtype": "Link", - "options": "Brand", - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "search_index": 1, - "width": "150px" - } -] \ No newline at end of file +{ + "autoname": "QUOD/.#####", + "creation": "2013-03-07 11:42:57", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "item_code", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 1, + "in_list_view": 1, + "label": "Item Code", + "oldfieldname": "item_code", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0, + "print_hide": 0, + "print_width": "150px", + "read_only": 0, + "reqd": 1, + "search_index": 1, + "width": "150px" + }, + { + "fieldname": "customer_item_code", + "fieldtype": "Data", + "hidden": 1, + "in_list_view": 0, + "label": "Customer's Item Code", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "item_name", + "fieldtype": "Data", + "in_filter": 1, + "in_list_view": 0, + "label": "Item Name", + "oldfieldname": "item_name", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 0, + "reqd": 1, + "search_index": 1, + "width": "150px" + }, + { + "fieldname": "col_break1", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "description", + "fieldtype": "Small Text", + "in_list_view": 1, + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_hide": 0, + "print_width": "300px", + "read_only": 0, + "reqd": 1, + "width": "300px" + }, + { + "fieldname": "quantity_and_rate", + "fieldtype": "Section Break", + "in_list_view": 0, + "label": "Quantity and Rate", + "permlevel": 0 + }, + { + "fieldname": "qty", + "fieldtype": "Float", + "in_filter": 0, + "in_list_view": 1, + "label": "Quantity", + "oldfieldname": "qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 0, + "print_width": "100px", + "read_only": 0, + "reqd": 1, + "search_index": 0, + "width": "100px" + }, + { + "fieldname": "price_list_rate", + "fieldtype": "Currency", + "in_list_view": 0, + "label": "Price List Rate", + "oldfieldname": "ref_rate", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 1, + "reqd": 0, + "width": "100px" + }, + { + "fieldname": "discount_percentage", + "fieldtype": "Float", + "in_list_view": 0, + "label": "Discount (%)", + "oldfieldname": "adj_rate", + "oldfieldtype": "Float", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 0, + "width": "100px" + }, + { + "fieldname": "col_break2", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "stock_uom", + "fieldtype": "Link", + "in_list_view": 0, + "label": "UOM", + "oldfieldname": "stock_uom", + "oldfieldtype": "Data", + "options": "UOM", + "permlevel": 0, + "print_hide": 0, + "print_width": "100px", + "read_only": 1, + "reqd": 0, + "width": "100px" + }, + { + "fieldname": "base_price_list_rate", + "fieldtype": "Currency", + "in_list_view": 0, + "label": "Price List Rate (Company Currency)", + "oldfieldname": "base_ref_rate", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 1, + "width": "100px" + }, + { + "fieldname": "Section_break1", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "rate", + "fieldtype": "Currency", + "in_filter": 0, + "in_list_view": 1, + "label": "Rate", + "oldfieldname": "export_rate", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "print_width": "100px", + "read_only": 0, + "reqd": 0, + "search_index": 0, + "width": "100px" + }, + { + "fieldname": "amount", + "fieldtype": "Currency", + "in_filter": 0, + "in_list_view": 1, + "label": "Amount", + "oldfieldname": "export_amount", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "print_width": "100px", + "read_only": 1, + "reqd": 0, + "search_index": 0, + "width": "100px" + }, + { + "fieldname": "col_break3", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "base_rate", + "fieldtype": "Currency", + "in_filter": 0, + "in_list_view": 0, + "label": "Basic Rate (Company Currency)", + "oldfieldname": "basic_rate", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 1, + "reqd": 0, + "search_index": 0, + "width": "100px" + }, + { + "fieldname": "base_amount", + "fieldtype": "Currency", + "in_filter": 0, + "in_list_view": 0, + "label": "Amount (Company Currency)", + "oldfieldname": "amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 1, + "reqd": 0, + "search_index": 0, + "width": "100px" + }, + { + "fieldname": "pricing_rule_for_price", + "fieldtype": "Link", + "label": "Pricing Rule For Price", + "options": "Pricing Rule", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "pricing_rule_for_discount", + "fieldtype": "Link", + "label": "Pricing Rule For Discount", + "options": "Pricing Rule", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "reference", + "fieldtype": "Section Break", + "in_list_view": 0, + "label": "Reference", + "permlevel": 0 + }, + { + "fieldname": "prevdoc_doctype", + "fieldtype": "Data", + "hidden": 1, + "in_list_view": 0, + "label": "Against Doctype", + "no_copy": 1, + "oldfieldname": "prevdoc_doctype", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 1, + "report_hide": 0, + "width": "150px" + }, + { + "fieldname": "prevdoc_docname", + "fieldtype": "Data", + "in_list_view": 0, + "label": "Against Docname", + "no_copy": 1, + "oldfieldname": "prevdoc_docname", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 1, + "report_hide": 0, + "width": "150px" + }, + { + "fieldname": "item_tax_rate", + "fieldtype": "Small Text", + "hidden": 1, + "in_list_view": 0, + "label": "Item Tax Rate", + "oldfieldname": "item_tax_rate", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "report_hide": 1 + }, + { + "fieldname": "col_break4", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "allow_on_submit": 1, + "fieldname": "page_break", + "fieldtype": "Check", + "hidden": 0, + "in_list_view": 0, + "label": "Page Break", + "no_copy": 1, + "oldfieldname": "page_break", + "oldfieldtype": "Check", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 1 + }, + { + "description": "Add / Edit", + "fieldname": "item_group", + "fieldtype": "Link", + "hidden": 1, + "in_filter": 1, + "in_list_view": 0, + "label": "Item Group", + "oldfieldname": "item_group", + "oldfieldtype": "Link", + "options": "Item Group", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "search_index": 1 + }, + { + "fieldname": "brand", + "fieldtype": "Link", + "hidden": 1, + "in_filter": 1, + "in_list_view": 0, + "label": "Brand", + "oldfieldname": "brand", + "oldfieldtype": "Link", + "options": "Brand", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 1, + "search_index": 1, + "width": "150px" + } + ], + "idx": 1, + "istable": 1, + "modified": "2014-02-28 11:20:34", + "modified_by": "Administrator", + "module": "Selling", + "name": "Quotation Item", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/selling/doctype/sales_bom/sales_bom.txt b/erpnext/selling/doctype/sales_bom/sales_bom.txt index ae40e10f80..c747615aae 100644 --- a/erpnext/selling/doctype/sales_bom/sales_bom.txt +++ b/erpnext/selling/doctype/sales_bom/sales_bom.txt @@ -1,102 +1,97 @@ -[ - { - "creation": "2013-06-20 11:53:21", - "docstatus": 0, - "modified": "2014-01-20 17:49:19", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "description": "Aggregate group of **Items** into another **Item**. This is useful if you are bundling a certain **Items** into a package and you maintain stock of the packed **Items** and not the aggregate **Item**. \n\nThe package **Item** will have \"Is Stock Item\" as \"No\" and \"Is Sales Item\" as \"Yes\".\n\nFor Example: If you are selling Laptops and Backpacks separately and have a special price if the customer buys both, then the Laptop + Backpack will be a new Sales BOM Item.\n\nNote: BOM = Bill of Materials", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-sitemap", - "is_submittable": 0, - "module": "Selling", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Sales BOM", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "amend": 0, - "cancel": 0, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Sales BOM", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 0 - }, - { - "doctype": "DocType", - "name": "Sales BOM" - }, - { - "doctype": "DocField", - "fieldname": "basic_section", - "fieldtype": "Section Break", - "label": "Sales BOM Item" - }, - { - "description": "The Item that represents the Package. This Item must have \"Is Stock Item\" as \"No\" and \"Is Sales Item\" as \"Yes\"", - "doctype": "DocField", - "fieldname": "new_item_code", - "fieldtype": "Link", - "label": "Parent Item", - "no_copy": 1, - "oldfieldname": "new_item_code", - "oldfieldtype": "Data", - "options": "Item", - "reqd": 1 - }, - { - "description": "List items that form the package.", - "doctype": "DocField", - "fieldname": "item_section", - "fieldtype": "Section Break", - "label": "Package Items" - }, - { - "doctype": "DocField", - "fieldname": "sales_bom_items", - "fieldtype": "Table", - "label": "Sales BOM Items", - "oldfieldname": "sales_bom_items", - "oldfieldtype": "Table", - "options": "Sales BOM Item", - "reqd": 1 - }, - { - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Material Manager", - "write": 1 - }, - { - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Material User", - "write": 0 - }, - { - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Sales User", - "write": 1 - } -] \ No newline at end of file +{ + "allow_import": 1, + "creation": "2013-06-20 11:53:21", + "description": "Aggregate group of **Items** into another **Item**. This is useful if you are bundling a certain **Items** into a package and you maintain stock of the packed **Items** and not the aggregate **Item**. \n\nThe package **Item** will have \"Is Stock Item\" as \"No\" and \"Is Sales Item\" as \"Yes\".\n\nFor Example: If you are selling Laptops and Backpacks separately and have a special price if the customer buys both, then the Laptop + Backpack will be a new Sales BOM Item.\n\nNote: BOM = Bill of Materials", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "basic_section", + "fieldtype": "Section Break", + "label": "Sales BOM Item", + "permlevel": 0 + }, + { + "description": "The Item that represents the Package. This Item must have \"Is Stock Item\" as \"No\" and \"Is Sales Item\" as \"Yes\"", + "fieldname": "new_item_code", + "fieldtype": "Link", + "label": "Parent Item", + "no_copy": 1, + "oldfieldname": "new_item_code", + "oldfieldtype": "Data", + "options": "Item", + "permlevel": 0, + "reqd": 1 + }, + { + "description": "List items that form the package.", + "fieldname": "item_section", + "fieldtype": "Section Break", + "label": "Package Items", + "permlevel": 0 + }, + { + "fieldname": "sales_bom_items", + "fieldtype": "Table", + "label": "Sales BOM Items", + "oldfieldname": "sales_bom_items", + "oldfieldtype": "Table", + "options": "Sales BOM Item", + "permlevel": 0, + "reqd": 1 + } + ], + "icon": "icon-sitemap", + "idx": 1, + "is_submittable": 0, + "modified": "2014-01-20 17:49:19", + "modified_by": "Administrator", + "module": "Selling", + "name": "Sales BOM", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material Manager", + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material User", + "submit": 0, + "write": 0 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales User", + "submit": 0, + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/selling/doctype/sales_bom_item/sales_bom_item.txt b/erpnext/selling/doctype/sales_bom_item/sales_bom_item.txt index e06d8f8241..57642c3820 100644 --- a/erpnext/selling/doctype/sales_bom_item/sales_bom_item.txt +++ b/erpnext/selling/doctype/sales_bom_item/sales_bom_item.txt @@ -1,81 +1,68 @@ -[ - { - "creation": "2013-05-23 16:55:51", - "docstatus": 0, - "modified": "2013-12-20 19:21:38", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "istable": 1, - "module": "Selling", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Sales BOM Item", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Sales BOM Item" - }, - { - "doctype": "DocField", - "fieldname": "item_code", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Item", - "oldfieldname": "item_code", - "oldfieldtype": "Link", - "options": "Item", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "qty", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Qty", - "oldfieldname": "qty", - "oldfieldtype": "Currency", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Text", - "in_list_view": 1, - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Text", - "print_width": "300px" - }, - { - "doctype": "DocField", - "fieldname": "rate", - "fieldtype": "Float", - "hidden": 1, - "in_list_view": 0, - "label": "Rate", - "oldfieldname": "rate", - "oldfieldtype": "Currency", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "uom", - "fieldtype": "Link", - "in_list_view": 0, - "label": "UOM", - "oldfieldname": "uom", - "oldfieldtype": "Link", - "options": "UOM", - "read_only": 1, - "search_index": 0 - } -] \ No newline at end of file +{ + "creation": "2013-05-23 16:55:51", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "item_code", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Item", + "oldfieldname": "item_code", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "qty", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Qty", + "oldfieldname": "qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "description", + "fieldtype": "Text", + "in_list_view": 1, + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Text", + "permlevel": 0, + "print_width": "300px" + }, + { + "fieldname": "rate", + "fieldtype": "Float", + "hidden": 1, + "in_list_view": 0, + "label": "Rate", + "oldfieldname": "rate", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "uom", + "fieldtype": "Link", + "in_list_view": 0, + "label": "UOM", + "oldfieldname": "uom", + "oldfieldtype": "Link", + "options": "UOM", + "permlevel": 0, + "read_only": 1, + "search_index": 0 + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:21:38", + "modified_by": "Administrator", + "module": "Selling", + "name": "Sales BOM Item", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/selling/doctype/sales_order/sales_order.txt b/erpnext/selling/doctype/sales_order/sales_order.txt index 01c2817306..a856a53b28 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.txt +++ b/erpnext/selling/doctype/sales_order/sales_order.txt @@ -1,942 +1,932 @@ -[ - { - "creation": "2013-06-18 12:39:59", - "docstatus": 0, - "modified": "2014-01-28 18:47:42", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_attach": 1, - "allow_import": 1, - "autoname": "naming_series:", - "doctype": "DocType", - "document_type": "Transaction", - "icon": "icon-file-text", - "is_submittable": 1, - "issingle": 0, - "module": "Selling", - "name": "__common__", - "read_only_onload": 1, - "search_fields": "status,transaction_date,customer,customer_name, territory,order_type,company" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Sales Order", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Sales Order", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1 - }, - { - "doctype": "DocType", - "name": "Sales Order" - }, - { - "doctype": "DocField", - "fieldname": "customer_section", - "fieldtype": "Section Break", - "label": "Customer", - "options": "icon-user" - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "in_filter": 0, - "oldfieldtype": "Column Break", - "search_index": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "naming_series", - "fieldtype": "Select", - "label": "Series", - "no_copy": 1, - "oldfieldname": "naming_series", - "oldfieldtype": "Select", - "options": "PI/2011/\nSO\nSO/10-11/\nSO1112", - "print_hide": 1, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "customer", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "Customer", - "oldfieldname": "customer", - "oldfieldtype": "Link", - "options": "Customer", - "print_hide": 1, - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "customer_name", - "fieldtype": "Data", - "hidden": 0, - "label": "Name", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "address_display", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Address", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "contact_display", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Contact", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "contact_mobile", - "fieldtype": "Text", - "hidden": 1, - "label": "Mobile No", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "contact_email", - "fieldtype": "Text", - "hidden": 1, - "label": "Contact Email", - "print_hide": 1, - "read_only": 1 - }, - { - "default": "Sales", - "doctype": "DocField", - "fieldname": "order_type", - "fieldtype": "Select", - "in_list_view": 1, - "label": "Order Type", - "oldfieldname": "order_type", - "oldfieldtype": "Select", - "options": "\nSales\nMaintenance", - "print_hide": 1, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "amended_from", - "fieldtype": "Data", - "hidden": 1, - "ignore_restrictions": 1, - "label": "Amended From", - "no_copy": 1, - "oldfieldname": "amended_from", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 1, - "width": "150px" - }, - { - "description": "Select the relevant company name if you have multiple companies.", - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "in_filter": 1, - "label": "Company", - "oldfieldname": "company", - "oldfieldtype": "Link", - "options": "Company", - "print_hide": 1, - "reqd": 1, - "search_index": 1, - "width": "150px" - }, - { - "default": "Today", - "doctype": "DocField", - "fieldname": "transaction_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Sales Order Date", - "no_copy": 1, - "oldfieldname": "transaction_date", - "oldfieldtype": "Date", - "print_hide": 0, - "reqd": 1, - "search_index": 1, - "width": "160px" - }, - { - "depends_on": "eval:doc.order_type == 'Sales'", - "doctype": "DocField", - "fieldname": "delivery_date", - "fieldtype": "Date", - "hidden": 0, - "in_filter": 1, - "label": "Delivery Date", - "oldfieldname": "delivery_date", - "oldfieldtype": "Date", - "print_hide": 1, - "reqd": 0, - "search_index": 1, - "width": "160px" - }, - { - "description": "Customer's Purchase Order Number", - "doctype": "DocField", - "fieldname": "po_no", - "fieldtype": "Data", - "hidden": 0, - "label": "PO No", - "oldfieldname": "po_no", - "oldfieldtype": "Data", - "print_hide": 0, - "reqd": 0, - "width": "100px" - }, - { - "depends_on": "eval:doc.po_no", - "description": "Customer's Purchase Order Date", - "doctype": "DocField", - "fieldname": "po_date", - "fieldtype": "Date", - "hidden": 0, - "label": "PO Date", - "oldfieldname": "po_date", - "oldfieldtype": "Date", - "print_hide": 0, - "reqd": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "shipping_address_name", - "fieldtype": "Link", - "hidden": 1, - "in_filter": 1, - "label": "Shipping Address", - "options": "Address", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "shipping_address", - "fieldtype": "Small Text", - "hidden": 1, - "in_filter": 0, - "label": "Shipping Address", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "sec_break45", - "fieldtype": "Section Break", - "label": "Currency and Price List", - "options": "icon-tag" - }, - { - "doctype": "DocField", - "fieldname": "currency", - "fieldtype": "Link", - "label": "Currency", - "oldfieldname": "currency", - "oldfieldtype": "Select", - "options": "Currency", - "print_hide": 1, - "reqd": 1, - "width": "100px" - }, - { - "description": "Rate at which customer's currency is converted to company's base currency", - "doctype": "DocField", - "fieldname": "conversion_rate", - "fieldtype": "Float", - "label": "Exchange Rate", - "oldfieldname": "conversion_rate", - "oldfieldtype": "Currency", - "print_hide": 1, - "reqd": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "column_break2", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "selling_price_list", - "fieldtype": "Link", - "label": "Price List", - "oldfieldname": "price_list_name", - "oldfieldtype": "Select", - "options": "Price List", - "print_hide": 1, - "reqd": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "price_list_currency", - "fieldtype": "Link", - "label": "Price List Currency", - "options": "Currency", - "print_hide": 1, - "read_only": 1, - "reqd": 1 - }, - { - "description": "Rate at which Price list currency is converted to company's base currency", - "doctype": "DocField", - "fieldname": "plc_conversion_rate", - "fieldtype": "Float", - "label": "Price List Exchange Rate", - "print_hide": 1, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "items", - "fieldtype": "Section Break", - "label": "Items", - "oldfieldtype": "Section Break", - "options": "icon-shopping-cart" - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "sales_order_details", - "fieldtype": "Table", - "label": "Sales Order Items", - "oldfieldname": "sales_order_details", - "oldfieldtype": "Table", - "options": "Sales Order Item", - "print_hide": 0, - "reqd": 1 - }, - { - "description": "Display all the individual items delivered with the main items", - "doctype": "DocField", - "fieldname": "packing_list", - "fieldtype": "Section Break", - "hidden": 0, - "label": "Packing List", - "oldfieldtype": "Section Break", - "options": "icon-suitcase", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "packing_details", - "fieldtype": "Table", - "label": "Packing Details", - "oldfieldname": "packing_details", - "oldfieldtype": "Table", - "options": "Packed Item", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "section_break_31", - "fieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "net_total_export", - "fieldtype": "Currency", - "label": "Net Total", - "options": "currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break_33", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "net_total", - "fieldtype": "Currency", - "label": "Net Total (Company Currency)", - "oldfieldname": "net_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1, - "reqd": 0, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "taxes", - "fieldtype": "Section Break", - "label": "Taxes and Charges", - "oldfieldtype": "Section Break", - "options": "icon-money", - "print_hide": 0 - }, - { - "doctype": "DocField", - "fieldname": "taxes_and_charges", - "fieldtype": "Link", - "label": "Taxes and Charges", - "oldfieldname": "charge", - "oldfieldtype": "Link", - "options": "Sales Taxes and Charges Master", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break_38", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "shipping_rule", - "fieldtype": "Link", - "label": "Shipping Rule", - "oldfieldtype": "Button", - "options": "Shipping Rule", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "section_break_40", - "fieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "other_charges", - "fieldtype": "Table", - "label": "Sales Taxes and Charges", - "oldfieldname": "other_charges", - "oldfieldtype": "Table", - "options": "Sales Taxes and Charges" - }, - { - "doctype": "DocField", - "fieldname": "other_charges_calculation", - "fieldtype": "HTML", - "label": "Taxes and Charges Calculation", - "oldfieldtype": "HTML", - "print_hide": 0 - }, - { - "doctype": "DocField", - "fieldname": "section_break_43", - "fieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "other_charges_total_export", - "fieldtype": "Currency", - "label": "Taxes and Charges Total", - "options": "currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break_46", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "other_charges_total", - "fieldtype": "Currency", - "label": "Taxes and Charges Total (Company Currency)", - "oldfieldname": "other_charges_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "discount_amount", - "fieldtype": "Currency", - "label": "Discount Amount", - "options": "Company:company:default_currency" - }, - { - "doctype": "DocField", - "fieldname": "totals", - "fieldtype": "Section Break", - "label": "Totals", - "oldfieldtype": "Section Break", - "options": "icon-money", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "grand_total_export", - "fieldtype": "Currency", - "label": "Grand Total", - "oldfieldname": "grand_total_export", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 0, - "read_only": 1, - "reqd": 0, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "rounded_total_export", - "fieldtype": "Currency", - "label": "Rounded Total", - "oldfieldname": "rounded_total_export", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 0, - "read_only": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "in_words_export", - "fieldtype": "Data", - "label": "In Words", - "oldfieldname": "in_words_export", - "oldfieldtype": "Data", - "print_hide": 0, - "read_only": 1, - "width": "200px" - }, - { - "doctype": "DocField", - "fieldname": "column_break3", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "print_hide": 1, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "grand_total", - "fieldtype": "Currency", - "label": "Grand Total (Company Currency)", - "oldfieldname": "grand_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1, - "reqd": 0, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "rounded_total", - "fieldtype": "Currency", - "label": "Rounded Total (Company Currency)", - "oldfieldname": "rounded_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1, - "width": "150px" - }, - { - "description": "In Words will be visible once you save the Sales Order.", - "doctype": "DocField", - "fieldname": "in_words", - "fieldtype": "Data", - "label": "In Words (Company Currency)", - "oldfieldname": "in_words", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 1, - "width": "200px" - }, - { - "doctype": "DocField", - "fieldname": "terms_section_break", - "fieldtype": "Section Break", - "label": "Terms and Conditions", - "oldfieldtype": "Section Break", - "options": "icon-legal", - "print_hide": 0 - }, - { - "doctype": "DocField", - "fieldname": "tc_name", - "fieldtype": "Link", - "label": "Terms", - "oldfieldname": "tc_name", - "oldfieldtype": "Link", - "options": "Terms and Conditions", - "print_hide": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "terms", - "fieldtype": "Text Editor", - "label": "Terms and Conditions Details", - "oldfieldname": "terms", - "oldfieldtype": "Text Editor", - "print_hide": 0 - }, - { - "depends_on": "customer", - "doctype": "DocField", - "fieldname": "contact_info", - "fieldtype": "Section Break", - "label": "Contact Info", - "options": "icon-bullhorn" - }, - { - "doctype": "DocField", - "fieldname": "col_break45", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "territory", - "fieldtype": "Link", - "in_filter": 1, - "label": "Territory", - "options": "Territory", - "print_hide": 1, - "reqd": 1, - "search_index": 1 - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "customer_group", - "fieldtype": "Link", - "in_filter": 1, - "label": "Customer Group", - "options": "Customer Group", - "print_hide": 1, - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "col_break46", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "customer_address", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 1, - "label": "Customer Address", - "options": "Address", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "contact_person", - "fieldtype": "Link", - "in_filter": 1, - "label": "Contact Person", - "options": "Contact", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "more_info", - "fieldtype": "Section Break", - "label": "More Info", - "oldfieldtype": "Section Break", - "options": "icon-file-text", - "print_hide": 1 - }, - { - "description": "Track this Sales Order against any Project", - "doctype": "DocField", - "fieldname": "project_name", - "fieldtype": "Link", - "in_filter": 1, - "label": "Project Name", - "oldfieldname": "project_name", - "oldfieldtype": "Link", - "options": "Project", - "search_index": 1 - }, - { - "depends_on": "eval:doc.source == 'Campaign'", - "doctype": "DocField", - "fieldname": "campaign", - "fieldtype": "Link", - "label": "Campaign", - "oldfieldname": "campaign", - "oldfieldtype": "Link", - "options": "Campaign", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "source", - "fieldtype": "Select", - "label": "Source", - "oldfieldname": "source", - "oldfieldtype": "Select", - "options": "\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break4", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "print_hide": 1, - "width": "50%" - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "letter_head", - "fieldtype": "Select", - "label": "Letter Head", - "oldfieldname": "letter_head", - "oldfieldtype": "Select", - "options": "link:Letter Head", - "print_hide": 1 - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "select_print_heading", - "fieldtype": "Link", - "label": "Print Heading", - "no_copy": 1, - "oldfieldname": "select_print_heading", - "oldfieldtype": "Link", - "options": "Print Heading", - "print_hide": 1, - "report_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "fiscal_year", - "fieldtype": "Select", - "in_filter": 1, - "label": "Fiscal Year", - "oldfieldname": "fiscal_year", - "oldfieldtype": "Select", - "options": "link:Fiscal Year", - "print_hide": 1, - "reqd": 1, - "search_index": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "section_break_78", - "fieldtype": "Section Break", - "oldfieldtype": "Column Break", - "print_hide": 1, - "width": "50%" - }, - { - "default": "Draft", - "doctype": "DocField", - "fieldname": "status", - "fieldtype": "Select", - "in_filter": 1, - "in_list_view": 1, - "label": "Status", - "no_copy": 1, - "oldfieldname": "status", - "oldfieldtype": "Select", - "options": "\nDraft\nSubmitted\nStopped\nCancelled", - "print_hide": 1, - "read_only": 1, - "reqd": 1, - "search_index": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "delivery_status", - "fieldtype": "Select", - "hidden": 1, - "label": "Delivery Status", - "no_copy": 1, - "options": "Delivered\nNot Delivered\nPartly Delivered\nClosed\nNot Applicable", - "print_hide": 1 - }, - { - "depends_on": "eval:!doc.__islocal", - "description": "% of materials delivered against this Sales Order", - "doctype": "DocField", - "fieldname": "per_delivered", - "fieldtype": "Percent", - "in_filter": 1, - "in_list_view": 1, - "label": "% Delivered", - "no_copy": 1, - "oldfieldname": "per_delivered", - "oldfieldtype": "Currency", - "print_hide": 1, - "read_only": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "column_break_81", - "fieldtype": "Column Break" - }, - { - "depends_on": "eval:!doc.__islocal", - "description": "% of materials billed against this Sales Order", - "doctype": "DocField", - "fieldname": "per_billed", - "fieldtype": "Percent", - "in_filter": 1, - "in_list_view": 1, - "label": "% Amount Billed", - "no_copy": 1, - "oldfieldname": "per_billed", - "oldfieldtype": "Currency", - "print_hide": 1, - "read_only": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "billing_status", - "fieldtype": "Select", - "hidden": 1, - "label": "Billing Status", - "no_copy": 1, - "options": "Billed\nNot Billed\nPartly Billed\nClosed", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "sales_team_section_break", - "fieldtype": "Section Break", - "label": "Sales Team", - "oldfieldtype": "Section Break", - "options": "icon-group", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "sales_partner", - "fieldtype": "Link", - "in_filter": 1, - "label": "Sales Partner", - "oldfieldname": "sales_partner", - "oldfieldtype": "Link", - "options": "Sales Partner", - "print_hide": 1, - "search_index": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "column_break7", - "fieldtype": "Column Break", - "print_hide": 1, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "commission_rate", - "fieldtype": "Float", - "label": "Commission Rate", - "oldfieldname": "commission_rate", - "oldfieldtype": "Currency", - "print_hide": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "total_commission", - "fieldtype": "Currency", - "label": "Total Commission", - "oldfieldname": "total_commission", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "section_break1", - "fieldtype": "Section Break", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "sales_team", - "fieldtype": "Table", - "label": "Sales Team1", - "oldfieldname": "sales_team", - "oldfieldtype": "Table", - "options": "Sales Team", - "print_hide": 1 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "report": 1, - "role": "Sales User", - "submit": 1, - "write": 1 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "report": 1, - "role": "Maintenance User", - "submit": 1, - "write": 1 - }, - { - "cancel": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Accounts User" - }, - { - "cancel": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Customer" - } -] \ No newline at end of file +{ + "allow_attach": 1, + "allow_import": 1, + "autoname": "naming_series:", + "creation": "2013-06-18 12:39:59", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Transaction", + "fields": [ + { + "fieldname": "customer_section", + "fieldtype": "Section Break", + "label": "Customer", + "options": "icon-user", + "permlevel": 0 + }, + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "in_filter": 0, + "oldfieldtype": "Column Break", + "permlevel": 0, + "search_index": 0, + "width": "50%" + }, + { + "fieldname": "naming_series", + "fieldtype": "Select", + "label": "Series", + "no_copy": 1, + "oldfieldname": "naming_series", + "oldfieldtype": "Select", + "options": "PI/2011/\nSO\nSO/10-11/\nSO1112", + "permlevel": 0, + "print_hide": 1, + "reqd": 1 + }, + { + "fieldname": "customer", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Customer", + "oldfieldname": "customer", + "oldfieldtype": "Link", + "options": "Customer", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "customer_name", + "fieldtype": "Data", + "hidden": 0, + "label": "Name", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "address_display", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Address", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "contact_display", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Contact", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "contact_mobile", + "fieldtype": "Text", + "hidden": 1, + "label": "Mobile No", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "contact_email", + "fieldtype": "Text", + "hidden": 1, + "label": "Contact Email", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "default": "Sales", + "fieldname": "order_type", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Order Type", + "oldfieldname": "order_type", + "oldfieldtype": "Select", + "options": "\nSales\nMaintenance", + "permlevel": 0, + "print_hide": 1, + "reqd": 1 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "amended_from", + "fieldtype": "Data", + "hidden": 1, + "ignore_restrictions": 1, + "label": "Amended From", + "no_copy": 1, + "oldfieldname": "amended_from", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "width": "150px" + }, + { + "description": "Select the relevant company name if you have multiple companies.", + "fieldname": "company", + "fieldtype": "Link", + "in_filter": 1, + "label": "Company", + "oldfieldname": "company", + "oldfieldtype": "Link", + "options": "Company", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, + "search_index": 1, + "width": "150px" + }, + { + "default": "Today", + "fieldname": "transaction_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Sales Order Date", + "no_copy": 1, + "oldfieldname": "transaction_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 0, + "reqd": 1, + "search_index": 1, + "width": "160px" + }, + { + "depends_on": "eval:doc.order_type == 'Sales'", + "fieldname": "delivery_date", + "fieldtype": "Date", + "hidden": 0, + "in_filter": 1, + "label": "Delivery Date", + "oldfieldname": "delivery_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 1, + "reqd": 0, + "search_index": 1, + "width": "160px" + }, + { + "description": "Customer's Purchase Order Number", + "fieldname": "po_no", + "fieldtype": "Data", + "hidden": 0, + "label": "PO No", + "oldfieldname": "po_no", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 0, + "reqd": 0, + "width": "100px" + }, + { + "depends_on": "eval:doc.po_no", + "description": "Customer's Purchase Order Date", + "fieldname": "po_date", + "fieldtype": "Date", + "hidden": 0, + "label": "PO Date", + "oldfieldname": "po_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 0, + "reqd": 0, + "width": "100px" + }, + { + "fieldname": "shipping_address_name", + "fieldtype": "Link", + "hidden": 1, + "in_filter": 1, + "label": "Shipping Address", + "options": "Address", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "shipping_address", + "fieldtype": "Small Text", + "hidden": 1, + "in_filter": 0, + "label": "Shipping Address", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "sec_break45", + "fieldtype": "Section Break", + "label": "Currency and Price List", + "options": "icon-tag", + "permlevel": 0 + }, + { + "fieldname": "currency", + "fieldtype": "Link", + "label": "Currency", + "oldfieldname": "currency", + "oldfieldtype": "Select", + "options": "Currency", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, + "width": "100px" + }, + { + "description": "Rate at which customer's currency is converted to company's base currency", + "fieldname": "conversion_rate", + "fieldtype": "Float", + "label": "Exchange Rate", + "oldfieldname": "conversion_rate", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, + "width": "100px" + }, + { + "fieldname": "column_break2", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "selling_price_list", + "fieldtype": "Link", + "label": "Price List", + "oldfieldname": "price_list_name", + "oldfieldtype": "Select", + "options": "Price List", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, + "width": "100px" + }, + { + "fieldname": "price_list_currency", + "fieldtype": "Link", + "label": "Price List Currency", + "options": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 1 + }, + { + "description": "Rate at which Price list currency is converted to company's base currency", + "fieldname": "plc_conversion_rate", + "fieldtype": "Float", + "label": "Price List Exchange Rate", + "permlevel": 0, + "print_hide": 1, + "reqd": 1 + }, + { + "fieldname": "items", + "fieldtype": "Section Break", + "label": "Items", + "oldfieldtype": "Section Break", + "options": "icon-shopping-cart", + "permlevel": 0 + }, + { + "allow_on_submit": 1, + "fieldname": "sales_order_details", + "fieldtype": "Table", + "label": "Sales Order Items", + "oldfieldname": "sales_order_details", + "oldfieldtype": "Table", + "options": "Sales Order Item", + "permlevel": 0, + "print_hide": 0, + "reqd": 1 + }, + { + "description": "Display all the individual items delivered with the main items", + "fieldname": "packing_list", + "fieldtype": "Section Break", + "hidden": 0, + "label": "Packing List", + "oldfieldtype": "Section Break", + "options": "icon-suitcase", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "packing_details", + "fieldtype": "Table", + "label": "Packing Details", + "oldfieldname": "packing_details", + "oldfieldtype": "Table", + "options": "Packed Item", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "section_break_31", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "net_total_export", + "fieldtype": "Currency", + "label": "Net Total", + "options": "currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "column_break_33", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "net_total", + "fieldtype": "Currency", + "label": "Net Total (Company Currency)", + "oldfieldname": "net_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 0, + "width": "150px" + }, + { + "fieldname": "taxes", + "fieldtype": "Section Break", + "label": "Taxes and Charges", + "oldfieldtype": "Section Break", + "options": "icon-money", + "permlevel": 0, + "print_hide": 0 + }, + { + "fieldname": "taxes_and_charges", + "fieldtype": "Link", + "label": "Taxes and Charges", + "oldfieldname": "charge", + "oldfieldtype": "Link", + "options": "Sales Taxes and Charges Master", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "column_break_38", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "shipping_rule", + "fieldtype": "Link", + "label": "Shipping Rule", + "oldfieldtype": "Button", + "options": "Shipping Rule", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "section_break_40", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "other_charges", + "fieldtype": "Table", + "label": "Sales Taxes and Charges", + "oldfieldname": "other_charges", + "oldfieldtype": "Table", + "options": "Sales Taxes and Charges", + "permlevel": 0 + }, + { + "fieldname": "other_charges_calculation", + "fieldtype": "HTML", + "label": "Taxes and Charges Calculation", + "oldfieldtype": "HTML", + "permlevel": 0, + "print_hide": 0 + }, + { + "fieldname": "section_break_43", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "other_charges_total_export", + "fieldtype": "Currency", + "label": "Taxes and Charges Total", + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "column_break_46", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "other_charges_total", + "fieldtype": "Currency", + "label": "Taxes and Charges Total (Company Currency)", + "oldfieldname": "other_charges_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "width": "150px" + }, + { + "fieldname": "discount_amount", + "fieldtype": "Currency", + "label": "Discount Amount", + "options": "Company:company:default_currency", + "permlevel": 0 + }, + { + "fieldname": "totals", + "fieldtype": "Section Break", + "label": "Totals", + "oldfieldtype": "Section Break", + "options": "icon-money", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "grand_total_export", + "fieldtype": "Currency", + "label": "Grand Total", + "oldfieldname": "grand_total_export", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 1, + "reqd": 0, + "width": "150px" + }, + { + "fieldname": "rounded_total_export", + "fieldtype": "Currency", + "label": "Rounded Total", + "oldfieldname": "rounded_total_export", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 1, + "width": "150px" + }, + { + "fieldname": "in_words_export", + "fieldtype": "Data", + "label": "In Words", + "oldfieldname": "in_words_export", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 0, + "read_only": 1, + "width": "200px" + }, + { + "fieldname": "column_break3", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 1, + "width": "50%" + }, + { + "fieldname": "grand_total", + "fieldtype": "Currency", + "label": "Grand Total (Company Currency)", + "oldfieldname": "grand_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 0, + "width": "150px" + }, + { + "fieldname": "rounded_total", + "fieldtype": "Currency", + "label": "Rounded Total (Company Currency)", + "oldfieldname": "rounded_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "width": "150px" + }, + { + "description": "In Words will be visible once you save the Sales Order.", + "fieldname": "in_words", + "fieldtype": "Data", + "label": "In Words (Company Currency)", + "oldfieldname": "in_words", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "width": "200px" + }, + { + "fieldname": "terms_section_break", + "fieldtype": "Section Break", + "label": "Terms and Conditions", + "oldfieldtype": "Section Break", + "options": "icon-legal", + "permlevel": 0, + "print_hide": 0 + }, + { + "fieldname": "tc_name", + "fieldtype": "Link", + "label": "Terms", + "oldfieldname": "tc_name", + "oldfieldtype": "Link", + "options": "Terms and Conditions", + "permlevel": 0, + "print_hide": 1, + "search_index": 0 + }, + { + "fieldname": "terms", + "fieldtype": "Text Editor", + "label": "Terms and Conditions Details", + "oldfieldname": "terms", + "oldfieldtype": "Text Editor", + "permlevel": 0, + "print_hide": 0 + }, + { + "depends_on": "customer", + "fieldname": "contact_info", + "fieldtype": "Section Break", + "label": "Contact Info", + "options": "icon-bullhorn", + "permlevel": 0 + }, + { + "fieldname": "col_break45", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "description": "Add / Edit", + "fieldname": "territory", + "fieldtype": "Link", + "in_filter": 1, + "label": "Territory", + "options": "Territory", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, + "search_index": 1 + }, + { + "description": "Add / Edit", + "fieldname": "customer_group", + "fieldtype": "Link", + "in_filter": 1, + "label": "Customer Group", + "options": "Customer Group", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "col_break46", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "customer_address", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 1, + "label": "Customer Address", + "options": "Address", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "contact_person", + "fieldtype": "Link", + "in_filter": 1, + "label": "Contact Person", + "options": "Contact", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "more_info", + "fieldtype": "Section Break", + "label": "More Info", + "oldfieldtype": "Section Break", + "options": "icon-file-text", + "permlevel": 0, + "print_hide": 1 + }, + { + "description": "Track this Sales Order against any Project", + "fieldname": "project_name", + "fieldtype": "Link", + "in_filter": 1, + "label": "Project Name", + "oldfieldname": "project_name", + "oldfieldtype": "Link", + "options": "Project", + "permlevel": 0, + "search_index": 1 + }, + { + "depends_on": "eval:doc.source == 'Campaign'", + "fieldname": "campaign", + "fieldtype": "Link", + "label": "Campaign", + "oldfieldname": "campaign", + "oldfieldtype": "Link", + "options": "Campaign", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "source", + "fieldtype": "Select", + "label": "Source", + "oldfieldname": "source", + "oldfieldtype": "Select", + "options": "\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "column_break4", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 1, + "width": "50%" + }, + { + "allow_on_submit": 1, + "fieldname": "letter_head", + "fieldtype": "Select", + "label": "Letter Head", + "oldfieldname": "letter_head", + "oldfieldtype": "Select", + "options": "link:Letter Head", + "permlevel": 0, + "print_hide": 1 + }, + { + "allow_on_submit": 1, + "fieldname": "select_print_heading", + "fieldtype": "Link", + "label": "Print Heading", + "no_copy": 1, + "oldfieldname": "select_print_heading", + "oldfieldtype": "Link", + "options": "Print Heading", + "permlevel": 0, + "print_hide": 1, + "report_hide": 1 + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Select", + "in_filter": 1, + "label": "Fiscal Year", + "oldfieldname": "fiscal_year", + "oldfieldtype": "Select", + "options": "link:Fiscal Year", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, + "search_index": 1, + "width": "150px" + }, + { + "fieldname": "section_break_78", + "fieldtype": "Section Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 1, + "width": "50%" + }, + { + "default": "Draft", + "fieldname": "status", + "fieldtype": "Select", + "in_filter": 1, + "in_list_view": 1, + "label": "Status", + "no_copy": 1, + "oldfieldname": "status", + "oldfieldtype": "Select", + "options": "\nDraft\nSubmitted\nStopped\nCancelled", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 1, + "search_index": 1, + "width": "100px" + }, + { + "fieldname": "delivery_status", + "fieldtype": "Select", + "hidden": 1, + "label": "Delivery Status", + "no_copy": 1, + "options": "Delivered\nNot Delivered\nPartly Delivered\nClosed\nNot Applicable", + "permlevel": 0, + "print_hide": 1 + }, + { + "depends_on": "eval:!doc.__islocal", + "description": "% of materials delivered against this Sales Order", + "fieldname": "per_delivered", + "fieldtype": "Percent", + "in_filter": 1, + "in_list_view": 1, + "label": "% Delivered", + "no_copy": 1, + "oldfieldname": "per_delivered", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "width": "100px" + }, + { + "fieldname": "column_break_81", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "depends_on": "eval:!doc.__islocal", + "description": "% of materials billed against this Sales Order", + "fieldname": "per_billed", + "fieldtype": "Percent", + "in_filter": 1, + "in_list_view": 1, + "label": "% Amount Billed", + "no_copy": 1, + "oldfieldname": "per_billed", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "width": "100px" + }, + { + "fieldname": "billing_status", + "fieldtype": "Select", + "hidden": 1, + "label": "Billing Status", + "no_copy": 1, + "options": "Billed\nNot Billed\nPartly Billed\nClosed", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "sales_team_section_break", + "fieldtype": "Section Break", + "label": "Sales Team", + "oldfieldtype": "Section Break", + "options": "icon-group", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "sales_partner", + "fieldtype": "Link", + "in_filter": 1, + "label": "Sales Partner", + "oldfieldname": "sales_partner", + "oldfieldtype": "Link", + "options": "Sales Partner", + "permlevel": 0, + "print_hide": 1, + "search_index": 1, + "width": "150px" + }, + { + "fieldname": "column_break7", + "fieldtype": "Column Break", + "permlevel": 0, + "print_hide": 1, + "width": "50%" + }, + { + "fieldname": "commission_rate", + "fieldtype": "Float", + "label": "Commission Rate", + "oldfieldname": "commission_rate", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "width": "100px" + }, + { + "fieldname": "total_commission", + "fieldtype": "Currency", + "label": "Total Commission", + "oldfieldname": "total_commission", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "section_break1", + "fieldtype": "Section Break", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "sales_team", + "fieldtype": "Table", + "label": "Sales Team1", + "oldfieldname": "sales_team", + "oldfieldtype": "Table", + "options": "Sales Team", + "permlevel": 0, + "print_hide": 1 + } + ], + "icon": "icon-file-text", + "idx": 1, + "is_submittable": 1, + "issingle": 0, + "modified": "2014-01-28 18:47:42", + "modified_by": "Administrator", + "module": "Selling", + "name": "Sales Order", + "owner": "Administrator", + "permissions": [ + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales User", + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Maintenance User", + "submit": 1, + "write": 1 + }, + { + "cancel": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "role": "Accounts User" + }, + { + "cancel": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "role": "Customer" + } + ], + "read_only_onload": 1, + "search_fields": "status,transaction_date,customer,customer_name, territory,order_type,company" +} \ No newline at end of file diff --git a/erpnext/selling/doctype/sales_order_item/sales_order_item.txt b/erpnext/selling/doctype/sales_order_item/sales_order_item.txt index 7e471e497c..d5b4d78560 100644 --- a/erpnext/selling/doctype/sales_order_item/sales_order_item.txt +++ b/erpnext/selling/doctype/sales_order_item/sales_order_item.txt @@ -1,460 +1,447 @@ -[ - { - "creation": "2013-03-07 11:42:58", - "docstatus": 0, - "modified": "2014-02-28 11:20:05", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "SOD/.#####", - "doctype": "DocType", - "istable": 1, - "module": "Selling", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Sales Order Item", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Sales Order Item" - }, - { - "doctype": "DocField", - "fieldname": "item_code", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "Item Code", - "oldfieldname": "item_code", - "oldfieldtype": "Link", - "options": "Item", - "print_width": "150px", - "read_only": 0, - "reqd": 1, - "search_index": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "customer_item_code", - "fieldtype": "Data", - "hidden": 1, - "in_list_view": 0, - "label": "Customer's Item Code", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "item_name", - "fieldtype": "Data", - "in_list_view": 0, - "label": "Item Name", - "oldfieldname": "item_name", - "oldfieldtype": "Data", - "print_hide": 1, - "print_width": "150", - "read_only": 0, - "reqd": 1, - "width": "150" - }, - { - "doctype": "DocField", - "fieldname": "col_break1", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Small Text", - "in_filter": 1, - "in_list_view": 1, - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Small Text", - "print_width": "300px", - "read_only": 0, - "reqd": 1, - "search_index": 1, - "width": "300px" - }, - { - "doctype": "DocField", - "fieldname": "quantity_and_rate", - "fieldtype": "Section Break", - "in_list_view": 0, - "label": "Quantity and Rate" - }, - { - "doctype": "DocField", - "fieldname": "qty", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Quantity", - "oldfieldname": "qty", - "oldfieldtype": "Currency", - "print_width": "100px", - "read_only": 0, - "reqd": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "price_list_rate", - "fieldtype": "Currency", - "in_list_view": 0, - "label": "Price List Rate", - "oldfieldname": "ref_rate", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 1, - "print_width": "70px", - "read_only": 1, - "reqd": 0, - "width": "70px" - }, - { - "doctype": "DocField", - "fieldname": "discount_percentage", - "fieldtype": "Float", - "in_list_view": 0, - "label": "Discount(%)", - "oldfieldname": "adj_rate", - "oldfieldtype": "Float", - "print_hide": 1, - "print_width": "70px", - "read_only": 0, - "width": "70px" - }, - { - "doctype": "DocField", - "fieldname": "col_break2", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "stock_uom", - "fieldtype": "Link", - "hidden": 0, - "in_list_view": 0, - "label": "UOM", - "oldfieldname": "stock_uom", - "oldfieldtype": "Data", - "options": "UOM", - "print_width": "70px", - "read_only": 1, - "reqd": 0, - "width": "70px" - }, - { - "doctype": "DocField", - "fieldname": "base_price_list_rate", - "fieldtype": "Currency", - "in_list_view": 0, - "label": "Price List Rate (Company Currency)", - "oldfieldname": "base_ref_rate", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "print_width": "100px", - "read_only": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "section_break_simple1", - "fieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "rate", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Rate", - "oldfieldname": "export_rate", - "oldfieldtype": "Currency", - "options": "currency", - "print_width": "100px", - "read_only": 0, - "reqd": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "amount", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Amount", - "no_copy": 0, - "oldfieldname": "export_amount", - "oldfieldtype": "Currency", - "options": "currency", - "print_width": "100px", - "read_only": 1, - "reqd": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "col_break3", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "base_rate", - "fieldtype": "Currency", - "in_list_view": 0, - "label": "Basic Rate (Company Currency)", - "oldfieldname": "basic_rate", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "print_width": "100px", - "read_only": 1, - "reqd": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "base_amount", - "fieldtype": "Currency", - "in_list_view": 0, - "label": "Amount (Company Currency)", - "no_copy": 0, - "oldfieldname": "amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "print_width": "100px", - "read_only": 1, - "reqd": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "pricing_rule_for_price", - "fieldtype": "Link", - "label": "Pricing Rule For Price", - "options": "Pricing Rule", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "pricing_rule_for_discount", - "fieldtype": "Link", - "label": "Pricing Rule For Discount", - "options": "Pricing Rule", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "warehouse_and_reference", - "fieldtype": "Section Break", - "in_list_view": 0, - "label": "Warehouse and Reference" - }, - { - "doctype": "DocField", - "fieldname": "warehouse", - "fieldtype": "Link", - "in_list_view": 0, - "label": "Reserved Warehouse", - "no_copy": 0, - "oldfieldname": "reserved_warehouse", - "oldfieldtype": "Link", - "options": "Warehouse", - "print_hide": 1, - "print_width": "150px", - "read_only": 0, - "reqd": 0, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "prevdoc_docname", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 1, - "in_list_view": 0, - "label": "Quotation", - "no_copy": 1, - "oldfieldname": "prevdoc_docname", - "oldfieldtype": "Link", - "options": "Quotation", - "print_hide": 1, - "read_only": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "brand", - "fieldtype": "Link", - "hidden": 1, - "in_filter": 1, - "in_list_view": 0, - "label": "Brand Name", - "oldfieldname": "brand", - "oldfieldtype": "Link", - "options": "Brand", - "print_hide": 1, - "read_only": 1, - "search_index": 1 - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "item_group", - "fieldtype": "Link", - "hidden": 1, - "in_filter": 1, - "in_list_view": 0, - "label": "Item Group", - "oldfieldname": "item_group", - "oldfieldtype": "Link", - "options": "Item Group", - "print_hide": 1, - "read_only": 1, - "search_index": 1 - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "page_break", - "fieldtype": "Check", - "in_list_view": 0, - "label": "Page Break", - "oldfieldname": "page_break", - "oldfieldtype": "Check", - "print_hide": 1, - "read_only": 0, - "report_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "col_break4", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "projected_qty", - "fieldtype": "Float", - "hidden": 1, - "in_list_view": 0, - "label": "Projected Qty", - "no_copy": 1, - "oldfieldname": "projected_qty", - "oldfieldtype": "Currency", - "print_hide": 1, - "print_width": "70px", - "read_only": 1, - "width": "70px" - }, - { - "doctype": "DocField", - "fieldname": "actual_qty", - "fieldtype": "Float", - "in_list_view": 0, - "label": "Actual Qty", - "no_copy": 1, - "print_hide": 1, - "print_width": "70px", - "read_only": 1, - "width": "70px" - }, - { - "doctype": "DocField", - "fieldname": "delivered_qty", - "fieldtype": "Float", - "hidden": 0, - "in_filter": 0, - "in_list_view": 0, - "label": "Delivered Qty", - "no_copy": 1, - "oldfieldname": "delivered_qty", - "oldfieldtype": "Currency", - "print_hide": 1, - "print_width": "100px", - "read_only": 1, - "search_index": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "billed_amt", - "fieldtype": "Currency", - "in_list_view": 0, - "label": "Billed Amt", - "no_copy": 1, - "options": "currency", - "print_hide": 1, - "read_only": 1 - }, - { - "description": "For Production", - "doctype": "DocField", - "fieldname": "planned_qty", - "fieldtype": "Float", - "hidden": 1, - "in_list_view": 0, - "label": "Planned Quantity", - "no_copy": 1, - "oldfieldname": "planned_qty", - "oldfieldtype": "Currency", - "print_hide": 1, - "print_width": "50px", - "read_only": 1, - "report_hide": 1, - "width": "50px" - }, - { - "description": "For Production", - "doctype": "DocField", - "fieldname": "produced_qty", - "fieldtype": "Float", - "hidden": 1, - "in_list_view": 0, - "label": "Produced Quantity", - "oldfieldname": "produced_qty", - "oldfieldtype": "Currency", - "print_hide": 1, - "print_width": "50px", - "read_only": 1, - "report_hide": 1, - "width": "50px" - }, - { - "doctype": "DocField", - "fieldname": "item_tax_rate", - "fieldtype": "Small Text", - "hidden": 1, - "in_list_view": 0, - "label": "Item Tax Rate", - "oldfieldname": "item_tax_rate", - "oldfieldtype": "Small Text", - "print_hide": 1, - "read_only": 1, - "report_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "transaction_date", - "fieldtype": "Date", - "hidden": 1, - "in_filter": 0, - "in_list_view": 0, - "label": "Sales Order Date", - "oldfieldname": "transaction_date", - "oldfieldtype": "Date", - "print_hide": 1, - "read_only": 1, - "report_hide": 1, - "search_index": 0 - } -] \ No newline at end of file +{ + "autoname": "SOD/.#####", + "creation": "2013-03-07 11:42:58", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "item_code", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Item Code", + "oldfieldname": "item_code", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0, + "print_width": "150px", + "read_only": 0, + "reqd": 1, + "search_index": 1, + "width": "150px" + }, + { + "fieldname": "customer_item_code", + "fieldtype": "Data", + "hidden": 1, + "in_list_view": 0, + "label": "Customer's Item Code", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "item_name", + "fieldtype": "Data", + "in_list_view": 0, + "label": "Item Name", + "oldfieldname": "item_name", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "print_width": "150", + "read_only": 0, + "reqd": 1, + "width": "150" + }, + { + "fieldname": "col_break1", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "description", + "fieldtype": "Small Text", + "in_filter": 1, + "in_list_view": 1, + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_width": "300px", + "read_only": 0, + "reqd": 1, + "search_index": 1, + "width": "300px" + }, + { + "fieldname": "quantity_and_rate", + "fieldtype": "Section Break", + "in_list_view": 0, + "label": "Quantity and Rate", + "permlevel": 0 + }, + { + "fieldname": "qty", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Quantity", + "oldfieldname": "qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_width": "100px", + "read_only": 0, + "reqd": 1, + "width": "100px" + }, + { + "fieldname": "price_list_rate", + "fieldtype": "Currency", + "in_list_view": 0, + "label": "Price List Rate", + "oldfieldname": "ref_rate", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "70px", + "read_only": 1, + "reqd": 0, + "width": "70px" + }, + { + "fieldname": "discount_percentage", + "fieldtype": "Float", + "in_list_view": 0, + "label": "Discount(%)", + "oldfieldname": "adj_rate", + "oldfieldtype": "Float", + "permlevel": 0, + "print_hide": 1, + "print_width": "70px", + "read_only": 0, + "width": "70px" + }, + { + "fieldname": "col_break2", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "stock_uom", + "fieldtype": "Link", + "hidden": 0, + "in_list_view": 0, + "label": "UOM", + "oldfieldname": "stock_uom", + "oldfieldtype": "Data", + "options": "UOM", + "permlevel": 0, + "print_width": "70px", + "read_only": 1, + "reqd": 0, + "width": "70px" + }, + { + "fieldname": "base_price_list_rate", + "fieldtype": "Currency", + "in_list_view": 0, + "label": "Price List Rate (Company Currency)", + "oldfieldname": "base_ref_rate", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 1, + "width": "100px" + }, + { + "fieldname": "section_break_simple1", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "rate", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Rate", + "oldfieldname": "export_rate", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_width": "100px", + "read_only": 0, + "reqd": 0, + "width": "100px" + }, + { + "fieldname": "amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Amount", + "no_copy": 0, + "oldfieldname": "export_amount", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_width": "100px", + "read_only": 1, + "reqd": 0, + "width": "100px" + }, + { + "fieldname": "col_break3", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "base_rate", + "fieldtype": "Currency", + "in_list_view": 0, + "label": "Basic Rate (Company Currency)", + "oldfieldname": "basic_rate", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 1, + "reqd": 0, + "width": "100px" + }, + { + "fieldname": "base_amount", + "fieldtype": "Currency", + "in_list_view": 0, + "label": "Amount (Company Currency)", + "no_copy": 0, + "oldfieldname": "amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 1, + "reqd": 0, + "width": "100px" + }, + { + "fieldname": "pricing_rule_for_price", + "fieldtype": "Link", + "label": "Pricing Rule For Price", + "options": "Pricing Rule", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "pricing_rule_for_discount", + "fieldtype": "Link", + "label": "Pricing Rule For Discount", + "options": "Pricing Rule", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "warehouse_and_reference", + "fieldtype": "Section Break", + "in_list_view": 0, + "label": "Warehouse and Reference", + "permlevel": 0 + }, + { + "fieldname": "warehouse", + "fieldtype": "Link", + "in_list_view": 0, + "label": "Reserved Warehouse", + "no_copy": 0, + "oldfieldname": "reserved_warehouse", + "oldfieldtype": "Link", + "options": "Warehouse", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 0, + "reqd": 0, + "width": "150px" + }, + { + "fieldname": "prevdoc_docname", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 1, + "in_list_view": 0, + "label": "Quotation", + "no_copy": 1, + "oldfieldname": "prevdoc_docname", + "oldfieldtype": "Link", + "options": "Quotation", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "search_index": 1 + }, + { + "fieldname": "brand", + "fieldtype": "Link", + "hidden": 1, + "in_filter": 1, + "in_list_view": 0, + "label": "Brand Name", + "oldfieldname": "brand", + "oldfieldtype": "Link", + "options": "Brand", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "search_index": 1 + }, + { + "description": "Add / Edit", + "fieldname": "item_group", + "fieldtype": "Link", + "hidden": 1, + "in_filter": 1, + "in_list_view": 0, + "label": "Item Group", + "oldfieldname": "item_group", + "oldfieldtype": "Link", + "options": "Item Group", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "search_index": 1 + }, + { + "allow_on_submit": 1, + "fieldname": "page_break", + "fieldtype": "Check", + "in_list_view": 0, + "label": "Page Break", + "oldfieldname": "page_break", + "oldfieldtype": "Check", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 1 + }, + { + "fieldname": "col_break4", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "projected_qty", + "fieldtype": "Float", + "hidden": 1, + "in_list_view": 0, + "label": "Projected Qty", + "no_copy": 1, + "oldfieldname": "projected_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "70px", + "read_only": 1, + "width": "70px" + }, + { + "fieldname": "actual_qty", + "fieldtype": "Float", + "in_list_view": 0, + "label": "Actual Qty", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, + "print_width": "70px", + "read_only": 1, + "width": "70px" + }, + { + "fieldname": "delivered_qty", + "fieldtype": "Float", + "hidden": 0, + "in_filter": 0, + "in_list_view": 0, + "label": "Delivered Qty", + "no_copy": 1, + "oldfieldname": "delivered_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 1, + "search_index": 0, + "width": "100px" + }, + { + "fieldname": "billed_amt", + "fieldtype": "Currency", + "in_list_view": 0, + "label": "Billed Amt", + "no_copy": 1, + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "description": "For Production", + "fieldname": "planned_qty", + "fieldtype": "Float", + "hidden": 1, + "in_list_view": 0, + "label": "Planned Quantity", + "no_copy": 1, + "oldfieldname": "planned_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "50px", + "read_only": 1, + "report_hide": 1, + "width": "50px" + }, + { + "description": "For Production", + "fieldname": "produced_qty", + "fieldtype": "Float", + "hidden": 1, + "in_list_view": 0, + "label": "Produced Quantity", + "oldfieldname": "produced_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "50px", + "read_only": 1, + "report_hide": 1, + "width": "50px" + }, + { + "fieldname": "item_tax_rate", + "fieldtype": "Small Text", + "hidden": 1, + "in_list_view": 0, + "label": "Item Tax Rate", + "oldfieldname": "item_tax_rate", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "report_hide": 1 + }, + { + "fieldname": "transaction_date", + "fieldtype": "Date", + "hidden": 1, + "in_filter": 0, + "in_list_view": 0, + "label": "Sales Order Date", + "oldfieldname": "transaction_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "report_hide": 1, + "search_index": 0 + } + ], + "idx": 1, + "istable": 1, + "modified": "2014-02-28 11:20:05", + "modified_by": "Administrator", + "module": "Selling", + "name": "Sales Order Item", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/selling/doctype/sales_team/sales_team.txt b/erpnext/selling/doctype/sales_team/sales_team.txt index d012cb41c1..11bf5447b8 100644 --- a/erpnext/selling/doctype/sales_team/sales_team.txt +++ b/erpnext/selling/doctype/sales_team/sales_team.txt @@ -1,120 +1,107 @@ -[ - { - "creation": "2013-04-19 13:30:51", - "docstatus": 0, - "modified": "2013-12-31 19:00:14", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "istable": 1, - "module": "Selling", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Sales Team", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Sales Team" - }, - { - "doctype": "DocField", - "fieldname": "sales_person", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "Sales Person", - "oldfieldname": "sales_person", - "oldfieldtype": "Link", - "options": "Sales Person", - "print_width": "200px", - "reqd": 1, - "search_index": 1, - "width": "200px" - }, - { - "doctype": "DocField", - "fieldname": "sales_designation", - "fieldtype": "Data", - "hidden": 0, - "in_list_view": 1, - "label": "Designation", - "oldfieldname": "sales_designation", - "oldfieldtype": "Data", - "print_width": "100px", - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "contact_no", - "fieldtype": "Data", - "hidden": 1, - "in_list_view": 1, - "label": "Contact No.", - "oldfieldname": "contact_no", - "oldfieldtype": "Data", - "print_width": "100px", - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "col_break1", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "allocated_percentage", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Contribution (%)", - "oldfieldname": "allocated_percentage", - "oldfieldtype": "Currency", - "print_width": "100px", - "reqd": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "allocated_amount", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Contribution to Net Total", - "oldfieldname": "allocated_amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_width": "120px", - "read_only": 1, - "reqd": 0, - "width": "120px" - }, - { - "doctype": "DocField", - "fieldname": "incentives", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Incentives", - "oldfieldname": "incentives", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency" - }, - { - "doctype": "DocField", - "fieldname": "parenttype", - "fieldtype": "Data", - "hidden": 1, - "in_filter": 1, - "in_list_view": 0, - "label": "Parenttype", - "oldfieldname": "parenttype", - "oldfieldtype": "Data", - "print_hide": 1, - "search_index": 1 - } -] \ No newline at end of file +{ + "creation": "2013-04-19 13:30:51", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "sales_person", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Sales Person", + "oldfieldname": "sales_person", + "oldfieldtype": "Link", + "options": "Sales Person", + "permlevel": 0, + "print_width": "200px", + "reqd": 1, + "search_index": 1, + "width": "200px" + }, + { + "fieldname": "sales_designation", + "fieldtype": "Data", + "hidden": 0, + "in_list_view": 1, + "label": "Designation", + "oldfieldname": "sales_designation", + "oldfieldtype": "Data", + "permlevel": 0, + "print_width": "100px", + "width": "100px" + }, + { + "fieldname": "contact_no", + "fieldtype": "Data", + "hidden": 1, + "in_list_view": 1, + "label": "Contact No.", + "oldfieldname": "contact_no", + "oldfieldtype": "Data", + "permlevel": 0, + "print_width": "100px", + "width": "100px" + }, + { + "fieldname": "col_break1", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "allocated_percentage", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Contribution (%)", + "oldfieldname": "allocated_percentage", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_width": "100px", + "reqd": 0, + "width": "100px" + }, + { + "fieldname": "allocated_amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Contribution to Net Total", + "oldfieldname": "allocated_amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_width": "120px", + "read_only": 1, + "reqd": 0, + "width": "120px" + }, + { + "fieldname": "incentives", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Incentives", + "oldfieldname": "incentives", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0 + }, + { + "fieldname": "parenttype", + "fieldtype": "Data", + "hidden": 1, + "in_filter": 1, + "in_list_view": 0, + "label": "Parenttype", + "oldfieldname": "parenttype", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "search_index": 1 + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-31 19:00:14", + "modified_by": "Administrator", + "module": "Selling", + "name": "Sales Team", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/selling/doctype/selling_settings/selling_settings.txt b/erpnext/selling/doctype/selling_settings/selling_settings.txt index 24d5c28106..cee3a5c061 100644 --- a/erpnext/selling/doctype/selling_settings/selling_settings.txt +++ b/erpnext/selling/doctype/selling_settings/selling_settings.txt @@ -1,109 +1,90 @@ -[ - { - "creation": "2013-06-25 10:25:16", - "docstatus": 0, - "modified": "2014-02-19 18:35:36", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "description": "Settings for Selling Module", - "doctype": "DocType", - "document_type": "Other", - "icon": "icon-cog", - "issingle": 1, - "module": "Selling", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Selling Settings", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Selling Settings", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "role": "System Manager", - "write": 1 - }, - { - "doctype": "DocType", - "name": "Selling Settings" - }, - { - "default": "Customer Name", - "doctype": "DocField", - "fieldname": "cust_master_name", - "fieldtype": "Select", - "label": "Customer Naming By", - "options": "Customer Name\nNaming Series" - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "customer_group", - "fieldtype": "Link", - "label": "Default Customer Group", - "options": "Customer Group" - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "territory", - "fieldtype": "Link", - "label": "Default Territory", - "options": "Territory" - }, - { - "doctype": "DocField", - "fieldname": "selling_price_list", - "fieldtype": "Link", - "label": "Default Price List", - "options": "Price List" - }, - { - "doctype": "DocField", - "fieldname": "column_break_5", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "so_required", - "fieldtype": "Select", - "label": "Sales Order Required", - "options": "No\nYes" - }, - { - "doctype": "DocField", - "fieldname": "dn_required", - "fieldtype": "Select", - "label": "Delivery Note Required", - "options": "No\nYes" - }, - { - "doctype": "DocField", - "fieldname": "maintain_same_sales_rate", - "fieldtype": "Check", - "label": "Maintain Same Rate Throughout Sales Cycle" - }, - { - "doctype": "DocField", - "fieldname": "editable_price_list_rate", - "fieldtype": "Check", - "label": "Allow user to edit Price List Rate in transactions" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "creation": "2013-06-25 10:25:16", + "description": "Settings for Selling Module", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Other", + "fields": [ + { + "default": "Customer Name", + "fieldname": "cust_master_name", + "fieldtype": "Select", + "label": "Customer Naming By", + "options": "Customer Name\nNaming Series", + "permlevel": 0 + }, + { + "description": "Add / Edit", + "fieldname": "customer_group", + "fieldtype": "Link", + "label": "Default Customer Group", + "options": "Customer Group", + "permlevel": 0 + }, + { + "description": "Add / Edit", + "fieldname": "territory", + "fieldtype": "Link", + "label": "Default Territory", + "options": "Territory", + "permlevel": 0 + }, + { + "fieldname": "selling_price_list", + "fieldtype": "Link", + "label": "Default Price List", + "options": "Price List", + "permlevel": 0 + }, + { + "fieldname": "column_break_5", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "so_required", + "fieldtype": "Select", + "label": "Sales Order Required", + "options": "No\nYes", + "permlevel": 0 + }, + { + "fieldname": "dn_required", + "fieldtype": "Select", + "label": "Delivery Note Required", + "options": "No\nYes", + "permlevel": 0 + }, + { + "fieldname": "maintain_same_sales_rate", + "fieldtype": "Check", + "label": "Maintain Same Rate Throughout Sales Cycle", + "permlevel": 0 + }, + { + "fieldname": "editable_price_list_rate", + "fieldtype": "Check", + "label": "Allow user to edit Price List Rate in transactions", + "permlevel": 0 + } + ], + "icon": "icon-cog", + "idx": 1, + "issingle": 1, + "modified": "2014-02-19 18:35:36", + "modified_by": "Administrator", + "module": "Selling", + "name": "Selling Settings", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "role": "System Manager", + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/selling/doctype/sms_center/sms_center.txt b/erpnext/selling/doctype/sms_center/sms_center.txt index efa7a45551..98e630d792 100644 --- a/erpnext/selling/doctype/sms_center/sms_center.txt +++ b/erpnext/selling/doctype/sms_center/sms_center.txt @@ -1,148 +1,129 @@ -[ - { - "creation": "2013-01-10 16:34:22", - "docstatus": 0, - "modified": "2014-01-30 15:29:04", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_attach": 0, - "allow_copy": 1, - "doctype": "DocType", - "hide_heading": 0, - "hide_toolbar": 0, - "icon": "icon-mobile-phone", - "in_create": 0, - "issingle": 1, - "module": "Selling", - "name": "__common__", - "read_only": 1 - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "SMS Center", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "cancel": 0, - "create": 1, - "delete": 0, - "doctype": "DocPerm", - "export": 0, - "import": 0, - "name": "__common__", - "parent": "SMS Center", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "read": 1, - "report": 0, - "role": "System Manager", - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "SMS Center" - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "send_to", - "fieldtype": "Select", - "label": "Send To", - "options": "\nAll Contact\nAll Customer Contact\nAll Supplier Contact\nAll Sales Partner Contact\nAll Lead (Open)\nAll Employee (Active)\nAll Sales Person" - }, - { - "depends_on": "eval:doc.send_to=='All Customer Contact'", - "doctype": "DocField", - "fieldname": "customer", - "fieldtype": "Link", - "label": "Customer", - "options": "Customer" - }, - { - "depends_on": "eval:doc.send_to=='All Supplier Contact'", - "doctype": "DocField", - "fieldname": "supplier", - "fieldtype": "Link", - "label": "Supplier", - "options": "Supplier" - }, - { - "depends_on": "eval:doc.send_to=='All Employee (Active)'", - "doctype": "DocField", - "fieldname": "department", - "fieldtype": "Select", - "label": "Department", - "options": "link:Department" - }, - { - "depends_on": "eval:doc.send_to=='All Employee (Active)'", - "doctype": "DocField", - "fieldname": "branch", - "fieldtype": "Select", - "label": "Branch", - "options": "link:Branch" - }, - { - "doctype": "DocField", - "fieldname": "create_receiver_list", - "fieldtype": "Button", - "label": "Create Receiver List", - "options": "create_receiver_list" - }, - { - "doctype": "DocField", - "fieldname": "receiver_list", - "fieldtype": "Code", - "label": "Receiver List" - }, - { - "doctype": "DocField", - "fieldname": "column_break9", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "description": "Messages greater than 160 characters will be split into multiple messages", - "doctype": "DocField", - "fieldname": "message", - "fieldtype": "Text", - "label": "Message", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "total_words", - "fieldtype": "Int", - "label": "Total Words", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "total_messages", - "fieldtype": "Int", - "label": "Total Message(s)", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "send_sms", - "fieldtype": "Button", - "label": "Send SMS", - "options": "send_sms" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "allow_attach": 0, + "allow_copy": 1, + "creation": "2013-01-10 16:34:22", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "send_to", + "fieldtype": "Select", + "label": "Send To", + "options": "\nAll Contact\nAll Customer Contact\nAll Supplier Contact\nAll Sales Partner Contact\nAll Lead (Open)\nAll Employee (Active)\nAll Sales Person", + "permlevel": 0 + }, + { + "depends_on": "eval:doc.send_to=='All Customer Contact'", + "fieldname": "customer", + "fieldtype": "Link", + "label": "Customer", + "options": "Customer", + "permlevel": 0 + }, + { + "depends_on": "eval:doc.send_to=='All Supplier Contact'", + "fieldname": "supplier", + "fieldtype": "Link", + "label": "Supplier", + "options": "Supplier", + "permlevel": 0 + }, + { + "depends_on": "eval:doc.send_to=='All Employee (Active)'", + "fieldname": "department", + "fieldtype": "Select", + "label": "Department", + "options": "link:Department", + "permlevel": 0 + }, + { + "depends_on": "eval:doc.send_to=='All Employee (Active)'", + "fieldname": "branch", + "fieldtype": "Select", + "label": "Branch", + "options": "link:Branch", + "permlevel": 0 + }, + { + "fieldname": "create_receiver_list", + "fieldtype": "Button", + "label": "Create Receiver List", + "options": "create_receiver_list", + "permlevel": 0 + }, + { + "fieldname": "receiver_list", + "fieldtype": "Code", + "label": "Receiver List", + "permlevel": 0 + }, + { + "fieldname": "column_break9", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "description": "Messages greater than 160 characters will be split into multiple messages", + "fieldname": "message", + "fieldtype": "Text", + "label": "Message", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "total_words", + "fieldtype": "Int", + "label": "Total Words", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "total_messages", + "fieldtype": "Int", + "label": "Total Message(s)", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "send_sms", + "fieldtype": "Button", + "label": "Send SMS", + "options": "send_sms", + "permlevel": 0 + } + ], + "hide_heading": 0, + "hide_toolbar": 0, + "icon": "icon-mobile-phone", + "idx": 1, + "in_create": 0, + "issingle": 1, + "modified": "2014-01-30 15:29:04", + "modified_by": "Administrator", + "module": "Selling", + "name": "SMS Center", + "owner": "Administrator", + "permissions": [ + { + "cancel": 0, + "create": 1, + "delete": 0, + "export": 0, + "import": 0, + "permlevel": 0, + "read": 1, + "report": 0, + "role": "System Manager", + "submit": 0, + "write": 1 + } + ], + "read_only": 1 +} \ No newline at end of file diff --git a/erpnext/selling/page/sales_analytics/sales_analytics.txt b/erpnext/selling/page/sales_analytics/sales_analytics.txt index 8753be6b28..113d4326f4 100644 --- a/erpnext/selling/page/sales_analytics/sales_analytics.txt +++ b/erpnext/selling/page/sales_analytics/sales_analytics.txt @@ -1,41 +1,26 @@ -[ - { - "creation": "2012-09-21 20:15:12", - "docstatus": 0, - "modified": "2013-07-11 14:43:59", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Page", - "icon": "icon-bar-chart", - "module": "Selling", - "name": "__common__", - "page_name": "sales-analytics", - "standard": "Yes", - "title": "Sales Analytics" - }, - { - "doctype": "Page Role", - "name": "__common__", - "parent": "sales-analytics", - "parentfield": "roles", - "parenttype": "Page" - }, - { - "doctype": "Page", - "name": "sales-analytics" - }, - { - "doctype": "Page Role", - "role": "Analytics" - }, - { - "doctype": "Page Role", - "role": "Sales Manager" - }, - { - "doctype": "Page Role", - "role": "Maintenance Manager" - } -] \ No newline at end of file +{ + "creation": "2012-09-21 20:15:12", + "docstatus": 0, + "doctype": "Page", + "icon": "icon-bar-chart", + "idx": 1, + "modified": "2013-07-11 14:43:59", + "modified_by": "Administrator", + "module": "Selling", + "name": "sales-analytics", + "owner": "Administrator", + "page_name": "sales-analytics", + "roles": [ + { + "role": "Analytics" + }, + { + "role": "Sales Manager" + }, + { + "role": "Maintenance Manager" + } + ], + "standard": "Yes", + "title": "Sales Analytics" +} \ No newline at end of file diff --git a/erpnext/selling/page/sales_browser/sales_browser.txt b/erpnext/selling/page/sales_browser/sales_browser.txt index 5a047e27de..d950d90598 100644 --- a/erpnext/selling/page/sales_browser/sales_browser.txt +++ b/erpnext/selling/page/sales_browser/sales_browser.txt @@ -1,56 +1,37 @@ -[ - { - "creation": "2012-06-14 15:07:26", - "docstatus": 0, - "modified": "2013-07-11 14:43:56", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Page", - "icon": "icon-sitemap", - "module": "Selling", - "name": "__common__", - "page_name": "Sales Browser", - "standard": "Yes" - }, - { - "doctype": "Page Role", - "name": "__common__", - "parent": "Sales Browser", - "parentfield": "roles", - "parenttype": "Page" - }, - { - "doctype": "Page", - "name": "Sales Browser" - }, - { - "doctype": "Page Role", - "role": "Sales Master Manager" - }, - { - "doctype": "Page Role", - "role": "Material Master Manager" - }, - { - "doctype": "Page Role", - "role": "Accounts Manager" - }, - { - "doctype": "Page Role", - "role": "Sales Master Manager" - }, - { - "doctype": "Page Role", - "role": "Purchase Manager" - }, - { - "doctype": "Page Role", - "role": "Purchase Master Manager" - }, - { - "doctype": "Page Role", - "role": "Material Manager" - } -] \ No newline at end of file +{ + "creation": "2012-06-14 15:07:26", + "docstatus": 0, + "doctype": "Page", + "icon": "icon-sitemap", + "idx": 1, + "modified": "2013-07-11 14:43:56", + "modified_by": "Administrator", + "module": "Selling", + "name": "Sales Browser", + "owner": "Administrator", + "page_name": "Sales Browser", + "roles": [ + { + "role": "Sales Master Manager" + }, + { + "role": "Material Master Manager" + }, + { + "role": "Accounts Manager" + }, + { + "role": "Sales Master Manager" + }, + { + "role": "Purchase Manager" + }, + { + "role": "Purchase Master Manager" + }, + { + "role": "Material Manager" + } + ], + "standard": "Yes" +} \ No newline at end of file diff --git a/erpnext/selling/page/sales_funnel/sales_funnel.txt b/erpnext/selling/page/sales_funnel/sales_funnel.txt index b841f20fdc..2e61c0e8ca 100644 --- a/erpnext/selling/page/sales_funnel/sales_funnel.txt +++ b/erpnext/selling/page/sales_funnel/sales_funnel.txt @@ -1,33 +1,20 @@ -[ - { - "creation": "2013-10-04 13:17:18", - "docstatus": 0, - "modified": "2013-10-04 13:17:18", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Page", - "icon": "icon-filter", - "module": "Selling", - "name": "__common__", - "page_name": "sales-funnel", - "standard": "Yes", - "title": "Sales Funnel" - }, - { - "doctype": "Page Role", - "name": "__common__", - "parent": "sales-funnel", - "parentfield": "roles", - "parenttype": "Page", - "role": "Sales Manager" - }, - { - "doctype": "Page", - "name": "sales-funnel" - }, - { - "doctype": "Page Role" - } -] \ No newline at end of file +{ + "creation": "2013-10-04 13:17:18", + "docstatus": 0, + "doctype": "Page", + "icon": "icon-filter", + "idx": 1, + "modified": "2013-10-04 13:17:18", + "modified_by": "Administrator", + "module": "Selling", + "name": "sales-funnel", + "owner": "Administrator", + "page_name": "sales-funnel", + "roles": [ + { + "role": "Sales Manager" + } + ], + "standard": "Yes", + "title": "Sales Funnel" +} \ No newline at end of file diff --git a/erpnext/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.txt b/erpnext/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.txt index 6655caad59..c81e8d3778 100644 --- a/erpnext/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.txt +++ b/erpnext/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-06-21 13:40:05", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Report", - "is_standard": "Yes", - "module": "Selling", - "name": "__common__", - "ref_doctype": "Sales BOM", - "report_name": "Available Stock for Packing Items", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Available Stock for Packing Items" - } -] \ No newline at end of file +{ + "creation": "2013-06-21 13:40:05", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Selling", + "name": "Available Stock for Packing Items", + "owner": "Administrator", + "ref_doctype": "Sales BOM", + "report_name": "Available Stock for Packing Items", + "report_type": "Script Report" +} \ No newline at end of file diff --git a/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.txt b/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.txt index 98ef3a9639..6805f90005 100644 --- a/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.txt +++ b/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.txt @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-11-28 14:58:06", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "add_total_row": 1, - "doctype": "Report", - "is_standard": "Yes", - "module": "Selling", - "name": "__common__", - "ref_doctype": "Customer", - "report_name": "Customer Acquisition and Loyalty", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Customer Acquisition and Loyalty" - } -] \ No newline at end of file +{ + "add_total_row": 1, + "creation": "2013-11-28 14:58:06", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Selling", + "name": "Customer Acquisition and Loyalty", + "owner": "Administrator", + "ref_doctype": "Customer", + "report_name": "Customer Acquisition and Loyalty", + "report_type": "Script Report" +} \ No newline at end of file diff --git a/erpnext/selling/report/customer_addresses_and_contacts/customer_addresses_and_contacts.txt b/erpnext/selling/report/customer_addresses_and_contacts/customer_addresses_and_contacts.txt index fbe5b77052..a2805c5257 100644 --- a/erpnext/selling/report/customer_addresses_and_contacts/customer_addresses_and_contacts.txt +++ b/erpnext/selling/report/customer_addresses_and_contacts/customer_addresses_and_contacts.txt @@ -1,23 +1,16 @@ -[ - { - "creation": "2012-10-04 18:45:27", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Report", - "is_standard": "Yes", - "module": "Selling", - "name": "__common__", - "query": "SELECT\n\t`tabCustomer`.name as customer_id,\n\t`tabCustomer`.customer_name,\n\t`tabCustomer`.customer_group,\n\t`tabAddress`.address_line1,\n\t`tabAddress`.address_line2,\n\t`tabAddress`.city,\n\t`tabAddress`.state,\n\t`tabAddress`.pincode,\n\t`tabAddress`.country,\n\t`tabAddress`.is_primary_address, \n\t`tabContact`.first_name,\n\t`tabContact`.last_name,\n\t`tabContact`.phone,\n\t`tabContact`.mobile_no,\n\t`tabContact`.email_id,\n\t`tabContact`.is_primary_contact\nFROM\n\t`tabCustomer`\n\tleft join `tabAddress` on (\n\t\t`tabAddress`.customer=`tabCustomer`.name\n\t)\n\tleft join `tabContact` on (\n\t\t`tabContact`.customer=`tabCustomer`.name\n\t)\nWHERE\n\t`tabCustomer`.docstatus<2\nORDER BY\n\t`tabCustomer`.name asc", - "ref_doctype": "Customer", - "report_name": "Customer Addresses And Contacts", - "report_type": "Query Report" - }, - { - "doctype": "Report", - "name": "Customer Addresses And Contacts" - } -] \ No newline at end of file +{ + "creation": "2012-10-04 18:45:27", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Selling", + "name": "Customer Addresses And Contacts", + "owner": "Administrator", + "query": "SELECT\n\t`tabCustomer`.name as customer_id,\n\t`tabCustomer`.customer_name,\n\t`tabCustomer`.customer_group,\n\t`tabAddress`.address_line1,\n\t`tabAddress`.address_line2,\n\t`tabAddress`.city,\n\t`tabAddress`.state,\n\t`tabAddress`.pincode,\n\t`tabAddress`.country,\n\t`tabAddress`.is_primary_address, \n\t`tabContact`.first_name,\n\t`tabContact`.last_name,\n\t`tabContact`.phone,\n\t`tabContact`.mobile_no,\n\t`tabContact`.email_id,\n\t`tabContact`.is_primary_contact\nFROM\n\t`tabCustomer`\n\tleft join `tabAddress` on (\n\t\t`tabAddress`.customer=`tabCustomer`.name\n\t)\n\tleft join `tabContact` on (\n\t\t`tabContact`.customer=`tabCustomer`.name\n\t)\nWHERE\n\t`tabCustomer`.docstatus<2\nORDER BY\n\t`tabCustomer`.name asc", + "ref_doctype": "Customer", + "report_name": "Customer Addresses And Contacts", + "report_type": "Query Report" +} \ No newline at end of file diff --git a/erpnext/selling/report/customers_not_buying_since_long_time/customers_not_buying_since_long_time.txt b/erpnext/selling/report/customers_not_buying_since_long_time/customers_not_buying_since_long_time.txt index 54ea37ebcd..62d523c0b9 100644 --- a/erpnext/selling/report/customers_not_buying_since_long_time/customers_not_buying_since_long_time.txt +++ b/erpnext/selling/report/customers_not_buying_since_long_time/customers_not_buying_since_long_time.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-06-07 12:27:07", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Report", - "is_standard": "Yes", - "module": "Selling", - "name": "__common__", - "ref_doctype": "Sales Order", - "report_name": "Customers Not Buying Since Long Time ", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Customers Not Buying Since Long Time" - } -] \ No newline at end of file +{ + "creation": "2013-06-07 12:27:07", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Selling", + "name": "Customers Not Buying Since Long Time", + "owner": "Administrator", + "ref_doctype": "Sales Order", + "report_name": "Customers Not Buying Since Long Time ", + "report_type": "Script Report" +} \ No newline at end of file diff --git a/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.txt b/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.txt index d03ca924c1..0e4551bad3 100644 --- a/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.txt +++ b/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.txt @@ -1,25 +1,18 @@ -[ - { - "creation": "2013-05-23 17:42:24", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "add_total_row": 1, - "disabled": 0, - "doctype": "Report", - "is_standard": "Yes", - "module": "Selling", - "name": "__common__", - "query": "select\n so_item.item_code as \"Item Code:Link/Item:120\",\n\tso_item.item_name as \"Item Name::120\",\n\tso_item.description as \"Description::150\",\n\tso_item.qty as \"Qty:Float:100\",\n\tso_item.stock_uom as \"UOM:Link/UOM:80\",\n\tso_item.base_rate as \"Rate:Currency:120\",\n\tso_item.base_amount as \"Amount:Currency:120\",\n\tso.name as \"Sales Order:Link/Sales Order:120\",\n\tso.transaction_date as \"Transaction Date:Date:140\",\n\tso.customer as \"Customer:Link/Customer:130\",\n\tso.territory as \"Territory:Link/Territory:130\",\n so.project_name as \"Project:Link/Project:130\",\n\tifnull(so_item.delivered_qty, 0) as \"Delivered Qty:Float:120\",\n\tifnull(so_item.billed_amt, 0) as \"Billed Amount:Currency:120\"\nfrom\n\t`tabSales Order` so, `tabSales Order Item` so_item\nwhere\n\tso.name = so_item.parent\n\tand so.docstatus = 1\norder by so.name desc", - "ref_doctype": "Sales Order", - "report_name": "Item-wise Sales History", - "report_type": "Query Report" - }, - { - "doctype": "Report", - "name": "Item-wise Sales History" - } -] \ No newline at end of file +{ + "add_total_row": 1, + "creation": "2013-05-23 17:42:24", + "disabled": 0, + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Selling", + "name": "Item-wise Sales History", + "owner": "Administrator", + "query": "select\n so_item.item_code as \"Item Code:Link/Item:120\",\n\tso_item.item_name as \"Item Name::120\",\n\tso_item.description as \"Description::150\",\n\tso_item.qty as \"Qty:Float:100\",\n\tso_item.stock_uom as \"UOM:Link/UOM:80\",\n\tso_item.base_rate as \"Rate:Currency:120\",\n\tso_item.base_amount as \"Amount:Currency:120\",\n\tso.name as \"Sales Order:Link/Sales Order:120\",\n\tso.transaction_date as \"Transaction Date:Date:140\",\n\tso.customer as \"Customer:Link/Customer:130\",\n\tso.territory as \"Territory:Link/Territory:130\",\n so.project_name as \"Project:Link/Project:130\",\n\tifnull(so_item.delivered_qty, 0) as \"Delivered Qty:Float:120\",\n\tifnull(so_item.billed_amt, 0) as \"Billed Amount:Currency:120\"\nfrom\n\t`tabSales Order` so, `tabSales Order Item` so_item\nwhere\n\tso.name = so_item.parent\n\tand so.docstatus = 1\norder by so.name desc", + "ref_doctype": "Sales Order", + "report_name": "Item-wise Sales History", + "report_type": "Query Report" +} \ No newline at end of file diff --git a/erpnext/selling/report/lead_details/lead_details.txt b/erpnext/selling/report/lead_details/lead_details.txt index 8c9f170171..4c1021f7d8 100644 --- a/erpnext/selling/report/lead_details/lead_details.txt +++ b/erpnext/selling/report/lead_details/lead_details.txt @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-10-22 11:58:16", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Report", - "is_standard": "Yes", - "module": "Selling", - "name": "__common__", - "query": "SELECT\n `tabLead`.name as \"Lead Id:Link/Lead:120\",\n `tabLead`.lead_name as \"Lead Name::120\",\n\t`tabLead`.company_name as \"Company Name::120\",\n\t`tabLead`.status as \"Status::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\t`tabLead`.phone as \"Phone::100\",\n\t`tabLead`.mobile_no as \"Mobile No::100\",\n\t`tabLead`.email_id as \"Email Id::120\",\n\t`tabLead`.lead_owner as \"Lead Owner::120\",\n\t`tabLead`.source as \"Source::120\",\n\t`tabLead`.territory as \"Territory::120\",\n `tabLead`.owner as \"Owner:Link/User:120\"\nFROM\n\t`tabLead`\n\tleft join `tabAddress` on (\n\t\t`tabAddress`.lead=`tabLead`.name\n\t)\nWHERE\n\t`tabLead`.docstatus<2\nORDER BY\n\t`tabLead`.name asc", - "ref_doctype": "Lead", - "report_name": "Lead Details", - "report_type": "Query Report" - }, - { - "doctype": "Report", - "name": "Lead Details" - } -] \ No newline at end of file +{ + "creation": "2013-10-22 11:58:16", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Selling", + "name": "Lead Details", + "owner": "Administrator", + "query": "SELECT\n `tabLead`.name as \"Lead Id:Link/Lead:120\",\n `tabLead`.lead_name as \"Lead Name::120\",\n\t`tabLead`.company_name as \"Company Name::120\",\n\t`tabLead`.status as \"Status::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\t`tabLead`.phone as \"Phone::100\",\n\t`tabLead`.mobile_no as \"Mobile No::100\",\n\t`tabLead`.email_id as \"Email Id::120\",\n\t`tabLead`.lead_owner as \"Lead Owner::120\",\n\t`tabLead`.source as \"Source::120\",\n\t`tabLead`.territory as \"Territory::120\",\n `tabLead`.owner as \"Owner:Link/User:120\"\nFROM\n\t`tabLead`\n\tleft join `tabAddress` on (\n\t\t`tabAddress`.lead=`tabLead`.name\n\t)\nWHERE\n\t`tabLead`.docstatus<2\nORDER BY\n\t`tabLead`.name asc", + "ref_doctype": "Lead", + "report_name": "Lead Details", + "report_type": "Query Report" +} \ No newline at end of file diff --git a/erpnext/selling/report/pending_so_items_for_purchase_request/pending_so_items_for_purchase_request.txt b/erpnext/selling/report/pending_so_items_for_purchase_request/pending_so_items_for_purchase_request.txt index 07b524b4f9..1c84245a7b 100644 --- a/erpnext/selling/report/pending_so_items_for_purchase_request/pending_so_items_for_purchase_request.txt +++ b/erpnext/selling/report/pending_so_items_for_purchase_request/pending_so_items_for_purchase_request.txt @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-06-21 16:46:45", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Report", - "is_standard": "Yes", - "module": "Selling", - "name": "__common__", - "query": "select \n so_item.item_code as \"Item Code:Link/Item:120\",\n so_item.item_name as \"Item Name::120\",\n so_item.description as \"Description::120\",\n so.`name` as \"S.O. No.:Link/Sales Order:120\",\n so.`transaction_date` as \"Date:Date:120\",\n mr.name as \"Material Request:Link/Material Request:120\",\n so.customer as \"Customer:Link/Customer:120\",\n so.territory as \"Terretory:Link/Territory:120\",\n sum(so_item.qty) as \"SO Qty:Float:100 \",\n sum(mr_item.qty) as \"Requested Qty:Float:100\"\nfrom\n `tabSales Order` so, `tabSales Order Item` so_item, \n `tabMaterial Request` mr, `tabMaterial Request Item` mr_item\nwhere\n so_item.`parent` = so.`name` and mr_item.sales_order_no = so.name\n and mr_item.parent = mr.name \n and so.docstatus = 1 and so.status != \"Stopped\" \n and mr.docstatus = 1 and mr.status != \"Stopped\"\ngroup by so.name, so_item.item_code\norder by so.name desc, so_item.item_code asc", - "ref_doctype": "Sales Order", - "report_name": "Pending SO Items For Purchase Request", - "report_type": "Query Report" - }, - { - "doctype": "Report", - "name": "Pending SO Items For Purchase Request" - } -] \ No newline at end of file +{ + "creation": "2013-06-21 16:46:45", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Selling", + "name": "Pending SO Items For Purchase Request", + "owner": "Administrator", + "query": "select \n so_item.item_code as \"Item Code:Link/Item:120\",\n so_item.item_name as \"Item Name::120\",\n so_item.description as \"Description::120\",\n so.`name` as \"S.O. No.:Link/Sales Order:120\",\n so.`transaction_date` as \"Date:Date:120\",\n mr.name as \"Material Request:Link/Material Request:120\",\n so.customer as \"Customer:Link/Customer:120\",\n so.territory as \"Terretory:Link/Territory:120\",\n sum(so_item.qty) as \"SO Qty:Float:100 \",\n sum(mr_item.qty) as \"Requested Qty:Float:100\"\nfrom\n `tabSales Order` so, `tabSales Order Item` so_item, \n `tabMaterial Request` mr, `tabMaterial Request Item` mr_item\nwhere\n so_item.`parent` = so.`name` and mr_item.sales_order_no = so.name\n and mr_item.parent = mr.name \n and so.docstatus = 1 and so.status != \"Stopped\" \n and mr.docstatus = 1 and mr.status != \"Stopped\"\ngroup by so.name, so_item.item_code\norder by so.name desc, so_item.item_code asc", + "ref_doctype": "Sales Order", + "report_name": "Pending SO Items For Purchase Request", + "report_type": "Query Report" +} \ No newline at end of file diff --git a/erpnext/selling/report/quotation_trends/quotation_trends.txt b/erpnext/selling/report/quotation_trends/quotation_trends.txt index 5db150f380..0a1ca8a6bc 100644 --- a/erpnext/selling/report/quotation_trends/quotation_trends.txt +++ b/erpnext/selling/report/quotation_trends/quotation_trends.txt @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-06-07 16:01:16", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "add_total_row": 0, - "doctype": "Report", - "is_standard": "Yes", - "module": "Selling", - "name": "__common__", - "ref_doctype": "Quotation", - "report_name": "Quotation Trends", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Quotation Trends" - } -] \ No newline at end of file +{ + "add_total_row": 0, + "creation": "2013-06-07 16:01:16", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Selling", + "name": "Quotation Trends", + "owner": "Administrator", + "ref_doctype": "Quotation", + "report_name": "Quotation Trends", + "report_type": "Script Report" +} \ No newline at end of file diff --git a/erpnext/selling/report/sales_order_trends/sales_order_trends.txt b/erpnext/selling/report/sales_order_trends/sales_order_trends.txt index 6ac7595d0f..9624889dbb 100644 --- a/erpnext/selling/report/sales_order_trends/sales_order_trends.txt +++ b/erpnext/selling/report/sales_order_trends/sales_order_trends.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-06-13 18:43:30", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Report", - "is_standard": "Yes", - "module": "Selling", - "name": "__common__", - "ref_doctype": "Sales Order", - "report_name": "Sales Order Trends", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Sales Order Trends" - } -] \ No newline at end of file +{ + "creation": "2013-06-13 18:43:30", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Selling", + "name": "Sales Order Trends", + "owner": "Administrator", + "ref_doctype": "Sales Order", + "report_name": "Sales Order Trends", + "report_type": "Script Report" +} \ No newline at end of file diff --git a/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.txt b/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.txt index 56674e1046..ed1f64e5b6 100644 --- a/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.txt +++ b/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-06-21 12:14:15", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Report", - "is_standard": "Yes", - "module": "Selling", - "name": "__common__", - "ref_doctype": "Sales Order", - "report_name": "Sales Person Target Variance Item Group-Wise", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Sales Person Target Variance Item Group-Wise" - } -] \ No newline at end of file +{ + "creation": "2013-06-21 12:14:15", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Selling", + "name": "Sales Person Target Variance Item Group-Wise", + "owner": "Administrator", + "ref_doctype": "Sales Order", + "report_name": "Sales Person Target Variance Item Group-Wise", + "report_type": "Script Report" +} \ No newline at end of file diff --git a/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.txt b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.txt index b1334c68be..3b1b3f28e3 100644 --- a/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.txt +++ b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.txt @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-05-03 11:31:05", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "add_total_row": 1, - "doctype": "Report", - "is_standard": "Yes", - "module": "Selling", - "name": "__common__", - "ref_doctype": "Sales Order", - "report_name": "Sales Person-wise Transaction Summary", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Sales Person-wise Transaction Summary" - } -] \ No newline at end of file +{ + "add_total_row": 1, + "creation": "2013-05-03 11:31:05", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Selling", + "name": "Sales Person-wise Transaction Summary", + "owner": "Administrator", + "ref_doctype": "Sales Order", + "report_name": "Sales Person-wise Transaction Summary", + "report_type": "Script Report" +} \ No newline at end of file diff --git a/erpnext/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.txt b/erpnext/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.txt index 5bce0073e4..321a5feb03 100644 --- a/erpnext/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.txt +++ b/erpnext/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-06-21 12:15:00", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Report", - "is_standard": "Yes", - "module": "Selling", - "name": "__common__", - "ref_doctype": "Sales Order", - "report_name": "Territory Target Variance Item Group-Wise", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Territory Target Variance Item Group-Wise" - } -] \ No newline at end of file +{ + "creation": "2013-06-21 12:15:00", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Selling", + "name": "Territory Target Variance Item Group-Wise", + "owner": "Administrator", + "ref_doctype": "Sales Order", + "report_name": "Territory Target Variance Item Group-Wise", + "report_type": "Script Report" +} \ No newline at end of file diff --git a/erpnext/setup/doctype/applicable_territory/applicable_territory.txt b/erpnext/setup/doctype/applicable_territory/applicable_territory.txt index 3a5b0f351b..572015c43d 100644 --- a/erpnext/setup/doctype/applicable_territory/applicable_territory.txt +++ b/erpnext/setup/doctype/applicable_territory/applicable_territory.txt @@ -1,37 +1,24 @@ -[ - { - "creation": "2013-06-20 12:48:38", - "docstatus": 0, - "modified": "2013-12-20 19:22:53", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "istable": 1, - "module": "Setup", - "name": "__common__" - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "territory", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Territory", - "name": "__common__", - "options": "Territory", - "parent": "Applicable Territory", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0, - "reqd": 1 - }, - { - "doctype": "DocType", - "name": "Applicable Territory" - }, - { - "doctype": "DocField" - } -] \ No newline at end of file +{ + "creation": "2013-06-20 12:48:38", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "description": "Add / Edit", + "fieldname": "territory", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Territory", + "options": "Territory", + "permlevel": 0, + "reqd": 1 + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:22:53", + "modified_by": "Administrator", + "module": "Setup", + "name": "Applicable Territory", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/setup/doctype/authorization_control/authorization_control.txt b/erpnext/setup/doctype/authorization_control/authorization_control.txt index c5628d23dd..66db33a91f 100644 --- a/erpnext/setup/doctype/authorization_control/authorization_control.txt +++ b/erpnext/setup/doctype/authorization_control/authorization_control.txt @@ -1,19 +1,12 @@ -[ - { - "creation": "2012-03-27 14:36:18", - "docstatus": 0, - "modified": "2013-12-20 19:22:54", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "issingle": 1, - "module": "Setup", - "name": "__common__" - }, - { - "doctype": "DocType", - "name": "Authorization Control" - } -] \ No newline at end of file +{ + "creation": "2012-03-27 14:36:18", + "docstatus": 0, + "doctype": "DocType", + "idx": 1, + "issingle": 1, + "modified": "2013-12-20 19:22:54", + "modified_by": "Administrator", + "module": "Setup", + "name": "Authorization Control", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/setup/doctype/authorization_rule/authorization_rule.txt b/erpnext/setup/doctype/authorization_rule/authorization_rule.txt index bd852d0b8e..5d88cb68ff 100644 --- a/erpnext/setup/doctype/authorization_rule/authorization_rule.txt +++ b/erpnext/setup/doctype/authorization_rule/authorization_rule.txt @@ -1,166 +1,147 @@ -[ - { - "creation": "2013-01-10 16:34:22", - "docstatus": 0, - "modified": "2014-01-20 17:48:25", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "autoname": "AR.####", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-shield", - "module": "Setup", - "name": "__common__", - "search_fields": "transaction,based_on,system_user,system_role,approving_user,approving_role" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Authorization Rule", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "cancel": 0, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Authorization Rule", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "System Manager", - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Authorization Rule" - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "label": "Company", - "oldfieldname": "company", - "oldfieldtype": "Link", - "options": "Company", - "reqd": 0, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "transaction", - "fieldtype": "Select", - "label": "Transaction", - "oldfieldname": "transaction", - "oldfieldtype": "Select", - "options": "\nDelivery Note\nPurchase Invoice\nPurchase Order\nPurchase Receipt\nQuotation\nSales Invoice\nSales Order\nAppraisal", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "based_on", - "fieldtype": "Select", - "label": "Based On", - "oldfieldname": "based_on", - "oldfieldtype": "Select", - "options": "\nGrand Total\nAverage Discount\nCustomerwise Discount\nItemwise Discount\nNot Applicable", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "master_name", - "fieldtype": "Link", - "label": "Customer / Item Name", - "oldfieldname": "master_name", - "oldfieldtype": "Link", - "options": "[Select]" - }, - { - "doctype": "DocField", - "fieldname": "system_role", - "fieldtype": "Link", - "label": "Applicable To (Role)", - "oldfieldname": "system_role", - "oldfieldtype": "Link", - "options": "Role" - }, - { - "doctype": "DocField", - "fieldname": "system_user", - "fieldtype": "Link", - "label": "Applicable To (User)", - "oldfieldname": "system_user", - "oldfieldtype": "Link", - "options": "User" - }, - { - "description": "This will be used for setting rule in HR module", - "doctype": "DocField", - "fieldname": "to_emp", - "fieldtype": "Link", - "label": "Applicable To (Employee)", - "oldfieldname": "to_emp", - "oldfieldtype": "Link", - "options": "Employee", - "search_index": 0 - }, - { - "description": "This will be used for setting rule in HR module", - "doctype": "DocField", - "fieldname": "to_designation", - "fieldtype": "Link", - "label": "Applicable To (Designation)", - "oldfieldname": "to_designation", - "oldfieldtype": "Link", - "options": "Designation", - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "approving_role", - "fieldtype": "Link", - "label": "Approving Role", - "oldfieldname": "approving_role", - "oldfieldtype": "Link", - "options": "Role" - }, - { - "doctype": "DocField", - "fieldname": "approving_user", - "fieldtype": "Link", - "label": "Approving User", - "oldfieldname": "approving_user", - "oldfieldtype": "Link", - "options": "User" - }, - { - "doctype": "DocField", - "fieldname": "value", - "fieldtype": "Float", - "label": "Above Value", - "oldfieldname": "value", - "oldfieldtype": "Currency" - }, - { - "doctype": "DocField", - "fieldname": "trash_reason", - "fieldtype": "Small Text", - "label": "Trash Reason", - "oldfieldname": "trash_reason", - "oldfieldtype": "Small Text" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "allow_import": 1, + "autoname": "AR.####", + "creation": "2013-01-10 16:34:22", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "company", + "fieldtype": "Link", + "label": "Company", + "oldfieldname": "company", + "oldfieldtype": "Link", + "options": "Company", + "permlevel": 0, + "reqd": 0, + "search_index": 0 + }, + { + "fieldname": "transaction", + "fieldtype": "Select", + "label": "Transaction", + "oldfieldname": "transaction", + "oldfieldtype": "Select", + "options": "\nDelivery Note\nPurchase Invoice\nPurchase Order\nPurchase Receipt\nQuotation\nSales Invoice\nSales Order\nAppraisal", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "based_on", + "fieldtype": "Select", + "label": "Based On", + "oldfieldname": "based_on", + "oldfieldtype": "Select", + "options": "\nGrand Total\nAverage Discount\nCustomerwise Discount\nItemwise Discount\nNot Applicable", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "master_name", + "fieldtype": "Link", + "label": "Customer / Item Name", + "oldfieldname": "master_name", + "oldfieldtype": "Link", + "options": "[Select]", + "permlevel": 0 + }, + { + "fieldname": "system_role", + "fieldtype": "Link", + "label": "Applicable To (Role)", + "oldfieldname": "system_role", + "oldfieldtype": "Link", + "options": "Role", + "permlevel": 0 + }, + { + "fieldname": "system_user", + "fieldtype": "Link", + "label": "Applicable To (User)", + "oldfieldname": "system_user", + "oldfieldtype": "Link", + "options": "User", + "permlevel": 0 + }, + { + "description": "This will be used for setting rule in HR module", + "fieldname": "to_emp", + "fieldtype": "Link", + "label": "Applicable To (Employee)", + "oldfieldname": "to_emp", + "oldfieldtype": "Link", + "options": "Employee", + "permlevel": 0, + "search_index": 0 + }, + { + "description": "This will be used for setting rule in HR module", + "fieldname": "to_designation", + "fieldtype": "Link", + "label": "Applicable To (Designation)", + "oldfieldname": "to_designation", + "oldfieldtype": "Link", + "options": "Designation", + "permlevel": 0, + "search_index": 0 + }, + { + "fieldname": "approving_role", + "fieldtype": "Link", + "label": "Approving Role", + "oldfieldname": "approving_role", + "oldfieldtype": "Link", + "options": "Role", + "permlevel": 0 + }, + { + "fieldname": "approving_user", + "fieldtype": "Link", + "label": "Approving User", + "oldfieldname": "approving_user", + "oldfieldtype": "Link", + "options": "User", + "permlevel": 0 + }, + { + "fieldname": "value", + "fieldtype": "Float", + "label": "Above Value", + "oldfieldname": "value", + "oldfieldtype": "Currency", + "permlevel": 0 + }, + { + "fieldname": "trash_reason", + "fieldtype": "Small Text", + "label": "Trash Reason", + "oldfieldname": "trash_reason", + "oldfieldtype": "Small Text", + "permlevel": 0 + } + ], + "icon": "icon-shield", + "idx": 1, + "modified": "2014-01-20 17:48:25", + "modified_by": "Administrator", + "module": "Setup", + "name": "Authorization Rule", + "owner": "Administrator", + "permissions": [ + { + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "submit": 0, + "write": 1 + } + ], + "search_fields": "transaction,based_on,system_user,system_role,approving_user,approving_role" +} \ No newline at end of file diff --git a/erpnext/setup/doctype/backup_manager/backup_manager.txt b/erpnext/setup/doctype/backup_manager/backup_manager.txt index 259bf378dd..ddb7096de1 100644 --- a/erpnext/setup/doctype/backup_manager/backup_manager.txt +++ b/erpnext/setup/doctype/backup_manager/backup_manager.txt @@ -1,178 +1,159 @@ -[ - { - "creation": "2013-04-30 12:58:38", - "docstatus": 0, - "modified": "2013-12-20 19:22:55", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "description": "System for managing Backups", - "doctype": "DocType", - "document_type": "System", - "icon": "icon-cloud-upload", - "issingle": 1, - "module": "Setup", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Backup Manager", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Backup Manager", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "role": "System Manager", - "write": 1 - }, - { - "doctype": "DocType", - "name": "Backup Manager" - }, - { - "doctype": "DocField", - "fieldname": "setup", - "fieldtype": "Section Break", - "label": "Setup" - }, - { - "description": "Email ids separated by commas.", - "doctype": "DocField", - "fieldname": "send_notifications_to", - "fieldtype": "Data", - "label": "Send Notifications To", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "backup_right_now", - "fieldtype": "Button", - "hidden": 1, - "label": "Backup Right Now", - "read_only": 1 - }, - { - "description": "Note: Backups and files are not deleted from Dropbox, you will have to delete them manually.", - "doctype": "DocField", - "fieldname": "sync_with_dropbox", - "fieldtype": "Section Break", - "label": "Sync with Dropbox" - }, - { - "doctype": "DocField", - "fieldname": "upload_backups_to_dropbox", - "fieldtype": "Select", - "label": "Upload Backups to Dropbox", - "options": "Never\nWeekly\nDaily" - }, - { - "doctype": "DocField", - "fieldname": "dropbox_access_key", - "fieldtype": "Data", - "hidden": 1, - "label": "Dropbox Access Key", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "dropbox_access_secret", - "fieldtype": "Data", - "hidden": 1, - "label": "Dropbox Access Secret", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "dropbox_access_allowed", - "fieldtype": "Check", - "hidden": 1, - "label": "Dropbox Access Allowed", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "allow_dropbox_access", - "fieldtype": "Button", - "label": "Allow Dropbox Access" - }, - { - "description": "Note: Backups and files are not deleted from Google Drive, you will have to delete them manually.", - "doctype": "DocField", - "fieldname": "sync_with_gdrive", - "fieldtype": "Section Break", - "hidden": 1, - "label": "Sync with Google Drive" - }, - { - "doctype": "DocField", - "fieldname": "upload_backups_to_gdrive", - "fieldtype": "Select", - "label": "Upload Backups to Google Drive", - "options": "Never\nDaily\nWeekly" - }, - { - "doctype": "DocField", - "fieldname": "allow_gdrive_access", - "fieldtype": "Button", - "label": "Allow Google Drive Access" - }, - { - "doctype": "DocField", - "fieldname": "verification_code", - "fieldtype": "Data", - "label": "Enter Verification Code" - }, - { - "doctype": "DocField", - "fieldname": "validate_gdrive", - "fieldtype": "Button", - "label": "Validate" - }, - { - "doctype": "DocField", - "fieldname": "gdrive_access_allowed", - "fieldtype": "Check", - "hidden": 1, - "label": "Google Drive Access Allowed", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "gdrive_credentials", - "fieldtype": "Text", - "hidden": 1, - "label": "Credentials", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "database_folder_id", - "fieldtype": "Data", - "hidden": 1, - "label": "Database Folder ID", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "files_folder_id", - "fieldtype": "Data", - "hidden": 1, - "label": "Files Folder ID", - "read_only": 1 - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "creation": "2013-04-30 12:58:38", + "description": "System for managing Backups", + "docstatus": 0, + "doctype": "DocType", + "document_type": "System", + "fields": [ + { + "fieldname": "setup", + "fieldtype": "Section Break", + "label": "Setup", + "permlevel": 0 + }, + { + "description": "Email ids separated by commas.", + "fieldname": "send_notifications_to", + "fieldtype": "Data", + "label": "Send Notifications To", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "backup_right_now", + "fieldtype": "Button", + "hidden": 1, + "label": "Backup Right Now", + "permlevel": 0, + "read_only": 1 + }, + { + "description": "Note: Backups and files are not deleted from Dropbox, you will have to delete them manually.", + "fieldname": "sync_with_dropbox", + "fieldtype": "Section Break", + "label": "Sync with Dropbox", + "permlevel": 0 + }, + { + "fieldname": "upload_backups_to_dropbox", + "fieldtype": "Select", + "label": "Upload Backups to Dropbox", + "options": "Never\nWeekly\nDaily", + "permlevel": 0 + }, + { + "fieldname": "dropbox_access_key", + "fieldtype": "Data", + "hidden": 1, + "label": "Dropbox Access Key", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "dropbox_access_secret", + "fieldtype": "Data", + "hidden": 1, + "label": "Dropbox Access Secret", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "dropbox_access_allowed", + "fieldtype": "Check", + "hidden": 1, + "label": "Dropbox Access Allowed", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "allow_dropbox_access", + "fieldtype": "Button", + "label": "Allow Dropbox Access", + "permlevel": 0 + }, + { + "description": "Note: Backups and files are not deleted from Google Drive, you will have to delete them manually.", + "fieldname": "sync_with_gdrive", + "fieldtype": "Section Break", + "hidden": 1, + "label": "Sync with Google Drive", + "permlevel": 0 + }, + { + "fieldname": "upload_backups_to_gdrive", + "fieldtype": "Select", + "label": "Upload Backups to Google Drive", + "options": "Never\nDaily\nWeekly", + "permlevel": 0 + }, + { + "fieldname": "allow_gdrive_access", + "fieldtype": "Button", + "label": "Allow Google Drive Access", + "permlevel": 0 + }, + { + "fieldname": "verification_code", + "fieldtype": "Data", + "label": "Enter Verification Code", + "permlevel": 0 + }, + { + "fieldname": "validate_gdrive", + "fieldtype": "Button", + "label": "Validate", + "permlevel": 0 + }, + { + "fieldname": "gdrive_access_allowed", + "fieldtype": "Check", + "hidden": 1, + "label": "Google Drive Access Allowed", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "gdrive_credentials", + "fieldtype": "Text", + "hidden": 1, + "label": "Credentials", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "database_folder_id", + "fieldtype": "Data", + "hidden": 1, + "label": "Database Folder ID", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "files_folder_id", + "fieldtype": "Data", + "hidden": 1, + "label": "Files Folder ID", + "permlevel": 0, + "read_only": 1 + } + ], + "icon": "icon-cloud-upload", + "idx": 1, + "issingle": 1, + "modified": "2013-12-20 19:22:55", + "modified_by": "Administrator", + "module": "Setup", + "name": "Backup Manager", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "role": "System Manager", + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/setup/doctype/brand/brand.txt b/erpnext/setup/doctype/brand/brand.txt index 3e67b9ff62..7fa15c1810 100644 --- a/erpnext/setup/doctype/brand/brand.txt +++ b/erpnext/setup/doctype/brand/brand.txt @@ -1,95 +1,93 @@ -[ - { - "creation": "2013-02-22 01:27:54", - "docstatus": 0, - "modified": "2014-01-20 17:48:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "autoname": "field:brand", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-certificate", - "in_dialog": 0, - "module": "Setup", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Brand", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0, - "read_only": 0 - }, - { - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Brand", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1 - }, - { - "doctype": "DocType", - "name": "Brand" - }, - { - "doctype": "DocField", - "fieldname": "brand", - "fieldtype": "Data", - "label": "Brand Name", - "oldfieldname": "brand", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Text", - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Text", - "width": "300px" - }, - { - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Material Master Manager", - "write": 1 - }, - { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Material User", - "submit": 0, - "write": 0 - }, - { - "delete": 0, - "doctype": "DocPerm", - "role": "Sales User" - }, - { - "delete": 0, - "doctype": "DocPerm", - "role": "Purchase User" - }, - { - "delete": 0, - "doctype": "DocPerm", - "role": "Accounts User" - } -] \ No newline at end of file +{ + "allow_import": 1, + "autoname": "field:brand", + "creation": "2013-02-22 01:27:54", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "brand", + "fieldtype": "Data", + "label": "Brand Name", + "oldfieldname": "brand", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "description", + "fieldtype": "Text", + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Text", + "permlevel": 0, + "read_only": 0, + "width": "300px" + } + ], + "icon": "icon-certificate", + "idx": 1, + "in_dialog": 0, + "modified": "2014-01-20 17:48:27", + "modified_by": "Administrator", + "module": "Setup", + "name": "Brand", + "owner": "Administrator", + "permissions": [ + { + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material Master Manager", + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material User", + "submit": 0, + "write": 0 + }, + { + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales User" + }, + { + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase User" + }, + { + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts User" + } + ] +} \ No newline at end of file diff --git a/erpnext/setup/doctype/company/company.txt b/erpnext/setup/doctype/company/company.txt index 3aca525390..5bd408e28d 100644 --- a/erpnext/setup/doctype/company/company.txt +++ b/erpnext/setup/doctype/company/company.txt @@ -1,393 +1,377 @@ -[ - { - "creation": "2013-04-10 08:35:39", - "docstatus": 0, - "modified": "2014-03-05 14:54:29", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "allow_rename": 1, - "autoname": "field:company_name", - "description": "Legal Entity / Subsidiary with a separate Chart of Accounts belonging to the Organization.", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-building", - "module": "Setup", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Company", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Company", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1 - }, - { - "doctype": "DocType", - "name": "Company" - }, - { - "doctype": "DocField", - "fieldname": "details", - "fieldtype": "Section Break", - "label": "Company Details", - "oldfieldtype": "Section Break", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "company_name", - "fieldtype": "Data", - "label": "Company", - "no_copy": 0, - "oldfieldname": "company_name", - "oldfieldtype": "Data", - "read_only": 0, - "reqd": 1 - }, - { - "description": "Please Enter Abbreviation or Short Name properly as it will be added as Suffix to all Account Heads.", - "doctype": "DocField", - "fieldname": "abbr", - "fieldtype": "Data", - "label": "Abbr", - "no_copy": 0, - "oldfieldname": "abbr", - "oldfieldtype": "Data", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "cb0", - "fieldtype": "Column Break", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "domain", - "fieldtype": "Select", - "label": "Domain", - "options": "Distribution\nManufacturing\nRetail\nServices", - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "charts_section", - "fieldtype": "Section Break", - "label": "Chart of Accounts" - }, - { - "doctype": "DocField", - "fieldname": "country", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Country", - "options": "Country", - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "chart_of_accounts", - "fieldtype": "Link", - "label": "Chart of Accounts", - "options": "Chart of Accounts" - }, - { - "doctype": "DocField", - "fieldname": "default_settings", - "fieldtype": "Section Break", - "label": "Default Settings", - "oldfieldtype": "Section Break", - "read_only": 0 - }, - { - "depends_on": "eval:!doc.__islocal", - "doctype": "DocField", - "fieldname": "default_bank_account", - "fieldtype": "Link", - "label": "Default Bank Account", - "no_copy": 1, - "oldfieldname": "default_bank_account", - "oldfieldtype": "Link", - "options": "Account", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "default_cash_account", - "fieldtype": "Link", - "label": "Default Cash Account", - "no_copy": 1, - "options": "Account", - "read_only": 0 - }, - { - "depends_on": "eval:!doc.__islocal", - "doctype": "DocField", - "fieldname": "receivables_group", - "fieldtype": "Link", - "label": "Receivables Group", - "no_copy": 1, - "oldfieldname": "receivables_group", - "oldfieldtype": "Link", - "options": "Account", - "read_only": 0 - }, - { - "depends_on": "eval:!doc.__islocal", - "doctype": "DocField", - "fieldname": "payables_group", - "fieldtype": "Link", - "label": "Payables Group", - "no_copy": 1, - "oldfieldname": "payables_group", - "oldfieldtype": "Link", - "options": "Account", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "default_expense_account", - "fieldtype": "Link", - "label": "Default Expense Account", - "no_copy": 1, - "options": "Account" - }, - { - "doctype": "DocField", - "fieldname": "default_income_account", - "fieldtype": "Link", - "label": "Default Income Account", - "no_copy": 1, - "options": "Account" - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "default_currency", - "fieldtype": "Link", - "label": "Default Currency", - "options": "Currency", - "read_only": 0, - "reqd": 1 - }, - { - "depends_on": "eval:!doc.__islocal", - "doctype": "DocField", - "fieldname": "cost_center", - "fieldtype": "Link", - "label": "Cost Center", - "no_copy": 1, - "options": "Cost Center" - }, - { - "depends_on": "eval:!doc.__islocal", - "doctype": "DocField", - "fieldname": "credit_days", - "fieldtype": "Int", - "label": "Credit Days", - "oldfieldname": "credit_days", - "oldfieldtype": "Int", - "read_only": 0 - }, - { - "depends_on": "eval:!doc.__islocal", - "doctype": "DocField", - "fieldname": "credit_limit", - "fieldtype": "Currency", - "label": "Credit Limit", - "oldfieldname": "credit_limit", - "oldfieldtype": "Currency", - "options": "default_currency", - "read_only": 0 - }, - { - "depends_on": "eval:!doc.__islocal", - "doctype": "DocField", - "fieldname": "yearly_bgt_flag", - "fieldtype": "Select", - "label": "If Yearly Budget Exceeded", - "oldfieldname": "yearly_bgt_flag", - "oldfieldtype": "Select", - "options": "\nWarn\nIgnore\nStop", - "read_only": 0 - }, - { - "depends_on": "eval:!doc.__islocal", - "doctype": "DocField", - "fieldname": "monthly_bgt_flag", - "fieldtype": "Select", - "label": "If Monthly Budget Exceeded", - "oldfieldname": "monthly_bgt_flag", - "oldfieldtype": "Select", - "options": "\nWarn\nIgnore\nStop", - "read_only": 0 - }, - { - "depends_on": "eval:!doc.__islocal", - "doctype": "DocField", - "fieldname": "auto_accounting_for_stock_settings", - "fieldtype": "Section Break", - "label": "Auto Accounting For Stock Settings", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "stock_received_but_not_billed", - "fieldtype": "Link", - "label": "Stock Received But Not Billed", - "no_copy": 1, - "options": "Account", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "stock_adjustment_account", - "fieldtype": "Link", - "label": "Stock Adjustment Account", - "no_copy": 1, - "options": "Account", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "expenses_included_in_valuation", - "fieldtype": "Link", - "label": "Expenses Included In Valuation", - "no_copy": 1, - "options": "Account", - "read_only": 0 - }, - { - "description": "For reference only.", - "doctype": "DocField", - "fieldname": "company_info", - "fieldtype": "Section Break", - "label": "Company Info", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "address", - "fieldtype": "Small Text", - "label": "Address", - "oldfieldname": "address", - "oldfieldtype": "Small Text", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "phone_no", - "fieldtype": "Data", - "label": "Phone No", - "oldfieldname": "phone_no", - "oldfieldtype": "Data", - "options": "Phone", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "fax", - "fieldtype": "Data", - "label": "Fax", - "oldfieldname": "fax", - "oldfieldtype": "Data", - "options": "Phone", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "email", - "fieldtype": "Data", - "label": "Email", - "oldfieldname": "email", - "oldfieldtype": "Data", - "options": "Email", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "website", - "fieldtype": "Data", - "label": "Website", - "oldfieldname": "website", - "oldfieldtype": "Data", - "read_only": 0 - }, - { - "description": "Company registration numbers for your reference. Example: VAT Registration Numbers etc.", - "doctype": "DocField", - "fieldname": "registration_info", - "fieldtype": "Section Break", - "label": "Registration Info", - "oldfieldtype": "Section Break", - "read_only": 0, - "width": "50%" - }, - { - "description": "Company registration numbers for your reference. Tax numbers etc.", - "doctype": "DocField", - "fieldname": "registration_details", - "fieldtype": "Code", - "label": "Registration Details", - "oldfieldname": "registration_details", - "oldfieldtype": "Code", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "trash_reason", - "fieldtype": "Small Text", - "label": "Trash Reason", - "no_copy": 1, - "oldfieldname": "trash_reason", - "oldfieldtype": "Small Text", - "read_only": 1 - }, - { - "amend": 0, - "cancel": 0, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "report": 1, - "role": "System Manager", - "submit": 0, - "write": 1 - }, - { - "delete": 0, - "doctype": "DocPerm", - "role": "All" - } -] \ No newline at end of file +{ + "allow_import": 1, + "allow_rename": 1, + "autoname": "field:company_name", + "creation": "2013-04-10 08:35:39", + "description": "Legal Entity / Subsidiary with a separate Chart of Accounts belonging to the Organization.", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "details", + "fieldtype": "Section Break", + "label": "Company Details", + "oldfieldtype": "Section Break", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "company_name", + "fieldtype": "Data", + "label": "Company", + "no_copy": 0, + "oldfieldname": "company_name", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "description": "Please Enter Abbreviation or Short Name properly as it will be added as Suffix to all Account Heads.", + "fieldname": "abbr", + "fieldtype": "Data", + "label": "Abbr", + "no_copy": 0, + "oldfieldname": "abbr", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "cb0", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "domain", + "fieldtype": "Select", + "label": "Domain", + "options": "Distribution\nManufacturing\nRetail\nServices", + "permlevel": 0, + "reqd": 0 + }, + { + "fieldname": "charts_section", + "fieldtype": "Section Break", + "label": "Chart of Accounts", + "permlevel": 0 + }, + { + "fieldname": "country", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Country", + "options": "Country", + "permlevel": 0, + "reqd": 0 + }, + { + "fieldname": "chart_of_accounts", + "fieldtype": "Link", + "label": "Chart of Accounts", + "options": "Chart of Accounts", + "permlevel": 0 + }, + { + "fieldname": "default_settings", + "fieldtype": "Section Break", + "label": "Default Settings", + "oldfieldtype": "Section Break", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "eval:!doc.__islocal", + "fieldname": "default_bank_account", + "fieldtype": "Link", + "label": "Default Bank Account", + "no_copy": 1, + "oldfieldname": "default_bank_account", + "oldfieldtype": "Link", + "options": "Account", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "default_cash_account", + "fieldtype": "Link", + "label": "Default Cash Account", + "no_copy": 1, + "options": "Account", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "eval:!doc.__islocal", + "fieldname": "receivables_group", + "fieldtype": "Link", + "label": "Receivables Group", + "no_copy": 1, + "oldfieldname": "receivables_group", + "oldfieldtype": "Link", + "options": "Account", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "eval:!doc.__islocal", + "fieldname": "payables_group", + "fieldtype": "Link", + "label": "Payables Group", + "no_copy": 1, + "oldfieldname": "payables_group", + "oldfieldtype": "Link", + "options": "Account", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "default_expense_account", + "fieldtype": "Link", + "label": "Default Expense Account", + "no_copy": 1, + "options": "Account", + "permlevel": 0 + }, + { + "fieldname": "default_income_account", + "fieldtype": "Link", + "label": "Default Income Account", + "no_copy": 1, + "options": "Account", + "permlevel": 0 + }, + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "default_currency", + "fieldtype": "Link", + "label": "Default Currency", + "options": "Currency", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "depends_on": "eval:!doc.__islocal", + "fieldname": "cost_center", + "fieldtype": "Link", + "label": "Cost Center", + "no_copy": 1, + "options": "Cost Center", + "permlevel": 0 + }, + { + "depends_on": "eval:!doc.__islocal", + "fieldname": "credit_days", + "fieldtype": "Int", + "label": "Credit Days", + "oldfieldname": "credit_days", + "oldfieldtype": "Int", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "eval:!doc.__islocal", + "fieldname": "credit_limit", + "fieldtype": "Currency", + "label": "Credit Limit", + "oldfieldname": "credit_limit", + "oldfieldtype": "Currency", + "options": "default_currency", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "eval:!doc.__islocal", + "fieldname": "yearly_bgt_flag", + "fieldtype": "Select", + "label": "If Yearly Budget Exceeded", + "oldfieldname": "yearly_bgt_flag", + "oldfieldtype": "Select", + "options": "\nWarn\nIgnore\nStop", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "eval:!doc.__islocal", + "fieldname": "monthly_bgt_flag", + "fieldtype": "Select", + "label": "If Monthly Budget Exceeded", + "oldfieldname": "monthly_bgt_flag", + "oldfieldtype": "Select", + "options": "\nWarn\nIgnore\nStop", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "eval:!doc.__islocal", + "fieldname": "auto_accounting_for_stock_settings", + "fieldtype": "Section Break", + "label": "Auto Accounting For Stock Settings", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "stock_received_but_not_billed", + "fieldtype": "Link", + "label": "Stock Received But Not Billed", + "no_copy": 1, + "options": "Account", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "stock_adjustment_account", + "fieldtype": "Link", + "label": "Stock Adjustment Account", + "no_copy": 1, + "options": "Account", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "expenses_included_in_valuation", + "fieldtype": "Link", + "label": "Expenses Included In Valuation", + "no_copy": 1, + "options": "Account", + "permlevel": 0, + "read_only": 0 + }, + { + "description": "For reference only.", + "fieldname": "company_info", + "fieldtype": "Section Break", + "label": "Company Info", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "address", + "fieldtype": "Small Text", + "label": "Address", + "oldfieldname": "address", + "oldfieldtype": "Small Text", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "phone_no", + "fieldtype": "Data", + "label": "Phone No", + "oldfieldname": "phone_no", + "oldfieldtype": "Data", + "options": "Phone", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "fax", + "fieldtype": "Data", + "label": "Fax", + "oldfieldname": "fax", + "oldfieldtype": "Data", + "options": "Phone", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "email", + "fieldtype": "Data", + "label": "Email", + "oldfieldname": "email", + "oldfieldtype": "Data", + "options": "Email", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "website", + "fieldtype": "Data", + "label": "Website", + "oldfieldname": "website", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 0 + }, + { + "description": "Company registration numbers for your reference. Example: VAT Registration Numbers etc.", + "fieldname": "registration_info", + "fieldtype": "Section Break", + "label": "Registration Info", + "oldfieldtype": "Section Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "description": "Company registration numbers for your reference. Tax numbers etc.", + "fieldname": "registration_details", + "fieldtype": "Code", + "label": "Registration Details", + "oldfieldname": "registration_details", + "oldfieldtype": "Code", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "trash_reason", + "fieldtype": "Small Text", + "label": "Trash Reason", + "no_copy": 1, + "oldfieldname": "trash_reason", + "oldfieldtype": "Small Text", + "permlevel": 0, + "read_only": 1 + } + ], + "icon": "icon-building", + "idx": 1, + "modified": "2014-03-05 14:54:29", + "modified_by": "Administrator", + "module": "Setup", + "name": "Company", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "submit": 0, + "write": 1 + }, + { + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "role": "All" + } + ] +} \ No newline at end of file diff --git a/erpnext/setup/doctype/contact_control/contact_control.txt b/erpnext/setup/doctype/contact_control/contact_control.txt index a5a0d01c27..7c6768a048 100644 --- a/erpnext/setup/doctype/contact_control/contact_control.txt +++ b/erpnext/setup/doctype/contact_control/contact_control.txt @@ -1,63 +1,48 @@ -[ - { - "creation": "2012-03-27 14:36:19", - "docstatus": 0, - "modified": "2013-12-20 19:23:02", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "in_create": 1, - "issingle": 1, - "module": "Setup", - "name": "__common__", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldtype": "Text", - "in_list_view": 1, - "name": "__common__", - "parent": "Contact Control", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "create": 0, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Contact Control", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "role": "System Manager", - "write": 1 - }, - { - "doctype": "DocType", - "name": "Contact Control" - }, - { - "doctype": "DocField", - "fieldname": "header", - "label": "Header" - }, - { - "doctype": "DocField", - "fieldname": "customer_intro", - "label": "Customer Intro" - }, - { - "doctype": "DocField", - "fieldname": "supplier_intro", - "label": "Supplier Intro" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "creation": "2012-03-27 14:36:19", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "header", + "fieldtype": "Text", + "in_list_view": 1, + "label": "Header", + "permlevel": 0 + }, + { + "fieldname": "customer_intro", + "fieldtype": "Text", + "in_list_view": 1, + "label": "Customer Intro", + "permlevel": 0 + }, + { + "fieldname": "supplier_intro", + "fieldtype": "Text", + "in_list_view": 1, + "label": "Supplier Intro", + "permlevel": 0 + } + ], + "idx": 1, + "in_create": 1, + "issingle": 1, + "modified": "2013-12-20 19:23:02", + "modified_by": "Administrator", + "module": "Setup", + "name": "Contact Control", + "owner": "Administrator", + "permissions": [ + { + "create": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "role": "System Manager", + "write": 1 + } + ], + "read_only": 1 +} \ No newline at end of file diff --git a/erpnext/setup/doctype/country/country.txt b/erpnext/setup/doctype/country/country.txt index 57d2025316..1652d59491 100644 --- a/erpnext/setup/doctype/country/country.txt +++ b/erpnext/setup/doctype/country/country.txt @@ -1,105 +1,102 @@ -[ - { - "creation": "2013-01-19 10:23:30", - "docstatus": 0, - "modified": "2014-03-05 14:36:16", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "autoname": "field:country_name", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-globe", - "in_create": 0, - "module": "Setup", - "name": "__common__", - "read_only": 0 - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Country", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Country", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1 - }, - { - "doctype": "DocType", - "name": "Country" - }, - { - "doctype": "DocField", - "fieldname": "country_name", - "fieldtype": "Data", - "label": "Country Name", - "oldfieldname": "country_name", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "date_format", - "fieldtype": "Data", - "label": "Date Format" - }, - { - "doctype": "DocField", - "fieldname": "time_zones", - "fieldtype": "Text", - "label": "Time Zones" - }, - { - "doctype": "DocField", - "fieldname": "code", - "fieldtype": "Data", - "label": "Code" - }, - { - "amend": 0, - "cancel": 0, - "create": 1, - "doctype": "DocPerm", - "role": "Sales Master Manager", - "submit": 0, - "write": 1 - }, - { - "create": 1, - "doctype": "DocPerm", - "role": "Purchase Master Manager", - "submit": 0, - "write": 1 - }, - { - "create": 1, - "doctype": "DocPerm", - "role": "HR User", - "submit": 0, - "write": 1 - }, - { - "create": 1, - "doctype": "DocPerm", - "role": "HR Manager", - "submit": 0, - "write": 1 - }, - { - "doctype": "DocPerm", - "role": "All" - } -] \ No newline at end of file +{ + "allow_import": 1, + "autoname": "field:country_name", + "creation": "2013-01-19 10:23:30", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "country_name", + "fieldtype": "Data", + "label": "Country Name", + "oldfieldname": "country_name", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "date_format", + "fieldtype": "Data", + "label": "Date Format", + "permlevel": 0 + }, + { + "fieldname": "time_zones", + "fieldtype": "Text", + "label": "Time Zones", + "permlevel": 0 + }, + { + "fieldname": "code", + "fieldtype": "Data", + "label": "Code", + "permlevel": 0 + } + ], + "icon": "icon-globe", + "idx": 1, + "in_create": 0, + "modified": "2014-03-05 14:36:16", + "modified_by": "Administrator", + "module": "Setup", + "name": "Country", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales Master Manager", + "submit": 0, + "write": 1 + }, + { + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase Master Manager", + "submit": 0, + "write": 1 + }, + { + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "HR User", + "submit": 0, + "write": 1 + }, + { + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "HR Manager", + "submit": 0, + "write": 1 + }, + { + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "All" + } + ], + "read_only": 0 +} \ No newline at end of file diff --git a/erpnext/setup/doctype/currency/currency.txt b/erpnext/setup/doctype/currency/currency.txt index 6bd2b1ca35..d3cbc279ab 100644 --- a/erpnext/setup/doctype/currency/currency.txt +++ b/erpnext/setup/doctype/currency/currency.txt @@ -1,126 +1,119 @@ -[ - { - "creation": "2013-01-28 10:06:02", - "docstatus": 0, - "modified": "2014-01-20 17:48:31", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "field:currency_name", - "description": "**Currency** Master", - "doctype": "DocType", - "icon": "icon-bitcoin", - "in_create": 0, - "module": "Setup", - "name": "__common__", - "read_only": 0 - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Currency", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Currency", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1 - }, - { - "doctype": "DocType", - "name": "Currency" - }, - { - "doctype": "DocField", - "fieldname": "currency_name", - "fieldtype": "Data", - "label": "Currency Name", - "oldfieldname": "currency_name", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "enabled", - "fieldtype": "Check", - "in_list_view": 1, - "label": "Enabled" - }, - { - "description": "Sub-currency. For e.g. \"Cent\"", - "doctype": "DocField", - "fieldname": "fraction", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Fraction" - }, - { - "description": "1 Currency = [?] Fraction\nFor e.g. 1 USD = 100 Cent", - "doctype": "DocField", - "fieldname": "fraction_units", - "fieldtype": "Int", - "in_list_view": 1, - "label": "Fraction Units" - }, - { - "description": "A symbol for this currency. For e.g. $", - "doctype": "DocField", - "fieldname": "symbol", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Symbol" - }, - { - "description": "How should this currency be formatted? If not set, will use system defaults", - "doctype": "DocField", - "fieldname": "number_format", - "fieldtype": "Select", - "in_list_view": 1, - "label": "Number Format", - "options": "\n#,###.##\n#.###,##\n# ###.##\n#,###.###\n#,##,###.##\n#.###\n#,###" - }, - { - "cancel": 0, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Accounts Manager", - "submit": 0, - "write": 1 - }, - { - "amend": 0, - "cancel": 0, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Sales Master Manager", - "submit": 0, - "write": 1 - }, - { - "amend": 0, - "cancel": 0, - "create": 1, - "delete": 0, - "doctype": "DocPerm", - "role": "Purchase Master Manager", - "submit": 0, - "write": 1 - }, - { - "delete": 0, - "doctype": "DocPerm", - "role": "All" - } -] \ No newline at end of file +{ + "autoname": "field:currency_name", + "creation": "2013-01-28 10:06:02", + "description": "**Currency** Master", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "currency_name", + "fieldtype": "Data", + "label": "Currency Name", + "oldfieldname": "currency_name", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "enabled", + "fieldtype": "Check", + "in_list_view": 1, + "label": "Enabled", + "permlevel": 0 + }, + { + "description": "Sub-currency. For e.g. \"Cent\"", + "fieldname": "fraction", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Fraction", + "permlevel": 0 + }, + { + "description": "1 Currency = [?] Fraction\nFor e.g. 1 USD = 100 Cent", + "fieldname": "fraction_units", + "fieldtype": "Int", + "in_list_view": 1, + "label": "Fraction Units", + "permlevel": 0 + }, + { + "description": "A symbol for this currency. For e.g. $", + "fieldname": "symbol", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Symbol", + "permlevel": 0 + }, + { + "description": "How should this currency be formatted? If not set, will use system defaults", + "fieldname": "number_format", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Number Format", + "options": "\n#,###.##\n#.###,##\n# ###.##\n#,###.###\n#,##,###.##\n#.###\n#,###", + "permlevel": 0 + } + ], + "icon": "icon-bitcoin", + "idx": 1, + "in_create": 0, + "modified": "2014-01-20 17:48:31", + "modified_by": "Administrator", + "module": "Setup", + "name": "Currency", + "owner": "Administrator", + "permissions": [ + { + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts Manager", + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales Master Manager", + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase Master Manager", + "submit": 0, + "write": 1 + }, + { + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "All" + } + ], + "read_only": 0 +} \ No newline at end of file diff --git a/erpnext/setup/doctype/currency_exchange/currency_exchange.txt b/erpnext/setup/doctype/currency_exchange/currency_exchange.txt index adaf12508a..2172c13efe 100644 --- a/erpnext/setup/doctype/currency_exchange/currency_exchange.txt +++ b/erpnext/setup/doctype/currency_exchange/currency_exchange.txt @@ -1,86 +1,81 @@ -[ - { - "creation": "2013-06-20 15:40:29", - "docstatus": 0, - "modified": "2014-01-20 17:48:31", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "description": "Specify Exchange Rate to convert one currency into another", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-exchange", - "module": "Setup", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Currency Exchange", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0, - "reqd": 1 - }, - { - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Currency Exchange", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1 - }, - { - "doctype": "DocType", - "name": "Currency Exchange" - }, - { - "doctype": "DocField", - "fieldname": "from_currency", - "fieldtype": "Link", - "label": "From Currency", - "options": "Currency" - }, - { - "doctype": "DocField", - "fieldname": "to_currency", - "fieldtype": "Link", - "label": "To Currency", - "options": "Currency" - }, - { - "doctype": "DocField", - "fieldname": "exchange_rate", - "fieldtype": "Float", - "label": "Exchange Rate" - }, - { - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Accounts Manager", - "write": 1 - }, - { - "delete": 0, - "doctype": "DocPerm", - "role": "Accounts User" - }, - { - "delete": 0, - "doctype": "DocPerm", - "role": "Sales User" - }, - { - "delete": 0, - "doctype": "DocPerm", - "role": "Purchase User" - } -] \ No newline at end of file +{ + "allow_import": 1, + "creation": "2013-06-20 15:40:29", + "description": "Specify Exchange Rate to convert one currency into another", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "from_currency", + "fieldtype": "Link", + "label": "From Currency", + "options": "Currency", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "to_currency", + "fieldtype": "Link", + "label": "To Currency", + "options": "Currency", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "exchange_rate", + "fieldtype": "Float", + "label": "Exchange Rate", + "permlevel": 0, + "reqd": 1 + } + ], + "icon": "icon-exchange", + "idx": 1, + "modified": "2014-01-20 17:48:31", + "modified_by": "Administrator", + "module": "Setup", + "name": "Currency Exchange", + "owner": "Administrator", + "permissions": [ + { + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts Manager", + "write": 1 + }, + { + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts User" + }, + { + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales User" + }, + { + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase User" + } + ] +} \ No newline at end of file diff --git a/erpnext/setup/doctype/customer_group/customer_group.txt b/erpnext/setup/doctype/customer_group/customer_group.txt index 59f52c6727..d26f8e50b1 100644 --- a/erpnext/setup/doctype/customer_group/customer_group.txt +++ b/erpnext/setup/doctype/customer_group/customer_group.txt @@ -1,165 +1,160 @@ -[ - { - "creation": "2013-01-10 16:34:23", - "docstatus": 0, - "modified": "2014-01-20 17:48:33", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "allow_rename": 1, - "autoname": "field:customer_group_name", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-sitemap", - "in_create": 1, - "module": "Setup", - "name": "__common__", - "read_only": 1, - "search_fields": "name,parent_customer_group" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Customer Group", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "amend": 0, - "cancel": 0, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Customer Group", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 0 - }, - { - "doctype": "DocType", - "name": "Customer Group" - }, - { - "doctype": "DocField", - "fieldname": "trash_reason", - "fieldtype": "Small Text", - "label": "Trash Reason", - "oldfieldname": "trash_reason", - "oldfieldtype": "Small Text", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "customer_group_name", - "fieldtype": "Data", - "label": "Customer Group Name", - "no_copy": 1, - "oldfieldname": "customer_group_name", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "parent_customer_group", - "fieldtype": "Link", - "ignore_restrictions": 1, - "label": "Parent Customer Group", - "oldfieldname": "parent_customer_group", - "oldfieldtype": "Link", - "options": "Customer Group", - "reqd": 0 - }, - { - "description": "Only leaf nodes are allowed in transaction", - "doctype": "DocField", - "fieldname": "is_group", - "fieldtype": "Select", - "label": "Has Child Node", - "oldfieldname": "is_group", - "oldfieldtype": "Select", - "options": "\nYes\nNo", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "cb0", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "default_price_list", - "fieldtype": "Link", - "label": "Default Price List", - "options": "Price List" - }, - { - "doctype": "DocField", - "fieldname": "lft", - "fieldtype": "Int", - "hidden": 1, - "label": "lft", - "no_copy": 1, - "oldfieldname": "lft", - "oldfieldtype": "Int", - "print_hide": 1, - "report_hide": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "rgt", - "fieldtype": "Int", - "hidden": 1, - "label": "rgt", - "no_copy": 1, - "oldfieldname": "rgt", - "oldfieldtype": "Int", - "print_hide": 1, - "report_hide": 1, - "search_index": 1 - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "old_parent", - "fieldtype": "Link", - "hidden": 1, - "ignore_restrictions": 1, - "label": "old_parent", - "no_copy": 1, - "oldfieldname": "old_parent", - "oldfieldtype": "Data", - "options": "Customer Group", - "print_hide": 1, - "report_hide": 1 - }, - { - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Sales Manager", - "write": 0 - }, - { - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Sales User", - "write": 0 - }, - { - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Sales Master Manager", - "write": 1 - } -] \ No newline at end of file +{ + "allow_import": 1, + "allow_rename": 1, + "autoname": "field:customer_group_name", + "creation": "2013-01-10 16:34:23", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "trash_reason", + "fieldtype": "Small Text", + "label": "Trash Reason", + "oldfieldname": "trash_reason", + "oldfieldtype": "Small Text", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "customer_group_name", + "fieldtype": "Data", + "label": "Customer Group Name", + "no_copy": 1, + "oldfieldname": "customer_group_name", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + }, + { + "description": "Add / Edit", + "fieldname": "parent_customer_group", + "fieldtype": "Link", + "ignore_restrictions": 1, + "label": "Parent Customer Group", + "oldfieldname": "parent_customer_group", + "oldfieldtype": "Link", + "options": "Customer Group", + "permlevel": 0, + "reqd": 0 + }, + { + "description": "Only leaf nodes are allowed in transaction", + "fieldname": "is_group", + "fieldtype": "Select", + "label": "Has Child Node", + "oldfieldname": "is_group", + "oldfieldtype": "Select", + "options": "\nYes\nNo", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "cb0", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "default_price_list", + "fieldtype": "Link", + "label": "Default Price List", + "options": "Price List", + "permlevel": 0 + }, + { + "fieldname": "lft", + "fieldtype": "Int", + "hidden": 1, + "label": "lft", + "no_copy": 1, + "oldfieldname": "lft", + "oldfieldtype": "Int", + "permlevel": 0, + "print_hide": 1, + "report_hide": 1, + "search_index": 1 + }, + { + "fieldname": "rgt", + "fieldtype": "Int", + "hidden": 1, + "label": "rgt", + "no_copy": 1, + "oldfieldname": "rgt", + "oldfieldtype": "Int", + "permlevel": 0, + "print_hide": 1, + "report_hide": 1, + "search_index": 1 + }, + { + "description": "Add / Edit", + "fieldname": "old_parent", + "fieldtype": "Link", + "hidden": 1, + "ignore_restrictions": 1, + "label": "old_parent", + "no_copy": 1, + "oldfieldname": "old_parent", + "oldfieldtype": "Data", + "options": "Customer Group", + "permlevel": 0, + "print_hide": 1, + "report_hide": 1 + } + ], + "icon": "icon-sitemap", + "idx": 1, + "in_create": 1, + "modified": "2014-01-20 17:48:33", + "modified_by": "Administrator", + "module": "Setup", + "name": "Customer Group", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales Manager", + "submit": 0, + "write": 0 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales User", + "submit": 0, + "write": 0 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales Master Manager", + "submit": 0, + "write": 1 + } + ], + "read_only": 1, + "search_fields": "name,parent_customer_group" +} \ No newline at end of file diff --git a/erpnext/setup/doctype/email_digest/email_digest.txt b/erpnext/setup/doctype/email_digest/email_digest.txt index 6660c250fe..55b334e17b 100644 --- a/erpnext/setup/doctype/email_digest/email_digest.txt +++ b/erpnext/setup/doctype/email_digest/email_digest.txt @@ -1,368 +1,352 @@ -[ - { - "creation": "2013-02-21 14:15:31", - "docstatus": 0, - "modified": "2014-03-19 11:39:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "Prompt", - "description": "Send regular summary reports via Email.", - "doctype": "DocType", - "document_type": "System", - "icon": "icon-envelope", - "module": "Setup", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Email Digest", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "cancel": 0, - "doctype": "DocPerm", - "name": "__common__", - "parent": "Email Digest", - "parentfield": "permissions", - "parenttype": "DocType", - "read": 1, - "role": "System Manager", - "submit": 0 - }, - { - "doctype": "DocType", - "name": "Email Digest" - }, - { - "doctype": "DocField", - "fieldname": "settings", - "fieldtype": "Section Break", - "label": "Email Digest Settings" - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "enabled", - "fieldtype": "Check", - "label": "Enabled" - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Select", - "label": "For Company", - "options": "link:Company", - "reqd": 1 - }, - { - "allow_on_submit": 0, - "doctype": "DocField", - "fieldname": "frequency", - "fieldtype": "Select", - "label": "How frequently?", - "options": "Daily\nWeekly\nMonthly", - "reqd": 1 - }, - { - "depends_on": "eval:doc.enabled", - "doctype": "DocField", - "fieldname": "next_send", - "fieldtype": "Data", - "label": "Next email will be sent on:", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break" - }, - { - "description": "Note: Email will not be sent to disabled users", - "doctype": "DocField", - "fieldname": "recipient_list", - "fieldtype": "Text", - "label": "Recipients", - "read_only": 1, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "addremove_recipients", - "fieldtype": "Button", - "label": "Add/Remove Recipients" - }, - { - "doctype": "DocField", - "fieldname": "accounts", - "fieldtype": "Section Break", - "label": "Accounts" - }, - { - "doctype": "DocField", - "fieldname": "accounts_module", - "fieldtype": "Column Break", - "label": "Income / Expense" - }, - { - "doctype": "DocField", - "fieldname": "income_year_to_date", - "fieldtype": "Check", - "label": "Income Year to Date" - }, - { - "description": "Balances of Accounts of type \"Bank\" or \"Cash\"", - "doctype": "DocField", - "fieldname": "bank_balance", - "fieldtype": "Check", - "label": "Bank/Cash Balance" - }, - { - "description": "Income booked for the digest period", - "doctype": "DocField", - "fieldname": "income", - "fieldtype": "Check", - "label": "Income Booked" - }, - { - "description": "Expenses booked for the digest period", - "doctype": "DocField", - "fieldname": "expenses_booked", - "fieldtype": "Check", - "label": "Expenses Booked" - }, - { - "description": "Receivable / Payable account will be identified based on the field Master Type", - "doctype": "DocField", - "fieldname": "column_break_16", - "fieldtype": "Column Break", - "label": "Receivables / Payables" - }, - { - "description": "Payments received during the digest period", - "doctype": "DocField", - "fieldname": "collections", - "fieldtype": "Check", - "label": "Payments Received" - }, - { - "description": "Payments made during the digest period", - "doctype": "DocField", - "fieldname": "payments", - "fieldtype": "Check", - "label": "Payments Made" - }, - { - "description": "Total amount of invoices sent to the customer during the digest period", - "doctype": "DocField", - "fieldname": "invoiced_amount", - "fieldtype": "Check", - "label": "Receivables" - }, - { - "description": "Total amount of invoices received from suppliers during the digest period", - "doctype": "DocField", - "fieldname": "payables", - "fieldtype": "Check", - "label": "Payables" - }, - { - "doctype": "DocField", - "fieldname": "section_break_20", - "fieldtype": "Section Break", - "label": "Buying & Selling" - }, - { - "doctype": "DocField", - "fieldname": "buying_module", - "fieldtype": "Column Break", - "label": "Buying" - }, - { - "doctype": "DocField", - "fieldname": "new_purchase_requests", - "fieldtype": "Check", - "label": "New Material Requests" - }, - { - "doctype": "DocField", - "fieldname": "new_supplier_quotations", - "fieldtype": "Check", - "label": "New Supplier Quotations" - }, - { - "doctype": "DocField", - "fieldname": "new_purchase_orders", - "fieldtype": "Check", - "label": "New Purchase Orders" - }, - { - "doctype": "DocField", - "fieldname": "selling_module", - "fieldtype": "Column Break", - "label": "Selling" - }, - { - "doctype": "DocField", - "fieldname": "new_leads", - "fieldtype": "Check", - "label": "New Leads" - }, - { - "doctype": "DocField", - "fieldname": "new_enquiries", - "fieldtype": "Check", - "label": "New Enquiries" - }, - { - "doctype": "DocField", - "fieldname": "new_quotations", - "fieldtype": "Check", - "label": "New Quotations" - }, - { - "doctype": "DocField", - "fieldname": "new_sales_orders", - "fieldtype": "Check", - "label": "New Sales Orders" - }, - { - "doctype": "DocField", - "fieldname": "section_break_34", - "fieldtype": "Section Break", - "label": "Inventory & Support" - }, - { - "doctype": "DocField", - "fieldname": "stock_module", - "fieldtype": "Column Break", - "label": "Stock" - }, - { - "doctype": "DocField", - "fieldname": "new_delivery_notes", - "fieldtype": "Check", - "label": "New Delivery Notes" - }, - { - "doctype": "DocField", - "fieldname": "new_purchase_receipts", - "fieldtype": "Check", - "label": "New Purchase Receipts" - }, - { - "doctype": "DocField", - "fieldname": "new_stock_entries", - "fieldtype": "Check", - "label": "New Stock Entries" - }, - { - "doctype": "DocField", - "fieldname": "support_module", - "fieldtype": "Column Break", - "label": "Support" - }, - { - "doctype": "DocField", - "fieldname": "new_support_tickets", - "fieldtype": "Check", - "label": "New Support Tickets" - }, - { - "doctype": "DocField", - "fieldname": "open_tickets", - "fieldtype": "Check", - "label": "Open Tickets" - }, - { - "doctype": "DocField", - "fieldname": "new_communications", - "fieldtype": "Check", - "label": "New Communications" - }, - { - "doctype": "DocField", - "fieldname": "section_break_40", - "fieldtype": "Section Break", - "label": "Projects & System" - }, - { - "doctype": "DocField", - "fieldname": "projects_module", - "fieldtype": "Column Break", - "label": "Projects" - }, - { - "doctype": "DocField", - "fieldname": "new_projects", - "fieldtype": "Check", - "label": "New Projects" - }, - { - "doctype": "DocField", - "fieldname": "core_module", - "fieldtype": "Column Break", - "label": "System" - }, - { - "doctype": "DocField", - "fieldname": "scheduler_errors", - "fieldtype": "Check", - "label": "Scheduler Failed Events" - }, - { - "doctype": "DocField", - "fieldname": "user_specific", - "fieldtype": "Section Break", - "label": "User Specific" - }, - { - "doctype": "DocField", - "fieldname": "general", - "fieldtype": "Column Break", - "label": "General" - }, - { - "doctype": "DocField", - "fieldname": "calendar_events", - "fieldtype": "Check", - "label": "Calendar Events" - }, - { - "doctype": "DocField", - "fieldname": "todo_list", - "fieldtype": "Check", - "label": "To Do List" - }, - { - "doctype": "DocField", - "fieldname": "stub", - "fieldtype": "Column Break", - "label": "Stub" - }, - { - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "permlevel": 0, - "print": 1, - "report": 1, - "write": 1 - }, - { - "amend": 0, - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "permlevel": 1 - } -] \ No newline at end of file +{ + "autoname": "Prompt", + "creation": "2013-02-21 14:15:31", + "description": "Send regular summary reports via Email.", + "docstatus": 0, + "doctype": "DocType", + "document_type": "System", + "fields": [ + { + "fieldname": "settings", + "fieldtype": "Section Break", + "label": "Email Digest Settings", + "permlevel": 0 + }, + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "enabled", + "fieldtype": "Check", + "label": "Enabled", + "permlevel": 0 + }, + { + "fieldname": "company", + "fieldtype": "Select", + "label": "For Company", + "options": "link:Company", + "permlevel": 0, + "reqd": 1 + }, + { + "allow_on_submit": 0, + "fieldname": "frequency", + "fieldtype": "Select", + "label": "How frequently?", + "options": "Daily\nWeekly\nMonthly", + "permlevel": 0, + "reqd": 1 + }, + { + "depends_on": "eval:doc.enabled", + "fieldname": "next_send", + "fieldtype": "Data", + "label": "Next email will be sent on:", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "description": "Note: Email will not be sent to disabled users", + "fieldname": "recipient_list", + "fieldtype": "Text", + "label": "Recipients", + "permlevel": 0, + "read_only": 1, + "reqd": 1 + }, + { + "fieldname": "addremove_recipients", + "fieldtype": "Button", + "label": "Add/Remove Recipients", + "permlevel": 0 + }, + { + "fieldname": "accounts", + "fieldtype": "Section Break", + "label": "Accounts", + "permlevel": 0 + }, + { + "fieldname": "accounts_module", + "fieldtype": "Column Break", + "label": "Income / Expense", + "permlevel": 0 + }, + { + "fieldname": "income_year_to_date", + "fieldtype": "Check", + "label": "Income Year to Date", + "permlevel": 0 + }, + { + "description": "Balances of Accounts of type \"Bank\" or \"Cash\"", + "fieldname": "bank_balance", + "fieldtype": "Check", + "label": "Bank/Cash Balance", + "permlevel": 0 + }, + { + "description": "Income booked for the digest period", + "fieldname": "income", + "fieldtype": "Check", + "label": "Income Booked", + "permlevel": 0 + }, + { + "description": "Expenses booked for the digest period", + "fieldname": "expenses_booked", + "fieldtype": "Check", + "label": "Expenses Booked", + "permlevel": 0 + }, + { + "description": "Receivable / Payable account will be identified based on the field Master Type", + "fieldname": "column_break_16", + "fieldtype": "Column Break", + "label": "Receivables / Payables", + "permlevel": 0 + }, + { + "description": "Payments received during the digest period", + "fieldname": "collections", + "fieldtype": "Check", + "label": "Payments Received", + "permlevel": 0 + }, + { + "description": "Payments made during the digest period", + "fieldname": "payments", + "fieldtype": "Check", + "label": "Payments Made", + "permlevel": 0 + }, + { + "description": "Total amount of invoices sent to the customer during the digest period", + "fieldname": "invoiced_amount", + "fieldtype": "Check", + "label": "Receivables", + "permlevel": 0 + }, + { + "description": "Total amount of invoices received from suppliers during the digest period", + "fieldname": "payables", + "fieldtype": "Check", + "label": "Payables", + "permlevel": 0 + }, + { + "fieldname": "section_break_20", + "fieldtype": "Section Break", + "label": "Buying & Selling", + "permlevel": 0 + }, + { + "fieldname": "buying_module", + "fieldtype": "Column Break", + "label": "Buying", + "permlevel": 0 + }, + { + "fieldname": "new_purchase_requests", + "fieldtype": "Check", + "label": "New Material Requests", + "permlevel": 0 + }, + { + "fieldname": "new_supplier_quotations", + "fieldtype": "Check", + "label": "New Supplier Quotations", + "permlevel": 0 + }, + { + "fieldname": "new_purchase_orders", + "fieldtype": "Check", + "label": "New Purchase Orders", + "permlevel": 0 + }, + { + "fieldname": "selling_module", + "fieldtype": "Column Break", + "label": "Selling", + "permlevel": 0 + }, + { + "fieldname": "new_leads", + "fieldtype": "Check", + "label": "New Leads", + "permlevel": 0 + }, + { + "fieldname": "new_enquiries", + "fieldtype": "Check", + "label": "New Enquiries", + "permlevel": 0 + }, + { + "fieldname": "new_quotations", + "fieldtype": "Check", + "label": "New Quotations", + "permlevel": 0 + }, + { + "fieldname": "new_sales_orders", + "fieldtype": "Check", + "label": "New Sales Orders", + "permlevel": 0 + }, + { + "fieldname": "section_break_34", + "fieldtype": "Section Break", + "label": "Inventory & Support", + "permlevel": 0 + }, + { + "fieldname": "stock_module", + "fieldtype": "Column Break", + "label": "Stock", + "permlevel": 0 + }, + { + "fieldname": "new_delivery_notes", + "fieldtype": "Check", + "label": "New Delivery Notes", + "permlevel": 0 + }, + { + "fieldname": "new_purchase_receipts", + "fieldtype": "Check", + "label": "New Purchase Receipts", + "permlevel": 0 + }, + { + "fieldname": "new_stock_entries", + "fieldtype": "Check", + "label": "New Stock Entries", + "permlevel": 0 + }, + { + "fieldname": "support_module", + "fieldtype": "Column Break", + "label": "Support", + "permlevel": 0 + }, + { + "fieldname": "new_support_tickets", + "fieldtype": "Check", + "label": "New Support Tickets", + "permlevel": 0 + }, + { + "fieldname": "open_tickets", + "fieldtype": "Check", + "label": "Open Tickets", + "permlevel": 0 + }, + { + "fieldname": "new_communications", + "fieldtype": "Check", + "label": "New Communications", + "permlevel": 0 + }, + { + "fieldname": "section_break_40", + "fieldtype": "Section Break", + "label": "Projects & System", + "permlevel": 0 + }, + { + "fieldname": "projects_module", + "fieldtype": "Column Break", + "label": "Projects", + "permlevel": 0 + }, + { + "fieldname": "new_projects", + "fieldtype": "Check", + "label": "New Projects", + "permlevel": 0 + }, + { + "fieldname": "core_module", + "fieldtype": "Column Break", + "label": "System", + "permlevel": 0 + }, + { + "fieldname": "scheduler_errors", + "fieldtype": "Check", + "label": "Scheduler Failed Events", + "permlevel": 0 + }, + { + "fieldname": "user_specific", + "fieldtype": "Section Break", + "label": "User Specific", + "permlevel": 0 + }, + { + "fieldname": "general", + "fieldtype": "Column Break", + "label": "General", + "permlevel": 0 + }, + { + "fieldname": "calendar_events", + "fieldtype": "Check", + "label": "Calendar Events", + "permlevel": 0 + }, + { + "fieldname": "todo_list", + "fieldtype": "Check", + "label": "To Do List", + "permlevel": 0 + }, + { + "fieldname": "stub", + "fieldtype": "Column Break", + "label": "Stub", + "permlevel": 0 + } + ], + "icon": "icon-envelope", + "idx": 1, + "modified": "2014-03-19 11:39:27", + "modified_by": "Administrator", + "module": "Setup", + "name": "Email Digest", + "owner": "Administrator", + "permissions": [ + { + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "permlevel": 1, + "read": 1, + "role": "System Manager", + "submit": 0 + } + ] +} \ No newline at end of file diff --git a/erpnext/setup/doctype/features_setup/features_setup.txt b/erpnext/setup/doctype/features_setup/features_setup.txt index dd2df028de..fd2db4e537 100644 --- a/erpnext/setup/doctype/features_setup/features_setup.txt +++ b/erpnext/setup/doctype/features_setup/features_setup.txt @@ -1,253 +1,241 @@ -[ - { - "creation": "2012-12-20 12:50:49", - "docstatus": 0, - "modified": "2013-12-24 11:40:19", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "icon": "icon-glass", - "issingle": 1, - "module": "Setup", - "name": "__common__", - "name_case": "Title Case" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Features Setup", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Features Setup", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 0, - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Features Setup" - }, - { - "doctype": "DocField", - "fieldname": "materials", - "fieldtype": "Section Break", - "label": "Materials" - }, - { - "description": "To track item in sales and purchase documents based on their serial nos. This is can also used to track warranty details of the product.", - "doctype": "DocField", - "fieldname": "fs_item_serial_nos", - "fieldtype": "Check", - "label": "Item Serial Nos" - }, - { - "description": "To track items in sales and purchase documents with batch nos
Preferred Industry: Chemicals etc", - "doctype": "DocField", - "fieldname": "fs_item_batch_nos", - "fieldtype": "Check", - "label": "Item Batch Nos" - }, - { - "description": "To track brand name in the following documents
\nDelivery Note, Enuiry, Material Request, Item, Purchase Order, Purchase Voucher, Purchaser Receipt, Quotation, Sales Invoice, Sales BOM, Sales Order, Serial No", - "doctype": "DocField", - "fieldname": "fs_brands", - "fieldtype": "Check", - "label": "Brands" - }, - { - "description": "To track items using barcode. You will be able to enter items in Delivery Note and Sales Invoice by scanning barcode of item.", - "doctype": "DocField", - "fieldname": "fs_item_barcode", - "fieldtype": "Check", - "label": "Item Barcode" - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break" - }, - { - "description": "1. To maintain the customer wise item code and to make them searchable based on their code use this option", - "doctype": "DocField", - "fieldname": "fs_item_advanced", - "fieldtype": "Check", - "label": "Item Advanced" - }, - { - "description": "If Sale BOM is defined, the actual BOM of the Pack is displayed as table.\nAvailable in Delivery Note and Sales Order", - "doctype": "DocField", - "fieldname": "fs_packing_details", - "fieldtype": "Check", - "label": "Packing Details" - }, - { - "description": "To get Item Group in details table", - "doctype": "DocField", - "fieldname": "fs_item_group_in_details", - "fieldtype": "Check", - "label": "Item Groups in Details" - }, - { - "doctype": "DocField", - "fieldname": "sales_and_purchase", - "fieldtype": "Section Break", - "label": "Sales and Purchase" - }, - { - "description": "All export related fields like currency, conversion rate, export total, export grand total etc are available in
\nDelivery Note, POS, Quotation, Sales Invoice, Sales Order etc.", - "doctype": "DocField", - "fieldname": "fs_exports", - "fieldtype": "Check", - "label": "Exports" - }, - { - "description": "All import related fields like currency, conversion rate, import total, import grand total etc are available in
\nPurchase Receipt, Supplier Quotation, Purchase Invoice, Purchase Order etc.", - "doctype": "DocField", - "fieldname": "fs_imports", - "fieldtype": "Check", - "label": "Imports" - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break" - }, - { - "description": "Field available in Delivery Note, Quotation, Sales Invoice, Sales Order", - "doctype": "DocField", - "fieldname": "fs_discounts", - "fieldtype": "Check", - "label": "Sales Discounts" - }, - { - "description": "Discount Fields will be available in Purchase Order, Purchase Receipt, Purchase Invoice", - "doctype": "DocField", - "fieldname": "fs_purchase_discounts", - "fieldtype": "Check", - "label": "Purchase Discounts" - }, - { - "description": "To track any installation or commissioning related work after sales", - "doctype": "DocField", - "fieldname": "fs_after_sales_installations", - "fieldtype": "Check", - "label": "After Sale Installations" - }, - { - "description": "Available in \nBOM, Delivery Note, Purchase Invoice, Production Order, Purchase Order, Purchase Receipt, Sales Invoice, Sales Order, Stock Entry, Timesheet", - "doctype": "DocField", - "fieldname": "fs_projects", - "fieldtype": "Check", - "label": "Projects" - }, - { - "description": "If you have Sales Team and Sale Partners (Channel Partners) they can be tagged and maintain their contribution in the sales activity", - "doctype": "DocField", - "fieldname": "fs_sales_extras", - "fieldtype": "Check", - "label": "Sales Extras" - }, - { - "doctype": "DocField", - "fieldname": "accounts", - "fieldtype": "Section Break", - "label": "Accounts" - }, - { - "description": "Check if you need automatic recurring invoices. After submitting any sales invoice, Recurring section will be visible.", - "doctype": "DocField", - "fieldname": "fs_recurring_invoice", - "fieldtype": "Check", - "label": "Recurring Invoice" - }, - { - "doctype": "DocField", - "fieldname": "column_break2", - "fieldtype": "Column Break" - }, - { - "description": "To enable Point of Sale features", - "doctype": "DocField", - "fieldname": "fs_pos", - "fieldtype": "Check", - "label": "Point of Sale" - }, - { - "description": "To enable Point of Sale view", - "doctype": "DocField", - "fieldname": "fs_pos_view", - "fieldtype": "Check", - "label": "POS View" - }, - { - "doctype": "DocField", - "fieldname": "production", - "fieldtype": "Section Break", - "label": "Manufacturing" - }, - { - "description": "If you involve in manufacturing activity
\nEnables item Is Manufactured", - "doctype": "DocField", - "fieldname": "fs_manufacturing", - "fieldtype": "Check", - "label": "Manufacturing" - }, - { - "doctype": "DocField", - "fieldname": "column_break3", - "fieldtype": "Column Break" - }, - { - "description": "If you follow Quality Inspection
\nEnables item QA Required and QA No in Purchase Receipt", - "doctype": "DocField", - "fieldname": "fs_quality", - "fieldtype": "Check", - "label": "Quality" - }, - { - "doctype": "DocField", - "fieldname": "miscelleneous", - "fieldtype": "Section Break", - "label": "Miscelleneous" - }, - { - "description": "If you have long print formats, this feature can be used to split the page to be printed on multiple pages with all headers and footers on each page", - "doctype": "DocField", - "fieldname": "fs_page_break", - "fieldtype": "Check", - "label": "Page Break" - }, - { - "doctype": "DocField", - "fieldname": "column_break4", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "fs_more_info", - "fieldtype": "Check", - "label": "More Info" - }, - { - "doctype": "DocPerm", - "role": "System Manager" - }, - { - "doctype": "DocPerm", - "role": "Administrator" - } -] \ No newline at end of file +{ + "creation": "2012-12-20 12:50:49", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "materials", + "fieldtype": "Section Break", + "label": "Materials", + "permlevel": 0 + }, + { + "description": "To track item in sales and purchase documents based on their serial nos. This is can also used to track warranty details of the product.", + "fieldname": "fs_item_serial_nos", + "fieldtype": "Check", + "label": "Item Serial Nos", + "permlevel": 0 + }, + { + "description": "To track items in sales and purchase documents with batch nos
Preferred Industry: Chemicals etc", + "fieldname": "fs_item_batch_nos", + "fieldtype": "Check", + "label": "Item Batch Nos", + "permlevel": 0 + }, + { + "description": "To track brand name in the following documents
\nDelivery Note, Enuiry, Material Request, Item, Purchase Order, Purchase Voucher, Purchaser Receipt, Quotation, Sales Invoice, Sales BOM, Sales Order, Serial No", + "fieldname": "fs_brands", + "fieldtype": "Check", + "label": "Brands", + "permlevel": 0 + }, + { + "description": "To track items using barcode. You will be able to enter items in Delivery Note and Sales Invoice by scanning barcode of item.", + "fieldname": "fs_item_barcode", + "fieldtype": "Check", + "label": "Item Barcode", + "permlevel": 0 + }, + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "description": "1. To maintain the customer wise item code and to make them searchable based on their code use this option", + "fieldname": "fs_item_advanced", + "fieldtype": "Check", + "label": "Item Advanced", + "permlevel": 0 + }, + { + "description": "If Sale BOM is defined, the actual BOM of the Pack is displayed as table.\nAvailable in Delivery Note and Sales Order", + "fieldname": "fs_packing_details", + "fieldtype": "Check", + "label": "Packing Details", + "permlevel": 0 + }, + { + "description": "To get Item Group in details table", + "fieldname": "fs_item_group_in_details", + "fieldtype": "Check", + "label": "Item Groups in Details", + "permlevel": 0 + }, + { + "fieldname": "sales_and_purchase", + "fieldtype": "Section Break", + "label": "Sales and Purchase", + "permlevel": 0 + }, + { + "description": "All export related fields like currency, conversion rate, export total, export grand total etc are available in
\nDelivery Note, POS, Quotation, Sales Invoice, Sales Order etc.", + "fieldname": "fs_exports", + "fieldtype": "Check", + "label": "Exports", + "permlevel": 0 + }, + { + "description": "All import related fields like currency, conversion rate, import total, import grand total etc are available in
\nPurchase Receipt, Supplier Quotation, Purchase Invoice, Purchase Order etc.", + "fieldname": "fs_imports", + "fieldtype": "Check", + "label": "Imports", + "permlevel": 0 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "description": "Field available in Delivery Note, Quotation, Sales Invoice, Sales Order", + "fieldname": "fs_discounts", + "fieldtype": "Check", + "label": "Sales Discounts", + "permlevel": 0 + }, + { + "description": "Discount Fields will be available in Purchase Order, Purchase Receipt, Purchase Invoice", + "fieldname": "fs_purchase_discounts", + "fieldtype": "Check", + "label": "Purchase Discounts", + "permlevel": 0 + }, + { + "description": "To track any installation or commissioning related work after sales", + "fieldname": "fs_after_sales_installations", + "fieldtype": "Check", + "label": "After Sale Installations", + "permlevel": 0 + }, + { + "description": "Available in \nBOM, Delivery Note, Purchase Invoice, Production Order, Purchase Order, Purchase Receipt, Sales Invoice, Sales Order, Stock Entry, Timesheet", + "fieldname": "fs_projects", + "fieldtype": "Check", + "label": "Projects", + "permlevel": 0 + }, + { + "description": "If you have Sales Team and Sale Partners (Channel Partners) they can be tagged and maintain their contribution in the sales activity", + "fieldname": "fs_sales_extras", + "fieldtype": "Check", + "label": "Sales Extras", + "permlevel": 0 + }, + { + "fieldname": "accounts", + "fieldtype": "Section Break", + "label": "Accounts", + "permlevel": 0 + }, + { + "description": "Check if you need automatic recurring invoices. After submitting any sales invoice, Recurring section will be visible.", + "fieldname": "fs_recurring_invoice", + "fieldtype": "Check", + "label": "Recurring Invoice", + "permlevel": 0 + }, + { + "fieldname": "column_break2", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "description": "To enable Point of Sale features", + "fieldname": "fs_pos", + "fieldtype": "Check", + "label": "Point of Sale", + "permlevel": 0 + }, + { + "description": "To enable Point of Sale view", + "fieldname": "fs_pos_view", + "fieldtype": "Check", + "label": "POS View", + "permlevel": 0 + }, + { + "fieldname": "production", + "fieldtype": "Section Break", + "label": "Manufacturing", + "permlevel": 0 + }, + { + "description": "If you involve in manufacturing activity
\nEnables item Is Manufactured", + "fieldname": "fs_manufacturing", + "fieldtype": "Check", + "label": "Manufacturing", + "permlevel": 0 + }, + { + "fieldname": "column_break3", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "description": "If you follow Quality Inspection
\nEnables item QA Required and QA No in Purchase Receipt", + "fieldname": "fs_quality", + "fieldtype": "Check", + "label": "Quality", + "permlevel": 0 + }, + { + "fieldname": "miscelleneous", + "fieldtype": "Section Break", + "label": "Miscelleneous", + "permlevel": 0 + }, + { + "description": "If you have long print formats, this feature can be used to split the page to be printed on multiple pages with all headers and footers on each page", + "fieldname": "fs_page_break", + "fieldtype": "Check", + "label": "Page Break", + "permlevel": 0 + }, + { + "fieldname": "column_break4", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "fs_more_info", + "fieldtype": "Check", + "label": "More Info", + "permlevel": 0 + } + ], + "icon": "icon-glass", + "idx": 1, + "issingle": 1, + "modified": "2013-12-24 11:40:19", + "modified_by": "Administrator", + "module": "Setup", + "name": "Features Setup", + "name_case": "Title Case", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 0, + "role": "System Manager", + "submit": 0, + "write": 1 + }, + { + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 0, + "role": "Administrator", + "submit": 0, + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/setup/doctype/global_defaults/global_defaults.txt b/erpnext/setup/doctype/global_defaults/global_defaults.txt index 31ba0df9ce..adf82a533c 100644 --- a/erpnext/setup/doctype/global_defaults/global_defaults.txt +++ b/erpnext/setup/doctype/global_defaults/global_defaults.txt @@ -1,193 +1,174 @@ -[ - { - "creation": "2013-05-02 17:53:24", - "docstatus": 0, - "modified": "2014-02-19 19:11:58", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_copy": 1, - "doctype": "DocType", - "hide_toolbar": 0, - "icon": "icon-cog", - "in_create": 1, - "issingle": 1, - "module": "Setup", - "name": "__common__", - "read_only": 1 - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Global Defaults", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "amend": 0, - "cancel": 0, - "create": 1, - "doctype": "DocPerm", - "name": "__common__", - "parent": "Global Defaults", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "read": 1, - "report": 0, - "role": "System Manager", - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Global Defaults" - }, - { - "doctype": "DocField", - "fieldname": "date_and_number_settings", - "fieldtype": "Section Break", - "label": "Date and Number Settings" - }, - { - "default": "dd-mm-yyyy", - "doctype": "DocField", - "fieldname": "date_format", - "fieldtype": "Select", - "label": "Date Format", - "options": "yyyy-mm-dd\ndd-mm-yyyy\ndd/mm/yyyy\nmm/dd/yyyy\nmm-dd-yyyy", - "read_only": 0 - }, - { - "description": "This is the default number format. For currencies, please set the number format in the currency master.", - "doctype": "DocField", - "fieldname": "number_format", - "fieldtype": "Select", - "label": "Number Format", - "options": "\n#,###.##\n#.###,##\n# ###.##\n#,###.###\n#,##,###.##\n#.###\n#,###", - "read_only": 0 - }, - { - "default": "3", - "description": "Precision for Float fields (quantities, discounts, percentages etc). Floats will be rounded up to specified decimals. Default = 3", - "doctype": "DocField", - "fieldname": "float_precision", - "fieldtype": "Select", - "label": "Float Precision", - "options": "\n2\n3\n4\n5\n6", - "read_only": 0 - }, - { - "description": "If disable, 'Rounded Total' field will not be visible in any transaction", - "doctype": "DocField", - "fieldname": "disable_rounded_total", - "fieldtype": "Check", - "label": "Disable Rounded Total", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "currency_settings", - "fieldtype": "Section Break", - "label": "Currency Settings" - }, - { - "default": "INR", - "doctype": "DocField", - "fieldname": "default_currency", - "fieldtype": "Link", - "label": "Default Currency", - "options": "Currency", - "read_only": 0, - "reqd": 1 - }, - { - "description": "Do not show any symbol like $ etc next to currencies.", - "doctype": "DocField", - "fieldname": "hide_currency_symbol", - "fieldtype": "Select", - "label": "Hide Currency Symbol", - "options": "\nNo\nYes", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Section Break", - "label": "Company Settings", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "default_company", - "fieldtype": "Link", - "label": "Default Company", - "options": "Company", - "read_only": 0, - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "current_fiscal_year", - "fieldtype": "Link", - "label": "Current Fiscal Year", - "options": "Fiscal Year", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "system", - "fieldtype": "Section Break", - "label": "System Settings", - "read_only": 0 - }, - { - "description": "Session Expiry in Hours e.g. 06:00", - "doctype": "DocField", - "fieldname": "session_expiry", - "fieldtype": "Data", - "label": "Session Expiry", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "country", - "fieldtype": "Select", - "label": "Country", - "options": "link:Country" - }, - { - "doctype": "DocField", - "fieldname": "sms_sender_name", - "fieldtype": "Data", - "label": "SMS Sender Name", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break_3", - "fieldtype": "Column Break", - "read_only": 0 - }, - { - "description": "For Server Side Print Formats", - "doctype": "DocField", - "fieldname": "print_style", - "fieldtype": "Select", - "label": "Print Format Style", - "options": "Standard\nClassic\nModern\nSpartan", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "time_zone", - "fieldtype": "Select", - "label": "Time Zone" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "allow_copy": 1, + "creation": "2013-05-02 17:53:24", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "date_and_number_settings", + "fieldtype": "Section Break", + "label": "Date and Number Settings", + "permlevel": 0 + }, + { + "default": "dd-mm-yyyy", + "fieldname": "date_format", + "fieldtype": "Select", + "label": "Date Format", + "options": "yyyy-mm-dd\ndd-mm-yyyy\ndd/mm/yyyy\nmm/dd/yyyy\nmm-dd-yyyy", + "permlevel": 0, + "read_only": 0 + }, + { + "description": "This is the default number format. For currencies, please set the number format in the currency master.", + "fieldname": "number_format", + "fieldtype": "Select", + "label": "Number Format", + "options": "\n#,###.##\n#.###,##\n# ###.##\n#,###.###\n#,##,###.##\n#.###\n#,###", + "permlevel": 0, + "read_only": 0 + }, + { + "default": "3", + "description": "Precision for Float fields (quantities, discounts, percentages etc). Floats will be rounded up to specified decimals. Default = 3", + "fieldname": "float_precision", + "fieldtype": "Select", + "label": "Float Precision", + "options": "\n2\n3\n4\n5\n6", + "permlevel": 0, + "read_only": 0 + }, + { + "description": "If disable, 'Rounded Total' field will not be visible in any transaction", + "fieldname": "disable_rounded_total", + "fieldtype": "Check", + "label": "Disable Rounded Total", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "currency_settings", + "fieldtype": "Section Break", + "label": "Currency Settings", + "permlevel": 0 + }, + { + "default": "INR", + "fieldname": "default_currency", + "fieldtype": "Link", + "label": "Default Currency", + "options": "Currency", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "description": "Do not show any symbol like $ etc next to currencies.", + "fieldname": "hide_currency_symbol", + "fieldtype": "Select", + "label": "Hide Currency Symbol", + "options": "\nNo\nYes", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "company", + "fieldtype": "Section Break", + "label": "Company Settings", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "default_company", + "fieldtype": "Link", + "label": "Default Company", + "options": "Company", + "permlevel": 0, + "read_only": 0, + "reqd": 0 + }, + { + "fieldname": "current_fiscal_year", + "fieldtype": "Link", + "label": "Current Fiscal Year", + "options": "Fiscal Year", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "system", + "fieldtype": "Section Break", + "label": "System Settings", + "permlevel": 0, + "read_only": 0 + }, + { + "description": "Session Expiry in Hours e.g. 06:00", + "fieldname": "session_expiry", + "fieldtype": "Data", + "label": "Session Expiry", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "country", + "fieldtype": "Select", + "label": "Country", + "options": "link:Country", + "permlevel": 0 + }, + { + "fieldname": "sms_sender_name", + "fieldtype": "Data", + "label": "SMS Sender Name", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "column_break_3", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0 + }, + { + "description": "For Server Side Print Formats", + "fieldname": "print_style", + "fieldtype": "Select", + "label": "Print Format Style", + "options": "Standard\nClassic\nModern\nSpartan", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "time_zone", + "fieldtype": "Select", + "label": "Time Zone", + "permlevel": 0 + } + ], + "hide_toolbar": 0, + "icon": "icon-cog", + "idx": 1, + "in_create": 1, + "issingle": 1, + "modified": "2014-02-19 19:11:58", + "modified_by": "Administrator", + "module": "Setup", + "name": "Global Defaults", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "permlevel": 0, + "read": 1, + "report": 0, + "role": "System Manager", + "submit": 0, + "write": 1 + } + ], + "read_only": 1 +} \ No newline at end of file diff --git a/erpnext/setup/doctype/item_group/item_group.txt b/erpnext/setup/doctype/item_group/item_group.txt index 8bd9e7f237..b463cb0ad1 100644 --- a/erpnext/setup/doctype/item_group/item_group.txt +++ b/erpnext/setup/doctype/item_group/item_group.txt @@ -1,228 +1,239 @@ -[ - { - "creation": "2013-03-28 10:35:29", - "docstatus": 0, - "modified": "2014-02-20 18:29:57", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_attach": 1, - "allow_import": 1, - "allow_rename": 1, - "autoname": "field:item_group_name", - "description": "Item Classification", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-sitemap", - "in_create": 1, - "issingle": 0, - "max_attachments": 3, - "module": "Setup", - "name": "__common__", - "search_fields": "parent_item_group" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Item Group", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "cancel": 0, - "delete": 0, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Item Group", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1 - }, - { - "doctype": "DocType", - "name": "Item Group" - }, - { - "doctype": "DocField", - "fieldname": "item_group_name", - "fieldtype": "Data", - "label": "Item Group Name", - "no_copy": 0, - "oldfieldname": "item_group_name", - "oldfieldtype": "Data", - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "page_name", - "fieldtype": "Data", - "label": "Page Name", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "cb0", - "fieldtype": "Column Break" - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "parent_item_group", - "fieldtype": "Link", - "ignore_restrictions": 1, - "label": "Parent Item Group", - "no_copy": 0, - "oldfieldname": "parent_item_group", - "oldfieldtype": "Link", - "options": "Item Group", - "reqd": 0, - "search_index": 0 - }, - { - "description": "Only leaf nodes are allowed in transaction", - "doctype": "DocField", - "fieldname": "is_group", - "fieldtype": "Select", - "label": "Has Child Node", - "no_copy": 0, - "oldfieldname": "is_group", - "oldfieldtype": "Select", - "options": "\nYes\nNo", - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "sb9", - "fieldtype": "Section Break", - "label": "Website Settings" - }, - { - "description": "Check this if you want to show in website", - "doctype": "DocField", - "fieldname": "show_in_website", - "fieldtype": "Check", - "label": "Show in Website", - "no_copy": 0, - "search_index": 0 - }, - { - "depends_on": "show_in_website", - "doctype": "DocField", - "fieldname": "parent_website_route", - "fieldtype": "Link", - "label": "Parent Website Page", - "options": "Website Route" - }, - { - "depends_on": "show_in_website", - "description": "Show this slideshow at the top of the page", - "doctype": "DocField", - "fieldname": "slideshow", - "fieldtype": "Link", - "label": "Slideshow", - "options": "Website Slideshow" - }, - { - "depends_on": "show_in_website", - "description": "HTML / Banner that will show on the top of product list.", - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Text Editor", - "label": "Description" - }, - { - "depends_on": "show_in_website", - "doctype": "DocField", - "fieldname": "item_website_specifications", - "fieldtype": "Table", - "label": "Item Website Specifications", - "options": "Item Website Specification" - }, - { - "doctype": "DocField", - "fieldname": "lft", - "fieldtype": "Int", - "hidden": 1, - "in_filter": 1, - "label": "lft", - "no_copy": 1, - "oldfieldname": "lft", - "oldfieldtype": "Int", - "print_hide": 1, - "report_hide": 0, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "rgt", - "fieldtype": "Int", - "hidden": 1, - "in_filter": 1, - "label": "rgt", - "no_copy": 1, - "oldfieldname": "rgt", - "oldfieldtype": "Int", - "print_hide": 1, - "report_hide": 0, - "search_index": 1 - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "old_parent", - "fieldtype": "Link", - "hidden": 1, - "ignore_restrictions": 1, - "label": "old_parent", - "no_copy": 1, - "oldfieldname": "old_parent", - "oldfieldtype": "Data", - "options": "Item Group", - "print_hide": 1, - "report_hide": 1, - "search_index": 0 - }, - { - "amend": 0, - "create": 0, - "doctype": "DocPerm", - "role": "Material Manager", - "submit": 0, - "write": 0 - }, - { - "amend": 0, - "create": 0, - "doctype": "DocPerm", - "role": "Material User", - "submit": 0, - "write": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "role": "Material Master Manager", - "submit": 0, - "write": 1 - }, - { - "doctype": "DocPerm", - "role": "Sales User" - }, - { - "doctype": "DocPerm", - "role": "Purchase User" - }, - { - "doctype": "DocPerm", - "role": "Accounts User" - } -] \ No newline at end of file +{ + "allow_attach": 1, + "allow_import": 1, + "allow_rename": 1, + "autoname": "field:item_group_name", + "creation": "2013-03-28 10:35:29", + "description": "Item Classification", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "item_group_name", + "fieldtype": "Data", + "label": "Item Group Name", + "no_copy": 0, + "oldfieldname": "item_group_name", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "page_name", + "fieldtype": "Data", + "label": "Page Name", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "cb0", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "description": "Add / Edit", + "fieldname": "parent_item_group", + "fieldtype": "Link", + "ignore_restrictions": 1, + "label": "Parent Item Group", + "no_copy": 0, + "oldfieldname": "parent_item_group", + "oldfieldtype": "Link", + "options": "Item Group", + "permlevel": 0, + "reqd": 0, + "search_index": 0 + }, + { + "description": "Only leaf nodes are allowed in transaction", + "fieldname": "is_group", + "fieldtype": "Select", + "label": "Has Child Node", + "no_copy": 0, + "oldfieldname": "is_group", + "oldfieldtype": "Select", + "options": "\nYes\nNo", + "permlevel": 0, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "sb9", + "fieldtype": "Section Break", + "label": "Website Settings", + "permlevel": 0 + }, + { + "description": "Check this if you want to show in website", + "fieldname": "show_in_website", + "fieldtype": "Check", + "label": "Show in Website", + "no_copy": 0, + "permlevel": 0, + "search_index": 0 + }, + { + "depends_on": "show_in_website", + "fieldname": "parent_website_route", + "fieldtype": "Link", + "label": "Parent Website Page", + "options": "Website Route", + "permlevel": 0 + }, + { + "depends_on": "show_in_website", + "description": "Show this slideshow at the top of the page", + "fieldname": "slideshow", + "fieldtype": "Link", + "label": "Slideshow", + "options": "Website Slideshow", + "permlevel": 0 + }, + { + "depends_on": "show_in_website", + "description": "HTML / Banner that will show on the top of product list.", + "fieldname": "description", + "fieldtype": "Text Editor", + "label": "Description", + "permlevel": 0 + }, + { + "depends_on": "show_in_website", + "fieldname": "item_website_specifications", + "fieldtype": "Table", + "label": "Item Website Specifications", + "options": "Item Website Specification", + "permlevel": 0 + }, + { + "fieldname": "lft", + "fieldtype": "Int", + "hidden": 1, + "in_filter": 1, + "label": "lft", + "no_copy": 1, + "oldfieldname": "lft", + "oldfieldtype": "Int", + "permlevel": 0, + "print_hide": 1, + "report_hide": 0, + "search_index": 1 + }, + { + "fieldname": "rgt", + "fieldtype": "Int", + "hidden": 1, + "in_filter": 1, + "label": "rgt", + "no_copy": 1, + "oldfieldname": "rgt", + "oldfieldtype": "Int", + "permlevel": 0, + "print_hide": 1, + "report_hide": 0, + "search_index": 1 + }, + { + "description": "Add / Edit", + "fieldname": "old_parent", + "fieldtype": "Link", + "hidden": 1, + "ignore_restrictions": 1, + "label": "old_parent", + "no_copy": 1, + "oldfieldname": "old_parent", + "oldfieldtype": "Data", + "options": "Item Group", + "permlevel": 0, + "print_hide": 1, + "report_hide": 1, + "search_index": 0 + } + ], + "icon": "icon-sitemap", + "idx": 1, + "in_create": 1, + "issingle": 0, + "max_attachments": 3, + "modified": "2014-02-20 18:29:57", + "modified_by": "Administrator", + "module": "Setup", + "name": "Item Group", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material Manager", + "submit": 0, + "write": 0 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material User", + "submit": 0, + "write": 0 + }, + { + "cancel": 0, + "create": 1, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material Master Manager", + "submit": 0, + "write": 1 + }, + { + "cancel": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales User" + }, + { + "cancel": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase User" + }, + { + "cancel": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts User" + } + ], + "search_fields": "parent_item_group" +} \ No newline at end of file diff --git a/erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.txt b/erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.txt index 24a424054c..18f71febdf 100644 --- a/erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.txt +++ b/erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.txt @@ -1,92 +1,73 @@ -[ - { - "creation": "2013-01-15 16:50:01", - "docstatus": 0, - "modified": "2013-12-20 19:23:16", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "description": "Email settings for jobs email id \"jobs@example.com\"", - "doctype": "DocType", - "icon": "icon-cog", - "issingle": 1, - "module": "Setup", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Jobs Email Settings", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Jobs Email Settings", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "role": "System Manager", - "write": 1 - }, - { - "doctype": "DocType", - "name": "Jobs Email Settings" - }, - { - "description": "Settings to extract Job Applicants from a mailbox e.g. \"jobs@example.com\"", - "doctype": "DocField", - "fieldname": "pop3_mail_settings", - "fieldtype": "Section Break", - "label": "POP3 Mail Settings" - }, - { - "description": "Check to activate", - "doctype": "DocField", - "fieldname": "extract_emails", - "fieldtype": "Check", - "label": "Extract Emails" - }, - { - "description": "Email Id where a job applicant will email e.g. \"jobs@example.com\"", - "doctype": "DocField", - "fieldname": "email_id", - "fieldtype": "Data", - "label": "Email Id" - }, - { - "description": "POP3 server e.g. (pop.gmail.com)", - "doctype": "DocField", - "fieldname": "host", - "fieldtype": "Data", - "label": "Host" - }, - { - "doctype": "DocField", - "fieldname": "use_ssl", - "fieldtype": "Check", - "label": "Use SSL" - }, - { - "doctype": "DocField", - "fieldname": "username", - "fieldtype": "Data", - "label": "Username" - }, - { - "doctype": "DocField", - "fieldname": "password", - "fieldtype": "Password", - "label": "Password" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "creation": "2013-01-15 16:50:01", + "description": "Email settings for jobs email id \"jobs@example.com\"", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "description": "Settings to extract Job Applicants from a mailbox e.g. \"jobs@example.com\"", + "fieldname": "pop3_mail_settings", + "fieldtype": "Section Break", + "label": "POP3 Mail Settings", + "permlevel": 0 + }, + { + "description": "Check to activate", + "fieldname": "extract_emails", + "fieldtype": "Check", + "label": "Extract Emails", + "permlevel": 0 + }, + { + "description": "Email Id where a job applicant will email e.g. \"jobs@example.com\"", + "fieldname": "email_id", + "fieldtype": "Data", + "label": "Email Id", + "permlevel": 0 + }, + { + "description": "POP3 server e.g. (pop.gmail.com)", + "fieldname": "host", + "fieldtype": "Data", + "label": "Host", + "permlevel": 0 + }, + { + "fieldname": "use_ssl", + "fieldtype": "Check", + "label": "Use SSL", + "permlevel": 0 + }, + { + "fieldname": "username", + "fieldtype": "Data", + "label": "Username", + "permlevel": 0 + }, + { + "fieldname": "password", + "fieldtype": "Password", + "label": "Password", + "permlevel": 0 + } + ], + "icon": "icon-cog", + "idx": 1, + "issingle": 1, + "modified": "2013-12-20 19:23:16", + "modified_by": "Administrator", + "module": "Setup", + "name": "Jobs Email Settings", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "role": "System Manager", + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/setup/doctype/naming_series/naming_series.txt b/erpnext/setup/doctype/naming_series/naming_series.txt index dd28eac340..36b1184784 100644 --- a/erpnext/setup/doctype/naming_series/naming_series.txt +++ b/erpnext/setup/doctype/naming_series/naming_series.txt @@ -1,117 +1,98 @@ -[ - { - "creation": "2013-01-25 11:35:08", - "docstatus": 0, - "modified": "2013-12-20 19:23:21", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "description": "Set prefix for numbering series on your transactions", - "doctype": "DocType", - "hide_heading": 0, - "hide_toolbar": 1, - "icon": "icon-sort-by-order", - "issingle": 1, - "module": "Setup", - "name": "__common__", - "read_only": 1 - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Naming Series", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Naming Series", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 0, - "role": "System Manager", - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Naming Series" - }, - { - "description": "Set prefix for numbering series on your transactions", - "doctype": "DocField", - "fieldname": "setup_series", - "fieldtype": "Section Break", - "label": "Setup Series" - }, - { - "doctype": "DocField", - "fieldname": "select_doc_for_series", - "fieldtype": "Select", - "label": "Select Transaction" - }, - { - "doctype": "DocField", - "fieldname": "help_html", - "fieldtype": "HTML", - "label": "Help HTML", - "options": "
\nEdit list of Series in the box below. Rules:\n
    \n
  • Each Series Prefix on a new line.
  • \n
  • Allowed special characters are \"/\" and \"-\"
  • \n
  • Optionally, set the number of digits in the series using dot (.) followed by hashes (#). For example, \".####\" means that the series will have four digits. Default is five digits.
  • \n
\nExamples:
\nINV-
\nINV-10-
\nINVK-
\nINV-.####
\n
" - }, - { - "doctype": "DocField", - "fieldname": "set_options", - "fieldtype": "Text", - "label": "Series List for this Transaction" - }, - { - "description": "Check this if you want to force the user to select a series before saving. There will be no default if you check this.", - "doctype": "DocField", - "fieldname": "user_must_always_select", - "fieldtype": "Check", - "label": "User must always select" - }, - { - "doctype": "DocField", - "fieldname": "update", - "fieldtype": "Button", - "label": "Update" - }, - { - "description": "Change the starting / current sequence number of an existing series.", - "doctype": "DocField", - "fieldname": "update_series", - "fieldtype": "Section Break", - "label": "Update Series" - }, - { - "doctype": "DocField", - "fieldname": "prefix", - "fieldtype": "Select", - "label": "Prefix" - }, - { - "description": "This is the number of the last created transaction with this prefix", - "doctype": "DocField", - "fieldname": "current_value", - "fieldtype": "Int", - "label": "Current Value" - }, - { - "doctype": "DocField", - "fieldname": "update_series_start", - "fieldtype": "Button", - "label": "Update Series Number", - "options": "update_series_start" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "creation": "2013-01-25 11:35:08", + "description": "Set prefix for numbering series on your transactions", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "description": "Set prefix for numbering series on your transactions", + "fieldname": "setup_series", + "fieldtype": "Section Break", + "label": "Setup Series", + "permlevel": 0 + }, + { + "fieldname": "select_doc_for_series", + "fieldtype": "Select", + "label": "Select Transaction", + "permlevel": 0 + }, + { + "fieldname": "help_html", + "fieldtype": "HTML", + "label": "Help HTML", + "options": "
\nEdit list of Series in the box below. Rules:\n
    \n
  • Each Series Prefix on a new line.
  • \n
  • Allowed special characters are \"/\" and \"-\"
  • \n
  • Optionally, set the number of digits in the series using dot (.) followed by hashes (#). For example, \".####\" means that the series will have four digits. Default is five digits.
  • \n
\nExamples:
\nINV-
\nINV-10-
\nINVK-
\nINV-.####
\n
", + "permlevel": 0 + }, + { + "fieldname": "set_options", + "fieldtype": "Text", + "label": "Series List for this Transaction", + "permlevel": 0 + }, + { + "description": "Check this if you want to force the user to select a series before saving. There will be no default if you check this.", + "fieldname": "user_must_always_select", + "fieldtype": "Check", + "label": "User must always select", + "permlevel": 0 + }, + { + "fieldname": "update", + "fieldtype": "Button", + "label": "Update", + "permlevel": 0 + }, + { + "description": "Change the starting / current sequence number of an existing series.", + "fieldname": "update_series", + "fieldtype": "Section Break", + "label": "Update Series", + "permlevel": 0 + }, + { + "fieldname": "prefix", + "fieldtype": "Select", + "label": "Prefix", + "permlevel": 0 + }, + { + "description": "This is the number of the last created transaction with this prefix", + "fieldname": "current_value", + "fieldtype": "Int", + "label": "Current Value", + "permlevel": 0 + }, + { + "fieldname": "update_series_start", + "fieldtype": "Button", + "label": "Update Series Number", + "options": "update_series_start", + "permlevel": 0 + } + ], + "hide_heading": 0, + "hide_toolbar": 1, + "icon": "icon-sort-by-order", + "idx": 1, + "issingle": 1, + "modified": "2013-12-20 19:23:21", + "modified_by": "Administrator", + "module": "Setup", + "name": "Naming Series", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 0, + "role": "System Manager", + "submit": 0, + "write": 1 + } + ], + "read_only": 1 +} \ No newline at end of file diff --git a/erpnext/setup/doctype/notification_control/notification_control.txt b/erpnext/setup/doctype/notification_control/notification_control.txt index 81e08a552e..628db7714d 100644 --- a/erpnext/setup/doctype/notification_control/notification_control.txt +++ b/erpnext/setup/doctype/notification_control/notification_control.txt @@ -1,218 +1,200 @@ -[ - { - "creation": "2012-07-12 23:29:45", - "docstatus": 0, - "modified": "2013-07-10 19:24:07", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_copy": 1, - "allow_email": 1, - "allow_print": 1, - "description": "Send automatic emails to Contacts on Submitting transactions.", - "doctype": "DocType", - "icon": "icon-envelope", - "issingle": 1, - "module": "Setup", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Notification Control", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocPerm", - "name": "__common__", - "parent": "Notification Control", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "read": 1 - }, - { - "doctype": "DocType", - "name": "Notification Control" - }, - { - "description": "When any of the checked transactions are \"Submitted\", an email pop-up automatically opened to send an email to the associated \"Contact\" in that transaction, with the transaction as an attachment. The user may or may not send the email.", - "doctype": "DocField", - "fieldname": "send_autonotification_for", - "fieldtype": "Section Break", - "in_list_view": 0, - "label": "Prompt for Email on Submission of" - }, - { - "doctype": "DocField", - "fieldname": "sales", - "fieldtype": "Column Break", - "in_list_view": 0, - "label": "Sales", - "print_width": "50%", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "quotation", - "fieldtype": "Check", - "in_list_view": 1, - "label": "Quotation" - }, - { - "doctype": "DocField", - "fieldname": "sales_order", - "fieldtype": "Check", - "in_list_view": 1, - "label": "Sales Order" - }, - { - "doctype": "DocField", - "fieldname": "delivery_note", - "fieldtype": "Check", - "in_list_view": 1, - "label": "Delivery Note" - }, - { - "doctype": "DocField", - "fieldname": "sales_invoice", - "fieldtype": "Check", - "in_list_view": 1, - "label": "Sales Invoice" - }, - { - "doctype": "DocField", - "fieldname": "purchase", - "fieldtype": "Column Break", - "in_list_view": 0, - "label": "Purchase", - "print_width": "50%", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "purchase_order", - "fieldtype": "Check", - "in_list_view": 1, - "label": "Purchase Order" - }, - { - "doctype": "DocField", - "fieldname": "purchase_receipt", - "fieldtype": "Check", - "in_list_view": 1, - "label": "Purchase Receipt" - }, - { - "doctype": "DocField", - "fieldname": "expense_claim", - "fieldtype": "Check", - "label": "Expense Claim" - }, - { - "description": "Customize the introductory text that goes as a part of that email. Each transaction has a separate introductory text.", - "doctype": "DocField", - "fieldname": "customize_the_notification", - "fieldtype": "Section Break", - "label": "Customize the Notification" - }, - { - "doctype": "DocField", - "fieldname": "select_transaction", - "fieldtype": "Select", - "label": "Select Transaction", - "options": "\nQuotation\nSales Order\nDelivery Note\nSales Invoice\nPurchase Order\nPurchase Receipt\nExpense Claim\nExpense Claim Approved\nExpense Claim Rejected" - }, - { - "doctype": "DocField", - "fieldname": "custom_message", - "fieldtype": "Text Editor", - "label": "Custom Message" - }, - { - "doctype": "DocField", - "fieldname": "update", - "fieldtype": "Button", - "label": "Update", - "options": "set_message" - }, - { - "doctype": "DocField", - "fieldname": "quotation_message", - "fieldtype": "Text", - "hidden": 1, - "label": "Quotation Message", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "sales_order_message", - "fieldtype": "Text", - "hidden": 1, - "label": "Sales Order Message", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "delivery_note_message", - "fieldtype": "Text", - "hidden": 1, - "label": "Delivery Note Message", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "sales_invoice_message", - "fieldtype": "Text", - "hidden": 1, - "label": "Sales Invoice Message", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "purchase_order_message", - "fieldtype": "Text", - "hidden": 1, - "label": "Purchase Order Message", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "purchase_receipt_message", - "fieldtype": "Text", - "hidden": 1, - "label": "Purchase Receipt Message", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "expense_claim_approved_message", - "fieldtype": "Text", - "hidden": 1, - "label": "Expense Claim Approved Message", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "expense_claim_rejected_message", - "fieldtype": "Text", - "hidden": 1, - "label": "Expense Claim Rejected Message", - "print_hide": 1 - }, - { - "create": 0, - "doctype": "DocPerm", - "role": "Guest", - "write": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "role": "System Manager", - "write": 1 - } -] \ No newline at end of file +{ + "allow_copy": 1, + "allow_email": 1, + "allow_print": 1, + "creation": "2012-07-12 23:29:45", + "description": "Send automatic emails to Contacts on Submitting transactions.", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "description": "When any of the checked transactions are \"Submitted\", an email pop-up automatically opened to send an email to the associated \"Contact\" in that transaction, with the transaction as an attachment. The user may or may not send the email.", + "fieldname": "send_autonotification_for", + "fieldtype": "Section Break", + "in_list_view": 0, + "label": "Prompt for Email on Submission of", + "permlevel": 0 + }, + { + "fieldname": "sales", + "fieldtype": "Column Break", + "in_list_view": 0, + "label": "Sales", + "permlevel": 0, + "print_width": "50%", + "width": "50%" + }, + { + "fieldname": "quotation", + "fieldtype": "Check", + "in_list_view": 1, + "label": "Quotation", + "permlevel": 0 + }, + { + "fieldname": "sales_order", + "fieldtype": "Check", + "in_list_view": 1, + "label": "Sales Order", + "permlevel": 0 + }, + { + "fieldname": "delivery_note", + "fieldtype": "Check", + "in_list_view": 1, + "label": "Delivery Note", + "permlevel": 0 + }, + { + "fieldname": "sales_invoice", + "fieldtype": "Check", + "in_list_view": 1, + "label": "Sales Invoice", + "permlevel": 0 + }, + { + "fieldname": "purchase", + "fieldtype": "Column Break", + "in_list_view": 0, + "label": "Purchase", + "permlevel": 0, + "print_width": "50%", + "width": "50%" + }, + { + "fieldname": "purchase_order", + "fieldtype": "Check", + "in_list_view": 1, + "label": "Purchase Order", + "permlevel": 0 + }, + { + "fieldname": "purchase_receipt", + "fieldtype": "Check", + "in_list_view": 1, + "label": "Purchase Receipt", + "permlevel": 0 + }, + { + "fieldname": "expense_claim", + "fieldtype": "Check", + "label": "Expense Claim", + "permlevel": 0 + }, + { + "description": "Customize the introductory text that goes as a part of that email. Each transaction has a separate introductory text.", + "fieldname": "customize_the_notification", + "fieldtype": "Section Break", + "label": "Customize the Notification", + "permlevel": 0 + }, + { + "fieldname": "select_transaction", + "fieldtype": "Select", + "label": "Select Transaction", + "options": "\nQuotation\nSales Order\nDelivery Note\nSales Invoice\nPurchase Order\nPurchase Receipt\nExpense Claim\nExpense Claim Approved\nExpense Claim Rejected", + "permlevel": 0 + }, + { + "fieldname": "custom_message", + "fieldtype": "Text Editor", + "label": "Custom Message", + "permlevel": 0 + }, + { + "fieldname": "update", + "fieldtype": "Button", + "label": "Update", + "options": "set_message", + "permlevel": 0 + }, + { + "fieldname": "quotation_message", + "fieldtype": "Text", + "hidden": 1, + "label": "Quotation Message", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "sales_order_message", + "fieldtype": "Text", + "hidden": 1, + "label": "Sales Order Message", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "delivery_note_message", + "fieldtype": "Text", + "hidden": 1, + "label": "Delivery Note Message", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "sales_invoice_message", + "fieldtype": "Text", + "hidden": 1, + "label": "Sales Invoice Message", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "purchase_order_message", + "fieldtype": "Text", + "hidden": 1, + "label": "Purchase Order Message", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "purchase_receipt_message", + "fieldtype": "Text", + "hidden": 1, + "label": "Purchase Receipt Message", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "expense_claim_approved_message", + "fieldtype": "Text", + "hidden": 1, + "label": "Expense Claim Approved Message", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "expense_claim_rejected_message", + "fieldtype": "Text", + "hidden": 1, + "label": "Expense Claim Rejected Message", + "permlevel": 0, + "print_hide": 1 + } + ], + "icon": "icon-envelope", + "idx": 1, + "issingle": 1, + "modified": "2013-07-10 19:24:07", + "modified_by": "Administrator", + "module": "Setup", + "name": "Notification Control", + "owner": "Administrator", + "permissions": [ + { + "create": 0, + "permlevel": 0, + "read": 1, + "role": "Guest", + "write": 0 + }, + { + "create": 1, + "permlevel": 0, + "read": 1, + "role": "System Manager", + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/setup/doctype/print_heading/print_heading.txt b/erpnext/setup/doctype/print_heading/print_heading.txt index d566f8dee2..9724f6203e 100644 --- a/erpnext/setup/doctype/print_heading/print_heading.txt +++ b/erpnext/setup/doctype/print_heading/print_heading.txt @@ -1,80 +1,61 @@ -[ - { - "creation": "2013-01-10 16:34:24", - "docstatus": 0, - "modified": "2014-01-20 17:49:01", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "autoname": "field:print_heading", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-font", - "module": "Setup", - "name": "__common__", - "search_fields": "print_heading" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Print Heading", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "cancel": 0, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Print Heading", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "All", - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Print Heading" - }, - { - "doctype": "DocField", - "fieldname": "trash_reason", - "fieldtype": "Small Text", - "label": "Trash Reason", - "oldfieldname": "trash_reason", - "oldfieldtype": "Small Text", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "print_heading", - "fieldtype": "Data", - "in_filter": 1, - "label": "Print Heading", - "oldfieldname": "print_heading", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Small Text", - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Small Text", - "width": "300px" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "allow_import": 1, + "autoname": "field:print_heading", + "creation": "2013-01-10 16:34:24", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "trash_reason", + "fieldtype": "Small Text", + "label": "Trash Reason", + "oldfieldname": "trash_reason", + "oldfieldtype": "Small Text", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "print_heading", + "fieldtype": "Data", + "in_filter": 1, + "label": "Print Heading", + "oldfieldname": "print_heading", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "description", + "fieldtype": "Small Text", + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Small Text", + "permlevel": 0, + "width": "300px" + } + ], + "icon": "icon-font", + "idx": 1, + "modified": "2014-01-20 17:49:01", + "modified_by": "Administrator", + "module": "Setup", + "name": "Print Heading", + "owner": "Administrator", + "permissions": [ + { + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "All", + "submit": 0, + "write": 1 + } + ], + "search_fields": "print_heading" +} \ No newline at end of file diff --git a/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.txt b/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.txt index 00e9c6ea4e..b27d349552 100644 --- a/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.txt +++ b/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.txt @@ -1,70 +1,51 @@ -[ - { - "creation": "2013-01-10 16:34:24", - "docstatus": 0, - "modified": "2014-01-20 17:49:17", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "autoname": "field:order_lost_reason", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-flag", - "module": "Setup", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Quotation Lost Reason", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "amend": 0, - "cancel": 0, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Quotation Lost Reason", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Sales Master Manager", - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Quotation Lost Reason" - }, - { - "doctype": "DocField", - "fieldname": "trash_reason", - "fieldtype": "Small Text", - "label": "Trash Reason", - "oldfieldname": "trash_reason", - "oldfieldtype": "Small Text", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "order_lost_reason", - "fieldtype": "Data", - "label": "Quotation Lost Reason", - "oldfieldname": "order_lost_reason", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "allow_import": 1, + "autoname": "field:order_lost_reason", + "creation": "2013-01-10 16:34:24", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "trash_reason", + "fieldtype": "Small Text", + "label": "Trash Reason", + "oldfieldname": "trash_reason", + "oldfieldtype": "Small Text", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "order_lost_reason", + "fieldtype": "Data", + "label": "Quotation Lost Reason", + "oldfieldname": "order_lost_reason", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + } + ], + "icon": "icon-flag", + "idx": 1, + "modified": "2014-01-20 17:49:17", + "modified_by": "Administrator", + "module": "Setup", + "name": "Quotation Lost Reason", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales Master Manager", + "submit": 0, + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/setup/doctype/sales_email_settings/sales_email_settings.txt b/erpnext/setup/doctype/sales_email_settings/sales_email_settings.txt index f5f8a97fa1..4e0891e0d8 100644 --- a/erpnext/setup/doctype/sales_email_settings/sales_email_settings.txt +++ b/erpnext/setup/doctype/sales_email_settings/sales_email_settings.txt @@ -1,92 +1,73 @@ -[ - { - "creation": "2013-01-16 10:25:26", - "docstatus": 0, - "modified": "2013-12-20 19:21:38", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "description": "Email settings to extract Leads from sales email id e.g. \"sales@example.com\"", - "doctype": "DocType", - "icon": "icon-cog", - "issingle": 1, - "module": "Setup", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Sales Email Settings", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Sales Email Settings", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "role": "System Manager", - "write": 1 - }, - { - "doctype": "DocType", - "name": "Sales Email Settings" - }, - { - "description": "Email settings to extract Leads from sales email id e.g. \"sales@example.com\"", - "doctype": "DocField", - "fieldname": "pop3_mail_settings", - "fieldtype": "Section Break", - "label": "POP3 Mail Settings" - }, - { - "description": "Check to activate", - "doctype": "DocField", - "fieldname": "extract_emails", - "fieldtype": "Check", - "label": "Extract Emails" - }, - { - "description": "Email Id where a job applicant will email e.g. \"jobs@example.com\"", - "doctype": "DocField", - "fieldname": "email_id", - "fieldtype": "Data", - "label": "Email Id" - }, - { - "description": "POP3 server e.g. (pop.gmail.com)", - "doctype": "DocField", - "fieldname": "host", - "fieldtype": "Data", - "label": "Host" - }, - { - "doctype": "DocField", - "fieldname": "use_ssl", - "fieldtype": "Check", - "label": "Use SSL" - }, - { - "doctype": "DocField", - "fieldname": "username", - "fieldtype": "Data", - "label": "Username" - }, - { - "doctype": "DocField", - "fieldname": "password", - "fieldtype": "Password", - "label": "Password" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "creation": "2013-01-16 10:25:26", + "description": "Email settings to extract Leads from sales email id e.g. \"sales@example.com\"", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "description": "Email settings to extract Leads from sales email id e.g. \"sales@example.com\"", + "fieldname": "pop3_mail_settings", + "fieldtype": "Section Break", + "label": "POP3 Mail Settings", + "permlevel": 0 + }, + { + "description": "Check to activate", + "fieldname": "extract_emails", + "fieldtype": "Check", + "label": "Extract Emails", + "permlevel": 0 + }, + { + "description": "Email Id where a job applicant will email e.g. \"jobs@example.com\"", + "fieldname": "email_id", + "fieldtype": "Data", + "label": "Email Id", + "permlevel": 0 + }, + { + "description": "POP3 server e.g. (pop.gmail.com)", + "fieldname": "host", + "fieldtype": "Data", + "label": "Host", + "permlevel": 0 + }, + { + "fieldname": "use_ssl", + "fieldtype": "Check", + "label": "Use SSL", + "permlevel": 0 + }, + { + "fieldname": "username", + "fieldtype": "Data", + "label": "Username", + "permlevel": 0 + }, + { + "fieldname": "password", + "fieldtype": "Password", + "label": "Password", + "permlevel": 0 + } + ], + "icon": "icon-cog", + "idx": 1, + "issingle": 1, + "modified": "2013-12-20 19:21:38", + "modified_by": "Administrator", + "module": "Setup", + "name": "Sales Email Settings", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "role": "System Manager", + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/setup/doctype/sales_partner/sales_partner.txt b/erpnext/setup/doctype/sales_partner/sales_partner.txt index 25ae9a0671..4563fe51e2 100644 --- a/erpnext/setup/doctype/sales_partner/sales_partner.txt +++ b/erpnext/setup/doctype/sales_partner/sales_partner.txt @@ -1,250 +1,247 @@ -[ - { - "creation": "2013-04-12 15:34:06", - "docstatus": 0, - "modified": "2014-02-20 18:30:32", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "autoname": "field:partner_name", - "description": "A third party distributor / dealer / commission agent / affiliate / reseller who sells the companies products for a commission.", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-user", - "in_create": 0, - "module": "Setup", - "name": "__common__", - "read_only": 0 - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Sales Partner", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "amend": 0, - "cancel": 0, - "delete": 0, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Sales Partner", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 0 - }, - { - "doctype": "DocType", - "name": "Sales Partner" - }, - { - "doctype": "DocField", - "fieldname": "partner_name", - "fieldtype": "Data", - "in_filter": 1, - "label": "Sales Partner Name", - "oldfieldname": "partner_name", - "oldfieldtype": "Data", - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "partner_type", - "fieldtype": "Select", - "in_filter": 1, - "label": "Partner Type", - "oldfieldname": "partner_type", - "oldfieldtype": "Select", - "options": "\nChannel Partner\nDistributor\nDealer\nAgent\nRetailer\nImplementation Partner\nReseller", - "search_index": 0 - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "territory", - "fieldtype": "Link", - "label": "Territory", - "options": "Territory", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "commission_rate", - "fieldtype": "Float", - "label": "Commission Rate", - "oldfieldname": "commission_rate", - "oldfieldtype": "Currency", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "address_contacts", - "fieldtype": "Section Break", - "label": "Address & Contacts" - }, - { - "depends_on": "eval:doc.__islocal", - "doctype": "DocField", - "fieldname": "address_desc", - "fieldtype": "HTML", - "label": "Address Desc", - "options": "Addresses will appear only when you save the customer" - }, - { - "doctype": "DocField", - "fieldname": "address_html", - "fieldtype": "HTML", - "label": "Address HTML", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break" - }, - { - "depends_on": "eval:doc.__islocal", - "doctype": "DocField", - "fieldname": "contact_desc", - "fieldtype": "HTML", - "label": "Contact Desc", - "options": "Contact Details will appear only when you save the customer" - }, - { - "doctype": "DocField", - "fieldname": "contact_html", - "fieldtype": "HTML", - "label": "Contact HTML", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "partner_target_details_section_break", - "fieldtype": "Section Break", - "label": "Sales Partner Target", - "oldfieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "partner_target_details", - "fieldtype": "Table", - "label": "Partner Target Detail", - "oldfieldname": "partner_target_details", - "oldfieldtype": "Table", - "options": "Target Detail", - "reqd": 0 - }, - { - "description": "Select Budget Distribution to unevenly distribute targets across months.", - "doctype": "DocField", - "fieldname": "distribution_id", - "fieldtype": "Link", - "label": "Target Distribution", - "oldfieldname": "distribution_id", - "oldfieldtype": "Link", - "options": "Budget Distribution" - }, - { - "doctype": "DocField", - "fieldname": "website", - "fieldtype": "Section Break", - "label": "Website" - }, - { - "doctype": "DocField", - "fieldname": "show_in_website", - "fieldtype": "Check", - "label": "Show In Website" - }, - { - "depends_on": "eval:cint(doc.show_in_website)", - "doctype": "DocField", - "fieldname": "section_break_17", - "fieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "logo", - "fieldtype": "Select", - "label": "Logo", - "options": "attach_files:" - }, - { - "doctype": "DocField", - "fieldname": "partner_website", - "fieldtype": "Data", - "label": "Partner's Website" - }, - { - "doctype": "DocField", - "fieldname": "column_break_20", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "page_name", - "fieldtype": "Data", - "label": "Page Name", - "read_only": 1 - }, - { - "depends_on": "eval:cint(doc.show_in_website)", - "doctype": "DocField", - "fieldname": "section_break_22", - "fieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "introduction", - "fieldtype": "Text", - "label": "Introduction" - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Text Editor", - "label": "Description" - }, - { - "doctype": "DocField", - "fieldname": "parent_website_route", - "fieldtype": "Link", - "label": "Parent Website Route", - "options": "Website Route" - }, - { - "create": 0, - "doctype": "DocPerm", - "role": "Sales Manager", - "write": 0 - }, - { - "create": 0, - "doctype": "DocPerm", - "role": "Sales User", - "write": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "role": "Sales Master Manager", - "write": 1 - } -] \ No newline at end of file +{ + "allow_import": 1, + "autoname": "field:partner_name", + "creation": "2013-04-12 15:34:06", + "description": "A third party distributor / dealer / commission agent / affiliate / reseller who sells the companies products for a commission.", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "partner_name", + "fieldtype": "Data", + "in_filter": 1, + "label": "Sales Partner Name", + "oldfieldname": "partner_name", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "partner_type", + "fieldtype": "Select", + "in_filter": 1, + "label": "Partner Type", + "oldfieldname": "partner_type", + "oldfieldtype": "Select", + "options": "\nChannel Partner\nDistributor\nDealer\nAgent\nRetailer\nImplementation Partner\nReseller", + "permlevel": 0, + "search_index": 0 + }, + { + "description": "Add / Edit", + "fieldname": "territory", + "fieldtype": "Link", + "label": "Territory", + "options": "Territory", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "commission_rate", + "fieldtype": "Float", + "label": "Commission Rate", + "oldfieldname": "commission_rate", + "oldfieldtype": "Currency", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "address_contacts", + "fieldtype": "Section Break", + "label": "Address & Contacts", + "permlevel": 0 + }, + { + "depends_on": "eval:doc.__islocal", + "fieldname": "address_desc", + "fieldtype": "HTML", + "label": "Address Desc", + "options": "Addresses will appear only when you save the customer", + "permlevel": 0 + }, + { + "fieldname": "address_html", + "fieldtype": "HTML", + "label": "Address HTML", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "depends_on": "eval:doc.__islocal", + "fieldname": "contact_desc", + "fieldtype": "HTML", + "label": "Contact Desc", + "options": "Contact Details will appear only when you save the customer", + "permlevel": 0 + }, + { + "fieldname": "contact_html", + "fieldtype": "HTML", + "label": "Contact HTML", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "partner_target_details_section_break", + "fieldtype": "Section Break", + "label": "Sales Partner Target", + "oldfieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "partner_target_details", + "fieldtype": "Table", + "label": "Partner Target Detail", + "oldfieldname": "partner_target_details", + "oldfieldtype": "Table", + "options": "Target Detail", + "permlevel": 0, + "reqd": 0 + }, + { + "description": "Select Budget Distribution to unevenly distribute targets across months.", + "fieldname": "distribution_id", + "fieldtype": "Link", + "label": "Target Distribution", + "oldfieldname": "distribution_id", + "oldfieldtype": "Link", + "options": "Budget Distribution", + "permlevel": 0 + }, + { + "fieldname": "website", + "fieldtype": "Section Break", + "label": "Website", + "permlevel": 0 + }, + { + "fieldname": "show_in_website", + "fieldtype": "Check", + "label": "Show In Website", + "permlevel": 0 + }, + { + "depends_on": "eval:cint(doc.show_in_website)", + "fieldname": "section_break_17", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "logo", + "fieldtype": "Select", + "label": "Logo", + "options": "attach_files:", + "permlevel": 0 + }, + { + "fieldname": "partner_website", + "fieldtype": "Data", + "label": "Partner's Website", + "permlevel": 0 + }, + { + "fieldname": "column_break_20", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "page_name", + "fieldtype": "Data", + "label": "Page Name", + "permlevel": 0, + "read_only": 1 + }, + { + "depends_on": "eval:cint(doc.show_in_website)", + "fieldname": "section_break_22", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "introduction", + "fieldtype": "Text", + "label": "Introduction", + "permlevel": 0 + }, + { + "fieldname": "description", + "fieldtype": "Text Editor", + "label": "Description", + "permlevel": 0 + }, + { + "fieldname": "parent_website_route", + "fieldtype": "Link", + "label": "Parent Website Route", + "options": "Website Route", + "permlevel": 0 + } + ], + "icon": "icon-user", + "idx": 1, + "in_create": 0, + "modified": "2014-02-20 18:30:32", + "modified_by": "Administrator", + "module": "Setup", + "name": "Sales Partner", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales Manager", + "submit": 0, + "write": 0 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales User", + "submit": 0, + "write": 0 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales Master Manager", + "submit": 0, + "write": 1 + } + ], + "read_only": 0 +} \ No newline at end of file diff --git a/erpnext/setup/doctype/sales_person/sales_person.txt b/erpnext/setup/doctype/sales_person/sales_person.txt index 724dc4cd0e..e321390793 100644 --- a/erpnext/setup/doctype/sales_person/sales_person.txt +++ b/erpnext/setup/doctype/sales_person/sales_person.txt @@ -1,198 +1,193 @@ -[ - { - "creation": "2013-01-10 16:34:24", - "docstatus": 0, - "modified": "2014-01-20 17:49:25", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "allow_rename": 1, - "autoname": "field:sales_person_name", - "description": "All Sales Transactions can be tagged against multiple **Sales Persons** so that you can set and monitor targets.", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-user", - "in_create": 1, - "module": "Setup", - "name": "__common__", - "search_fields": "name,parent_sales_person" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Sales Person", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "amend": 0, - "cancel": 0, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Sales Person", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 0 - }, - { - "doctype": "DocType", - "name": "Sales Person" - }, - { - "doctype": "DocField", - "fieldname": "name_and_employee_id", - "fieldtype": "Section Break", - "label": "Name and Employee ID", - "options": "icon-user" - }, - { - "doctype": "DocField", - "fieldname": "sales_person_name", - "fieldtype": "Data", - "in_filter": 1, - "label": "Sales Person Name", - "oldfieldname": "sales_person_name", - "oldfieldtype": "Data", - "reqd": 1, - "search_index": 0 - }, - { - "description": "Select company name first.", - "doctype": "DocField", - "fieldname": "parent_sales_person", - "fieldtype": "Link", - "ignore_restrictions": 1, - "label": "Parent Sales Person", - "oldfieldname": "parent_sales_person", - "oldfieldtype": "Link", - "options": "Sales Person", - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "is_group", - "fieldtype": "Select", - "label": "Has Child Node", - "oldfieldname": "is_group", - "oldfieldtype": "Select", - "options": "\nYes\nNo", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "cb0", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "employee", - "fieldtype": "Link", - "label": "Employee", - "options": "Employee", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "lft", - "fieldtype": "Int", - "hidden": 1, - "in_filter": 1, - "label": "lft", - "no_copy": 1, - "oldfieldname": "lft", - "oldfieldtype": "Int", - "print_hide": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "rgt", - "fieldtype": "Int", - "hidden": 1, - "in_filter": 1, - "label": "rgt", - "no_copy": 1, - "oldfieldname": "rgt", - "oldfieldtype": "Int", - "print_hide": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "old_parent", - "fieldtype": "Data", - "hidden": 1, - "label": "old_parent", - "no_copy": 1, - "oldfieldname": "old_parent", - "oldfieldtype": "Data", - "print_hide": 1 - }, - { - "description": "Set targets Item Group-wise for this Sales Person.", - "doctype": "DocField", - "fieldname": "target_details_section_break", - "fieldtype": "Section Break", - "label": "Sales Person Targets", - "oldfieldtype": "Section Break", - "options": "icon-bullseye" - }, - { - "doctype": "DocField", - "fieldname": "target_details", - "fieldtype": "Table", - "label": "Target Details1", - "oldfieldname": "target_details", - "oldfieldtype": "Table", - "options": "Target Detail" - }, - { - "description": "Select Budget Distribution to unevenly distribute targets across months.", - "doctype": "DocField", - "fieldname": "distribution_id", - "fieldtype": "Link", - "label": "Target Distribution", - "oldfieldname": "distribution_id", - "oldfieldtype": "Link", - "options": "Budget Distribution", - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "communications", - "fieldtype": "Table", - "hidden": 1, - "label": "Communications", - "options": "Communication", - "print_hide": 1 - }, - { - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Sales Manager", - "write": 0 - }, - { - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Sales User", - "write": 0 - }, - { - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Sales Master Manager", - "write": 1 - } -] \ No newline at end of file +{ + "allow_import": 1, + "allow_rename": 1, + "autoname": "field:sales_person_name", + "creation": "2013-01-10 16:34:24", + "description": "All Sales Transactions can be tagged against multiple **Sales Persons** so that you can set and monitor targets.", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "name_and_employee_id", + "fieldtype": "Section Break", + "label": "Name and Employee ID", + "options": "icon-user", + "permlevel": 0 + }, + { + "fieldname": "sales_person_name", + "fieldtype": "Data", + "in_filter": 1, + "label": "Sales Person Name", + "oldfieldname": "sales_person_name", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1, + "search_index": 0 + }, + { + "description": "Select company name first.", + "fieldname": "parent_sales_person", + "fieldtype": "Link", + "ignore_restrictions": 1, + "label": "Parent Sales Person", + "oldfieldname": "parent_sales_person", + "oldfieldtype": "Link", + "options": "Sales Person", + "permlevel": 0, + "reqd": 0 + }, + { + "fieldname": "is_group", + "fieldtype": "Select", + "label": "Has Child Node", + "oldfieldname": "is_group", + "oldfieldtype": "Select", + "options": "\nYes\nNo", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "cb0", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "employee", + "fieldtype": "Link", + "label": "Employee", + "options": "Employee", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "lft", + "fieldtype": "Int", + "hidden": 1, + "in_filter": 1, + "label": "lft", + "no_copy": 1, + "oldfieldname": "lft", + "oldfieldtype": "Int", + "permlevel": 0, + "print_hide": 1, + "search_index": 1 + }, + { + "fieldname": "rgt", + "fieldtype": "Int", + "hidden": 1, + "in_filter": 1, + "label": "rgt", + "no_copy": 1, + "oldfieldname": "rgt", + "oldfieldtype": "Int", + "permlevel": 0, + "print_hide": 1, + "search_index": 1 + }, + { + "fieldname": "old_parent", + "fieldtype": "Data", + "hidden": 1, + "label": "old_parent", + "no_copy": 1, + "oldfieldname": "old_parent", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1 + }, + { + "description": "Set targets Item Group-wise for this Sales Person.", + "fieldname": "target_details_section_break", + "fieldtype": "Section Break", + "label": "Sales Person Targets", + "oldfieldtype": "Section Break", + "options": "icon-bullseye", + "permlevel": 0 + }, + { + "fieldname": "target_details", + "fieldtype": "Table", + "label": "Target Details1", + "oldfieldname": "target_details", + "oldfieldtype": "Table", + "options": "Target Detail", + "permlevel": 0 + }, + { + "description": "Select Budget Distribution to unevenly distribute targets across months.", + "fieldname": "distribution_id", + "fieldtype": "Link", + "label": "Target Distribution", + "oldfieldname": "distribution_id", + "oldfieldtype": "Link", + "options": "Budget Distribution", + "permlevel": 0, + "search_index": 0 + }, + { + "fieldname": "communications", + "fieldtype": "Table", + "hidden": 1, + "label": "Communications", + "options": "Communication", + "permlevel": 0, + "print_hide": 1 + } + ], + "icon": "icon-user", + "idx": 1, + "in_create": 1, + "modified": "2014-01-20 17:49:25", + "modified_by": "Administrator", + "module": "Setup", + "name": "Sales Person", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales Manager", + "submit": 0, + "write": 0 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales User", + "submit": 0, + "write": 0 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales Master Manager", + "submit": 0, + "write": 1 + } + ], + "search_fields": "name,parent_sales_person" +} \ No newline at end of file diff --git a/erpnext/setup/doctype/sms_parameter/sms_parameter.txt b/erpnext/setup/doctype/sms_parameter/sms_parameter.txt index c4ebb8f84f..5c08bc0efc 100755 --- a/erpnext/setup/doctype/sms_parameter/sms_parameter.txt +++ b/erpnext/setup/doctype/sms_parameter/sms_parameter.txt @@ -1,42 +1,34 @@ -[ - { - "creation": "2013-02-22 01:27:58", - "docstatus": 0, - "modified": "2013-12-20 19:21:47", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "istable": 1, - "module": "Setup", - "name": "__common__" - }, - { - "doctype": "DocField", - "fieldtype": "Data", - "in_list_view": 1, - "name": "__common__", - "parent": "SMS Parameter", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0, - "print_width": "150px", - "reqd": 1, - "width": "150px" - }, - { - "doctype": "DocType", - "name": "SMS Parameter" - }, - { - "doctype": "DocField", - "fieldname": "parameter", - "label": "Parameter" - }, - { - "doctype": "DocField", - "fieldname": "value", - "label": "Value" - } -] \ No newline at end of file +{ + "creation": "2013-02-22 01:27:58", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "parameter", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Parameter", + "permlevel": 0, + "print_width": "150px", + "reqd": 1, + "width": "150px" + }, + { + "fieldname": "value", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Value", + "permlevel": 0, + "print_width": "150px", + "reqd": 1, + "width": "150px" + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:21:47", + "modified_by": "Administrator", + "module": "Setup", + "name": "SMS Parameter", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/setup/doctype/sms_settings/sms_settings.txt b/erpnext/setup/doctype/sms_settings/sms_settings.txt index 20c0a62439..f8e49fe027 100755 --- a/erpnext/setup/doctype/sms_settings/sms_settings.txt +++ b/erpnext/setup/doctype/sms_settings/sms_settings.txt @@ -1,94 +1,75 @@ -[ - { - "creation": "2013-01-10 16:34:24", - "docstatus": 0, - "modified": "2013-09-10 17:20:25", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_copy": 1, - "allow_email": 1, - "allow_print": 1, - "doctype": "DocType", - "icon": "icon-cog", - "in_create": 0, - "issingle": 1, - "module": "Setup", - "name": "__common__", - "read_only": 0 - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "SMS Settings", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "name": "__common__", - "parent": "SMS Settings", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "read": 1, - "report": 0, - "role": "System Manager", - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "SMS Settings" - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "description": "Eg. smsgateway.com/api/send_sms.cgi", - "doctype": "DocField", - "fieldname": "sms_gateway_url", - "fieldtype": "Data", - "label": "SMS Gateway URL", - "reqd": 1 - }, - { - "description": "Enter url parameter for message", - "doctype": "DocField", - "fieldname": "message_parameter", - "fieldtype": "Data", - "label": "Message Parameter", - "reqd": 1 - }, - { - "description": "Enter url parameter for receiver nos", - "doctype": "DocField", - "fieldname": "receiver_parameter", - "fieldtype": "Data", - "label": "Receiver Parameter", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "static_parameters", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "description": "Enter static url parameters here (Eg. sender=ERPNext, username=ERPNext, password=1234 etc.)", - "doctype": "DocField", - "fieldname": "static_parameter_details", - "fieldtype": "Table", - "label": "Static Parameters", - "options": "SMS Parameter" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "allow_copy": 1, + "allow_email": 1, + "allow_print": 1, + "creation": "2013-01-10 16:34:24", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "description": "Eg. smsgateway.com/api/send_sms.cgi", + "fieldname": "sms_gateway_url", + "fieldtype": "Data", + "label": "SMS Gateway URL", + "permlevel": 0, + "reqd": 1 + }, + { + "description": "Enter url parameter for message", + "fieldname": "message_parameter", + "fieldtype": "Data", + "label": "Message Parameter", + "permlevel": 0, + "reqd": 1 + }, + { + "description": "Enter url parameter for receiver nos", + "fieldname": "receiver_parameter", + "fieldtype": "Data", + "label": "Receiver Parameter", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "static_parameters", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "description": "Enter static url parameters here (Eg. sender=ERPNext, username=ERPNext, password=1234 etc.)", + "fieldname": "static_parameter_details", + "fieldtype": "Table", + "label": "Static Parameters", + "options": "SMS Parameter", + "permlevel": 0 + } + ], + "icon": "icon-cog", + "idx": 1, + "in_create": 0, + "issingle": 1, + "modified": "2013-09-10 17:20:25", + "modified_by": "Administrator", + "module": "Setup", + "name": "SMS Settings", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "permlevel": 0, + "read": 1, + "report": 0, + "role": "System Manager", + "submit": 0, + "write": 1 + } + ], + "read_only": 0 +} \ No newline at end of file diff --git a/erpnext/setup/doctype/supplier_type/supplier_type.txt b/erpnext/setup/doctype/supplier_type/supplier_type.txt index 5154f15a98..aeb90c856b 100644 --- a/erpnext/setup/doctype/supplier_type/supplier_type.txt +++ b/erpnext/setup/doctype/supplier_type/supplier_type.txt @@ -1,85 +1,80 @@ -[ - { - "creation": "2013-01-10 16:34:24", - "docstatus": 0, - "modified": "2014-01-20 17:49:31", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "allow_rename": 1, - "autoname": "field:supplier_type", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-flag", - "module": "Setup", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Supplier Type", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "amend": 0, - "cancel": 0, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Supplier Type", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 0 - }, - { - "doctype": "DocType", - "name": "Supplier Type" - }, - { - "doctype": "DocField", - "fieldname": "trash_reason", - "fieldtype": "Small Text", - "label": "Trash Reason", - "oldfieldname": "trash_reason", - "oldfieldtype": "Small Text", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "supplier_type", - "fieldtype": "Data", - "label": "Supplier Type", - "oldfieldname": "supplier_type", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Purchase Manager", - "write": 0 - }, - { - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Purchase User", - "write": 0 - }, - { - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Purchase Master Manager", - "write": 1 - } -] \ No newline at end of file +{ + "allow_import": 1, + "allow_rename": 1, + "autoname": "field:supplier_type", + "creation": "2013-01-10 16:34:24", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "trash_reason", + "fieldtype": "Small Text", + "label": "Trash Reason", + "oldfieldname": "trash_reason", + "oldfieldtype": "Small Text", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "supplier_type", + "fieldtype": "Data", + "label": "Supplier Type", + "oldfieldname": "supplier_type", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + } + ], + "icon": "icon-flag", + "idx": 1, + "modified": "2014-01-20 17:49:31", + "modified_by": "Administrator", + "module": "Setup", + "name": "Supplier Type", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase Manager", + "submit": 0, + "write": 0 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase User", + "submit": 0, + "write": 0 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase Master Manager", + "submit": 0, + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/setup/doctype/target_detail/target_detail.txt b/erpnext/setup/doctype/target_detail/target_detail.txt index 3ae395fc22..55667c243f 100644 --- a/erpnext/setup/doctype/target_detail/target_detail.txt +++ b/erpnext/setup/doctype/target_detail/target_detail.txt @@ -1,72 +1,62 @@ -[ - { - "creation": "2013-02-22 01:27:58", - "docstatus": 0, - "modified": "2013-12-20 19:21:51", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "istable": 1, - "module": "Setup", - "name": "__common__" - }, - { - "doctype": "DocField", - "in_list_view": 1, - "name": "__common__", - "parent": "Target Detail", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Target Detail" - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "item_group", - "fieldtype": "Link", - "in_filter": 1, - "label": "Item Group", - "oldfieldname": "item_group", - "oldfieldtype": "Link", - "options": "Item Group", - "reqd": 0, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "fiscal_year", - "fieldtype": "Select", - "in_filter": 1, - "label": "Fiscal Year", - "oldfieldname": "fiscal_year", - "oldfieldtype": "Select", - "options": "link:Fiscal Year", - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "target_qty", - "fieldtype": "Float", - "label": "Target Qty", - "oldfieldname": "target_qty", - "oldfieldtype": "Currency" - }, - { - "doctype": "DocField", - "fieldname": "target_amount", - "fieldtype": "Float", - "in_filter": 1, - "label": "Target Amount", - "oldfieldname": "target_amount", - "oldfieldtype": "Currency", - "reqd": 0, - "search_index": 1 - } -] \ No newline at end of file +{ + "creation": "2013-02-22 01:27:58", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "description": "Add / Edit", + "fieldname": "item_group", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Item Group", + "oldfieldname": "item_group", + "oldfieldtype": "Link", + "options": "Item Group", + "permlevel": 0, + "reqd": 0, + "search_index": 1 + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Select", + "in_filter": 1, + "in_list_view": 1, + "label": "Fiscal Year", + "oldfieldname": "fiscal_year", + "oldfieldtype": "Select", + "options": "link:Fiscal Year", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "target_qty", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Target Qty", + "oldfieldname": "target_qty", + "oldfieldtype": "Currency", + "permlevel": 0 + }, + { + "fieldname": "target_amount", + "fieldtype": "Float", + "in_filter": 1, + "in_list_view": 1, + "label": "Target Amount", + "oldfieldname": "target_amount", + "oldfieldtype": "Currency", + "permlevel": 0, + "reqd": 0, + "search_index": 1 + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:21:51", + "modified_by": "Administrator", + "module": "Setup", + "name": "Target Detail", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.txt b/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.txt index 16493799ca..4076ecd5a7 100644 --- a/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.txt +++ b/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.txt @@ -1,104 +1,103 @@ -[ - { - "creation": "2013-01-10 16:34:24", - "docstatus": 0, - "modified": "2014-01-20 17:49:33", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "allow_rename": 1, - "autoname": "field:title", - "description": "Standard Terms and Conditions that can be added to Sales and Purchases.\n\nExamples:\n\n1. Validity of the offer.\n1. Payment Terms (In Advance, On Credit, part advance etc).\n1. What is extra (or payable by the Customer).\n1. Safety / usage warning.\n1. Warranty if any.\n1. Returns Policy.\n1. Terms of shipping, if applicable.\n1. Ways of addressing disputes, indemnity, liability, etc.\n1. Address and Contact of your Company.", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-legal", - "module": "Setup", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Terms and Conditions", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "cancel": 0, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Terms and Conditions", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 0 - }, - { - "doctype": "DocType", - "name": "Terms and Conditions" - }, - { - "doctype": "DocField", - "fieldname": "trash_reason", - "fieldtype": "Small Text", - "label": "Trash Reason", - "oldfieldname": "trash_reason", - "oldfieldtype": "Small Text", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "title", - "fieldtype": "Data", - "in_filter": 1, - "label": "Title", - "oldfieldname": "title", - "oldfieldtype": "Data", - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "terms", - "fieldtype": "Text Editor", - "label": "Terms and Conditions", - "oldfieldname": "terms", - "oldfieldtype": "Text Editor" - }, - { - "amend": 0, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Sales Master Manager", - "write": 1 - }, - { - "amend": 0, - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Sales User", - "write": 0 - }, - { - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "System Manager", - "write": 1 - }, - { - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Accounts User", - "write": 1 - } -] \ No newline at end of file +{ + "allow_import": 1, + "allow_rename": 1, + "autoname": "field:title", + "creation": "2013-01-10 16:34:24", + "description": "Standard Terms and Conditions that can be added to Sales and Purchases.\n\nExamples:\n\n1. Validity of the offer.\n1. Payment Terms (In Advance, On Credit, part advance etc).\n1. What is extra (or payable by the Customer).\n1. Safety / usage warning.\n1. Warranty if any.\n1. Returns Policy.\n1. Terms of shipping, if applicable.\n1. Ways of addressing disputes, indemnity, liability, etc.\n1. Address and Contact of your Company.", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "trash_reason", + "fieldtype": "Small Text", + "label": "Trash Reason", + "oldfieldname": "trash_reason", + "oldfieldtype": "Small Text", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "title", + "fieldtype": "Data", + "in_filter": 1, + "label": "Title", + "oldfieldname": "title", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "terms", + "fieldtype": "Text Editor", + "label": "Terms and Conditions", + "oldfieldname": "terms", + "oldfieldtype": "Text Editor", + "permlevel": 0 + } + ], + "icon": "icon-legal", + "idx": 1, + "modified": "2014-01-20 17:49:33", + "modified_by": "Administrator", + "module": "Setup", + "name": "Terms and Conditions", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales Master Manager", + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales User", + "submit": 0, + "write": 0 + }, + { + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "submit": 0, + "write": 1 + }, + { + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts User", + "submit": 0, + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/setup/doctype/territory/territory.txt b/erpnext/setup/doctype/territory/territory.txt index 3eb766d4e0..a3ed0b2ecd 100644 --- a/erpnext/setup/doctype/territory/territory.txt +++ b/erpnext/setup/doctype/territory/territory.txt @@ -1,201 +1,196 @@ -[ - { - "creation": "2013-01-10 16:34:24", - "docstatus": 0, - "modified": "2014-01-20 17:49:33", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "allow_rename": 1, - "autoname": "field:territory_name", - "description": "Classification of Customers by region", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-map-marker", - "in_create": 1, - "module": "Setup", - "name": "__common__", - "name_case": "Title Case", - "read_only": 1, - "search_fields": "name,parent_territory,territory_manager" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Territory", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "amend": 0, - "cancel": 0, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Territory", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 0 - }, - { - "doctype": "DocType", - "name": "Territory" - }, - { - "doctype": "DocField", - "fieldname": "trash_reason", - "fieldtype": "Small Text", - "label": "Trash Reason", - "oldfieldname": "trash_reason", - "oldfieldtype": "Small Text", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "territory_name", - "fieldtype": "Data", - "label": "Territory Name", - "no_copy": 1, - "oldfieldname": "territory_name", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "parent_territory", - "fieldtype": "Link", - "ignore_restrictions": 1, - "label": "Parent Territory", - "oldfieldname": "parent_territory", - "oldfieldtype": "Link", - "options": "Territory", - "reqd": 0 - }, - { - "description": "Only leaf nodes are allowed in transaction", - "doctype": "DocField", - "fieldname": "is_group", - "fieldtype": "Select", - "label": "Has Child Node", - "oldfieldname": "is_group", - "oldfieldtype": "Select", - "options": "\nYes\nNo", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "cb0", - "fieldtype": "Column Break" - }, - { - "description": "For reference", - "doctype": "DocField", - "fieldname": "territory_manager", - "fieldtype": "Link", - "in_filter": 1, - "label": "Territory Manager", - "oldfieldname": "territory_manager", - "oldfieldtype": "Link", - "options": "Sales Person", - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "lft", - "fieldtype": "Int", - "hidden": 1, - "in_filter": 1, - "label": "lft", - "no_copy": 1, - "oldfieldname": "lft", - "oldfieldtype": "Int", - "print_hide": 1, - "report_hide": 0, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "rgt", - "fieldtype": "Int", - "hidden": 1, - "in_filter": 1, - "label": "rgt", - "no_copy": 1, - "oldfieldname": "rgt", - "oldfieldtype": "Int", - "print_hide": 1, - "report_hide": 0, - "search_index": 1 - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "old_parent", - "fieldtype": "Link", - "hidden": 1, - "ignore_restrictions": 1, - "label": "old_parent", - "no_copy": 1, - "oldfieldname": "old_parent", - "oldfieldtype": "Data", - "options": "Territory", - "print_hide": 1, - "report_hide": 1 - }, - { - "description": "Set Item Group-wise budgets on this Territory. You can also include seasonality by setting the Distribution.", - "doctype": "DocField", - "fieldname": "target_details_section_break", - "fieldtype": "Section Break", - "label": "Territory Targets", - "oldfieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "target_details", - "fieldtype": "Table", - "label": "Target Details", - "oldfieldname": "target_details", - "oldfieldtype": "Table", - "options": "Target Detail" - }, - { - "description": "Select Budget Distribution to unevenly distribute targets across months.", - "doctype": "DocField", - "fieldname": "distribution_id", - "fieldtype": "Link", - "label": "Target Distribution", - "oldfieldname": "distribution_id", - "oldfieldtype": "Link", - "options": "Budget Distribution" - }, - { - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Sales Manager", - "write": 0 - }, - { - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Sales User", - "write": 0 - }, - { - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Sales Master Manager", - "write": 1 - } -] \ No newline at end of file +{ + "allow_import": 1, + "allow_rename": 1, + "autoname": "field:territory_name", + "creation": "2013-01-10 16:34:24", + "description": "Classification of Customers by region", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "trash_reason", + "fieldtype": "Small Text", + "label": "Trash Reason", + "oldfieldname": "trash_reason", + "oldfieldtype": "Small Text", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "territory_name", + "fieldtype": "Data", + "label": "Territory Name", + "no_copy": 1, + "oldfieldname": "territory_name", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + }, + { + "description": "Add / Edit", + "fieldname": "parent_territory", + "fieldtype": "Link", + "ignore_restrictions": 1, + "label": "Parent Territory", + "oldfieldname": "parent_territory", + "oldfieldtype": "Link", + "options": "Territory", + "permlevel": 0, + "reqd": 0 + }, + { + "description": "Only leaf nodes are allowed in transaction", + "fieldname": "is_group", + "fieldtype": "Select", + "label": "Has Child Node", + "oldfieldname": "is_group", + "oldfieldtype": "Select", + "options": "\nYes\nNo", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "cb0", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "description": "For reference", + "fieldname": "territory_manager", + "fieldtype": "Link", + "in_filter": 1, + "label": "Territory Manager", + "oldfieldname": "territory_manager", + "oldfieldtype": "Link", + "options": "Sales Person", + "permlevel": 0, + "search_index": 1 + }, + { + "fieldname": "lft", + "fieldtype": "Int", + "hidden": 1, + "in_filter": 1, + "label": "lft", + "no_copy": 1, + "oldfieldname": "lft", + "oldfieldtype": "Int", + "permlevel": 0, + "print_hide": 1, + "report_hide": 0, + "search_index": 1 + }, + { + "fieldname": "rgt", + "fieldtype": "Int", + "hidden": 1, + "in_filter": 1, + "label": "rgt", + "no_copy": 1, + "oldfieldname": "rgt", + "oldfieldtype": "Int", + "permlevel": 0, + "print_hide": 1, + "report_hide": 0, + "search_index": 1 + }, + { + "description": "Add / Edit", + "fieldname": "old_parent", + "fieldtype": "Link", + "hidden": 1, + "ignore_restrictions": 1, + "label": "old_parent", + "no_copy": 1, + "oldfieldname": "old_parent", + "oldfieldtype": "Data", + "options": "Territory", + "permlevel": 0, + "print_hide": 1, + "report_hide": 1 + }, + { + "description": "Set Item Group-wise budgets on this Territory. You can also include seasonality by setting the Distribution.", + "fieldname": "target_details_section_break", + "fieldtype": "Section Break", + "label": "Territory Targets", + "oldfieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "target_details", + "fieldtype": "Table", + "label": "Target Details", + "oldfieldname": "target_details", + "oldfieldtype": "Table", + "options": "Target Detail", + "permlevel": 0 + }, + { + "description": "Select Budget Distribution to unevenly distribute targets across months.", + "fieldname": "distribution_id", + "fieldtype": "Link", + "label": "Target Distribution", + "oldfieldname": "distribution_id", + "oldfieldtype": "Link", + "options": "Budget Distribution", + "permlevel": 0 + } + ], + "icon": "icon-map-marker", + "idx": 1, + "in_create": 1, + "modified": "2014-01-20 17:49:33", + "modified_by": "Administrator", + "module": "Setup", + "name": "Territory", + "name_case": "Title Case", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales Manager", + "submit": 0, + "write": 0 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales User", + "submit": 0, + "write": 0 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales Master Manager", + "submit": 0, + "write": 1 + } + ], + "read_only": 1, + "search_fields": "name,parent_territory,territory_manager" +} \ No newline at end of file diff --git a/erpnext/setup/doctype/uom/uom.txt b/erpnext/setup/doctype/uom/uom.txt index edff5b1d7b..ee075592ed 100644 --- a/erpnext/setup/doctype/uom/uom.txt +++ b/erpnext/setup/doctype/uom/uom.txt @@ -1,82 +1,77 @@ -[ - { - "creation": "2013-01-10 16:34:24", - "docstatus": 0, - "modified": "2014-01-20 17:49:34", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "autoname": "field:uom_name", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-compass", - "module": "Setup", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "UOM", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "amend": 0, - "cancel": 0, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "UOM", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 0 - }, - { - "doctype": "DocType", - "name": "UOM" - }, - { - "doctype": "DocField", - "fieldname": "uom_name", - "fieldtype": "Data", - "label": "UOM Name", - "oldfieldname": "uom_name", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "description": "Check this to disallow fractions. (for Nos)", - "doctype": "DocField", - "fieldname": "must_be_whole_number", - "fieldtype": "Check", - "label": "Must be Whole Number" - }, - { - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Material Master Manager", - "write": 1 - }, - { - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Material Manager", - "write": 0 - }, - { - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Material User", - "write": 0 - } -] \ No newline at end of file +{ + "allow_import": 1, + "autoname": "field:uom_name", + "creation": "2013-01-10 16:34:24", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "uom_name", + "fieldtype": "Data", + "label": "UOM Name", + "oldfieldname": "uom_name", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + }, + { + "description": "Check this to disallow fractions. (for Nos)", + "fieldname": "must_be_whole_number", + "fieldtype": "Check", + "label": "Must be Whole Number", + "permlevel": 0 + } + ], + "icon": "icon-compass", + "idx": 1, + "modified": "2014-01-20 17:49:34", + "modified_by": "Administrator", + "module": "Setup", + "name": "UOM", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material Master Manager", + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material Manager", + "submit": 0, + "write": 0 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material User", + "submit": 0, + "write": 0 + } + ] +} \ No newline at end of file diff --git a/erpnext/setup/doctype/website_item_group/website_item_group.txt b/erpnext/setup/doctype/website_item_group/website_item_group.txt index ff731a1e48..6d3a801640 100644 --- a/erpnext/setup/doctype/website_item_group/website_item_group.txt +++ b/erpnext/setup/doctype/website_item_group/website_item_group.txt @@ -1,39 +1,26 @@ -[ - { - "creation": "2013-02-22 01:28:09", - "docstatus": 0, - "modified": "2014-02-28 13:00:07", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "description": "Cross Listing of Item in multiple groups", - "doctype": "DocType", - "document_type": "Other", - "istable": 1, - "module": "Setup", - "name": "__common__" - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "item_group", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Item Group", - "name": "__common__", - "options": "Item Group", - "parent": "Website Item Group", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0, - "reqd": 1 - }, - { - "doctype": "DocType", - "name": "Website Item Group" - }, - { - "doctype": "DocField" - } -] \ No newline at end of file +{ + "creation": "2013-02-22 01:28:09", + "description": "Cross Listing of Item in multiple groups", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Other", + "fields": [ + { + "description": "Add / Edit", + "fieldname": "item_group", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Item Group", + "options": "Item Group", + "permlevel": 0, + "reqd": 1 + } + ], + "idx": 1, + "istable": 1, + "modified": "2014-02-28 13:00:07", + "modified_by": "Administrator", + "module": "Setup", + "name": "Website Item Group", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/setup/page/setup_wizard/setup_wizard.txt b/erpnext/setup/page/setup_wizard/setup_wizard.txt index 996fd1a059..fcb8e380cd 100644 --- a/erpnext/setup/page/setup_wizard/setup_wizard.txt +++ b/erpnext/setup/page/setup_wizard/setup_wizard.txt @@ -1,32 +1,19 @@ -[ - { - "creation": "2013-10-04 13:49:33", - "docstatus": 0, - "modified": "2013-10-04 13:49:33", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Page", - "module": "Setup", - "name": "__common__", - "page_name": "setup-wizard", - "standard": "Yes", - "title": "Setup Wizard" - }, - { - "doctype": "Page Role", - "name": "__common__", - "parent": "setup-wizard", - "parentfield": "roles", - "parenttype": "Page", - "role": "System Manager" - }, - { - "doctype": "Page", - "name": "setup-wizard" - }, - { - "doctype": "Page Role" - } -] \ No newline at end of file +{ + "creation": "2013-10-04 13:49:33", + "docstatus": 0, + "doctype": "Page", + "idx": 1, + "modified": "2013-10-04 13:49:33", + "modified_by": "Administrator", + "module": "Setup", + "name": "setup-wizard", + "owner": "Administrator", + "page_name": "setup-wizard", + "roles": [ + { + "role": "System Manager" + } + ], + "standard": "Yes", + "title": "Setup Wizard" +} \ No newline at end of file diff --git a/erpnext/stock/Print Format/Delivery Note Classic/Delivery Note Classic.txt b/erpnext/stock/Print Format/Delivery Note Classic/Delivery Note Classic.txt index 3f29d61127..6eeef251ab 100644 --- a/erpnext/stock/Print Format/Delivery Note Classic/Delivery Note Classic.txt +++ b/erpnext/stock/Print Format/Delivery Note Classic/Delivery Note Classic.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-04-19 13:31:11", - "docstatus": 0, - "modified": "2014-02-11 17:36:51", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doc_type": "Delivery Note", - "doctype": "Print Format", - "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", - "module": "Stock", - "name": "__common__", - "print_format_type": "Client", - "standard": "Yes" - }, - { - "doctype": "Print Format", - "name": "Delivery Note Classic" - } -] \ No newline at end of file +{ + "creation": "2013-04-19 13:31:11", + "doc_type": "Delivery Note", + "docstatus": 0, + "doctype": "Print Format", + "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", + "idx": 1, + "modified": "2014-02-11 17:36:51", + "modified_by": "Administrator", + "module": "Stock", + "name": "Delivery Note Classic", + "owner": "Administrator", + "print_format_type": "Client", + "standard": "Yes" +} \ No newline at end of file diff --git a/erpnext/stock/Print Format/Delivery Note Modern/Delivery Note Modern.txt b/erpnext/stock/Print Format/Delivery Note Modern/Delivery Note Modern.txt index 2c668670f8..907c3b5fb1 100644 --- a/erpnext/stock/Print Format/Delivery Note Modern/Delivery Note Modern.txt +++ b/erpnext/stock/Print Format/Delivery Note Modern/Delivery Note Modern.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-04-19 13:31:11", - "docstatus": 0, - "modified": "2014-02-11 17:36:26", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doc_type": "Delivery Note", - "doctype": "Print Format", - "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", - "module": "Stock", - "name": "__common__", - "print_format_type": "Client", - "standard": "Yes" - }, - { - "doctype": "Print Format", - "name": "Delivery Note Modern" - } -] \ No newline at end of file +{ + "creation": "2013-04-19 13:31:11", + "doc_type": "Delivery Note", + "docstatus": 0, + "doctype": "Print Format", + "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", + "idx": 1, + "modified": "2014-02-11 17:36:26", + "modified_by": "Administrator", + "module": "Stock", + "name": "Delivery Note Modern", + "owner": "Administrator", + "print_format_type": "Client", + "standard": "Yes" +} \ No newline at end of file diff --git a/erpnext/stock/Print Format/Delivery Note Packing List Wise/Delivery Note Packing List Wise.txt b/erpnext/stock/Print Format/Delivery Note Packing List Wise/Delivery Note Packing List Wise.txt index 1d33833227..b0976c2531 100644 --- a/erpnext/stock/Print Format/Delivery Note Packing List Wise/Delivery Note Packing List Wise.txt +++ b/erpnext/stock/Print Format/Delivery Note Packing List Wise/Delivery Note Packing List Wise.txt @@ -1,20 +1,13 @@ -[ - { - "owner": "Administrator", - "docstatus": 0, - "creation": "2011-08-23 16:49:40", - "modified_by": "Administrator", - "modified": "2011-10-19 14:12:11" - }, - { - "name": "__common__", - "module": "Stock", - "standard": "Yes", - "html": "\n\n\n\n\n\n\n\n\n\n", - "doctype": "Print Format" - }, - { - "name": "Delivery Note Packing List Wise", - "doctype": "Print Format" - } -] \ No newline at end of file +{ + "creation": "2011-08-23 16:49:40", + "docstatus": 0, + "doctype": "Print Format", + "html": "\n\n\n\n\n\n\n\n\n\n", + "idx": 1, + "modified": "2011-10-19 14:12:11", + "modified_by": "Administrator", + "module": "Stock", + "name": "Delivery Note Packing List Wise", + "owner": "Administrator", + "standard": "Yes" +} \ No newline at end of file diff --git a/erpnext/stock/Print Format/Delivery Note Spartan/Delivery Note Spartan.txt b/erpnext/stock/Print Format/Delivery Note Spartan/Delivery Note Spartan.txt index 4b62d70f1c..5e341f3f2c 100644 --- a/erpnext/stock/Print Format/Delivery Note Spartan/Delivery Note Spartan.txt +++ b/erpnext/stock/Print Format/Delivery Note Spartan/Delivery Note Spartan.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-04-19 13:31:11", - "docstatus": 0, - "modified": "2014-02-11 17:37:14", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doc_type": "Delivery Note", - "doctype": "Print Format", - "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", - "module": "Stock", - "name": "__common__", - "print_format_type": "Client", - "standard": "Yes" - }, - { - "doctype": "Print Format", - "name": "Delivery Note Spartan" - } -] \ No newline at end of file +{ + "creation": "2013-04-19 13:31:11", + "doc_type": "Delivery Note", + "docstatus": 0, + "doctype": "Print Format", + "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", + "idx": 1, + "modified": "2014-02-11 17:37:14", + "modified_by": "Administrator", + "module": "Stock", + "name": "Delivery Note Spartan", + "owner": "Administrator", + "print_format_type": "Client", + "standard": "Yes" +} \ No newline at end of file diff --git a/erpnext/stock/doctype/batch/batch.txt b/erpnext/stock/doctype/batch/batch.txt index c08573b507..b5a1e64da3 100644 --- a/erpnext/stock/doctype/batch/batch.txt +++ b/erpnext/stock/doctype/batch/batch.txt @@ -1,109 +1,90 @@ -[ - { - "creation": "2013-03-05 14:50:38", - "docstatus": 0, - "modified": "2014-01-20 17:48:24", - "modified_by": "Administrator", - "owner": "harshada@webnotestech.com" - }, - { - "allow_attach": 1, - "allow_import": 1, - "autoname": "field:batch_id", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-archive", - "max_attachments": 5, - "module": "Stock", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Batch", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "cancel": 0, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Batch", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Material Master Manager", - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Batch" - }, - { - "doctype": "DocField", - "fieldname": "batch_id", - "fieldtype": "Data", - "label": "Batch ID", - "no_copy": 1, - "oldfieldname": "batch_id", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "item", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Item", - "oldfieldname": "item", - "oldfieldtype": "Link", - "options": "Item", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Small Text", - "in_list_view": 1, - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Small Text", - "width": "300px" - }, - { - "doctype": "DocField", - "fieldname": "expiry_date", - "fieldtype": "Date", - "in_list_view": 1, - "label": "Expiry Date", - "oldfieldname": "expiry_date", - "oldfieldtype": "Date" - }, - { - "doctype": "DocField", - "fieldname": "start_date", - "fieldtype": "Date", - "label": "Batch Started Date", - "oldfieldname": "start_date", - "oldfieldtype": "Date" - }, - { - "doctype": "DocField", - "fieldname": "finished_date", - "fieldtype": "Date", - "label": "Batch Finished Date", - "oldfieldname": "finished_date", - "oldfieldtype": "Date" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "allow_attach": 1, + "allow_import": 1, + "autoname": "field:batch_id", + "creation": "2013-03-05 14:50:38", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "batch_id", + "fieldtype": "Data", + "label": "Batch ID", + "no_copy": 1, + "oldfieldname": "batch_id", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "item", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Item", + "oldfieldname": "item", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "description", + "fieldtype": "Small Text", + "in_list_view": 1, + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Small Text", + "permlevel": 0, + "width": "300px" + }, + { + "fieldname": "expiry_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "Expiry Date", + "oldfieldname": "expiry_date", + "oldfieldtype": "Date", + "permlevel": 0 + }, + { + "fieldname": "start_date", + "fieldtype": "Date", + "label": "Batch Started Date", + "oldfieldname": "start_date", + "oldfieldtype": "Date", + "permlevel": 0 + }, + { + "fieldname": "finished_date", + "fieldtype": "Date", + "label": "Batch Finished Date", + "oldfieldname": "finished_date", + "oldfieldtype": "Date", + "permlevel": 0 + } + ], + "icon": "icon-archive", + "idx": 1, + "max_attachments": 5, + "modified": "2014-01-20 17:48:24", + "modified_by": "Administrator", + "module": "Stock", + "name": "Batch", + "owner": "harshada@webnotestech.com", + "permissions": [ + { + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material Master Manager", + "submit": 0, + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/stock/doctype/bin/bin.txt b/erpnext/stock/doctype/bin/bin.txt index 2775191070..b2ce6e9580 100644 --- a/erpnext/stock/doctype/bin/bin.txt +++ b/erpnext/stock/doctype/bin/bin.txt @@ -1,202 +1,205 @@ -[ - { - "creation": "2013-01-10 16:34:25", - "docstatus": 0, - "modified": "2013-12-20 19:23:56", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "BIN/.#######", - "doctype": "DocType", - "hide_toolbar": 1, - "in_create": 1, - "module": "Stock", - "name": "__common__", - "read_only": 0, - "search_fields": "item_code,warehouse" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Bin", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0, - "read_only": 1 - }, - { - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Bin", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 0 - }, - { - "doctype": "DocType", - "name": "Bin" - }, - { - "doctype": "DocField", - "fieldname": "warehouse", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "Warehouse", - "oldfieldname": "warehouse", - "oldfieldtype": "Link", - "options": "Warehouse", - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "item_code", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "Item Code", - "oldfieldname": "item_code", - "oldfieldtype": "Link", - "options": "Item", - "search_index": 1 - }, - { - "default": "0.00", - "doctype": "DocField", - "fieldname": "reserved_qty", - "fieldtype": "Float", - "in_filter": 0, - "in_list_view": 1, - "label": "Reserved Quantity", - "oldfieldname": "reserved_qty", - "oldfieldtype": "Currency", - "search_index": 0 - }, - { - "default": "0.00", - "doctype": "DocField", - "fieldname": "actual_qty", - "fieldtype": "Float", - "in_filter": 1, - "in_list_view": 1, - "label": "Actual Quantity", - "oldfieldname": "actual_qty", - "oldfieldtype": "Currency", - "search_index": 0 - }, - { - "default": "0.00", - "doctype": "DocField", - "fieldname": "ordered_qty", - "fieldtype": "Float", - "in_filter": 0, - "in_list_view": 1, - "label": "Ordered Quantity", - "oldfieldname": "ordered_qty", - "oldfieldtype": "Currency", - "search_index": 0 - }, - { - "default": "0.00", - "doctype": "DocField", - "fieldname": "indented_qty", - "fieldtype": "Float", - "in_filter": 0, - "label": "Quantity Requested for Purchase", - "oldfieldname": "indented_qty", - "oldfieldtype": "Currency", - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "planned_qty", - "fieldtype": "Float", - "in_filter": 0, - "label": "Planned Qty", - "oldfieldname": "planned_qty", - "oldfieldtype": "Currency", - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "projected_qty", - "fieldtype": "Float", - "in_filter": 0, - "label": "Projected Qty", - "oldfieldname": "projected_qty", - "oldfieldtype": "Currency" - }, - { - "doctype": "DocField", - "fieldname": "ma_rate", - "fieldtype": "Float", - "hidden": 1, - "in_filter": 0, - "label": "Moving Average Rate", - "oldfieldname": "ma_rate", - "oldfieldtype": "Currency", - "print_hide": 1, - "report_hide": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "stock_uom", - "fieldtype": "Link", - "in_filter": 1, - "label": "UOM", - "oldfieldname": "stock_uom", - "oldfieldtype": "Data", - "options": "UOM", - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "fcfs_rate", - "fieldtype": "Float", - "hidden": 1, - "label": "FCFS Rate", - "oldfieldname": "fcfs_rate", - "oldfieldtype": "Currency", - "print_hide": 1, - "report_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "valuation_rate", - "fieldtype": "Float", - "label": "Valuation Rate", - "oldfieldname": "valuation_rate", - "oldfieldtype": "Currency" - }, - { - "doctype": "DocField", - "fieldname": "stock_value", - "fieldtype": "Float", - "label": "Stock Value", - "oldfieldname": "stock_value", - "oldfieldtype": "Currency" - }, - { - "doctype": "DocPerm", - "role": "Sales User" - }, - { - "doctype": "DocPerm", - "role": "Purchase User" - }, - { - "amend": 0, - "cancel": 0, - "create": 0, - "doctype": "DocPerm", - "role": "Material User", - "write": 0 - } -] \ No newline at end of file +{ + "autoname": "BIN/.#######", + "creation": "2013-01-10 16:34:25", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "warehouse", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Warehouse", + "oldfieldname": "warehouse", + "oldfieldtype": "Link", + "options": "Warehouse", + "permlevel": 0, + "read_only": 1, + "search_index": 1 + }, + { + "fieldname": "item_code", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Item Code", + "oldfieldname": "item_code", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0, + "read_only": 1, + "search_index": 1 + }, + { + "default": "0.00", + "fieldname": "reserved_qty", + "fieldtype": "Float", + "in_filter": 0, + "in_list_view": 1, + "label": "Reserved Quantity", + "oldfieldname": "reserved_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 1, + "search_index": 0 + }, + { + "default": "0.00", + "fieldname": "actual_qty", + "fieldtype": "Float", + "in_filter": 1, + "in_list_view": 1, + "label": "Actual Quantity", + "oldfieldname": "actual_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 1, + "search_index": 0 + }, + { + "default": "0.00", + "fieldname": "ordered_qty", + "fieldtype": "Float", + "in_filter": 0, + "in_list_view": 1, + "label": "Ordered Quantity", + "oldfieldname": "ordered_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 1, + "search_index": 0 + }, + { + "default": "0.00", + "fieldname": "indented_qty", + "fieldtype": "Float", + "in_filter": 0, + "label": "Quantity Requested for Purchase", + "oldfieldname": "indented_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 1, + "search_index": 0 + }, + { + "fieldname": "planned_qty", + "fieldtype": "Float", + "in_filter": 0, + "label": "Planned Qty", + "oldfieldname": "planned_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 1, + "search_index": 0 + }, + { + "fieldname": "projected_qty", + "fieldtype": "Float", + "in_filter": 0, + "label": "Projected Qty", + "oldfieldname": "projected_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "ma_rate", + "fieldtype": "Float", + "hidden": 1, + "in_filter": 0, + "label": "Moving Average Rate", + "oldfieldname": "ma_rate", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "report_hide": 1, + "search_index": 0 + }, + { + "fieldname": "stock_uom", + "fieldtype": "Link", + "in_filter": 1, + "label": "UOM", + "oldfieldname": "stock_uom", + "oldfieldtype": "Data", + "options": "UOM", + "permlevel": 0, + "read_only": 1, + "search_index": 0 + }, + { + "fieldname": "fcfs_rate", + "fieldtype": "Float", + "hidden": 1, + "label": "FCFS Rate", + "oldfieldname": "fcfs_rate", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "report_hide": 1 + }, + { + "fieldname": "valuation_rate", + "fieldtype": "Float", + "label": "Valuation Rate", + "oldfieldname": "valuation_rate", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "stock_value", + "fieldtype": "Float", + "label": "Stock Value", + "oldfieldname": "stock_value", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 1 + } + ], + "hide_toolbar": 1, + "idx": 1, + "in_create": 1, + "modified": "2013-12-20 19:23:56", + "modified_by": "Administrator", + "module": "Stock", + "name": "Bin", + "owner": "Administrator", + "permissions": [ + { + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales User", + "submit": 0 + }, + { + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase User", + "submit": 0 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material User", + "submit": 0, + "write": 0 + } + ], + "read_only": 0, + "search_fields": "item_code,warehouse" +} \ No newline at end of file diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.txt b/erpnext/stock/doctype/delivery_note/delivery_note.txt index a20723de33..e4ad47d10e 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.txt +++ b/erpnext/stock/doctype/delivery_note/delivery_note.txt @@ -1,1079 +1,1076 @@ -[ - { - "creation": "2013-05-24 19:29:09", - "docstatus": 0, - "modified": "2014-01-28 18:51:42", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_attach": 1, - "autoname": "naming_series:", - "doctype": "DocType", - "document_type": "Transaction", - "hide_toolbar": 0, - "icon": "icon-truck", - "in_create": 0, - "is_submittable": 1, - "module": "Stock", - "name": "__common__", - "read_only_onload": 1, - "search_fields": "status,customer,customer_name, territory,grand_total" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Delivery Note", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Delivery Note", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1 - }, - { - "doctype": "DocType", - "name": "Delivery Note" - }, - { - "doctype": "DocField", - "fieldname": "delivery_to_section", - "fieldtype": "Section Break", - "label": "Delivery To", - "options": "icon-user" - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "print_width": "50%", - "read_only": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "naming_series", - "fieldtype": "Select", - "label": "Series", - "no_copy": 1, - "oldfieldname": "naming_series", - "oldfieldtype": "Select", - "options": "DN", - "print_hide": 1, - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "customer", - "fieldtype": "Link", - "in_filter": 1, - "label": "Customer", - "oldfieldname": "customer", - "oldfieldtype": "Link", - "options": "Customer", - "print_hide": 1, - "read_only": 0, - "reqd": 1, - "search_index": 1 - }, - { - "depends_on": "customer", - "doctype": "DocField", - "fieldname": "customer_name", - "fieldtype": "Data", - "hidden": 0, - "in_list_view": 1, - "label": "Customer Name", - "read_only": 1 - }, - { - "depends_on": "customer", - "doctype": "DocField", - "fieldname": "customer_address", - "fieldtype": "Link", - "in_filter": 1, - "label": "Billing Address Name", - "options": "Address", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "address_display", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Billing Address", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "shipping_address_name", - "fieldtype": "Link", - "label": "Shipping Address", - "options": "Address", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "shipping_address", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Shipping Address", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "contact_display", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Contact", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "contact_mobile", - "fieldtype": "Text", - "hidden": 1, - "label": "Mobile No", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "contact_email", - "fieldtype": "Text", - "hidden": 1, - "label": "Contact Email", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "read_only": 0 - }, - { - "allow_on_submit": 0, - "doctype": "DocField", - "fieldname": "amended_from", - "fieldtype": "Data", - "ignore_restrictions": 1, - "label": "Amended From", - "no_copy": 1, - "oldfieldname": "amended_from", - "oldfieldtype": "Data", - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "width": "150px" - }, - { - "description": "Select the relevant company name if you have multiple companies", - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "in_filter": 1, - "label": "Company", - "oldfieldname": "company", - "oldfieldtype": "Link", - "options": "Company", - "print_hide": 1, - "print_width": "150px", - "read_only": 0, - "reqd": 1, - "search_index": 1, - "width": "150px" - }, - { - "default": "Today", - "doctype": "DocField", - "fieldname": "posting_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Posting Date", - "no_copy": 1, - "oldfieldname": "posting_date", - "oldfieldtype": "Date", - "print_hide": 0, - "print_width": "100px", - "read_only": 0, - "reqd": 1, - "search_index": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "po_no", - "fieldtype": "Data", - "hidden": 1, - "label": "Customer's Purchase Order No", - "no_copy": 0, - "oldfieldname": "po_no", - "oldfieldtype": "Data", - "print_hide": 1, - "print_width": "100px", - "read_only": 1, - "width": "100px" - }, - { - "depends_on": "eval:doc.po_no", - "doctype": "DocField", - "fieldname": "po_date", - "fieldtype": "Date", - "hidden": 0, - "label": "Customer's Purchase Order Date", - "no_copy": 0, - "oldfieldname": "po_date", - "oldfieldtype": "Data", - "print_hide": 1, - "print_width": "100px", - "read_only": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "sec_break25", - "fieldtype": "Section Break", - "label": "Currency and Price List", - "options": "icon-tag", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "currency", - "fieldtype": "Link", - "label": "Currency", - "oldfieldname": "currency", - "oldfieldtype": "Select", - "options": "Currency", - "print_hide": 1, - "read_only": 0, - "reqd": 1 - }, - { - "description": "Rate at which customer's currency is converted to company's base currency", - "doctype": "DocField", - "fieldname": "conversion_rate", - "fieldtype": "Float", - "label": "Exchange Rate", - "no_copy": 0, - "oldfieldname": "conversion_rate", - "oldfieldtype": "Currency", - "print_hide": 1, - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "col_break23", - "fieldtype": "Column Break", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "selling_price_list", - "fieldtype": "Link", - "label": "Price List", - "oldfieldname": "price_list_name", - "oldfieldtype": "Select", - "options": "Price List", - "print_hide": 1, - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "price_list_currency", - "fieldtype": "Link", - "label": "Price List Currency", - "options": "Currency", - "print_hide": 1, - "read_only": 1, - "reqd": 1 - }, - { - "description": "Rate at which Price list currency is converted to company's base currency", - "doctype": "DocField", - "fieldname": "plc_conversion_rate", - "fieldtype": "Float", - "label": "Price List Exchange Rate", - "print_hide": 1, - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "items", - "fieldtype": "Section Break", - "label": "Items", - "oldfieldtype": "Section Break", - "options": "icon-shopping-cart", - "read_only": 0 - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "delivery_note_details", - "fieldtype": "Table", - "label": "Delivery Note Items", - "no_copy": 0, - "oldfieldname": "delivery_note_details", - "oldfieldtype": "Table", - "options": "Delivery Note Item", - "print_hide": 0, - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "packing_list", - "fieldtype": "Section Break", - "label": "Packing List", - "oldfieldtype": "Section Break", - "options": "icon-suitcase", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "packing_details", - "fieldtype": "Table", - "label": "Packing Details", - "oldfieldname": "packing_details", - "oldfieldtype": "Table", - "options": "Packed Item", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "sales_bom_help", - "fieldtype": "HTML", - "label": "Sales BOM Help", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "section_break_31", - "fieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "net_total_export", - "fieldtype": "Currency", - "label": "Net Total", - "options": "currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break_33", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "net_total", - "fieldtype": "Currency", - "label": "Net Total (Company Currency)", - "no_copy": 0, - "oldfieldname": "net_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "reqd": 0, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "taxes", - "fieldtype": "Section Break", - "label": "Taxes and Charges", - "oldfieldtype": "Section Break", - "options": "icon-money", - "read_only": 0 - }, - { - "description": "If you have created a standard template in Sales Taxes and Charges Master, select one and click on the button below.", - "doctype": "DocField", - "fieldname": "taxes_and_charges", - "fieldtype": "Link", - "label": "Taxes and Charges", - "oldfieldname": "charge", - "oldfieldtype": "Link", - "options": "Sales Taxes and Charges Master", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break_39", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "shipping_rule", - "fieldtype": "Link", - "label": "Shipping Rule", - "oldfieldtype": "Button", - "options": "Shipping Rule", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "section_break_41", - "fieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "other_charges", - "fieldtype": "Table", - "label": "Sales Taxes and Charges", - "no_copy": 0, - "oldfieldname": "other_charges", - "oldfieldtype": "Table", - "options": "Sales Taxes and Charges", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "other_charges_calculation", - "fieldtype": "HTML", - "label": "Taxes and Charges Calculation", - "oldfieldtype": "HTML", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "section_break_44", - "fieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "other_charges_total_export", - "fieldtype": "Currency", - "label": "Taxes and Charges Total", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break_47", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "other_charges_total", - "fieldtype": "Currency", - "label": "Taxes and Charges Total (Company Currency)", - "oldfieldname": "other_charges_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "discount_amount", - "fieldtype": "Currency", - "label": "Discount Amount", - "options": "Company:company:default_currency" - }, - { - "doctype": "DocField", - "fieldname": "totals", - "fieldtype": "Section Break", - "label": "Totals", - "oldfieldtype": "Section Break", - "options": "icon-money", - "print_hide": 0, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "grand_total_export", - "fieldtype": "Currency", - "label": "Grand Total", - "no_copy": 0, - "oldfieldname": "grand_total_export", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 0, - "print_width": "150px", - "read_only": 1, - "reqd": 0, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "rounded_total_export", - "fieldtype": "Currency", - "label": "Rounded Total", - "no_copy": 0, - "oldfieldname": "rounded_total_export", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 0, - "print_width": "150px", - "read_only": 1, - "width": "150px" - }, - { - "description": "In Words (Export) will be visible once you save the Delivery Note.", - "doctype": "DocField", - "fieldname": "in_words_export", - "fieldtype": "Data", - "label": "In Words", - "no_copy": 0, - "oldfieldname": "in_words_export", - "oldfieldtype": "Data", - "print_hide": 0, - "print_width": "150px", - "read_only": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "column_break3", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "grand_total", - "fieldtype": "Currency", - "label": "Grand Total (Company Currency)", - "no_copy": 0, - "oldfieldname": "grand_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "reqd": 0, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "rounded_total", - "fieldtype": "Currency", - "label": "Rounded Total (Company Currency)", - "no_copy": 0, - "oldfieldname": "rounded_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "width": "150px" - }, - { - "description": "In Words will be visible once you save the Delivery Note.", - "doctype": "DocField", - "fieldname": "in_words", - "fieldtype": "Data", - "label": "In Words (Company Currency)", - "no_copy": 0, - "oldfieldname": "in_words", - "oldfieldtype": "Data", - "print_hide": 1, - "print_width": "200px", - "read_only": 1, - "width": "200px" - }, - { - "doctype": "DocField", - "fieldname": "terms_section_break", - "fieldtype": "Section Break", - "label": "Terms and Conditions", - "oldfieldtype": "Section Break", - "options": "icon-legal", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "tc_name", - "fieldtype": "Link", - "label": "Terms", - "oldfieldname": "tc_name", - "oldfieldtype": "Link", - "options": "Terms and Conditions", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "terms", - "fieldtype": "Text Editor", - "label": "Terms and Conditions Details", - "oldfieldname": "terms", - "oldfieldtype": "Text Editor", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "transporter_info", - "fieldtype": "Section Break", - "label": "Transporter Info", - "options": "icon-truck", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "transporter_name", - "fieldtype": "Data", - "label": "Transporter Name", - "no_copy": 0, - "oldfieldname": "transporter_name", - "oldfieldtype": "Data", - "print_hide": 1, - "print_width": "150px", - "read_only": 0, - "reqd": 0, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "col_break34", - "fieldtype": "Column Break", - "print_width": "50%", - "read_only": 0, - "width": "50%" - }, - { - "description": "Transporter lorry number", - "doctype": "DocField", - "fieldname": "lr_no", - "fieldtype": "Data", - "label": "Vehicle No", - "no_copy": 0, - "oldfieldname": "lr_no", - "oldfieldtype": "Data", - "print_hide": 1, - "print_width": "100px", - "read_only": 0, - "reqd": 0, - "width": "100px" - }, - { - "default": "Today", - "description": "Date on which lorry started from your warehouse", - "doctype": "DocField", - "fieldname": "lr_date", - "fieldtype": "Date", - "label": "Vehicle Dispatch Date", - "no_copy": 0, - "oldfieldname": "lr_date", - "oldfieldtype": "Date", - "print_hide": 1, - "print_width": "100px", - "read_only": 0, - "width": "100px" - }, - { - "depends_on": "customer", - "doctype": "DocField", - "fieldname": "contact_info", - "fieldtype": "Section Break", - "label": "Contact Info", - "options": "icon-bullhorn", - "read_only": 0 - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "territory", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 1, - "label": "Territory", - "options": "Territory", - "print_hide": 1, - "read_only": 0, - "reqd": 1, - "search_index": 1 - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "customer_group", - "fieldtype": "Link", - "in_filter": 1, - "label": "Customer Group", - "options": "Customer Group", - "print_hide": 1, - "read_only": 0, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "col_break21", - "fieldtype": "Column Break", - "print_width": "50%", - "read_only": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "contact_person", - "fieldtype": "Link", - "in_filter": 1, - "label": "Contact Person", - "options": "Contact", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "more_info", - "fieldtype": "Section Break", - "label": "More Info", - "oldfieldtype": "Section Break", - "options": "icon-file-text", - "print_hide": 1, - "read_only": 0 - }, - { - "description": "Track this Delivery Note against any Project", - "doctype": "DocField", - "fieldname": "project_name", - "fieldtype": "Link", - "in_filter": 1, - "label": "Project Name", - "oldfieldname": "project_name", - "oldfieldtype": "Link", - "options": "Project", - "read_only": 0, - "search_index": 1 - }, - { - "depends_on": "eval:doc.source == 'Campaign'", - "doctype": "DocField", - "fieldname": "campaign", - "fieldtype": "Link", - "label": "Campaign", - "oldfieldname": "campaign", - "oldfieldtype": "Link", - "options": "Campaign", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "source", - "fieldtype": "Select", - "label": "Source", - "oldfieldname": "source", - "oldfieldtype": "Select", - "options": "\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break5", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "print_hide": 1, - "print_width": "50%", - "read_only": 0, - "width": "50%" - }, - { - "description": "Time at which items were delivered from warehouse", - "doctype": "DocField", - "fieldname": "posting_time", - "fieldtype": "Time", - "in_filter": 0, - "label": "Posting Time", - "oldfieldname": "posting_time", - "oldfieldtype": "Time", - "print_hide": 1, - "print_width": "100px", - "read_only": 0, - "reqd": 1, - "search_index": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "fiscal_year", - "fieldtype": "Select", - "in_filter": 1, - "label": "Fiscal Year", - "oldfieldname": "fiscal_year", - "oldfieldtype": "Select", - "options": "link:Fiscal Year", - "print_hide": 1, - "print_width": "150px", - "read_only": 0, - "reqd": 1, - "search_index": 1, - "width": "150px" - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "letter_head", - "fieldtype": "Select", - "label": "Letter Head", - "oldfieldname": "letter_head", - "oldfieldtype": "Link", - "options": "link:Letter Head", - "print_hide": 1, - "read_only": 0 - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "select_print_heading", - "fieldtype": "Link", - "label": "Print Heading", - "no_copy": 1, - "oldfieldname": "select_print_heading", - "oldfieldtype": "Link", - "options": "Print Heading", - "print_hide": 1, - "read_only": 0, - "report_hide": 1 - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "print_without_amount", - "fieldtype": "Check", - "label": "Print Without Amount", - "oldfieldname": "print_without_amount", - "oldfieldtype": "Check", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "section_break_83", - "fieldtype": "Section Break" - }, - { - "default": "Draft", - "doctype": "DocField", - "fieldname": "status", - "fieldtype": "Select", - "in_filter": 1, - "label": "Status", - "no_copy": 1, - "oldfieldname": "status", - "oldfieldtype": "Select", - "options": "\nDraft\nSubmitted\nCancelled", - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "reqd": 1, - "search_index": 1, - "width": "150px" - }, - { - "depends_on": "eval:!doc.__islocal", - "description": "% of materials delivered against this Delivery Note", - "doctype": "DocField", - "fieldname": "per_installed", - "fieldtype": "Percent", - "in_filter": 1, - "in_list_view": 1, - "label": "% Installed", - "no_copy": 1, - "oldfieldname": "per_installed", - "oldfieldtype": "Currency", - "print_hide": 1, - "read_only": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "installation_status", - "fieldtype": "Select", - "hidden": 1, - "label": "Installation Status", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break_89", - "fieldtype": "Column Break" - }, - { - "description": "Required only for sample item.", - "doctype": "DocField", - "fieldname": "to_warehouse", - "fieldtype": "Link", - "hidden": 0, - "label": "To Warehouse", - "no_copy": 1, - "oldfieldname": "to_warehouse", - "oldfieldtype": "Link", - "options": "Warehouse", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "excise_page", - "fieldtype": "Data", - "hidden": 1, - "label": "Excise Page Number", - "oldfieldname": "excise_page", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "instructions", - "fieldtype": "Text", - "label": "Instructions", - "oldfieldname": "instructions", - "oldfieldtype": "Text", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "sales_team_section_break", - "fieldtype": "Section Break", - "label": "Sales Team", - "oldfieldtype": "Section Break", - "options": "icon-group", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "sales_partner", - "fieldtype": "Link", - "label": "Sales Partner", - "no_copy": 0, - "oldfieldname": "sales_partner", - "oldfieldtype": "Link", - "options": "Sales Partner", - "print_hide": 1, - "print_width": "150px", - "read_only": 0, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "column_break7", - "fieldtype": "Column Break", - "print_hide": 1, - "print_width": "50%", - "read_only": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "commission_rate", - "fieldtype": "Float", - "label": "Commission Rate (%)", - "no_copy": 0, - "oldfieldname": "commission_rate", - "oldfieldtype": "Currency", - "print_hide": 1, - "print_width": "100px", - "read_only": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "total_commission", - "fieldtype": "Currency", - "label": "Total Commission", - "no_copy": 0, - "oldfieldname": "total_commission", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "section_break1", - "fieldtype": "Section Break", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "sales_team", - "fieldtype": "Table", - "label": "Sales Team1", - "oldfieldname": "sales_team", - "oldfieldtype": "Table", - "options": "Sales Team", - "print_hide": 1, - "read_only": 0 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Material User", - "submit": 1, - "write": 1 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Material Manager", - "submit": 1, - "write": 1 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Sales User", - "submit": 1, - "write": 1 - }, - { - "cancel": 0, - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Accounts User", - "submit": 0, - "write": 0 - }, - { - "cancel": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Customer" - } -] \ No newline at end of file +{ + "allow_attach": 1, + "autoname": "naming_series:", + "creation": "2013-05-24 19:29:09", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Transaction", + "fields": [ + { + "fieldname": "delivery_to_section", + "fieldtype": "Section Break", + "label": "Delivery To", + "options": "icon-user", + "permlevel": 0 + }, + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_width": "50%", + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "naming_series", + "fieldtype": "Select", + "label": "Series", + "no_copy": 1, + "oldfieldname": "naming_series", + "oldfieldtype": "Select", + "options": "DN", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "customer", + "fieldtype": "Link", + "in_filter": 1, + "label": "Customer", + "oldfieldname": "customer", + "oldfieldtype": "Link", + "options": "Customer", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1, + "search_index": 1 + }, + { + "depends_on": "customer", + "fieldname": "customer_name", + "fieldtype": "Data", + "hidden": 0, + "in_list_view": 1, + "label": "Customer Name", + "permlevel": 0, + "read_only": 1 + }, + { + "depends_on": "customer", + "fieldname": "customer_address", + "fieldtype": "Link", + "in_filter": 1, + "label": "Billing Address Name", + "options": "Address", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "address_display", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Billing Address", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "shipping_address_name", + "fieldtype": "Link", + "label": "Shipping Address", + "options": "Address", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "shipping_address", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Shipping Address", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "contact_display", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Contact", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "contact_mobile", + "fieldtype": "Text", + "hidden": 1, + "label": "Mobile No", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "contact_email", + "fieldtype": "Text", + "hidden": 1, + "label": "Contact Email", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 0 + }, + { + "allow_on_submit": 0, + "fieldname": "amended_from", + "fieldtype": "Data", + "ignore_restrictions": 1, + "label": "Amended From", + "no_copy": 1, + "oldfieldname": "amended_from", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 1, + "width": "150px" + }, + { + "description": "Select the relevant company name if you have multiple companies", + "fieldname": "company", + "fieldtype": "Link", + "in_filter": 1, + "label": "Company", + "oldfieldname": "company", + "oldfieldtype": "Link", + "options": "Company", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 0, + "reqd": 1, + "search_index": 1, + "width": "150px" + }, + { + "default": "Today", + "fieldname": "posting_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Posting Date", + "no_copy": 1, + "oldfieldname": "posting_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 0, + "print_width": "100px", + "read_only": 0, + "reqd": 1, + "search_index": 1, + "width": "100px" + }, + { + "fieldname": "po_no", + "fieldtype": "Data", + "hidden": 1, + "label": "Customer's Purchase Order No", + "no_copy": 0, + "oldfieldname": "po_no", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 1, + "width": "100px" + }, + { + "depends_on": "eval:doc.po_no", + "fieldname": "po_date", + "fieldtype": "Date", + "hidden": 0, + "label": "Customer's Purchase Order Date", + "no_copy": 0, + "oldfieldname": "po_date", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 1, + "width": "100px" + }, + { + "fieldname": "sec_break25", + "fieldtype": "Section Break", + "label": "Currency and Price List", + "options": "icon-tag", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "currency", + "fieldtype": "Link", + "label": "Currency", + "oldfieldname": "currency", + "oldfieldtype": "Select", + "options": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1 + }, + { + "description": "Rate at which customer's currency is converted to company's base currency", + "fieldname": "conversion_rate", + "fieldtype": "Float", + "label": "Exchange Rate", + "no_copy": 0, + "oldfieldname": "conversion_rate", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "col_break23", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "selling_price_list", + "fieldtype": "Link", + "label": "Price List", + "oldfieldname": "price_list_name", + "oldfieldtype": "Select", + "options": "Price List", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "price_list_currency", + "fieldtype": "Link", + "label": "Price List Currency", + "options": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 1 + }, + { + "description": "Rate at which Price list currency is converted to company's base currency", + "fieldname": "plc_conversion_rate", + "fieldtype": "Float", + "label": "Price List Exchange Rate", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "items", + "fieldtype": "Section Break", + "label": "Items", + "oldfieldtype": "Section Break", + "options": "icon-shopping-cart", + "permlevel": 0, + "read_only": 0 + }, + { + "allow_on_submit": 1, + "fieldname": "delivery_note_details", + "fieldtype": "Table", + "label": "Delivery Note Items", + "no_copy": 0, + "oldfieldname": "delivery_note_details", + "oldfieldtype": "Table", + "options": "Delivery Note Item", + "permlevel": 0, + "print_hide": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "packing_list", + "fieldtype": "Section Break", + "label": "Packing List", + "oldfieldtype": "Section Break", + "options": "icon-suitcase", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "packing_details", + "fieldtype": "Table", + "label": "Packing Details", + "oldfieldname": "packing_details", + "oldfieldtype": "Table", + "options": "Packed Item", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "sales_bom_help", + "fieldtype": "HTML", + "label": "Sales BOM Help", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "section_break_31", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "net_total_export", + "fieldtype": "Currency", + "label": "Net Total", + "options": "currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "column_break_33", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "net_total", + "fieldtype": "Currency", + "label": "Net Total (Company Currency)", + "no_copy": 0, + "oldfieldname": "net_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 1, + "reqd": 0, + "width": "150px" + }, + { + "fieldname": "taxes", + "fieldtype": "Section Break", + "label": "Taxes and Charges", + "oldfieldtype": "Section Break", + "options": "icon-money", + "permlevel": 0, + "read_only": 0 + }, + { + "description": "If you have created a standard template in Sales Taxes and Charges Master, select one and click on the button below.", + "fieldname": "taxes_and_charges", + "fieldtype": "Link", + "label": "Taxes and Charges", + "oldfieldname": "charge", + "oldfieldtype": "Link", + "options": "Sales Taxes and Charges Master", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "column_break_39", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "shipping_rule", + "fieldtype": "Link", + "label": "Shipping Rule", + "oldfieldtype": "Button", + "options": "Shipping Rule", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "section_break_41", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "other_charges", + "fieldtype": "Table", + "label": "Sales Taxes and Charges", + "no_copy": 0, + "oldfieldname": "other_charges", + "oldfieldtype": "Table", + "options": "Sales Taxes and Charges", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "other_charges_calculation", + "fieldtype": "HTML", + "label": "Taxes and Charges Calculation", + "oldfieldtype": "HTML", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "section_break_44", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "other_charges_total_export", + "fieldtype": "Currency", + "label": "Taxes and Charges Total", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "column_break_47", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "other_charges_total", + "fieldtype": "Currency", + "label": "Taxes and Charges Total (Company Currency)", + "oldfieldname": "other_charges_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 1, + "width": "150px" + }, + { + "fieldname": "discount_amount", + "fieldtype": "Currency", + "label": "Discount Amount", + "options": "Company:company:default_currency", + "permlevel": 0 + }, + { + "fieldname": "totals", + "fieldtype": "Section Break", + "label": "Totals", + "oldfieldtype": "Section Break", + "options": "icon-money", + "permlevel": 0, + "print_hide": 0, + "read_only": 0 + }, + { + "fieldname": "grand_total_export", + "fieldtype": "Currency", + "label": "Grand Total", + "no_copy": 0, + "oldfieldname": "grand_total_export", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "print_width": "150px", + "read_only": 1, + "reqd": 0, + "width": "150px" + }, + { + "fieldname": "rounded_total_export", + "fieldtype": "Currency", + "label": "Rounded Total", + "no_copy": 0, + "oldfieldname": "rounded_total_export", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "print_width": "150px", + "read_only": 1, + "width": "150px" + }, + { + "description": "In Words (Export) will be visible once you save the Delivery Note.", + "fieldname": "in_words_export", + "fieldtype": "Data", + "label": "In Words", + "no_copy": 0, + "oldfieldname": "in_words_export", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 0, + "print_width": "150px", + "read_only": 1, + "width": "150px" + }, + { + "fieldname": "column_break3", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "grand_total", + "fieldtype": "Currency", + "label": "Grand Total (Company Currency)", + "no_copy": 0, + "oldfieldname": "grand_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 1, + "reqd": 0, + "width": "150px" + }, + { + "fieldname": "rounded_total", + "fieldtype": "Currency", + "label": "Rounded Total (Company Currency)", + "no_copy": 0, + "oldfieldname": "rounded_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 1, + "width": "150px" + }, + { + "description": "In Words will be visible once you save the Delivery Note.", + "fieldname": "in_words", + "fieldtype": "Data", + "label": "In Words (Company Currency)", + "no_copy": 0, + "oldfieldname": "in_words", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "print_width": "200px", + "read_only": 1, + "width": "200px" + }, + { + "fieldname": "terms_section_break", + "fieldtype": "Section Break", + "label": "Terms and Conditions", + "oldfieldtype": "Section Break", + "options": "icon-legal", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "tc_name", + "fieldtype": "Link", + "label": "Terms", + "oldfieldname": "tc_name", + "oldfieldtype": "Link", + "options": "Terms and Conditions", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "terms", + "fieldtype": "Text Editor", + "label": "Terms and Conditions Details", + "oldfieldname": "terms", + "oldfieldtype": "Text Editor", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "transporter_info", + "fieldtype": "Section Break", + "label": "Transporter Info", + "options": "icon-truck", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "transporter_name", + "fieldtype": "Data", + "label": "Transporter Name", + "no_copy": 0, + "oldfieldname": "transporter_name", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 0, + "reqd": 0, + "width": "150px" + }, + { + "fieldname": "col_break34", + "fieldtype": "Column Break", + "permlevel": 0, + "print_width": "50%", + "read_only": 0, + "width": "50%" + }, + { + "description": "Transporter lorry number", + "fieldname": "lr_no", + "fieldtype": "Data", + "label": "Vehicle No", + "no_copy": 0, + "oldfieldname": "lr_no", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 0, + "reqd": 0, + "width": "100px" + }, + { + "default": "Today", + "description": "Date on which lorry started from your warehouse", + "fieldname": "lr_date", + "fieldtype": "Date", + "label": "Vehicle Dispatch Date", + "no_copy": 0, + "oldfieldname": "lr_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 0, + "width": "100px" + }, + { + "depends_on": "customer", + "fieldname": "contact_info", + "fieldtype": "Section Break", + "label": "Contact Info", + "options": "icon-bullhorn", + "permlevel": 0, + "read_only": 0 + }, + { + "description": "Add / Edit", + "fieldname": "territory", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 1, + "label": "Territory", + "options": "Territory", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1, + "search_index": 1 + }, + { + "description": "Add / Edit", + "fieldname": "customer_group", + "fieldtype": "Link", + "in_filter": 1, + "label": "Customer Group", + "options": "Customer Group", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "search_index": 1 + }, + { + "fieldname": "col_break21", + "fieldtype": "Column Break", + "permlevel": 0, + "print_width": "50%", + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "contact_person", + "fieldtype": "Link", + "in_filter": 1, + "label": "Contact Person", + "options": "Contact", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "more_info", + "fieldtype": "Section Break", + "label": "More Info", + "oldfieldtype": "Section Break", + "options": "icon-file-text", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "description": "Track this Delivery Note against any Project", + "fieldname": "project_name", + "fieldtype": "Link", + "in_filter": 1, + "label": "Project Name", + "oldfieldname": "project_name", + "oldfieldtype": "Link", + "options": "Project", + "permlevel": 0, + "read_only": 0, + "search_index": 1 + }, + { + "depends_on": "eval:doc.source == 'Campaign'", + "fieldname": "campaign", + "fieldtype": "Link", + "label": "Campaign", + "oldfieldname": "campaign", + "oldfieldtype": "Link", + "options": "Campaign", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "source", + "fieldtype": "Select", + "label": "Source", + "oldfieldname": "source", + "oldfieldtype": "Select", + "options": "\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "column_break5", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 1, + "print_width": "50%", + "read_only": 0, + "width": "50%" + }, + { + "description": "Time at which items were delivered from warehouse", + "fieldname": "posting_time", + "fieldtype": "Time", + "in_filter": 0, + "label": "Posting Time", + "oldfieldname": "posting_time", + "oldfieldtype": "Time", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 0, + "reqd": 1, + "search_index": 0, + "width": "100px" + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Select", + "in_filter": 1, + "label": "Fiscal Year", + "oldfieldname": "fiscal_year", + "oldfieldtype": "Select", + "options": "link:Fiscal Year", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 0, + "reqd": 1, + "search_index": 1, + "width": "150px" + }, + { + "allow_on_submit": 1, + "fieldname": "letter_head", + "fieldtype": "Select", + "label": "Letter Head", + "oldfieldname": "letter_head", + "oldfieldtype": "Link", + "options": "link:Letter Head", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "allow_on_submit": 1, + "fieldname": "select_print_heading", + "fieldtype": "Link", + "label": "Print Heading", + "no_copy": 1, + "oldfieldname": "select_print_heading", + "oldfieldtype": "Link", + "options": "Print Heading", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 1 + }, + { + "allow_on_submit": 1, + "fieldname": "print_without_amount", + "fieldtype": "Check", + "label": "Print Without Amount", + "oldfieldname": "print_without_amount", + "oldfieldtype": "Check", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "section_break_83", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "default": "Draft", + "fieldname": "status", + "fieldtype": "Select", + "in_filter": 1, + "label": "Status", + "no_copy": 1, + "oldfieldname": "status", + "oldfieldtype": "Select", + "options": "\nDraft\nSubmitted\nCancelled", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 1, + "reqd": 1, + "search_index": 1, + "width": "150px" + }, + { + "depends_on": "eval:!doc.__islocal", + "description": "% of materials delivered against this Delivery Note", + "fieldname": "per_installed", + "fieldtype": "Percent", + "in_filter": 1, + "in_list_view": 1, + "label": "% Installed", + "no_copy": 1, + "oldfieldname": "per_installed", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "search_index": 1 + }, + { + "fieldname": "installation_status", + "fieldtype": "Select", + "hidden": 1, + "label": "Installation Status", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "column_break_89", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "description": "Required only for sample item.", + "fieldname": "to_warehouse", + "fieldtype": "Link", + "hidden": 0, + "label": "To Warehouse", + "no_copy": 1, + "oldfieldname": "to_warehouse", + "oldfieldtype": "Link", + "options": "Warehouse", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "excise_page", + "fieldtype": "Data", + "hidden": 1, + "label": "Excise Page Number", + "oldfieldname": "excise_page", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "instructions", + "fieldtype": "Text", + "label": "Instructions", + "oldfieldname": "instructions", + "oldfieldtype": "Text", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "sales_team_section_break", + "fieldtype": "Section Break", + "label": "Sales Team", + "oldfieldtype": "Section Break", + "options": "icon-group", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "sales_partner", + "fieldtype": "Link", + "label": "Sales Partner", + "no_copy": 0, + "oldfieldname": "sales_partner", + "oldfieldtype": "Link", + "options": "Sales Partner", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 0, + "width": "150px" + }, + { + "fieldname": "column_break7", + "fieldtype": "Column Break", + "permlevel": 0, + "print_hide": 1, + "print_width": "50%", + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "commission_rate", + "fieldtype": "Float", + "label": "Commission Rate (%)", + "no_copy": 0, + "oldfieldname": "commission_rate", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 0, + "width": "100px" + }, + { + "fieldname": "total_commission", + "fieldtype": "Currency", + "label": "Total Commission", + "no_copy": 0, + "oldfieldname": "total_commission", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "section_break1", + "fieldtype": "Section Break", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "sales_team", + "fieldtype": "Table", + "label": "Sales Team1", + "oldfieldname": "sales_team", + "oldfieldtype": "Table", + "options": "Sales Team", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + } + ], + "hide_toolbar": 0, + "icon": "icon-truck", + "idx": 1, + "in_create": 0, + "is_submittable": 1, + "modified": "2014-01-28 18:51:42", + "modified_by": "Administrator", + "module": "Stock", + "name": "Delivery Note", + "owner": "Administrator", + "permissions": [ + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material User", + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material Manager", + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales User", + "submit": 1, + "write": 1 + }, + { + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts User", + "submit": 0, + "write": 0 + }, + { + "cancel": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Customer" + } + ], + "read_only_onload": 1, + "search_fields": "status,customer,customer_name, territory,grand_total" +} \ No newline at end of file diff --git a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.txt b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.txt index f5f77125f1..e7be79f744 100644 --- a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.txt +++ b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.txt @@ -1,458 +1,445 @@ -[ - { - "creation": "2013-04-22 13:15:44", - "docstatus": 0, - "modified": "2014-02-28 11:20:58", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "DND/.#######", - "doctype": "DocType", - "istable": 1, - "module": "Stock", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Delivery Note Item", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Delivery Note Item" - }, - { - "doctype": "DocField", - "fieldname": "barcode", - "fieldtype": "Data", - "in_list_view": 0, - "label": "Barcode", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "item_code", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "Item Code", - "oldfieldname": "item_code", - "oldfieldtype": "Link", - "options": "Item", - "print_width": "150px", - "read_only": 0, - "reqd": 1, - "search_index": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "item_name", - "fieldtype": "Data", - "in_list_view": 0, - "label": "Item Name", - "oldfieldname": "item_name", - "oldfieldtype": "Data", - "print_hide": 1, - "print_width": "150px", - "read_only": 0, - "reqd": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "col_break1", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "customer_item_code", - "fieldtype": "Data", - "hidden": 1, - "in_list_view": 0, - "label": "Customer's Item Code", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Small Text", - "in_list_view": 1, - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Small Text", - "print_width": "300px", - "read_only": 0, - "reqd": 1, - "width": "300px" - }, - { - "doctype": "DocField", - "fieldname": "quantity_and_rate", - "fieldtype": "Section Break", - "in_list_view": 0, - "label": "Quantity and Rate" - }, - { - "doctype": "DocField", - "fieldname": "qty", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Quantity", - "oldfieldname": "qty", - "oldfieldtype": "Currency", - "print_width": "100px", - "read_only": 0, - "reqd": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "price_list_rate", - "fieldtype": "Currency", - "in_list_view": 0, - "label": "Price List Rate", - "no_copy": 0, - "oldfieldname": "ref_rate", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 1, - "print_width": "100px", - "read_only": 1, - "reqd": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "discount_percentage", - "fieldtype": "Float", - "in_list_view": 0, - "label": "Discount (%)", - "oldfieldname": "adj_rate", - "oldfieldtype": "Float", - "print_hide": 1, - "print_width": "100px", - "read_only": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "col_break2", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "stock_uom", - "fieldtype": "Link", - "in_list_view": 0, - "label": "UOM", - "oldfieldname": "stock_uom", - "oldfieldtype": "Data", - "options": "UOM", - "print_hide": 0, - "print_width": "50px", - "read_only": 1, - "reqd": 1, - "width": "50px" - }, - { - "doctype": "DocField", - "fieldname": "base_price_list_rate", - "fieldtype": "Currency", - "in_list_view": 0, - "label": "Price List Rate (Company Currency)", - "oldfieldname": "base_ref_rate", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "print_width": "100px", - "read_only": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "section_break_1", - "fieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "rate", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Rate", - "oldfieldname": "export_rate", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 0, - "print_width": "150px", - "read_only": 0, - "reqd": 0, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "amount", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Amount", - "oldfieldname": "export_amount", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 0, - "print_width": "100px", - "read_only": 1, - "reqd": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "col_break3", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "base_rate", - "fieldtype": "Currency", - "in_list_view": 0, - "label": "Rate (Company Currency)", - "oldfieldname": "basic_rate", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "reqd": 0, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "base_amount", - "fieldtype": "Currency", - "in_list_view": 0, - "label": "Amount (Company Currency)", - "oldfieldname": "amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "print_width": "100px", - "read_only": 1, - "reqd": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "pricing_rule_for_price", - "fieldtype": "Link", - "label": "Pricing Rule For Price", - "options": "Pricing Rule", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "pricing_rule_for_discount", - "fieldtype": "Link", - "label": "Pricing Rule For Discount", - "options": "Pricing Rule", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "warehouse_and_reference", - "fieldtype": "Section Break", - "in_list_view": 0, - "label": "Warehouse and Reference" - }, - { - "doctype": "DocField", - "fieldname": "warehouse", - "fieldtype": "Link", - "in_list_view": 0, - "label": "Warehouse", - "oldfieldname": "warehouse", - "oldfieldtype": "Link", - "options": "Warehouse", - "print_hide": 1, - "print_width": "100px", - "read_only": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "serial_no", - "fieldtype": "Text", - "in_filter": 1, - "in_list_view": 1, - "label": "Serial No", - "no_copy": 1, - "oldfieldname": "serial_no", - "oldfieldtype": "Text", - "print_hide": 0, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "batch_no", - "fieldtype": "Link", - "hidden": 0, - "label": "Batch No", - "oldfieldname": "batch_no", - "oldfieldtype": "Link", - "options": "Batch", - "print_hide": 1, - "read_only": 0 - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "item_group", - "fieldtype": "Link", - "hidden": 1, - "label": "Item Group", - "oldfieldname": "item_group", - "oldfieldtype": "Link", - "options": "Item Group", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "brand", - "fieldtype": "Link", - "hidden": 1, - "label": "Brand Name", - "oldfieldname": "brand", - "oldfieldtype": "Link", - "options": "Brand", - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "item_tax_rate", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Item Tax Rate", - "oldfieldname": "item_tax_rate", - "oldfieldtype": "Small Text", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "col_break4", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "actual_qty", - "fieldtype": "Float", - "label": "Available Qty at Warehouse", - "no_copy": 1, - "oldfieldname": "actual_qty", - "oldfieldtype": "Currency", - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "expense_account", - "fieldtype": "Link", - "hidden": 0, - "label": "Expense Account", - "no_copy": 1, - "options": "Account", - "print_hide": 1, - "read_only": 0, - "width": "120px" - }, - { - "default": ":Company", - "doctype": "DocField", - "fieldname": "cost_center", - "fieldtype": "Link", - "hidden": 0, - "label": "Cost Center", - "no_copy": 1, - "options": "Cost Center", - "print_hide": 1, - "read_only": 0, - "width": "120px" - }, - { - "doctype": "DocField", - "fieldname": "against_sales_order", - "fieldtype": "Link", - "label": "Against Sales Order", - "options": "Sales Order", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "against_sales_invoice", - "fieldtype": "Link", - "label": "Against Sales Invoice", - "options": "Sales Invoice", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "prevdoc_detail_docname", - "fieldtype": "Data", - "hidden": 1, - "in_filter": 1, - "label": "Against Document Detail No", - "no_copy": 1, - "oldfieldname": "prevdoc_detail_docname", - "oldfieldtype": "Data", - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "search_index": 0, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "installed_qty", - "fieldtype": "Float", - "label": "Installed Qty", - "no_copy": 1, - "oldfieldname": "installed_qty", - "oldfieldtype": "Currency", - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "buying_amount", - "fieldtype": "Currency", - "hidden": 1, - "label": "Buying Amount", - "no_copy": 1, - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "page_break", - "fieldtype": "Check", - "label": "Page Break", - "oldfieldname": "page_break", - "oldfieldtype": "Check", - "print_hide": 1, - "read_only": 0 - } -] \ No newline at end of file +{ + "autoname": "DND/.#######", + "creation": "2013-04-22 13:15:44", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "barcode", + "fieldtype": "Data", + "in_list_view": 0, + "label": "Barcode", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "item_code", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Item Code", + "oldfieldname": "item_code", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0, + "print_width": "150px", + "read_only": 0, + "reqd": 1, + "search_index": 1, + "width": "150px" + }, + { + "fieldname": "item_name", + "fieldtype": "Data", + "in_list_view": 0, + "label": "Item Name", + "oldfieldname": "item_name", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 0, + "reqd": 1, + "width": "150px" + }, + { + "fieldname": "col_break1", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "customer_item_code", + "fieldtype": "Data", + "hidden": 1, + "in_list_view": 0, + "label": "Customer's Item Code", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "description", + "fieldtype": "Small Text", + "in_list_view": 1, + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_width": "300px", + "read_only": 0, + "reqd": 1, + "width": "300px" + }, + { + "fieldname": "quantity_and_rate", + "fieldtype": "Section Break", + "in_list_view": 0, + "label": "Quantity and Rate", + "permlevel": 0 + }, + { + "fieldname": "qty", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Quantity", + "oldfieldname": "qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_width": "100px", + "read_only": 0, + "reqd": 1, + "width": "100px" + }, + { + "fieldname": "price_list_rate", + "fieldtype": "Currency", + "in_list_view": 0, + "label": "Price List Rate", + "no_copy": 0, + "oldfieldname": "ref_rate", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 1, + "reqd": 0, + "width": "100px" + }, + { + "fieldname": "discount_percentage", + "fieldtype": "Float", + "in_list_view": 0, + "label": "Discount (%)", + "oldfieldname": "adj_rate", + "oldfieldtype": "Float", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 0, + "width": "100px" + }, + { + "fieldname": "col_break2", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "stock_uom", + "fieldtype": "Link", + "in_list_view": 0, + "label": "UOM", + "oldfieldname": "stock_uom", + "oldfieldtype": "Data", + "options": "UOM", + "permlevel": 0, + "print_hide": 0, + "print_width": "50px", + "read_only": 1, + "reqd": 1, + "width": "50px" + }, + { + "fieldname": "base_price_list_rate", + "fieldtype": "Currency", + "in_list_view": 0, + "label": "Price List Rate (Company Currency)", + "oldfieldname": "base_ref_rate", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 1, + "width": "100px" + }, + { + "fieldname": "section_break_1", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "rate", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Rate", + "oldfieldname": "export_rate", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "print_width": "150px", + "read_only": 0, + "reqd": 0, + "width": "150px" + }, + { + "fieldname": "amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Amount", + "oldfieldname": "export_amount", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "print_width": "100px", + "read_only": 1, + "reqd": 0, + "width": "100px" + }, + { + "fieldname": "col_break3", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "base_rate", + "fieldtype": "Currency", + "in_list_view": 0, + "label": "Rate (Company Currency)", + "oldfieldname": "basic_rate", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 1, + "reqd": 0, + "width": "150px" + }, + { + "fieldname": "base_amount", + "fieldtype": "Currency", + "in_list_view": 0, + "label": "Amount (Company Currency)", + "oldfieldname": "amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 1, + "reqd": 0, + "width": "100px" + }, + { + "fieldname": "pricing_rule_for_price", + "fieldtype": "Link", + "label": "Pricing Rule For Price", + "options": "Pricing Rule", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "pricing_rule_for_discount", + "fieldtype": "Link", + "label": "Pricing Rule For Discount", + "options": "Pricing Rule", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "warehouse_and_reference", + "fieldtype": "Section Break", + "in_list_view": 0, + "label": "Warehouse and Reference", + "permlevel": 0 + }, + { + "fieldname": "warehouse", + "fieldtype": "Link", + "in_list_view": 0, + "label": "Warehouse", + "oldfieldname": "warehouse", + "oldfieldtype": "Link", + "options": "Warehouse", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 0, + "width": "100px" + }, + { + "fieldname": "serial_no", + "fieldtype": "Text", + "in_filter": 1, + "in_list_view": 1, + "label": "Serial No", + "no_copy": 1, + "oldfieldname": "serial_no", + "oldfieldtype": "Text", + "permlevel": 0, + "print_hide": 0, + "read_only": 0 + }, + { + "fieldname": "batch_no", + "fieldtype": "Link", + "hidden": 0, + "label": "Batch No", + "oldfieldname": "batch_no", + "oldfieldtype": "Link", + "options": "Batch", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "description": "Add / Edit", + "fieldname": "item_group", + "fieldtype": "Link", + "hidden": 1, + "label": "Item Group", + "oldfieldname": "item_group", + "oldfieldtype": "Link", + "options": "Item Group", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "brand", + "fieldtype": "Link", + "hidden": 1, + "label": "Brand Name", + "oldfieldname": "brand", + "oldfieldtype": "Link", + "options": "Brand", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 1, + "width": "150px" + }, + { + "fieldname": "item_tax_rate", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Item Tax Rate", + "oldfieldname": "item_tax_rate", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "col_break4", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "actual_qty", + "fieldtype": "Float", + "label": "Available Qty at Warehouse", + "no_copy": 1, + "oldfieldname": "actual_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 1, + "width": "150px" + }, + { + "fieldname": "expense_account", + "fieldtype": "Link", + "hidden": 0, + "label": "Expense Account", + "no_copy": 1, + "options": "Account", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "width": "120px" + }, + { + "default": ":Company", + "fieldname": "cost_center", + "fieldtype": "Link", + "hidden": 0, + "label": "Cost Center", + "no_copy": 1, + "options": "Cost Center", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "width": "120px" + }, + { + "fieldname": "against_sales_order", + "fieldtype": "Link", + "label": "Against Sales Order", + "options": "Sales Order", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "against_sales_invoice", + "fieldtype": "Link", + "label": "Against Sales Invoice", + "options": "Sales Invoice", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "prevdoc_detail_docname", + "fieldtype": "Data", + "hidden": 1, + "in_filter": 1, + "label": "Against Document Detail No", + "no_copy": 1, + "oldfieldname": "prevdoc_detail_docname", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 1, + "search_index": 0, + "width": "150px" + }, + { + "fieldname": "installed_qty", + "fieldtype": "Float", + "label": "Installed Qty", + "no_copy": 1, + "oldfieldname": "installed_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 1, + "width": "150px" + }, + { + "fieldname": "buying_amount", + "fieldtype": "Currency", + "hidden": 1, + "label": "Buying Amount", + "no_copy": 1, + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "allow_on_submit": 1, + "fieldname": "page_break", + "fieldtype": "Check", + "label": "Page Break", + "oldfieldname": "page_break", + "oldfieldtype": "Check", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + } + ], + "idx": 1, + "istable": 1, + "modified": "2014-02-28 11:20:58", + "modified_by": "Administrator", + "module": "Stock", + "name": "Delivery Note Item", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/stock/doctype/item/item.txt b/erpnext/stock/doctype/item/item.txt index 229fa9718b..7aac35c773 100644 --- a/erpnext/stock/doctype/item/item.txt +++ b/erpnext/stock/doctype/item/item.txt @@ -1,892 +1,885 @@ -[ - { - "creation": "2013-05-03 10:45:46", - "docstatus": 0, - "modified": "2014-03-13 15:54:09", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_attach": 1, - "allow_import": 1, - "allow_rename": 1, - "autoname": "field:item_code", - "default_print_format": "Standard", - "description": "A Product or a Service that is bought, sold or kept in stock.", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-tag", - "max_attachments": 1, - "module": "Stock", - "name": "__common__", - "search_fields": "item_name,description,item_group,customer_code" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Item", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "cancel": 0, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Item", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 0 - }, - { - "doctype": "DocType", - "name": "Item" - }, - { - "doctype": "DocField", - "fieldname": "name_and_description_section", - "fieldtype": "Section Break", - "label": "Name and Description", - "no_copy": 0, - "oldfieldtype": "Section Break", - "options": "icon-flag", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "naming_series", - "fieldtype": "Select", - "label": "Series", - "options": "\nITEM", - "read_only": 0 - }, - { - "description": "Item will be saved by this name in the data base.", - "doctype": "DocField", - "fieldname": "item_code", - "fieldtype": "Data", - "in_filter": 0, - "label": "Item Code", - "no_copy": 1, - "oldfieldname": "item_code", - "oldfieldtype": "Data", - "read_only": 0, - "reqd": 0, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "item_name", - "fieldtype": "Data", - "in_filter": 1, - "in_list_view": 1, - "label": "Item Name", - "oldfieldname": "item_name", - "oldfieldtype": "Data", - "read_only": 0, - "reqd": 1, - "search_index": 1 - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "item_group", - "fieldtype": "Link", - "in_filter": 1, - "label": "Item Group", - "oldfieldname": "item_group", - "oldfieldtype": "Link", - "options": "Item Group", - "read_only": 0, - "reqd": 1 - }, - { - "description": "Unit of measurement of this item (e.g. Kg, Unit, No, Pair).", - "doctype": "DocField", - "fieldname": "stock_uom", - "fieldtype": "Link", - "ignore_restrictions": 1, - "label": "Default Unit of Measure", - "oldfieldname": "stock_uom", - "oldfieldtype": "Link", - "options": "UOM", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "brand", - "fieldtype": "Link", - "hidden": 0, - "label": "Brand", - "oldfieldname": "brand", - "oldfieldtype": "Link", - "options": "Brand", - "print_hide": 1, - "read_only": 0, - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "barcode", - "fieldtype": "Data", - "label": "Barcode", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "image", - "fieldtype": "Select", - "label": "Image", - "options": "attach_files:", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "image_view", - "fieldtype": "Image", - "in_list_view": 1, - "label": "Image View", - "options": "image", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Small Text", - "in_filter": 0, - "in_list_view": 1, - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Text", - "read_only": 0, - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "description_html", - "fieldtype": "Small Text", - "label": "Description HTML", - "read_only": 0 - }, - { - "description": "Generates HTML to include selected image in the description", - "doctype": "DocField", - "fieldname": "add_image", - "fieldtype": "Button", - "label": "Generate Description HTML", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "inventory", - "fieldtype": "Section Break", - "label": "Inventory", - "oldfieldtype": "Section Break", - "options": "icon-truck", - "read_only": 0 - }, - { - "default": "Yes", - "description": "Select \"Yes\" if you are maintaining stock of this item in your Inventory.", - "doctype": "DocField", - "fieldname": "is_stock_item", - "fieldtype": "Select", - "label": "Is Stock Item", - "oldfieldname": "is_stock_item", - "oldfieldtype": "Select", - "options": "Yes\nNo", - "read_only": 0, - "reqd": 1 - }, - { - "depends_on": "eval:doc.is_stock_item==\"Yes\"", - "description": "Mandatory if Stock Item is \"Yes\". Also the default warehouse where reserved quantity is set from Sales Order.", - "doctype": "DocField", - "fieldname": "default_warehouse", - "fieldtype": "Link", - "ignore_restrictions": 1, - "label": "Default Warehouse", - "oldfieldname": "default_warehouse", - "oldfieldtype": "Link", - "options": "Warehouse", - "read_only": 0 - }, - { - "depends_on": "eval:doc.is_stock_item==\"Yes\"", - "description": "Percentage variation in quantity to be allowed while receiving or delivering this item.", - "doctype": "DocField", - "fieldname": "tolerance", - "fieldtype": "Float", - "label": "Allowance Percent", - "oldfieldname": "tolerance", - "oldfieldtype": "Currency", - "read_only": 0 - }, - { - "depends_on": "eval:doc.is_stock_item==\"Yes\"", - "doctype": "DocField", - "fieldname": "valuation_method", - "fieldtype": "Select", - "label": "Valuation Method", - "options": "\nFIFO\nMoving Average", - "read_only": 0 - }, - { - "default": "0.00", - "depends_on": "eval:doc.is_stock_item==\"Yes\"", - "description": "You can enter the minimum quantity of this item to be ordered.", - "doctype": "DocField", - "fieldname": "min_order_qty", - "fieldtype": "Float", - "hidden": 0, - "label": "Minimum Order Qty", - "oldfieldname": "min_order_qty", - "oldfieldtype": "Currency", - "read_only": 0 - }, - { - "depends_on": "eval:doc.is_stock_item==\"Yes\"", - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "default": "No", - "depends_on": "eval:doc.is_stock_item==\"Yes\"", - "description": "Select \"Yes\" if this item is used for some internal purpose in your company.", - "doctype": "DocField", - "fieldname": "is_asset_item", - "fieldtype": "Select", - "label": "Is Fixed Asset Item", - "oldfieldname": "is_asset_item", - "oldfieldtype": "Select", - "options": "Yes\nNo", - "read_only": 0, - "reqd": 1 - }, - { - "default": "No", - "depends_on": "eval:doc.is_stock_item==\"Yes\"", - "doctype": "DocField", - "fieldname": "has_batch_no", - "fieldtype": "Select", - "label": "Has Batch No", - "oldfieldname": "has_batch_no", - "oldfieldtype": "Select", - "options": "Yes\nNo", - "read_only": 0, - "reqd": 1 - }, - { - "default": "No", - "depends_on": "eval:doc.is_stock_item==\"Yes\"", - "description": "Selecting \"Yes\" will give a unique identity to each entity of this item which can be viewed in the Serial No master.", - "doctype": "DocField", - "fieldname": "has_serial_no", - "fieldtype": "Select", - "in_filter": 1, - "label": "Has Serial No", - "oldfieldname": "has_serial_no", - "oldfieldtype": "Select", - "options": "Yes\nNo", - "read_only": 0, - "reqd": 1 - }, - { - "depends_on": "eval: doc.has_serial_no===\"Yes\"", - "description": "Example: ABCD.#####\nIf series is set and Serial No is not mentioned in transactions, then automatic serial number will be created based on this series. If you always want to explicitly mention Serial Nos for this item. leave this blank.", - "doctype": "DocField", - "fieldname": "serial_no_series", - "fieldtype": "Data", - "label": "Serial Number Series" - }, - { - "depends_on": "eval:doc.is_stock_item==\"Yes\"", - "doctype": "DocField", - "fieldname": "warranty_period", - "fieldtype": "Data", - "label": "Warranty Period (in days)", - "oldfieldname": "warranty_period", - "oldfieldtype": "Data", - "read_only": 0 - }, - { - "depends_on": "eval:doc.is_stock_item==\"Yes\"", - "doctype": "DocField", - "fieldname": "end_of_life", - "fieldtype": "Date", - "label": "End of Life", - "oldfieldname": "end_of_life", - "oldfieldtype": "Date", - "read_only": 0 - }, - { - "depends_on": "eval:doc.is_stock_item==\"Yes\"", - "description": "Net Weight of each Item", - "doctype": "DocField", - "fieldname": "net_weight", - "fieldtype": "Float", - "label": "Net Weight", - "read_only": 0 - }, - { - "depends_on": "eval:doc.is_stock_item==\"Yes\"", - "doctype": "DocField", - "fieldname": "weight_uom", - "fieldtype": "Link", - "ignore_restrictions": 1, - "label": "Weight UOM", - "options": "UOM", - "read_only": 0 - }, - { - "description": "Auto-raise Material Request if quantity goes below re-order level in a warehouse", - "doctype": "DocField", - "fieldname": "reorder_section", - "fieldtype": "Section Break", - "label": "Re-order", - "options": "icon-rss", - "read_only": 0 - }, - { - "depends_on": "eval:doc.is_stock_item==\"Yes\"", - "doctype": "DocField", - "fieldname": "re_order_level", - "fieldtype": "Float", - "label": "Re-Order Level", - "oldfieldname": "re_order_level", - "oldfieldtype": "Currency", - "read_only": 0 - }, - { - "depends_on": "eval:doc.is_stock_item==\"Yes\"", - "doctype": "DocField", - "fieldname": "re_order_qty", - "fieldtype": "Float", - "label": "Re-Order Qty", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "section_break_31", - "fieldtype": "Section Break", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "item_reorder", - "fieldtype": "Table", - "label": "Warehouse-wise Item Reorder", - "options": "Item Reorder", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "purchase_details", - "fieldtype": "Section Break", - "label": "Purchase Details", - "oldfieldtype": "Section Break", - "options": "icon-shopping-cart", - "read_only": 0 - }, - { - "default": "Yes", - "description": "Selecting \"Yes\" will allow this item to appear in Purchase Order , Purchase Receipt.", - "doctype": "DocField", - "fieldname": "is_purchase_item", - "fieldtype": "Select", - "label": "Is Purchase Item", - "oldfieldname": "is_purchase_item", - "oldfieldtype": "Select", - "options": "Yes\nNo", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "default_supplier", - "fieldtype": "Link", - "ignore_restrictions": 1, - "label": "Default Supplier", - "options": "Supplier" - }, - { - "depends_on": "eval:doc.is_purchase_item==\"Yes\"", - "description": "Lead Time days is number of days by which this item is expected in your warehouse. This days is fetched in Material Request when you select this item.", - "doctype": "DocField", - "fieldname": "lead_time_days", - "fieldtype": "Int", - "label": "Lead Time Days", - "no_copy": 1, - "oldfieldname": "lead_time_days", - "oldfieldtype": "Int", - "read_only": 0 - }, - { - "depends_on": "eval:doc.is_purchase_item==\"Yes\"", - "description": "Default Purchase Account in which cost of the item will be debited.", - "doctype": "DocField", - "fieldname": "expense_account", - "fieldtype": "Link", - "ignore_restrictions": 1, - "label": "Default Expense Account", - "oldfieldname": "purchase_account", - "oldfieldtype": "Link", - "options": "Account", - "read_only": 0 - }, - { - "depends_on": "eval:doc.is_purchase_item==\"Yes\"", - "description": "Default Cost Center for tracking expense for this item.", - "doctype": "DocField", - "fieldname": "buying_cost_center", - "fieldtype": "Link", - "ignore_restrictions": 1, - "label": "Default Buying Cost Center", - "oldfieldname": "cost_center", - "oldfieldtype": "Link", - "options": "Cost Center", - "read_only": 0 - }, - { - "depends_on": "eval:doc.is_purchase_item==\"Yes\"", - "doctype": "DocField", - "fieldname": "last_purchase_rate", - "fieldtype": "Float", - "label": "Last Purchase Rate", - "no_copy": 1, - "oldfieldname": "last_purchase_rate", - "oldfieldtype": "Currency", - "read_only": 1 - }, - { - "depends_on": "eval:doc.is_purchase_item==\"Yes\"", - "doctype": "DocField", - "fieldname": "standard_rate", - "fieldtype": "Float", - "label": "Standard Rate", - "oldfieldname": "standard_rate", - "oldfieldtype": "Currency", - "read_only": 0 - }, - { - "depends_on": "eval:doc.is_purchase_item==\"Yes\"", - "doctype": "DocField", - "fieldname": "column_break2", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "depends_on": "eval:doc.is_purchase_item==\"Yes\"", - "doctype": "DocField", - "fieldname": "uom_conversion_details", - "fieldtype": "Table", - "label": "UOM Conversion Details", - "no_copy": 1, - "oldfieldname": "uom_conversion_details", - "oldfieldtype": "Table", - "options": "UOM Conversion Detail", - "read_only": 0 - }, - { - "depends_on": "eval:doc.is_purchase_item==\"Yes\"", - "doctype": "DocField", - "fieldname": "manufacturer", - "fieldtype": "Data", - "label": "Manufacturer", - "read_only": 0 - }, - { - "depends_on": "eval:doc.is_purchase_item==\"Yes\"", - "doctype": "DocField", - "fieldname": "manufacturer_part_no", - "fieldtype": "Data", - "label": "Manufacturer Part Number", - "read_only": 0 - }, - { - "depends_on": "eval:doc.is_purchase_item==\"Yes\"", - "doctype": "DocField", - "fieldname": "item_supplier_details", - "fieldtype": "Table", - "label": "Item Supplier Details", - "options": "Item Supplier", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "sales_details", - "fieldtype": "Section Break", - "label": "Sales Details", - "oldfieldtype": "Section Break", - "options": "icon-tag", - "read_only": 0 - }, - { - "default": "Yes", - "description": "Selecting \"Yes\" will allow this item to figure in Sales Order, Delivery Note", - "doctype": "DocField", - "fieldname": "is_sales_item", - "fieldtype": "Select", - "in_filter": 1, - "label": "Is Sales Item", - "oldfieldname": "is_sales_item", - "oldfieldtype": "Select", - "options": "Yes\nNo", - "read_only": 0, - "reqd": 1 - }, - { - "default": "No", - "depends_on": "eval:doc.is_sales_item==\"Yes\"", - "description": "Select \"Yes\" if this item represents some work like training, designing, consulting etc.", - "doctype": "DocField", - "fieldname": "is_service_item", - "fieldtype": "Select", - "in_filter": 1, - "label": "Is Service Item", - "oldfieldname": "is_service_item", - "oldfieldtype": "Select", - "options": "Yes\nNo", - "read_only": 0, - "reqd": 1 - }, - { - "depends_on": "eval:doc.is_sales_item==\"Yes\"", - "doctype": "DocField", - "fieldname": "max_discount", - "fieldtype": "Float", - "label": "Max Discount (%)", - "oldfieldname": "max_discount", - "oldfieldtype": "Currency", - "read_only": 0 - }, - { - "depends_on": "eval:doc.is_sales_item==\"Yes\"", - "doctype": "DocField", - "fieldname": "income_account", - "fieldtype": "Link", - "ignore_restrictions": 1, - "label": "Default Income Account", - "options": "Account", - "read_only": 0 - }, - { - "depends_on": "eval:doc.is_sales_item==\"Yes\"", - "doctype": "DocField", - "fieldname": "selling_cost_center", - "fieldtype": "Link", - "ignore_restrictions": 1, - "label": "Default Selling Cost Center", - "options": "Cost Center", - "read_only": 0 - }, - { - "depends_on": "eval:doc.is_sales_item==\"Yes\"", - "doctype": "DocField", - "fieldname": "column_break3", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "depends_on": "eval:doc.is_sales_item==\"Yes\"", - "description": "For the convenience of customers, these codes can be used in print formats like Invoices and Delivery Notes", - "doctype": "DocField", - "fieldname": "item_customer_details", - "fieldtype": "Table", - "label": "Customer Codes", - "options": "Item Customer Detail", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "item_tax_section_break", - "fieldtype": "Section Break", - "label": "Item Tax", - "oldfieldtype": "Section Break", - "options": "icon-money", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "item_tax", - "fieldtype": "Table", - "label": "Item Tax1", - "oldfieldname": "item_tax", - "oldfieldtype": "Table", - "options": "Item Tax", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "inspection_criteria", - "fieldtype": "Section Break", - "label": "Inspection Criteria", - "oldfieldtype": "Section Break", - "options": "icon-search", - "read_only": 0 - }, - { - "default": "No", - "doctype": "DocField", - "fieldname": "inspection_required", - "fieldtype": "Select", - "label": "Inspection Required", - "no_copy": 0, - "oldfieldname": "inspection_required", - "oldfieldtype": "Select", - "options": "\nYes\nNo", - "read_only": 0, - "reqd": 1 - }, - { - "depends_on": "eval:doc.inspection_required==\"Yes\"", - "description": "Quality Inspection Parameters", - "doctype": "DocField", - "fieldname": "item_specification_details", - "fieldtype": "Table", - "label": "Item Quality Inspection Parameter", - "oldfieldname": "item_specification_details", - "oldfieldtype": "Table", - "options": "Item Quality Inspection Parameter", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "manufacturing", - "fieldtype": "Section Break", - "label": "Manufacturing", - "oldfieldtype": "Section Break", - "options": "icon-cogs", - "read_only": 0 - }, - { - "default": "No", - "description": "Selecting \"Yes\" will allow you to create Bill of Material showing raw material and operational costs incurred to manufacture this item.", - "doctype": "DocField", - "fieldname": "is_manufactured_item", - "fieldtype": "Select", - "label": "Allow Bill of Materials", - "oldfieldname": "is_manufactured_item", - "oldfieldtype": "Select", - "options": "Yes\nNo", - "read_only": 0, - "reqd": 1 - }, - { - "depends_on": "eval:doc.is_manufactured_item==\"Yes\"", - "doctype": "DocField", - "fieldname": "default_bom", - "fieldtype": "Link", - "ignore_restrictions": 1, - "label": "Default BOM", - "no_copy": 1, - "oldfieldname": "default_bom", - "oldfieldtype": "Link", - "options": "BOM", - "read_only": 1 - }, - { - "default": "No", - "depends_on": "eval:doc.is_manufactured_item==\"Yes\"", - "description": "Selecting \"Yes\" will allow you to make a Production Order for this item.", - "doctype": "DocField", - "fieldname": "is_pro_applicable", - "fieldtype": "Select", - "label": "Allow Production Order", - "oldfieldname": "is_pro_applicable", - "oldfieldtype": "Select", - "options": "Yes\nNo", - "read_only": 0, - "reqd": 1 - }, - { - "default": "No", - "description": "Select \"Yes\" if you supply raw materials to your supplier to manufacture this item.", - "doctype": "DocField", - "fieldname": "is_sub_contracted_item", - "fieldtype": "Select", - "label": "Is Sub Contracted Item", - "oldfieldname": "is_sub_contracted_item", - "oldfieldtype": "Select", - "options": "Yes\nNo", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "customer_code", - "fieldtype": "Data", - "hidden": 1, - "in_filter": 1, - "label": "Customer Code", - "no_copy": 1, - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "website_section", - "fieldtype": "Section Break", - "label": "Website", - "options": "icon-globe", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "show_in_website", - "fieldtype": "Check", - "label": "Show in Website", - "read_only": 0 - }, - { - "depends_on": "show_in_website", - "description": "website page link", - "doctype": "DocField", - "fieldname": "page_name", - "fieldtype": "Data", - "label": "Page Name", - "read_only": 1 - }, - { - "depends_on": "show_in_website", - "description": "Products will be sorted by weight-age in default searches. More the weight-age, higher the product will appear in the list.", - "doctype": "DocField", - "fieldname": "weightage", - "fieldtype": "Int", - "label": "Weightage", - "read_only": 0, - "search_index": 1 - }, - { - "depends_on": "show_in_website", - "description": "Show a slideshow at the top of the page", - "doctype": "DocField", - "fieldname": "slideshow", - "fieldtype": "Link", - "label": "Slideshow", - "options": "Website Slideshow", - "read_only": 0 - }, - { - "depends_on": "show_in_website", - "description": "Item Image (if not slideshow)", - "doctype": "DocField", - "fieldname": "website_image", - "fieldtype": "Select", - "label": "Image", - "options": "attach_files:", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "cb72", - "fieldtype": "Column Break", - "read_only": 0 - }, - { - "depends_on": "show_in_website", - "description": "Show \"In Stock\" or \"Not in Stock\" based on stock available in this warehouse.", - "doctype": "DocField", - "fieldname": "website_warehouse", - "fieldtype": "Link", - "ignore_restrictions": 1, - "label": "Website Warehouse", - "options": "Warehouse", - "read_only": 0 - }, - { - "depends_on": "show_in_website", - "description": "List this Item in multiple groups on the website.", - "doctype": "DocField", - "fieldname": "website_item_groups", - "fieldtype": "Table", - "label": "Website Item Groups", - "options": "Website Item Group", - "read_only": 0 - }, - { - "depends_on": "show_in_website", - "doctype": "DocField", - "fieldname": "sb72", - "fieldtype": "Section Break", - "read_only": 0 - }, - { - "depends_on": "show_in_website", - "doctype": "DocField", - "fieldname": "copy_from_item_group", - "fieldtype": "Button", - "label": "Copy From Item Group", - "read_only": 0 - }, - { - "depends_on": "show_in_website", - "doctype": "DocField", - "fieldname": "item_website_specifications", - "fieldtype": "Table", - "label": "Item Website Specifications", - "options": "Item Website Specification", - "read_only": 0 - }, - { - "depends_on": "show_in_website", - "doctype": "DocField", - "fieldname": "web_long_description", - "fieldtype": "Text Editor", - "label": "Website Description", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "parent_website_route", - "fieldtype": "Link", - "ignore_restrictions": 1, - "label": "Parent Website Route", - "options": "Website Route" - }, - { - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "import": 1, - "role": "Material Master Manager", - "write": 1 - }, - { - "amend": 0, - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Material Manager", - "write": 0 - }, - { - "amend": 0, - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Material User", - "write": 0 - } -] \ No newline at end of file +{ + "allow_attach": 1, + "allow_import": 1, + "allow_rename": 1, + "autoname": "field:item_code", + "creation": "2013-05-03 10:45:46", + "default_print_format": "Standard", + "description": "A Product or a Service that is bought, sold or kept in stock.", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "name_and_description_section", + "fieldtype": "Section Break", + "label": "Name and Description", + "no_copy": 0, + "oldfieldtype": "Section Break", + "options": "icon-flag", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "naming_series", + "fieldtype": "Select", + "label": "Series", + "options": "\nITEM", + "permlevel": 0, + "read_only": 0 + }, + { + "description": "Item will be saved by this name in the data base.", + "fieldname": "item_code", + "fieldtype": "Data", + "in_filter": 0, + "label": "Item Code", + "no_copy": 1, + "oldfieldname": "item_code", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 0, + "reqd": 0, + "search_index": 0 + }, + { + "fieldname": "item_name", + "fieldtype": "Data", + "in_filter": 1, + "in_list_view": 1, + "label": "Item Name", + "oldfieldname": "item_name", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 0, + "reqd": 1, + "search_index": 1 + }, + { + "description": "Add / Edit", + "fieldname": "item_group", + "fieldtype": "Link", + "in_filter": 1, + "label": "Item Group", + "oldfieldname": "item_group", + "oldfieldtype": "Link", + "options": "Item Group", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "description": "Unit of measurement of this item (e.g. Kg, Unit, No, Pair).", + "fieldname": "stock_uom", + "fieldtype": "Link", + "ignore_restrictions": 1, + "label": "Default Unit of Measure", + "oldfieldname": "stock_uom", + "oldfieldtype": "Link", + "options": "UOM", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "brand", + "fieldtype": "Link", + "hidden": 0, + "label": "Brand", + "oldfieldname": "brand", + "oldfieldtype": "Link", + "options": "Brand", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 0 + }, + { + "fieldname": "barcode", + "fieldtype": "Data", + "label": "Barcode", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "image", + "fieldtype": "Select", + "label": "Image", + "options": "attach_files:", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "image_view", + "fieldtype": "Image", + "in_list_view": 1, + "label": "Image View", + "options": "image", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "description", + "fieldtype": "Small Text", + "in_filter": 0, + "in_list_view": 1, + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Text", + "permlevel": 0, + "read_only": 0, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "description_html", + "fieldtype": "Small Text", + "label": "Description HTML", + "permlevel": 0, + "read_only": 0 + }, + { + "description": "Generates HTML to include selected image in the description", + "fieldname": "add_image", + "fieldtype": "Button", + "label": "Generate Description HTML", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "inventory", + "fieldtype": "Section Break", + "label": "Inventory", + "oldfieldtype": "Section Break", + "options": "icon-truck", + "permlevel": 0, + "read_only": 0 + }, + { + "default": "Yes", + "description": "Select \"Yes\" if you are maintaining stock of this item in your Inventory.", + "fieldname": "is_stock_item", + "fieldtype": "Select", + "label": "Is Stock Item", + "oldfieldname": "is_stock_item", + "oldfieldtype": "Select", + "options": "Yes\nNo", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "depends_on": "eval:doc.is_stock_item==\"Yes\"", + "description": "Mandatory if Stock Item is \"Yes\". Also the default warehouse where reserved quantity is set from Sales Order.", + "fieldname": "default_warehouse", + "fieldtype": "Link", + "ignore_restrictions": 1, + "label": "Default Warehouse", + "oldfieldname": "default_warehouse", + "oldfieldtype": "Link", + "options": "Warehouse", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "eval:doc.is_stock_item==\"Yes\"", + "description": "Percentage variation in quantity to be allowed while receiving or delivering this item.", + "fieldname": "tolerance", + "fieldtype": "Float", + "label": "Allowance Percent", + "oldfieldname": "tolerance", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "eval:doc.is_stock_item==\"Yes\"", + "fieldname": "valuation_method", + "fieldtype": "Select", + "label": "Valuation Method", + "options": "\nFIFO\nMoving Average", + "permlevel": 0, + "read_only": 0 + }, + { + "default": "0.00", + "depends_on": "eval:doc.is_stock_item==\"Yes\"", + "description": "You can enter the minimum quantity of this item to be ordered.", + "fieldname": "min_order_qty", + "fieldtype": "Float", + "hidden": 0, + "label": "Minimum Order Qty", + "oldfieldname": "min_order_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "eval:doc.is_stock_item==\"Yes\"", + "fieldname": "column_break1", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "default": "No", + "depends_on": "eval:doc.is_stock_item==\"Yes\"", + "description": "Select \"Yes\" if this item is used for some internal purpose in your company.", + "fieldname": "is_asset_item", + "fieldtype": "Select", + "label": "Is Fixed Asset Item", + "oldfieldname": "is_asset_item", + "oldfieldtype": "Select", + "options": "Yes\nNo", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "default": "No", + "depends_on": "eval:doc.is_stock_item==\"Yes\"", + "fieldname": "has_batch_no", + "fieldtype": "Select", + "label": "Has Batch No", + "oldfieldname": "has_batch_no", + "oldfieldtype": "Select", + "options": "Yes\nNo", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "default": "No", + "depends_on": "eval:doc.is_stock_item==\"Yes\"", + "description": "Selecting \"Yes\" will give a unique identity to each entity of this item which can be viewed in the Serial No master.", + "fieldname": "has_serial_no", + "fieldtype": "Select", + "in_filter": 1, + "label": "Has Serial No", + "oldfieldname": "has_serial_no", + "oldfieldtype": "Select", + "options": "Yes\nNo", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "depends_on": "eval: doc.has_serial_no===\"Yes\"", + "description": "Example: ABCD.#####\nIf series is set and Serial No is not mentioned in transactions, then automatic serial number will be created based on this series. If you always want to explicitly mention Serial Nos for this item. leave this blank.", + "fieldname": "serial_no_series", + "fieldtype": "Data", + "label": "Serial Number Series", + "permlevel": 0 + }, + { + "depends_on": "eval:doc.is_stock_item==\"Yes\"", + "fieldname": "warranty_period", + "fieldtype": "Data", + "label": "Warranty Period (in days)", + "oldfieldname": "warranty_period", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "eval:doc.is_stock_item==\"Yes\"", + "fieldname": "end_of_life", + "fieldtype": "Date", + "label": "End of Life", + "oldfieldname": "end_of_life", + "oldfieldtype": "Date", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "eval:doc.is_stock_item==\"Yes\"", + "description": "Net Weight of each Item", + "fieldname": "net_weight", + "fieldtype": "Float", + "label": "Net Weight", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "eval:doc.is_stock_item==\"Yes\"", + "fieldname": "weight_uom", + "fieldtype": "Link", + "ignore_restrictions": 1, + "label": "Weight UOM", + "options": "UOM", + "permlevel": 0, + "read_only": 0 + }, + { + "description": "Auto-raise Material Request if quantity goes below re-order level in a warehouse", + "fieldname": "reorder_section", + "fieldtype": "Section Break", + "label": "Re-order", + "options": "icon-rss", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "eval:doc.is_stock_item==\"Yes\"", + "fieldname": "re_order_level", + "fieldtype": "Float", + "label": "Re-Order Level", + "oldfieldname": "re_order_level", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "eval:doc.is_stock_item==\"Yes\"", + "fieldname": "re_order_qty", + "fieldtype": "Float", + "label": "Re-Order Qty", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "section_break_31", + "fieldtype": "Section Break", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "item_reorder", + "fieldtype": "Table", + "label": "Warehouse-wise Item Reorder", + "options": "Item Reorder", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "purchase_details", + "fieldtype": "Section Break", + "label": "Purchase Details", + "oldfieldtype": "Section Break", + "options": "icon-shopping-cart", + "permlevel": 0, + "read_only": 0 + }, + { + "default": "Yes", + "description": "Selecting \"Yes\" will allow this item to appear in Purchase Order , Purchase Receipt.", + "fieldname": "is_purchase_item", + "fieldtype": "Select", + "label": "Is Purchase Item", + "oldfieldname": "is_purchase_item", + "oldfieldtype": "Select", + "options": "Yes\nNo", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "default_supplier", + "fieldtype": "Link", + "ignore_restrictions": 1, + "label": "Default Supplier", + "options": "Supplier", + "permlevel": 0 + }, + { + "depends_on": "eval:doc.is_purchase_item==\"Yes\"", + "description": "Lead Time days is number of days by which this item is expected in your warehouse. This days is fetched in Material Request when you select this item.", + "fieldname": "lead_time_days", + "fieldtype": "Int", + "label": "Lead Time Days", + "no_copy": 1, + "oldfieldname": "lead_time_days", + "oldfieldtype": "Int", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "eval:doc.is_purchase_item==\"Yes\"", + "description": "Default Purchase Account in which cost of the item will be debited.", + "fieldname": "expense_account", + "fieldtype": "Link", + "ignore_restrictions": 1, + "label": "Default Expense Account", + "oldfieldname": "purchase_account", + "oldfieldtype": "Link", + "options": "Account", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "eval:doc.is_purchase_item==\"Yes\"", + "description": "Default Cost Center for tracking expense for this item.", + "fieldname": "buying_cost_center", + "fieldtype": "Link", + "ignore_restrictions": 1, + "label": "Default Buying Cost Center", + "oldfieldname": "cost_center", + "oldfieldtype": "Link", + "options": "Cost Center", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "eval:doc.is_purchase_item==\"Yes\"", + "fieldname": "last_purchase_rate", + "fieldtype": "Float", + "label": "Last Purchase Rate", + "no_copy": 1, + "oldfieldname": "last_purchase_rate", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 1 + }, + { + "depends_on": "eval:doc.is_purchase_item==\"Yes\"", + "fieldname": "standard_rate", + "fieldtype": "Float", + "label": "Standard Rate", + "oldfieldname": "standard_rate", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "eval:doc.is_purchase_item==\"Yes\"", + "fieldname": "column_break2", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "depends_on": "eval:doc.is_purchase_item==\"Yes\"", + "fieldname": "uom_conversion_details", + "fieldtype": "Table", + "label": "UOM Conversion Details", + "no_copy": 1, + "oldfieldname": "uom_conversion_details", + "oldfieldtype": "Table", + "options": "UOM Conversion Detail", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "eval:doc.is_purchase_item==\"Yes\"", + "fieldname": "manufacturer", + "fieldtype": "Data", + "label": "Manufacturer", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "eval:doc.is_purchase_item==\"Yes\"", + "fieldname": "manufacturer_part_no", + "fieldtype": "Data", + "label": "Manufacturer Part Number", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "eval:doc.is_purchase_item==\"Yes\"", + "fieldname": "item_supplier_details", + "fieldtype": "Table", + "label": "Item Supplier Details", + "options": "Item Supplier", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "sales_details", + "fieldtype": "Section Break", + "label": "Sales Details", + "oldfieldtype": "Section Break", + "options": "icon-tag", + "permlevel": 0, + "read_only": 0 + }, + { + "default": "Yes", + "description": "Selecting \"Yes\" will allow this item to figure in Sales Order, Delivery Note", + "fieldname": "is_sales_item", + "fieldtype": "Select", + "in_filter": 1, + "label": "Is Sales Item", + "oldfieldname": "is_sales_item", + "oldfieldtype": "Select", + "options": "Yes\nNo", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "default": "No", + "depends_on": "eval:doc.is_sales_item==\"Yes\"", + "description": "Select \"Yes\" if this item represents some work like training, designing, consulting etc.", + "fieldname": "is_service_item", + "fieldtype": "Select", + "in_filter": 1, + "label": "Is Service Item", + "oldfieldname": "is_service_item", + "oldfieldtype": "Select", + "options": "Yes\nNo", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "depends_on": "eval:doc.is_sales_item==\"Yes\"", + "fieldname": "max_discount", + "fieldtype": "Float", + "label": "Max Discount (%)", + "oldfieldname": "max_discount", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "eval:doc.is_sales_item==\"Yes\"", + "fieldname": "income_account", + "fieldtype": "Link", + "ignore_restrictions": 1, + "label": "Default Income Account", + "options": "Account", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "eval:doc.is_sales_item==\"Yes\"", + "fieldname": "selling_cost_center", + "fieldtype": "Link", + "ignore_restrictions": 1, + "label": "Default Selling Cost Center", + "options": "Cost Center", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "eval:doc.is_sales_item==\"Yes\"", + "fieldname": "column_break3", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "depends_on": "eval:doc.is_sales_item==\"Yes\"", + "description": "For the convenience of customers, these codes can be used in print formats like Invoices and Delivery Notes", + "fieldname": "item_customer_details", + "fieldtype": "Table", + "label": "Customer Codes", + "options": "Item Customer Detail", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "item_tax_section_break", + "fieldtype": "Section Break", + "label": "Item Tax", + "oldfieldtype": "Section Break", + "options": "icon-money", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "item_tax", + "fieldtype": "Table", + "label": "Item Tax1", + "oldfieldname": "item_tax", + "oldfieldtype": "Table", + "options": "Item Tax", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "inspection_criteria", + "fieldtype": "Section Break", + "label": "Inspection Criteria", + "oldfieldtype": "Section Break", + "options": "icon-search", + "permlevel": 0, + "read_only": 0 + }, + { + "default": "No", + "fieldname": "inspection_required", + "fieldtype": "Select", + "label": "Inspection Required", + "no_copy": 0, + "oldfieldname": "inspection_required", + "oldfieldtype": "Select", + "options": "\nYes\nNo", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "depends_on": "eval:doc.inspection_required==\"Yes\"", + "description": "Quality Inspection Parameters", + "fieldname": "item_specification_details", + "fieldtype": "Table", + "label": "Item Quality Inspection Parameter", + "oldfieldname": "item_specification_details", + "oldfieldtype": "Table", + "options": "Item Quality Inspection Parameter", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "manufacturing", + "fieldtype": "Section Break", + "label": "Manufacturing", + "oldfieldtype": "Section Break", + "options": "icon-cogs", + "permlevel": 0, + "read_only": 0 + }, + { + "default": "No", + "description": "Selecting \"Yes\" will allow you to create Bill of Material showing raw material and operational costs incurred to manufacture this item.", + "fieldname": "is_manufactured_item", + "fieldtype": "Select", + "label": "Allow Bill of Materials", + "oldfieldname": "is_manufactured_item", + "oldfieldtype": "Select", + "options": "Yes\nNo", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "depends_on": "eval:doc.is_manufactured_item==\"Yes\"", + "fieldname": "default_bom", + "fieldtype": "Link", + "ignore_restrictions": 1, + "label": "Default BOM", + "no_copy": 1, + "oldfieldname": "default_bom", + "oldfieldtype": "Link", + "options": "BOM", + "permlevel": 0, + "read_only": 1 + }, + { + "default": "No", + "depends_on": "eval:doc.is_manufactured_item==\"Yes\"", + "description": "Selecting \"Yes\" will allow you to make a Production Order for this item.", + "fieldname": "is_pro_applicable", + "fieldtype": "Select", + "label": "Allow Production Order", + "oldfieldname": "is_pro_applicable", + "oldfieldtype": "Select", + "options": "Yes\nNo", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "default": "No", + "description": "Select \"Yes\" if you supply raw materials to your supplier to manufacture this item.", + "fieldname": "is_sub_contracted_item", + "fieldtype": "Select", + "label": "Is Sub Contracted Item", + "oldfieldname": "is_sub_contracted_item", + "oldfieldtype": "Select", + "options": "Yes\nNo", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "customer_code", + "fieldtype": "Data", + "hidden": 1, + "in_filter": 1, + "label": "Customer Code", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "website_section", + "fieldtype": "Section Break", + "label": "Website", + "options": "icon-globe", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "show_in_website", + "fieldtype": "Check", + "label": "Show in Website", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "show_in_website", + "description": "website page link", + "fieldname": "page_name", + "fieldtype": "Data", + "label": "Page Name", + "permlevel": 0, + "read_only": 1 + }, + { + "depends_on": "show_in_website", + "description": "Products will be sorted by weight-age in default searches. More the weight-age, higher the product will appear in the list.", + "fieldname": "weightage", + "fieldtype": "Int", + "label": "Weightage", + "permlevel": 0, + "read_only": 0, + "search_index": 1 + }, + { + "depends_on": "show_in_website", + "description": "Show a slideshow at the top of the page", + "fieldname": "slideshow", + "fieldtype": "Link", + "label": "Slideshow", + "options": "Website Slideshow", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "show_in_website", + "description": "Item Image (if not slideshow)", + "fieldname": "website_image", + "fieldtype": "Select", + "label": "Image", + "options": "attach_files:", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "cb72", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "show_in_website", + "description": "Show \"In Stock\" or \"Not in Stock\" based on stock available in this warehouse.", + "fieldname": "website_warehouse", + "fieldtype": "Link", + "ignore_restrictions": 1, + "label": "Website Warehouse", + "options": "Warehouse", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "show_in_website", + "description": "List this Item in multiple groups on the website.", + "fieldname": "website_item_groups", + "fieldtype": "Table", + "label": "Website Item Groups", + "options": "Website Item Group", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "show_in_website", + "fieldname": "sb72", + "fieldtype": "Section Break", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "show_in_website", + "fieldname": "copy_from_item_group", + "fieldtype": "Button", + "label": "Copy From Item Group", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "show_in_website", + "fieldname": "item_website_specifications", + "fieldtype": "Table", + "label": "Item Website Specifications", + "options": "Item Website Specification", + "permlevel": 0, + "read_only": 0 + }, + { + "depends_on": "show_in_website", + "fieldname": "web_long_description", + "fieldtype": "Text Editor", + "label": "Website Description", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "parent_website_route", + "fieldtype": "Link", + "ignore_restrictions": 1, + "label": "Parent Website Route", + "options": "Website Route", + "permlevel": 0 + } + ], + "icon": "icon-tag", + "idx": 1, + "max_attachments": 1, + "modified": "2014-03-13 15:54:09", + "modified_by": "Administrator", + "module": "Stock", + "name": "Item", + "owner": "Administrator", + "permissions": [ + { + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "import": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material Master Manager", + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material Manager", + "submit": 0, + "write": 0 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material User", + "submit": 0, + "write": 0 + } + ], + "search_fields": "item_name,description,item_group,customer_code" +} \ No newline at end of file diff --git a/erpnext/stock/doctype/item_customer_detail/item_customer_detail.txt b/erpnext/stock/doctype/item_customer_detail/item_customer_detail.txt index 9d9b6ca078..b3a575371c 100644 --- a/erpnext/stock/doctype/item_customer_detail/item_customer_detail.txt +++ b/erpnext/stock/doctype/item_customer_detail/item_customer_detail.txt @@ -1,56 +1,47 @@ -[ - { - "creation": "2013-03-08 15:37:16", - "docstatus": 0, - "modified": "2013-12-20 19:23:16", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "ITEMCUST/.#####", - "description": "For the convenience of customers, these codes can be used in print formats like Invoices and Delivery Notes", - "doctype": "DocType", - "in_create": 0, - "istable": 1, - "module": "Stock", - "name": "__common__", - "read_only": 0 - }, - { - "doctype": "DocField", - "in_filter": 1, - "in_list_view": 1, - "name": "__common__", - "parent": "Item Customer Detail", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0, - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocType", - "name": "Item Customer Detail" - }, - { - "doctype": "DocField", - "fieldname": "customer_name", - "fieldtype": "Link", - "label": "Customer Name", - "oldfieldname": "price_list_name", - "oldfieldtype": "Select", - "options": "Customer", - "print_width": "180px", - "width": "180px" - }, - { - "doctype": "DocField", - "fieldname": "ref_code", - "fieldtype": "Data", - "label": "Ref Code", - "oldfieldname": "ref_rate", - "oldfieldtype": "Currency", - "print_width": "120px", - "width": "120px" - } -] \ No newline at end of file +{ + "autoname": "ITEMCUST/.#####", + "creation": "2013-03-08 15:37:16", + "description": "For the convenience of customers, these codes can be used in print formats like Invoices and Delivery Notes", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "customer_name", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Customer Name", + "oldfieldname": "price_list_name", + "oldfieldtype": "Select", + "options": "Customer", + "permlevel": 0, + "print_width": "180px", + "reqd": 1, + "search_index": 1, + "width": "180px" + }, + { + "fieldname": "ref_code", + "fieldtype": "Data", + "in_filter": 1, + "in_list_view": 1, + "label": "Ref Code", + "oldfieldname": "ref_rate", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_width": "120px", + "reqd": 1, + "search_index": 1, + "width": "120px" + } + ], + "idx": 1, + "in_create": 0, + "istable": 1, + "modified": "2013-12-20 19:23:16", + "modified_by": "Administrator", + "module": "Stock", + "name": "Item Customer Detail", + "owner": "Administrator", + "read_only": 0 +} \ No newline at end of file diff --git a/erpnext/stock/doctype/item_price/item_price.txt b/erpnext/stock/doctype/item_price/item_price.txt index 8b188762e1..8ff8b2e571 100644 --- a/erpnext/stock/doctype/item_price/item_price.txt +++ b/erpnext/stock/doctype/item_price/item_price.txt @@ -1,151 +1,140 @@ -[ - { - "creation": "2013-05-02 16:29:48", - "docstatus": 0, - "modified": "2014-02-10 17:27:32", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "autoname": "RFD/.#####", - "description": "Multiple Item prices.", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-flag", - "in_create": 0, - "istable": 0, - "module": "Stock", - "name": "__common__", - "read_only": 0 - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Item Price", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "cancel": 0, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Item Price", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Item Price" - }, - { - "doctype": "DocField", - "fieldname": "price_list_details", - "fieldtype": "Section Break", - "label": "Price List", - "options": "icon-tags" - }, - { - "doctype": "DocField", - "fieldname": "price_list", - "fieldtype": "Link", - "in_filter": 1, - "label": "Price List", - "options": "Price List", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "buying", - "fieldtype": "Check", - "in_list_view": 1, - "label": "Buying", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "selling", - "fieldtype": "Check", - "in_list_view": 1, - "label": "Selling", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "item_details", - "fieldtype": "Section Break", - "label": "Item", - "options": "icon-tag" - }, - { - "doctype": "DocField", - "fieldname": "item_code", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "Item Code", - "oldfieldname": "price_list_name", - "oldfieldtype": "Select", - "options": "Item", - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "price_list_rate", - "fieldtype": "Currency", - "in_filter": 1, - "in_list_view": 1, - "label": "Rate", - "oldfieldname": "ref_rate", - "oldfieldtype": "Currency", - "options": "currency", - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "col_br_1", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "item_name", - "fieldtype": "Data", - "label": "Item Name", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "item_description", - "fieldtype": "Text", - "label": "Item Description", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "currency", - "fieldtype": "Link", - "hidden": 1, - "label": "Currency", - "options": "Currency", - "read_only": 1 - }, - { - "doctype": "DocPerm", - "role": "Sales Master Manager" - }, - { - "doctype": "DocPerm", - "role": "Purchase Master Manager" - } -] \ No newline at end of file +{ + "allow_import": 1, + "autoname": "RFD/.#####", + "creation": "2013-05-02 16:29:48", + "description": "Multiple Item prices.", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "price_list_details", + "fieldtype": "Section Break", + "label": "Price List", + "options": "icon-tags", + "permlevel": 0 + }, + { + "fieldname": "price_list", + "fieldtype": "Link", + "in_filter": 1, + "label": "Price List", + "options": "Price List", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "buying", + "fieldtype": "Check", + "in_list_view": 1, + "label": "Buying", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "selling", + "fieldtype": "Check", + "in_list_view": 1, + "label": "Selling", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "item_details", + "fieldtype": "Section Break", + "label": "Item", + "options": "icon-tag", + "permlevel": 0 + }, + { + "fieldname": "item_code", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Item Code", + "oldfieldname": "price_list_name", + "oldfieldtype": "Select", + "options": "Item", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "price_list_rate", + "fieldtype": "Currency", + "in_filter": 1, + "in_list_view": 1, + "label": "Rate", + "oldfieldname": "ref_rate", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "col_br_1", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "item_name", + "fieldtype": "Data", + "label": "Item Name", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "item_description", + "fieldtype": "Text", + "label": "Item Description", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "currency", + "fieldtype": "Link", + "hidden": 1, + "label": "Currency", + "options": "Currency", + "permlevel": 0, + "read_only": 1 + } + ], + "icon": "icon-flag", + "idx": 1, + "in_create": 0, + "istable": 0, + "modified": "2014-02-10 17:27:32", + "modified_by": "Administrator", + "module": "Stock", + "name": "Item Price", + "owner": "Administrator", + "permissions": [ + { + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales Master Manager", + "write": 1 + }, + { + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase Master Manager", + "write": 1 + } + ], + "read_only": 0 +} \ No newline at end of file diff --git a/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.txt b/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.txt index 8ec87d7cc1..9f48329222 100644 --- a/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.txt +++ b/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.txt @@ -1,48 +1,38 @@ -[ - { - "creation": "2013-02-22 01:28:01", - "docstatus": 0, - "modified": "2013-12-20 19:23:16", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "IISD/.#####", - "doctype": "DocType", - "istable": 1, - "module": "Stock", - "name": "__common__" - }, - { - "doctype": "DocField", - "fieldtype": "Data", - "in_list_view": 1, - "name": "__common__", - "oldfieldtype": "Data", - "parent": "Item Quality Inspection Parameter", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Item Quality Inspection Parameter" - }, - { - "doctype": "DocField", - "fieldname": "specification", - "in_filter": 0, - "label": "Parameter", - "oldfieldname": "specification", - "print_width": "200px", - "reqd": 1, - "search_index": 0, - "width": "200px" - }, - { - "doctype": "DocField", - "fieldname": "value", - "label": "Acceptance Criteria", - "oldfieldname": "value" - } -] \ No newline at end of file +{ + "autoname": "IISD/.#####", + "creation": "2013-02-22 01:28:01", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "specification", + "fieldtype": "Data", + "in_filter": 0, + "in_list_view": 1, + "label": "Parameter", + "oldfieldname": "specification", + "oldfieldtype": "Data", + "permlevel": 0, + "print_width": "200px", + "reqd": 1, + "search_index": 0, + "width": "200px" + }, + { + "fieldname": "value", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Acceptance Criteria", + "oldfieldname": "value", + "oldfieldtype": "Data", + "permlevel": 0 + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:23:16", + "modified_by": "Administrator", + "module": "Stock", + "name": "Item Quality Inspection Parameter", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/stock/doctype/item_reorder/item_reorder.txt b/erpnext/stock/doctype/item_reorder/item_reorder.txt index 74df09a0ae..d029e49d1e 100644 --- a/erpnext/stock/doctype/item_reorder/item_reorder.txt +++ b/erpnext/stock/doctype/item_reorder/item_reorder.txt @@ -1,60 +1,53 @@ -[ - { - "creation": "2013-03-07 11:42:59", - "docstatus": 0, - "modified": "2013-12-20 19:23:16", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "REORD-.#####", - "doctype": "DocType", - "in_create": 1, - "istable": 1, - "module": "Stock", - "name": "__common__" - }, - { - "doctype": "DocField", - "in_list_view": 1, - "name": "__common__", - "parent": "Item Reorder", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0, - "read_only": 0 - }, - { - "doctype": "DocType", - "name": "Item Reorder" - }, - { - "doctype": "DocField", - "fieldname": "warehouse", - "fieldtype": "Link", - "label": "Warehouse", - "options": "Warehouse", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "warehouse_reorder_level", - "fieldtype": "Float", - "label": "Re-order Level", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "warehouse_reorder_qty", - "fieldtype": "Float", - "label": "Re-order Qty" - }, - { - "doctype": "DocField", - "fieldname": "material_request_type", - "fieldtype": "Select", - "label": "Material Request Type", - "options": "Purchase\nTransfer", - "reqd": 1 - } -] \ No newline at end of file +{ + "autoname": "REORD-.#####", + "creation": "2013-03-07 11:42:59", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "warehouse", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Warehouse", + "options": "Warehouse", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "warehouse_reorder_level", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Re-order Level", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "warehouse_reorder_qty", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Re-order Qty", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "material_request_type", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Material Request Type", + "options": "Purchase\nTransfer", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + } + ], + "idx": 1, + "in_create": 1, + "istable": 1, + "modified": "2013-12-20 19:23:16", + "modified_by": "Administrator", + "module": "Stock", + "name": "Item Reorder", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/stock/doctype/item_supplier/item_supplier.txt b/erpnext/stock/doctype/item_supplier/item_supplier.txt index 02e0bd7cac..64d32d6888 100644 --- a/erpnext/stock/doctype/item_supplier/item_supplier.txt +++ b/erpnext/stock/doctype/item_supplier/item_supplier.txt @@ -1,43 +1,31 @@ -[ - { - "creation": "2013-02-22 01:28:01", - "docstatus": 0, - "modified": "2013-12-20 19:23:16", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "istable": 1, - "module": "Stock", - "name": "__common__" - }, - { - "doctype": "DocField", - "in_list_view": 1, - "name": "__common__", - "parent": "Item Supplier", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Item Supplier" - }, - { - "doctype": "DocField", - "fieldname": "supplier", - "fieldtype": "Link", - "label": "Supplier", - "options": "Supplier" - }, - { - "doctype": "DocField", - "fieldname": "supplier_part_no", - "fieldtype": "Data", - "label": "Supplier Part Number", - "print_width": "200px", - "width": "200px" - } -] \ No newline at end of file +{ + "creation": "2013-02-22 01:28:01", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "supplier", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Supplier", + "options": "Supplier", + "permlevel": 0 + }, + { + "fieldname": "supplier_part_no", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Supplier Part Number", + "permlevel": 0, + "print_width": "200px", + "width": "200px" + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:23:16", + "modified_by": "Administrator", + "module": "Stock", + "name": "Item Supplier", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/stock/doctype/item_tax/item_tax.txt b/erpnext/stock/doctype/item_tax/item_tax.txt index 243ee1f31b..c2df3219f8 100644 --- a/erpnext/stock/doctype/item_tax/item_tax.txt +++ b/erpnext/stock/doctype/item_tax/item_tax.txt @@ -1,47 +1,35 @@ -[ - { - "creation": "2013-02-22 01:28:01", - "docstatus": 0, - "modified": "2013-12-20 19:23:16", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "istable": 1, - "module": "Stock", - "name": "__common__" - }, - { - "doctype": "DocField", - "in_list_view": 1, - "name": "__common__", - "parent": "Item Tax", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Item Tax" - }, - { - "doctype": "DocField", - "fieldname": "tax_type", - "fieldtype": "Link", - "label": "Tax", - "oldfieldname": "tax_type", - "oldfieldtype": "Link", - "options": "Account", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "tax_rate", - "fieldtype": "Float", - "label": "Tax Rate", - "oldfieldname": "tax_rate", - "oldfieldtype": "Currency", - "reqd": 0 - } -] \ No newline at end of file +{ + "creation": "2013-02-22 01:28:01", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "tax_type", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Tax", + "oldfieldname": "tax_type", + "oldfieldtype": "Link", + "options": "Account", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "tax_rate", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Tax Rate", + "oldfieldname": "tax_rate", + "oldfieldtype": "Currency", + "permlevel": 0, + "reqd": 0 + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:23:16", + "modified_by": "Administrator", + "module": "Stock", + "name": "Item Tax", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/stock/doctype/item_website_specification/item_website_specification.txt b/erpnext/stock/doctype/item_website_specification/item_website_specification.txt index 164da81ca7..87e5dd7e47 100644 --- a/erpnext/stock/doctype/item_website_specification/item_website_specification.txt +++ b/erpnext/stock/doctype/item_website_specification/item_website_specification.txt @@ -1,45 +1,33 @@ -[ - { - "creation": "2013-02-22 01:28:01", - "docstatus": 0, - "modified": "2013-12-20 19:23:16", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "description": "Table for Item that will be shown in Web Site", - "doctype": "DocType", - "istable": 1, - "module": "Stock", - "name": "__common__" - }, - { - "doctype": "DocField", - "in_list_view": 1, - "name": "__common__", - "parent": "Item Website Specification", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Item Website Specification" - }, - { - "doctype": "DocField", - "fieldname": "label", - "fieldtype": "Data", - "label": "Label", - "print_width": "150px", - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Text", - "label": "Description", - "print_width": "300px", - "width": "300px" - } -] \ No newline at end of file +{ + "creation": "2013-02-22 01:28:01", + "description": "Table for Item that will be shown in Web Site", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "label", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Label", + "permlevel": 0, + "print_width": "150px", + "width": "150px" + }, + { + "fieldname": "description", + "fieldtype": "Text", + "in_list_view": 1, + "label": "Description", + "permlevel": 0, + "print_width": "300px", + "width": "300px" + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:23:16", + "modified_by": "Administrator", + "module": "Stock", + "name": "Item Website Specification", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/stock/doctype/landed_cost_item/landed_cost_item.txt b/erpnext/stock/doctype/landed_cost_item/landed_cost_item.txt index bf8af3a37b..0eab747d30 100644 --- a/erpnext/stock/doctype/landed_cost_item/landed_cost_item.txt +++ b/erpnext/stock/doctype/landed_cost_item/landed_cost_item.txt @@ -1,67 +1,57 @@ -[ - { - "creation": "2013-02-22 01:28:02", - "docstatus": 0, - "modified": "2013-12-20 19:23:18", - "modified_by": "Administrator", - "owner": "wasim@webnotestech.com" - }, - { - "doctype": "DocType", - "istable": 1, - "module": "Stock", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Landed Cost Item", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0, - "reqd": 1 - }, - { - "doctype": "DocType", - "name": "Landed Cost Item" - }, - { - "doctype": "DocField", - "fieldname": "account_head", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Account Head", - "oldfieldname": "account_head", - "oldfieldtype": "Link", - "options": "Account", - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "cost_center", - "fieldtype": "Link", - "label": "Cost Center", - "options": "Cost Center" - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Data", - "print_width": "300px", - "width": "300px" - }, - { - "doctype": "DocField", - "fieldname": "amount", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Amount", - "oldfieldname": "amount", - "oldfieldtype": "Currency", - "options": "currency" - } -] \ No newline at end of file +{ + "creation": "2013-02-22 01:28:02", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "account_head", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Account Head", + "oldfieldname": "account_head", + "oldfieldtype": "Link", + "options": "Account", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "cost_center", + "fieldtype": "Link", + "label": "Cost Center", + "options": "Cost Center", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "description", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Data", + "permlevel": 0, + "print_width": "300px", + "reqd": 1, + "width": "300px" + }, + { + "fieldname": "amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Amount", + "oldfieldname": "amount", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "reqd": 1 + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:23:18", + "modified_by": "Administrator", + "module": "Stock", + "name": "Landed Cost Item", + "owner": "wasim@webnotestech.com" +} \ No newline at end of file diff --git a/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.txt b/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.txt index 8d02e3a10c..904c20da89 100644 --- a/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.txt +++ b/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.txt @@ -1,39 +1,26 @@ -[ - { - "creation": "2013-02-22 01:28:02", - "docstatus": 0, - "modified": "2013-12-20 19:23:18", - "modified_by": "Administrator", - "owner": "wasim@webnotestech.com" - }, - { - "doctype": "DocType", - "istable": 1, - "module": "Stock", - "name": "__common__" - }, - { - "doctype": "DocField", - "fieldname": "purchase_receipt", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Purchase Receipt", - "name": "__common__", - "oldfieldname": "purchase_receipt_no", - "oldfieldtype": "Link", - "options": "Purchase Receipt", - "parent": "Landed Cost Purchase Receipt", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0, - "print_width": "220px", - "width": "220px" - }, - { - "doctype": "DocType", - "name": "Landed Cost Purchase Receipt" - }, - { - "doctype": "DocField" - } -] \ No newline at end of file +{ + "creation": "2013-02-22 01:28:02", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "purchase_receipt", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Purchase Receipt", + "oldfieldname": "purchase_receipt_no", + "oldfieldtype": "Link", + "options": "Purchase Receipt", + "permlevel": 0, + "print_width": "220px", + "width": "220px" + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:23:18", + "modified_by": "Administrator", + "module": "Stock", + "name": "Landed Cost Purchase Receipt", + "owner": "wasim@webnotestech.com" +} \ No newline at end of file diff --git a/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.txt b/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.txt index 587d0e313c..461c909065 100644 --- a/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.txt +++ b/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.txt @@ -1,95 +1,83 @@ -[ - { - "creation": "2013-01-22 16:50:39", - "docstatus": 0, - "modified": "2013-12-20 19:23:18", - "modified_by": "Administrator", - "owner": "wasim@webnotestech.com" - }, - { - "doctype": "DocType", - "icon": "icon-magic", - "issingle": 1, - "module": "Stock", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Landed Cost Wizard", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Landed Cost Wizard", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 0, - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Landed Cost Wizard" - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "label": "Company", - "options": "Company", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "section_break0", - "fieldtype": "Section Break", - "label": "Select Purchase Receipts", - "options": "Simple" - }, - { - "doctype": "DocField", - "fieldname": "lc_pr_details", - "fieldtype": "Table", - "label": "Landed Cost Purchase Receipts", - "options": "Landed Cost Purchase Receipt" - }, - { - "doctype": "DocField", - "fieldname": "section_break1", - "fieldtype": "Section Break", - "label": "Add Taxes and Charges" - }, - { - "doctype": "DocField", - "fieldname": "landed_cost_details", - "fieldtype": "Table", - "label": "Landed Cost Items", - "options": "Landed Cost Item" - }, - { - "doctype": "DocField", - "fieldname": "update_landed_cost", - "fieldtype": "Button", - "label": "Update Landed Cost", - "options": "update_landed_cost" - }, - { - "amend": 0, - "cancel": 0, - "doctype": "DocPerm", - "role": "Purchase Manager" - }, - { - "doctype": "DocPerm", - "role": "Purchase User" - } -] \ No newline at end of file +{ + "creation": "2013-01-22 16:50:39", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "company", + "fieldtype": "Link", + "label": "Company", + "options": "Company", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "section_break0", + "fieldtype": "Section Break", + "label": "Select Purchase Receipts", + "options": "Simple", + "permlevel": 0 + }, + { + "fieldname": "lc_pr_details", + "fieldtype": "Table", + "label": "Landed Cost Purchase Receipts", + "options": "Landed Cost Purchase Receipt", + "permlevel": 0 + }, + { + "fieldname": "section_break1", + "fieldtype": "Section Break", + "label": "Add Taxes and Charges", + "permlevel": 0 + }, + { + "fieldname": "landed_cost_details", + "fieldtype": "Table", + "label": "Landed Cost Items", + "options": "Landed Cost Item", + "permlevel": 0 + }, + { + "fieldname": "update_landed_cost", + "fieldtype": "Button", + "label": "Update Landed Cost", + "options": "update_landed_cost", + "permlevel": 0 + } + ], + "icon": "icon-magic", + "idx": 1, + "issingle": 1, + "modified": "2013-12-20 19:23:18", + "modified_by": "Administrator", + "module": "Stock", + "name": "Landed Cost Wizard", + "owner": "wasim@webnotestech.com", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 0, + "role": "Purchase Manager", + "submit": 0, + "write": 1 + }, + { + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 0, + "role": "Purchase User", + "submit": 0, + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/stock/doctype/material_request/material_request.txt b/erpnext/stock/doctype/material_request/material_request.txt index cb027918bd..efff22410b 100644 --- a/erpnext/stock/doctype/material_request/material_request.txt +++ b/erpnext/stock/doctype/material_request/material_request.txt @@ -1,286 +1,297 @@ -[ - { - "creation": "2013-03-07 14:48:38", - "docstatus": 0, - "modified": "2014-01-20 17:48:57", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_attach": 1, - "allow_import": 1, - "autoname": "naming_series:", - "doctype": "DocType", - "icon": "icon-ticket", - "is_submittable": 1, - "module": "Stock", - "name": "__common__", - "read_only_onload": 1, - "search_fields": "status,transaction_date" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Material Request", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Material Request", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 1, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Material Request" - }, - { - "doctype": "DocField", - "fieldname": "type_section", - "fieldtype": "Section Break", - "label": "Basic Info", - "options": "icon-pushpin" - }, - { - "doctype": "DocField", - "fieldname": "material_request_type", - "fieldtype": "Select", - "in_list_view": 1, - "label": "Type", - "options": "Purchase\nTransfer", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break_2", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "naming_series", - "fieldtype": "Select", - "label": "Series", - "no_copy": 1, - "oldfieldname": "naming_series", - "oldfieldtype": "Select", - "options": "MREQ-\nIDT", - "print_hide": 1, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "amended_from", - "fieldtype": "Data", - "ignore_restrictions": 1, - "label": "Amended From", - "no_copy": 1, - "oldfieldname": "amended_from", - "oldfieldtype": "Data", - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "width": "150px" - }, - { - "description": "Select the relevant company name if you have multiple companies", - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "in_filter": 1, - "label": "Company", - "oldfieldname": "company", - "oldfieldtype": "Link", - "options": "Company", - "print_hide": 1, - "print_width": "150px", - "reqd": 1, - "search_index": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "items", - "fieldtype": "Section Break", - "label": "Items", - "oldfieldtype": "Section Break", - "options": "icon-shopping-cart" - }, - { - "allow_on_submit": 0, - "doctype": "DocField", - "fieldname": "indent_details", - "fieldtype": "Table", - "label": "Material Request Items", - "no_copy": 0, - "oldfieldname": "indent_details", - "oldfieldtype": "Table", - "options": "Material Request Item" - }, - { - "doctype": "DocField", - "fieldname": "more_info", - "fieldtype": "Section Break", - "label": "More Info", - "oldfieldtype": "Section Break", - "options": "icon-file-text" - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "print_width": "50%", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "requested_by", - "fieldtype": "Data", - "label": "Requested For" - }, - { - "doctype": "DocField", - "fieldname": "transaction_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Transaction Date", - "no_copy": 1, - "oldfieldname": "transaction_date", - "oldfieldtype": "Date", - "print_width": "100px", - "reqd": 1, - "search_index": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "fiscal_year", - "fieldtype": "Select", - "in_filter": 1, - "label": "Fiscal Year", - "oldfieldname": "fiscal_year", - "oldfieldtype": "Select", - "options": "link:Fiscal Year", - "print_hide": 1, - "print_width": "150px", - "reqd": 1, - "search_index": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "column_break2", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "print_width": "50%", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "status", - "fieldtype": "Select", - "in_filter": 1, - "in_list_view": 1, - "label": "Status", - "no_copy": 1, - "oldfieldname": "status", - "oldfieldtype": "Select", - "options": "\nDraft\nSubmitted\nStopped\nCancelled", - "print_hide": 1, - "print_width": "100px", - "read_only": 1, - "reqd": 0, - "search_index": 1, - "width": "100px" - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "letter_head", - "fieldtype": "Select", - "label": "Letter Head", - "oldfieldname": "letter_head", - "oldfieldtype": "Select", - "options": "link:Letter Head", - "print_hide": 1 - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "select_print_heading", - "fieldtype": "Link", - "label": "Print Heading", - "options": "Print Heading", - "print_hide": 1 - }, - { - "description": "% of materials ordered against this Material Request", - "doctype": "DocField", - "fieldname": "per_ordered", - "fieldtype": "Percent", - "in_list_view": 1, - "label": "% Completed", - "no_copy": 1, - "oldfieldname": "per_ordered", - "oldfieldtype": "Currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "terms_section_break", - "fieldtype": "Section Break", - "label": "Terms and Conditions", - "oldfieldtype": "Section Break", - "options": "icon-legal" - }, - { - "doctype": "DocField", - "fieldname": "tc_name", - "fieldtype": "Link", - "label": "Terms", - "oldfieldname": "tc_name", - "oldfieldtype": "Link", - "options": "Terms and Conditions", - "print_hide": 1, - "report_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "terms", - "fieldtype": "Text Editor", - "label": "Terms and Conditions Content", - "oldfieldname": "terms", - "oldfieldtype": "Text Editor" - }, - { - "doctype": "DocPerm", - "role": "Purchase Manager" - }, - { - "doctype": "DocPerm", - "role": "Material Manager" - }, - { - "doctype": "DocPerm", - "role": "Material User" - }, - { - "doctype": "DocPerm", - "role": "Purchase User" - } -] \ No newline at end of file +{ + "allow_attach": 1, + "allow_import": 1, + "autoname": "naming_series:", + "creation": "2013-03-07 14:48:38", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "type_section", + "fieldtype": "Section Break", + "label": "Basic Info", + "options": "icon-pushpin", + "permlevel": 0 + }, + { + "fieldname": "material_request_type", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Type", + "options": "Purchase\nTransfer", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "column_break_2", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "naming_series", + "fieldtype": "Select", + "label": "Series", + "no_copy": 1, + "oldfieldname": "naming_series", + "oldfieldtype": "Select", + "options": "MREQ-\nIDT", + "permlevel": 0, + "print_hide": 1, + "reqd": 1 + }, + { + "fieldname": "amended_from", + "fieldtype": "Data", + "ignore_restrictions": 1, + "label": "Amended From", + "no_copy": 1, + "oldfieldname": "amended_from", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 1, + "width": "150px" + }, + { + "description": "Select the relevant company name if you have multiple companies", + "fieldname": "company", + "fieldtype": "Link", + "in_filter": 1, + "label": "Company", + "oldfieldname": "company", + "oldfieldtype": "Link", + "options": "Company", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "reqd": 1, + "search_index": 1, + "width": "150px" + }, + { + "fieldname": "items", + "fieldtype": "Section Break", + "label": "Items", + "oldfieldtype": "Section Break", + "options": "icon-shopping-cart", + "permlevel": 0 + }, + { + "allow_on_submit": 0, + "fieldname": "indent_details", + "fieldtype": "Table", + "label": "Material Request Items", + "no_copy": 0, + "oldfieldname": "indent_details", + "oldfieldtype": "Table", + "options": "Material Request Item", + "permlevel": 0 + }, + { + "fieldname": "more_info", + "fieldtype": "Section Break", + "label": "More Info", + "oldfieldtype": "Section Break", + "options": "icon-file-text", + "permlevel": 0 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_width": "50%", + "width": "50%" + }, + { + "fieldname": "requested_by", + "fieldtype": "Data", + "label": "Requested For", + "permlevel": 0 + }, + { + "fieldname": "transaction_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Transaction Date", + "no_copy": 1, + "oldfieldname": "transaction_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_width": "100px", + "reqd": 1, + "search_index": 1, + "width": "100px" + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Select", + "in_filter": 1, + "label": "Fiscal Year", + "oldfieldname": "fiscal_year", + "oldfieldtype": "Select", + "options": "link:Fiscal Year", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "reqd": 1, + "search_index": 1, + "width": "150px" + }, + { + "fieldname": "column_break2", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_width": "50%", + "width": "50%" + }, + { + "fieldname": "status", + "fieldtype": "Select", + "in_filter": 1, + "in_list_view": 1, + "label": "Status", + "no_copy": 1, + "oldfieldname": "status", + "oldfieldtype": "Select", + "options": "\nDraft\nSubmitted\nStopped\nCancelled", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 1, + "reqd": 0, + "search_index": 1, + "width": "100px" + }, + { + "allow_on_submit": 1, + "fieldname": "letter_head", + "fieldtype": "Select", + "label": "Letter Head", + "oldfieldname": "letter_head", + "oldfieldtype": "Select", + "options": "link:Letter Head", + "permlevel": 0, + "print_hide": 1 + }, + { + "allow_on_submit": 1, + "fieldname": "select_print_heading", + "fieldtype": "Link", + "label": "Print Heading", + "options": "Print Heading", + "permlevel": 0, + "print_hide": 1 + }, + { + "description": "% of materials ordered against this Material Request", + "fieldname": "per_ordered", + "fieldtype": "Percent", + "in_list_view": 1, + "label": "% Completed", + "no_copy": 1, + "oldfieldname": "per_ordered", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "terms_section_break", + "fieldtype": "Section Break", + "label": "Terms and Conditions", + "oldfieldtype": "Section Break", + "options": "icon-legal", + "permlevel": 0 + }, + { + "fieldname": "tc_name", + "fieldtype": "Link", + "label": "Terms", + "oldfieldname": "tc_name", + "oldfieldtype": "Link", + "options": "Terms and Conditions", + "permlevel": 0, + "print_hide": 1, + "report_hide": 1 + }, + { + "fieldname": "terms", + "fieldtype": "Text Editor", + "label": "Terms and Conditions Content", + "oldfieldname": "terms", + "oldfieldtype": "Text Editor", + "permlevel": 0 + } + ], + "icon": "icon-ticket", + "idx": 1, + "is_submittable": 1, + "modified": "2014-01-20 17:48:57", + "modified_by": "Administrator", + "module": "Stock", + "name": "Material Request", + "owner": "Administrator", + "permissions": [ + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase Manager", + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material Manager", + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material User", + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase User", + "submit": 1, + "write": 1 + } + ], + "read_only_onload": 1, + "search_fields": "status,transaction_date" +} \ No newline at end of file diff --git a/erpnext/stock/doctype/material_request_item/material_request_item.txt b/erpnext/stock/doctype/material_request_item/material_request_item.txt index 56a4976bca..bd916a8783 100644 --- a/erpnext/stock/doctype/material_request_item/material_request_item.txt +++ b/erpnext/stock/doctype/material_request_item/material_request_item.txt @@ -1,253 +1,240 @@ -[ - { - "creation": "2013-02-22 01:28:02", - "docstatus": 0, - "modified": "2014-02-03 11:35:26", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "MREQD-.#####", - "doctype": "DocType", - "istable": 1, - "module": "Stock", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Material Request Item", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Material Request Item" - }, - { - "doctype": "DocField", - "fieldname": "item_code", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "Item Code", - "oldfieldname": "item_code", - "oldfieldtype": "Link", - "options": "Item", - "print_width": "100px", - "reqd": 1, - "search_index": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "item_name", - "fieldtype": "Data", - "in_filter": 1, - "in_list_view": 0, - "label": "Item Name", - "oldfieldname": "item_name", - "oldfieldtype": "Data", - "print_width": "100px", - "reqd": 0, - "search_index": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "col_break1", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Text", - "in_list_view": 1, - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Text", - "print_width": "250px", - "reqd": 1, - "width": "250px" - }, - { - "doctype": "DocField", - "fieldname": "quantity_and_warehouse", - "fieldtype": "Section Break", - "in_list_view": 0, - "label": "Quantity and Warehouse" - }, - { - "doctype": "DocField", - "fieldname": "qty", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Quantity", - "no_copy": 0, - "oldfieldname": "qty", - "oldfieldtype": "Currency", - "print_width": "80px", - "reqd": 1, - "width": "80px" - }, - { - "doctype": "DocField", - "fieldname": "warehouse", - "fieldtype": "Link", - "in_list_view": 1, - "label": "For Warehouse", - "oldfieldname": "warehouse", - "oldfieldtype": "Link", - "options": "Warehouse", - "print_hide": 0, - "print_width": "100px", - "reqd": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "col_break2", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "uom", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Stock UOM", - "no_copy": 0, - "oldfieldname": "uom", - "oldfieldtype": "Link", - "options": "UOM", - "print_width": "70px", - "read_only": 1, - "reqd": 1, - "width": "70px" - }, - { - "allow_on_submit": 0, - "doctype": "DocField", - "fieldname": "schedule_date", - "fieldtype": "Date", - "in_list_view": 1, - "label": "Required Date", - "no_copy": 0, - "oldfieldname": "schedule_date", - "oldfieldtype": "Date", - "print_hide": 0, - "print_width": "100px", - "reqd": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "more_info", - "fieldtype": "Section Break", - "label": "More Info" - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "item_group", - "fieldtype": "Link", - "in_filter": 1, - "label": "Item Group", - "no_copy": 0, - "oldfieldname": "item_group", - "oldfieldtype": "Link", - "options": "Item Group", - "print_hide": 1, - "read_only": 1, - "reqd": 0, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "brand", - "fieldtype": "Link", - "label": "Brand", - "oldfieldname": "brand", - "oldfieldtype": "Link", - "options": "Brand", - "print_hide": 1, - "print_width": "100px", - "read_only": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "lead_time_date", - "fieldtype": "Date", - "in_list_view": 0, - "label": "Lead Time Date", - "no_copy": 1, - "oldfieldname": "lead_time_date", - "oldfieldtype": "Date", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "sales_order_no", - "fieldtype": "Link", - "label": "Sales Order No", - "no_copy": 0, - "options": "Sales Order", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "col_break3", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "min_order_qty", - "fieldtype": "Float", - "label": "Min Order Qty", - "no_copy": 1, - "oldfieldname": "min_order_qty", - "oldfieldtype": "Currency", - "print_hide": 1, - "print_width": "70px", - "read_only": 1, - "reqd": 0, - "width": "70px" - }, - { - "doctype": "DocField", - "fieldname": "projected_qty", - "fieldtype": "Float", - "label": "Projected Qty", - "no_copy": 1, - "oldfieldname": "projected_qty", - "oldfieldtype": "Currency", - "print_hide": 1, - "print_width": "70px", - "read_only": 1, - "width": "70px" - }, - { - "doctype": "DocField", - "fieldname": "ordered_qty", - "fieldtype": "Float", - "label": "Completed Qty", - "no_copy": 1, - "oldfieldname": "ordered_qty", - "oldfieldtype": "Currency", - "read_only": 1 - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "page_break", - "fieldtype": "Check", - "label": "Page Break", - "no_copy": 1, - "oldfieldname": "page_break", - "oldfieldtype": "Check", - "print_hide": 1 - } -] \ No newline at end of file +{ + "autoname": "MREQD-.#####", + "creation": "2013-02-22 01:28:02", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "item_code", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Item Code", + "oldfieldname": "item_code", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0, + "print_width": "100px", + "reqd": 1, + "search_index": 1, + "width": "100px" + }, + { + "fieldname": "item_name", + "fieldtype": "Data", + "in_filter": 1, + "in_list_view": 0, + "label": "Item Name", + "oldfieldname": "item_name", + "oldfieldtype": "Data", + "permlevel": 0, + "print_width": "100px", + "reqd": 0, + "search_index": 1, + "width": "100px" + }, + { + "fieldname": "col_break1", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "description", + "fieldtype": "Text", + "in_list_view": 1, + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Text", + "permlevel": 0, + "print_width": "250px", + "reqd": 1, + "width": "250px" + }, + { + "fieldname": "quantity_and_warehouse", + "fieldtype": "Section Break", + "in_list_view": 0, + "label": "Quantity and Warehouse", + "permlevel": 0 + }, + { + "fieldname": "qty", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Quantity", + "no_copy": 0, + "oldfieldname": "qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_width": "80px", + "reqd": 1, + "width": "80px" + }, + { + "fieldname": "warehouse", + "fieldtype": "Link", + "in_list_view": 1, + "label": "For Warehouse", + "oldfieldname": "warehouse", + "oldfieldtype": "Link", + "options": "Warehouse", + "permlevel": 0, + "print_hide": 0, + "print_width": "100px", + "reqd": 0, + "width": "100px" + }, + { + "fieldname": "col_break2", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "uom", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Stock UOM", + "no_copy": 0, + "oldfieldname": "uom", + "oldfieldtype": "Link", + "options": "UOM", + "permlevel": 0, + "print_width": "70px", + "read_only": 1, + "reqd": 1, + "width": "70px" + }, + { + "allow_on_submit": 0, + "fieldname": "schedule_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "Required Date", + "no_copy": 0, + "oldfieldname": "schedule_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 0, + "print_width": "100px", + "reqd": 1, + "width": "100px" + }, + { + "fieldname": "more_info", + "fieldtype": "Section Break", + "label": "More Info", + "permlevel": 0 + }, + { + "description": "Add / Edit", + "fieldname": "item_group", + "fieldtype": "Link", + "in_filter": 1, + "label": "Item Group", + "no_copy": 0, + "oldfieldname": "item_group", + "oldfieldtype": "Link", + "options": "Item Group", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 0, + "search_index": 1 + }, + { + "fieldname": "brand", + "fieldtype": "Link", + "label": "Brand", + "oldfieldname": "brand", + "oldfieldtype": "Link", + "options": "Brand", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 1, + "width": "100px" + }, + { + "fieldname": "lead_time_date", + "fieldtype": "Date", + "in_list_view": 0, + "label": "Lead Time Date", + "no_copy": 1, + "oldfieldname": "lead_time_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "sales_order_no", + "fieldtype": "Link", + "label": "Sales Order No", + "no_copy": 0, + "options": "Sales Order", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "col_break3", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "min_order_qty", + "fieldtype": "Float", + "label": "Min Order Qty", + "no_copy": 1, + "oldfieldname": "min_order_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "70px", + "read_only": 1, + "reqd": 0, + "width": "70px" + }, + { + "fieldname": "projected_qty", + "fieldtype": "Float", + "label": "Projected Qty", + "no_copy": 1, + "oldfieldname": "projected_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "70px", + "read_only": 1, + "width": "70px" + }, + { + "fieldname": "ordered_qty", + "fieldtype": "Float", + "label": "Completed Qty", + "no_copy": 1, + "oldfieldname": "ordered_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 1 + }, + { + "allow_on_submit": 1, + "fieldname": "page_break", + "fieldtype": "Check", + "label": "Page Break", + "no_copy": 1, + "oldfieldname": "page_break", + "oldfieldtype": "Check", + "permlevel": 0, + "print_hide": 1 + } + ], + "idx": 1, + "istable": 1, + "modified": "2014-02-03 11:35:26", + "modified_by": "Administrator", + "module": "Stock", + "name": "Material Request Item", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/stock/doctype/packed_item/packed_item.txt b/erpnext/stock/doctype/packed_item/packed_item.txt index 45a1d4d9b2..57d32cdc69 100644 --- a/erpnext/stock/doctype/packed_item/packed_item.txt +++ b/erpnext/stock/doctype/packed_item/packed_item.txt @@ -1,170 +1,157 @@ -[ - { - "creation": "2013-02-22 01:28:00", - "docstatus": 0, - "modified": "2013-12-20 19:23:23", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "istable": 1, - "module": "Stock", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Packed Item", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Packed Item" - }, - { - "doctype": "DocField", - "fieldname": "parent_item", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Parent Item", - "oldfieldname": "parent_item", - "oldfieldtype": "Link", - "options": "Item", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "item_code", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "Item Code", - "oldfieldname": "item_code", - "oldfieldtype": "Link", - "options": "Item", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "item_name", - "fieldtype": "Data", - "in_filter": 1, - "in_list_view": 1, - "label": "Item Name", - "oldfieldname": "item_name", - "oldfieldtype": "Data", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "parent_detail_docname", - "fieldtype": "Data", - "hidden": 1, - "in_list_view": 0, - "label": "Parent Detail docname", - "no_copy": 1, - "oldfieldname": "parent_detail_docname", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Text", - "in_list_view": 1, - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Text", - "print_width": "300px", - "read_only": 1, - "width": "300px" - }, - { - "doctype": "DocField", - "fieldname": "warehouse", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Warehouse", - "oldfieldname": "warehouse", - "oldfieldtype": "Link", - "options": "Warehouse" - }, - { - "doctype": "DocField", - "fieldname": "qty", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Qty", - "oldfieldname": "qty", - "oldfieldtype": "Currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "serial_no", - "fieldtype": "Text", - "label": "Serial No" - }, - { - "doctype": "DocField", - "fieldname": "batch_no", - "fieldtype": "Data", - "label": "Batch No" - }, - { - "doctype": "DocField", - "fieldname": "actual_qty", - "fieldtype": "Float", - "label": "Actual Qty", - "no_copy": 1, - "oldfieldname": "actual_qty", - "oldfieldtype": "Currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "projected_qty", - "fieldtype": "Float", - "label": "Projected Qty", - "no_copy": 1, - "oldfieldname": "projected_qty", - "oldfieldtype": "Currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "uom", - "fieldtype": "Link", - "label": "UOM", - "oldfieldname": "uom", - "oldfieldtype": "Link", - "options": "UOM", - "read_only": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "prevdoc_doctype", - "fieldtype": "Data", - "hidden": 1, - "label": "Prevdoc DocType", - "oldfieldname": "prevdoc_doctype", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 1 - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "page_break", - "fieldtype": "Check", - "label": "Page Break", - "oldfieldname": "page_break", - "oldfieldtype": "Check", - "read_only": 1 - } -] \ No newline at end of file +{ + "creation": "2013-02-22 01:28:00", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "parent_item", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Parent Item", + "oldfieldname": "parent_item", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "item_code", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Item Code", + "oldfieldname": "item_code", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "item_name", + "fieldtype": "Data", + "in_filter": 1, + "in_list_view": 1, + "label": "Item Name", + "oldfieldname": "item_name", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "parent_detail_docname", + "fieldtype": "Data", + "hidden": 1, + "in_list_view": 0, + "label": "Parent Detail docname", + "no_copy": 1, + "oldfieldname": "parent_detail_docname", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "description", + "fieldtype": "Text", + "in_list_view": 1, + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Text", + "permlevel": 0, + "print_width": "300px", + "read_only": 1, + "width": "300px" + }, + { + "fieldname": "warehouse", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Warehouse", + "oldfieldname": "warehouse", + "oldfieldtype": "Link", + "options": "Warehouse", + "permlevel": 0 + }, + { + "fieldname": "qty", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Qty", + "oldfieldname": "qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "serial_no", + "fieldtype": "Text", + "label": "Serial No", + "permlevel": 0 + }, + { + "fieldname": "batch_no", + "fieldtype": "Data", + "label": "Batch No", + "permlevel": 0 + }, + { + "fieldname": "actual_qty", + "fieldtype": "Float", + "label": "Actual Qty", + "no_copy": 1, + "oldfieldname": "actual_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "projected_qty", + "fieldtype": "Float", + "label": "Projected Qty", + "no_copy": 1, + "oldfieldname": "projected_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "uom", + "fieldtype": "Link", + "label": "UOM", + "oldfieldname": "uom", + "oldfieldtype": "Link", + "options": "UOM", + "permlevel": 0, + "read_only": 1, + "search_index": 0 + }, + { + "fieldname": "prevdoc_doctype", + "fieldtype": "Data", + "hidden": 1, + "label": "Prevdoc DocType", + "oldfieldname": "prevdoc_doctype", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "allow_on_submit": 1, + "fieldname": "page_break", + "fieldtype": "Check", + "label": "Page Break", + "oldfieldname": "page_break", + "oldfieldtype": "Check", + "permlevel": 0, + "read_only": 1 + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:23:23", + "modified_by": "Administrator", + "module": "Stock", + "name": "Packed Item", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/stock/doctype/packing_slip/packing_slip.txt b/erpnext/stock/doctype/packing_slip/packing_slip.txt index 2f8ccc3fc7..2cba25b18c 100644 --- a/erpnext/stock/doctype/packing_slip/packing_slip.txt +++ b/erpnext/stock/doctype/packing_slip/packing_slip.txt @@ -1,238 +1,259 @@ -[ - { - "creation": "2013-04-11 15:32:24", - "docstatus": 0, - "modified": "2014-01-20 17:48:59", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "PS.#######", - "description": "Generate packing slips for packages to be delivered. Used to notify package number, package contents and its weight.", - "doctype": "DocType", - "document_type": "Transaction", - "icon": "icon-suitcase", - "is_submittable": 1, - "module": "Stock", - "name": "__common__", - "read_only_onload": 1, - "search_fields": "delivery_note" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Packing Slip", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Packing Slip", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 1, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Packing Slip" - }, - { - "doctype": "DocField", - "fieldname": "packing_slip_details", - "fieldtype": "Section Break", - "label": "Packing Slip Items", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "read_only": 0 - }, - { - "description": "Indicates that the package is a part of this delivery", - "doctype": "DocField", - "fieldname": "delivery_note", - "fieldtype": "Link", - "label": "Delivery Note", - "options": "Delivery Note", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "naming_series", - "fieldtype": "Select", - "label": "Series", - "no_copy": 0, - "options": "PS", - "print_hide": 1, - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "section_break0", - "fieldtype": "Section Break", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break2", - "fieldtype": "Column Break", - "read_only": 0 - }, - { - "description": "Identification of the package for the delivery (for print)", - "doctype": "DocField", - "fieldname": "from_case_no", - "fieldtype": "Data", - "label": "From Package No.", - "no_copy": 1, - "read_only": 0, - "reqd": 1, - "width": "50px" - }, - { - "doctype": "DocField", - "fieldname": "column_break3", - "fieldtype": "Column Break", - "read_only": 0 - }, - { - "description": "If more than one package of the same type (for print)", - "doctype": "DocField", - "fieldname": "to_case_no", - "fieldtype": "Data", - "label": "To Package No.", - "no_copy": 1, - "read_only": 0, - "width": "50px" - }, - { - "doctype": "DocField", - "fieldname": "package_item_details", - "fieldtype": "Section Break", - "label": "Package Item Details", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "get_items", - "fieldtype": "Button", - "label": "Get Items" - }, - { - "doctype": "DocField", - "fieldname": "item_details", - "fieldtype": "Table", - "label": "Items", - "options": "Packing Slip Item", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "package_weight_details", - "fieldtype": "Section Break", - "label": "Package Weight Details", - "read_only": 0 - }, - { - "description": "The net weight of this package. (calculated automatically as sum of net weight of items)", - "doctype": "DocField", - "fieldname": "net_weight_pkg", - "fieldtype": "Float", - "label": "Net Weight", - "no_copy": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "net_weight_uom", - "fieldtype": "Link", - "label": "Net Weight UOM", - "no_copy": 1, - "options": "UOM", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break4", - "fieldtype": "Column Break", - "read_only": 0 - }, - { - "description": "The gross weight of the package. Usually net weight + packaging material weight. (for print)", - "doctype": "DocField", - "fieldname": "gross_weight_pkg", - "fieldtype": "Float", - "label": "Gross Weight", - "no_copy": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "gross_weight_uom", - "fieldtype": "Link", - "label": "Gross Weight UOM", - "no_copy": 1, - "options": "UOM", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "misc_details", - "fieldtype": "Section Break", - "label": "Misc Details", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "amended_from", - "fieldtype": "Link", - "ignore_restrictions": 1, - "label": "Amended From", - "no_copy": 1, - "options": "Packing Slip", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocPerm", - "role": "Material User" - }, - { - "doctype": "DocPerm", - "role": "Sales User" - }, - { - "doctype": "DocPerm", - "role": "Material Master Manager" - }, - { - "doctype": "DocPerm", - "role": "Material Manager" - }, - { - "doctype": "DocPerm", - "role": "Sales Manager" - } -] \ No newline at end of file +{ + "autoname": "PS.#######", + "creation": "2013-04-11 15:32:24", + "description": "Generate packing slips for packages to be delivered. Used to notify package number, package contents and its weight.", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Transaction", + "fields": [ + { + "fieldname": "packing_slip_details", + "fieldtype": "Section Break", + "label": "Packing Slip Items", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0 + }, + { + "description": "Indicates that the package is a part of this delivery", + "fieldname": "delivery_note", + "fieldtype": "Link", + "label": "Delivery Note", + "options": "Delivery Note", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "naming_series", + "fieldtype": "Select", + "label": "Series", + "no_copy": 0, + "options": "PS", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "section_break0", + "fieldtype": "Section Break", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "column_break2", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0 + }, + { + "description": "Identification of the package for the delivery (for print)", + "fieldname": "from_case_no", + "fieldtype": "Data", + "label": "From Package No.", + "no_copy": 1, + "permlevel": 0, + "read_only": 0, + "reqd": 1, + "width": "50px" + }, + { + "fieldname": "column_break3", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0 + }, + { + "description": "If more than one package of the same type (for print)", + "fieldname": "to_case_no", + "fieldtype": "Data", + "label": "To Package No.", + "no_copy": 1, + "permlevel": 0, + "read_only": 0, + "width": "50px" + }, + { + "fieldname": "package_item_details", + "fieldtype": "Section Break", + "label": "Package Item Details", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "get_items", + "fieldtype": "Button", + "label": "Get Items", + "permlevel": 0 + }, + { + "fieldname": "item_details", + "fieldtype": "Table", + "label": "Items", + "options": "Packing Slip Item", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "package_weight_details", + "fieldtype": "Section Break", + "label": "Package Weight Details", + "permlevel": 0, + "read_only": 0 + }, + { + "description": "The net weight of this package. (calculated automatically as sum of net weight of items)", + "fieldname": "net_weight_pkg", + "fieldtype": "Float", + "label": "Net Weight", + "no_copy": 1, + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "net_weight_uom", + "fieldtype": "Link", + "label": "Net Weight UOM", + "no_copy": 1, + "options": "UOM", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "column_break4", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0 + }, + { + "description": "The gross weight of the package. Usually net weight + packaging material weight. (for print)", + "fieldname": "gross_weight_pkg", + "fieldtype": "Float", + "label": "Gross Weight", + "no_copy": 1, + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "gross_weight_uom", + "fieldtype": "Link", + "label": "Gross Weight UOM", + "no_copy": 1, + "options": "UOM", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "misc_details", + "fieldtype": "Section Break", + "label": "Misc Details", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "amended_from", + "fieldtype": "Link", + "ignore_restrictions": 1, + "label": "Amended From", + "no_copy": 1, + "options": "Packing Slip", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + } + ], + "icon": "icon-suitcase", + "idx": 1, + "is_submittable": 1, + "modified": "2014-01-20 17:48:59", + "modified_by": "Administrator", + "module": "Stock", + "name": "Packing Slip", + "owner": "Administrator", + "permissions": [ + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material User", + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales User", + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material Master Manager", + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material Manager", + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales Manager", + "submit": 1, + "write": 1 + } + ], + "read_only_onload": 1, + "search_fields": "delivery_note" +} \ No newline at end of file diff --git a/erpnext/stock/doctype/packing_slip_item/packing_slip_item.txt b/erpnext/stock/doctype/packing_slip_item/packing_slip_item.txt index 54e69914d0..8844754b56 100644 --- a/erpnext/stock/doctype/packing_slip_item/packing_slip_item.txt +++ b/erpnext/stock/doctype/packing_slip_item/packing_slip_item.txt @@ -1,110 +1,97 @@ -[ - { - "creation": "2013-04-08 13:10:16", - "docstatus": 0, - "modified": "2013-12-20 19:23:23", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "PSD/.#######", - "doctype": "DocType", - "istable": 1, - "module": "Stock", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Packing Slip Item", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Packing Slip Item" - }, - { - "doctype": "DocField", - "fieldname": "item_code", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Item Code", - "options": "Item", - "print_width": "100px", - "read_only": 0, - "reqd": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "item_name", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Item Name", - "print_width": "200px", - "read_only": 1, - "width": "200px" - }, - { - "doctype": "DocField", - "fieldname": "qty", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Quantity", - "print_width": "100px", - "read_only": 0, - "reqd": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "stock_uom", - "fieldtype": "Link", - "in_list_view": 0, - "label": "UOM", - "options": "UOM", - "print_width": "100px", - "read_only": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "net_weight", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Net Weight", - "print_width": "100px", - "read_only": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "weight_uom", - "fieldtype": "Link", - "in_list_view": 0, - "label": "Weight UOM", - "options": "UOM", - "print_width": "100px", - "read_only": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "page_break", - "fieldtype": "Check", - "in_list_view": 1, - "label": "Page Break", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "dn_detail", - "fieldtype": "Data", - "hidden": 1, - "in_list_view": 1, - "label": "DN Detail", - "read_only": 0 - } -] \ No newline at end of file +{ + "autoname": "PSD/.#######", + "creation": "2013-04-08 13:10:16", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "item_code", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Item Code", + "options": "Item", + "permlevel": 0, + "print_width": "100px", + "read_only": 0, + "reqd": 1, + "width": "100px" + }, + { + "fieldname": "item_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Item Name", + "permlevel": 0, + "print_width": "200px", + "read_only": 1, + "width": "200px" + }, + { + "fieldname": "qty", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Quantity", + "permlevel": 0, + "print_width": "100px", + "read_only": 0, + "reqd": 1, + "width": "100px" + }, + { + "fieldname": "stock_uom", + "fieldtype": "Link", + "in_list_view": 0, + "label": "UOM", + "options": "UOM", + "permlevel": 0, + "print_width": "100px", + "read_only": 1, + "width": "100px" + }, + { + "fieldname": "net_weight", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Net Weight", + "permlevel": 0, + "print_width": "100px", + "read_only": 0, + "width": "100px" + }, + { + "fieldname": "weight_uom", + "fieldtype": "Link", + "in_list_view": 0, + "label": "Weight UOM", + "options": "UOM", + "permlevel": 0, + "print_width": "100px", + "read_only": 0, + "width": "100px" + }, + { + "fieldname": "page_break", + "fieldtype": "Check", + "in_list_view": 1, + "label": "Page Break", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "dn_detail", + "fieldtype": "Data", + "hidden": 1, + "in_list_view": 1, + "label": "DN Detail", + "permlevel": 0, + "read_only": 0 + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:23:23", + "modified_by": "Administrator", + "module": "Stock", + "name": "Packing Slip Item", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/stock/doctype/price_list/price_list.txt b/erpnext/stock/doctype/price_list/price_list.txt index 253dce72c5..c22355a2d2 100644 --- a/erpnext/stock/doctype/price_list/price_list.txt +++ b/erpnext/stock/doctype/price_list/price_list.txt @@ -1,139 +1,126 @@ -[ - { - "creation": "2013-01-25 11:35:09", - "docstatus": 0, - "modified": "2014-01-27 11:11:08", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_attach": 0, - "allow_copy": 0, - "allow_import": 1, - "allow_email": 1, - "allow_print": 1, - "allow_rename": 1, - "autoname": "field:price_list_name", - "description": "Price List Master", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-tags", - "max_attachments": 1, - "module": "Stock", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Price List", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocPerm", - "name": "__common__", - "parent": "Price List", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "read": 1, - "report": 1 - }, - { - "doctype": "DocType", - "name": "Price List" - }, - { - "default": "1", - "doctype": "DocField", - "fieldname": "enabled", - "fieldtype": "Check", - "label": "Enabled" - }, - { - "doctype": "DocField", - "fieldname": "sb_1", - "fieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "price_list_name", - "fieldtype": "Data", - "label": "Price List Name", - "oldfieldname": "price_list_name", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "currency", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Currency", - "options": "Currency", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "buying", - "fieldtype": "Check", - "in_list_view": 1, - "label": "Buying" - }, - { - "doctype": "DocField", - "fieldname": "selling", - "fieldtype": "Check", - "in_list_view": 1, - "label": "Selling", - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break_3", - "fieldtype": "Column Break" - }, - { - "description": "Specify a list of Territories, for which, this Price List is valid", - "doctype": "DocField", - "fieldname": "valid_for_territories", - "fieldtype": "Table", - "label": "Valid for Territories", - "options": "Applicable Territory", - "reqd": 1 - }, - { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Sales User", - "submit": 0, - "write": 0 - }, - { - "amend": 0, - "cancel": 0, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Sales Master Manager", - "submit": 0, - "write": 1 - }, - { - "delete": 0, - "doctype": "DocPerm", - "role": "Purchase User" - }, - { - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Purchase Master Manager", - "write": 1 - } -] \ No newline at end of file +{ + "allow_attach": 0, + "allow_copy": 0, + "allow_email": 1, + "allow_import": 1, + "allow_print": 1, + "allow_rename": 1, + "autoname": "field:price_list_name", + "creation": "2013-01-25 11:35:09", + "description": "Price List Master", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "default": "1", + "fieldname": "enabled", + "fieldtype": "Check", + "label": "Enabled", + "permlevel": 0 + }, + { + "fieldname": "sb_1", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "price_list_name", + "fieldtype": "Data", + "label": "Price List Name", + "oldfieldname": "price_list_name", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "currency", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Currency", + "options": "Currency", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "buying", + "fieldtype": "Check", + "in_list_view": 1, + "label": "Buying", + "permlevel": 0 + }, + { + "fieldname": "selling", + "fieldtype": "Check", + "in_list_view": 1, + "label": "Selling", + "permlevel": 0, + "reqd": 0 + }, + { + "fieldname": "column_break_3", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "description": "Specify a list of Territories, for which, this Price List is valid", + "fieldname": "valid_for_territories", + "fieldtype": "Table", + "label": "Valid for Territories", + "options": "Applicable Territory", + "permlevel": 0, + "reqd": 1 + } + ], + "icon": "icon-tags", + "idx": 1, + "max_attachments": 1, + "modified": "2014-01-27 11:11:08", + "modified_by": "Administrator", + "module": "Stock", + "name": "Price List", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "permlevel": 0, + "read": 1, + "report": 1, + "role": "Sales User", + "submit": 0, + "write": 0 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "permlevel": 0, + "read": 1, + "report": 1, + "role": "Sales Master Manager", + "submit": 0, + "write": 1 + }, + { + "delete": 0, + "permlevel": 0, + "read": 1, + "report": 1, + "role": "Purchase User" + }, + { + "cancel": 1, + "create": 1, + "delete": 1, + "permlevel": 0, + "read": 1, + "report": 1, + "role": "Purchase Master Manager", + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.txt b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.txt index 5b83710c76..7d81392fe9 100755 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.txt +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.txt @@ -1,853 +1,846 @@ -[ - { - "creation": "2013-05-21 16:16:39", - "docstatus": 0, - "modified": "2014-02-17 12:01:00", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_attach": 1, - "autoname": "naming_series:", - "doctype": "DocType", - "document_type": "Transaction", - "icon": "icon-truck", - "is_submittable": 1, - "module": "Stock", - "name": "__common__", - "read_only_onload": 1, - "search_fields": "status, posting_date, supplier" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Purchase Receipt", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Purchase Receipt", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1 - }, - { - "doctype": "DocType", - "name": "Purchase Receipt" - }, - { - "doctype": "DocField", - "fieldname": "supplier_section", - "fieldtype": "Section Break", - "label": "Supplier", - "options": "icon-user" - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "print_width": "50%", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "naming_series", - "fieldtype": "Select", - "label": "Series", - "no_copy": 1, - "oldfieldname": "naming_series", - "oldfieldtype": "Select", - "options": "\nGRN", - "print_hide": 1, - "reqd": 1 - }, - { - "allow_on_submit": 0, - "doctype": "DocField", - "fieldname": "supplier", - "fieldtype": "Link", - "in_filter": 1, - "label": "Supplier", - "oldfieldname": "supplier", - "oldfieldtype": "Link", - "options": "Supplier", - "print_hide": 1, - "print_width": "150px", - "reqd": 1, - "search_index": 1, - "width": "150px" - }, - { - "depends_on": "supplier", - "doctype": "DocField", - "fieldname": "supplier_name", - "fieldtype": "Data", - "hidden": 0, - "in_list_view": 1, - "label": "Supplier Name", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "address_display", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Address", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "contact_display", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Contact", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "contact_mobile", - "fieldtype": "Text", - "hidden": 1, - "label": "Mobile No", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "contact_email", - "fieldtype": "Text", - "hidden": 1, - "label": "Contact Email", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "print_width": "50%", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "posting_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Posting Date", - "no_copy": 1, - "oldfieldname": "posting_date", - "oldfieldtype": "Date", - "print_hide": 1, - "print_width": "100px", - "reqd": 1, - "search_index": 1, - "width": "100px" - }, - { - "description": "Time at which materials were received", - "doctype": "DocField", - "fieldname": "posting_time", - "fieldtype": "Time", - "in_filter": 0, - "label": "Posting Time", - "no_copy": 1, - "oldfieldname": "posting_time", - "oldfieldtype": "Time", - "print_hide": 1, - "print_width": "100px", - "reqd": 1, - "search_index": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "challan_no", - "fieldtype": "Data", - "hidden": 1, - "label": "Supplier Shipment No", - "no_copy": 1, - "oldfieldname": "challan_no", - "oldfieldtype": "Data", - "print_hide": 0, - "print_width": "100px", - "reqd": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "challan_date", - "fieldtype": "Date", - "hidden": 1, - "label": "Supplier Shipment Date", - "no_copy": 1, - "oldfieldname": "challan_date", - "oldfieldtype": "Date", - "print_hide": 0, - "print_width": "100px", - "reqd": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "currency_price_list", - "fieldtype": "Section Break", - "label": "Currency and Price List", - "options": "icon-tag" - }, - { - "doctype": "DocField", - "fieldname": "currency", - "fieldtype": "Link", - "label": "Currency", - "oldfieldname": "currency", - "oldfieldtype": "Select", - "options": "Currency", - "print_hide": 1, - "reqd": 1 - }, - { - "description": "Rate at which supplier's currency is converted to company's base currency", - "doctype": "DocField", - "fieldname": "conversion_rate", - "fieldtype": "Float", - "label": "Exchange Rate", - "oldfieldname": "conversion_rate", - "oldfieldtype": "Currency", - "print_hide": 1, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break2", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "print_width": "50%", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "buying_price_list", - "fieldtype": "Link", - "label": "Price List", - "options": "Price List", - "print_hide": 1 - }, - { - "depends_on": "buying_price_list", - "doctype": "DocField", - "fieldname": "price_list_currency", - "fieldtype": "Link", - "hidden": 0, - "label": "Price List Currency", - "options": "Currency", - "print_hide": 1, - "read_only": 1 - }, - { - "depends_on": "buying_price_list", - "doctype": "DocField", - "fieldname": "plc_conversion_rate", - "fieldtype": "Float", - "label": "Price List Exchange Rate", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "items", - "fieldtype": "Section Break", - "label": "Items", - "oldfieldtype": "Section Break", - "options": "icon-shopping-cart" - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "purchase_receipt_details", - "fieldtype": "Table", - "label": "Purchase Receipt Items", - "oldfieldname": "purchase_receipt_details", - "oldfieldtype": "Table", - "options": "Purchase Receipt Item", - "print_hide": 0, - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "section_break0", - "fieldtype": "Section Break", - "oldfieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "net_total_import", - "fieldtype": "Currency", - "label": "Net Total", - "oldfieldname": "net_total_import", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 0, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "get_current_stock", - "fieldtype": "Button", - "label": "Get Current Stock", - "oldfieldtype": "Button", - "options": "get_current_stock", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break_27", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "net_total", - "fieldtype": "Currency", - "label": "Net Total (Company Currency)", - "oldfieldname": "net_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "reqd": 1, - "width": "150px" - }, - { - "description": "Add / Edit Taxes and Charges", - "doctype": "DocField", - "fieldname": "taxes", - "fieldtype": "Section Break", - "label": "Taxes and Charges", - "oldfieldtype": "Section Break", - "options": "icon-money" - }, - { - "description": "If you have created a standard template in Purchase Taxes and Charges Master, select one and click on the button below.", - "doctype": "DocField", - "fieldname": "taxes_and_charges", - "fieldtype": "Link", - "label": "Taxes and Charges", - "oldfieldname": "purchase_other_charges", - "oldfieldtype": "Link", - "options": "Purchase Taxes and Charges Master", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "other_charges", - "fieldtype": "Table", - "label": "Purchase Taxes and Charges", - "oldfieldname": "purchase_tax_details", - "oldfieldtype": "Table", - "options": "Purchase Taxes and Charges" - }, - { - "doctype": "DocField", - "fieldname": "other_charges_calculation", - "fieldtype": "HTML", - "label": "Taxes and Charges Calculation", - "oldfieldtype": "HTML", - "print_hide": 1 - }, - { - "description": "Detailed Breakup of the totals", - "doctype": "DocField", - "fieldname": "totals", - "fieldtype": "Section Break", - "label": "Totals", - "oldfieldtype": "Section Break", - "options": "icon-money" - }, - { - "doctype": "DocField", - "fieldname": "other_charges_added_import", - "fieldtype": "Currency", - "label": "Taxes and Charges Added", - "oldfieldname": "other_charges_added_import", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "other_charges_deducted_import", - "fieldtype": "Currency", - "label": "Taxes and Charges Deducted", - "oldfieldname": "other_charges_deducted_import", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "grand_total_import", - "fieldtype": "Currency", - "label": "Grand Total", - "oldfieldname": "grand_total_import", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 0, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "in_words_import", - "fieldtype": "Data", - "label": "In Words", - "oldfieldname": "in_words_import", - "oldfieldtype": "Data", - "print_hide": 0, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break3", - "fieldtype": "Column Break", - "print_width": "50%", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "other_charges_added", - "fieldtype": "Currency", - "label": "Taxes and Charges Added (Company Currency)", - "oldfieldname": "other_charges_added", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "other_charges_deducted", - "fieldtype": "Currency", - "label": "Taxes and Charges Deducted (Company Currency)", - "oldfieldname": "other_charges_deducted", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "total_tax", - "fieldtype": "Currency", - "label": "Total Tax (Company Currency)", - "oldfieldname": "total_tax", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "grand_total", - "fieldtype": "Currency", - "label": "Grand Total (Company Currency)", - "oldfieldname": "grand_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "rounded_total", - "fieldtype": "Currency", - "label": "Rounded Total (Company Currency)", - "oldfieldname": "rounded_total", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "description": "In Words will be visible once you save the Purchase Receipt.", - "doctype": "DocField", - "fieldname": "in_words", - "fieldtype": "Data", - "label": "In Words (Company Currency)", - "oldfieldname": "in_words", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "terms_section_break", - "fieldtype": "Section Break", - "label": "Terms and Conditions", - "oldfieldtype": "Section Break", - "options": "icon-legal" - }, - { - "doctype": "DocField", - "fieldname": "tc_name", - "fieldtype": "Link", - "label": "Terms", - "oldfieldname": "tc_name", - "oldfieldtype": "Link", - "options": "Terms and Conditions", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "terms", - "fieldtype": "Text Editor", - "label": "Terms and Conditions1", - "oldfieldname": "terms", - "oldfieldtype": "Text Editor" - }, - { - "depends_on": "supplier", - "doctype": "DocField", - "fieldname": "contact_section", - "fieldtype": "Section Break", - "label": "Contact Info", - "options": "icon-bullhorn" - }, - { - "doctype": "DocField", - "fieldname": "supplier_address", - "fieldtype": "Link", - "label": "Supplier Address", - "options": "Address", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break_57", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "contact_person", - "fieldtype": "Link", - "label": "Contact Person", - "options": "Contact", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "more_info", - "fieldtype": "Section Break", - "label": "More Info", - "oldfieldtype": "Section Break", - "options": "icon-file-text" - }, - { - "doctype": "DocField", - "fieldname": "status", - "fieldtype": "Select", - "in_filter": 1, - "label": "Status", - "no_copy": 1, - "oldfieldname": "status", - "oldfieldtype": "Select", - "options": "\nDraft\nSubmitted\nCancelled", - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "reqd": 1, - "search_index": 1, - "width": "150px" - }, - { - "default": "No", - "description": "Select \"Yes\" for sub - contracting items", - "doctype": "DocField", - "fieldname": "is_subcontracted", - "fieldtype": "Select", - "label": "Is Subcontracted", - "oldfieldname": "is_subcontracted", - "oldfieldtype": "Select", - "options": "\nYes\nNo", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "amended_from", - "fieldtype": "Data", - "hidden": 1, - "ignore_restrictions": 1, - "label": "Amended From", - "no_copy": 1, - "oldfieldname": "amended_from", - "oldfieldtype": "Data", - "options": "Purchase Receipt", - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "range", - "fieldtype": "Data", - "hidden": 1, - "label": "Range", - "oldfieldname": "range", - "oldfieldtype": "Data", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "bill_no", - "fieldtype": "Data", - "hidden": 1, - "label": "Bill No", - "oldfieldname": "bill_no", - "oldfieldtype": "Data", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "bill_date", - "fieldtype": "Date", - "hidden": 1, - "label": "Bill Date", - "oldfieldname": "bill_date", - "oldfieldtype": "Date", - "print_hide": 1 - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "letter_head", - "fieldtype": "Select", - "label": "Letter Head", - "options": "link:Letter Head", - "print_hide": 1 - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "select_print_heading", - "fieldtype": "Link", - "label": "Print Heading", - "no_copy": 1, - "oldfieldname": "select_print_heading", - "oldfieldtype": "Link", - "options": "Print Heading", - "print_hide": 1, - "report_hide": 1 - }, - { - "description": "Select the relevant company name if you have multiple companies", - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 1, - "label": "Company", - "no_copy": 0, - "oldfieldname": "company", - "oldfieldtype": "Link", - "options": "Company", - "print_hide": 1, - "print_width": "150px", - "reqd": 1, - "search_index": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "fiscal_year", - "fieldtype": "Select", - "in_filter": 1, - "label": "Fiscal Year", - "oldfieldname": "fiscal_year", - "oldfieldtype": "Select", - "options": "link:Fiscal Year", - "print_hide": 1, - "print_width": "150px", - "reqd": 1, - "search_index": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "column_break4", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "print_hide": 1, - "print_width": "50%", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "other_details", - "fieldtype": "HTML", - "hidden": 1, - "label": "Other Details", - "oldfieldtype": "HTML", - "options": "
Other Details
", - "print_hide": 1, - "print_width": "30%", - "reqd": 0, - "width": "30%" - }, - { - "description": "Warehouse where you are maintaining stock of rejected items", - "doctype": "DocField", - "fieldname": "rejected_warehouse", - "fieldtype": "Link", - "label": "Rejected Warehouse", - "no_copy": 1, - "oldfieldname": "rejected_warehouse", - "oldfieldtype": "Link", - "options": "Warehouse", - "print_hide": 1, - "reqd": 0 - }, - { - "description": "Supplier warehouse where you have issued raw materials for sub - contracting", - "doctype": "DocField", - "fieldname": "supplier_warehouse", - "fieldtype": "Link", - "label": "Supplier Warehouse", - "no_copy": 1, - "oldfieldname": "supplier_warehouse", - "oldfieldtype": "Link", - "options": "Warehouse", - "print_hide": 1, - "print_width": "50px", - "width": "50px" - }, - { - "doctype": "DocField", - "fieldname": "instructions", - "fieldtype": "Small Text", - "label": "Instructions", - "oldfieldname": "instructions", - "oldfieldtype": "Text" - }, - { - "doctype": "DocField", - "fieldname": "remarks", - "fieldtype": "Small Text", - "label": "Remarks", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "transporter_info", - "fieldtype": "Section Break", - "label": "Transporter Info", - "options": "icon-truck" - }, - { - "doctype": "DocField", - "fieldname": "transporter_name", - "fieldtype": "Data", - "label": "Transporter Name", - "oldfieldname": "transporter_name", - "oldfieldtype": "Data" - }, - { - "description": "Transporter lorry number", - "doctype": "DocField", - "fieldname": "lr_no", - "fieldtype": "Data", - "label": "LR No", - "no_copy": 1, - "oldfieldname": "lr_no", - "oldfieldtype": "Data", - "print_hide": 0, - "print_width": "100px", - "width": "100px" - }, - { - "description": "Date on which lorry started from supplier warehouse", - "doctype": "DocField", - "fieldname": "lr_date", - "fieldtype": "Date", - "label": "LR Date", - "no_copy": 1, - "oldfieldname": "lr_date", - "oldfieldtype": "Date", - "print_hide": 0, - "print_width": "100px", - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "column_break5", - "fieldtype": "Column Break", - "print_width": "50%", - "width": "50%" - }, - { - "description": "Following table will show values if items are sub - contracted. These values will be fetched from the master of \"Bill of Materials\" of sub - contracted items.", - "doctype": "DocField", - "fieldname": "raw_material_details", - "fieldtype": "Section Break", - "label": "Raw Materials Supplied", - "oldfieldtype": "Section Break", - "options": "icon-table", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "pr_raw_material_details", - "fieldtype": "Table", - "label": "Purchase Receipt Item Supplieds", - "no_copy": 1, - "oldfieldname": "pr_raw_material_details", - "oldfieldtype": "Table", - "options": "Purchase Receipt Item Supplied", - "print_hide": 1, - "read_only": 1 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Material Manager", - "submit": 1, - "write": 1 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Material User", - "submit": 1, - "write": 1 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Purchase User", - "submit": 1, - "write": 1 - }, - { - "cancel": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Supplier" - } -] +{ + "allow_attach": 1, + "autoname": "naming_series:", + "creation": "2013-05-21 16:16:39", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Transaction", + "fields": [ + { + "fieldname": "supplier_section", + "fieldtype": "Section Break", + "label": "Supplier", + "options": "icon-user", + "permlevel": 0 + }, + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_width": "50%", + "width": "50%" + }, + { + "fieldname": "naming_series", + "fieldtype": "Select", + "label": "Series", + "no_copy": 1, + "oldfieldname": "naming_series", + "oldfieldtype": "Select", + "options": "\nGRN", + "permlevel": 0, + "print_hide": 1, + "reqd": 1 + }, + { + "allow_on_submit": 0, + "fieldname": "supplier", + "fieldtype": "Link", + "in_filter": 1, + "label": "Supplier", + "oldfieldname": "supplier", + "oldfieldtype": "Link", + "options": "Supplier", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "reqd": 1, + "search_index": 1, + "width": "150px" + }, + { + "depends_on": "supplier", + "fieldname": "supplier_name", + "fieldtype": "Data", + "hidden": 0, + "in_list_view": 1, + "label": "Supplier Name", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "address_display", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Address", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "contact_display", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Contact", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "contact_mobile", + "fieldtype": "Text", + "hidden": 1, + "label": "Mobile No", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "contact_email", + "fieldtype": "Text", + "hidden": 1, + "label": "Contact Email", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_width": "50%", + "width": "50%" + }, + { + "fieldname": "posting_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Posting Date", + "no_copy": 1, + "oldfieldname": "posting_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "reqd": 1, + "search_index": 1, + "width": "100px" + }, + { + "description": "Time at which materials were received", + "fieldname": "posting_time", + "fieldtype": "Time", + "in_filter": 0, + "label": "Posting Time", + "no_copy": 1, + "oldfieldname": "posting_time", + "oldfieldtype": "Time", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "reqd": 1, + "search_index": 0, + "width": "100px" + }, + { + "fieldname": "challan_no", + "fieldtype": "Data", + "hidden": 1, + "label": "Supplier Shipment No", + "no_copy": 1, + "oldfieldname": "challan_no", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 0, + "print_width": "100px", + "reqd": 0, + "width": "100px" + }, + { + "fieldname": "challan_date", + "fieldtype": "Date", + "hidden": 1, + "label": "Supplier Shipment Date", + "no_copy": 1, + "oldfieldname": "challan_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 0, + "print_width": "100px", + "reqd": 0, + "width": "100px" + }, + { + "fieldname": "currency_price_list", + "fieldtype": "Section Break", + "label": "Currency and Price List", + "options": "icon-tag", + "permlevel": 0 + }, + { + "fieldname": "currency", + "fieldtype": "Link", + "label": "Currency", + "oldfieldname": "currency", + "oldfieldtype": "Select", + "options": "Currency", + "permlevel": 0, + "print_hide": 1, + "reqd": 1 + }, + { + "description": "Rate at which supplier's currency is converted to company's base currency", + "fieldname": "conversion_rate", + "fieldtype": "Float", + "label": "Exchange Rate", + "oldfieldname": "conversion_rate", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "reqd": 1 + }, + { + "fieldname": "column_break2", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_width": "50%", + "width": "50%" + }, + { + "fieldname": "buying_price_list", + "fieldtype": "Link", + "label": "Price List", + "options": "Price List", + "permlevel": 0, + "print_hide": 1 + }, + { + "depends_on": "buying_price_list", + "fieldname": "price_list_currency", + "fieldtype": "Link", + "hidden": 0, + "label": "Price List Currency", + "options": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "depends_on": "buying_price_list", + "fieldname": "plc_conversion_rate", + "fieldtype": "Float", + "label": "Price List Exchange Rate", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "items", + "fieldtype": "Section Break", + "label": "Items", + "oldfieldtype": "Section Break", + "options": "icon-shopping-cart", + "permlevel": 0 + }, + { + "allow_on_submit": 1, + "fieldname": "purchase_receipt_details", + "fieldtype": "Table", + "label": "Purchase Receipt Items", + "oldfieldname": "purchase_receipt_details", + "oldfieldtype": "Table", + "options": "Purchase Receipt Item", + "permlevel": 0, + "print_hide": 0, + "reqd": 0 + }, + { + "fieldname": "section_break0", + "fieldtype": "Section Break", + "oldfieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "net_total_import", + "fieldtype": "Currency", + "label": "Net Total", + "oldfieldname": "net_total_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 1 + }, + { + "fieldname": "get_current_stock", + "fieldtype": "Button", + "label": "Get Current Stock", + "oldfieldtype": "Button", + "options": "get_current_stock", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "column_break_27", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "net_total", + "fieldtype": "Currency", + "label": "Net Total (Company Currency)", + "oldfieldname": "net_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 1, + "reqd": 1, + "width": "150px" + }, + { + "description": "Add / Edit Taxes and Charges", + "fieldname": "taxes", + "fieldtype": "Section Break", + "label": "Taxes and Charges", + "oldfieldtype": "Section Break", + "options": "icon-money", + "permlevel": 0 + }, + { + "description": "If you have created a standard template in Purchase Taxes and Charges Master, select one and click on the button below.", + "fieldname": "taxes_and_charges", + "fieldtype": "Link", + "label": "Taxes and Charges", + "oldfieldname": "purchase_other_charges", + "oldfieldtype": "Link", + "options": "Purchase Taxes and Charges Master", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "other_charges", + "fieldtype": "Table", + "label": "Purchase Taxes and Charges", + "oldfieldname": "purchase_tax_details", + "oldfieldtype": "Table", + "options": "Purchase Taxes and Charges", + "permlevel": 0 + }, + { + "fieldname": "other_charges_calculation", + "fieldtype": "HTML", + "label": "Taxes and Charges Calculation", + "oldfieldtype": "HTML", + "permlevel": 0, + "print_hide": 1 + }, + { + "description": "Detailed Breakup of the totals", + "fieldname": "totals", + "fieldtype": "Section Break", + "label": "Totals", + "oldfieldtype": "Section Break", + "options": "icon-money", + "permlevel": 0 + }, + { + "fieldname": "other_charges_added_import", + "fieldtype": "Currency", + "label": "Taxes and Charges Added", + "oldfieldname": "other_charges_added_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "other_charges_deducted_import", + "fieldtype": "Currency", + "label": "Taxes and Charges Deducted", + "oldfieldname": "other_charges_deducted_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "grand_total_import", + "fieldtype": "Currency", + "label": "Grand Total", + "oldfieldname": "grand_total_import", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "read_only": 1 + }, + { + "fieldname": "in_words_import", + "fieldtype": "Data", + "label": "In Words", + "oldfieldname": "in_words_import", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 0, + "read_only": 1 + }, + { + "fieldname": "column_break3", + "fieldtype": "Column Break", + "permlevel": 0, + "print_width": "50%", + "width": "50%" + }, + { + "fieldname": "other_charges_added", + "fieldtype": "Currency", + "label": "Taxes and Charges Added (Company Currency)", + "oldfieldname": "other_charges_added", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "other_charges_deducted", + "fieldtype": "Currency", + "label": "Taxes and Charges Deducted (Company Currency)", + "oldfieldname": "other_charges_deducted", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "total_tax", + "fieldtype": "Currency", + "label": "Total Tax (Company Currency)", + "oldfieldname": "total_tax", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "grand_total", + "fieldtype": "Currency", + "label": "Grand Total (Company Currency)", + "oldfieldname": "grand_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "rounded_total", + "fieldtype": "Currency", + "label": "Rounded Total (Company Currency)", + "oldfieldname": "rounded_total", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "description": "In Words will be visible once you save the Purchase Receipt.", + "fieldname": "in_words", + "fieldtype": "Data", + "label": "In Words (Company Currency)", + "oldfieldname": "in_words", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "terms_section_break", + "fieldtype": "Section Break", + "label": "Terms and Conditions", + "oldfieldtype": "Section Break", + "options": "icon-legal", + "permlevel": 0 + }, + { + "fieldname": "tc_name", + "fieldtype": "Link", + "label": "Terms", + "oldfieldname": "tc_name", + "oldfieldtype": "Link", + "options": "Terms and Conditions", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "terms", + "fieldtype": "Text Editor", + "label": "Terms and Conditions1", + "oldfieldname": "terms", + "oldfieldtype": "Text Editor", + "permlevel": 0 + }, + { + "depends_on": "supplier", + "fieldname": "contact_section", + "fieldtype": "Section Break", + "label": "Contact Info", + "options": "icon-bullhorn", + "permlevel": 0 + }, + { + "fieldname": "supplier_address", + "fieldtype": "Link", + "label": "Supplier Address", + "options": "Address", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "column_break_57", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "contact_person", + "fieldtype": "Link", + "label": "Contact Person", + "options": "Contact", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "more_info", + "fieldtype": "Section Break", + "label": "More Info", + "oldfieldtype": "Section Break", + "options": "icon-file-text", + "permlevel": 0 + }, + { + "fieldname": "status", + "fieldtype": "Select", + "in_filter": 1, + "label": "Status", + "no_copy": 1, + "oldfieldname": "status", + "oldfieldtype": "Select", + "options": "\nDraft\nSubmitted\nCancelled", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 1, + "reqd": 1, + "search_index": 1, + "width": "150px" + }, + { + "default": "No", + "description": "Select \"Yes\" for sub - contracting items", + "fieldname": "is_subcontracted", + "fieldtype": "Select", + "label": "Is Subcontracted", + "oldfieldname": "is_subcontracted", + "oldfieldtype": "Select", + "options": "\nYes\nNo", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "amended_from", + "fieldtype": "Data", + "hidden": 1, + "ignore_restrictions": 1, + "label": "Amended From", + "no_copy": 1, + "oldfieldname": "amended_from", + "oldfieldtype": "Data", + "options": "Purchase Receipt", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 1, + "width": "150px" + }, + { + "fieldname": "range", + "fieldtype": "Data", + "hidden": 1, + "label": "Range", + "oldfieldname": "range", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "bill_no", + "fieldtype": "Data", + "hidden": 1, + "label": "Bill No", + "oldfieldname": "bill_no", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "bill_date", + "fieldtype": "Date", + "hidden": 1, + "label": "Bill Date", + "oldfieldname": "bill_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 1 + }, + { + "allow_on_submit": 1, + "fieldname": "letter_head", + "fieldtype": "Select", + "label": "Letter Head", + "options": "link:Letter Head", + "permlevel": 0, + "print_hide": 1 + }, + { + "allow_on_submit": 1, + "fieldname": "select_print_heading", + "fieldtype": "Link", + "label": "Print Heading", + "no_copy": 1, + "oldfieldname": "select_print_heading", + "oldfieldtype": "Link", + "options": "Print Heading", + "permlevel": 0, + "print_hide": 1, + "report_hide": 1 + }, + { + "description": "Select the relevant company name if you have multiple companies", + "fieldname": "company", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 1, + "label": "Company", + "no_copy": 0, + "oldfieldname": "company", + "oldfieldtype": "Link", + "options": "Company", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "reqd": 1, + "search_index": 1, + "width": "150px" + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Select", + "in_filter": 1, + "label": "Fiscal Year", + "oldfieldname": "fiscal_year", + "oldfieldtype": "Select", + "options": "link:Fiscal Year", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "reqd": 1, + "search_index": 1, + "width": "150px" + }, + { + "fieldname": "column_break4", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_hide": 1, + "print_width": "50%", + "width": "50%" + }, + { + "fieldname": "other_details", + "fieldtype": "HTML", + "hidden": 1, + "label": "Other Details", + "oldfieldtype": "HTML", + "options": "
Other Details
", + "permlevel": 0, + "print_hide": 1, + "print_width": "30%", + "reqd": 0, + "width": "30%" + }, + { + "description": "Warehouse where you are maintaining stock of rejected items", + "fieldname": "rejected_warehouse", + "fieldtype": "Link", + "label": "Rejected Warehouse", + "no_copy": 1, + "oldfieldname": "rejected_warehouse", + "oldfieldtype": "Link", + "options": "Warehouse", + "permlevel": 0, + "print_hide": 1, + "reqd": 0 + }, + { + "description": "Supplier warehouse where you have issued raw materials for sub - contracting", + "fieldname": "supplier_warehouse", + "fieldtype": "Link", + "label": "Supplier Warehouse", + "no_copy": 1, + "oldfieldname": "supplier_warehouse", + "oldfieldtype": "Link", + "options": "Warehouse", + "permlevel": 0, + "print_hide": 1, + "print_width": "50px", + "width": "50px" + }, + { + "fieldname": "instructions", + "fieldtype": "Small Text", + "label": "Instructions", + "oldfieldname": "instructions", + "oldfieldtype": "Text", + "permlevel": 0 + }, + { + "fieldname": "remarks", + "fieldtype": "Small Text", + "label": "Remarks", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "transporter_info", + "fieldtype": "Section Break", + "label": "Transporter Info", + "options": "icon-truck", + "permlevel": 0 + }, + { + "fieldname": "transporter_name", + "fieldtype": "Data", + "label": "Transporter Name", + "oldfieldname": "transporter_name", + "oldfieldtype": "Data", + "permlevel": 0 + }, + { + "description": "Transporter lorry number", + "fieldname": "lr_no", + "fieldtype": "Data", + "label": "LR No", + "no_copy": 1, + "oldfieldname": "lr_no", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 0, + "print_width": "100px", + "width": "100px" + }, + { + "description": "Date on which lorry started from supplier warehouse", + "fieldname": "lr_date", + "fieldtype": "Date", + "label": "LR Date", + "no_copy": 1, + "oldfieldname": "lr_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 0, + "print_width": "100px", + "width": "100px" + }, + { + "fieldname": "column_break5", + "fieldtype": "Column Break", + "permlevel": 0, + "print_width": "50%", + "width": "50%" + }, + { + "description": "Following table will show values if items are sub - contracted. These values will be fetched from the master of \"Bill of Materials\" of sub - contracted items.", + "fieldname": "raw_material_details", + "fieldtype": "Section Break", + "label": "Raw Materials Supplied", + "oldfieldtype": "Section Break", + "options": "icon-table", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "pr_raw_material_details", + "fieldtype": "Table", + "label": "Purchase Receipt Item Supplieds", + "no_copy": 1, + "oldfieldname": "pr_raw_material_details", + "oldfieldtype": "Table", + "options": "Purchase Receipt Item Supplied", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + } + ], + "icon": "icon-truck", + "idx": 1, + "is_submittable": 1, + "modified": "2014-02-17 12:01:00", + "modified_by": "Administrator", + "module": "Stock", + "name": "Purchase Receipt", + "owner": "Administrator", + "permissions": [ + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material Manager", + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material User", + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase User", + "submit": 1, + "write": 1 + }, + { + "cancel": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Supplier" + } + ], + "read_only_onload": 1, + "search_fields": "status, posting_date, supplier" +} \ No newline at end of file diff --git a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt index cde791178f..f2c69e91c9 100755 --- a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt +++ b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt @@ -1,574 +1,561 @@ -[ - { - "creation": "2013-05-24 19:29:10", - "docstatus": 0, - "modified": "2014-02-28 11:27:09", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "GRND/.#######", - "doctype": "DocType", - "istable": 1, - "module": "Stock", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Purchase Receipt Item", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Purchase Receipt Item" - }, - { - "doctype": "DocField", - "fieldname": "item_code", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "Item Code", - "oldfieldname": "item_code", - "oldfieldtype": "Link", - "options": "Item", - "print_width": "100px", - "read_only": 0, - "reqd": 1, - "search_index": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "item_name", - "fieldtype": "Data", - "in_filter": 0, - "in_list_view": 0, - "label": "Item Name", - "oldfieldname": "item_name", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 0, - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "col_break1", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Text", - "in_list_view": 1, - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Text", - "print_width": "300px", - "read_only": 0, - "reqd": 1, - "width": "300px" - }, - { - "doctype": "DocField", - "fieldname": "received_and_accepted", - "fieldtype": "Section Break", - "in_list_view": 0, - "label": "Received and Accepted" - }, - { - "doctype": "DocField", - "fieldname": "received_qty", - "fieldtype": "Float", - "in_list_view": 0, - "label": "Recd Quantity", - "oldfieldname": "received_qty", - "oldfieldtype": "Currency", - "print_hide": 1, - "print_width": "100px", - "read_only": 0, - "reqd": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "qty", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Accepted Quantity", - "oldfieldname": "qty", - "oldfieldtype": "Currency", - "print_width": "100px", - "read_only": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "rejected_qty", - "fieldtype": "Float", - "in_filter": 0, - "in_list_view": 0, - "label": "Rejected Quantity", - "oldfieldname": "rejected_qty", - "oldfieldtype": "Currency", - "print_hide": 1, - "print_width": "100px", - "read_only": 0, - "search_index": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "col_break2", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "uom", - "fieldtype": "Link", - "in_list_view": 0, - "label": "UOM", - "oldfieldname": "uom", - "oldfieldtype": "Link", - "options": "UOM", - "print_hide": 1, - "print_width": "100px", - "read_only": 0, - "reqd": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "stock_uom", - "fieldtype": "Link", - "in_list_view": 0, - "label": "Stock UOM", - "oldfieldname": "stock_uom", - "oldfieldtype": "Data", - "options": "UOM", - "print_hide": 1, - "print_width": "100px", - "read_only": 1, - "reqd": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "conversion_factor", - "fieldtype": "Float", - "in_list_view": 0, - "label": "Conversion Factor", - "oldfieldname": "conversion_factor", - "oldfieldtype": "Currency", - "print_hide": 1, - "print_width": "100px", - "read_only": 0, - "reqd": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "rate_and_amount", - "fieldtype": "Section Break", - "in_list_view": 0, - "label": "Rate and Amount" - }, - { - "doctype": "DocField", - "fieldname": "price_list_rate", - "fieldtype": "Currency", - "in_list_view": 0, - "label": "Price List Rate", - "options": "currency", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "discount_percentage", - "fieldtype": "Float", - "in_list_view": 0, - "label": "Discount %", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "col_break3", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "base_price_list_rate", - "fieldtype": "Currency", - "in_list_view": 0, - "label": "Price List Rate (Company Currency)", - "options": "Company:company:default_currency", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "sec_break1", - "fieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "rate", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Rate", - "oldfieldname": "import_rate", - "oldfieldtype": "Currency", - "options": "currency", - "print_hide": 0, - "print_width": "100px", - "read_only": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "amount", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Amount", - "oldfieldname": "import_amount", - "oldfieldtype": "Currency", - "options": "currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "col_break4", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "base_rate", - "fieldtype": "Currency", - "in_list_view": 0, - "label": "Rate (Company Currency)", - "oldfieldname": "purchase_rate", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "print_width": "100px", - "read_only": 1, - "reqd": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "base_amount", - "fieldtype": "Currency", - "in_list_view": 0, - "label": "Amount (Company Currency)", - "oldfieldname": "amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "print_width": "100px", - "read_only": 1, - "reqd": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "pricing_rule_for_price", - "fieldtype": "Link", - "label": "Pricing Rule For Price", - "options": "Pricing Rule", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "pricing_rule_for_discount", - "fieldtype": "Link", - "label": "Pricing Rule For Discount", - "options": "Pricing Rule", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "warehouse_and_reference", - "fieldtype": "Section Break", - "in_list_view": 0, - "label": "Warehouse and Reference" - }, - { - "doctype": "DocField", - "fieldname": "warehouse", - "fieldtype": "Link", - "hidden": 0, - "in_list_view": 0, - "label": "Accepted Warehouse", - "oldfieldname": "warehouse", - "oldfieldtype": "Link", - "options": "Warehouse", - "print_hide": 1, - "print_width": "100px", - "read_only": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "rejected_warehouse", - "fieldtype": "Link", - "hidden": 0, - "label": "Rejected Warehouse", - "no_copy": 1, - "oldfieldname": "rejected_warehouse", - "oldfieldtype": "Link", - "options": "Warehouse", - "print_hide": 1, - "print_width": "100px", - "read_only": 0, - "width": "100px" - }, - { - "default": ":Company", - "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)", - "doctype": "DocField", - "fieldname": "cost_center", - "fieldtype": "Link", - "label": "Cost Center", - "options": "Cost Center", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "project_name", - "fieldtype": "Link", - "in_filter": 1, - "label": "Project Name", - "options": "Project", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "qa_no", - "fieldtype": "Link", - "label": "Quality Inspection", - "no_copy": 1, - "oldfieldname": "qa_no", - "oldfieldtype": "Link", - "options": "Quality Inspection", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "schedule_date", - "fieldtype": "Date", - "label": "Required By", - "no_copy": 0, - "oldfieldname": "schedule_date", - "oldfieldtype": "Date", - "print_hide": 1, - "read_only": 1, - "report_hide": 0, - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "stock_qty", - "fieldtype": "Float", - "label": "Qty as per Stock UOM", - "oldfieldname": "stock_qty", - "oldfieldtype": "Currency", - "print_hide": 1, - "print_width": "100px", - "read_only": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "prevdoc_doctype", - "fieldtype": "Data", - "hidden": 1, - "label": "Prevdoc Doctype", - "no_copy": 1, - "oldfieldname": "prevdoc_doctype", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "prevdoc_docname", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 1, - "label": "Purchase Order", - "no_copy": 1, - "oldfieldname": "prevdoc_docname", - "oldfieldtype": "Link", - "options": "Purchase Order", - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "reqd": 0, - "search_index": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "prevdoc_detail_docname", - "fieldtype": "Data", - "hidden": 1, - "in_filter": 1, - "label": "Purchase Order Item No", - "no_copy": 1, - "oldfieldname": "prevdoc_detail_docname", - "oldfieldtype": "Data", - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "search_index": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "col_break5", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "serial_no", - "fieldtype": "Text", - "in_filter": 1, - "in_list_view": 1, - "label": "Serial No", - "no_copy": 1, - "oldfieldname": "serial_no", - "oldfieldtype": "Text", - "print_hide": 0, - "read_only": 0, - "report_hide": 0 - }, - { - "doctype": "DocField", - "fieldname": "rejected_serial_no", - "fieldtype": "Text", - "label": "Rejected Serial No", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "batch_no", - "fieldtype": "Link", - "label": "Batch No", - "oldfieldname": "batch_no", - "oldfieldtype": "Link", - "options": "Batch", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "brand", - "fieldtype": "Link", - "hidden": 1, - "label": "Brand", - "oldfieldname": "brand", - "oldfieldtype": "Link", - "options": "Brand", - "print_hide": 1, - "read_only": 1 - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "item_group", - "fieldtype": "Link", - "hidden": 1, - "in_filter": 1, - "label": "Item Group", - "oldfieldname": "item_group", - "oldfieldtype": "Link", - "options": "Item Group", - "print_hide": 1, - "read_only": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "rm_supp_cost", - "fieldtype": "Currency", - "hidden": 1, - "in_filter": 0, - "label": "Raw Materials Supplied Cost", - "no_copy": 1, - "oldfieldname": "rm_supp_cost", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "item_tax_amount", - "fieldtype": "Currency", - "hidden": 1, - "label": "Item Tax Amount", - "no_copy": 1, - "oldfieldname": "item_tax_amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "reqd": 0, - "search_index": 0, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "valuation_rate", - "fieldtype": "Currency", - "hidden": 1, - "in_filter": 0, - "label": "Valuation Rate", - "no_copy": 1, - "oldfieldname": "valuation_rate", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_hide": 1, - "print_width": "80px", - "read_only": 1, - "width": "80px" - }, - { - "description": "Tax detail table fetched from item master as a string and stored in this field.\nUsed for Taxes and Charges", - "doctype": "DocField", - "fieldname": "item_tax_rate", - "fieldtype": "Small Text", - "hidden": 1, - "in_filter": 0, - "label": "Item Tax Rate", - "oldfieldname": "item_tax_rate", - "oldfieldtype": "Small Text", - "print_hide": 1, - "read_only": 1, - "report_hide": 1 - }, - { - "allow_on_submit": 1, - "doctype": "DocField", - "fieldname": "page_break", - "fieldtype": "Check", - "label": "Page Break", - "oldfieldname": "page_break", - "oldfieldtype": "Check", - "print_hide": 1, - "read_only": 0 - } -] \ No newline at end of file +{ + "autoname": "GRND/.#######", + "creation": "2013-05-24 19:29:10", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "item_code", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Item Code", + "oldfieldname": "item_code", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0, + "print_width": "100px", + "read_only": 0, + "reqd": 1, + "search_index": 1, + "width": "100px" + }, + { + "fieldname": "item_name", + "fieldtype": "Data", + "in_filter": 0, + "in_list_view": 0, + "label": "Item Name", + "oldfieldname": "item_name", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "col_break1", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "description", + "fieldtype": "Text", + "in_list_view": 1, + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Text", + "permlevel": 0, + "print_width": "300px", + "read_only": 0, + "reqd": 1, + "width": "300px" + }, + { + "fieldname": "received_and_accepted", + "fieldtype": "Section Break", + "in_list_view": 0, + "label": "Received and Accepted", + "permlevel": 0 + }, + { + "fieldname": "received_qty", + "fieldtype": "Float", + "in_list_view": 0, + "label": "Recd Quantity", + "oldfieldname": "received_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 0, + "reqd": 1, + "width": "100px" + }, + { + "fieldname": "qty", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Accepted Quantity", + "oldfieldname": "qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_width": "100px", + "read_only": 0, + "width": "100px" + }, + { + "fieldname": "rejected_qty", + "fieldtype": "Float", + "in_filter": 0, + "in_list_view": 0, + "label": "Rejected Quantity", + "oldfieldname": "rejected_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 0, + "search_index": 0, + "width": "100px" + }, + { + "fieldname": "col_break2", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "uom", + "fieldtype": "Link", + "in_list_view": 0, + "label": "UOM", + "oldfieldname": "uom", + "oldfieldtype": "Link", + "options": "UOM", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 0, + "reqd": 1, + "width": "100px" + }, + { + "fieldname": "stock_uom", + "fieldtype": "Link", + "in_list_view": 0, + "label": "Stock UOM", + "oldfieldname": "stock_uom", + "oldfieldtype": "Data", + "options": "UOM", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 1, + "reqd": 1, + "width": "100px" + }, + { + "fieldname": "conversion_factor", + "fieldtype": "Float", + "in_list_view": 0, + "label": "Conversion Factor", + "oldfieldname": "conversion_factor", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 0, + "reqd": 1, + "width": "100px" + }, + { + "fieldname": "rate_and_amount", + "fieldtype": "Section Break", + "in_list_view": 0, + "label": "Rate and Amount", + "permlevel": 0 + }, + { + "fieldname": "price_list_rate", + "fieldtype": "Currency", + "in_list_view": 0, + "label": "Price List Rate", + "options": "currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "discount_percentage", + "fieldtype": "Float", + "in_list_view": 0, + "label": "Discount %", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "col_break3", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "base_price_list_rate", + "fieldtype": "Currency", + "in_list_view": 0, + "label": "Price List Rate (Company Currency)", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "sec_break1", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "rate", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Rate", + "oldfieldname": "import_rate", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "print_hide": 0, + "print_width": "100px", + "read_only": 0, + "width": "100px" + }, + { + "fieldname": "amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Amount", + "oldfieldname": "import_amount", + "oldfieldtype": "Currency", + "options": "currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "col_break4", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "base_rate", + "fieldtype": "Currency", + "in_list_view": 0, + "label": "Rate (Company Currency)", + "oldfieldname": "purchase_rate", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 1, + "reqd": 1, + "width": "100px" + }, + { + "fieldname": "base_amount", + "fieldtype": "Currency", + "in_list_view": 0, + "label": "Amount (Company Currency)", + "oldfieldname": "amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 1, + "reqd": 0, + "width": "100px" + }, + { + "fieldname": "pricing_rule_for_price", + "fieldtype": "Link", + "label": "Pricing Rule For Price", + "options": "Pricing Rule", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "pricing_rule_for_discount", + "fieldtype": "Link", + "label": "Pricing Rule For Discount", + "options": "Pricing Rule", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "warehouse_and_reference", + "fieldtype": "Section Break", + "in_list_view": 0, + "label": "Warehouse and Reference", + "permlevel": 0 + }, + { + "fieldname": "warehouse", + "fieldtype": "Link", + "hidden": 0, + "in_list_view": 0, + "label": "Accepted Warehouse", + "oldfieldname": "warehouse", + "oldfieldtype": "Link", + "options": "Warehouse", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 0, + "width": "100px" + }, + { + "fieldname": "rejected_warehouse", + "fieldtype": "Link", + "hidden": 0, + "label": "Rejected Warehouse", + "no_copy": 1, + "oldfieldname": "rejected_warehouse", + "oldfieldtype": "Link", + "options": "Warehouse", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 0, + "width": "100px" + }, + { + "default": ":Company", + "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)", + "fieldname": "cost_center", + "fieldtype": "Link", + "label": "Cost Center", + "options": "Cost Center", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "project_name", + "fieldtype": "Link", + "in_filter": 1, + "label": "Project Name", + "options": "Project", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "qa_no", + "fieldtype": "Link", + "label": "Quality Inspection", + "no_copy": 1, + "oldfieldname": "qa_no", + "oldfieldtype": "Link", + "options": "Quality Inspection", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "schedule_date", + "fieldtype": "Date", + "label": "Required By", + "no_copy": 0, + "oldfieldname": "schedule_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "report_hide": 0, + "reqd": 0 + }, + { + "fieldname": "stock_qty", + "fieldtype": "Float", + "label": "Qty as per Stock UOM", + "oldfieldname": "stock_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "100px", + "read_only": 1, + "width": "100px" + }, + { + "fieldname": "prevdoc_doctype", + "fieldtype": "Data", + "hidden": 1, + "label": "Prevdoc Doctype", + "no_copy": 1, + "oldfieldname": "prevdoc_doctype", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "prevdoc_docname", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 1, + "label": "Purchase Order", + "no_copy": 1, + "oldfieldname": "prevdoc_docname", + "oldfieldtype": "Link", + "options": "Purchase Order", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 1, + "reqd": 0, + "search_index": 1, + "width": "150px" + }, + { + "fieldname": "prevdoc_detail_docname", + "fieldtype": "Data", + "hidden": 1, + "in_filter": 1, + "label": "Purchase Order Item No", + "no_copy": 1, + "oldfieldname": "prevdoc_detail_docname", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 1, + "search_index": 1, + "width": "150px" + }, + { + "fieldname": "col_break5", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "serial_no", + "fieldtype": "Text", + "in_filter": 1, + "in_list_view": 1, + "label": "Serial No", + "no_copy": 1, + "oldfieldname": "serial_no", + "oldfieldtype": "Text", + "permlevel": 0, + "print_hide": 0, + "read_only": 0, + "report_hide": 0 + }, + { + "fieldname": "rejected_serial_no", + "fieldtype": "Text", + "label": "Rejected Serial No", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "batch_no", + "fieldtype": "Link", + "label": "Batch No", + "oldfieldname": "batch_no", + "oldfieldtype": "Link", + "options": "Batch", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "brand", + "fieldtype": "Link", + "hidden": 1, + "label": "Brand", + "oldfieldname": "brand", + "oldfieldtype": "Link", + "options": "Brand", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "description": "Add / Edit", + "fieldname": "item_group", + "fieldtype": "Link", + "hidden": 1, + "in_filter": 1, + "label": "Item Group", + "oldfieldname": "item_group", + "oldfieldtype": "Link", + "options": "Item Group", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "search_index": 1 + }, + { + "fieldname": "rm_supp_cost", + "fieldtype": "Currency", + "hidden": 1, + "in_filter": 0, + "label": "Raw Materials Supplied Cost", + "no_copy": 1, + "oldfieldname": "rm_supp_cost", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 1, + "width": "150px" + }, + { + "fieldname": "item_tax_amount", + "fieldtype": "Currency", + "hidden": 1, + "label": "Item Tax Amount", + "no_copy": 1, + "oldfieldname": "item_tax_amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 1, + "reqd": 0, + "search_index": 0, + "width": "150px" + }, + { + "fieldname": "valuation_rate", + "fieldtype": "Currency", + "hidden": 1, + "in_filter": 0, + "label": "Valuation Rate", + "no_copy": 1, + "oldfieldname": "valuation_rate", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_hide": 1, + "print_width": "80px", + "read_only": 1, + "width": "80px" + }, + { + "description": "Tax detail table fetched from item master as a string and stored in this field.\nUsed for Taxes and Charges", + "fieldname": "item_tax_rate", + "fieldtype": "Small Text", + "hidden": 1, + "in_filter": 0, + "label": "Item Tax Rate", + "oldfieldname": "item_tax_rate", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "report_hide": 1 + }, + { + "allow_on_submit": 1, + "fieldname": "page_break", + "fieldtype": "Check", + "label": "Page Break", + "oldfieldname": "page_break", + "oldfieldtype": "Check", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + } + ], + "idx": 1, + "istable": 1, + "modified": "2014-02-28 11:27:09", + "modified_by": "Administrator", + "module": "Stock", + "name": "Purchase Receipt Item", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/stock/doctype/serial_no/serial_no.txt b/erpnext/stock/doctype/serial_no/serial_no.txt index 3588493a20..cb1b5ad556 100644 --- a/erpnext/stock/doctype/serial_no/serial_no.txt +++ b/erpnext/stock/doctype/serial_no/serial_no.txt @@ -1,477 +1,470 @@ -[ - { - "creation": "2013-05-16 10:59:15", - "docstatus": 0, - "modified": "2014-01-20 17:49:26", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_attach": 1, - "allow_import": 1, - "allow_rename": 1, - "autoname": "field:serial_no", - "description": "Distinct unit of an Item", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-barcode", - "in_create": 0, - "module": "Stock", - "name": "__common__", - "search_fields": "item_code,status" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Serial No", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "cancel": 0, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Serial No", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 0 - }, - { - "doctype": "DocType", - "name": "Serial No" - }, - { - "doctype": "DocField", - "fieldname": "details", - "fieldtype": "Section Break", - "label": "Details", - "oldfieldtype": "Section Break", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "read_only": 0 - }, - { - "default": "In Store", - "description": "Only Serial Nos with status \"Available\" can be delivered.", - "doctype": "DocField", - "fieldname": "status", - "fieldtype": "Select", - "in_filter": 1, - "in_list_view": 1, - "label": "Status", - "no_copy": 1, - "oldfieldname": "status", - "oldfieldtype": "Select", - "options": "\nAvailable\nNot Available\nDelivered\nPurchase Returned\nSales Returned", - "read_only": 0, - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "serial_no", - "fieldtype": "Data", - "in_filter": 0, - "label": "Serial No", - "no_copy": 1, - "oldfieldname": "serial_no", - "oldfieldtype": "Data", - "read_only": 0, - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "item_code", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "Item Code", - "oldfieldname": "item_code", - "oldfieldtype": "Link", - "options": "Item", - "read_only": 0, - "reqd": 1, - "search_index": 0 - }, - { - "description": "Warehouse can only be changed via Stock Entry / Delivery Note / Purchase Receipt", - "doctype": "DocField", - "fieldname": "warehouse", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "Warehouse", - "no_copy": 1, - "oldfieldname": "warehouse", - "oldfieldtype": "Link", - "options": "Warehouse", - "read_only": 1, - "reqd": 0, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "item_name", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Item Name", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Text", - "in_filter": 1, - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Text", - "read_only": 1, - "search_index": 0, - "width": "300px" - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "item_group", - "fieldtype": "Link", - "in_filter": 0, - "label": "Item Group", - "oldfieldname": "item_group", - "oldfieldtype": "Link", - "options": "Item Group", - "read_only": 1, - "reqd": 0, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "brand", - "fieldtype": "Link", - "in_filter": 0, - "label": "Brand", - "oldfieldname": "brand", - "oldfieldtype": "Link", - "options": "Brand", - "read_only": 1, - "reqd": 0, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "purchase_details", - "fieldtype": "Section Break", - "label": "Purchase / Manufacture Details", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break2", - "fieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "purchase_document_type", - "fieldtype": "Select", - "label": "Creation Document Type", - "no_copy": 1, - "options": "\nPurchase Receipt\nStock Entry", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "purchase_document_no", - "fieldtype": "Data", - "hidden": 0, - "label": "Creation Document No", - "no_copy": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "purchase_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Creation Date", - "no_copy": 1, - "oldfieldname": "purchase_date", - "oldfieldtype": "Date", - "read_only": 1, - "reqd": 0, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "purchase_time", - "fieldtype": "Time", - "label": "Creation Time", - "no_copy": 1, - "read_only": 1, - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "purchase_rate", - "fieldtype": "Currency", - "in_filter": 0, - "label": "Incoming Rate", - "no_copy": 1, - "oldfieldname": "purchase_rate", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "read_only": 1, - "reqd": 0, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break3", - "fieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "supplier", - "fieldtype": "Link", - "in_filter": 1, - "label": "Supplier", - "no_copy": 1, - "options": "Supplier", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "supplier_name", - "fieldtype": "Data", - "in_filter": 1, - "label": "Supplier Name", - "no_copy": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "delivery_details", - "fieldtype": "Section Break", - "label": "Delivery Details", - "oldfieldtype": "Column Break", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "delivery_document_type", - "fieldtype": "Select", - "in_filter": 1, - "label": "Delivery Document Type", - "no_copy": 1, - "options": "\nDelivery Note\nSales Invoice\nStock Entry", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "delivery_document_no", - "fieldtype": "Data", - "in_filter": 1, - "label": "Delivery Document No", - "no_copy": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "delivery_date", - "fieldtype": "Date", - "label": "Delivery Date", - "no_copy": 1, - "oldfieldname": "delivery_date", - "oldfieldtype": "Date", - "read_only": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "delivery_time", - "fieldtype": "Time", - "label": "Delivery Time", - "no_copy": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "is_cancelled", - "fieldtype": "Select", - "hidden": 1, - "label": "Is Cancelled", - "oldfieldname": "is_cancelled", - "oldfieldtype": "Select", - "options": "\nYes\nNo", - "read_only": 0, - "report_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break5", - "fieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "customer", - "fieldtype": "Link", - "in_filter": 1, - "label": "Customer", - "no_copy": 1, - "oldfieldname": "customer", - "oldfieldtype": "Link", - "options": "Customer", - "print_hide": 1, - "read_only": 0, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "customer_name", - "fieldtype": "Data", - "in_filter": 1, - "label": "Customer Name", - "no_copy": 1, - "oldfieldname": "customer_name", - "oldfieldtype": "Data", - "read_only": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "warranty_amc_details", - "fieldtype": "Section Break", - "label": "Warranty / AMC Details", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break6", - "fieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "maintenance_status", - "fieldtype": "Select", - "in_filter": 1, - "label": "Maintenance Status", - "no_copy": 0, - "oldfieldname": "maintenance_status", - "oldfieldtype": "Select", - "options": "\nUnder Warranty\nOut of Warranty\nUnder AMC\nOut of AMC", - "read_only": 0, - "search_index": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "warranty_period", - "fieldtype": "Int", - "label": "Warranty Period (Days)", - "oldfieldname": "warranty_period", - "oldfieldtype": "Int", - "read_only": 0, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "column_break7", - "fieldtype": "Column Break", - "read_only": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "warranty_expiry_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Warranty Expiry Date", - "oldfieldname": "warranty_expiry_date", - "oldfieldtype": "Date", - "read_only": 0, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "amc_expiry_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "AMC Expiry Date", - "oldfieldname": "amc_expiry_date", - "oldfieldtype": "Date", - "read_only": 0, - "search_index": 0, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "more_info", - "fieldtype": "Section Break", - "label": "More Info", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "serial_no_details", - "fieldtype": "Text Editor", - "label": "Serial No Details", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Select", - "in_filter": 1, - "label": "Company", - "options": "link:Company", - "read_only": 1, - "reqd": 1, - "search_index": 1 - }, - { - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Material Master Manager", - "write": 1 - }, - { - "amend": 0, - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Material Manager", - "write": 0 - }, - { - "amend": 0, - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Material User", - "write": 0 - } -] \ No newline at end of file +{ + "allow_attach": 1, + "allow_import": 1, + "allow_rename": 1, + "autoname": "field:serial_no", + "creation": "2013-05-16 10:59:15", + "description": "Distinct unit of an Item", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "details", + "fieldtype": "Section Break", + "label": "Details", + "oldfieldtype": "Section Break", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0 + }, + { + "default": "In Store", + "description": "Only Serial Nos with status \"Available\" can be delivered.", + "fieldname": "status", + "fieldtype": "Select", + "in_filter": 1, + "in_list_view": 1, + "label": "Status", + "no_copy": 1, + "oldfieldname": "status", + "oldfieldtype": "Select", + "options": "\nAvailable\nNot Available\nDelivered\nPurchase Returned\nSales Returned", + "permlevel": 0, + "read_only": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "serial_no", + "fieldtype": "Data", + "in_filter": 0, + "label": "Serial No", + "no_copy": 1, + "oldfieldname": "serial_no", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "item_code", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Item Code", + "oldfieldname": "item_code", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0, + "read_only": 0, + "reqd": 1, + "search_index": 0 + }, + { + "description": "Warehouse can only be changed via Stock Entry / Delivery Note / Purchase Receipt", + "fieldname": "warehouse", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Warehouse", + "no_copy": 1, + "oldfieldname": "warehouse", + "oldfieldtype": "Link", + "options": "Warehouse", + "permlevel": 0, + "read_only": 1, + "reqd": 0, + "search_index": 1 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "item_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Item Name", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "description", + "fieldtype": "Text", + "in_filter": 1, + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Text", + "permlevel": 0, + "read_only": 1, + "search_index": 0, + "width": "300px" + }, + { + "description": "Add / Edit", + "fieldname": "item_group", + "fieldtype": "Link", + "in_filter": 0, + "label": "Item Group", + "oldfieldname": "item_group", + "oldfieldtype": "Link", + "options": "Item Group", + "permlevel": 0, + "read_only": 1, + "reqd": 0, + "search_index": 0 + }, + { + "fieldname": "brand", + "fieldtype": "Link", + "in_filter": 0, + "label": "Brand", + "oldfieldname": "brand", + "oldfieldtype": "Link", + "options": "Brand", + "permlevel": 0, + "read_only": 1, + "reqd": 0, + "search_index": 0 + }, + { + "fieldname": "purchase_details", + "fieldtype": "Section Break", + "label": "Purchase / Manufacture Details", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "column_break2", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "purchase_document_type", + "fieldtype": "Select", + "label": "Creation Document Type", + "no_copy": 1, + "options": "\nPurchase Receipt\nStock Entry", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "purchase_document_no", + "fieldtype": "Data", + "hidden": 0, + "label": "Creation Document No", + "no_copy": 1, + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "purchase_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Creation Date", + "no_copy": 1, + "oldfieldname": "purchase_date", + "oldfieldtype": "Date", + "permlevel": 0, + "read_only": 1, + "reqd": 0, + "search_index": 0 + }, + { + "fieldname": "purchase_time", + "fieldtype": "Time", + "label": "Creation Time", + "no_copy": 1, + "permlevel": 0, + "read_only": 1, + "reqd": 0 + }, + { + "fieldname": "purchase_rate", + "fieldtype": "Currency", + "in_filter": 0, + "label": "Incoming Rate", + "no_copy": 1, + "oldfieldname": "purchase_rate", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1, + "reqd": 0, + "search_index": 0 + }, + { + "fieldname": "column_break3", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "supplier", + "fieldtype": "Link", + "in_filter": 1, + "label": "Supplier", + "no_copy": 1, + "options": "Supplier", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "supplier_name", + "fieldtype": "Data", + "in_filter": 1, + "label": "Supplier Name", + "no_copy": 1, + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "delivery_details", + "fieldtype": "Section Break", + "label": "Delivery Details", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "delivery_document_type", + "fieldtype": "Select", + "in_filter": 1, + "label": "Delivery Document Type", + "no_copy": 1, + "options": "\nDelivery Note\nSales Invoice\nStock Entry", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "delivery_document_no", + "fieldtype": "Data", + "in_filter": 1, + "label": "Delivery Document No", + "no_copy": 1, + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "delivery_date", + "fieldtype": "Date", + "label": "Delivery Date", + "no_copy": 1, + "oldfieldname": "delivery_date", + "oldfieldtype": "Date", + "permlevel": 0, + "read_only": 1, + "search_index": 0 + }, + { + "fieldname": "delivery_time", + "fieldtype": "Time", + "label": "Delivery Time", + "no_copy": 1, + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "is_cancelled", + "fieldtype": "Select", + "hidden": 1, + "label": "Is Cancelled", + "oldfieldname": "is_cancelled", + "oldfieldtype": "Select", + "options": "\nYes\nNo", + "permlevel": 0, + "read_only": 0, + "report_hide": 1 + }, + { + "fieldname": "column_break5", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "customer", + "fieldtype": "Link", + "in_filter": 1, + "label": "Customer", + "no_copy": 1, + "oldfieldname": "customer", + "oldfieldtype": "Link", + "options": "Customer", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "search_index": 0 + }, + { + "fieldname": "customer_name", + "fieldtype": "Data", + "in_filter": 1, + "label": "Customer Name", + "no_copy": 1, + "oldfieldname": "customer_name", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1, + "search_index": 0 + }, + { + "fieldname": "warranty_amc_details", + "fieldtype": "Section Break", + "label": "Warranty / AMC Details", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "column_break6", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "maintenance_status", + "fieldtype": "Select", + "in_filter": 1, + "label": "Maintenance Status", + "no_copy": 0, + "oldfieldname": "maintenance_status", + "oldfieldtype": "Select", + "options": "\nUnder Warranty\nOut of Warranty\nUnder AMC\nOut of AMC", + "permlevel": 0, + "read_only": 0, + "search_index": 1, + "width": "150px" + }, + { + "fieldname": "warranty_period", + "fieldtype": "Int", + "label": "Warranty Period (Days)", + "oldfieldname": "warranty_period", + "oldfieldtype": "Int", + "permlevel": 0, + "read_only": 0, + "width": "150px" + }, + { + "fieldname": "column_break7", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "warranty_expiry_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Warranty Expiry Date", + "oldfieldname": "warranty_expiry_date", + "oldfieldtype": "Date", + "permlevel": 0, + "read_only": 0, + "width": "150px" + }, + { + "fieldname": "amc_expiry_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "AMC Expiry Date", + "oldfieldname": "amc_expiry_date", + "oldfieldtype": "Date", + "permlevel": 0, + "read_only": 0, + "search_index": 0, + "width": "150px" + }, + { + "fieldname": "more_info", + "fieldtype": "Section Break", + "label": "More Info", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "serial_no_details", + "fieldtype": "Text Editor", + "label": "Serial No Details", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "company", + "fieldtype": "Select", + "in_filter": 1, + "label": "Company", + "options": "link:Company", + "permlevel": 0, + "read_only": 1, + "reqd": 1, + "search_index": 1 + } + ], + "icon": "icon-barcode", + "idx": 1, + "in_create": 0, + "modified": "2014-01-20 17:49:26", + "modified_by": "Administrator", + "module": "Stock", + "name": "Serial No", + "owner": "Administrator", + "permissions": [ + { + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material Master Manager", + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material Manager", + "submit": 0, + "write": 0 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material User", + "submit": 0, + "write": 0 + } + ], + "search_fields": "item_code,status" +} \ No newline at end of file diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.txt b/erpnext/stock/doctype/stock_entry/stock_entry.txt index a8cf16b078..ef537e0353 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.txt +++ b/erpnext/stock/doctype/stock_entry/stock_entry.txt @@ -1,638 +1,649 @@ -[ - { - "creation": "2013-04-09 11:43:55", - "docstatus": 0, - "modified": "2014-02-26 10:59:19", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_attach": 0, - "allow_copy": 0, - "allow_import": 1, - "allow_rename": 0, - "autoname": "naming_series:", - "doctype": "DocType", - "hide_heading": 0, - "hide_toolbar": 0, - "icon": "icon-file-text", - "in_create": 0, - "in_dialog": 0, - "is_submittable": 1, - "issingle": 0, - "max_attachments": 0, - "module": "Stock", - "name": "__common__", - "read_only": 0, - "read_only_onload": 0, - "search_fields": "transfer_date, from_warehouse, to_warehouse, purpose, remarks" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Stock Entry", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Stock Entry", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 1, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Stock Entry" - }, - { - "doctype": "DocField", - "fieldname": "col1", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "print_width": "50%", - "read_only": 0, - "width": "50%" - }, - { - "allow_on_submit": 0, - "doctype": "DocField", - "fieldname": "naming_series", - "fieldtype": "Select", - "hidden": 0, - "in_filter": 0, - "label": "Series", - "no_copy": 1, - "oldfieldname": "naming_series", - "oldfieldtype": "Select", - "options": "\nSTE", - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0 - }, - { - "allow_on_submit": 0, - "default": "Material Issue", - "doctype": "DocField", - "fieldname": "purpose", - "fieldtype": "Select", - "hidden": 0, - "in_filter": 1, - "in_list_view": 1, - "label": "Purpose", - "no_copy": 0, - "oldfieldname": "purpose", - "oldfieldtype": "Select", - "options": "Material Issue\nMaterial Receipt\nMaterial Transfer\nManufacture/Repack\nSubcontract\nSales Return\nPurchase Return", - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0 - }, - { - "allow_on_submit": 0, - "depends_on": "eval:doc.purpose==\"Sales Return\"", - "doctype": "DocField", - "fieldname": "delivery_note_no", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 0, - "label": "Delivery Note No", - "no_copy": 1, - "oldfieldname": "delivery_note_no", - "oldfieldtype": "Link", - "options": "Delivery Note", - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 1 - }, - { - "depends_on": "eval:doc.purpose==\"Sales Return\"", - "doctype": "DocField", - "fieldname": "sales_invoice_no", - "fieldtype": "Link", - "hidden": 0, - "label": "Sales Invoice No", - "no_copy": 1, - "options": "Sales Invoice", - "print_hide": 1, - "read_only": 0 - }, - { - "allow_on_submit": 0, - "depends_on": "eval:doc.purpose==\"Purchase Return\"", - "doctype": "DocField", - "fieldname": "purchase_receipt_no", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 0, - "label": "Purchase Receipt No", - "no_copy": 1, - "oldfieldname": "purchase_receipt_no", - "oldfieldtype": "Link", - "options": "Purchase Receipt", - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "col2", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "print_width": "50%", - "read_only": 0, - "width": "50%" - }, - { - "allow_on_submit": 0, - "default": "Today", - "doctype": "DocField", - "fieldname": "posting_date", - "fieldtype": "Date", - "hidden": 0, - "in_filter": 1, - "in_list_view": 0, - "label": "Posting Date", - "no_copy": 1, - "oldfieldname": "posting_date", - "oldfieldtype": "Date", - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 1 - }, - { - "allow_on_submit": 0, - "doctype": "DocField", - "fieldname": "posting_time", - "fieldtype": "Time", - "hidden": 0, - "in_filter": 0, - "label": "Posting Time", - "no_copy": 1, - "oldfieldname": "posting_time", - "oldfieldtype": "Time", - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "items_section", - "fieldtype": "Section Break", - "label": "Items", - "oldfieldtype": "Section Break", - "read_only": 0 - }, - { - "allow_on_submit": 0, - "doctype": "DocField", - "fieldname": "from_warehouse", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 0, - "in_list_view": 1, - "label": "Default Source Warehouse", - "no_copy": 1, - "oldfieldname": "from_warehouse", - "oldfieldtype": "Link", - "options": "Warehouse", - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "cb0", - "fieldtype": "Column Break", - "read_only": 0 - }, - { - "allow_on_submit": 0, - "doctype": "DocField", - "fieldname": "to_warehouse", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 0, - "in_list_view": 1, - "label": "Default Target Warehouse", - "no_copy": 1, - "oldfieldname": "to_warehouse", - "oldfieldtype": "Link", - "options": "Warehouse", - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "sb0", - "fieldtype": "Section Break", - "options": "Simple", - "read_only": 0 - }, - { - "allow_on_submit": 0, - "doctype": "DocField", - "fieldname": "mtn_details", - "fieldtype": "Table", - "hidden": 0, - "in_filter": 0, - "label": "MTN Details", - "no_copy": 0, - "oldfieldname": "mtn_details", - "oldfieldtype": "Table", - "options": "Stock Entry Detail", - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0 - }, - { - "description": "Get valuation rate and available stock at source/target warehouse on mentioned posting date-time. If serialized item, please press this button after entering serial nos.", - "doctype": "DocField", - "fieldname": "get_stock_and_rate", - "fieldtype": "Button", - "label": "Get Stock and Rate", - "oldfieldtype": "Button", - "options": "get_stock_and_rate", - "print_hide": 1, - "read_only": 0 - }, - { - "depends_on": "eval:(doc.purpose!==\"Sales Return\" && doc.purpose!==\"Purchase Return\")", - "doctype": "DocField", - "fieldname": "sb1", - "fieldtype": "Section Break", - "label": "From Bill of Materials", - "read_only": 0 - }, - { - "allow_on_submit": 0, - "depends_on": "eval:inList([\"Material Transfer\", \"Manufacture/Repack\"], doc.purpose)", - "doctype": "DocField", - "fieldname": "production_order", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 1, - "label": "Production Order", - "no_copy": 0, - "oldfieldname": "production_order", - "oldfieldtype": "Link", - "options": "Production Order", - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 1 - }, - { - "depends_on": "eval:!inList([\"Sales Return\", \"Purchase Return\"], doc.purpose)", - "doctype": "DocField", - "fieldname": "bom_no", - "fieldtype": "Link", - "label": "BOM No", - "options": "BOM", - "read_only": 0 - }, - { - "allow_on_submit": 0, - "depends_on": "eval:!inList([\"Sales Return\", \"Purchase Return\"], doc.purpose)", - "description": "As per Stock UOM", - "doctype": "DocField", - "fieldname": "fg_completed_qty", - "fieldtype": "Float", - "hidden": 0, - "in_filter": 0, - "label": "Manufacturing Quantity", - "no_copy": 0, - "oldfieldname": "fg_completed_qty", - "oldfieldtype": "Currency", - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "cb1", - "fieldtype": "Column Break", - "read_only": 0 - }, - { - "default": "1", - "depends_on": "eval:!inList([\"Sales Return\", \"Purchase Return\"], doc.purpose)", - "description": "If checked, BOM for sub-assembly items will be considered for getting raw materials. Otherwise, all sub-assembly items will be treated as a raw material.", - "doctype": "DocField", - "fieldname": "use_multi_level_bom", - "fieldtype": "Check", - "label": "Use Multi-Level BOM", - "read_only": 0 - }, - { - "allow_on_submit": 0, - "depends_on": "eval:!inList([\"Sales Return\", \"Purchase Return\"], doc.purpose)", - "doctype": "DocField", - "fieldname": "get_items", - "fieldtype": "Button", - "hidden": 0, - "in_filter": 0, - "label": "Get Items", - "no_copy": 0, - "oldfieldtype": "Button", - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0 - }, - { - "depends_on": "eval:(doc.purpose==\"Sales Return\" || doc.purpose==\"Purchase Return\")", - "doctype": "DocField", - "fieldname": "contact_section", - "fieldtype": "Section Break", - "label": "Contact Info", - "read_only": 0 - }, - { - "allow_on_submit": 0, - "depends_on": "eval:doc.purpose==\"Purchase Return\"", - "doctype": "DocField", - "fieldname": "supplier", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 0, - "label": "Supplier", - "no_copy": 1, - "oldfieldname": "supplier", - "oldfieldtype": "Link", - "options": "Supplier", - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0 - }, - { - "allow_on_submit": 0, - "depends_on": "eval:doc.purpose==\"Purchase Return\"", - "doctype": "DocField", - "fieldname": "supplier_name", - "fieldtype": "Data", - "hidden": 0, - "in_filter": 0, - "label": "Supplier Name", - "no_copy": 1, - "oldfieldname": "supplier_name", - "oldfieldtype": "Data", - "print_hide": 0, - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0 - }, - { - "allow_on_submit": 0, - "depends_on": "eval:doc.purpose==\"Purchase Return\"", - "doctype": "DocField", - "fieldname": "supplier_address", - "fieldtype": "Small Text", - "hidden": 0, - "in_filter": 0, - "label": "Supplier Address", - "no_copy": 1, - "oldfieldname": "supplier_address", - "oldfieldtype": "Small Text", - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0 - }, - { - "allow_on_submit": 0, - "depends_on": "eval:doc.purpose==\"Sales Return\"", - "doctype": "DocField", - "fieldname": "customer", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 0, - "label": "Customer", - "no_copy": 1, - "oldfieldname": "customer", - "oldfieldtype": "Link", - "options": "Customer", - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0 - }, - { - "allow_on_submit": 0, - "depends_on": "eval:doc.purpose==\"Sales Return\"", - "doctype": "DocField", - "fieldname": "customer_name", - "fieldtype": "Data", - "hidden": 0, - "in_filter": 0, - "label": "Customer Name", - "no_copy": 1, - "oldfieldname": "customer_name", - "oldfieldtype": "Data", - "print_hide": 0, - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0 - }, - { - "allow_on_submit": 0, - "depends_on": "eval:doc.purpose==\"Sales Return\"", - "doctype": "DocField", - "fieldname": "customer_address", - "fieldtype": "Small Text", - "hidden": 0, - "in_filter": 0, - "label": "Customer Address", - "no_copy": 1, - "oldfieldname": "customer_address", - "oldfieldtype": "Small Text", - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "more_info", - "fieldtype": "Section Break", - "label": "More Info", - "oldfieldtype": "Section Break", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "col4", - "fieldtype": "Column Break", - "print_width": "50%", - "read_only": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "total_amount", - "fieldtype": "Currency", - "label": "Total Amount", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "project_name", - "fieldtype": "Link", - "in_filter": 1, - "label": "Project Name", - "oldfieldname": "project_name", - "oldfieldtype": "Link", - "options": "Project", - "read_only": 0 - }, - { - "allow_on_submit": 0, - "doctype": "DocField", - "fieldname": "select_print_heading", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 0, - "label": "Print Heading", - "no_copy": 0, - "oldfieldname": "select_print_heading", - "oldfieldtype": "Link", - "options": "Print Heading", - "print_hide": 0, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "fiscal_year", - "fieldtype": "Select", - "in_filter": 0, - "label": "Fiscal Year", - "options": "link:Fiscal Year", - "print_hide": 1, - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "col5", - "fieldtype": "Column Break", - "print_width": "50%", - "read_only": 0, - "width": "50%" - }, - { - "allow_on_submit": 0, - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "hidden": 0, - "in_filter": 1, - "label": "Company", - "no_copy": 0, - "oldfieldname": "company", - "oldfieldtype": "Link", - "options": "Company", - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 1, - "search_index": 0 - }, - { - "allow_on_submit": 0, - "doctype": "DocField", - "fieldname": "amended_from", - "fieldtype": "Link", - "hidden": 0, - "ignore_restrictions": 1, - "in_filter": 0, - "label": "Amended From", - "no_copy": 1, - "oldfieldname": "amended_from", - "oldfieldtype": "Link", - "options": "Stock Entry", - "print_hide": 1, - "read_only": 1, - "report_hide": 0, - "reqd": 0, - "search_index": 0 - }, - { - "allow_on_submit": 0, - "doctype": "DocField", - "fieldname": "remarks", - "fieldtype": "Text", - "hidden": 0, - "in_filter": 0, - "label": "Remarks", - "no_copy": 1, - "oldfieldname": "remarks", - "oldfieldtype": "Text", - "print_hide": 1, - "read_only": 0, - "report_hide": 0, - "reqd": 0, - "search_index": 0 - }, - { - "doctype": "DocPerm", - "role": "Material User" - }, - { - "doctype": "DocPerm", - "role": "Manufacturing User" - }, - { - "doctype": "DocPerm", - "role": "Manufacturing Manager" - }, - { - "doctype": "DocPerm", - "role": "Material Manager" - } -] \ No newline at end of file +{ + "allow_attach": 0, + "allow_copy": 0, + "allow_import": 1, + "allow_rename": 0, + "autoname": "naming_series:", + "creation": "2013-04-09 11:43:55", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "col1", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_width": "50%", + "read_only": 0, + "width": "50%" + }, + { + "allow_on_submit": 0, + "fieldname": "naming_series", + "fieldtype": "Select", + "hidden": 0, + "in_filter": 0, + "label": "Series", + "no_copy": 1, + "oldfieldname": "naming_series", + "oldfieldtype": "Select", + "options": "\nSTE", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0 + }, + { + "allow_on_submit": 0, + "default": "Material Issue", + "fieldname": "purpose", + "fieldtype": "Select", + "hidden": 0, + "in_filter": 1, + "in_list_view": 1, + "label": "Purpose", + "no_copy": 0, + "oldfieldname": "purpose", + "oldfieldtype": "Select", + "options": "Material Issue\nMaterial Receipt\nMaterial Transfer\nManufacture/Repack\nSubcontract\nSales Return\nPurchase Return", + "permlevel": 0, + "print_hide": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0 + }, + { + "allow_on_submit": 0, + "depends_on": "eval:doc.purpose==\"Sales Return\"", + "fieldname": "delivery_note_no", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 0, + "label": "Delivery Note No", + "no_copy": 1, + "oldfieldname": "delivery_note_no", + "oldfieldtype": "Link", + "options": "Delivery Note", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 1 + }, + { + "depends_on": "eval:doc.purpose==\"Sales Return\"", + "fieldname": "sales_invoice_no", + "fieldtype": "Link", + "hidden": 0, + "label": "Sales Invoice No", + "no_copy": 1, + "options": "Sales Invoice", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "allow_on_submit": 0, + "depends_on": "eval:doc.purpose==\"Purchase Return\"", + "fieldname": "purchase_receipt_no", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 0, + "label": "Purchase Receipt No", + "no_copy": 1, + "oldfieldname": "purchase_receipt_no", + "oldfieldtype": "Link", + "options": "Purchase Receipt", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 1 + }, + { + "fieldname": "col2", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "print_width": "50%", + "read_only": 0, + "width": "50%" + }, + { + "allow_on_submit": 0, + "default": "Today", + "fieldname": "posting_date", + "fieldtype": "Date", + "hidden": 0, + "in_filter": 1, + "in_list_view": 0, + "label": "Posting Date", + "no_copy": 1, + "oldfieldname": "posting_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 1 + }, + { + "allow_on_submit": 0, + "fieldname": "posting_time", + "fieldtype": "Time", + "hidden": 0, + "in_filter": 0, + "label": "Posting Time", + "no_copy": 1, + "oldfieldname": "posting_time", + "oldfieldtype": "Time", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "items_section", + "fieldtype": "Section Break", + "label": "Items", + "oldfieldtype": "Section Break", + "permlevel": 0, + "read_only": 0 + }, + { + "allow_on_submit": 0, + "fieldname": "from_warehouse", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 0, + "in_list_view": 1, + "label": "Default Source Warehouse", + "no_copy": 1, + "oldfieldname": "from_warehouse", + "oldfieldtype": "Link", + "options": "Warehouse", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0 + }, + { + "fieldname": "cb0", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0 + }, + { + "allow_on_submit": 0, + "fieldname": "to_warehouse", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 0, + "in_list_view": 1, + "label": "Default Target Warehouse", + "no_copy": 1, + "oldfieldname": "to_warehouse", + "oldfieldtype": "Link", + "options": "Warehouse", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0 + }, + { + "fieldname": "sb0", + "fieldtype": "Section Break", + "options": "Simple", + "permlevel": 0, + "read_only": 0 + }, + { + "allow_on_submit": 0, + "fieldname": "mtn_details", + "fieldtype": "Table", + "hidden": 0, + "in_filter": 0, + "label": "MTN Details", + "no_copy": 0, + "oldfieldname": "mtn_details", + "oldfieldtype": "Table", + "options": "Stock Entry Detail", + "permlevel": 0, + "print_hide": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0 + }, + { + "description": "Get valuation rate and available stock at source/target warehouse on mentioned posting date-time. If serialized item, please press this button after entering serial nos.", + "fieldname": "get_stock_and_rate", + "fieldtype": "Button", + "label": "Get Stock and Rate", + "oldfieldtype": "Button", + "options": "get_stock_and_rate", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "depends_on": "eval:(doc.purpose!==\"Sales Return\" && doc.purpose!==\"Purchase Return\")", + "fieldname": "sb1", + "fieldtype": "Section Break", + "label": "From Bill of Materials", + "permlevel": 0, + "read_only": 0 + }, + { + "allow_on_submit": 0, + "depends_on": "eval:inList([\"Material Transfer\", \"Manufacture/Repack\"], doc.purpose)", + "fieldname": "production_order", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 1, + "label": "Production Order", + "no_copy": 0, + "oldfieldname": "production_order", + "oldfieldtype": "Link", + "options": "Production Order", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 1 + }, + { + "depends_on": "eval:!inList([\"Sales Return\", \"Purchase Return\"], doc.purpose)", + "fieldname": "bom_no", + "fieldtype": "Link", + "label": "BOM No", + "options": "BOM", + "permlevel": 0, + "read_only": 0 + }, + { + "allow_on_submit": 0, + "depends_on": "eval:!inList([\"Sales Return\", \"Purchase Return\"], doc.purpose)", + "description": "As per Stock UOM", + "fieldname": "fg_completed_qty", + "fieldtype": "Float", + "hidden": 0, + "in_filter": 0, + "label": "Manufacturing Quantity", + "no_copy": 0, + "oldfieldname": "fg_completed_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0 + }, + { + "fieldname": "cb1", + "fieldtype": "Column Break", + "permlevel": 0, + "read_only": 0 + }, + { + "default": "1", + "depends_on": "eval:!inList([\"Sales Return\", \"Purchase Return\"], doc.purpose)", + "description": "If checked, BOM for sub-assembly items will be considered for getting raw materials. Otherwise, all sub-assembly items will be treated as a raw material.", + "fieldname": "use_multi_level_bom", + "fieldtype": "Check", + "label": "Use Multi-Level BOM", + "permlevel": 0, + "read_only": 0 + }, + { + "allow_on_submit": 0, + "depends_on": "eval:!inList([\"Sales Return\", \"Purchase Return\"], doc.purpose)", + "fieldname": "get_items", + "fieldtype": "Button", + "hidden": 0, + "in_filter": 0, + "label": "Get Items", + "no_copy": 0, + "oldfieldtype": "Button", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0 + }, + { + "depends_on": "eval:(doc.purpose==\"Sales Return\" || doc.purpose==\"Purchase Return\")", + "fieldname": "contact_section", + "fieldtype": "Section Break", + "label": "Contact Info", + "permlevel": 0, + "read_only": 0 + }, + { + "allow_on_submit": 0, + "depends_on": "eval:doc.purpose==\"Purchase Return\"", + "fieldname": "supplier", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 0, + "label": "Supplier", + "no_copy": 1, + "oldfieldname": "supplier", + "oldfieldtype": "Link", + "options": "Supplier", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0 + }, + { + "allow_on_submit": 0, + "depends_on": "eval:doc.purpose==\"Purchase Return\"", + "fieldname": "supplier_name", + "fieldtype": "Data", + "hidden": 0, + "in_filter": 0, + "label": "Supplier Name", + "no_copy": 1, + "oldfieldname": "supplier_name", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0 + }, + { + "allow_on_submit": 0, + "depends_on": "eval:doc.purpose==\"Purchase Return\"", + "fieldname": "supplier_address", + "fieldtype": "Small Text", + "hidden": 0, + "in_filter": 0, + "label": "Supplier Address", + "no_copy": 1, + "oldfieldname": "supplier_address", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_hide": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0 + }, + { + "allow_on_submit": 0, + "depends_on": "eval:doc.purpose==\"Sales Return\"", + "fieldname": "customer", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 0, + "label": "Customer", + "no_copy": 1, + "oldfieldname": "customer", + "oldfieldtype": "Link", + "options": "Customer", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0 + }, + { + "allow_on_submit": 0, + "depends_on": "eval:doc.purpose==\"Sales Return\"", + "fieldname": "customer_name", + "fieldtype": "Data", + "hidden": 0, + "in_filter": 0, + "label": "Customer Name", + "no_copy": 1, + "oldfieldname": "customer_name", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 0, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0 + }, + { + "allow_on_submit": 0, + "depends_on": "eval:doc.purpose==\"Sales Return\"", + "fieldname": "customer_address", + "fieldtype": "Small Text", + "hidden": 0, + "in_filter": 0, + "label": "Customer Address", + "no_copy": 1, + "oldfieldname": "customer_address", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_hide": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0 + }, + { + "fieldname": "more_info", + "fieldtype": "Section Break", + "label": "More Info", + "oldfieldtype": "Section Break", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "col4", + "fieldtype": "Column Break", + "permlevel": 0, + "print_width": "50%", + "read_only": 0, + "width": "50%" + }, + { + "fieldname": "total_amount", + "fieldtype": "Currency", + "label": "Total Amount", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "project_name", + "fieldtype": "Link", + "in_filter": 1, + "label": "Project Name", + "oldfieldname": "project_name", + "oldfieldtype": "Link", + "options": "Project", + "permlevel": 0, + "read_only": 0 + }, + { + "allow_on_submit": 0, + "fieldname": "select_print_heading", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 0, + "label": "Print Heading", + "no_copy": 0, + "oldfieldname": "select_print_heading", + "oldfieldtype": "Link", + "options": "Print Heading", + "permlevel": 0, + "print_hide": 0, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0 + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Select", + "in_filter": 0, + "label": "Fiscal Year", + "options": "link:Fiscal Year", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "col5", + "fieldtype": "Column Break", + "permlevel": 0, + "print_width": "50%", + "read_only": 0, + "width": "50%" + }, + { + "allow_on_submit": 0, + "fieldname": "company", + "fieldtype": "Link", + "hidden": 0, + "in_filter": 1, + "label": "Company", + "no_copy": 0, + "oldfieldname": "company", + "oldfieldtype": "Link", + "options": "Company", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0 + }, + { + "allow_on_submit": 0, + "fieldname": "amended_from", + "fieldtype": "Link", + "hidden": 0, + "ignore_restrictions": 1, + "in_filter": 0, + "label": "Amended From", + "no_copy": 1, + "oldfieldname": "amended_from", + "oldfieldtype": "Link", + "options": "Stock Entry", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "report_hide": 0, + "reqd": 0, + "search_index": 0 + }, + { + "allow_on_submit": 0, + "fieldname": "remarks", + "fieldtype": "Text", + "hidden": 0, + "in_filter": 0, + "label": "Remarks", + "no_copy": 1, + "oldfieldname": "remarks", + "oldfieldtype": "Text", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 0, + "reqd": 0, + "search_index": 0 + } + ], + "hide_heading": 0, + "hide_toolbar": 0, + "icon": "icon-file-text", + "idx": 1, + "in_create": 0, + "in_dialog": 0, + "is_submittable": 1, + "issingle": 0, + "max_attachments": 0, + "modified": "2014-02-26 10:59:19", + "modified_by": "Administrator", + "module": "Stock", + "name": "Stock Entry", + "owner": "Administrator", + "permissions": [ + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material User", + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Manufacturing User", + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Manufacturing Manager", + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material Manager", + "submit": 1, + "write": 1 + } + ], + "read_only": 0, + "read_only_onload": 0, + "search_fields": "transfer_date, from_warehouse, to_warehouse, purpose, remarks" +} \ No newline at end of file diff --git a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.txt b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.txt index 3bc16955bc..b141aa4418 100644 --- a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.txt +++ b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.txt @@ -1,321 +1,308 @@ -[ - { - "creation": "2013-03-29 18:22:12", - "docstatus": 0, - "modified": "2014-02-03 12:59:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "MTND/.######", - "doctype": "DocType", - "istable": 1, - "module": "Stock", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Stock Entry Detail", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Stock Entry Detail" - }, - { - "doctype": "DocField", - "fieldname": "s_warehouse", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "Source Warehouse", - "no_copy": 1, - "oldfieldname": "s_warehouse", - "oldfieldtype": "Link", - "options": "Warehouse", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "col_break1", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "t_warehouse", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "Target Warehouse", - "no_copy": 1, - "oldfieldname": "t_warehouse", - "oldfieldtype": "Link", - "options": "Warehouse", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "sec_break1", - "fieldtype": "Section Break" - }, - { - "doctype": "DocField", - "fieldname": "item_code", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "Item Code", - "oldfieldname": "item_code", - "oldfieldtype": "Link", - "options": "Item", - "read_only": 0, - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "item_name", - "fieldtype": "Data", - "label": "Item Name", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "col_break2", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Text", - "in_list_view": 1, - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Text", - "print_width": "300px", - "read_only": 0, - "width": "300px" - }, - { - "doctype": "DocField", - "fieldname": "quantity_and_rate", - "fieldtype": "Section Break", - "label": "Quantity and Rate" - }, - { - "doctype": "DocField", - "fieldname": "qty", - "fieldtype": "Float", - "in_list_view": 1, - "label": "Qty", - "oldfieldname": "qty", - "oldfieldtype": "Currency", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "uom", - "fieldtype": "Link", - "in_list_view": 0, - "label": "UOM", - "oldfieldname": "uom", - "oldfieldtype": "Link", - "options": "UOM", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "incoming_rate", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Valuation Rate", - "oldfieldname": "incoming_rate", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "read_only": 0, - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "col_break3", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "stock_uom", - "fieldtype": "Link", - "in_filter": 0, - "label": "Stock UOM", - "oldfieldname": "stock_uom", - "oldfieldtype": "Link", - "options": "UOM", - "print_hide": 1, - "read_only": 1, - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "conversion_factor", - "fieldtype": "Float", - "label": "Conversion Factor", - "oldfieldname": "conversion_factor", - "oldfieldtype": "Currency", - "print_hide": 1, - "read_only": 1, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "amount", - "fieldtype": "Currency", - "label": "Amount", - "oldfieldname": "amount", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "serial_no_batch", - "fieldtype": "Section Break", - "label": "Serial No / Batch" - }, - { - "doctype": "DocField", - "fieldname": "serial_no", - "fieldtype": "Text", - "label": "Serial No", - "no_copy": 1, - "oldfieldname": "serial_no", - "oldfieldtype": "Text", - "read_only": 0, - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "col_break4", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "batch_no", - "fieldtype": "Link", - "label": "Batch No", - "oldfieldname": "batch_no", - "oldfieldtype": "Link", - "options": "Batch", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "accounting", - "fieldtype": "Section Break", - "label": "Accounting" - }, - { - "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)", - "doctype": "DocField", - "fieldname": "expense_account", - "fieldtype": "Link", - "label": "Difference Account", - "options": "Account", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "col_break5", - "fieldtype": "Column Break" - }, - { - "default": ":Company", - "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)", - "doctype": "DocField", - "fieldname": "cost_center", - "fieldtype": "Link", - "hidden": 0, - "label": "Cost Center", - "options": "Cost Center", - "print_hide": 1, - "read_only": 0, - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "more_info", - "fieldtype": "Section Break", - "label": "More Info" - }, - { - "doctype": "DocField", - "fieldname": "actual_qty", - "fieldtype": "Float", - "in_filter": 1, - "label": "Actual Qty (at source/target)", - "no_copy": 1, - "oldfieldname": "actual_qty", - "oldfieldtype": "Read Only", - "print_hide": 1, - "read_only": 1, - "reqd": 0, - "search_index": 1 - }, - { - "description": "BOM No. for a Finished Good Item", - "doctype": "DocField", - "fieldname": "bom_no", - "fieldtype": "Link", - "hidden": 1, - "label": "BOM No", - "no_copy": 0, - "options": "BOM", - "print_hide": 1, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "col_break6", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "transfer_qty", - "fieldtype": "Float", - "label": "Qty as per Stock UOM", - "oldfieldname": "transfer_qty", - "oldfieldtype": "Currency", - "print_hide": 1, - "read_only": 1, - "reqd": 1 - }, - { - "description": "Material Request used to make this Stock Entry", - "doctype": "DocField", - "fieldname": "material_request", - "fieldtype": "Link", - "hidden": 1, - "label": "Material Request", - "no_copy": 1, - "options": "Material Request", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "material_request_item", - "fieldtype": "Link", - "hidden": 1, - "label": "Material Request Item", - "no_copy": 1, - "options": "Material Request Item", - "print_hide": 1, - "read_only": 1 - } -] \ No newline at end of file +{ + "autoname": "MTND/.######", + "creation": "2013-03-29 18:22:12", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "s_warehouse", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Source Warehouse", + "no_copy": 1, + "oldfieldname": "s_warehouse", + "oldfieldtype": "Link", + "options": "Warehouse", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "col_break1", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "t_warehouse", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Target Warehouse", + "no_copy": 1, + "oldfieldname": "t_warehouse", + "oldfieldtype": "Link", + "options": "Warehouse", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "sec_break1", + "fieldtype": "Section Break", + "permlevel": 0 + }, + { + "fieldname": "item_code", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Item Code", + "oldfieldname": "item_code", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0, + "read_only": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "item_name", + "fieldtype": "Data", + "label": "Item Name", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "col_break2", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "description", + "fieldtype": "Text", + "in_list_view": 1, + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Text", + "permlevel": 0, + "print_width": "300px", + "read_only": 0, + "width": "300px" + }, + { + "fieldname": "quantity_and_rate", + "fieldtype": "Section Break", + "label": "Quantity and Rate", + "permlevel": 0 + }, + { + "fieldname": "qty", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Qty", + "oldfieldname": "qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "uom", + "fieldtype": "Link", + "in_list_view": 0, + "label": "UOM", + "oldfieldname": "uom", + "oldfieldtype": "Link", + "options": "UOM", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "incoming_rate", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Valuation Rate", + "oldfieldname": "incoming_rate", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 0, + "reqd": 0 + }, + { + "fieldname": "col_break3", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "stock_uom", + "fieldtype": "Link", + "in_filter": 0, + "label": "Stock UOM", + "oldfieldname": "stock_uom", + "oldfieldtype": "Link", + "options": "UOM", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "conversion_factor", + "fieldtype": "Float", + "label": "Conversion Factor", + "oldfieldname": "conversion_factor", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 1 + }, + { + "fieldname": "amount", + "fieldtype": "Currency", + "label": "Amount", + "oldfieldname": "amount", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "serial_no_batch", + "fieldtype": "Section Break", + "label": "Serial No / Batch", + "permlevel": 0 + }, + { + "fieldname": "serial_no", + "fieldtype": "Text", + "label": "Serial No", + "no_copy": 1, + "oldfieldname": "serial_no", + "oldfieldtype": "Text", + "permlevel": 0, + "read_only": 0, + "reqd": 0 + }, + { + "fieldname": "col_break4", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "batch_no", + "fieldtype": "Link", + "label": "Batch No", + "oldfieldname": "batch_no", + "oldfieldtype": "Link", + "options": "Batch", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "accounting", + "fieldtype": "Section Break", + "label": "Accounting", + "permlevel": 0 + }, + { + "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)", + "fieldname": "expense_account", + "fieldtype": "Link", + "label": "Difference Account", + "options": "Account", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "col_break5", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "default": ":Company", + "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)", + "fieldname": "cost_center", + "fieldtype": "Link", + "hidden": 0, + "label": "Cost Center", + "options": "Cost Center", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 0 + }, + { + "fieldname": "more_info", + "fieldtype": "Section Break", + "label": "More Info", + "permlevel": 0 + }, + { + "fieldname": "actual_qty", + "fieldtype": "Float", + "in_filter": 1, + "label": "Actual Qty (at source/target)", + "no_copy": 1, + "oldfieldname": "actual_qty", + "oldfieldtype": "Read Only", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 0, + "search_index": 1 + }, + { + "description": "BOM No. for a Finished Good Item", + "fieldname": "bom_no", + "fieldtype": "Link", + "hidden": 1, + "label": "BOM No", + "no_copy": 0, + "options": "BOM", + "permlevel": 0, + "print_hide": 1, + "read_only": 0 + }, + { + "fieldname": "col_break6", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "transfer_qty", + "fieldtype": "Float", + "label": "Qty as per Stock UOM", + "oldfieldname": "transfer_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "reqd": 1 + }, + { + "description": "Material Request used to make this Stock Entry", + "fieldname": "material_request", + "fieldtype": "Link", + "hidden": 1, + "label": "Material Request", + "no_copy": 1, + "options": "Material Request", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "material_request_item", + "fieldtype": "Link", + "hidden": 1, + "label": "Material Request Item", + "no_copy": 1, + "options": "Material Request Item", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + } + ], + "idx": 1, + "istable": 1, + "modified": "2014-02-03 12:59:27", + "modified_by": "Administrator", + "module": "Stock", + "name": "Stock Entry Detail", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.txt b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.txt index 641a68c3bc..68fd18ce00 100644 --- a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.txt +++ b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.txt @@ -1,303 +1,287 @@ -[ - { - "creation": "2013-01-29 19:25:42", - "docstatus": 0, - "modified": "2013-11-03 14:11:43", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_copy": 1, - "allow_email": 1, - "allow_print": 1, - "autoname": "SLE/.########", - "doctype": "DocType", - "document_type": "Other", - "hide_toolbar": 1, - "icon": "icon-list", - "in_create": 1, - "module": "Stock", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Stock Ledger Entry", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocPerm", - "name": "__common__", - "parent": "Stock Ledger Entry", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "read": 1, - "report": 1, - "submit": 0 - }, - { - "doctype": "DocType", - "name": "Stock Ledger Entry" - }, - { - "doctype": "DocField", - "fieldname": "item_code", - "fieldtype": "Link", - "in_filter": 1, - "label": "Item Code", - "oldfieldname": "item_code", - "oldfieldtype": "Link", - "options": "Item", - "print_width": "100px", - "read_only": 1, - "reqd": 0, - "search_index": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "serial_no", - "fieldtype": "Text", - "in_filter": 0, - "label": "Serial No", - "print_width": "100px", - "read_only": 1, - "search_index": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "batch_no", - "fieldtype": "Data", - "label": "Batch No", - "oldfieldname": "batch_no", - "oldfieldtype": "Data", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "warehouse", - "fieldtype": "Link", - "in_filter": 1, - "label": "Warehouse", - "oldfieldname": "warehouse", - "oldfieldtype": "Link", - "options": "Warehouse", - "print_width": "100px", - "read_only": 1, - "search_index": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "posting_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Posting Date", - "oldfieldname": "posting_date", - "oldfieldtype": "Date", - "print_width": "100px", - "read_only": 1, - "reqd": 0, - "search_index": 1, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "posting_time", - "fieldtype": "Time", - "in_filter": 0, - "label": "Posting Time", - "oldfieldname": "posting_time", - "oldfieldtype": "Time", - "print_width": "100px", - "read_only": 1, - "search_index": 0, - "width": "100px" - }, - { - "doctype": "DocField", - "fieldname": "voucher_type", - "fieldtype": "Data", - "in_filter": 1, - "label": "Voucher Type", - "oldfieldname": "voucher_type", - "oldfieldtype": "Data", - "print_width": "150px", - "read_only": 1, - "search_index": 0, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "voucher_no", - "fieldtype": "Data", - "in_filter": 1, - "label": "Voucher No", - "oldfieldname": "voucher_no", - "oldfieldtype": "Data", - "print_width": "150px", - "read_only": 1, - "search_index": 0, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "voucher_detail_no", - "fieldtype": "Data", - "label": "Voucher Detail No", - "oldfieldname": "voucher_detail_no", - "oldfieldtype": "Data", - "print_width": "150px", - "read_only": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "actual_qty", - "fieldtype": "Float", - "in_filter": 1, - "label": "Actual Quantity", - "oldfieldname": "actual_qty", - "oldfieldtype": "Currency", - "print_width": "150px", - "read_only": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "incoming_rate", - "fieldtype": "Currency", - "label": "Incoming Rate", - "oldfieldname": "incoming_rate", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "stock_uom", - "fieldtype": "Link", - "label": "Stock UOM", - "oldfieldname": "stock_uom", - "oldfieldtype": "Data", - "options": "UOM", - "print_width": "150px", - "read_only": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "qty_after_transaction", - "fieldtype": "Float", - "in_filter": 1, - "label": "Actual Qty After Transaction", - "oldfieldname": "bin_aqat", - "oldfieldtype": "Currency", - "print_width": "150px", - "read_only": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "valuation_rate", - "fieldtype": "Currency", - "label": "Valuation Rate", - "oldfieldname": "valuation_rate", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "print_width": "150px", - "read_only": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "stock_value", - "fieldtype": "Currency", - "label": "Stock Value", - "oldfieldname": "stock_value", - "oldfieldtype": "Currency", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "stock_value_difference", - "fieldtype": "Currency", - "label": "Stock Value Difference", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "stock_queue", - "fieldtype": "Text", - "hidden": 1, - "in_filter": 0, - "label": "Stock Queue (FIFO)", - "oldfieldname": "fcfs_stack", - "oldfieldtype": "Text", - "print_hide": 1, - "read_only": 1, - "report_hide": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "project", - "fieldtype": "Link", - "label": "Project", - "options": "Project" - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Select", - "in_filter": 1, - "label": "Company", - "oldfieldname": "company", - "oldfieldtype": "Data", - "options": "link:Company", - "print_width": "150px", - "read_only": 1, - "search_index": 0, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "fiscal_year", - "fieldtype": "Data", - "in_filter": 1, - "label": "Fiscal Year", - "oldfieldname": "fiscal_year", - "oldfieldtype": "Data", - "print_width": "150px", - "read_only": 1, - "search_index": 0, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "is_cancelled", - "fieldtype": "Select", - "hidden": 1, - "label": "Is Cancelled", - "options": "\nNo\nYes", - "report_hide": 1 - }, - { - "amend": 0, - "cancel": 0, - "create": 0, - "doctype": "DocPerm", - "role": "Material User", - "write": 0 - }, - { - "doctype": "DocPerm", - "role": "Accounts Manager" - } -] \ No newline at end of file +{ + "allow_copy": 1, + "allow_email": 1, + "allow_print": 1, + "autoname": "SLE/.########", + "creation": "2013-01-29 19:25:42", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Other", + "fields": [ + { + "fieldname": "item_code", + "fieldtype": "Link", + "in_filter": 1, + "label": "Item Code", + "oldfieldname": "item_code", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0, + "print_width": "100px", + "read_only": 1, + "reqd": 0, + "search_index": 1, + "width": "100px" + }, + { + "fieldname": "serial_no", + "fieldtype": "Text", + "in_filter": 0, + "label": "Serial No", + "permlevel": 0, + "print_width": "100px", + "read_only": 1, + "search_index": 0, + "width": "100px" + }, + { + "fieldname": "batch_no", + "fieldtype": "Data", + "label": "Batch No", + "oldfieldname": "batch_no", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "warehouse", + "fieldtype": "Link", + "in_filter": 1, + "label": "Warehouse", + "oldfieldname": "warehouse", + "oldfieldtype": "Link", + "options": "Warehouse", + "permlevel": 0, + "print_width": "100px", + "read_only": 1, + "search_index": 1, + "width": "100px" + }, + { + "fieldname": "posting_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Posting Date", + "oldfieldname": "posting_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_width": "100px", + "read_only": 1, + "reqd": 0, + "search_index": 1, + "width": "100px" + }, + { + "fieldname": "posting_time", + "fieldtype": "Time", + "in_filter": 0, + "label": "Posting Time", + "oldfieldname": "posting_time", + "oldfieldtype": "Time", + "permlevel": 0, + "print_width": "100px", + "read_only": 1, + "search_index": 0, + "width": "100px" + }, + { + "fieldname": "voucher_type", + "fieldtype": "Data", + "in_filter": 1, + "label": "Voucher Type", + "oldfieldname": "voucher_type", + "oldfieldtype": "Data", + "permlevel": 0, + "print_width": "150px", + "read_only": 1, + "search_index": 0, + "width": "150px" + }, + { + "fieldname": "voucher_no", + "fieldtype": "Data", + "in_filter": 1, + "label": "Voucher No", + "oldfieldname": "voucher_no", + "oldfieldtype": "Data", + "permlevel": 0, + "print_width": "150px", + "read_only": 1, + "search_index": 0, + "width": "150px" + }, + { + "fieldname": "voucher_detail_no", + "fieldtype": "Data", + "label": "Voucher Detail No", + "oldfieldname": "voucher_detail_no", + "oldfieldtype": "Data", + "permlevel": 0, + "print_width": "150px", + "read_only": 1, + "width": "150px" + }, + { + "fieldname": "actual_qty", + "fieldtype": "Float", + "in_filter": 1, + "label": "Actual Quantity", + "oldfieldname": "actual_qty", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_width": "150px", + "read_only": 1, + "width": "150px" + }, + { + "fieldname": "incoming_rate", + "fieldtype": "Currency", + "label": "Incoming Rate", + "oldfieldname": "incoming_rate", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "stock_uom", + "fieldtype": "Link", + "label": "Stock UOM", + "oldfieldname": "stock_uom", + "oldfieldtype": "Data", + "options": "UOM", + "permlevel": 0, + "print_width": "150px", + "read_only": 1, + "width": "150px" + }, + { + "fieldname": "qty_after_transaction", + "fieldtype": "Float", + "in_filter": 1, + "label": "Actual Qty After Transaction", + "oldfieldname": "bin_aqat", + "oldfieldtype": "Currency", + "permlevel": 0, + "print_width": "150px", + "read_only": 1, + "width": "150px" + }, + { + "fieldname": "valuation_rate", + "fieldtype": "Currency", + "label": "Valuation Rate", + "oldfieldname": "valuation_rate", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "print_width": "150px", + "read_only": 1, + "width": "150px" + }, + { + "fieldname": "stock_value", + "fieldtype": "Currency", + "label": "Stock Value", + "oldfieldname": "stock_value", + "oldfieldtype": "Currency", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "stock_value_difference", + "fieldtype": "Currency", + "label": "Stock Value Difference", + "options": "Company:company:default_currency", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "stock_queue", + "fieldtype": "Text", + "hidden": 1, + "in_filter": 0, + "label": "Stock Queue (FIFO)", + "oldfieldname": "fcfs_stack", + "oldfieldtype": "Text", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "report_hide": 1, + "search_index": 0 + }, + { + "fieldname": "project", + "fieldtype": "Link", + "label": "Project", + "options": "Project", + "permlevel": 0 + }, + { + "fieldname": "company", + "fieldtype": "Select", + "in_filter": 1, + "label": "Company", + "oldfieldname": "company", + "oldfieldtype": "Data", + "options": "link:Company", + "permlevel": 0, + "print_width": "150px", + "read_only": 1, + "search_index": 0, + "width": "150px" + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Data", + "in_filter": 1, + "label": "Fiscal Year", + "oldfieldname": "fiscal_year", + "oldfieldtype": "Data", + "permlevel": 0, + "print_width": "150px", + "read_only": 1, + "search_index": 0, + "width": "150px" + }, + { + "fieldname": "is_cancelled", + "fieldtype": "Select", + "hidden": 1, + "label": "Is Cancelled", + "options": "\nNo\nYes", + "permlevel": 0, + "report_hide": 1 + } + ], + "hide_toolbar": 1, + "icon": "icon-list", + "idx": 1, + "in_create": 1, + "modified": "2013-11-03 14:11:43", + "modified_by": "Administrator", + "module": "Stock", + "name": "Stock Ledger Entry", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 0, + "permlevel": 0, + "read": 1, + "report": 1, + "role": "Material User", + "submit": 0, + "write": 0 + }, + { + "permlevel": 0, + "read": 1, + "report": 1, + "role": "Accounts Manager", + "submit": 0 + } + ] +} \ No newline at end of file diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.txt b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.txt index 90f5bc8e69..784f99ef83 100644 --- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.txt +++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.txt @@ -1,162 +1,143 @@ -[ - { - "creation": "2013-03-28 10:35:31", - "docstatus": 0, - "modified": "2014-01-20 17:49:28", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_attach": 0, - "allow_copy": 1, - "autoname": "SR/.######", - "description": "This tool helps you to update or fix the quantity and valuation of stock in the system. It is typically used to synchronise the system values and what actually exists in your warehouses.", - "doctype": "DocType", - "icon": "icon-upload-alt", - "is_submittable": 1, - "max_attachments": 1, - "module": "Stock", - "name": "__common__", - "read_only_onload": 0, - "search_fields": "posting_date" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Stock Reconciliation", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "amend": 0, - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "name": "__common__", - "parent": "Stock Reconciliation", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "read": 1, - "report": 1, - "role": "Material Manager", - "submit": 1, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Stock Reconciliation" - }, - { - "doctype": "DocField", - "fieldname": "posting_date", - "fieldtype": "Date", - "in_filter": 0, - "in_list_view": 1, - "label": "Posting Date", - "oldfieldname": "reconciliation_date", - "oldfieldtype": "Date", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "posting_time", - "fieldtype": "Time", - "in_filter": 0, - "in_list_view": 1, - "label": "Posting Time", - "oldfieldname": "reconciliation_time", - "oldfieldtype": "Time", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "amended_from", - "fieldtype": "Link", - "ignore_restrictions": 1, - "label": "Amended From", - "no_copy": 1, - "options": "Stock Reconciliation", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "fiscal_year", - "fieldtype": "Select", - "label": "Fiscal Year", - "options": "link:Fiscal Year", - "print_hide": 1, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "label": "Company", - "options": "Company", - "reqd": 1 - }, - { - "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)", - "doctype": "DocField", - "fieldname": "expense_account", - "fieldtype": "Link", - "label": "Difference Account", - "options": "Account" - }, - { - "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)", - "doctype": "DocField", - "fieldname": "cost_center", - "fieldtype": "Link", - "label": "Cost Center", - "options": "Cost Center" - }, - { - "doctype": "DocField", - "fieldname": "col1", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "upload_html", - "fieldtype": "HTML", - "label": "Upload HTML", - "print_hide": 1, - "read_only": 1 - }, - { - "depends_on": "reconciliation_json", - "doctype": "DocField", - "fieldname": "sb2", - "fieldtype": "Section Break", - "label": "Reconciliation Data" - }, - { - "doctype": "DocField", - "fieldname": "reconciliation_html", - "fieldtype": "HTML", - "hidden": 0, - "label": "Reconciliation HTML", - "print_hide": 0, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "reconciliation_json", - "fieldtype": "Long Text", - "hidden": 1, - "label": "Reconciliation JSON", - "no_copy": 1, - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "allow_attach": 0, + "allow_copy": 1, + "autoname": "SR/.######", + "creation": "2013-03-28 10:35:31", + "description": "This tool helps you to update or fix the quantity and valuation of stock in the system. It is typically used to synchronise the system values and what actually exists in your warehouses.", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "posting_date", + "fieldtype": "Date", + "in_filter": 0, + "in_list_view": 1, + "label": "Posting Date", + "oldfieldname": "reconciliation_date", + "oldfieldtype": "Date", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "posting_time", + "fieldtype": "Time", + "in_filter": 0, + "in_list_view": 1, + "label": "Posting Time", + "oldfieldname": "reconciliation_time", + "oldfieldtype": "Time", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "amended_from", + "fieldtype": "Link", + "ignore_restrictions": 1, + "label": "Amended From", + "no_copy": 1, + "options": "Stock Reconciliation", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Select", + "label": "Fiscal Year", + "options": "link:Fiscal Year", + "permlevel": 0, + "print_hide": 1, + "reqd": 1 + }, + { + "fieldname": "company", + "fieldtype": "Link", + "label": "Company", + "options": "Company", + "permlevel": 0, + "reqd": 1 + }, + { + "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)", + "fieldname": "expense_account", + "fieldtype": "Link", + "label": "Difference Account", + "options": "Account", + "permlevel": 0 + }, + { + "depends_on": "eval:cint(sys_defaults.auto_accounting_for_stock)", + "fieldname": "cost_center", + "fieldtype": "Link", + "label": "Cost Center", + "options": "Cost Center", + "permlevel": 0 + }, + { + "fieldname": "col1", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "upload_html", + "fieldtype": "HTML", + "label": "Upload HTML", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "depends_on": "reconciliation_json", + "fieldname": "sb2", + "fieldtype": "Section Break", + "label": "Reconciliation Data", + "permlevel": 0 + }, + { + "fieldname": "reconciliation_html", + "fieldtype": "HTML", + "hidden": 0, + "label": "Reconciliation HTML", + "permlevel": 0, + "print_hide": 0, + "read_only": 1 + }, + { + "fieldname": "reconciliation_json", + "fieldtype": "Long Text", + "hidden": 1, + "label": "Reconciliation JSON", + "no_copy": 1, + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + } + ], + "icon": "icon-upload-alt", + "idx": 1, + "is_submittable": 1, + "max_attachments": 1, + "modified": "2014-01-20 17:49:28", + "modified_by": "Administrator", + "module": "Stock", + "name": "Stock Reconciliation", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 1, + "create": 1, + "delete": 1, + "permlevel": 0, + "read": 1, + "report": 1, + "role": "Material Manager", + "submit": 1, + "write": 1 + } + ], + "read_only_onload": 0, + "search_fields": "posting_date" +} \ No newline at end of file diff --git a/erpnext/stock/doctype/stock_settings/stock_settings.txt b/erpnext/stock/doctype/stock_settings/stock_settings.txt index 556420ceda..8f5fc03fe2 100644 --- a/erpnext/stock/doctype/stock_settings/stock_settings.txt +++ b/erpnext/stock/doctype/stock_settings/stock_settings.txt @@ -1,137 +1,118 @@ -[ - { - "creation": "2013-06-24 16:37:54", - "docstatus": 0, - "modified": "2014-02-19 19:02:23", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "description": "Settings", - "doctype": "DocType", - "icon": "icon-cog", - "issingle": 1, - "module": "Stock", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Stock Settings", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Stock Settings", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "role": "Material Manager", - "write": 1 - }, - { - "doctype": "DocType", - "name": "Stock Settings" - }, - { - "default": "Item Code", - "doctype": "DocField", - "fieldname": "item_naming_by", - "fieldtype": "Select", - "label": "Item Naming By", - "options": "Item Code\nNaming Series" - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "item_group", - "fieldtype": "Link", - "label": "Default Item Group", - "options": "Item Group" - }, - { - "doctype": "DocField", - "fieldname": "stock_uom", - "fieldtype": "Link", - "label": "Default Stock UOM", - "options": "UOM" - }, - { - "doctype": "DocField", - "fieldname": "column_break_4", - "fieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "allow_negative_stock", - "fieldtype": "Check", - "label": "Allow Negative Stock" - }, - { - "doctype": "DocField", - "fieldname": "valuation_method", - "fieldtype": "Select", - "label": "Default Valuation Method", - "options": "FIFO\nMoving Average" - }, - { - "description": "Percentage you are allowed to receive or deliver more against the quantity ordered. For example: If you have ordered 100 units. and your Allowance is 10% then you are allowed to receive 110 units.", - "doctype": "DocField", - "fieldname": "tolerance", - "fieldtype": "Float", - "label": "Allowance Percent" - }, - { - "doctype": "DocField", - "fieldname": "auto_material_request", - "fieldtype": "Section Break", - "label": "Auto Material Request" - }, - { - "doctype": "DocField", - "fieldname": "auto_indent", - "fieldtype": "Check", - "label": "Raise Material Request when stock reaches re-order level" - }, - { - "doctype": "DocField", - "fieldname": "reorder_email_notify", - "fieldtype": "Check", - "label": "Notify by Email on creation of automatic Material Request" - }, - { - "doctype": "DocField", - "fieldname": "freeze_stock_entries", - "fieldtype": "Section Break", - "label": "Freeze Stock Entries" - }, - { - "doctype": "DocField", - "fieldname": "stock_frozen_upto", - "fieldtype": "Date", - "label": "Stock Frozen Upto" - }, - { - "doctype": "DocField", - "fieldname": "stock_frozen_upto_days", - "fieldtype": "Int", - "label": "Freeze Stocks Older Than [Days]" - }, - { - "doctype": "DocField", - "fieldname": "stock_auth_role", - "fieldtype": "Link", - "label": "Role Allowed to edit frozen stock", - "options": "Role" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "creation": "2013-06-24 16:37:54", + "description": "Settings", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "default": "Item Code", + "fieldname": "item_naming_by", + "fieldtype": "Select", + "label": "Item Naming By", + "options": "Item Code\nNaming Series", + "permlevel": 0 + }, + { + "description": "Add / Edit", + "fieldname": "item_group", + "fieldtype": "Link", + "label": "Default Item Group", + "options": "Item Group", + "permlevel": 0 + }, + { + "fieldname": "stock_uom", + "fieldtype": "Link", + "label": "Default Stock UOM", + "options": "UOM", + "permlevel": 0 + }, + { + "fieldname": "column_break_4", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "allow_negative_stock", + "fieldtype": "Check", + "label": "Allow Negative Stock", + "permlevel": 0 + }, + { + "fieldname": "valuation_method", + "fieldtype": "Select", + "label": "Default Valuation Method", + "options": "FIFO\nMoving Average", + "permlevel": 0 + }, + { + "description": "Percentage you are allowed to receive or deliver more against the quantity ordered. For example: If you have ordered 100 units. and your Allowance is 10% then you are allowed to receive 110 units.", + "fieldname": "tolerance", + "fieldtype": "Float", + "label": "Allowance Percent", + "permlevel": 0 + }, + { + "fieldname": "auto_material_request", + "fieldtype": "Section Break", + "label": "Auto Material Request", + "permlevel": 0 + }, + { + "fieldname": "auto_indent", + "fieldtype": "Check", + "label": "Raise Material Request when stock reaches re-order level", + "permlevel": 0 + }, + { + "fieldname": "reorder_email_notify", + "fieldtype": "Check", + "label": "Notify by Email on creation of automatic Material Request", + "permlevel": 0 + }, + { + "fieldname": "freeze_stock_entries", + "fieldtype": "Section Break", + "label": "Freeze Stock Entries", + "permlevel": 0 + }, + { + "fieldname": "stock_frozen_upto", + "fieldtype": "Date", + "label": "Stock Frozen Upto", + "permlevel": 0 + }, + { + "fieldname": "stock_frozen_upto_days", + "fieldtype": "Int", + "label": "Freeze Stocks Older Than [Days]", + "permlevel": 0 + }, + { + "fieldname": "stock_auth_role", + "fieldtype": "Link", + "label": "Role Allowed to edit frozen stock", + "options": "Role", + "permlevel": 0 + } + ], + "icon": "icon-cog", + "idx": 1, + "issingle": 1, + "modified": "2014-02-19 19:02:23", + "modified_by": "Administrator", + "module": "Stock", + "name": "Stock Settings", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "role": "Material Manager", + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.txt b/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.txt index a4f368efc2..58142682b0 100644 --- a/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.txt +++ b/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.txt @@ -1,88 +1,76 @@ -[ - { - "creation": "2013-01-10 16:34:30", - "docstatus": 0, - "modified": "2013-12-20 19:21:48", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "icon": "icon-magic", - "in_create": 0, - "issingle": 1, - "module": "Stock", - "name": "__common__", - "read_only": 0 - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Stock UOM Replace Utility", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Stock UOM Replace Utility", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 0, - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Stock UOM Replace Utility" - }, - { - "doctype": "DocField", - "fieldname": "item_code", - "fieldtype": "Link", - "label": "Item", - "options": "Item" - }, - { - "doctype": "DocField", - "fieldname": "current_stock_uom", - "fieldtype": "Link", - "label": "Current Stock UOM", - "options": "UOM", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "new_stock_uom", - "fieldtype": "Link", - "label": "New Stock UOM", - "options": "UOM" - }, - { - "doctype": "DocField", - "fieldname": "conversion_factor", - "fieldtype": "Float", - "label": "Conversion Factor" - }, - { - "doctype": "DocField", - "fieldname": "update", - "fieldtype": "Button", - "label": "Update", - "options": "update_stock_uom" - }, - { - "doctype": "DocPerm", - "role": "Material Master Manager" - }, - { - "doctype": "DocPerm", - "role": "Material Manager" - } -] \ No newline at end of file +{ + "creation": "2013-01-10 16:34:30", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "item_code", + "fieldtype": "Link", + "label": "Item", + "options": "Item", + "permlevel": 0 + }, + { + "fieldname": "current_stock_uom", + "fieldtype": "Link", + "label": "Current Stock UOM", + "options": "UOM", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "new_stock_uom", + "fieldtype": "Link", + "label": "New Stock UOM", + "options": "UOM", + "permlevel": 0 + }, + { + "fieldname": "conversion_factor", + "fieldtype": "Float", + "label": "Conversion Factor", + "permlevel": 0 + }, + { + "fieldname": "update", + "fieldtype": "Button", + "label": "Update", + "options": "update_stock_uom", + "permlevel": 0 + } + ], + "icon": "icon-magic", + "idx": 1, + "in_create": 0, + "issingle": 1, + "modified": "2013-12-20 19:21:48", + "modified_by": "Administrator", + "module": "Stock", + "name": "Stock UOM Replace Utility", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 0, + "role": "Material Master Manager", + "submit": 0, + "write": 1 + }, + { + "create": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 0, + "role": "Material Manager", + "submit": 0, + "write": 1 + } + ], + "read_only": 0 +} \ No newline at end of file diff --git a/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.txt b/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.txt index 0843921150..b64d0578fb 100644 --- a/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.txt +++ b/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.txt @@ -1,46 +1,34 @@ -[ - { - "creation": "2013-02-22 01:28:04", - "docstatus": 0, - "modified": "2013-12-20 19:21:53", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "UCDD/.#####", - "doctype": "DocType", - "istable": 1, - "module": "Stock", - "name": "__common__" - }, - { - "doctype": "DocField", - "in_list_view": 1, - "name": "__common__", - "parent": "UOM Conversion Detail", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "UOM Conversion Detail" - }, - { - "doctype": "DocField", - "fieldname": "uom", - "fieldtype": "Link", - "label": "UOM", - "oldfieldname": "uom", - "oldfieldtype": "Link", - "options": "UOM" - }, - { - "doctype": "DocField", - "fieldname": "conversion_factor", - "fieldtype": "Float", - "label": "Conversion Factor", - "oldfieldname": "conversion_factor", - "oldfieldtype": "Float" - } -] \ No newline at end of file +{ + "autoname": "UCDD/.#####", + "creation": "2013-02-22 01:28:04", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "uom", + "fieldtype": "Link", + "in_list_view": 1, + "label": "UOM", + "oldfieldname": "uom", + "oldfieldtype": "Link", + "options": "UOM", + "permlevel": 0 + }, + { + "fieldname": "conversion_factor", + "fieldtype": "Float", + "in_list_view": 1, + "label": "Conversion Factor", + "oldfieldname": "conversion_factor", + "oldfieldtype": "Float", + "permlevel": 0 + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:21:53", + "modified_by": "Administrator", + "module": "Stock", + "name": "UOM Conversion Detail", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/stock/doctype/warehouse/warehouse.txt b/erpnext/stock/doctype/warehouse/warehouse.txt index 589fa99c11..1831f35bbb 100644 --- a/erpnext/stock/doctype/warehouse/warehouse.txt +++ b/erpnext/stock/doctype/warehouse/warehouse.txt @@ -1,218 +1,215 @@ -[ - { - "creation": "2013-03-07 18:50:32", - "docstatus": 0, - "modified": "2014-03-13 16:26:29", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "allow_rename": 1, - "description": "A logical Warehouse against which stock entries are made.", - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-building", - "module": "Stock", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Warehouse", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Warehouse", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1 - }, - { - "doctype": "DocType", - "name": "Warehouse" - }, - { - "doctype": "DocField", - "fieldname": "warehouse_detail", - "fieldtype": "Section Break", - "label": "Warehouse Detail", - "oldfieldtype": "Section Break", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "warehouse_name", - "fieldtype": "Data", - "label": "Warehouse Name", - "oldfieldname": "warehouse_name", - "oldfieldtype": "Data", - "read_only": 0, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "in_filter": 1, - "label": "Company", - "oldfieldname": "company", - "oldfieldtype": "Link", - "options": "Company", - "read_only": 0, - "reqd": 1, - "search_index": 1 - }, - { - "depends_on": "eval:sys_defaults.auto_accounting_for_stock", - "description": "Account for the warehouse (Perpetual Inventory) will be created under this Account.", - "doctype": "DocField", - "fieldname": "create_account_under", - "fieldtype": "Link", - "label": "Parent Account", - "options": "Account" - }, - { - "doctype": "DocField", - "fieldname": "disabled", - "fieldtype": "Check", - "label": "Disabled" - }, - { - "description": "For Reference Only.", - "doctype": "DocField", - "fieldname": "warehouse_contact_info", - "fieldtype": "Section Break", - "label": "Warehouse Contact Info", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "email_id", - "fieldtype": "Data", - "hidden": 1, - "label": "Email Id", - "oldfieldname": "email_id", - "oldfieldtype": "Data", - "print_hide": 0, - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "phone_no", - "fieldtype": "Data", - "label": "Phone No", - "oldfieldname": "phone_no", - "oldfieldtype": "Int", - "options": "Phone", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "mobile_no", - "fieldtype": "Data", - "label": "Mobile No", - "oldfieldname": "mobile_no", - "oldfieldtype": "Int", - "options": "Phone", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "address_line_1", - "fieldtype": "Data", - "label": "Address Line 1", - "oldfieldname": "address_line_1", - "oldfieldtype": "Data", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "address_line_2", - "fieldtype": "Data", - "label": "Address Line 2", - "oldfieldname": "address_line_2", - "oldfieldtype": "Data", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "city", - "fieldtype": "Data", - "in_list_view": 1, - "label": "City", - "oldfieldname": "city", - "oldfieldtype": "Data", - "read_only": 0, - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "state", - "fieldtype": "Data", - "label": "State", - "oldfieldname": "state", - "oldfieldtype": "Select", - "options": "Suggest", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "pin", - "fieldtype": "Int", - "label": "PIN", - "oldfieldname": "pin", - "oldfieldtype": "Int", - "read_only": 0 - }, - { - "amend": 0, - "cancel": 0, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "role": "Material Master Manager", - "submit": 0, - "write": 1 - }, - { - "amend": 0, - "cancel": 0, - "create": 0, - "delete": 0, - "doctype": "DocPerm", - "role": "Material User", - "submit": 0, - "write": 0 - }, - { - "delete": 0, - "doctype": "DocPerm", - "role": "Sales User" - }, - { - "delete": 0, - "doctype": "DocPerm", - "role": "Purchase User" - }, - { - "delete": 0, - "doctype": "DocPerm", - "role": "Accounts User" - } -] \ No newline at end of file +{ + "allow_import": 1, + "allow_rename": 1, + "creation": "2013-03-07 18:50:32", + "description": "A logical Warehouse against which stock entries are made.", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "warehouse_detail", + "fieldtype": "Section Break", + "label": "Warehouse Detail", + "oldfieldtype": "Section Break", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "warehouse_name", + "fieldtype": "Data", + "label": "Warehouse Name", + "oldfieldname": "warehouse_name", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 0, + "reqd": 1 + }, + { + "fieldname": "company", + "fieldtype": "Link", + "in_filter": 1, + "label": "Company", + "oldfieldname": "company", + "oldfieldtype": "Link", + "options": "Company", + "permlevel": 0, + "read_only": 0, + "reqd": 1, + "search_index": 1 + }, + { + "depends_on": "eval:sys_defaults.auto_accounting_for_stock", + "description": "Account for the warehouse (Perpetual Inventory) will be created under this Account.", + "fieldname": "create_account_under", + "fieldtype": "Link", + "label": "Parent Account", + "options": "Account", + "permlevel": 0 + }, + { + "fieldname": "disabled", + "fieldtype": "Check", + "label": "Disabled", + "permlevel": 0 + }, + { + "description": "For Reference Only.", + "fieldname": "warehouse_contact_info", + "fieldtype": "Section Break", + "label": "Warehouse Contact Info", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "email_id", + "fieldtype": "Data", + "hidden": 1, + "label": "Email Id", + "oldfieldname": "email_id", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 0, + "read_only": 0 + }, + { + "fieldname": "phone_no", + "fieldtype": "Data", + "label": "Phone No", + "oldfieldname": "phone_no", + "oldfieldtype": "Int", + "options": "Phone", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "mobile_no", + "fieldtype": "Data", + "label": "Mobile No", + "oldfieldname": "mobile_no", + "oldfieldtype": "Int", + "options": "Phone", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "address_line_1", + "fieldtype": "Data", + "label": "Address Line 1", + "oldfieldname": "address_line_1", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "address_line_2", + "fieldtype": "Data", + "label": "Address Line 2", + "oldfieldname": "address_line_2", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "city", + "fieldtype": "Data", + "in_list_view": 1, + "label": "City", + "oldfieldname": "city", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 0, + "reqd": 0 + }, + { + "fieldname": "state", + "fieldtype": "Data", + "label": "State", + "oldfieldname": "state", + "oldfieldtype": "Select", + "options": "Suggest", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "pin", + "fieldtype": "Int", + "label": "PIN", + "oldfieldname": "pin", + "oldfieldtype": "Int", + "permlevel": 0, + "read_only": 0 + } + ], + "icon": "icon-building", + "idx": 1, + "modified": "2014-03-13 16:26:29", + "modified_by": "Administrator", + "module": "Stock", + "name": "Warehouse", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material Master Manager", + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 0, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Material User", + "submit": 0, + "write": 0 + }, + { + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales User" + }, + { + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase User" + }, + { + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts User" + } + ] +} \ No newline at end of file diff --git a/erpnext/stock/doctype/warehouse_user/warehouse_user.txt b/erpnext/stock/doctype/warehouse_user/warehouse_user.txt index ae22eecd77..8c34697968 100644 --- a/erpnext/stock/doctype/warehouse_user/warehouse_user.txt +++ b/erpnext/stock/doctype/warehouse_user/warehouse_user.txt @@ -1,38 +1,25 @@ -[ - { - "creation": "2013-02-22 01:28:05", - "docstatus": 0, - "modified": "2013-12-20 19:21:54", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "document_type": "Other", - "istable": 1, - "module": "Stock", - "name": "__common__" - }, - { - "doctype": "DocField", - "fieldname": "user", - "fieldtype": "Link", - "in_list_view": 1, - "label": "User", - "name": "__common__", - "options": "User", - "parent": "Warehouse User", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0, - "print_width": "200px", - "width": "200px" - }, - { - "doctype": "DocType", - "name": "Warehouse User" - }, - { - "doctype": "DocField" - } -] \ No newline at end of file +{ + "creation": "2013-02-22 01:28:05", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Other", + "fields": [ + { + "fieldname": "user", + "fieldtype": "Link", + "in_list_view": 1, + "label": "User", + "options": "User", + "permlevel": 0, + "print_width": "200px", + "width": "200px" + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:21:54", + "modified_by": "Administrator", + "module": "Stock", + "name": "Warehouse User", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/stock/page/stock_ageing/stock_ageing.txt b/erpnext/stock/page/stock_ageing/stock_ageing.txt index cd1cfbd1c9..29d52ffd54 100644 --- a/erpnext/stock/page/stock_ageing/stock_ageing.txt +++ b/erpnext/stock/page/stock_ageing/stock_ageing.txt @@ -1,37 +1,23 @@ -[ - { - "creation": "2012-09-21 20:15:14", - "docstatus": 0, - "modified": "2013-07-11 14:44:08", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Page", - "icon": "icon-table", - "module": "Stock", - "name": "__common__", - "page_name": "stock-ageing", - "standard": "Yes", - "title": "Stock Ageing" - }, - { - "doctype": "Page Role", - "name": "__common__", - "parent": "stock-ageing", - "parentfield": "roles", - "parenttype": "Page" - }, - { - "doctype": "Page", - "name": "stock-ageing" - }, - { - "doctype": "Page Role", - "role": "Analytics" - }, - { - "doctype": "Page Role", - "role": "Material Manager" - } -] \ No newline at end of file +{ + "creation": "2012-09-21 20:15:14", + "docstatus": 0, + "doctype": "Page", + "icon": "icon-table", + "idx": 1, + "modified": "2013-07-11 14:44:08", + "modified_by": "Administrator", + "module": "Stock", + "name": "stock-ageing", + "owner": "Administrator", + "page_name": "stock-ageing", + "roles": [ + { + "role": "Analytics" + }, + { + "role": "Material Manager" + } + ], + "standard": "Yes", + "title": "Stock Ageing" +} \ No newline at end of file diff --git a/erpnext/stock/page/stock_analytics/stock_analytics.txt b/erpnext/stock/page/stock_analytics/stock_analytics.txt index 140b1024f7..f732a9a6c6 100644 --- a/erpnext/stock/page/stock_analytics/stock_analytics.txt +++ b/erpnext/stock/page/stock_analytics/stock_analytics.txt @@ -1,37 +1,23 @@ -[ - { - "creation": "2012-09-21 20:15:14", - "docstatus": 0, - "modified": "2013-07-11 14:44:10", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Page", - "icon": "icon-bar-chart", - "module": "Stock", - "name": "__common__", - "page_name": "stock-analytics", - "standard": "Yes", - "title": "Stock Analytics" - }, - { - "doctype": "Page Role", - "name": "__common__", - "parent": "stock-analytics", - "parentfield": "roles", - "parenttype": "Page" - }, - { - "doctype": "Page", - "name": "stock-analytics" - }, - { - "doctype": "Page Role", - "role": "Analytics" - }, - { - "doctype": "Page Role", - "role": "Material Manager" - } -] \ No newline at end of file +{ + "creation": "2012-09-21 20:15:14", + "docstatus": 0, + "doctype": "Page", + "icon": "icon-bar-chart", + "idx": 1, + "modified": "2013-07-11 14:44:10", + "modified_by": "Administrator", + "module": "Stock", + "name": "stock-analytics", + "owner": "Administrator", + "page_name": "stock-analytics", + "roles": [ + { + "role": "Analytics" + }, + { + "role": "Material Manager" + } + ], + "standard": "Yes", + "title": "Stock Analytics" +} \ No newline at end of file diff --git a/erpnext/stock/page/stock_balance/stock_balance.txt b/erpnext/stock/page/stock_balance/stock_balance.txt index 536448c072..4c99474daa 100644 --- a/erpnext/stock/page/stock_balance/stock_balance.txt +++ b/erpnext/stock/page/stock_balance/stock_balance.txt @@ -1,37 +1,23 @@ -[ - { - "creation": "2012-12-27 18:57:47", - "docstatus": 0, - "modified": "2013-07-11 14:44:15", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Page", - "icon": "icon-table", - "module": "Stock", - "name": "__common__", - "page_name": "stock-balance", - "standard": "Yes", - "title": "Stock Balance" - }, - { - "doctype": "Page Role", - "name": "__common__", - "parent": "stock-balance", - "parentfield": "roles", - "parenttype": "Page" - }, - { - "doctype": "Page", - "name": "stock-balance" - }, - { - "doctype": "Page Role", - "role": "Material Manager" - }, - { - "doctype": "Page Role", - "role": "Analytics" - } -] \ No newline at end of file +{ + "creation": "2012-12-27 18:57:47", + "docstatus": 0, + "doctype": "Page", + "icon": "icon-table", + "idx": 1, + "modified": "2013-07-11 14:44:15", + "modified_by": "Administrator", + "module": "Stock", + "name": "stock-balance", + "owner": "Administrator", + "page_name": "stock-balance", + "roles": [ + { + "role": "Material Manager" + }, + { + "role": "Analytics" + } + ], + "standard": "Yes", + "title": "Stock Balance" +} \ No newline at end of file diff --git a/erpnext/stock/page/stock_ledger/stock_ledger.txt b/erpnext/stock/page/stock_ledger/stock_ledger.txt index 9c2a4b75e5..f031627a2c 100644 --- a/erpnext/stock/page/stock_ledger/stock_ledger.txt +++ b/erpnext/stock/page/stock_ledger/stock_ledger.txt @@ -1,41 +1,26 @@ -[ - { - "creation": "2012-09-21 20:15:14", - "docstatus": 0, - "modified": "2013-07-11 14:44:19", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Page", - "icon": "icon-table", - "module": "Stock", - "name": "__common__", - "page_name": "stock-ledger", - "standard": "Yes", - "title": "Stock Ledger" - }, - { - "doctype": "Page Role", - "name": "__common__", - "parent": "stock-ledger", - "parentfield": "roles", - "parenttype": "Page" - }, - { - "doctype": "Page", - "name": "stock-ledger" - }, - { - "doctype": "Page Role", - "role": "Analytics" - }, - { - "doctype": "Page Role", - "role": "Material Manager" - }, - { - "doctype": "Page Role", - "role": "Material User" - } -] \ No newline at end of file +{ + "creation": "2012-09-21 20:15:14", + "docstatus": 0, + "doctype": "Page", + "icon": "icon-table", + "idx": 1, + "modified": "2013-07-11 14:44:19", + "modified_by": "Administrator", + "module": "Stock", + "name": "stock-ledger", + "owner": "Administrator", + "page_name": "stock-ledger", + "roles": [ + { + "role": "Analytics" + }, + { + "role": "Material Manager" + }, + { + "role": "Material User" + } + ], + "standard": "Yes", + "title": "Stock Ledger" +} \ No newline at end of file diff --git a/erpnext/stock/page/stock_level/stock_level.txt b/erpnext/stock/page/stock_level/stock_level.txt index bae3d9c9b2..2026d1dc40 100644 --- a/erpnext/stock/page/stock_level/stock_level.txt +++ b/erpnext/stock/page/stock_level/stock_level.txt @@ -1,37 +1,23 @@ -[ - { - "creation": "2012-12-31 10:52:14", - "docstatus": 0, - "modified": "2013-07-11 14:44:21", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Page", - "icon": "icon-table", - "module": "Stock", - "name": "__common__", - "page_name": "stock-level", - "standard": "Yes", - "title": "Stock Level" - }, - { - "doctype": "Page Role", - "name": "__common__", - "parent": "stock-level", - "parentfield": "roles", - "parenttype": "Page" - }, - { - "doctype": "Page", - "name": "stock-level" - }, - { - "doctype": "Page Role", - "role": "Material Manager" - }, - { - "doctype": "Page Role", - "role": "Analytics" - } -] \ No newline at end of file +{ + "creation": "2012-12-31 10:52:14", + "docstatus": 0, + "doctype": "Page", + "icon": "icon-table", + "idx": 1, + "modified": "2013-07-11 14:44:21", + "modified_by": "Administrator", + "module": "Stock", + "name": "stock-level", + "owner": "Administrator", + "page_name": "stock-level", + "roles": [ + { + "role": "Material Manager" + }, + { + "role": "Analytics" + } + ], + "standard": "Yes", + "title": "Stock Level" +} \ No newline at end of file diff --git a/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.txt b/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.txt index 6a70042ffd..6fdbf93afe 100644 --- a/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.txt +++ b/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-06-04 11:03:47", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Report", - "is_standard": "Yes", - "module": "Stock", - "name": "__common__", - "ref_doctype": "Stock Ledger Entry", - "report_name": "Batch-Wise Balance History", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Batch-Wise Balance History" - } -] \ No newline at end of file +{ + "creation": "2013-06-04 11:03:47", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Stock", + "name": "Batch-Wise Balance History", + "owner": "Administrator", + "ref_doctype": "Stock Ledger Entry", + "report_name": "Batch-Wise Balance History", + "report_type": "Script Report" +} \ No newline at end of file diff --git a/erpnext/stock/report/delivery_note_trends/delivery_note_trends.txt b/erpnext/stock/report/delivery_note_trends/delivery_note_trends.txt index 2d7c9536da..99c086d75d 100644 --- a/erpnext/stock/report/delivery_note_trends/delivery_note_trends.txt +++ b/erpnext/stock/report/delivery_note_trends/delivery_note_trends.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-06-13 18:42:11", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Report", - "is_standard": "Yes", - "module": "Stock", - "name": "__common__", - "ref_doctype": "Delivery Note", - "report_name": "Delivery Note Trends", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Delivery Note Trends" - } -] \ No newline at end of file +{ + "creation": "2013-06-13 18:42:11", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Stock", + "name": "Delivery Note Trends", + "owner": "Administrator", + "ref_doctype": "Delivery Note", + "report_name": "Delivery Note Trends", + "report_type": "Script Report" +} \ No newline at end of file diff --git a/erpnext/stock/report/item_prices/item_prices.txt b/erpnext/stock/report/item_prices/item_prices.txt index e5e96347c6..8e62bcd2da 100644 --- a/erpnext/stock/report/item_prices/item_prices.txt +++ b/erpnext/stock/report/item_prices/item_prices.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-06-05 11:43:30", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Report", - "is_standard": "Yes", - "module": "Stock", - "name": "__common__", - "ref_doctype": "Stock Ledger Entry", - "report_name": "Item Prices", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Item Prices" - } -] \ No newline at end of file +{ + "creation": "2013-06-05 11:43:30", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Stock", + "name": "Item Prices", + "owner": "Administrator", + "ref_doctype": "Stock Ledger Entry", + "report_name": "Item Prices", + "report_type": "Script Report" +} \ No newline at end of file diff --git a/erpnext/stock/report/item_shortage_report/item_shortage_report.txt b/erpnext/stock/report/item_shortage_report/item_shortage_report.txt index 615c373986..4a505cc456 100644 --- a/erpnext/stock/report/item_shortage_report/item_shortage_report.txt +++ b/erpnext/stock/report/item_shortage_report/item_shortage_report.txt @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-08-20 13:43:30", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Report", - "is_standard": "Yes", - "json": "{\"filters\":[[\"Bin\",\"projected_qty\",\"<\",\"0\"]],\"columns\":[[\"warehouse\",\"Bin\"],[\"item_code\",\"Bin\"],[\"actual_qty\",\"Bin\"],[\"ordered_qty\",\"Bin\"],[\"planned_qty\",\"Bin\"],[\"reserved_qty\",\"Bin\"],[\"projected_qty\",\"Bin\"]],\"sort_by\":\"Bin.projected_qty\",\"sort_order\":\"asc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}", - "module": "Stock", - "name": "__common__", - "ref_doctype": "Bin", - "report_name": "Item Shortage Report", - "report_type": "Report Builder" - }, - { - "doctype": "Report", - "name": "Item Shortage Report" - } -] \ No newline at end of file +{ + "creation": "2013-08-20 13:43:30", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "json": "{\"filters\":[[\"Bin\",\"projected_qty\",\"<\",\"0\"]],\"columns\":[[\"warehouse\",\"Bin\"],[\"item_code\",\"Bin\"],[\"actual_qty\",\"Bin\"],[\"ordered_qty\",\"Bin\"],[\"planned_qty\",\"Bin\"],[\"reserved_qty\",\"Bin\"],[\"projected_qty\",\"Bin\"]],\"sort_by\":\"Bin.projected_qty\",\"sort_order\":\"asc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Stock", + "name": "Item Shortage Report", + "owner": "Administrator", + "ref_doctype": "Bin", + "report_name": "Item Shortage Report", + "report_type": "Report Builder" +} \ No newline at end of file diff --git a/erpnext/stock/report/item_wise_price_list_rate/item_wise_price_list_rate.txt b/erpnext/stock/report/item_wise_price_list_rate/item_wise_price_list_rate.txt index 14b0872943..962db3747a 100644 --- a/erpnext/stock/report/item_wise_price_list_rate/item_wise_price_list_rate.txt +++ b/erpnext/stock/report/item_wise_price_list_rate/item_wise_price_list_rate.txt @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-09-25 10:21:15", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Report", - "is_standard": "Yes", - "json": "{\"filters\":[[\"Item Price\",\"price_list\",\"like\",\"%\"],[\"Item Price\",\"item_code\",\"like\",\"%\"]],\"columns\":[[\"name\",\"Item Price\"],[\"price_list\",\"Item Price\"],[\"item_code\",\"Item Price\"],[\"item_name\",\"Item Price\"],[\"item_description\",\"Item Price\"],[\"ref_rate\",\"Item Price\"],[\"buying\",\"Item Price\"],[\"selling\",\"Item Price\"],[\"currency\",\"Item Price\"]],\"sort_by\":\"Item Price.modified\",\"sort_order\":\"desc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}", - "module": "Stock", - "name": "__common__", - "ref_doctype": "Price List", - "report_name": "Item-wise Price List Rate", - "report_type": "Report Builder" - }, - { - "doctype": "Report", - "name": "Item-wise Price List Rate" - } -] \ No newline at end of file +{ + "creation": "2013-09-25 10:21:15", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "json": "{\"filters\":[[\"Item Price\",\"price_list\",\"like\",\"%\"],[\"Item Price\",\"item_code\",\"like\",\"%\"]],\"columns\":[[\"name\",\"Item Price\"],[\"price_list\",\"Item Price\"],[\"item_code\",\"Item Price\"],[\"item_name\",\"Item Price\"],[\"item_description\",\"Item Price\"],[\"ref_rate\",\"Item Price\"],[\"buying\",\"Item Price\"],[\"selling\",\"Item Price\"],[\"currency\",\"Item Price\"]],\"sort_by\":\"Item Price.modified\",\"sort_order\":\"desc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Stock", + "name": "Item-wise Price List Rate", + "owner": "Administrator", + "ref_doctype": "Price List", + "report_name": "Item-wise Price List Rate", + "report_type": "Report Builder" +} \ No newline at end of file diff --git a/erpnext/stock/report/items_to_be_requested/items_to_be_requested.txt b/erpnext/stock/report/items_to_be_requested/items_to_be_requested.txt index 97f45ce0ff..f392693c27 100644 --- a/erpnext/stock/report/items_to_be_requested/items_to_be_requested.txt +++ b/erpnext/stock/report/items_to_be_requested/items_to_be_requested.txt @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-08-20 15:08:10", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Report", - "is_standard": "Yes", - "module": "Stock", - "name": "__common__", - "query": "SELECT\n tabBin.item_code as \"Item:Link/Item:120\",\n tabBin.warehouse as \"Warehouse:Link/Warehouse:120\",\n tabBin.actual_qty as \"Actual:Float:90\",\n tabBin.indented_qty as \"Requested:Float:90\",\n tabBin.reserved_qty as \"Reserved:Float:90\",\n tabBin.ordered_qty as \"Ordered:Float:90\",\n tabBin.projected_qty as \"Projected:Float:90\"\nFROM\n tabBin, tabItem\nWHERE\n tabBin.item_code = tabItem.name\n AND tabItem.is_purchase_item = \"Yes\"\n AND tabBin.projected_qty < 0\nORDER BY\n tabBin.projected_qty ASC", - "ref_doctype": "Item", - "report_name": "Items To Be Requested", - "report_type": "Query Report" - }, - { - "doctype": "Report", - "name": "Items To Be Requested" - } -] \ No newline at end of file +{ + "creation": "2013-08-20 15:08:10", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Stock", + "name": "Items To Be Requested", + "owner": "Administrator", + "query": "SELECT\n tabBin.item_code as \"Item:Link/Item:120\",\n tabBin.warehouse as \"Warehouse:Link/Warehouse:120\",\n tabBin.actual_qty as \"Actual:Float:90\",\n tabBin.indented_qty as \"Requested:Float:90\",\n tabBin.reserved_qty as \"Reserved:Float:90\",\n tabBin.ordered_qty as \"Ordered:Float:90\",\n tabBin.projected_qty as \"Projected:Float:90\"\nFROM\n tabBin, tabItem\nWHERE\n tabBin.item_code = tabItem.name\n AND tabItem.is_purchase_item = \"Yes\"\n AND tabBin.projected_qty < 0\nORDER BY\n tabBin.projected_qty ASC", + "ref_doctype": "Item", + "report_name": "Items To Be Requested", + "report_type": "Query Report" +} \ No newline at end of file diff --git a/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.txt b/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.txt index 5f6cad974d..b7284223db 100644 --- a/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.txt +++ b/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-06-07 12:47:22", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Report", - "is_standard": "Yes", - "module": "Stock", - "name": "__common__", - "ref_doctype": "Item", - "report_name": "Itemwise Recommended Reorder Level", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Itemwise Recommended Reorder Level" - } -] \ No newline at end of file +{ + "creation": "2013-06-07 12:47:22", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Stock", + "name": "Itemwise Recommended Reorder Level", + "owner": "Administrator", + "ref_doctype": "Item", + "report_name": "Itemwise Recommended Reorder Level", + "report_type": "Script Report" +} \ No newline at end of file diff --git a/erpnext/stock/report/material_requests_for_which_supplier_quotations_are_not_created/material_requests_for_which_supplier_quotations_are_not_created.txt b/erpnext/stock/report/material_requests_for_which_supplier_quotations_are_not_created/material_requests_for_which_supplier_quotations_are_not_created.txt index 05f7afbf61..af1a310b12 100644 --- a/erpnext/stock/report/material_requests_for_which_supplier_quotations_are_not_created/material_requests_for_which_supplier_quotations_are_not_created.txt +++ b/erpnext/stock/report/material_requests_for_which_supplier_quotations_are_not_created/material_requests_for_which_supplier_quotations_are_not_created.txt @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-08-09 12:20:58", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Report", - "is_standard": "Yes", - "module": "Stock", - "name": "__common__", - "query": "select \n mr.name as \"Material Request:Link/Material Request:120\",\n mr.transaction_date as \"Date:Date:100\",\n\tmr_item.item_code as \"Item Code:Link/Item:120\",\n\tmr_item.qty as \"Qty: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\"\n\tand not exists(select name from `tabSupplier Quotation Item` where prevdoc_docname=mr.name)\norder by mr.transaction_date asc", - "ref_doctype": "Material Request", - "report_name": "Material Requests for which Supplier Quotations are not created", - "report_type": "Query Report" - }, - { - "doctype": "Report", - "name": "Material Requests for which Supplier Quotations are not created" - } -] \ No newline at end of file +{ + "creation": "2013-08-09 12:20:58", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Stock", + "name": "Material Requests for which Supplier Quotations are not created", + "owner": "Administrator", + "query": "select \n mr.name as \"Material Request:Link/Material Request:120\",\n mr.transaction_date as \"Date:Date:100\",\n\tmr_item.item_code as \"Item Code:Link/Item:120\",\n\tmr_item.qty as \"Qty: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\"\n\tand not exists(select name from `tabSupplier Quotation Item` where prevdoc_docname=mr.name)\norder by mr.transaction_date asc", + "ref_doctype": "Material Request", + "report_name": "Material Requests for which Supplier Quotations are not created", + "report_type": "Query Report" +} \ No newline at end of file diff --git a/erpnext/stock/report/ordered_items_to_be_delivered/ordered_items_to_be_delivered.txt b/erpnext/stock/report/ordered_items_to_be_delivered/ordered_items_to_be_delivered.txt index a0a34b99a5..a8f4cdf0eb 100644 --- a/erpnext/stock/report/ordered_items_to_be_delivered/ordered_items_to_be_delivered.txt +++ b/erpnext/stock/report/ordered_items_to_be_delivered/ordered_items_to_be_delivered.txt @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-02-22 18:01:55", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Report", - "is_standard": "Yes", - "module": "Stock", - "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`.`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`.qty as \"Qty:Float:140\",\n `tabSales Order Item`.delivered_qty as \"Delivered Qty:Float:140\",\n (`tabSales Order Item`.qty - ifnull(`tabSales Order Item`.delivered_qty, 0)) as \"Qty to Deliver:Float:140\",\n `tabSales Order Item`.base_amount as \"Amount:Float:140\",\n `tabSales Order`.`delivery_date` as \"Expected Delivery Date:Date:120\",\n `tabSales Order Item`.item_name as \"Item Name::150\",\n `tabSales Order Item`.description as \"Description::200\",\n `tabSales Order Item`.item_group as \"Item Group:Link/Item Group:120\"\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`.delivered_qty,0) < ifnull(`tabSales Order Item`.qty,0)\norder by `tabSales Order`.transaction_date asc", - "ref_doctype": "Delivery Note", - "report_name": "Ordered Items To Be Delivered", - "report_type": "Query Report" - }, - { - "doctype": "Report", - "name": "Ordered Items To Be Delivered" - } -] \ No newline at end of file +{ + "creation": "2013-02-22 18:01:55", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Stock", + "name": "Ordered Items To Be Delivered", + "owner": "Administrator", + "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`.`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`.qty as \"Qty:Float:140\",\n `tabSales Order Item`.delivered_qty as \"Delivered Qty:Float:140\",\n (`tabSales Order Item`.qty - ifnull(`tabSales Order Item`.delivered_qty, 0)) as \"Qty to Deliver:Float:140\",\n `tabSales Order Item`.base_amount as \"Amount:Float:140\",\n `tabSales Order`.`delivery_date` as \"Expected Delivery Date:Date:120\",\n `tabSales Order Item`.item_name as \"Item Name::150\",\n `tabSales Order Item`.description as \"Description::200\",\n `tabSales Order Item`.item_group as \"Item Group:Link/Item Group:120\"\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`.delivered_qty,0) < ifnull(`tabSales Order Item`.qty,0)\norder by `tabSales Order`.transaction_date asc", + "ref_doctype": "Delivery Note", + "report_name": "Ordered Items To Be Delivered", + "report_type": "Query Report" +} \ No newline at end of file diff --git a/erpnext/stock/report/purchase_in_transit/purchase_in_transit.txt b/erpnext/stock/report/purchase_in_transit/purchase_in_transit.txt index d0e17e0ab3..c88b366c03 100644 --- a/erpnext/stock/report/purchase_in_transit/purchase_in_transit.txt +++ b/erpnext/stock/report/purchase_in_transit/purchase_in_transit.txt @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-05-06 12:09:05", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Report", - "is_standard": "Yes", - "module": "Stock", - "name": "__common__", - "query": "SELECT\n pi.name as \"Purchase Invoice:Link/Purchase Invoice:120\",\n\tpi.posting_date as \"Posting Date:Date:100\",\n\tpi.credit_to as \"Supplier Account:Link/Account:120\",\n\tpi_item.item_code as \"Item Code:Link/Item:120\",\n\tpi_item.description as \"Description:Data:140\",\n\tpi_item.qty as \"Qty:Float:120\",\n\tpi_item.base_amount as \"Amount:Currency:120\",\n\tpi_item.purchase_order as \"Purchase Order:Link/Purchase Order:120\",\n\tpi_item.purchase_receipt as \"Purchase Receipt:Link/Purchase Receipt:120\",\n\tpr.posting_date as \"PR Posting Date:Date:130\",\n\tpi.company as \"Company:Link/Company:120\"\nFROM\n\t`tabPurchase Invoice` pi, `tabPurchase Invoice Item` pi_item, `tabPurchase Receipt` pr\nWHERE\n\tpi.name = pi_item.parent and pi_item.purchase_receipt = pr.name\n\tand pi.docstatus = 1 and pr.posting_date > pi.posting_date\nORDER BY\n\tpi.name desc", - "ref_doctype": "Purchase Receipt", - "report_name": "Purchase In Transit", - "report_type": "Query Report" - }, - { - "doctype": "Report", - "name": "Purchase In Transit" - } -] \ No newline at end of file +{ + "creation": "2013-05-06 12:09:05", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Stock", + "name": "Purchase In Transit", + "owner": "Administrator", + "query": "SELECT\n pi.name as \"Purchase Invoice:Link/Purchase Invoice:120\",\n\tpi.posting_date as \"Posting Date:Date:100\",\n\tpi.credit_to as \"Supplier Account:Link/Account:120\",\n\tpi_item.item_code as \"Item Code:Link/Item:120\",\n\tpi_item.description as \"Description:Data:140\",\n\tpi_item.qty as \"Qty:Float:120\",\n\tpi_item.base_amount as \"Amount:Currency:120\",\n\tpi_item.purchase_order as \"Purchase Order:Link/Purchase Order:120\",\n\tpi_item.purchase_receipt as \"Purchase Receipt:Link/Purchase Receipt:120\",\n\tpr.posting_date as \"PR Posting Date:Date:130\",\n\tpi.company as \"Company:Link/Company:120\"\nFROM\n\t`tabPurchase Invoice` pi, `tabPurchase Invoice Item` pi_item, `tabPurchase Receipt` pr\nWHERE\n\tpi.name = pi_item.parent and pi_item.purchase_receipt = pr.name\n\tand pi.docstatus = 1 and pr.posting_date > pi.posting_date\nORDER BY\n\tpi.name desc", + "ref_doctype": "Purchase Receipt", + "report_name": "Purchase In Transit", + "report_type": "Query Report" +} \ No newline at end of file diff --git a/erpnext/stock/report/purchase_order_items_to_be_received/purchase_order_items_to_be_received.txt b/erpnext/stock/report/purchase_order_items_to_be_received/purchase_order_items_to_be_received.txt index 41aa05e6a2..529544a210 100644 --- a/erpnext/stock/report/purchase_order_items_to_be_received/purchase_order_items_to_be_received.txt +++ b/erpnext/stock/report/purchase_order_items_to_be_received/purchase_order_items_to_be_received.txt @@ -1,24 +1,17 @@ -[ - { - "creation": "2013-02-22 18:01:55", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "add_total_row": 1, - "doctype": "Report", - "is_standard": "Yes", - "module": "Stock", - "name": "__common__", - "query": "select \n `tabPurchase Order`.`name` as \"Purchase Order:Link/Purchase Order:120\",\n\t`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`.qty as \"Qty:Float:100\",\n\t`tabPurchase Order Item`.received_qty as \"Received Qty:Float:100\", \n\t(`tabPurchase Order Item`.qty - ifnull(`tabPurchase Order Item`.received_qty, 0)) as \"Qty to Receive:Float:100\",\n `tabPurchase Order Item`.warehouse as \"Warehouse:Link/Warehouse:150\",\n\t`tabPurchase Order Item`.item_name as \"Item Name::150\",\n\t`tabPurchase Order Item`.description as \"Description::200\",\n `tabPurchase Order Item`.brand as \"Brand::100\"\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`.received_qty, 0) < ifnull(`tabPurchase Order Item`.qty, 0)\norder by `tabPurchase Order`.transaction_date asc", - "ref_doctype": "Purchase Receipt", - "report_name": "Purchase Order Items To Be Received", - "report_type": "Query Report" - }, - { - "doctype": "Report", - "name": "Purchase Order Items To Be Received" - } -] \ No newline at end of file +{ + "add_total_row": 1, + "creation": "2013-02-22 18:01:55", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Stock", + "name": "Purchase Order Items To Be Received", + "owner": "Administrator", + "query": "select \n `tabPurchase Order`.`name` as \"Purchase Order:Link/Purchase Order:120\",\n\t`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`.qty as \"Qty:Float:100\",\n\t`tabPurchase Order Item`.received_qty as \"Received Qty:Float:100\", \n\t(`tabPurchase Order Item`.qty - ifnull(`tabPurchase Order Item`.received_qty, 0)) as \"Qty to Receive:Float:100\",\n `tabPurchase Order Item`.warehouse as \"Warehouse:Link/Warehouse:150\",\n\t`tabPurchase Order Item`.item_name as \"Item Name::150\",\n\t`tabPurchase Order Item`.description as \"Description::200\",\n `tabPurchase Order Item`.brand as \"Brand::100\"\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`.received_qty, 0) < ifnull(`tabPurchase Order Item`.qty, 0)\norder by `tabPurchase Order`.transaction_date asc", + "ref_doctype": "Purchase Receipt", + "report_name": "Purchase Order Items To Be Received", + "report_type": "Query Report" +} \ No newline at end of file diff --git a/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.txt b/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.txt index 11e0592512..da2dceaa05 100644 --- a/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.txt +++ b/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-06-13 18:45:44", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Report", - "is_standard": "Yes", - "module": "Stock", - "name": "__common__", - "ref_doctype": "Purchase Receipt", - "report_name": "Purchase Receipt Trends", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Purchase Receipt Trends" - } -] \ No newline at end of file +{ + "creation": "2013-06-13 18:45:44", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Stock", + "name": "Purchase Receipt Trends", + "owner": "Administrator", + "ref_doctype": "Purchase Receipt", + "report_name": "Purchase Receipt Trends", + "report_type": "Script Report" +} \ No newline at end of file diff --git a/erpnext/stock/report/requested_items_to_be_transferred/requested_items_to_be_transferred.txt b/erpnext/stock/report/requested_items_to_be_transferred/requested_items_to_be_transferred.txt index c86de91790..b69950788e 100644 --- a/erpnext/stock/report/requested_items_to_be_transferred/requested_items_to_be_transferred.txt +++ b/erpnext/stock/report/requested_items_to_be_transferred/requested_items_to_be_transferred.txt @@ -1,24 +1,17 @@ -[ - { - "creation": "2013-05-13 16:23:05", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "add_total_row": 1, - "doctype": "Report", - "is_standard": "Yes", - "module": "Stock", - "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\tmr_item.qty as \"Qty:Float:100\",\n\tmr_item.ordered_qty as \"Transferred Qty:Float:100\", \n\t(mr_item.qty - ifnull(mr_item.ordered_qty, 0)) as \"Qty to Transfer: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 = \"Transfer\"\n\tand mr.docstatus = 1\n\tand mr.status != \"Stopped\"\n\tand ifnull(mr_item.ordered_qty, 0) < ifnull(mr_item.qty, 0)\norder by mr.transaction_date asc", - "ref_doctype": "Stock Entry", - "report_name": "Requested Items To Be Transferred", - "report_type": "Query Report" - }, - { - "doctype": "Report", - "name": "Requested Items To Be Transferred" - } -] \ No newline at end of file +{ + "add_total_row": 1, + "creation": "2013-05-13 16:23:05", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Stock", + "name": "Requested Items To Be Transferred", + "owner": "Administrator", + "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\tmr_item.qty as \"Qty:Float:100\",\n\tmr_item.ordered_qty as \"Transferred Qty:Float:100\", \n\t(mr_item.qty - ifnull(mr_item.ordered_qty, 0)) as \"Qty to Transfer: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 = \"Transfer\"\n\tand mr.docstatus = 1\n\tand mr.status != \"Stopped\"\n\tand ifnull(mr_item.ordered_qty, 0) < ifnull(mr_item.qty, 0)\norder by mr.transaction_date asc", + "ref_doctype": "Stock Entry", + "report_name": "Requested Items To Be Transferred", + "report_type": "Query Report" +} \ No newline at end of file diff --git a/erpnext/stock/report/serial_no_service_contract_expiry/serial_no_service_contract_expiry.txt b/erpnext/stock/report/serial_no_service_contract_expiry/serial_no_service_contract_expiry.txt index b37b601726..b9718337dd 100644 --- a/erpnext/stock/report/serial_no_service_contract_expiry/serial_no_service_contract_expiry.txt +++ b/erpnext/stock/report/serial_no_service_contract_expiry/serial_no_service_contract_expiry.txt @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-01-14 10:52:58", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Report", - "is_standard": "Yes", - "json": "{\"filters\":[[\"Serial No\",\"status\",\"=\",\"Delivered\"]],\"columns\":[[\"name\",\"Serial No\"],[\"item_code\",\"Serial No\"],[\"amc_expiry_date\",\"Serial No\"],[\"maintenance_status\",\"Serial No\"],[\"delivery_document_no\",\"Serial No\"],[\"customer\",\"Serial No\"],[\"customer_name\",\"Serial No\"],[\"item_name\",\"Serial No\"],[\"description\",\"Serial No\"],[\"item_group\",\"Serial No\"],[\"brand\",\"Serial No\"]],\"sort_by\":\"Serial No.amc_expiry_date\",\"sort_order\":\"asc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}", - "module": "Stock", - "name": "__common__", - "ref_doctype": "Serial No", - "report_name": "Serial No Service Contract Expiry", - "report_type": "Report Builder" - }, - { - "doctype": "Report", - "name": "Serial No Service Contract Expiry" - } -] \ No newline at end of file +{ + "creation": "2013-01-14 10:52:58", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "json": "{\"filters\":[[\"Serial No\",\"status\",\"=\",\"Delivered\"]],\"columns\":[[\"name\",\"Serial No\"],[\"item_code\",\"Serial No\"],[\"amc_expiry_date\",\"Serial No\"],[\"maintenance_status\",\"Serial No\"],[\"delivery_document_no\",\"Serial No\"],[\"customer\",\"Serial No\"],[\"customer_name\",\"Serial No\"],[\"item_name\",\"Serial No\"],[\"description\",\"Serial No\"],[\"item_group\",\"Serial No\"],[\"brand\",\"Serial No\"]],\"sort_by\":\"Serial No.amc_expiry_date\",\"sort_order\":\"asc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Stock", + "name": "Serial No Service Contract Expiry", + "owner": "Administrator", + "ref_doctype": "Serial No", + "report_name": "Serial No Service Contract Expiry", + "report_type": "Report Builder" +} \ No newline at end of file diff --git a/erpnext/stock/report/serial_no_status/serial_no_status.txt b/erpnext/stock/report/serial_no_status/serial_no_status.txt index 68e4c2e315..83bdcd6905 100644 --- a/erpnext/stock/report/serial_no_status/serial_no_status.txt +++ b/erpnext/stock/report/serial_no_status/serial_no_status.txt @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-01-14 10:52:58", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Report", - "is_standard": "Yes", - "json": "{\"filters\":[],\"columns\":[[\"name\",\"Serial No\"],[\"item_code\",\"Serial No\"],[\"warehouse\",\"Serial No\"],[\"status\",\"Serial No\"],[\"item_name\",\"Serial No\"],[\"description\",\"Serial No\"],[\"item_group\",\"Serial No\"],[\"brand\",\"Serial No\"],[\"purchase_document_no\",\"Serial No\"],[\"purchase_date\",\"Serial No\"],[\"customer\",\"Serial No\"],[\"customer_name\",\"Serial No\"],[\"purchase_rate\",\"Serial No\"],[\"delivery_document_no\",\"Serial No\"],[\"delivery_date\",\"Serial No\"],[\"supplier\",\"Serial No\"],[\"supplier_name\",\"Serial No\"]],\"sort_by\":\"Serial No.name\",\"sort_order\":\"desc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}", - "module": "Stock", - "name": "__common__", - "ref_doctype": "Serial No", - "report_name": "Serial No Status", - "report_type": "Report Builder" - }, - { - "doctype": "Report", - "name": "Serial No Status" - } -] \ No newline at end of file +{ + "creation": "2013-01-14 10:52:58", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "json": "{\"filters\":[],\"columns\":[[\"name\",\"Serial No\"],[\"item_code\",\"Serial No\"],[\"warehouse\",\"Serial No\"],[\"status\",\"Serial No\"],[\"item_name\",\"Serial No\"],[\"description\",\"Serial No\"],[\"item_group\",\"Serial No\"],[\"brand\",\"Serial No\"],[\"purchase_document_no\",\"Serial No\"],[\"purchase_date\",\"Serial No\"],[\"customer\",\"Serial No\"],[\"customer_name\",\"Serial No\"],[\"purchase_rate\",\"Serial No\"],[\"delivery_document_no\",\"Serial No\"],[\"delivery_date\",\"Serial No\"],[\"supplier\",\"Serial No\"],[\"supplier_name\",\"Serial No\"]],\"sort_by\":\"Serial No.name\",\"sort_order\":\"desc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Stock", + "name": "Serial No Status", + "owner": "Administrator", + "ref_doctype": "Serial No", + "report_name": "Serial No Status", + "report_type": "Report Builder" +} \ No newline at end of file diff --git a/erpnext/stock/report/serial_no_warranty_expiry/serial_no_warranty_expiry.txt b/erpnext/stock/report/serial_no_warranty_expiry/serial_no_warranty_expiry.txt index 6471a58a1b..4b9da02cb7 100644 --- a/erpnext/stock/report/serial_no_warranty_expiry/serial_no_warranty_expiry.txt +++ b/erpnext/stock/report/serial_no_warranty_expiry/serial_no_warranty_expiry.txt @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-01-14 10:52:58", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Report", - "is_standard": "Yes", - "json": "{\"filters\":[[\"Serial No\",\"status\",\"=\",\"Delivered\"]],\"columns\":[[\"name\",\"Serial No\"],[\"item_code\",\"Serial No\"],[\"warranty_expiry_date\",\"Serial No\"],[\"warranty_period\",\"Serial No\"],[\"maintenance_status\",\"Serial No\"],[\"purchase_document_no\",\"Serial No\"],[\"purchase_date\",\"Serial No\"],[\"supplier\",\"Serial No\"],[\"supplier_name\",\"Serial No\"],[\"delivery_document_no\",\"Serial No\"],[\"delivery_date\",\"Serial No\"],[\"customer\",\"Serial No\"],[\"customer_name\",\"Serial No\"],[\"item_name\",\"Serial No\"],[\"description\",\"Serial No\"],[\"item_group\",\"Serial No\"],[\"brand\",\"Serial No\"]],\"sort_by\":\"Serial No.warranty_expiry_date\",\"sort_order\":\"asc\",\"sort_by_next\":\"\",\"sort_order_next\":\"asc\"}", - "module": "Stock", - "name": "__common__", - "ref_doctype": "Serial No", - "report_name": "Serial No Warranty Expiry", - "report_type": "Report Builder" - }, - { - "doctype": "Report", - "name": "Serial No Warranty Expiry" - } -] \ No newline at end of file +{ + "creation": "2013-01-14 10:52:58", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "json": "{\"filters\":[[\"Serial No\",\"status\",\"=\",\"Delivered\"]],\"columns\":[[\"name\",\"Serial No\"],[\"item_code\",\"Serial No\"],[\"warranty_expiry_date\",\"Serial No\"],[\"warranty_period\",\"Serial No\"],[\"maintenance_status\",\"Serial No\"],[\"purchase_document_no\",\"Serial No\"],[\"purchase_date\",\"Serial No\"],[\"supplier\",\"Serial No\"],[\"supplier_name\",\"Serial No\"],[\"delivery_document_no\",\"Serial No\"],[\"delivery_date\",\"Serial No\"],[\"customer\",\"Serial No\"],[\"customer_name\",\"Serial No\"],[\"item_name\",\"Serial No\"],[\"description\",\"Serial No\"],[\"item_group\",\"Serial No\"],[\"brand\",\"Serial No\"]],\"sort_by\":\"Serial No.warranty_expiry_date\",\"sort_order\":\"asc\",\"sort_by_next\":\"\",\"sort_order_next\":\"asc\"}", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Stock", + "name": "Serial No Warranty Expiry", + "owner": "Administrator", + "ref_doctype": "Serial No", + "report_name": "Serial No Warranty Expiry", + "report_type": "Report Builder" +} \ No newline at end of file diff --git a/erpnext/stock/report/stock_ageing/stock_ageing.txt b/erpnext/stock/report/stock_ageing/stock_ageing.txt index 18a7ec8cb3..bb594e6492 100644 --- a/erpnext/stock/report/stock_ageing/stock_ageing.txt +++ b/erpnext/stock/report/stock_ageing/stock_ageing.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-12-02 17:09:31", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Report", - "is_standard": "Yes", - "module": "Stock", - "name": "__common__", - "ref_doctype": "Item", - "report_name": "Stock Ageing", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Stock Ageing" - } -] \ No newline at end of file +{ + "creation": "2013-12-02 17:09:31", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Stock", + "name": "Stock Ageing", + "owner": "Administrator", + "ref_doctype": "Item", + "report_name": "Stock Ageing", + "report_type": "Script Report" +} \ No newline at end of file diff --git a/erpnext/stock/report/stock_ledger/stock_ledger.txt b/erpnext/stock/report/stock_ledger/stock_ledger.txt index 7da9f93dba..96604cbcc6 100644 --- a/erpnext/stock/report/stock_ledger/stock_ledger.txt +++ b/erpnext/stock/report/stock_ledger/stock_ledger.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-11-29 17:08:23", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Report", - "is_standard": "Yes", - "module": "Stock", - "name": "__common__", - "ref_doctype": "Stock Ledger Entry", - "report_name": "Stock Ledger", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Stock Ledger" - } -] \ No newline at end of file +{ + "creation": "2013-11-29 17:08:23", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Stock", + "name": "Stock Ledger", + "owner": "Administrator", + "ref_doctype": "Stock Ledger Entry", + "report_name": "Stock Ledger", + "report_type": "Script Report" +} \ No newline at end of file diff --git a/erpnext/stock/report/stock_projected_qty/stock_projected_qty.txt b/erpnext/stock/report/stock_projected_qty/stock_projected_qty.txt index 4eb46c5ea0..db603d5b8c 100644 --- a/erpnext/stock/report/stock_projected_qty/stock_projected_qty.txt +++ b/erpnext/stock/report/stock_projected_qty/stock_projected_qty.txt @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-12-04 18:21:56", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "add_total_row": 1, - "doctype": "Report", - "is_standard": "Yes", - "module": "Stock", - "name": "__common__", - "ref_doctype": "Item", - "report_name": "Stock Projected Qty", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Stock Projected Qty" - } -] \ No newline at end of file +{ + "add_total_row": 1, + "creation": "2013-12-04 18:21:56", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Stock", + "name": "Stock Projected Qty", + "owner": "Administrator", + "ref_doctype": "Item", + "report_name": "Stock Projected Qty", + "report_type": "Script Report" +} \ No newline at end of file diff --git a/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.txt b/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.txt index 53eeca7bf6..a5ccf34fbb 100644 --- a/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.txt +++ b/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.txt @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-11-29 15:45:39", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "add_total_row": 1, - "doctype": "Report", - "is_standard": "Yes", - "module": "Stock", - "name": "__common__", - "ref_doctype": "Stock Ledger Entry", - "report_name": "Supplier-Wise Sales Analytics", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Supplier-Wise Sales Analytics" - } -] \ No newline at end of file +{ + "add_total_row": 1, + "creation": "2013-11-29 15:45:39", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Stock", + "name": "Supplier-Wise Sales Analytics", + "owner": "Administrator", + "ref_doctype": "Stock Ledger Entry", + "report_name": "Supplier-Wise Sales Analytics", + "report_type": "Script Report" +} \ No newline at end of file diff --git a/erpnext/stock/report/warehouse_wise_stock_balance/warehouse_wise_stock_balance.txt b/erpnext/stock/report/warehouse_wise_stock_balance/warehouse_wise_stock_balance.txt index c8e36eb95d..09a3777be3 100644 --- a/erpnext/stock/report/warehouse_wise_stock_balance/warehouse_wise_stock_balance.txt +++ b/erpnext/stock/report/warehouse_wise_stock_balance/warehouse_wise_stock_balance.txt @@ -1,22 +1,15 @@ -[ - { - "creation": "2013-06-05 11:00:31", - "docstatus": 0, - "modified": "2014-03-07 15:30:28", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Report", - "is_standard": "Yes", - "module": "Stock", - "name": "__common__", - "ref_doctype": "Stock Ledger Entry", - "report_name": "Warehouse-Wise Stock Balance", - "report_type": "Script Report" - }, - { - "doctype": "Report", - "name": "Warehouse-Wise Stock Balance" - } -] \ No newline at end of file +{ + "creation": "2013-06-05 11:00:31", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:28", + "modified_by": "Administrator", + "module": "Stock", + "name": "Warehouse-Wise Stock Balance", + "owner": "Administrator", + "ref_doctype": "Stock Ledger Entry", + "report_name": "Warehouse-Wise Stock Balance", + "report_type": "Script Report" +} \ No newline at end of file diff --git a/erpnext/support/doctype/customer_issue/customer_issue.txt b/erpnext/support/doctype/customer_issue/customer_issue.txt index 90ac593ce9..b1d14c442c 100644 --- a/erpnext/support/doctype/customer_issue/customer_issue.txt +++ b/erpnext/support/doctype/customer_issue/customer_issue.txt @@ -1,438 +1,419 @@ -[ - { - "creation": "2013-01-10 16:34:30", - "docstatus": 0, - "modified": "2014-01-20 17:48:35", - "modified_by": "Administrator", - "owner": "harshada@webnotestech.com" - }, - { - "allow_import": 1, - "autoname": "naming_series:", - "doctype": "DocType", - "icon": "icon-bug", - "is_submittable": 0, - "module": "Support", - "name": "__common__", - "search_fields": "status,customer,customer_name,territory" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Customer Issue", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "amend": 0, - "cancel": 0, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Customer Issue", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Maintenance User", - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Customer Issue" - }, - { - "doctype": "DocField", - "fieldname": "customer_section", - "fieldtype": "Section Break", - "label": "Customer", - "options": "icon-user" - }, - { - "doctype": "DocField", - "fieldname": "naming_series", - "fieldtype": "Select", - "in_filter": 0, - "label": "Series", - "no_copy": 1, - "oldfieldname": "naming_series", - "oldfieldtype": "Select", - "options": "\nCI/2010-2011/", - "reqd": 1, - "search_index": 0 - }, - { - "default": "Open", - "doctype": "DocField", - "fieldname": "status", - "fieldtype": "Select", - "in_filter": 1, - "in_list_view": 1, - "label": "Status", - "no_copy": 1, - "oldfieldname": "status", - "oldfieldtype": "Select", - "options": "\nOpen\nClosed\nWork In Progress\nCancelled", - "reqd": 1, - "search_index": 1 - }, - { - "default": "Today", - "doctype": "DocField", - "fieldname": "complaint_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Issue Date", - "oldfieldname": "complaint_date", - "oldfieldtype": "Date", - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "customer", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "Customer", - "oldfieldname": "customer", - "oldfieldtype": "Link", - "options": "Customer", - "print_hide": 1, - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "customer_address", - "fieldtype": "Link", - "label": "Customer Address", - "options": "Address", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "contact_person", - "fieldtype": "Link", - "label": "Contact Person", - "options": "Contact", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "issue_details", - "fieldtype": "Section Break", - "label": "Issue Details", - "oldfieldtype": "Section Break", - "options": "icon-ticket" - }, - { - "doctype": "DocField", - "fieldname": "complaint", - "fieldtype": "Small Text", - "label": "Issue", - "no_copy": 1, - "oldfieldname": "complaint", - "oldfieldtype": "Small Text", - "reqd": 1 - }, - { - "description": "Item, Warranty, AMC (Annual Maintenance Contract) details will be automatically fetched when Serial Number is selected.", - "doctype": "DocField", - "fieldname": "serial_no", - "fieldtype": "Link", - "in_list_view": 0, - "label": "Serial No", - "options": "Serial No" - }, - { - "doctype": "DocField", - "fieldname": "item_code", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "Item Code", - "oldfieldname": "item_code", - "oldfieldtype": "Link", - "options": "Item", - "reqd": 0, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "width": "50%" - }, - { - "depends_on": "eval:doc.item_code", - "doctype": "DocField", - "fieldname": "item_name", - "fieldtype": "Data", - "label": "Item Name", - "oldfieldname": "item_name", - "oldfieldtype": "Data", - "read_only": 1 - }, - { - "depends_on": "eval:doc.item_code", - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Small Text", - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Small Text", - "read_only": 1, - "width": "300px" - }, - { - "doctype": "DocField", - "fieldname": "warranty_amc_status", - "fieldtype": "Select", - "hidden": 0, - "in_filter": 1, - "in_list_view": 1, - "label": "Warranty / AMC Status", - "options": "\nUnder Warranty\nOut of Warranty\nUnder AMC\nOut of AMC" - }, - { - "doctype": "DocField", - "fieldname": "warranty_expiry_date", - "fieldtype": "Date", - "label": "Warranty Expiry Date" - }, - { - "doctype": "DocField", - "fieldname": "amc_expiry_date", - "fieldtype": "Date", - "label": "AMC Expiry Date" - }, - { - "description": "To assign this issue, use the \"Assign\" button in the sidebar.", - "doctype": "DocField", - "fieldname": "resolution_section", - "fieldtype": "Section Break", - "label": "Resolution", - "oldfieldtype": "Section Break", - "options": "icon-thumbs-up" - }, - { - "doctype": "DocField", - "fieldname": "resolution_date", - "fieldtype": "Datetime", - "in_filter": 1, - "label": "Resolution Date", - "no_copy": 1, - "oldfieldname": "resolution_date", - "oldfieldtype": "Date", - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "resolved_by", - "fieldtype": "Link", - "in_filter": 1, - "label": "Resolved By", - "no_copy": 1, - "oldfieldname": "resolved_by", - "oldfieldtype": "Link", - "options": "User", - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "resolution_details", - "fieldtype": "Text", - "label": "Resolution Details", - "no_copy": 1, - "oldfieldname": "resolution_details", - "oldfieldtype": "Text" - }, - { - "doctype": "DocField", - "fieldname": "contact_info", - "fieldtype": "Section Break", - "label": "Contact Info", - "options": "icon-bullhorn" - }, - { - "doctype": "DocField", - "fieldname": "col_break3", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "depends_on": "customer", - "doctype": "DocField", - "fieldname": "customer_name", - "fieldtype": "Data", - "label": "Customer Name", - "read_only": 1 - }, - { - "depends_on": "customer", - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "customer_group", - "fieldtype": "Link", - "label": "Customer Group", - "options": "Customer Group", - "print_hide": 1, - "reqd": 0 - }, - { - "depends_on": "customer", - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "territory", - "fieldtype": "Link", - "in_filter": 1, - "label": "Territory", - "oldfieldname": "territory", - "oldfieldtype": "Link", - "options": "Territory", - "print_hide": 1, - "reqd": 0, - "search_index": 1 - }, - { - "depends_on": "customer", - "doctype": "DocField", - "fieldname": "contact_display", - "fieldtype": "Small Text", - "label": "Contact", - "read_only": 1 - }, - { - "depends_on": "customer", - "doctype": "DocField", - "fieldname": "contact_mobile", - "fieldtype": "Data", - "label": "Mobile No", - "read_only": 1 - }, - { - "depends_on": "customer", - "doctype": "DocField", - "fieldname": "contact_email", - "fieldtype": "Data", - "label": "Contact Email", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "col_break4", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "depends_on": "customer", - "description": "If different than customer address", - "doctype": "DocField", - "fieldname": "service_address", - "fieldtype": "Small Text", - "label": "Service Address", - "oldfieldname": "service_address", - "oldfieldtype": "Small Text" - }, - { - "depends_on": "customer", - "doctype": "DocField", - "fieldname": "address_display", - "fieldtype": "Small Text", - "hidden": 0, - "label": "Address", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "more_info", - "fieldtype": "Section Break", - "label": "More Info", - "options": "icon-file-text" - }, - { - "doctype": "DocField", - "fieldname": "col_break5", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "in_filter": 1, - "label": "Company", - "oldfieldname": "company", - "oldfieldtype": "Link", - "options": "Company", - "print_hide": 1, - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "fiscal_year", - "fieldtype": "Select", - "in_filter": 1, - "label": "Fiscal Year", - "oldfieldname": "fiscal_year", - "oldfieldtype": "Select", - "options": "link:Fiscal Year", - "print_hide": 1, - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "col_break6", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "complaint_raised_by", - "fieldtype": "Data", - "label": "Raised By", - "oldfieldname": "complaint_raised_by", - "oldfieldtype": "Data" - }, - { - "doctype": "DocField", - "fieldname": "from_company", - "fieldtype": "Data", - "label": "From Company", - "oldfieldname": "from_company", - "oldfieldtype": "Data" - }, - { - "doctype": "DocField", - "fieldname": "amended_from", - "fieldtype": "Data", - "hidden": 1, - "ignore_restrictions": 1, - "label": "Amended From", - "no_copy": 1, - "oldfieldname": "amended_from", - "oldfieldtype": "Data", - "print_hide": 1, - "width": "150px" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "allow_import": 1, + "autoname": "naming_series:", + "creation": "2013-01-10 16:34:30", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "customer_section", + "fieldtype": "Section Break", + "label": "Customer", + "options": "icon-user", + "permlevel": 0 + }, + { + "fieldname": "naming_series", + "fieldtype": "Select", + "in_filter": 0, + "label": "Series", + "no_copy": 1, + "oldfieldname": "naming_series", + "oldfieldtype": "Select", + "options": "\nCI/2010-2011/", + "permlevel": 0, + "reqd": 1, + "search_index": 0 + }, + { + "default": "Open", + "fieldname": "status", + "fieldtype": "Select", + "in_filter": 1, + "in_list_view": 1, + "label": "Status", + "no_copy": 1, + "oldfieldname": "status", + "oldfieldtype": "Select", + "options": "\nOpen\nClosed\nWork In Progress\nCancelled", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "default": "Today", + "fieldname": "complaint_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Issue Date", + "oldfieldname": "complaint_date", + "oldfieldtype": "Date", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "customer", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Customer", + "oldfieldname": "customer", + "oldfieldtype": "Link", + "options": "Customer", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "customer_address", + "fieldtype": "Link", + "label": "Customer Address", + "options": "Address", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "contact_person", + "fieldtype": "Link", + "label": "Contact Person", + "options": "Contact", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "issue_details", + "fieldtype": "Section Break", + "label": "Issue Details", + "oldfieldtype": "Section Break", + "options": "icon-ticket", + "permlevel": 0 + }, + { + "fieldname": "complaint", + "fieldtype": "Small Text", + "label": "Issue", + "no_copy": 1, + "oldfieldname": "complaint", + "oldfieldtype": "Small Text", + "permlevel": 0, + "reqd": 1 + }, + { + "description": "Item, Warranty, AMC (Annual Maintenance Contract) details will be automatically fetched when Serial Number is selected.", + "fieldname": "serial_no", + "fieldtype": "Link", + "in_list_view": 0, + "label": "Serial No", + "options": "Serial No", + "permlevel": 0 + }, + { + "fieldname": "item_code", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Item Code", + "oldfieldname": "item_code", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0, + "reqd": 0, + "search_index": 1 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "depends_on": "eval:doc.item_code", + "fieldname": "item_name", + "fieldtype": "Data", + "label": "Item Name", + "oldfieldname": "item_name", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1 + }, + { + "depends_on": "eval:doc.item_code", + "fieldname": "description", + "fieldtype": "Small Text", + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Small Text", + "permlevel": 0, + "read_only": 1, + "width": "300px" + }, + { + "fieldname": "warranty_amc_status", + "fieldtype": "Select", + "hidden": 0, + "in_filter": 1, + "in_list_view": 1, + "label": "Warranty / AMC Status", + "options": "\nUnder Warranty\nOut of Warranty\nUnder AMC\nOut of AMC", + "permlevel": 0 + }, + { + "fieldname": "warranty_expiry_date", + "fieldtype": "Date", + "label": "Warranty Expiry Date", + "permlevel": 0 + }, + { + "fieldname": "amc_expiry_date", + "fieldtype": "Date", + "label": "AMC Expiry Date", + "permlevel": 0 + }, + { + "description": "To assign this issue, use the \"Assign\" button in the sidebar.", + "fieldname": "resolution_section", + "fieldtype": "Section Break", + "label": "Resolution", + "oldfieldtype": "Section Break", + "options": "icon-thumbs-up", + "permlevel": 0 + }, + { + "fieldname": "resolution_date", + "fieldtype": "Datetime", + "in_filter": 1, + "label": "Resolution Date", + "no_copy": 1, + "oldfieldname": "resolution_date", + "oldfieldtype": "Date", + "permlevel": 0, + "search_index": 1 + }, + { + "fieldname": "resolved_by", + "fieldtype": "Link", + "in_filter": 1, + "label": "Resolved By", + "no_copy": 1, + "oldfieldname": "resolved_by", + "oldfieldtype": "Link", + "options": "User", + "permlevel": 0, + "search_index": 1 + }, + { + "fieldname": "resolution_details", + "fieldtype": "Text", + "label": "Resolution Details", + "no_copy": 1, + "oldfieldname": "resolution_details", + "oldfieldtype": "Text", + "permlevel": 0 + }, + { + "fieldname": "contact_info", + "fieldtype": "Section Break", + "label": "Contact Info", + "options": "icon-bullhorn", + "permlevel": 0 + }, + { + "fieldname": "col_break3", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "depends_on": "customer", + "fieldname": "customer_name", + "fieldtype": "Data", + "label": "Customer Name", + "permlevel": 0, + "read_only": 1 + }, + { + "depends_on": "customer", + "description": "Add / Edit", + "fieldname": "customer_group", + "fieldtype": "Link", + "label": "Customer Group", + "options": "Customer Group", + "permlevel": 0, + "print_hide": 1, + "reqd": 0 + }, + { + "depends_on": "customer", + "description": "Add / Edit", + "fieldname": "territory", + "fieldtype": "Link", + "in_filter": 1, + "label": "Territory", + "oldfieldname": "territory", + "oldfieldtype": "Link", + "options": "Territory", + "permlevel": 0, + "print_hide": 1, + "reqd": 0, + "search_index": 1 + }, + { + "depends_on": "customer", + "fieldname": "contact_display", + "fieldtype": "Small Text", + "label": "Contact", + "permlevel": 0, + "read_only": 1 + }, + { + "depends_on": "customer", + "fieldname": "contact_mobile", + "fieldtype": "Data", + "label": "Mobile No", + "permlevel": 0, + "read_only": 1 + }, + { + "depends_on": "customer", + "fieldname": "contact_email", + "fieldtype": "Data", + "label": "Contact Email", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "col_break4", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "depends_on": "customer", + "description": "If different than customer address", + "fieldname": "service_address", + "fieldtype": "Small Text", + "label": "Service Address", + "oldfieldname": "service_address", + "oldfieldtype": "Small Text", + "permlevel": 0 + }, + { + "depends_on": "customer", + "fieldname": "address_display", + "fieldtype": "Small Text", + "hidden": 0, + "label": "Address", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "more_info", + "fieldtype": "Section Break", + "label": "More Info", + "options": "icon-file-text", + "permlevel": 0 + }, + { + "fieldname": "col_break5", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "company", + "fieldtype": "Link", + "in_filter": 1, + "label": "Company", + "oldfieldname": "company", + "oldfieldtype": "Link", + "options": "Company", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Select", + "in_filter": 1, + "label": "Fiscal Year", + "oldfieldname": "fiscal_year", + "oldfieldtype": "Select", + "options": "link:Fiscal Year", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "col_break6", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "complaint_raised_by", + "fieldtype": "Data", + "label": "Raised By", + "oldfieldname": "complaint_raised_by", + "oldfieldtype": "Data", + "permlevel": 0 + }, + { + "fieldname": "from_company", + "fieldtype": "Data", + "label": "From Company", + "oldfieldname": "from_company", + "oldfieldtype": "Data", + "permlevel": 0 + }, + { + "fieldname": "amended_from", + "fieldtype": "Data", + "hidden": 1, + "ignore_restrictions": 1, + "label": "Amended From", + "no_copy": 1, + "oldfieldname": "amended_from", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "width": "150px" + } + ], + "icon": "icon-bug", + "idx": 1, + "is_submittable": 0, + "modified": "2014-01-20 17:48:35", + "modified_by": "Administrator", + "module": "Support", + "name": "Customer Issue", + "owner": "harshada@webnotestech.com", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Maintenance User", + "submit": 0, + "write": 1 + } + ], + "search_fields": "status,customer,customer_name,territory" +} \ No newline at end of file diff --git a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.txt b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.txt index 56278898aa..ac9d99778e 100644 --- a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.txt +++ b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.txt @@ -1,262 +1,243 @@ -[ - { - "creation": "2013-01-10 16:34:30", - "docstatus": 0, - "modified": "2014-01-20 17:48:56", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "MS.#####", - "doctype": "DocType", - "icon": "icon-calendar", - "is_submittable": 1, - "module": "Support", - "name": "__common__", - "search_fields": "status,customer,customer_name, sales_order_no" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Maintenance Schedule", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Maintenance Schedule", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Maintenance Manager", - "submit": 1, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Maintenance Schedule" - }, - { - "doctype": "DocField", - "fieldname": "customer_details", - "fieldtype": "Section Break", - "label": "Customer Details", - "oldfieldtype": "Section Break", - "options": "icon-user" - }, - { - "doctype": "DocField", - "fieldname": "customer", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 0, - "label": "Customer", - "oldfieldname": "customer", - "oldfieldtype": "Link", - "options": "Customer", - "print_hide": 1, - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break" - }, - { - "default": "Draft", - "doctype": "DocField", - "fieldname": "status", - "fieldtype": "Select", - "in_filter": 1, - "label": "Status", - "no_copy": 1, - "oldfieldname": "status", - "oldfieldtype": "Select", - "options": "\nDraft\nSubmitted\nCancelled", - "read_only": 1, - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "transaction_date", - "fieldtype": "Date", - "in_filter": 1, - "label": "Transaction Date", - "oldfieldname": "transaction_date", - "oldfieldtype": "Date", - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "items", - "fieldtype": "Section Break", - "label": "Items", - "oldfieldtype": "Section Break", - "options": "icon-shopping-cart" - }, - { - "doctype": "DocField", - "fieldname": "item_maintenance_detail", - "fieldtype": "Table", - "label": "Maintenance Schedule Item", - "oldfieldname": "item_maintenance_detail", - "oldfieldtype": "Table", - "options": "Maintenance Schedule Item" - }, - { - "doctype": "DocField", - "fieldname": "schedule", - "fieldtype": "Section Break", - "label": "Schedule", - "oldfieldtype": "Section Break", - "options": "icon-time" - }, - { - "doctype": "DocField", - "fieldname": "generate_schedule", - "fieldtype": "Button", - "label": "Generate Schedule", - "oldfieldtype": "Button" - }, - { - "doctype": "DocField", - "fieldname": "maintenance_schedule_detail", - "fieldtype": "Table", - "label": "Maintenance Schedule Detail", - "oldfieldname": "maintenance_schedule_detail", - "oldfieldtype": "Table", - "options": "Maintenance Schedule Detail", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "contact_info", - "fieldtype": "Section Break", - "label": "Contact Info" - }, - { - "depends_on": "customer", - "doctype": "DocField", - "fieldname": "customer_name", - "fieldtype": "Data", - "in_filter": 1, - "in_list_view": 1, - "label": "Customer Name", - "oldfieldname": "customer_name", - "oldfieldtype": "Data", - "read_only": 1, - "reqd": 0, - "search_index": 0 - }, - { - "depends_on": "customer", - "doctype": "DocField", - "fieldname": "contact_person", - "fieldtype": "Link", - "label": "Contact Person", - "options": "Contact", - "print_hide": 1 - }, - { - "depends_on": "customer", - "doctype": "DocField", - "fieldname": "contact_mobile", - "fieldtype": "Data", - "hidden": 1, - "label": "Mobile No", - "read_only": 1 - }, - { - "depends_on": "customer", - "doctype": "DocField", - "fieldname": "contact_email", - "fieldtype": "Data", - "hidden": 1, - "label": "Contact Email", - "print_hide": 1, - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "contact_display", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Contact", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break_17", - "fieldtype": "Column Break" - }, - { - "depends_on": "customer", - "doctype": "DocField", - "fieldname": "customer_address", - "fieldtype": "Link", - "label": "Customer Address", - "options": "Address", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "address_display", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Address", - "read_only": 1 - }, - { - "depends_on": "customer", - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "territory", - "fieldtype": "Link", - "in_filter": 1, - "label": "Territory", - "oldfieldname": "territory", - "oldfieldtype": "Link", - "options": "Territory", - "reqd": 1, - "search_index": 0 - }, - { - "depends_on": "customer", - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "customer_group", - "fieldtype": "Link", - "label": "Customer Group", - "options": "Customer Group", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "in_filter": 1, - "label": "Company", - "oldfieldname": "company", - "oldfieldtype": "Link", - "options": "Company", - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "autoname": "MS.#####", + "creation": "2013-01-10 16:34:30", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "customer_details", + "fieldtype": "Section Break", + "label": "Customer Details", + "oldfieldtype": "Section Break", + "options": "icon-user", + "permlevel": 0 + }, + { + "fieldname": "customer", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 0, + "label": "Customer", + "oldfieldname": "customer", + "oldfieldtype": "Link", + "options": "Customer", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0 + }, + { + "default": "Draft", + "fieldname": "status", + "fieldtype": "Select", + "in_filter": 1, + "label": "Status", + "no_copy": 1, + "oldfieldname": "status", + "oldfieldtype": "Select", + "options": "\nDraft\nSubmitted\nCancelled", + "permlevel": 0, + "read_only": 1, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "transaction_date", + "fieldtype": "Date", + "in_filter": 1, + "label": "Transaction Date", + "oldfieldname": "transaction_date", + "oldfieldtype": "Date", + "permlevel": 0, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "items", + "fieldtype": "Section Break", + "label": "Items", + "oldfieldtype": "Section Break", + "options": "icon-shopping-cart", + "permlevel": 0 + }, + { + "fieldname": "item_maintenance_detail", + "fieldtype": "Table", + "label": "Maintenance Schedule Item", + "oldfieldname": "item_maintenance_detail", + "oldfieldtype": "Table", + "options": "Maintenance Schedule Item", + "permlevel": 0 + }, + { + "fieldname": "schedule", + "fieldtype": "Section Break", + "label": "Schedule", + "oldfieldtype": "Section Break", + "options": "icon-time", + "permlevel": 0 + }, + { + "fieldname": "generate_schedule", + "fieldtype": "Button", + "label": "Generate Schedule", + "oldfieldtype": "Button", + "permlevel": 0 + }, + { + "fieldname": "maintenance_schedule_detail", + "fieldtype": "Table", + "label": "Maintenance Schedule Detail", + "oldfieldname": "maintenance_schedule_detail", + "oldfieldtype": "Table", + "options": "Maintenance Schedule Detail", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "contact_info", + "fieldtype": "Section Break", + "label": "Contact Info", + "permlevel": 0 + }, + { + "depends_on": "customer", + "fieldname": "customer_name", + "fieldtype": "Data", + "in_filter": 1, + "in_list_view": 1, + "label": "Customer Name", + "oldfieldname": "customer_name", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1, + "reqd": 0, + "search_index": 0 + }, + { + "depends_on": "customer", + "fieldname": "contact_person", + "fieldtype": "Link", + "label": "Contact Person", + "options": "Contact", + "permlevel": 0, + "print_hide": 1 + }, + { + "depends_on": "customer", + "fieldname": "contact_mobile", + "fieldtype": "Data", + "hidden": 1, + "label": "Mobile No", + "permlevel": 0, + "read_only": 1 + }, + { + "depends_on": "customer", + "fieldname": "contact_email", + "fieldtype": "Data", + "hidden": 1, + "label": "Contact Email", + "permlevel": 0, + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "contact_display", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Contact", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "column_break_17", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "depends_on": "customer", + "fieldname": "customer_address", + "fieldtype": "Link", + "label": "Customer Address", + "options": "Address", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "address_display", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Address", + "permlevel": 0, + "read_only": 1 + }, + { + "depends_on": "customer", + "description": "Add / Edit", + "fieldname": "territory", + "fieldtype": "Link", + "in_filter": 1, + "label": "Territory", + "oldfieldname": "territory", + "oldfieldtype": "Link", + "options": "Territory", + "permlevel": 0, + "reqd": 1, + "search_index": 0 + }, + { + "depends_on": "customer", + "description": "Add / Edit", + "fieldname": "customer_group", + "fieldtype": "Link", + "label": "Customer Group", + "options": "Customer Group", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "company", + "fieldtype": "Link", + "in_filter": 1, + "label": "Company", + "oldfieldname": "company", + "oldfieldtype": "Link", + "options": "Company", + "permlevel": 0, + "reqd": 1, + "search_index": 0 + } + ], + "icon": "icon-calendar", + "idx": 1, + "is_submittable": 1, + "modified": "2014-01-20 17:48:56", + "modified_by": "Administrator", + "module": "Support", + "name": "Maintenance Schedule", + "owner": "Administrator", + "permissions": [ + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Maintenance Manager", + "submit": 1, + "write": 1 + } + ], + "search_fields": "status,customer,customer_name, sales_order_no" +} \ No newline at end of file diff --git a/erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.txt b/erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.txt index 8ed6856d24..09098f028f 100644 --- a/erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.txt +++ b/erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.txt @@ -1,110 +1,97 @@ -[ - { - "creation": "2013-02-22 01:28:05", - "docstatus": 0, - "modified": "2013-12-31 12:13:38", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "MSD.#####", - "doctype": "DocType", - "istable": 1, - "module": "Support", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Maintenance Schedule Detail", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Maintenance Schedule Detail" - }, - { - "doctype": "DocField", - "fieldname": "item_code", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "Item Code", - "oldfieldname": "item_code", - "oldfieldtype": "Link", - "options": "Item", - "read_only": 1, - "reqd": 0, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "item_name", - "fieldtype": "Data", - "in_filter": 0, - "in_list_view": 1, - "label": "Item Name", - "oldfieldname": "item_name", - "oldfieldtype": "Data", - "read_only": 1, - "search_index": 0 - }, - { - "allow_on_submit": 0, - "doctype": "DocField", - "fieldname": "scheduled_date", - "fieldtype": "Date", - "in_filter": 1, - "in_list_view": 1, - "label": "Scheduled Date", - "oldfieldname": "scheduled_date", - "oldfieldtype": "Date", - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "actual_date", - "fieldtype": "Date", - "hidden": 1, - "in_list_view": 0, - "label": "Actual Date", - "no_copy": 1, - "oldfieldname": "actual_date", - "oldfieldtype": "Date", - "print_hide": 1, - "read_only": 0, - "report_hide": 1 - }, - { - "allow_on_submit": 0, - "doctype": "DocField", - "fieldname": "sales_person", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "Sales Person", - "oldfieldname": "incharge_name", - "oldfieldtype": "Link", - "options": "Sales Person", - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "serial_no", - "fieldtype": "Small Text", - "in_filter": 1, - "in_list_view": 1, - "label": "Serial No", - "no_copy": 0, - "oldfieldname": "serial_no", - "oldfieldtype": "Small Text", - "print_width": "160px", - "read_only": 1, - "search_index": 0, - "width": "160px" - } -] \ No newline at end of file +{ + "autoname": "MSD.#####", + "creation": "2013-02-22 01:28:05", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "item_code", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Item Code", + "oldfieldname": "item_code", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0, + "read_only": 1, + "reqd": 0, + "search_index": 1 + }, + { + "fieldname": "item_name", + "fieldtype": "Data", + "in_filter": 0, + "in_list_view": 1, + "label": "Item Name", + "oldfieldname": "item_name", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1, + "search_index": 0 + }, + { + "allow_on_submit": 0, + "fieldname": "scheduled_date", + "fieldtype": "Date", + "in_filter": 1, + "in_list_view": 1, + "label": "Scheduled Date", + "oldfieldname": "scheduled_date", + "oldfieldtype": "Date", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "actual_date", + "fieldtype": "Date", + "hidden": 1, + "in_list_view": 0, + "label": "Actual Date", + "no_copy": 1, + "oldfieldname": "actual_date", + "oldfieldtype": "Date", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "report_hide": 1 + }, + { + "allow_on_submit": 0, + "fieldname": "sales_person", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Sales Person", + "oldfieldname": "incharge_name", + "oldfieldtype": "Link", + "options": "Sales Person", + "permlevel": 0, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "serial_no", + "fieldtype": "Small Text", + "in_filter": 1, + "in_list_view": 1, + "label": "Serial No", + "no_copy": 0, + "oldfieldname": "serial_no", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_width": "160px", + "read_only": 1, + "search_index": 0, + "width": "160px" + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-31 12:13:38", + "modified_by": "Administrator", + "module": "Support", + "name": "Maintenance Schedule Detail", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.txt b/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.txt index 43d281d9e6..076317a59f 100644 --- a/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.txt +++ b/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.txt @@ -1,154 +1,141 @@ -[ - { - "creation": "2013-02-22 01:28:05", - "docstatus": 0, - "modified": "2013-12-31 12:08:32", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "IMD.#####", - "doctype": "DocType", - "istable": 1, - "module": "Support", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Maintenance Schedule Item", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Maintenance Schedule Item" - }, - { - "doctype": "DocField", - "fieldname": "item_code", - "fieldtype": "Link", - "in_filter": 1, - "in_list_view": 1, - "label": "Item Code", - "oldfieldname": "item_code", - "oldfieldtype": "Link", - "options": "Item", - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "item_name", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Item Name", - "oldfieldname": "item_name", - "oldfieldtype": "Data", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Data", - "print_width": "300px", - "read_only": 1, - "width": "300px" - }, - { - "doctype": "DocField", - "fieldname": "schedule_details", - "fieldtype": "Section Break", - "in_list_view": 0, - "label": "Schedule Details" - }, - { - "doctype": "DocField", - "fieldname": "start_date", - "fieldtype": "Date", - "in_filter": 1, - "in_list_view": 1, - "label": "Start Date", - "oldfieldname": "start_date", - "oldfieldtype": "Date", - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "end_date", - "fieldtype": "Date", - "in_filter": 1, - "in_list_view": 1, - "label": "End Date", - "oldfieldname": "end_date", - "oldfieldtype": "Date", - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "periodicity", - "fieldtype": "Select", - "in_list_view": 1, - "label": "Periodicity", - "oldfieldname": "periodicity", - "oldfieldtype": "Select", - "options": "\nWeekly\nMonthly\nQuarterly\nHalf Yearly\nYearly\nRandom" - }, - { - "doctype": "DocField", - "fieldname": "no_of_visits", - "fieldtype": "Int", - "label": "No of Visits", - "oldfieldname": "no_of_visits", - "oldfieldtype": "Int", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "sales_person", - "fieldtype": "Link", - "in_filter": 1, - "label": "Sales Person", - "oldfieldname": "incharge_name", - "oldfieldtype": "Link", - "options": "Sales Person", - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "reference", - "fieldtype": "Section Break", - "label": "Reference" - }, - { - "doctype": "DocField", - "fieldname": "serial_no", - "fieldtype": "Small Text", - "label": "Serial No", - "oldfieldname": "serial_no", - "oldfieldtype": "Small Text" - }, - { - "doctype": "DocField", - "fieldname": "prevdoc_docname", - "fieldtype": "Data", - "in_filter": 1, - "label": "Against Docname", - "no_copy": 1, - "oldfieldname": "prevdoc_docname", - "oldfieldtype": "Data", - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "search_index": 1, - "width": "150px" - } -] \ No newline at end of file +{ + "autoname": "IMD.#####", + "creation": "2013-02-22 01:28:05", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "item_code", + "fieldtype": "Link", + "in_filter": 1, + "in_list_view": 1, + "label": "Item Code", + "oldfieldname": "item_code", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "item_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Item Name", + "oldfieldname": "item_name", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "description", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Data", + "permlevel": 0, + "print_width": "300px", + "read_only": 1, + "width": "300px" + }, + { + "fieldname": "schedule_details", + "fieldtype": "Section Break", + "in_list_view": 0, + "label": "Schedule Details", + "permlevel": 0 + }, + { + "fieldname": "start_date", + "fieldtype": "Date", + "in_filter": 1, + "in_list_view": 1, + "label": "Start Date", + "oldfieldname": "start_date", + "oldfieldtype": "Date", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "end_date", + "fieldtype": "Date", + "in_filter": 1, + "in_list_view": 1, + "label": "End Date", + "oldfieldname": "end_date", + "oldfieldtype": "Date", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "periodicity", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Periodicity", + "oldfieldname": "periodicity", + "oldfieldtype": "Select", + "options": "\nWeekly\nMonthly\nQuarterly\nHalf Yearly\nYearly\nRandom", + "permlevel": 0 + }, + { + "fieldname": "no_of_visits", + "fieldtype": "Int", + "label": "No of Visits", + "oldfieldname": "no_of_visits", + "oldfieldtype": "Int", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "sales_person", + "fieldtype": "Link", + "in_filter": 1, + "label": "Sales Person", + "oldfieldname": "incharge_name", + "oldfieldtype": "Link", + "options": "Sales Person", + "permlevel": 0, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "reference", + "fieldtype": "Section Break", + "label": "Reference", + "permlevel": 0 + }, + { + "fieldname": "serial_no", + "fieldtype": "Small Text", + "label": "Serial No", + "oldfieldname": "serial_no", + "oldfieldtype": "Small Text", + "permlevel": 0 + }, + { + "fieldname": "prevdoc_docname", + "fieldtype": "Data", + "in_filter": 1, + "label": "Against Docname", + "no_copy": 1, + "oldfieldname": "prevdoc_docname", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 1, + "search_index": 1, + "width": "150px" + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-31 12:08:32", + "modified_by": "Administrator", + "module": "Support", + "name": "Maintenance Schedule Item", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/support/doctype/maintenance_visit/maintenance_visit.txt b/erpnext/support/doctype/maintenance_visit/maintenance_visit.txt index 6a03292dca..fde4bbd1db 100644 --- a/erpnext/support/doctype/maintenance_visit/maintenance_visit.txt +++ b/erpnext/support/doctype/maintenance_visit/maintenance_visit.txt @@ -1,321 +1,302 @@ -[ - { - "creation": "2013-01-10 16:34:31", - "docstatus": 0, - "modified": "2014-01-20 17:48:57", - "modified_by": "Administrator", - "owner": "ashwini@webnotestech.com" - }, - { - "autoname": "MV.#####", - "doctype": "DocType", - "icon": "icon-file-text", - "is_submittable": 1, - "module": "Support", - "name": "__common__", - "search_fields": "status,maintenance_type,customer,customer_name, address,mntc_date,company,fiscal_year" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Maintenance Visit", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Maintenance Visit", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "Maintenance User", - "submit": 1, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Maintenance Visit" - }, - { - "doctype": "DocField", - "fieldname": "customer_details", - "fieldtype": "Section Break", - "label": "Customer Details", - "oldfieldtype": "Section Break", - "options": "icon-user" - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break" - }, - { - "doctype": "DocField", - "fieldname": "customer", - "fieldtype": "Link", - "in_filter": 1, - "label": "Customer", - "oldfieldname": "customer", - "oldfieldtype": "Link", - "options": "Customer", - "print_hide": 1, - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "customer_name", - "fieldtype": "Data", - "hidden": 1, - "in_list_view": 1, - "label": "Customer Name", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "address_display", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Address", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "contact_display", - "fieldtype": "Small Text", - "hidden": 1, - "label": "Contact", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "contact_mobile", - "fieldtype": "Data", - "hidden": 1, - "label": "Mobile No", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "contact_email", - "fieldtype": "Data", - "hidden": 1, - "label": "Contact Email", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "width": "50%" - }, - { - "default": "Today", - "doctype": "DocField", - "fieldname": "mntc_date", - "fieldtype": "Date", - "label": "Maintenance Date", - "no_copy": 1, - "oldfieldname": "mntc_date", - "oldfieldtype": "Date", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "mntc_time", - "fieldtype": "Time", - "label": "Maintenance Time", - "no_copy": 1, - "oldfieldname": "mntc_time", - "oldfieldtype": "Time" - }, - { - "doctype": "DocField", - "fieldname": "maintenance_details", - "fieldtype": "Section Break", - "label": "Maintenance Details", - "oldfieldtype": "Section Break", - "options": "icon-wrench" - }, - { - "doctype": "DocField", - "fieldname": "completion_status", - "fieldtype": "Select", - "in_list_view": 1, - "label": "Completion Status", - "oldfieldname": "completion_status", - "oldfieldtype": "Select", - "options": "\nPartially Completed\nFully Completed", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break_14", - "fieldtype": "Column Break" - }, - { - "default": "Unscheduled", - "doctype": "DocField", - "fieldname": "maintenance_type", - "fieldtype": "Select", - "in_filter": 1, - "in_list_view": 1, - "label": "Maintenance Type", - "oldfieldname": "maintenance_type", - "oldfieldtype": "Select", - "options": "\nScheduled\nUnscheduled\nBreakdown", - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "section_break0", - "fieldtype": "Section Break", - "oldfieldtype": "Section Break", - "options": "icon-wrench" - }, - { - "doctype": "DocField", - "fieldname": "maintenance_visit_details", - "fieldtype": "Table", - "label": "Maintenance Visit Purpose", - "oldfieldname": "maintenance_visit_details", - "oldfieldtype": "Table", - "options": "Maintenance Visit Purpose" - }, - { - "doctype": "DocField", - "fieldname": "more_info", - "fieldtype": "Section Break", - "label": "More Info", - "oldfieldtype": "Section Break", - "options": "icon-file-text" - }, - { - "doctype": "DocField", - "fieldname": "customer_feedback", - "fieldtype": "Small Text", - "label": "Customer Feedback", - "oldfieldname": "customer_feedback", - "oldfieldtype": "Small Text" - }, - { - "doctype": "DocField", - "fieldname": "col_break3", - "fieldtype": "Column Break" - }, - { - "default": "Draft", - "doctype": "DocField", - "fieldname": "status", - "fieldtype": "Data", - "label": "Status", - "no_copy": 1, - "oldfieldname": "status", - "oldfieldtype": "Data", - "options": "\nDraft\nCancelled\nSubmitted", - "read_only": 1, - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "amended_from", - "fieldtype": "Data", - "ignore_restrictions": 1, - "label": "Amended From", - "no_copy": 1, - "oldfieldname": "amended_from", - "oldfieldtype": "Data", - "print_hide": 1, - "read_only": 1, - "width": "150px" - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Select", - "in_filter": 1, - "label": "Company", - "oldfieldname": "company", - "oldfieldtype": "Select", - "options": "link:Company", - "print_hide": 1, - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "fiscal_year", - "fieldtype": "Select", - "in_filter": 1, - "label": "Fiscal Year", - "oldfieldname": "fiscal_year", - "oldfieldtype": "Select", - "options": "link:Fiscal Year", - "print_hide": 1, - "reqd": 1, - "search_index": 0 - }, - { - "depends_on": "customer", - "doctype": "DocField", - "fieldname": "contact_info_section", - "fieldtype": "Section Break", - "label": "Contact Info", - "options": "icon-bullhorn" - }, - { - "doctype": "DocField", - "fieldname": "customer_address", - "fieldtype": "Link", - "label": "Customer Address", - "options": "Address", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "contact_person", - "fieldtype": "Link", - "label": "Contact Person", - "options": "Contact", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "col_break4", - "fieldtype": "Column Break" - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "territory", - "fieldtype": "Link", - "label": "Territory", - "options": "Territory", - "print_hide": 1 - }, - { - "description": "Add / Edit", - "doctype": "DocField", - "fieldname": "customer_group", - "fieldtype": "Link", - "label": "Customer Group", - "options": "Customer Group", - "print_hide": 1 - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "autoname": "MV.#####", + "creation": "2013-01-10 16:34:31", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "customer_details", + "fieldtype": "Section Break", + "label": "Customer Details", + "oldfieldtype": "Section Break", + "options": "icon-user", + "permlevel": 0 + }, + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0 + }, + { + "fieldname": "customer", + "fieldtype": "Link", + "in_filter": 1, + "label": "Customer", + "oldfieldname": "customer", + "oldfieldtype": "Link", + "options": "Customer", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "customer_name", + "fieldtype": "Data", + "hidden": 1, + "in_list_view": 1, + "label": "Customer Name", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "address_display", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Address", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "contact_display", + "fieldtype": "Small Text", + "hidden": 1, + "label": "Contact", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "contact_mobile", + "fieldtype": "Data", + "hidden": 1, + "label": "Mobile No", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "contact_email", + "fieldtype": "Data", + "hidden": 1, + "label": "Contact Email", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "default": "Today", + "fieldname": "mntc_date", + "fieldtype": "Date", + "label": "Maintenance Date", + "no_copy": 1, + "oldfieldname": "mntc_date", + "oldfieldtype": "Date", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "mntc_time", + "fieldtype": "Time", + "label": "Maintenance Time", + "no_copy": 1, + "oldfieldname": "mntc_time", + "oldfieldtype": "Time", + "permlevel": 0 + }, + { + "fieldname": "maintenance_details", + "fieldtype": "Section Break", + "label": "Maintenance Details", + "oldfieldtype": "Section Break", + "options": "icon-wrench", + "permlevel": 0 + }, + { + "fieldname": "completion_status", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Completion Status", + "oldfieldname": "completion_status", + "oldfieldtype": "Select", + "options": "\nPartially Completed\nFully Completed", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "column_break_14", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "default": "Unscheduled", + "fieldname": "maintenance_type", + "fieldtype": "Select", + "in_filter": 1, + "in_list_view": 1, + "label": "Maintenance Type", + "oldfieldname": "maintenance_type", + "oldfieldtype": "Select", + "options": "\nScheduled\nUnscheduled\nBreakdown", + "permlevel": 0, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "section_break0", + "fieldtype": "Section Break", + "oldfieldtype": "Section Break", + "options": "icon-wrench", + "permlevel": 0 + }, + { + "fieldname": "maintenance_visit_details", + "fieldtype": "Table", + "label": "Maintenance Visit Purpose", + "oldfieldname": "maintenance_visit_details", + "oldfieldtype": "Table", + "options": "Maintenance Visit Purpose", + "permlevel": 0 + }, + { + "fieldname": "more_info", + "fieldtype": "Section Break", + "label": "More Info", + "oldfieldtype": "Section Break", + "options": "icon-file-text", + "permlevel": 0 + }, + { + "fieldname": "customer_feedback", + "fieldtype": "Small Text", + "label": "Customer Feedback", + "oldfieldname": "customer_feedback", + "oldfieldtype": "Small Text", + "permlevel": 0 + }, + { + "fieldname": "col_break3", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "default": "Draft", + "fieldname": "status", + "fieldtype": "Data", + "label": "Status", + "no_copy": 1, + "oldfieldname": "status", + "oldfieldtype": "Data", + "options": "\nDraft\nCancelled\nSubmitted", + "permlevel": 0, + "read_only": 1, + "reqd": 1 + }, + { + "fieldname": "amended_from", + "fieldtype": "Data", + "ignore_restrictions": 1, + "label": "Amended From", + "no_copy": 1, + "oldfieldname": "amended_from", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "read_only": 1, + "width": "150px" + }, + { + "fieldname": "company", + "fieldtype": "Select", + "in_filter": 1, + "label": "Company", + "oldfieldname": "company", + "oldfieldtype": "Select", + "options": "link:Company", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "fiscal_year", + "fieldtype": "Select", + "in_filter": 1, + "label": "Fiscal Year", + "oldfieldname": "fiscal_year", + "oldfieldtype": "Select", + "options": "link:Fiscal Year", + "permlevel": 0, + "print_hide": 1, + "reqd": 1, + "search_index": 0 + }, + { + "depends_on": "customer", + "fieldname": "contact_info_section", + "fieldtype": "Section Break", + "label": "Contact Info", + "options": "icon-bullhorn", + "permlevel": 0 + }, + { + "fieldname": "customer_address", + "fieldtype": "Link", + "label": "Customer Address", + "options": "Address", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "contact_person", + "fieldtype": "Link", + "label": "Contact Person", + "options": "Contact", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "col_break4", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "description": "Add / Edit", + "fieldname": "territory", + "fieldtype": "Link", + "label": "Territory", + "options": "Territory", + "permlevel": 0, + "print_hide": 1 + }, + { + "description": "Add / Edit", + "fieldname": "customer_group", + "fieldtype": "Link", + "label": "Customer Group", + "options": "Customer Group", + "permlevel": 0, + "print_hide": 1 + } + ], + "icon": "icon-file-text", + "idx": 1, + "is_submittable": 1, + "modified": "2014-01-20 17:48:57", + "modified_by": "Administrator", + "module": "Support", + "name": "Maintenance Visit", + "owner": "ashwini@webnotestech.com", + "permissions": [ + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Maintenance User", + "submit": 1, + "write": 1 + } + ], + "search_fields": "status,maintenance_type,customer,customer_name, address,mntc_date,company,fiscal_year" +} \ No newline at end of file diff --git a/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.txt b/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.txt index 6a45e55c4e..d0b6850d36 100644 --- a/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.txt +++ b/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.txt @@ -1,142 +1,129 @@ -[ - { - "creation": "2013-02-22 01:28:06", - "docstatus": 0, - "modified": "2013-12-20 19:23:20", - "modified_by": "Administrator", - "owner": "ashwini@webnotestech.com" - }, - { - "autoname": "MVD.#####", - "doctype": "DocType", - "istable": 1, - "module": "Support", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Maintenance Visit Purpose", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Maintenance Visit Purpose" - }, - { - "doctype": "DocField", - "fieldname": "item_code", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Item Code", - "oldfieldname": "item_code", - "oldfieldtype": "Link", - "options": "Item" - }, - { - "doctype": "DocField", - "fieldname": "item_name", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Item Name", - "oldfieldname": "item_name", - "oldfieldtype": "Data", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "serial_no", - "fieldtype": "Small Text", - "in_list_view": 1, - "label": "Serial No", - "oldfieldname": "serial_no", - "oldfieldtype": "Small Text" - }, - { - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Small Text", - "in_list_view": 1, - "label": "Description", - "oldfieldname": "description", - "oldfieldtype": "Small Text", - "print_width": "300px", - "reqd": 1, - "width": "300px" - }, - { - "doctype": "DocField", - "fieldname": "work_details", - "fieldtype": "Section Break", - "in_list_view": 0, - "label": "Work Details" - }, - { - "doctype": "DocField", - "fieldname": "service_person", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Sales Person", - "oldfieldname": "service_person", - "oldfieldtype": "Link", - "options": "Sales Person", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "work_done", - "fieldtype": "Small Text", - "in_list_view": 1, - "label": "Work Done", - "oldfieldname": "work_done", - "oldfieldtype": "Small Text", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "prevdoc_docname", - "fieldtype": "Data", - "hidden": 0, - "label": "Against Document No", - "no_copy": 1, - "oldfieldname": "prevdoc_docname", - "oldfieldtype": "Data", - "print_hide": 1, - "print_width": "160px", - "read_only": 1, - "report_hide": 1, - "width": "160px" - }, - { - "doctype": "DocField", - "fieldname": "prevdoc_detail_docname", - "fieldtype": "Data", - "hidden": 1, - "label": "Against Document Detail No", - "no_copy": 1, - "oldfieldname": "prevdoc_detail_docname", - "oldfieldtype": "Data", - "print_hide": 1, - "print_width": "160px", - "read_only": 1, - "report_hide": 1, - "width": "160px" - }, - { - "doctype": "DocField", - "fieldname": "prevdoc_doctype", - "fieldtype": "Data", - "hidden": 0, - "label": "Document Type", - "no_copy": 1, - "oldfieldname": "prevdoc_doctype", - "oldfieldtype": "Data", - "print_hide": 1, - "print_width": "150px", - "read_only": 1, - "report_hide": 1, - "width": "150px" - } -] \ No newline at end of file +{ + "autoname": "MVD.#####", + "creation": "2013-02-22 01:28:06", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "item_code", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Item Code", + "oldfieldname": "item_code", + "oldfieldtype": "Link", + "options": "Item", + "permlevel": 0 + }, + { + "fieldname": "item_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Item Name", + "oldfieldname": "item_name", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "serial_no", + "fieldtype": "Small Text", + "in_list_view": 1, + "label": "Serial No", + "oldfieldname": "serial_no", + "oldfieldtype": "Small Text", + "permlevel": 0 + }, + { + "fieldname": "description", + "fieldtype": "Small Text", + "in_list_view": 1, + "label": "Description", + "oldfieldname": "description", + "oldfieldtype": "Small Text", + "permlevel": 0, + "print_width": "300px", + "reqd": 1, + "width": "300px" + }, + { + "fieldname": "work_details", + "fieldtype": "Section Break", + "in_list_view": 0, + "label": "Work Details", + "permlevel": 0 + }, + { + "fieldname": "service_person", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Sales Person", + "oldfieldname": "service_person", + "oldfieldtype": "Link", + "options": "Sales Person", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "work_done", + "fieldtype": "Small Text", + "in_list_view": 1, + "label": "Work Done", + "oldfieldname": "work_done", + "oldfieldtype": "Small Text", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "prevdoc_docname", + "fieldtype": "Data", + "hidden": 0, + "label": "Against Document No", + "no_copy": 1, + "oldfieldname": "prevdoc_docname", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "print_width": "160px", + "read_only": 1, + "report_hide": 1, + "width": "160px" + }, + { + "fieldname": "prevdoc_detail_docname", + "fieldtype": "Data", + "hidden": 1, + "label": "Against Document Detail No", + "no_copy": 1, + "oldfieldname": "prevdoc_detail_docname", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "print_width": "160px", + "read_only": 1, + "report_hide": 1, + "width": "160px" + }, + { + "fieldname": "prevdoc_doctype", + "fieldtype": "Data", + "hidden": 0, + "label": "Document Type", + "no_copy": 1, + "oldfieldname": "prevdoc_doctype", + "oldfieldtype": "Data", + "permlevel": 0, + "print_hide": 1, + "print_width": "150px", + "read_only": 1, + "report_hide": 1, + "width": "150px" + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:23:20", + "modified_by": "Administrator", + "module": "Support", + "name": "Maintenance Visit Purpose", + "owner": "ashwini@webnotestech.com" +} \ No newline at end of file diff --git a/erpnext/support/doctype/newsletter/newsletter.txt b/erpnext/support/doctype/newsletter/newsletter.txt index d0ce1f42b3..1c762701ec 100644 --- a/erpnext/support/doctype/newsletter/newsletter.txt +++ b/erpnext/support/doctype/newsletter/newsletter.txt @@ -1,179 +1,169 @@ -[ - { - "creation": "2013-01-10 16:34:31", - "docstatus": 0, - "modified": "2014-02-03 11:32:22", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "naming_series:", - "description": "Create and Send Newsletters", - "doctype": "DocType", - "document_type": "Other", - "icon": "icon-envelope", - "module": "Support", - "name": "__common__", - "title_field": "subject" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Newsletter", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "cancel": 0, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 0, - "name": "__common__", - "parent": "Newsletter", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 0, - "read": 1, - "report": 0, - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Newsletter" - }, - { - "description": "Select who you want to send this newsletter to", - "doctype": "DocField", - "fieldname": "send_to", - "fieldtype": "Section Break", - "label": "Send To" - }, - { - "default": "NL-", - "doctype": "DocField", - "fieldname": "naming_series", - "fieldtype": "Select", - "label": "Series", - "options": "NL-", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "send_to_type", - "fieldtype": "Select", - "label": "Send To Type", - "options": "Lead\nContact\nEmployee\nCustom" - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break" - }, - { - "depends_on": "eval:doc.send_to_type==\"Lead\"", - "doctype": "DocField", - "fieldname": "lead_source", - "fieldtype": "Select", - "label": "Lead Source" - }, - { - "depends_on": "eval:doc.send_to_type==\"Lead\"", - "doctype": "DocField", - "fieldname": "lead_status", - "fieldtype": "Select", - "label": "Lead Status" - }, - { - "depends_on": "eval:doc.send_to_type==\"Contact\"", - "doctype": "DocField", - "fieldname": "contact_type", - "fieldtype": "Select", - "label": "Contact Type", - "options": "Customer\nSupplier" - }, - { - "depends_on": "eval:doc.send_to_type==\"Custom\"", - "description": "Comma separated list of email addresses", - "doctype": "DocField", - "fieldname": "email_list", - "fieldtype": "Text", - "label": "Send to this list" - }, - { - "doctype": "DocField", - "fieldname": "newsletter_content", - "fieldtype": "Section Break", - "label": "Newsletter Content" - }, - { - "description": "If specified, send the newsletter using this email address", - "doctype": "DocField", - "fieldname": "send_from", - "fieldtype": "Data", - "label": "Send From", - "no_copy": 1 - }, - { - "doctype": "DocField", - "fieldname": "subject", - "fieldtype": "Small Text", - "in_list_view": 1, - "label": "Subject", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "message", - "fieldtype": "Text Editor", - "label": "Message", - "reqd": 0 - }, - { - "description": "Check how the newsletter looks in an email by sending it to your email.", - "doctype": "DocField", - "fieldname": "test_the_newsletter", - "fieldtype": "Section Break", - "label": "Test the Newsletter" - }, - { - "description": "A Lead with this email id should exist", - "doctype": "DocField", - "fieldname": "test_email_id", - "fieldtype": "Data", - "label": "Test Email Id" - }, - { - "doctype": "DocField", - "fieldname": "test_send", - "fieldtype": "Button", - "label": "Test", - "options": "test_send" - }, - { - "doctype": "DocField", - "fieldname": "newsletter_status", - "fieldtype": "Section Break", - "label": "Newsletter Status" - }, - { - "doctype": "DocField", - "fieldname": "email_sent", - "fieldtype": "Check", - "in_list_view": 1, - "label": "Email Sent?", - "no_copy": 1, - "read_only": 1 - }, - { - "doctype": "DocPerm", - "role": "Sales Manager" - }, - { - "doctype": "DocPerm", - "role": "Support Manager" - } -] \ No newline at end of file +{ + "autoname": "naming_series:", + "creation": "2013-01-10 16:34:31", + "description": "Create and Send Newsletters", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Other", + "fields": [ + { + "description": "Select who you want to send this newsletter to", + "fieldname": "send_to", + "fieldtype": "Section Break", + "label": "Send To", + "permlevel": 0 + }, + { + "default": "NL-", + "fieldname": "naming_series", + "fieldtype": "Select", + "label": "Series", + "options": "NL-", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "send_to_type", + "fieldtype": "Select", + "label": "Send To Type", + "options": "Lead\nContact\nEmployee\nCustom", + "permlevel": 0 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "depends_on": "eval:doc.send_to_type==\"Lead\"", + "fieldname": "lead_source", + "fieldtype": "Select", + "label": "Lead Source", + "permlevel": 0 + }, + { + "depends_on": "eval:doc.send_to_type==\"Lead\"", + "fieldname": "lead_status", + "fieldtype": "Select", + "label": "Lead Status", + "permlevel": 0 + }, + { + "depends_on": "eval:doc.send_to_type==\"Contact\"", + "fieldname": "contact_type", + "fieldtype": "Select", + "label": "Contact Type", + "options": "Customer\nSupplier", + "permlevel": 0 + }, + { + "depends_on": "eval:doc.send_to_type==\"Custom\"", + "description": "Comma separated list of email addresses", + "fieldname": "email_list", + "fieldtype": "Text", + "label": "Send to this list", + "permlevel": 0 + }, + { + "fieldname": "newsletter_content", + "fieldtype": "Section Break", + "label": "Newsletter Content", + "permlevel": 0 + }, + { + "description": "If specified, send the newsletter using this email address", + "fieldname": "send_from", + "fieldtype": "Data", + "label": "Send From", + "no_copy": 1, + "permlevel": 0 + }, + { + "fieldname": "subject", + "fieldtype": "Small Text", + "in_list_view": 1, + "label": "Subject", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "message", + "fieldtype": "Text Editor", + "label": "Message", + "permlevel": 0, + "reqd": 0 + }, + { + "description": "Check how the newsletter looks in an email by sending it to your email.", + "fieldname": "test_the_newsletter", + "fieldtype": "Section Break", + "label": "Test the Newsletter", + "permlevel": 0 + }, + { + "description": "A Lead with this email id should exist", + "fieldname": "test_email_id", + "fieldtype": "Data", + "label": "Test Email Id", + "permlevel": 0 + }, + { + "fieldname": "test_send", + "fieldtype": "Button", + "label": "Test", + "options": "test_send", + "permlevel": 0 + }, + { + "fieldname": "newsletter_status", + "fieldtype": "Section Break", + "label": "Newsletter Status", + "permlevel": 0 + }, + { + "fieldname": "email_sent", + "fieldtype": "Check", + "in_list_view": 1, + "label": "Email Sent?", + "no_copy": 1, + "permlevel": 0, + "read_only": 1 + } + ], + "icon": "icon-envelope", + "idx": 1, + "modified": "2014-02-03 11:32:22", + "modified_by": "Administrator", + "module": "Support", + "name": "Newsletter", + "owner": "Administrator", + "permissions": [ + { + "cancel": 0, + "create": 1, + "delete": 1, + "email": 0, + "permlevel": 0, + "print": 0, + "read": 1, + "report": 0, + "role": "Sales Manager", + "submit": 0, + "write": 1 + }, + { + "cancel": 0, + "create": 1, + "delete": 1, + "email": 0, + "permlevel": 0, + "print": 0, + "read": 1, + "report": 0, + "role": "Support Manager", + "submit": 0, + "write": 1 + } + ], + "title_field": "subject" +} \ No newline at end of file diff --git a/erpnext/support/doctype/support_email_settings/support_email_settings.txt b/erpnext/support/doctype/support_email_settings/support_email_settings.txt index 5775c28466..2b90a8522c 100644 --- a/erpnext/support/doctype/support_email_settings/support_email_settings.txt +++ b/erpnext/support/doctype/support_email_settings/support_email_settings.txt @@ -1,111 +1,92 @@ -[ - { - "creation": "2014-03-03 19:48:46", - "docstatus": 0, - "modified": "2014-03-03 20:20:34", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_copy": 1, - "description": "Email Settings for Outgoing and Incoming Emails.", - "doctype": "DocType", - "icon": "icon-cog", - "in_create": 1, - "issingle": 1, - "module": "Support", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Support Email Settings", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "name": "__common__", - "parent": "Support Email Settings", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "read": 1, - "role": "System Manager", - "write": 1 - }, - { - "doctype": "DocType", - "name": "Support Email Settings" - }, - { - "description": "Check this to pull emails from your mailbox", - "doctype": "DocField", - "fieldname": "sync_support_mails", - "fieldtype": "Check", - "label": "Sync Support Mails" - }, - { - "description": "Your support email id - must be a valid email - this is where your emails will come!", - "doctype": "DocField", - "fieldname": "support_email", - "fieldtype": "Data", - "label": "Support Email" - }, - { - "description": "POP3 mail server (e.g. pop.gmail.com)", - "doctype": "DocField", - "fieldname": "mail_server", - "fieldtype": "Data", - "label": "POP3 Mail Server" - }, - { - "doctype": "DocField", - "fieldname": "use_ssl", - "fieldtype": "Check", - "label": "Use SSL" - }, - { - "doctype": "DocField", - "fieldname": "mail_login", - "fieldtype": "Data", - "label": "User Name" - }, - { - "doctype": "DocField", - "fieldname": "mail_password", - "fieldtype": "Password", - "label": "Support Password" - }, - { - "doctype": "DocField", - "fieldname": "cb1", - "fieldtype": "Column Break" - }, - { - "description": "Signature to be appended at the end of every email", - "doctype": "DocField", - "fieldname": "support_signature", - "fieldtype": "Text", - "label": "Signature" - }, - { - "default": "1", - "doctype": "DocField", - "fieldname": "send_autoreply", - "fieldtype": "Check", - "label": "Send Autoreply" - }, - { - "description": "Autoreply when a new mail is received", - "doctype": "DocField", - "fieldname": "support_autoreply", - "fieldtype": "Text", - "label": "Custom Autoreply Message" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "allow_copy": 1, + "creation": "2014-03-03 19:48:46", + "description": "Email Settings for Outgoing and Incoming Emails.", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "description": "Check this to pull emails from your mailbox", + "fieldname": "sync_support_mails", + "fieldtype": "Check", + "label": "Sync Support Mails", + "permlevel": 0 + }, + { + "description": "Your support email id - must be a valid email - this is where your emails will come!", + "fieldname": "support_email", + "fieldtype": "Data", + "label": "Support Email", + "permlevel": 0 + }, + { + "description": "POP3 mail server (e.g. pop.gmail.com)", + "fieldname": "mail_server", + "fieldtype": "Data", + "label": "POP3 Mail Server", + "permlevel": 0 + }, + { + "fieldname": "use_ssl", + "fieldtype": "Check", + "label": "Use SSL", + "permlevel": 0 + }, + { + "fieldname": "mail_login", + "fieldtype": "Data", + "label": "User Name", + "permlevel": 0 + }, + { + "fieldname": "mail_password", + "fieldtype": "Password", + "label": "Support Password", + "permlevel": 0 + }, + { + "fieldname": "cb1", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "description": "Signature to be appended at the end of every email", + "fieldname": "support_signature", + "fieldtype": "Text", + "label": "Signature", + "permlevel": 0 + }, + { + "default": "1", + "fieldname": "send_autoreply", + "fieldtype": "Check", + "label": "Send Autoreply", + "permlevel": 0 + }, + { + "description": "Autoreply when a new mail is received", + "fieldname": "support_autoreply", + "fieldtype": "Text", + "label": "Custom Autoreply Message", + "permlevel": 0 + } + ], + "icon": "icon-cog", + "idx": 1, + "in_create": 1, + "issingle": 1, + "modified": "2014-03-03 20:20:34", + "modified_by": "Administrator", + "module": "Support", + "name": "Support Email Settings", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "permlevel": 0, + "read": 1, + "role": "System Manager", + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/support/doctype/support_ticket/support_ticket.txt b/erpnext/support/doctype/support_ticket/support_ticket.txt index 2eac196af6..7ffbbb81a9 100644 --- a/erpnext/support/doctype/support_ticket/support_ticket.txt +++ b/erpnext/support/doctype/support_ticket/support_ticket.txt @@ -1,291 +1,290 @@ -[ - { - "creation": "2013-02-01 10:36:25", - "docstatus": 0, - "modified": "2014-01-20 17:49:31", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_attach": 1, - "autoname": "naming_series:", - "doctype": "DocType", - "icon": "icon-ticket", - "module": "Support", - "name": "__common__", - "search_fields": "status,customer,allocated_to,subject,raised_by" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Support Ticket", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "amend": 0, - "cancel": 0, - "create": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Support Ticket", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Support Ticket" - }, - { - "doctype": "DocField", - "fieldname": "subject_section", - "fieldtype": "Section Break", - "label": "Subject", - "options": "icon-flag" - }, - { - "doctype": "DocField", - "fieldname": "naming_series", - "fieldtype": "Select", - "hidden": 0, - "label": "Series", - "no_copy": 1, - "options": "SUP", - "print_hide": 1, - "reqd": 0, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "subject", - "fieldtype": "Data", - "in_filter": 1, - "in_list_view": 1, - "label": "Subject", - "report_hide": 0, - "reqd": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "cb00", - "fieldtype": "Column Break" - }, - { - "default": "Open", - "doctype": "DocField", - "fieldname": "status", - "fieldtype": "Select", - "in_filter": 0, - "in_list_view": 1, - "label": "Status", - "no_copy": 1, - "oldfieldname": "status", - "oldfieldtype": "Select", - "options": "Open\nReplied\nHold\nClosed", - "read_only": 0, - "reqd": 0, - "search_index": 1 - }, - { - "depends_on": "eval:doc.__islocal", - "doctype": "DocField", - "fieldname": "raised_by", - "fieldtype": "Data", - "in_filter": 1, - "in_list_view": 1, - "label": "Raised By (Email)", - "oldfieldname": "raised_by", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "sb00", - "fieldtype": "Section Break", - "label": "Messages", - "options": "icon-comments" - }, - { - "depends_on": "eval:doc.__islocal", - "doctype": "DocField", - "fieldname": "description", - "fieldtype": "Text", - "label": "Description", - "oldfieldname": "problem_description", - "oldfieldtype": "Text", - "reqd": 0 - }, - { - "depends_on": "eval:!doc.__islocal", - "doctype": "DocField", - "fieldname": "thread_html", - "fieldtype": "HTML", - "label": "Thread HTML", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "additional_info", - "fieldtype": "Section Break", - "label": "Reference", - "options": "icon-pushpin", - "read_only": 1 - }, - { - "depends_on": "eval:!doc.__islocal", - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "read_only": 1, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "lead", - "fieldtype": "Link", - "label": "Lead", - "options": "Lead" - }, - { - "doctype": "DocField", - "fieldname": "contact", - "fieldtype": "Link", - "label": "Contact", - "options": "Contact" - }, - { - "doctype": "DocField", - "fieldname": "customer", - "fieldtype": "Link", - "in_filter": 1, - "label": "Customer", - "oldfieldname": "customer", - "oldfieldtype": "Link", - "options": "Customer", - "print_hide": 1, - "read_only": 0, - "reqd": 0, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "customer_name", - "fieldtype": "Data", - "in_filter": 1, - "label": "Customer Name", - "oldfieldname": "customer_name", - "oldfieldtype": "Data", - "read_only": 1, - "reqd": 0, - "search_index": 0 - }, - { - "default": "Today", - "doctype": "DocField", - "fieldname": "opening_date", - "fieldtype": "Date", - "label": "Opening Date", - "no_copy": 1, - "oldfieldname": "opening_date", - "oldfieldtype": "Date", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "opening_time", - "fieldtype": "Time", - "label": "Opening Time", - "no_copy": 1, - "oldfieldname": "opening_time", - "oldfieldtype": "Time", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "company", - "fieldtype": "Link", - "label": "Company", - "options": "Company", - "print_hide": 1, - "reqd": 0 - }, - { - "depends_on": "eval:!doc.__islocal", - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "first_responded_on", - "fieldtype": "Datetime", - "label": "First Responded On" - }, - { - "depends_on": "eval:!doc.__islocal", - "doctype": "DocField", - "fieldname": "resolution_date", - "fieldtype": "Datetime", - "in_filter": 0, - "label": "Resolution Date", - "no_copy": 1, - "oldfieldname": "resolution_date", - "oldfieldtype": "Date", - "read_only": 1, - "search_index": 0 - }, - { - "depends_on": "eval:!doc.__islocal", - "doctype": "DocField", - "fieldname": "resolution_details", - "fieldtype": "Small Text", - "label": "Resolution Details", - "no_copy": 1, - "oldfieldname": "resolution_details", - "oldfieldtype": "Text", - "read_only": 0 - }, - { - "doctype": "DocField", - "fieldname": "content_type", - "fieldtype": "Data", - "hidden": 1, - "label": "Content Type" - }, - { - "doctype": "DocField", - "fieldname": "communications", - "fieldtype": "Table", - "hidden": 1, - "label": "Communications", - "options": "Communication", - "print_hide": 1 - }, - { - "delete": 0, - "doctype": "DocPerm", - "role": "Guest" - }, - { - "delete": 0, - "doctype": "DocPerm", - "role": "Customer" - }, - { - "delete": 1, - "doctype": "DocPerm", - "role": "Support Team" - } -] \ No newline at end of file +{ + "allow_attach": 1, + "autoname": "naming_series:", + "creation": "2013-02-01 10:36:25", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "subject_section", + "fieldtype": "Section Break", + "label": "Subject", + "options": "icon-flag", + "permlevel": 0 + }, + { + "fieldname": "naming_series", + "fieldtype": "Select", + "hidden": 0, + "label": "Series", + "no_copy": 1, + "options": "SUP", + "permlevel": 0, + "print_hide": 1, + "reqd": 0, + "search_index": 0 + }, + { + "fieldname": "subject", + "fieldtype": "Data", + "in_filter": 1, + "in_list_view": 1, + "label": "Subject", + "permlevel": 0, + "report_hide": 0, + "reqd": 1, + "search_index": 0 + }, + { + "fieldname": "cb00", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "default": "Open", + "fieldname": "status", + "fieldtype": "Select", + "in_filter": 0, + "in_list_view": 1, + "label": "Status", + "no_copy": 1, + "oldfieldname": "status", + "oldfieldtype": "Select", + "options": "Open\nReplied\nHold\nClosed", + "permlevel": 0, + "read_only": 0, + "reqd": 0, + "search_index": 1 + }, + { + "depends_on": "eval:doc.__islocal", + "fieldname": "raised_by", + "fieldtype": "Data", + "in_filter": 1, + "in_list_view": 1, + "label": "Raised By (Email)", + "oldfieldname": "raised_by", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "sb00", + "fieldtype": "Section Break", + "label": "Messages", + "options": "icon-comments", + "permlevel": 0 + }, + { + "depends_on": "eval:doc.__islocal", + "fieldname": "description", + "fieldtype": "Text", + "label": "Description", + "oldfieldname": "problem_description", + "oldfieldtype": "Text", + "permlevel": 0, + "reqd": 0 + }, + { + "depends_on": "eval:!doc.__islocal", + "fieldname": "thread_html", + "fieldtype": "HTML", + "label": "Thread HTML", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "additional_info", + "fieldtype": "Section Break", + "label": "Reference", + "options": "icon-pushpin", + "permlevel": 0, + "read_only": 1 + }, + { + "depends_on": "eval:!doc.__islocal", + "fieldname": "column_break0", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 1, + "width": "50%" + }, + { + "fieldname": "lead", + "fieldtype": "Link", + "label": "Lead", + "options": "Lead", + "permlevel": 0 + }, + { + "fieldname": "contact", + "fieldtype": "Link", + "label": "Contact", + "options": "Contact", + "permlevel": 0 + }, + { + "fieldname": "customer", + "fieldtype": "Link", + "in_filter": 1, + "label": "Customer", + "oldfieldname": "customer", + "oldfieldtype": "Link", + "options": "Customer", + "permlevel": 0, + "print_hide": 1, + "read_only": 0, + "reqd": 0, + "search_index": 1 + }, + { + "fieldname": "customer_name", + "fieldtype": "Data", + "in_filter": 1, + "label": "Customer Name", + "oldfieldname": "customer_name", + "oldfieldtype": "Data", + "permlevel": 0, + "read_only": 1, + "reqd": 0, + "search_index": 0 + }, + { + "default": "Today", + "fieldname": "opening_date", + "fieldtype": "Date", + "label": "Opening Date", + "no_copy": 1, + "oldfieldname": "opening_date", + "oldfieldtype": "Date", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "opening_time", + "fieldtype": "Time", + "label": "Opening Time", + "no_copy": 1, + "oldfieldname": "opening_time", + "oldfieldtype": "Time", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "company", + "fieldtype": "Link", + "label": "Company", + "options": "Company", + "permlevel": 0, + "print_hide": 1, + "reqd": 0 + }, + { + "depends_on": "eval:!doc.__islocal", + "fieldname": "column_break1", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "first_responded_on", + "fieldtype": "Datetime", + "label": "First Responded On", + "permlevel": 0 + }, + { + "depends_on": "eval:!doc.__islocal", + "fieldname": "resolution_date", + "fieldtype": "Datetime", + "in_filter": 0, + "label": "Resolution Date", + "no_copy": 1, + "oldfieldname": "resolution_date", + "oldfieldtype": "Date", + "permlevel": 0, + "read_only": 1, + "search_index": 0 + }, + { + "depends_on": "eval:!doc.__islocal", + "fieldname": "resolution_details", + "fieldtype": "Small Text", + "label": "Resolution Details", + "no_copy": 1, + "oldfieldname": "resolution_details", + "oldfieldtype": "Text", + "permlevel": 0, + "read_only": 0 + }, + { + "fieldname": "content_type", + "fieldtype": "Data", + "hidden": 1, + "label": "Content Type", + "permlevel": 0 + }, + { + "fieldname": "communications", + "fieldtype": "Table", + "hidden": 1, + "label": "Communications", + "options": "Communication", + "permlevel": 0, + "print_hide": 1 + } + ], + "icon": "icon-ticket", + "idx": 1, + "modified": "2014-01-20 17:49:31", + "modified_by": "Administrator", + "module": "Support", + "name": "Support Ticket", + "owner": "Administrator", + "permissions": [ + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Guest", + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Customer", + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Support Team", + "submit": 0, + "write": 1 + } + ], + "search_fields": "status,customer,allocated_to,subject,raised_by" +} \ No newline at end of file diff --git a/erpnext/support/page/support_analytics/support_analytics.txt b/erpnext/support/page/support_analytics/support_analytics.txt index 3b9f190a56..899f49cd8a 100644 --- a/erpnext/support/page/support_analytics/support_analytics.txt +++ b/erpnext/support/page/support_analytics/support_analytics.txt @@ -1,33 +1,20 @@ -[ - { - "creation": "2013-01-04 15:31:45", - "docstatus": 0, - "modified": "2013-07-11 14:44:24", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Page", - "icon": "icon-bar-chart", - "module": "Support", - "name": "__common__", - "page_name": "support-analytics", - "standard": "Yes", - "title": "Support Analytics" - }, - { - "doctype": "Page Role", - "name": "__common__", - "parent": "support-analytics", - "parentfield": "roles", - "parenttype": "Page", - "role": "Support Team" - }, - { - "doctype": "Page", - "name": "support-analytics" - }, - { - "doctype": "Page Role" - } -] \ No newline at end of file +{ + "creation": "2013-01-04 15:31:45", + "docstatus": 0, + "doctype": "Page", + "icon": "icon-bar-chart", + "idx": 1, + "modified": "2013-07-11 14:44:24", + "modified_by": "Administrator", + "module": "Support", + "name": "support-analytics", + "owner": "Administrator", + "page_name": "support-analytics", + "roles": [ + { + "role": "Support Team" + } + ], + "standard": "Yes", + "title": "Support Analytics" +} \ No newline at end of file diff --git a/erpnext/support/report/maintenance_schedules/maintenance_schedules.txt b/erpnext/support/report/maintenance_schedules/maintenance_schedules.txt index a4c6fdb5e0..b891aed97e 100644 --- a/erpnext/support/report/maintenance_schedules/maintenance_schedules.txt +++ b/erpnext/support/report/maintenance_schedules/maintenance_schedules.txt @@ -1,23 +1,16 @@ -[ - { - "creation": "2013-05-06 14:25:21", - "docstatus": 0, - "modified": "2014-03-07 15:30:27", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "Report", - "is_standard": "Yes", - "module": "Support", - "name": "__common__", - "query": "SELECT\n ms_sch.scheduled_date as \"Schedule Date:Date:120\",\n\tms_sch.item_code as \"Item Code:Link/Item:120\",\n\tms_sch.item_name as \"Item Name::120\",\n\tms_sch.serial_no as \"Serial No::120\",\n\tms_sch.sales_person as \"Sales Person::120\",\n\tms.customer_name as \"Customer:Link/Customer:120\",\n\tms.address_display as \"Customer Address::120\",\n\tms_item.prevdoc_docname as \"Sales Order:Link/Sales Order:120\",\n\tms.company as \"Company:Link/Company:120\"\n\t\nFROM\n\t`tabMaintenance Schedule` ms, \n `tabMaintenance Schedule Detail` ms_sch, \n `tabMaintenance Schedule Item` ms_item\nWHERE\n\tms.name = ms_sch.parent and ms.name = ms_item.parent and ms.docstatus = 1\nORDER BY\n\tms_sch.scheduled_date asc, ms_sch.item_code asc", - "ref_doctype": "Maintenance Schedule", - "report_name": "Maintenance Schedules", - "report_type": "Query Report" - }, - { - "doctype": "Report", - "name": "Maintenance Schedules" - } -] \ No newline at end of file +{ + "creation": "2013-05-06 14:25:21", + "docstatus": 0, + "doctype": "Report", + "idx": 1, + "is_standard": "Yes", + "modified": "2014-03-07 15:30:27", + "modified_by": "Administrator", + "module": "Support", + "name": "Maintenance Schedules", + "owner": "Administrator", + "query": "SELECT\n ms_sch.scheduled_date as \"Schedule Date:Date:120\",\n\tms_sch.item_code as \"Item Code:Link/Item:120\",\n\tms_sch.item_name as \"Item Name::120\",\n\tms_sch.serial_no as \"Serial No::120\",\n\tms_sch.sales_person as \"Sales Person::120\",\n\tms.customer_name as \"Customer:Link/Customer:120\",\n\tms.address_display as \"Customer Address::120\",\n\tms_item.prevdoc_docname as \"Sales Order:Link/Sales Order:120\",\n\tms.company as \"Company:Link/Company:120\"\n\t\nFROM\n\t`tabMaintenance Schedule` ms, \n `tabMaintenance Schedule Detail` ms_sch, \n `tabMaintenance Schedule Item` ms_item\nWHERE\n\tms.name = ms_sch.parent and ms.name = ms_item.parent and ms.docstatus = 1\nORDER BY\n\tms_sch.scheduled_date asc, ms_sch.item_code asc", + "ref_doctype": "Maintenance Schedule", + "report_name": "Maintenance Schedules", + "report_type": "Query Report" +} \ No newline at end of file diff --git a/erpnext/utilities/doctype/address/address.txt b/erpnext/utilities/doctype/address/address.txt index aa9230dcb6..a958c578ef 100644 --- a/erpnext/utilities/doctype/address/address.txt +++ b/erpnext/utilities/doctype/address/address.txt @@ -1,254 +1,262 @@ -[ - { - "creation": "2013-01-10 16:34:32", - "docstatus": 0, - "modified": "2014-01-27 11:19:06", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "allow_rename": 1, - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-map-marker", - "in_dialog": 0, - "module": "Utilities", - "name": "__common__", - "search_fields": "customer, supplier, sales_partner, country, state" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Address", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "cancel": 0, - "create": 1, - "delete": 0, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Address", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Address" - }, - { - "doctype": "DocField", - "fieldname": "address_details", - "fieldtype": "Section Break", - "label": "Address Details", - "options": "icon-map-marker" - }, - { - "description": "Name of person or organization that this address belongs to.", - "doctype": "DocField", - "fieldname": "address_title", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Address Title", - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "address_type", - "fieldtype": "Select", - "label": "Address Type", - "options": "Billing\nShipping\nOffice\nPersonal\nPlant\nPostal\nShop\nSubsidiary\nWarehouse\nOther", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "address_line1", - "fieldtype": "Data", - "label": "Address Line 1", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "address_line2", - "fieldtype": "Data", - "label": "Address Line 2" - }, - { - "doctype": "DocField", - "fieldname": "city", - "fieldtype": "Data", - "in_filter": 1, - "in_list_view": 1, - "label": "City/Town", - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "state", - "fieldtype": "Data", - "in_filter": 1, - "in_list_view": 1, - "label": "State", - "options": "Suggest", - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "pincode", - "fieldtype": "Data", - "in_filter": 1, - "in_list_view": 1, - "label": "Pincode", - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "country", - "fieldtype": "Select", - "in_filter": 1, - "in_list_view": 1, - "label": "Country", - "options": "link:Country", - "reqd": 1, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "print_hide": 0, - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "email_id", - "fieldtype": "Data", - "label": "Email Id" - }, - { - "doctype": "DocField", - "fieldname": "phone", - "fieldtype": "Data", - "label": "Phone", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "fax", - "fieldtype": "Data", - "in_filter": 1, - "label": "Fax" - }, - { - "default": "0", - "description": "Check to make primary address", - "doctype": "DocField", - "fieldname": "is_primary_address", - "fieldtype": "Check", - "label": "Preferred Billing Address" - }, - { - "default": "0", - "description": "Check to make Shipping Address", - "doctype": "DocField", - "fieldname": "is_shipping_address", - "fieldtype": "Check", - "in_list_view": 1, - "label": "Preferred Shipping Address" - }, - { - "doctype": "DocField", - "fieldname": "linked_with", - "fieldtype": "Section Break", - "label": "Reference", - "options": "icon-pushpin" - }, - { - "doctype": "DocField", - "fieldname": "customer", - "fieldtype": "Link", - "label": "Customer", - "options": "Customer" - }, - { - "doctype": "DocField", - "fieldname": "customer_name", - "fieldtype": "Data", - "in_filter": 1, - "in_list_view": 0, - "label": "Customer Name", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "supplier", - "fieldtype": "Link", - "label": "Supplier", - "options": "Supplier" - }, - { - "doctype": "DocField", - "fieldname": "supplier_name", - "fieldtype": "Data", - "in_filter": 1, - "in_list_view": 0, - "label": "Supplier Name", - "read_only": 1, - "search_index": 0 - }, - { - "doctype": "DocField", - "fieldname": "sales_partner", - "fieldtype": "Link", - "label": "Sales Partner", - "options": "Sales Partner" - }, - { - "doctype": "DocField", - "fieldname": "column_break_22", - "fieldtype": "Column Break" - }, - { - "depends_on": "eval:!doc.supplier && !doc.sales_partner", - "doctype": "DocField", - "fieldname": "lead", - "fieldtype": "Link", - "label": "Lead", - "options": "Lead" - }, - { - "depends_on": "eval:!doc.supplier && !doc.sales_partner", - "doctype": "DocField", - "fieldname": "lead_name", - "fieldtype": "Data", - "label": "Lead Name", - "read_only": 1 - }, - { - "doctype": "DocPerm", - "role": "Sales User" - }, - { - "doctype": "DocPerm", - "role": "Purchase User" - }, - { - "doctype": "DocPerm", - "role": "Maintenance User" - }, - { - "doctype": "DocPerm", - "role": "Accounts User" - } -] \ No newline at end of file +{ + "allow_import": 1, + "allow_rename": 1, + "creation": "2013-01-10 16:34:32", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "address_details", + "fieldtype": "Section Break", + "label": "Address Details", + "options": "icon-map-marker", + "permlevel": 0 + }, + { + "description": "Name of person or organization that this address belongs to.", + "fieldname": "address_title", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Address Title", + "permlevel": 0, + "reqd": 0 + }, + { + "fieldname": "address_type", + "fieldtype": "Select", + "label": "Address Type", + "options": "Billing\nShipping\nOffice\nPersonal\nPlant\nPostal\nShop\nSubsidiary\nWarehouse\nOther", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "address_line1", + "fieldtype": "Data", + "label": "Address Line 1", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "address_line2", + "fieldtype": "Data", + "label": "Address Line 2", + "permlevel": 0 + }, + { + "fieldname": "city", + "fieldtype": "Data", + "in_filter": 1, + "in_list_view": 1, + "label": "City/Town", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "state", + "fieldtype": "Data", + "in_filter": 1, + "in_list_view": 1, + "label": "State", + "options": "Suggest", + "permlevel": 0, + "search_index": 0 + }, + { + "fieldname": "pincode", + "fieldtype": "Data", + "in_filter": 1, + "in_list_view": 1, + "label": "Pincode", + "permlevel": 0, + "search_index": 1 + }, + { + "fieldname": "country", + "fieldtype": "Select", + "in_filter": 1, + "in_list_view": 1, + "label": "Country", + "options": "link:Country", + "permlevel": 0, + "reqd": 1, + "search_index": 1 + }, + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "permlevel": 0, + "print_hide": 0, + "width": "50%" + }, + { + "fieldname": "email_id", + "fieldtype": "Data", + "label": "Email Id", + "permlevel": 0 + }, + { + "fieldname": "phone", + "fieldtype": "Data", + "label": "Phone", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "fax", + "fieldtype": "Data", + "in_filter": 1, + "label": "Fax", + "permlevel": 0 + }, + { + "default": "0", + "description": "Check to make primary address", + "fieldname": "is_primary_address", + "fieldtype": "Check", + "label": "Preferred Billing Address", + "permlevel": 0 + }, + { + "default": "0", + "description": "Check to make Shipping Address", + "fieldname": "is_shipping_address", + "fieldtype": "Check", + "in_list_view": 1, + "label": "Preferred Shipping Address", + "permlevel": 0 + }, + { + "fieldname": "linked_with", + "fieldtype": "Section Break", + "label": "Reference", + "options": "icon-pushpin", + "permlevel": 0 + }, + { + "fieldname": "customer", + "fieldtype": "Link", + "label": "Customer", + "options": "Customer", + "permlevel": 0 + }, + { + "fieldname": "customer_name", + "fieldtype": "Data", + "in_filter": 1, + "in_list_view": 0, + "label": "Customer Name", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "supplier", + "fieldtype": "Link", + "label": "Supplier", + "options": "Supplier", + "permlevel": 0 + }, + { + "fieldname": "supplier_name", + "fieldtype": "Data", + "in_filter": 1, + "in_list_view": 0, + "label": "Supplier Name", + "permlevel": 0, + "read_only": 1, + "search_index": 0 + }, + { + "fieldname": "sales_partner", + "fieldtype": "Link", + "label": "Sales Partner", + "options": "Sales Partner", + "permlevel": 0 + }, + { + "fieldname": "column_break_22", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "depends_on": "eval:!doc.supplier && !doc.sales_partner", + "fieldname": "lead", + "fieldtype": "Link", + "label": "Lead", + "options": "Lead", + "permlevel": 0 + }, + { + "depends_on": "eval:!doc.supplier && !doc.sales_partner", + "fieldname": "lead_name", + "fieldtype": "Data", + "label": "Lead Name", + "permlevel": 0, + "read_only": 1 + } + ], + "icon": "icon-map-marker", + "idx": 1, + "in_dialog": 0, + "modified": "2014-01-27 11:19:06", + "modified_by": "Administrator", + "module": "Utilities", + "name": "Address", + "owner": "Administrator", + "permissions": [ + { + "cancel": 0, + "create": 1, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales User", + "submit": 0, + "write": 1 + }, + { + "cancel": 0, + "create": 1, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase User", + "submit": 0, + "write": 1 + }, + { + "cancel": 0, + "create": 1, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Maintenance User", + "submit": 0, + "write": 1 + }, + { + "cancel": 0, + "create": 1, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts User", + "submit": 0, + "write": 1 + } + ], + "search_fields": "customer, supplier, sales_partner, country, state" +} \ No newline at end of file diff --git a/erpnext/utilities/doctype/contact/contact.txt b/erpnext/utilities/doctype/contact/contact.txt index 5a3e32d650..ab828f99e4 100644 --- a/erpnext/utilities/doctype/contact/contact.txt +++ b/erpnext/utilities/doctype/contact/contact.txt @@ -1,301 +1,362 @@ -[ - { - "creation": "2013-01-10 16:34:32", - "docstatus": 0, - "modified": "2014-01-20 17:48:29", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_import": 1, - "allow_rename": 1, - "doctype": "DocType", - "document_type": "Master", - "icon": "icon-user", - "in_create": 0, - "in_dialog": 0, - "module": "Utilities", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Contact", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "cancel": 0, - "create": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Contact", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Contact" - }, - { - "doctype": "DocField", - "fieldname": "contact_section", - "fieldtype": "Section Break", - "label": "Contact Details", - "options": "icon-user" - }, - { - "doctype": "DocField", - "fieldname": "first_name", - "fieldtype": "Data", - "label": "First Name", - "oldfieldname": "first_name", - "oldfieldtype": "Data", - "reqd": 1 - }, - { - "doctype": "DocField", - "fieldname": "last_name", - "fieldtype": "Data", - "label": "Last Name", - "oldfieldname": "last_name", - "oldfieldtype": "Data" - }, - { - "doctype": "DocField", - "fieldname": "cb00", - "fieldtype": "Column Break" - }, - { - "default": "Passive", - "doctype": "DocField", - "fieldname": "status", - "fieldtype": "Select", - "label": "Status", - "options": "Passive\nOpen\nReplied" - }, - { - "doctype": "DocField", - "fieldname": "email_id", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Email Id", - "oldfieldname": "email_id", - "oldfieldtype": "Data", - "reqd": 0, - "search_index": 1 - }, - { - "doctype": "DocField", - "fieldname": "phone", - "fieldtype": "Data", - "label": "Phone", - "oldfieldname": "contact_no", - "oldfieldtype": "Data", - "reqd": 0 - }, - { - "doctype": "DocField", - "fieldname": "sb00", - "fieldtype": "Section Break", - "label": "Communication History", - "options": "icon-comments", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "communication_html", - "fieldtype": "HTML", - "label": "Communication HTML", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "contact_details", - "fieldtype": "Section Break", - "label": "Reference", - "options": "icon-pushpin" - }, - { - "depends_on": "eval:!doc.supplier && !doc.sales_partner", - "doctype": "DocField", - "fieldname": "customer", - "fieldtype": "Link", - "label": "Customer", - "oldfieldname": "customer", - "oldfieldtype": "Link", - "options": "Customer", - "print_hide": 0 - }, - { - "depends_on": "eval:!doc.supplier && !doc.sales_partner", - "doctype": "DocField", - "fieldname": "customer_name", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Customer Name", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "oldfieldtype": "Column Break", - "width": "50%" - }, - { - "depends_on": "eval:!doc.customer && !doc.sales_partner", - "doctype": "DocField", - "fieldname": "supplier", - "fieldtype": "Link", - "label": "Supplier", - "options": "Supplier" - }, - { - "allow_on_submit": 0, - "depends_on": "eval:!doc.customer && !doc.sales_partner", - "doctype": "DocField", - "fieldname": "supplier_name", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Supplier Name", - "read_only": 1 - }, - { - "depends_on": "eval:!doc.customer && !doc.supplier", - "doctype": "DocField", - "fieldname": "sales_partner", - "fieldtype": "Link", - "label": "Sales Partner", - "options": "Sales Partner" - }, - { - "default": "0", - "depends_on": "eval:(doc.customer || doc.supplier || doc.sales_partner)", - "doctype": "DocField", - "fieldname": "is_primary_contact", - "fieldtype": "Check", - "label": "Is Primary Contact", - "oldfieldname": "is_primary_contact", - "oldfieldtype": "Select" - }, - { - "doctype": "DocField", - "fieldname": "more_info", - "fieldtype": "Section Break", - "label": "More Info", - "options": "icon-file-text" - }, - { - "doctype": "DocField", - "fieldname": "mobile_no", - "fieldtype": "Data", - "label": "Mobile No", - "oldfieldname": "mobile_no", - "oldfieldtype": "Data" - }, - { - "description": "Enter department to which this Contact belongs", - "doctype": "DocField", - "fieldname": "department", - "fieldtype": "Data", - "label": "Department", - "options": "Suggest" - }, - { - "description": "Enter designation of this Contact", - "doctype": "DocField", - "fieldname": "designation", - "fieldtype": "Data", - "label": "Designation", - "options": "Suggest" - }, - { - "doctype": "DocField", - "fieldname": "unsubscribed", - "fieldtype": "Check", - "label": "Unsubscribed" - }, - { - "doctype": "DocField", - "fieldname": "trash_reason", - "fieldtype": "Small Text", - "label": "Trash Reason", - "oldfieldname": "trash_reason", - "oldfieldtype": "Small Text", - "read_only": 1 - }, - { - "doctype": "DocField", - "fieldname": "communications", - "fieldtype": "Table", - "hidden": 1, - "label": "Communications", - "options": "Communication", - "print_hide": 1 - }, - { - "delete": 1, - "doctype": "DocPerm", - "role": "System Manager" - }, - { - "amend": 0, - "delete": 1, - "doctype": "DocPerm", - "role": "Sales Master Manager" - }, - { - "delete": 1, - "doctype": "DocPerm", - "role": "Purchase Master Manager" - }, - { - "delete": 0, - "doctype": "DocPerm", - "role": "Sales Manager" - }, - { - "delete": 0, - "doctype": "DocPerm", - "role": "Purchase Manager" - }, - { - "delete": 0, - "doctype": "DocPerm", - "role": "Maintenance Manager" - }, - { - "delete": 0, - "doctype": "DocPerm", - "role": "Accounts Manager" - }, - { - "delete": 0, - "doctype": "DocPerm", - "role": "Sales User" - }, - { - "delete": 0, - "doctype": "DocPerm", - "role": "Purchase User" - }, - { - "delete": 0, - "doctype": "DocPerm", - "role": "Maintenance User" - }, - { - "delete": 0, - "doctype": "DocPerm", - "role": "Accounts User" - } -] \ No newline at end of file +{ + "allow_import": 1, + "allow_rename": 1, + "creation": "2013-01-10 16:34:32", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "fields": [ + { + "fieldname": "contact_section", + "fieldtype": "Section Break", + "label": "Contact Details", + "options": "icon-user", + "permlevel": 0 + }, + { + "fieldname": "first_name", + "fieldtype": "Data", + "label": "First Name", + "oldfieldname": "first_name", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 1 + }, + { + "fieldname": "last_name", + "fieldtype": "Data", + "label": "Last Name", + "oldfieldname": "last_name", + "oldfieldtype": "Data", + "permlevel": 0 + }, + { + "fieldname": "cb00", + "fieldtype": "Column Break", + "permlevel": 0 + }, + { + "default": "Passive", + "fieldname": "status", + "fieldtype": "Select", + "label": "Status", + "options": "Passive\nOpen\nReplied", + "permlevel": 0 + }, + { + "fieldname": "email_id", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Email Id", + "oldfieldname": "email_id", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 0, + "search_index": 1 + }, + { + "fieldname": "phone", + "fieldtype": "Data", + "label": "Phone", + "oldfieldname": "contact_no", + "oldfieldtype": "Data", + "permlevel": 0, + "reqd": 0 + }, + { + "fieldname": "sb00", + "fieldtype": "Section Break", + "label": "Communication History", + "options": "icon-comments", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "communication_html", + "fieldtype": "HTML", + "label": "Communication HTML", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "contact_details", + "fieldtype": "Section Break", + "label": "Reference", + "options": "icon-pushpin", + "permlevel": 0 + }, + { + "depends_on": "eval:!doc.supplier && !doc.sales_partner", + "fieldname": "customer", + "fieldtype": "Link", + "label": "Customer", + "oldfieldname": "customer", + "oldfieldtype": "Link", + "options": "Customer", + "permlevel": 0, + "print_hide": 0 + }, + { + "depends_on": "eval:!doc.supplier && !doc.sales_partner", + "fieldname": "customer_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Customer Name", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "oldfieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "depends_on": "eval:!doc.customer && !doc.sales_partner", + "fieldname": "supplier", + "fieldtype": "Link", + "label": "Supplier", + "options": "Supplier", + "permlevel": 0 + }, + { + "allow_on_submit": 0, + "depends_on": "eval:!doc.customer && !doc.sales_partner", + "fieldname": "supplier_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Supplier Name", + "permlevel": 0, + "read_only": 1 + }, + { + "depends_on": "eval:!doc.customer && !doc.supplier", + "fieldname": "sales_partner", + "fieldtype": "Link", + "label": "Sales Partner", + "options": "Sales Partner", + "permlevel": 0 + }, + { + "default": "0", + "depends_on": "eval:(doc.customer || doc.supplier || doc.sales_partner)", + "fieldname": "is_primary_contact", + "fieldtype": "Check", + "label": "Is Primary Contact", + "oldfieldname": "is_primary_contact", + "oldfieldtype": "Select", + "permlevel": 0 + }, + { + "fieldname": "more_info", + "fieldtype": "Section Break", + "label": "More Info", + "options": "icon-file-text", + "permlevel": 0 + }, + { + "fieldname": "mobile_no", + "fieldtype": "Data", + "label": "Mobile No", + "oldfieldname": "mobile_no", + "oldfieldtype": "Data", + "permlevel": 0 + }, + { + "description": "Enter department to which this Contact belongs", + "fieldname": "department", + "fieldtype": "Data", + "label": "Department", + "options": "Suggest", + "permlevel": 0 + }, + { + "description": "Enter designation of this Contact", + "fieldname": "designation", + "fieldtype": "Data", + "label": "Designation", + "options": "Suggest", + "permlevel": 0 + }, + { + "fieldname": "unsubscribed", + "fieldtype": "Check", + "label": "Unsubscribed", + "permlevel": 0 + }, + { + "fieldname": "trash_reason", + "fieldtype": "Small Text", + "label": "Trash Reason", + "oldfieldname": "trash_reason", + "oldfieldtype": "Small Text", + "permlevel": 0, + "read_only": 1 + }, + { + "fieldname": "communications", + "fieldtype": "Table", + "hidden": 1, + "label": "Communications", + "options": "Communication", + "permlevel": 0, + "print_hide": 1 + } + ], + "icon": "icon-user", + "idx": 1, + "in_create": 0, + "in_dialog": 0, + "modified": "2014-01-20 17:48:29", + "modified_by": "Administrator", + "module": "Utilities", + "name": "Contact", + "owner": "Administrator", + "permissions": [ + { + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "submit": 0, + "write": 1 + }, + { + "amend": 0, + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales Master Manager", + "submit": 0, + "write": 1 + }, + { + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase Master Manager", + "submit": 0, + "write": 1 + }, + { + "cancel": 0, + "create": 1, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales Manager", + "submit": 0, + "write": 1 + }, + { + "cancel": 0, + "create": 1, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase Manager", + "submit": 0, + "write": 1 + }, + { + "cancel": 0, + "create": 1, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Maintenance Manager", + "submit": 0, + "write": 1 + }, + { + "cancel": 0, + "create": 1, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts Manager", + "submit": 0, + "write": 1 + }, + { + "cancel": 0, + "create": 1, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Sales User", + "submit": 0, + "write": 1 + }, + { + "cancel": 0, + "create": 1, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Purchase User", + "submit": 0, + "write": 1 + }, + { + "cancel": 0, + "create": 1, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Maintenance User", + "submit": 0, + "write": 1 + }, + { + "cancel": 0, + "create": 1, + "delete": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "Accounts User", + "submit": 0, + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/utilities/doctype/note/note.txt b/erpnext/utilities/doctype/note/note.txt index 94e5a0fbb3..e281f6c336 100644 --- a/erpnext/utilities/doctype/note/note.txt +++ b/erpnext/utilities/doctype/note/note.txt @@ -1,88 +1,69 @@ -[ - { - "creation": "2013-05-24 13:41:00", - "docstatus": 0, - "modified": "2014-01-22 16:05:35", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_rename": 1, - "description": "Note is a free page where users can share documents / notes", - "doctype": "DocType", - "document_type": "Transaction", - "icon": "icon-file-text", - "module": "Utilities", - "name": "__common__", - "read_only_onload": 1 - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Note", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "cancel": 0, - "create": 1, - "delete": 1, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "Note", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "restricted": 1, - "role": "All", - "write": 1 - }, - { - "doctype": "DocType", - "name": "Note" - }, - { - "doctype": "DocField", - "fieldname": "title", - "fieldtype": "Data", - "label": "Title", - "print_hide": 1 - }, - { - "description": "Help: To link to another record in the system, use \"#Form/Note/[Note Name]\" as the Link URL. (don't use \"http://\")", - "doctype": "DocField", - "fieldname": "content", - "fieldtype": "Text Editor", - "in_list_view": 0, - "label": "Content" - }, - { - "doctype": "DocField", - "fieldname": "share", - "fieldtype": "Section Break", - "label": "Share" - }, - { - "description": "Everyone can read", - "doctype": "DocField", - "fieldname": "public", - "fieldtype": "Check", - "label": "Public", - "print_hide": 1 - }, - { - "doctype": "DocField", - "fieldname": "share_with", - "fieldtype": "Table", - "label": "Share With", - "options": "Note User", - "print_hide": 1 - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "allow_rename": 1, + "creation": "2013-05-24 13:41:00", + "description": "Note is a free page where users can share documents / notes", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Transaction", + "fields": [ + { + "fieldname": "title", + "fieldtype": "Data", + "label": "Title", + "permlevel": 0, + "print_hide": 1 + }, + { + "description": "Help: To link to another record in the system, use \"#Form/Note/[Note Name]\" as the Link URL. (don't use \"http://\")", + "fieldname": "content", + "fieldtype": "Text Editor", + "in_list_view": 0, + "label": "Content", + "permlevel": 0 + }, + { + "fieldname": "share", + "fieldtype": "Section Break", + "label": "Share", + "permlevel": 0 + }, + { + "description": "Everyone can read", + "fieldname": "public", + "fieldtype": "Check", + "label": "Public", + "permlevel": 0, + "print_hide": 1 + }, + { + "fieldname": "share_with", + "fieldtype": "Table", + "label": "Share With", + "options": "Note User", + "permlevel": 0, + "print_hide": 1 + } + ], + "icon": "icon-file-text", + "idx": 1, + "modified": "2014-01-22 16:05:35", + "modified_by": "Administrator", + "module": "Utilities", + "name": "Note", + "owner": "Administrator", + "permissions": [ + { + "cancel": 0, + "create": 1, + "delete": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "restricted": 1, + "role": "All", + "write": 1 + } + ], + "read_only_onload": 1 +} \ No newline at end of file diff --git a/erpnext/utilities/doctype/note_user/note_user.txt b/erpnext/utilities/doctype/note_user/note_user.txt index 6ae80de1a4..09bfb69307 100644 --- a/erpnext/utilities/doctype/note_user/note_user.txt +++ b/erpnext/utilities/doctype/note_user/note_user.txt @@ -1,46 +1,34 @@ -[ - { - "creation": "2013-05-24 14:24:48", - "docstatus": 0, - "modified": "2013-12-20 19:23:23", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "description": "List of users who can edit a particular Note", - "doctype": "DocType", - "document_type": "Other", - "istable": 1, - "module": "Utilities", - "name": "__common__" - }, - { - "doctype": "DocField", - "in_list_view": 1, - "name": "__common__", - "parent": "Note User", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "doctype": "DocType", - "name": "Note User" - }, - { - "doctype": "DocField", - "fieldname": "user", - "fieldtype": "Link", - "label": "User", - "options": "User", - "reqd": 1 - }, - { - "default": "Edit", - "doctype": "DocField", - "fieldname": "permission", - "fieldtype": "Select", - "label": "Permission", - "options": "Edit\nRead" - } -] \ No newline at end of file +{ + "creation": "2013-05-24 14:24:48", + "description": "List of users who can edit a particular Note", + "docstatus": 0, + "doctype": "DocType", + "document_type": "Other", + "fields": [ + { + "fieldname": "user", + "fieldtype": "Link", + "in_list_view": 1, + "label": "User", + "options": "User", + "permlevel": 0, + "reqd": 1 + }, + { + "default": "Edit", + "fieldname": "permission", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Permission", + "options": "Edit\nRead", + "permlevel": 0 + } + ], + "idx": 1, + "istable": 1, + "modified": "2013-12-20 19:23:23", + "modified_by": "Administrator", + "module": "Utilities", + "name": "Note User", + "owner": "Administrator" +} \ No newline at end of file diff --git a/erpnext/utilities/doctype/rename_tool/rename_tool.txt b/erpnext/utilities/doctype/rename_tool/rename_tool.txt index e397cf3de4..4c09d90f68 100644 --- a/erpnext/utilities/doctype/rename_tool/rename_tool.txt +++ b/erpnext/utilities/doctype/rename_tool/rename_tool.txt @@ -1,70 +1,51 @@ -[ - { - "creation": "2012-12-03 10:25:59", - "docstatus": 0, - "modified": "2013-07-05 14:52:51", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "allow_attach": 0, - "allow_email": 1, - "allow_print": 1, - "doctype": "DocType", - "hide_heading": 0, - "hide_toolbar": 1, - "icon": "icon-magic", - "issingle": 1, - "max_attachments": 1, - "module": "Utilities", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "Rename Tool", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "create": 1, - "doctype": "DocPerm", - "name": "__common__", - "parent": "Rename Tool", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "read": 1, - "report": 0, - "role": "System Manager", - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "Rename Tool" - }, - { - "description": "Type of document to rename.", - "doctype": "DocField", - "fieldname": "select_doctype", - "fieldtype": "Select", - "label": "Select DocType" - }, - { - "doctype": "DocField", - "fieldname": "upload_html", - "fieldtype": "HTML", - "label": "Upload HTML" - }, - { - "doctype": "DocField", - "fieldname": "rename_log", - "fieldtype": "HTML", - "label": "Rename Log" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "allow_attach": 0, + "allow_email": 1, + "allow_print": 1, + "creation": "2012-12-03 10:25:59", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "description": "Type of document to rename.", + "fieldname": "select_doctype", + "fieldtype": "Select", + "label": "Select DocType", + "permlevel": 0 + }, + { + "fieldname": "upload_html", + "fieldtype": "HTML", + "label": "Upload HTML", + "permlevel": 0 + }, + { + "fieldname": "rename_log", + "fieldtype": "HTML", + "label": "Rename Log", + "permlevel": 0 + } + ], + "hide_heading": 0, + "hide_toolbar": 1, + "icon": "icon-magic", + "idx": 1, + "issingle": 1, + "max_attachments": 1, + "modified": "2013-07-05 14:52:51", + "modified_by": "Administrator", + "module": "Utilities", + "name": "Rename Tool", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "permlevel": 0, + "read": 1, + "report": 0, + "role": "System Manager", + "submit": 0, + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/utilities/doctype/sms_control/sms_control.txt b/erpnext/utilities/doctype/sms_control/sms_control.txt index f8e0fae9dc..80c4ef2c4c 100644 --- a/erpnext/utilities/doctype/sms_control/sms_control.txt +++ b/erpnext/utilities/doctype/sms_control/sms_control.txt @@ -1,42 +1,29 @@ -[ - { - "creation": "2013-01-10 16:34:32", - "docstatus": 0, - "modified": "2013-12-20 19:21:47", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "doctype": "DocType", - "icon": "icon-mobile-phone", - "in_create": 0, - "issingle": 1, - "module": "Utilities", - "name": "__common__" - }, - { - "create": 1, - "doctype": "DocPerm", - "email": 1, - "export": 0, - "import": 0, - "name": "__common__", - "parent": "SMS Control", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 0, - "role": "System Manager", - "submit": 0, - "write": 1 - }, - { - "doctype": "DocType", - "name": "SMS Control" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "creation": "2013-01-10 16:34:32", + "docstatus": 0, + "doctype": "DocType", + "icon": "icon-mobile-phone", + "idx": 1, + "in_create": 0, + "issingle": 1, + "modified": "2013-12-20 19:21:47", + "modified_by": "Administrator", + "module": "Utilities", + "name": "SMS Control", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "email": 1, + "export": 0, + "import": 0, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 0, + "role": "System Manager", + "submit": 0, + "write": 1 + } + ] +} \ No newline at end of file diff --git a/erpnext/utilities/doctype/sms_log/sms_log.txt b/erpnext/utilities/doctype/sms_log/sms_log.txt index 43cb1ffbcd..a60eb1aff8 100644 --- a/erpnext/utilities/doctype/sms_log/sms_log.txt +++ b/erpnext/utilities/doctype/sms_log/sms_log.txt @@ -1,94 +1,75 @@ -[ - { - "creation": "2012-03-27 14:36:47", - "docstatus": 0, - "modified": "2013-12-20 19:24:35", - "modified_by": "Administrator", - "owner": "Administrator" - }, - { - "autoname": "SMSLOG/.########", - "doctype": "DocType", - "icon": "icon-mobile-phone", - "module": "Utilities", - "name": "__common__" - }, - { - "doctype": "DocField", - "name": "__common__", - "parent": "SMS Log", - "parentfield": "fields", - "parenttype": "DocType", - "permlevel": 0 - }, - { - "create": 0, - "doctype": "DocPerm", - "email": 1, - "name": "__common__", - "parent": "SMS Log", - "parentfield": "permissions", - "parenttype": "DocType", - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, - "role": "System Manager", - "write": 0 - }, - { - "doctype": "DocType", - "name": "SMS Log" - }, - { - "doctype": "DocField", - "fieldname": "column_break0", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "sender_name", - "fieldtype": "Data", - "label": "Sender Name" - }, - { - "doctype": "DocField", - "fieldname": "sent_on", - "fieldtype": "Date", - "label": "Sent On" - }, - { - "doctype": "DocField", - "fieldname": "receiver_list", - "fieldtype": "Small Text", - "label": "Receiver List" - }, - { - "doctype": "DocField", - "fieldname": "column_break1", - "fieldtype": "Column Break", - "width": "50%" - }, - { - "doctype": "DocField", - "fieldname": "no_of_requested_sms", - "fieldtype": "Int", - "label": "No of Requested SMS" - }, - { - "doctype": "DocField", - "fieldname": "no_of_sent_sms", - "fieldtype": "Int", - "label": "No of Sent SMS" - }, - { - "doctype": "DocField", - "fieldname": "message", - "fieldtype": "Small Text", - "label": "Message" - }, - { - "doctype": "DocPerm" - } -] \ No newline at end of file +{ + "autoname": "SMSLOG/.########", + "creation": "2012-03-27 14:36:47", + "docstatus": 0, + "doctype": "DocType", + "fields": [ + { + "fieldname": "column_break0", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "sender_name", + "fieldtype": "Data", + "label": "Sender Name", + "permlevel": 0 + }, + { + "fieldname": "sent_on", + "fieldtype": "Date", + "label": "Sent On", + "permlevel": 0 + }, + { + "fieldname": "receiver_list", + "fieldtype": "Small Text", + "label": "Receiver List", + "permlevel": 0 + }, + { + "fieldname": "column_break1", + "fieldtype": "Column Break", + "permlevel": 0, + "width": "50%" + }, + { + "fieldname": "no_of_requested_sms", + "fieldtype": "Int", + "label": "No of Requested SMS", + "permlevel": 0 + }, + { + "fieldname": "no_of_sent_sms", + "fieldtype": "Int", + "label": "No of Sent SMS", + "permlevel": 0 + }, + { + "fieldname": "message", + "fieldtype": "Small Text", + "label": "Message", + "permlevel": 0 + } + ], + "icon": "icon-mobile-phone", + "idx": 1, + "modified": "2013-12-20 19:24:35", + "modified_by": "Administrator", + "module": "Utilities", + "name": "SMS Log", + "owner": "Administrator", + "permissions": [ + { + "create": 0, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "write": 0 + } + ] +} \ No newline at end of file From 40534f076b317ff6fdfa267291410e97a96c18c2 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 28 Mar 2014 12:46:53 +0530 Subject: [PATCH 06/42] Changed creation, modified format frappe/frappe#478 --- .../Cheque Printing Format/Cheque Printing Format.txt | 4 ++-- erpnext/accounts/Print Format/POS Invoice/POS Invoice.txt | 4 ++-- .../Payment Receipt Voucher/Payment Receipt Voucher.txt | 4 ++-- .../Sales Invoice Classic/Sales Invoice Classic.txt | 4 ++-- .../Sales Invoice Modern/Sales Invoice Modern.txt | 4 ++-- .../Sales Invoice Spartan/Sales Invoice Spartan.txt | 4 ++-- erpnext/accounts/Print Format/SalesInvoice/SalesInvoice.txt | 4 ++-- erpnext/accounts/doctype/account/account.txt | 4 ++-- .../accounts/doctype/accounts_settings/accounts_settings.txt | 4 ++-- .../doctype/bank_reconciliation/bank_reconciliation.txt | 4 ++-- .../bank_reconciliation_detail/bank_reconciliation_detail.txt | 4 ++-- erpnext/accounts/doctype/budget_detail/budget_detail.txt | 4 ++-- .../doctype/budget_distribution/budget_distribution.txt | 4 ++-- .../budget_distribution_detail/budget_distribution_detail.txt | 4 ++-- erpnext/accounts/doctype/c_form/c_form.txt | 4 ++-- .../doctype/c_form_invoice_detail/c_form_invoice_detail.txt | 4 ++-- .../accounts/doctype/chart_of_accounts/chart_of_accounts.txt | 4 ++-- erpnext/accounts/doctype/cost_center/cost_center.txt | 4 ++-- erpnext/accounts/doctype/fiscal_year/fiscal_year.txt | 4 ++-- erpnext/accounts/doctype/gl_entry/gl_entry.txt | 4 ++-- erpnext/accounts/doctype/journal_voucher/journal_voucher.txt | 4 ++-- .../doctype/journal_voucher_detail/journal_voucher_detail.txt | 4 ++-- erpnext/accounts/doctype/mode_of_payment/mode_of_payment.txt | 4 ++-- .../payment_to_invoice_matching_tool.txt | 4 ++-- .../payment_to_invoice_matching_tool_detail.txt | 4 ++-- .../doctype/period_closing_voucher/period_closing_voucher.txt | 4 ++-- erpnext/accounts/doctype/pos_setting/pos_setting.txt | 4 ++-- erpnext/accounts/doctype/pricing_rule/pricing_rule.txt | 4 ++-- .../accounts/doctype/purchase_invoice/purchase_invoice.txt | 4 ++-- .../purchase_invoice_advance/purchase_invoice_advance.txt | 4 ++-- .../doctype/purchase_invoice_item/purchase_invoice_item.txt | 4 ++-- .../purchase_taxes_and_charges/purchase_taxes_and_charges.txt | 4 ++-- .../purchase_taxes_and_charges_master.txt | 4 ++-- erpnext/accounts/doctype/sales_invoice/sales_invoice.txt | 4 ++-- .../doctype/sales_invoice_advance/sales_invoice_advance.txt | 4 ++-- .../doctype/sales_invoice_item/sales_invoice_item.txt | 4 ++-- .../sales_taxes_and_charges/sales_taxes_and_charges.txt | 4 ++-- .../sales_taxes_and_charges_master.txt | 4 ++-- erpnext/accounts/doctype/shipping_rule/shipping_rule.txt | 4 ++-- .../shipping_rule_condition/shipping_rule_condition.txt | 4 ++-- erpnext/accounts/page/accounts_browser/accounts_browser.txt | 4 ++-- .../accounts/page/financial_analytics/financial_analytics.txt | 4 ++-- erpnext/accounts/page/trial_balance/trial_balance.txt | 4 ++-- erpnext/accounts/report/accounts_payable/accounts_payable.txt | 4 ++-- .../report/accounts_receivable/accounts_receivable.txt | 4 ++-- .../report/bank_clearance_summary/bank_clearance_summary.txt | 4 ++-- .../bank_reconciliation_statement.txt | 4 ++-- .../report/budget_variance_report/budget_variance_report.txt | 4 ++-- .../report/customer_account_head/customer_account_head.txt | 4 ++-- .../delivered_items_to_be_billed.txt | 4 ++-- erpnext/accounts/report/general_ledger/general_ledger.txt | 4 ++-- erpnext/accounts/report/gross_profit/gross_profit.txt | 4 ++-- .../item_wise_purchase_register.txt | 4 ++-- .../item_wise_sales_register/item_wise_sales_register.txt | 4 ++-- .../ordered_items_to_be_billed/ordered_items_to_be_billed.txt | 4 ++-- .../payment_period_based_on_invoice_date.txt | 4 ++-- .../purchase_invoice_trends/purchase_invoice_trends.txt | 4 ++-- .../purchase_order_items_to_be_billed.txt | 4 ++-- .../accounts/report/purchase_register/purchase_register.txt | 4 ++-- .../received_items_to_be_billed.txt | 4 ++-- .../report/sales_invoice_trends/sales_invoice_trends.txt | 4 ++-- .../sales_partners_commission/sales_partners_commission.txt | 4 ++-- erpnext/accounts/report/sales_register/sales_register.txt | 4 ++-- .../report/supplier_account_head/supplier_account_head.txt | 4 ++-- .../Purchase Order Classic/Purchase Order Classic.txt | 4 ++-- .../Purchase Order Modern/Purchase Order Modern.txt | 4 ++-- .../Purchase Order Spartan/Purchase Order Spartan.txt | 4 ++-- erpnext/buying/doctype/buying_settings/buying_settings.txt | 4 ++-- erpnext/buying/doctype/purchase_common/purchase_common.txt | 4 ++-- erpnext/buying/doctype/purchase_order/purchase_order.txt | 4 ++-- .../doctype/purchase_order_item/purchase_order_item.txt | 4 ++-- .../purchase_order_item_supplied.txt | 4 ++-- .../purchase_receipt_item_supplied.txt | 4 ++-- .../buying/doctype/quality_inspection/quality_inspection.txt | 4 ++-- .../quality_inspection_reading/quality_inspection_reading.txt | 4 ++-- erpnext/buying/doctype/supplier/supplier.txt | 4 ++-- .../buying/doctype/supplier_quotation/supplier_quotation.txt | 4 ++-- .../supplier_quotation_item/supplier_quotation_item.txt | 4 ++-- erpnext/buying/page/purchase_analytics/purchase_analytics.txt | 4 ++-- .../item_wise_purchase_history/item_wise_purchase_history.txt | 4 ++-- .../report/purchase_order_trends/purchase_order_trends.txt | 4 ++-- .../requested_items_to_be_ordered.txt | 4 ++-- .../supplier_addresses_and_contacts.txt | 4 ++-- erpnext/home/doctype/feed/feed.txt | 4 ++-- erpnext/home/page/activity/activity.txt | 4 ++-- erpnext/hr/doctype/appraisal/appraisal.txt | 4 ++-- erpnext/hr/doctype/appraisal_goal/appraisal_goal.txt | 4 ++-- erpnext/hr/doctype/appraisal_template/appraisal_template.txt | 4 ++-- .../appraisal_template_goal/appraisal_template_goal.txt | 4 ++-- erpnext/hr/doctype/attendance/attendance.txt | 4 ++-- erpnext/hr/doctype/branch/branch.txt | 4 ++-- erpnext/hr/doctype/deduction_type/deduction_type.txt | 4 ++-- erpnext/hr/doctype/department/department.txt | 4 ++-- erpnext/hr/doctype/designation/designation.txt | 4 ++-- erpnext/hr/doctype/earning_type/earning_type.txt | 4 ++-- erpnext/hr/doctype/employee/employee.txt | 4 ++-- erpnext/hr/doctype/employee_education/employee_education.txt | 4 ++-- .../employee_external_work_history.txt | 4 ++-- .../employee_internal_work_history.txt | 4 ++-- .../employee_leave_approver/employee_leave_approver.txt | 4 ++-- erpnext/hr/doctype/employment_type/employment_type.txt | 4 ++-- erpnext/hr/doctype/expense_claim/expense_claim.txt | 4 ++-- .../hr/doctype/expense_claim_detail/expense_claim_detail.txt | 4 ++-- erpnext/hr/doctype/expense_claim_type/expense_claim_type.txt | 4 ++-- erpnext/hr/doctype/grade/grade.txt | 4 ++-- erpnext/hr/doctype/holiday/holiday.txt | 4 ++-- erpnext/hr/doctype/holiday_list/holiday_list.txt | 4 ++-- erpnext/hr/doctype/hr_settings/hr_settings.txt | 4 ++-- erpnext/hr/doctype/job_applicant/job_applicant.txt | 4 ++-- erpnext/hr/doctype/job_opening/job_opening.txt | 4 ++-- erpnext/hr/doctype/leave_allocation/leave_allocation.txt | 4 ++-- erpnext/hr/doctype/leave_application/leave_application.txt | 4 ++-- erpnext/hr/doctype/leave_block_list/leave_block_list.txt | 4 ++-- .../doctype/leave_block_list_allow/leave_block_list_allow.txt | 4 ++-- .../doctype/leave_block_list_date/leave_block_list_date.txt | 4 ++-- .../hr/doctype/leave_control_panel/leave_control_panel.txt | 4 ++-- erpnext/hr/doctype/leave_type/leave_type.txt | 4 ++-- erpnext/hr/doctype/salary_manager/salary_manager.txt | 4 ++-- erpnext/hr/doctype/salary_slip/salary_slip.txt | 4 ++-- .../doctype/salary_slip_deduction/salary_slip_deduction.txt | 4 ++-- .../hr/doctype/salary_slip_earning/salary_slip_earning.txt | 4 ++-- erpnext/hr/doctype/salary_structure/salary_structure.txt | 4 ++-- .../salary_structure_deduction/salary_structure_deduction.txt | 4 ++-- .../salary_structure_earning/salary_structure_earning.txt | 4 ++-- erpnext/hr/doctype/upload_attendance/upload_attendance.txt | 4 ++-- erpnext/hr/report/employee_birthday/employee_birthday.txt | 4 ++-- .../hr/report/employee_information/employee_information.txt | 4 ++-- .../report/employee_leave_balance/employee_leave_balance.txt | 4 ++-- .../monthly_attendance_sheet/monthly_attendance_sheet.txt | 4 ++-- .../monthly_salary_register/monthly_salary_register.txt | 4 ++-- erpnext/manufacturing/doctype/bom/bom.txt | 4 ++-- .../doctype/bom_explosion_item/bom_explosion_item.txt | 4 ++-- erpnext/manufacturing/doctype/bom_item/bom_item.txt | 4 ++-- erpnext/manufacturing/doctype/bom_operation/bom_operation.txt | 4 ++-- .../doctype/bom_replace_tool/bom_replace_tool.txt | 4 ++-- .../doctype/production_order/production_order.txt | 4 ++-- .../doctype/production_plan_item/production_plan_item.txt | 4 ++-- .../production_plan_sales_order.txt | 4 ++-- .../production_planning_tool/production_planning_tool.txt | 4 ++-- erpnext/manufacturing/doctype/workstation/workstation.txt | 4 ++-- .../completed_production_orders.txt | 4 ++-- .../issued_items_against_production_order.txt | 4 ++-- .../report/open_production_orders/open_production_orders.txt | 4 ++-- .../production_orders_in_progress.txt | 4 ++-- erpnext/projects/doctype/activity_type/activity_type.txt | 4 ++-- erpnext/projects/doctype/project/project.txt | 4 ++-- .../projects/doctype/project_milestone/project_milestone.txt | 4 ++-- erpnext/projects/doctype/task/task.txt | 4 ++-- erpnext/projects/doctype/time_log/time_log.txt | 4 ++-- erpnext/projects/doctype/time_log_batch/time_log_batch.txt | 4 ++-- .../doctype/time_log_batch_detail/time_log_batch_detail.txt | 4 ++-- .../report/daily_time_log_summary/daily_time_log_summary.txt | 4 ++-- .../project_wise_stock_tracking.txt | 4 ++-- .../Print Format/Quotation Classic/Quotation Classic.txt | 4 ++-- .../Print Format/Quotation Modern/Quotation Modern.txt | 4 ++-- .../Print Format/Quotation Spartan/Quotation Spartan.txt | 4 ++-- .../Print Format/Sales Order Classic/Sales Order Classic.txt | 4 ++-- .../Print Format/Sales Order Modern/Sales Order Modern.txt | 4 ++-- .../Print Format/Sales Order Spartan/Sales Order Spartan.txt | 4 ++-- erpnext/selling/doctype/campaign/campaign.txt | 4 ++-- erpnext/selling/doctype/customer/customer.txt | 4 ++-- erpnext/selling/doctype/industry_type/industry_type.txt | 4 ++-- .../selling/doctype/installation_note/installation_note.txt | 4 ++-- .../doctype/installation_note_item/installation_note_item.txt | 4 ++-- erpnext/selling/doctype/lead/lead.txt | 4 ++-- erpnext/selling/doctype/opportunity/opportunity.txt | 4 ++-- erpnext/selling/doctype/opportunity_item/opportunity_item.txt | 4 ++-- erpnext/selling/doctype/quotation/quotation.txt | 4 ++-- erpnext/selling/doctype/quotation_item/quotation_item.txt | 4 ++-- erpnext/selling/doctype/sales_bom/sales_bom.txt | 4 ++-- erpnext/selling/doctype/sales_bom_item/sales_bom_item.txt | 4 ++-- erpnext/selling/doctype/sales_order/sales_order.txt | 4 ++-- erpnext/selling/doctype/sales_order_item/sales_order_item.txt | 4 ++-- erpnext/selling/doctype/sales_team/sales_team.txt | 4 ++-- erpnext/selling/doctype/selling_settings/selling_settings.txt | 4 ++-- erpnext/selling/doctype/sms_center/sms_center.txt | 4 ++-- erpnext/selling/page/sales_analytics/sales_analytics.txt | 4 ++-- erpnext/selling/page/sales_browser/sales_browser.txt | 4 ++-- erpnext/selling/page/sales_funnel/sales_funnel.txt | 4 ++-- .../available_stock_for_packing_items.txt | 4 ++-- .../customer_acquisition_and_loyalty.txt | 4 ++-- .../customer_addresses_and_contacts.txt | 4 ++-- .../customers_not_buying_since_long_time.txt | 4 ++-- .../item_wise_sales_history/item_wise_sales_history.txt | 4 ++-- erpnext/selling/report/lead_details/lead_details.txt | 4 ++-- .../pending_so_items_for_purchase_request.txt | 4 ++-- erpnext/selling/report/quotation_trends/quotation_trends.txt | 4 ++-- .../selling/report/sales_order_trends/sales_order_trends.txt | 4 ++-- .../sales_person_target_variance_item_group_wise.txt | 4 ++-- .../sales_person_wise_transaction_summary.txt | 4 ++-- .../territory_target_variance_item_group_wise.txt | 4 ++-- .../doctype/applicable_territory/applicable_territory.txt | 4 ++-- .../doctype/authorization_control/authorization_control.txt | 4 ++-- .../setup/doctype/authorization_rule/authorization_rule.txt | 4 ++-- erpnext/setup/doctype/backup_manager/backup_manager.txt | 4 ++-- erpnext/setup/doctype/brand/brand.txt | 4 ++-- erpnext/setup/doctype/company/company.txt | 4 ++-- erpnext/setup/doctype/contact_control/contact_control.txt | 4 ++-- erpnext/setup/doctype/country/country.txt | 4 ++-- erpnext/setup/doctype/currency/currency.txt | 4 ++-- erpnext/setup/doctype/currency_exchange/currency_exchange.txt | 4 ++-- erpnext/setup/doctype/customer_group/customer_group.txt | 4 ++-- erpnext/setup/doctype/email_digest/email_digest.txt | 4 ++-- erpnext/setup/doctype/features_setup/features_setup.txt | 4 ++-- erpnext/setup/doctype/global_defaults/global_defaults.txt | 4 ++-- erpnext/setup/doctype/item_group/item_group.txt | 4 ++-- .../setup/doctype/jobs_email_settings/jobs_email_settings.txt | 4 ++-- erpnext/setup/doctype/naming_series/naming_series.txt | 4 ++-- .../doctype/notification_control/notification_control.txt | 4 ++-- erpnext/setup/doctype/print_heading/print_heading.txt | 4 ++-- .../doctype/quotation_lost_reason/quotation_lost_reason.txt | 4 ++-- .../doctype/sales_email_settings/sales_email_settings.txt | 4 ++-- erpnext/setup/doctype/sales_partner/sales_partner.txt | 4 ++-- erpnext/setup/doctype/sales_person/sales_person.txt | 4 ++-- erpnext/setup/doctype/sms_parameter/sms_parameter.txt | 4 ++-- erpnext/setup/doctype/sms_settings/sms_settings.txt | 4 ++-- erpnext/setup/doctype/supplier_type/supplier_type.txt | 4 ++-- erpnext/setup/doctype/target_detail/target_detail.txt | 4 ++-- .../doctype/terms_and_conditions/terms_and_conditions.txt | 4 ++-- erpnext/setup/doctype/territory/territory.txt | 4 ++-- erpnext/setup/doctype/uom/uom.txt | 4 ++-- .../setup/doctype/website_item_group/website_item_group.txt | 4 ++-- erpnext/setup/page/setup_wizard/setup_wizard.txt | 4 ++-- .../Delivery Note Classic/Delivery Note Classic.txt | 4 ++-- .../Delivery Note Modern/Delivery Note Modern.txt | 4 ++-- .../Delivery Note Packing List Wise.txt | 4 ++-- .../Delivery Note Spartan/Delivery Note Spartan.txt | 4 ++-- erpnext/stock/doctype/batch/batch.txt | 4 ++-- erpnext/stock/doctype/bin/bin.txt | 4 ++-- erpnext/stock/doctype/delivery_note/delivery_note.txt | 4 ++-- .../stock/doctype/delivery_note_item/delivery_note_item.txt | 4 ++-- erpnext/stock/doctype/item/item.txt | 4 ++-- .../doctype/item_customer_detail/item_customer_detail.txt | 4 ++-- erpnext/stock/doctype/item_price/item_price.txt | 4 ++-- .../item_quality_inspection_parameter.txt | 4 ++-- erpnext/stock/doctype/item_reorder/item_reorder.txt | 4 ++-- erpnext/stock/doctype/item_supplier/item_supplier.txt | 4 ++-- erpnext/stock/doctype/item_tax/item_tax.txt | 4 ++-- .../item_website_specification/item_website_specification.txt | 4 ++-- erpnext/stock/doctype/landed_cost_item/landed_cost_item.txt | 4 ++-- .../landed_cost_purchase_receipt.txt | 4 ++-- .../stock/doctype/landed_cost_wizard/landed_cost_wizard.txt | 4 ++-- erpnext/stock/doctype/material_request/material_request.txt | 4 ++-- .../doctype/material_request_item/material_request_item.txt | 4 ++-- erpnext/stock/doctype/packed_item/packed_item.txt | 4 ++-- erpnext/stock/doctype/packing_slip/packing_slip.txt | 4 ++-- erpnext/stock/doctype/packing_slip_item/packing_slip_item.txt | 4 ++-- erpnext/stock/doctype/price_list/price_list.txt | 4 ++-- erpnext/stock/doctype/purchase_receipt/purchase_receipt.txt | 4 ++-- .../doctype/purchase_receipt_item/purchase_receipt_item.txt | 4 ++-- erpnext/stock/doctype/serial_no/serial_no.txt | 4 ++-- erpnext/stock/doctype/stock_entry/stock_entry.txt | 4 ++-- .../stock/doctype/stock_entry_detail/stock_entry_detail.txt | 4 ++-- .../stock/doctype/stock_ledger_entry/stock_ledger_entry.txt | 4 ++-- .../doctype/stock_reconciliation/stock_reconciliation.txt | 4 ++-- erpnext/stock/doctype/stock_settings/stock_settings.txt | 4 ++-- .../stock_uom_replace_utility/stock_uom_replace_utility.txt | 4 ++-- .../doctype/uom_conversion_detail/uom_conversion_detail.txt | 4 ++-- erpnext/stock/doctype/warehouse/warehouse.txt | 4 ++-- erpnext/stock/doctype/warehouse_user/warehouse_user.txt | 4 ++-- erpnext/stock/page/stock_ageing/stock_ageing.txt | 4 ++-- erpnext/stock/page/stock_analytics/stock_analytics.txt | 4 ++-- erpnext/stock/page/stock_balance/stock_balance.txt | 4 ++-- erpnext/stock/page/stock_ledger/stock_ledger.txt | 4 ++-- erpnext/stock/page/stock_level/stock_level.txt | 4 ++-- .../batch_wise_balance_history/batch_wise_balance_history.txt | 4 ++-- .../report/delivery_note_trends/delivery_note_trends.txt | 4 ++-- erpnext/stock/report/item_prices/item_prices.txt | 4 ++-- .../report/item_shortage_report/item_shortage_report.txt | 4 ++-- .../item_wise_price_list_rate/item_wise_price_list_rate.txt | 4 ++-- .../report/items_to_be_requested/items_to_be_requested.txt | 4 ++-- .../itemwise_recommended_reorder_level.txt | 4 ++-- ...requests_for_which_supplier_quotations_are_not_created.txt | 4 ++-- .../ordered_items_to_be_delivered.txt | 4 ++-- .../stock/report/purchase_in_transit/purchase_in_transit.txt | 4 ++-- .../purchase_order_items_to_be_received.txt | 4 ++-- .../purchase_receipt_trends/purchase_receipt_trends.txt | 4 ++-- .../requested_items_to_be_transferred.txt | 4 ++-- .../serial_no_service_contract_expiry.txt | 4 ++-- erpnext/stock/report/serial_no_status/serial_no_status.txt | 4 ++-- .../serial_no_warranty_expiry/serial_no_warranty_expiry.txt | 4 ++-- erpnext/stock/report/stock_ageing/stock_ageing.txt | 4 ++-- erpnext/stock/report/stock_ledger/stock_ledger.txt | 4 ++-- .../stock/report/stock_projected_qty/stock_projected_qty.txt | 4 ++-- .../supplier_wise_sales_analytics.txt | 4 ++-- .../warehouse_wise_stock_balance.txt | 4 ++-- erpnext/support/doctype/customer_issue/customer_issue.txt | 4 ++-- .../doctype/maintenance_schedule/maintenance_schedule.txt | 4 ++-- .../maintenance_schedule_detail.txt | 4 ++-- .../maintenance_schedule_item/maintenance_schedule_item.txt | 4 ++-- .../support/doctype/maintenance_visit/maintenance_visit.txt | 4 ++-- .../maintenance_visit_purpose/maintenance_visit_purpose.txt | 4 ++-- erpnext/support/doctype/newsletter/newsletter.txt | 4 ++-- .../doctype/support_email_settings/support_email_settings.txt | 4 ++-- erpnext/support/doctype/support_ticket/support_ticket.txt | 4 ++-- erpnext/support/page/support_analytics/support_analytics.txt | 4 ++-- .../report/maintenance_schedules/maintenance_schedules.txt | 4 ++-- erpnext/utilities/doctype/address/address.txt | 4 ++-- erpnext/utilities/doctype/contact/contact.txt | 4 ++-- erpnext/utilities/doctype/note/note.txt | 4 ++-- erpnext/utilities/doctype/note_user/note_user.txt | 4 ++-- erpnext/utilities/doctype/rename_tool/rename_tool.txt | 4 ++-- erpnext/utilities/doctype/sms_control/sms_control.txt | 4 ++-- erpnext/utilities/doctype/sms_log/sms_log.txt | 4 ++-- 304 files changed, 608 insertions(+), 608 deletions(-) diff --git a/erpnext/accounts/Print Format/Cheque Printing Format/Cheque Printing Format.txt b/erpnext/accounts/Print Format/Cheque Printing Format/Cheque Printing Format.txt index a0a25cd16c..60088c9181 100755 --- a/erpnext/accounts/Print Format/Cheque Printing Format/Cheque Printing Format.txt +++ b/erpnext/accounts/Print Format/Cheque Printing Format/Cheque Printing Format.txt @@ -1,11 +1,11 @@ { - "creation": "2012-04-11 13:16:56", + "creation": "2012-04-11 13:16:56.000000", "doc_type": "Journal Voucher", "docstatus": 0, "doctype": "Print Format", "html": "\n
\n



\n
\nPAYMENT ADVICE

\n\n\n\n\n\n\n\n
To :
\n\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Voucher No :\n\n
Voucher Date :\n\n
Cheque No :\n\n
Cheque Date :\n\n
\n
\n
We are pleased to enclose our cheque in full/part Settlement of your under noted bills
\n
\n\n\n\n\n\n\n\n\n\n\n\n
 Total :\n\n
Narration :\n\n


\n
Prepared By
\n
Authorised Signatory
\n
Received Payment as Above
\n
_____________
\n
A/c Payee
\n
_____________
\n
\n\n
\n
\n\n
\n
\n\n
\n
\n\n
\n
", "idx": 1, - "modified": "2012-04-13 12:24:20", + "modified": "2012-04-13 12:24:20.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Cheque Printing Format", diff --git a/erpnext/accounts/Print Format/POS Invoice/POS Invoice.txt b/erpnext/accounts/Print Format/POS Invoice/POS Invoice.txt index 136856c0b7..c251c90dd6 100644 --- a/erpnext/accounts/Print Format/POS Invoice/POS Invoice.txt +++ b/erpnext/accounts/Print Format/POS Invoice/POS Invoice.txt @@ -1,11 +1,11 @@ { - "creation": "2011-12-21 11:08:55", + "creation": "2011-12-21 11:08:55.000000", "doc_type": "Sales Invoice", "docstatus": 0, "doctype": "Print Format", "html": "\n\t\n\n\t\t\n\t\t\n\n\t\t\n\t\t\n\t\n\n\t\n\t\t\n\t\t
\n\t\t
\n\t\t
\n\t\t
\n\t\t
\n\t\n", "idx": 1, - "modified": "2014-01-27 17:26:10", + "modified": "2014-01-27 17:26:10.000000", "modified_by": "Administrator", "module": "Accounts", "name": "POS Invoice", diff --git a/erpnext/accounts/Print Format/Payment Receipt Voucher/Payment Receipt Voucher.txt b/erpnext/accounts/Print Format/Payment Receipt Voucher/Payment Receipt Voucher.txt index da1bcd7810..aacb31102e 100755 --- a/erpnext/accounts/Print Format/Payment Receipt Voucher/Payment Receipt Voucher.txt +++ b/erpnext/accounts/Print Format/Payment Receipt Voucher/Payment Receipt Voucher.txt @@ -1,11 +1,11 @@ { - "creation": "2012-05-01 12:46:31", + "creation": "2012-05-01 12:46:31.000000", "doc_type": "Journal Voucher", "docstatus": 0, "doctype": "Print Format", "html": "

\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n\n\n\n\n
Receipt No.:
Date :
Remark:
Received From:
\n
\n\n

\n

\n
\n\n\n\n\n

For ,


(Authorised Signatory)
", "idx": 1, - "modified": "2013-01-21 18:40:20", + "modified": "2013-01-21 18:40:20.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Payment Receipt Voucher", diff --git a/erpnext/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.txt b/erpnext/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.txt index cc3aef2fd5..795df9af8c 100644 --- a/erpnext/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.txt +++ b/erpnext/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.txt @@ -1,11 +1,11 @@ { - "creation": "2013-04-19 13:30:27", + "creation": "2013-04-19 13:30:27.000000", "doc_type": "Sales Invoice", "docstatus": 0, "doctype": "Print Format", "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", "idx": 1, - "modified": "2014-02-11 17:33:08", + "modified": "2014-02-11 17:33:08.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice Classic", diff --git a/erpnext/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.txt b/erpnext/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.txt index e166ae4035..567da70e9f 100644 --- a/erpnext/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.txt +++ b/erpnext/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.txt @@ -1,11 +1,11 @@ { - "creation": "2013-04-19 13:30:27", + "creation": "2013-04-19 13:30:27.000000", "doc_type": "Sales Invoice", "docstatus": 0, "doctype": "Print Format", "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", "idx": 1, - "modified": "2014-02-11 17:33:05", + "modified": "2014-02-11 17:33:05.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice Modern", diff --git a/erpnext/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.txt b/erpnext/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.txt index b56e547478..7c3de89f31 100644 --- a/erpnext/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.txt +++ b/erpnext/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.txt @@ -1,11 +1,11 @@ { - "creation": "2013-04-19 13:30:27", + "creation": "2013-04-19 13:30:27.000000", "doc_type": "Sales Invoice", "docstatus": 0, "doctype": "Print Format", "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", "idx": 1, - "modified": "2014-02-11 17:34:00", + "modified": "2014-02-11 17:34:00.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice Spartan", diff --git a/erpnext/accounts/Print Format/SalesInvoice/SalesInvoice.txt b/erpnext/accounts/Print Format/SalesInvoice/SalesInvoice.txt index 60897e57c4..6c66cb869d 100644 --- a/erpnext/accounts/Print Format/SalesInvoice/SalesInvoice.txt +++ b/erpnext/accounts/Print Format/SalesInvoice/SalesInvoice.txt @@ -1,10 +1,10 @@ { - "creation": "2013-03-21 15:24:28", + "creation": "2013-03-21 15:24:28.000000", "doc_type": "Sales Invoice", "docstatus": 0, "doctype": "Print Format", "idx": 1, - "modified": "2013-03-21 15:26:21", + "modified": "2013-03-21 15:26:21.000000", "modified_by": "Administrator", "module": "Accounts", "name": "SalesInvoice", diff --git a/erpnext/accounts/doctype/account/account.txt b/erpnext/accounts/doctype/account/account.txt index 5778d5aa39..85ab439074 100644 --- a/erpnext/accounts/doctype/account/account.txt +++ b/erpnext/accounts/doctype/account/account.txt @@ -1,7 +1,7 @@ { "allow_copy": 1, "allow_rename": 1, - "creation": "2013-01-30 12:49:46", + "creation": "2013-01-30 12:49:46.000000", "description": "Heads (or groups) against which Accounting Entries are made and balances are maintained.", "docstatus": 0, "doctype": "DocType", @@ -206,7 +206,7 @@ "icon": "icon-money", "idx": 1, "in_create": 1, - "modified": "2014-03-19 12:07:27", + "modified": "2014-03-19 12:07:27.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Account", diff --git a/erpnext/accounts/doctype/accounts_settings/accounts_settings.txt b/erpnext/accounts/doctype/accounts_settings/accounts_settings.txt index 32646133b5..942de75079 100644 --- a/erpnext/accounts/doctype/accounts_settings/accounts_settings.txt +++ b/erpnext/accounts/doctype/accounts_settings/accounts_settings.txt @@ -1,5 +1,5 @@ { - "creation": "2013-06-24 15:49:57", + "creation": "2013-06-24 15:49:57.000000", "description": "Settings for Accounts", "docstatus": 0, "doctype": "DocType", @@ -47,7 +47,7 @@ "icon": "icon-cog", "idx": 1, "issingle": 1, - "modified": "2013-12-20 19:22:52", + "modified": "2013-12-20 19:22:52.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Accounts Settings", diff --git a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.txt b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.txt index 783c2954ce..eff6e6d5cf 100644 --- a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.txt +++ b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.txt @@ -2,7 +2,7 @@ "allow_copy": 1, "allow_email": 1, "allow_print": 1, - "creation": "2013-01-10 16:34:05", + "creation": "2013-01-10 16:34:05.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -74,7 +74,7 @@ "icon": "icon-check", "idx": 1, "issingle": 1, - "modified": "2013-07-05 14:26:22", + "modified": "2013-07-05 14:26:22.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Bank Reconciliation", diff --git a/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.txt b/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.txt index 386e3b7627..250dc45126 100644 --- a/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.txt +++ b/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.txt @@ -1,5 +1,5 @@ { - "creation": "2013-02-22 01:27:37", + "creation": "2013-02-22 01:27:37.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -101,7 +101,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:22:55", + "modified": "2013-12-20 19:22:55.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Bank Reconciliation Detail", diff --git a/erpnext/accounts/doctype/budget_detail/budget_detail.txt b/erpnext/accounts/doctype/budget_detail/budget_detail.txt index 0a95bc1e61..f8a969c097 100644 --- a/erpnext/accounts/doctype/budget_detail/budget_detail.txt +++ b/erpnext/accounts/doctype/budget_detail/budget_detail.txt @@ -1,6 +1,6 @@ { "autoname": "CBD/.######", - "creation": "2013-03-07 11:55:04", + "creation": "2013-03-07 11:55:04.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -44,7 +44,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:22:59", + "modified": "2013-12-20 19:22:59.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Budget Detail", diff --git a/erpnext/accounts/doctype/budget_distribution/budget_distribution.txt b/erpnext/accounts/doctype/budget_distribution/budget_distribution.txt index 4034b1d146..2bad58978e 100644 --- a/erpnext/accounts/doctype/budget_distribution/budget_distribution.txt +++ b/erpnext/accounts/doctype/budget_distribution/budget_distribution.txt @@ -1,6 +1,6 @@ { "autoname": "field:distribution_id", - "creation": "2013-01-10 16:34:05", + "creation": "2013-01-10 16:34:05.000000", "description": "**Budget Distribution** helps you distribute your budget across months if you have seasonality in your business.\n\nTo distribute a budget using this distribution, set this **Budget Distribution** in the **Cost Center**", "docstatus": 0, "doctype": "DocType", @@ -47,7 +47,7 @@ ], "icon": "icon-bar-chart", "idx": 1, - "modified": "2014-01-20 17:48:27", + "modified": "2014-01-20 17:48:27.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Budget Distribution", diff --git a/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.txt b/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.txt index a36dd179c9..aa4f2aedc2 100644 --- a/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.txt +++ b/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.txt @@ -1,6 +1,6 @@ { "autoname": "BDD/.#####", - "creation": "2013-02-22 01:27:38", + "creation": "2013-02-22 01:27:38.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -27,7 +27,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:22:59", + "modified": "2013-12-20 19:22:59.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Budget Distribution Detail", diff --git a/erpnext/accounts/doctype/c_form/c_form.txt b/erpnext/accounts/doctype/c_form/c_form.txt index 6445aeec16..06c56d2767 100644 --- a/erpnext/accounts/doctype/c_form/c_form.txt +++ b/erpnext/accounts/doctype/c_form/c_form.txt @@ -1,7 +1,7 @@ { "allow_attach": 1, "autoname": "naming_series:", - "creation": "2013-03-07 11:55:06", + "creation": "2013-03-07 11:55:06.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -136,7 +136,7 @@ "idx": 1, "is_submittable": 1, "max_attachments": 3, - "modified": "2013-12-20 19:23:58", + "modified": "2013-12-20 19:23:58.000000", "modified_by": "Administrator", "module": "Accounts", "name": "C-Form", diff --git a/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.txt b/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.txt index 97eef30534..37b63b7b68 100644 --- a/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.txt +++ b/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.txt @@ -1,5 +1,5 @@ { - "creation": "2013-02-22 01:27:38", + "creation": "2013-02-22 01:27:38.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -60,7 +60,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:00", + "modified": "2013-12-20 19:23:00.000000", "modified_by": "Administrator", "module": "Accounts", "name": "C-Form Invoice Detail", diff --git a/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.txt b/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.txt index 4be1e9d3bc..4f5ce66f0a 100644 --- a/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.txt +++ b/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.txt @@ -1,6 +1,6 @@ { "autoname": "field:chart_name", - "creation": "2014-03-05 14:11:31", + "creation": "2014-03-05 14:11:31.000000", "description": "Financial Chart of Accounts. Imported from file.", "docstatus": 0, "doctype": "DocType", @@ -41,7 +41,7 @@ ], "idx": 1, "in_create": 1, - "modified": "2014-03-05 14:51:05", + "modified": "2014-03-05 14:51:05.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Chart of Accounts", diff --git a/erpnext/accounts/doctype/cost_center/cost_center.txt b/erpnext/accounts/doctype/cost_center/cost_center.txt index 8201d3451e..9dd868a563 100644 --- a/erpnext/accounts/doctype/cost_center/cost_center.txt +++ b/erpnext/accounts/doctype/cost_center/cost_center.txt @@ -3,7 +3,7 @@ "allow_import": 1, "allow_rename": 1, "autoname": "field:cost_center_name", - "creation": "2013-01-23 19:57:17", + "creation": "2013-01-23 19:57:17.000000", "description": "Track separate Income and Expense for product verticals or divisions.", "docstatus": 0, "doctype": "DocType", @@ -151,7 +151,7 @@ "icon": "icon-money", "idx": 1, "in_create": 1, - "modified": "2014-01-20 17:48:30", + "modified": "2014-01-20 17:48:30.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Cost Center", diff --git a/erpnext/accounts/doctype/fiscal_year/fiscal_year.txt b/erpnext/accounts/doctype/fiscal_year/fiscal_year.txt index 639b2764f4..314dfab1a7 100644 --- a/erpnext/accounts/doctype/fiscal_year/fiscal_year.txt +++ b/erpnext/accounts/doctype/fiscal_year/fiscal_year.txt @@ -1,7 +1,7 @@ { "allow_import": 1, "autoname": "field:year", - "creation": "2013-01-22 16:50:25", + "creation": "2013-01-22 16:50:25.000000", "description": "**Fiscal Year** represents a Financial Year. All accounting entries and other major transactions are tracked against **Fiscal Year**.", "docstatus": 0, "doctype": "DocType", @@ -51,7 +51,7 @@ ], "icon": "icon-calendar", "idx": 1, - "modified": "2014-01-20 17:48:46", + "modified": "2014-01-20 17:48:46.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Fiscal Year", diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.txt b/erpnext/accounts/doctype/gl_entry/gl_entry.txt index 66c9f6c3c2..79bf90b5de 100644 --- a/erpnext/accounts/doctype/gl_entry/gl_entry.txt +++ b/erpnext/accounts/doctype/gl_entry/gl_entry.txt @@ -1,6 +1,6 @@ { "autoname": "GL.#######", - "creation": "2013-01-10 16:34:06", + "creation": "2013-01-10 16:34:06.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -181,7 +181,7 @@ "icon": "icon-list", "idx": 1, "in_create": 1, - "modified": "2013-12-20 19:24:08", + "modified": "2013-12-20 19:24:08.000000", "modified_by": "Administrator", "module": "Accounts", "name": "GL Entry", diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher.txt b/erpnext/accounts/doctype/journal_voucher/journal_voucher.txt index 72fdc4817d..872fffa388 100644 --- a/erpnext/accounts/doctype/journal_voucher/journal_voucher.txt +++ b/erpnext/accounts/doctype/journal_voucher/journal_voucher.txt @@ -1,7 +1,7 @@ { "allow_import": 1, "autoname": "naming_series:", - "creation": "2013-03-25 10:53:52", + "creation": "2013-03-25 10:53:52.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -438,7 +438,7 @@ "icon": "icon-file-text", "idx": 1, "is_submittable": 1, - "modified": "2014-01-20 17:48:51", + "modified": "2014-01-20 17:48:51.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Journal Voucher", diff --git a/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt b/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt index aa4dda6d3b..defd88e6db 100644 --- a/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt +++ b/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt @@ -1,6 +1,6 @@ { "autoname": "JVD.######", - "creation": "2013-02-22 01:27:39", + "creation": "2013-02-22 01:27:39.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -158,7 +158,7 @@ ], "idx": 1, "istable": 1, - "modified": "2014-02-03 12:44:31", + "modified": "2014-02-03 12:44:31.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Journal Voucher Detail", diff --git a/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.txt b/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.txt index 0dfe957003..870c18565a 100644 --- a/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.txt +++ b/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.txt @@ -2,7 +2,7 @@ "allow_import": 1, "allow_rename": 1, "autoname": "field:mode_of_payment", - "creation": "2012-12-04 17:49:20", + "creation": "2012-12-04 17:49:20.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Master", @@ -37,7 +37,7 @@ ], "icon": "icon-credit-card", "idx": 1, - "modified": "2013-12-20 19:24:14", + "modified": "2013-12-20 19:24:14.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Mode of Payment", diff --git a/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.txt b/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.txt index 42981dec90..ce1a06b8e2 100644 --- a/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.txt +++ b/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.txt @@ -1,5 +1,5 @@ { - "creation": "2013-01-30 12:49:46", + "creation": "2013-01-30 12:49:46.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Other", @@ -154,7 +154,7 @@ "icon": "icon-magic", "idx": 1, "issingle": 1, - "modified": "2013-12-20 19:23:24", + "modified": "2013-12-20 19:23:24.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Payment to Invoice Matching Tool", diff --git a/erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.txt b/erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.txt index 419ee52d45..eecbb110c6 100644 --- a/erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.txt +++ b/erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.txt @@ -1,5 +1,5 @@ { - "creation": "2013-02-22 01:27:39", + "creation": "2013-02-22 01:27:39.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -80,7 +80,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:24", + "modified": "2013-12-20 19:23:24.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Payment to Invoice Matching Tool Detail", diff --git a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.txt b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.txt index a4fa8b5c84..d964ac7bc7 100644 --- a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.txt +++ b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.txt @@ -1,6 +1,6 @@ { "autoname": "PCE/.###", - "creation": "2013-01-10 16:34:07", + "creation": "2013-01-10 16:34:07.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -97,7 +97,7 @@ "icon": "icon-file-text", "idx": 1, "is_submittable": 1, - "modified": "2014-01-20 17:48:59", + "modified": "2014-01-20 17:48:59.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Period Closing Voucher", diff --git a/erpnext/accounts/doctype/pos_setting/pos_setting.txt b/erpnext/accounts/doctype/pos_setting/pos_setting.txt index 03c984ac58..0e68bc3fed 100755 --- a/erpnext/accounts/doctype/pos_setting/pos_setting.txt +++ b/erpnext/accounts/doctype/pos_setting/pos_setting.txt @@ -1,6 +1,6 @@ { "autoname": "POS/.####", - "creation": "2013-05-24 12:15:51", + "creation": "2013-05-24 12:15:51.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -200,7 +200,7 @@ ], "icon": "icon-cog", "idx": 1, - "modified": "2014-01-29 13:08:25", + "modified": "2014-01-29 13:08:25.000000", "modified_by": "Administrator", "module": "Accounts", "name": "POS Setting", diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.txt b/erpnext/accounts/doctype/pricing_rule/pricing_rule.txt index 3094569803..32df323915 100644 --- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.txt +++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.txt @@ -1,6 +1,6 @@ { "autoname": "PRULE.#####", - "creation": "2014-02-21 15:02:51", + "creation": "2014-02-21 15:02:51.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Master", @@ -208,7 +208,7 @@ "icon": "icon-gift", "idx": 1, "istable": 0, - "modified": "2014-03-05 18:23:34", + "modified": "2014-03-05 18:23:34.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Pricing Rule", diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.txt b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.txt index c70cc6c531..7917caf19c 100755 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.txt +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.txt @@ -2,7 +2,7 @@ "allow_attach": 1, "allow_import": 1, "autoname": "naming_series:", - "creation": "2013-05-21 16:16:39", + "creation": "2013-05-21 16:16:39.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -744,7 +744,7 @@ "icon": "icon-file-text", "idx": 1, "is_submittable": 1, - "modified": "2014-02-17 12:01:59", + "modified": "2014-02-17 12:01:59.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Purchase Invoice", diff --git a/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.txt b/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.txt index 8b6c697766..47e2d89ae8 100644 --- a/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.txt +++ b/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.txt @@ -1,5 +1,5 @@ { - "creation": "2013-03-08 15:36:46", + "creation": "2013-03-08 15:36:46.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -80,7 +80,7 @@ ], "idx": 1, "istable": 1, - "modified": "2014-02-03 12:38:24", + "modified": "2014-02-03 12:38:24.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Purchase Invoice Advance", diff --git a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt index 1071f2291d..26f3be7889 100755 --- a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt +++ b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt @@ -1,6 +1,6 @@ { "autoname": "EVD.######", - "creation": "2013-05-22 12:43:10", + "creation": "2013-05-22 12:43:10.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -429,7 +429,7 @@ ], "idx": 1, "istable": 1, - "modified": "2014-02-28 11:27:53", + "modified": "2014-02-28 11:27:53.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Purchase Invoice Item", diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.txt b/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.txt index f95d36167c..4ec65dbc50 100644 --- a/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.txt +++ b/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.txt @@ -1,6 +1,6 @@ { "autoname": "PVTD.######", - "creation": "2013-05-21 16:16:04", + "creation": "2013-05-21 16:16:04.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -154,7 +154,7 @@ "hide_heading": 1, "idx": 1, "istable": 1, - "modified": "2014-02-03 12:36:04", + "modified": "2014-02-03 12:36:04.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Purchase Taxes and Charges", diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.txt b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.txt index 4edc055995..dd7c8e41e1 100644 --- a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.txt +++ b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.txt @@ -2,7 +2,7 @@ "allow_import": 1, "allow_rename": 1, "autoname": "field:title", - "creation": "2013-01-10 16:34:08", + "creation": "2013-01-10 16:34:08.000000", "description": "Standard tax template that can be applied to all Purchase Transactions. This template can contain list of tax heads and also other expense heads like \"Shipping\", \"Insurance\", \"Handling\" etc.\n\n#### Note\n\nThe tax rate you define here will be the standard tax rate for all **Items**. If there are **Items** that have different rates, they must be added in the **Item Tax** table in the **Item** master.\n\n#### Description of Columns\n\n1. Calculation Type: \n - This can be on **Net Total** (that is the sum of basic amount).\n - **On Previous Row Total / Amount** (for cumulative taxes or charges). If you select this option, the tax will be applied as a percentage of the previous row (in the tax table) amount or total.\n - **Actual** (as mentioned).\n2. Account Head: The Account ledger under which this tax will be booked\n3. Cost Center: If the tax / charge is an income (like shipping) or expense it needs to be booked against a Cost Center.\n4. Description: Description of the tax (that will be printed in invoices / quotes).\n5. Rate: Tax rate.\n6. Amount: Tax amount.\n7. Total: Cumulative total to this point.\n8. Enter Row: If based on \"Previous Row Total\" you can select the row number which will be taken as a base for this calculation (default is the previous row).\n9. Consider Tax or Charge for: In this section you can specify if the tax / charge is only for valuation (not a part of total) or only for total (does not add value to the item) or for both.\n10. Add or Deduct: Whether you want to add or deduct the tax.", "docstatus": 0, "doctype": "DocType", @@ -46,7 +46,7 @@ ], "icon": "icon-money", "idx": 1, - "modified": "2014-01-29 12:26:38", + "modified": "2014-01-29 12:26:38.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Purchase Taxes and Charges Master", diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt b/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt index 1da1c39dde..09c4fb1c72 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt @@ -2,7 +2,7 @@ "allow_attach": 1, "allow_import": 1, "autoname": "naming_series:", - "creation": "2013-05-24 19:29:05", + "creation": "2013-05-24 19:29:05.000000", "default_print_format": "Standard", "docstatus": 0, "doctype": "DocType", @@ -1178,7 +1178,7 @@ "icon": "icon-file-text", "idx": 1, "is_submittable": 1, - "modified": "2014-01-28 18:43:10", + "modified": "2014-01-28 18:43:10.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice", diff --git a/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.txt b/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.txt index 13a5642a30..15bac1d50e 100644 --- a/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.txt +++ b/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.txt @@ -1,5 +1,5 @@ { - "creation": "2013-02-22 01:27:41", + "creation": "2013-02-22 01:27:41.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -80,7 +80,7 @@ ], "idx": 1, "istable": 1, - "modified": "2014-02-03 12:38:53", + "modified": "2014-02-03 12:38:53.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice Advance", diff --git a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.txt b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.txt index 5c59ebcd64..527213be01 100644 --- a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.txt +++ b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.txt @@ -1,6 +1,6 @@ { "autoname": "INVD.######", - "creation": "2013-06-04 11:02:19", + "creation": "2013-06-04 11:02:19.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -456,7 +456,7 @@ ], "idx": 1, "istable": 1, - "modified": "2014-02-28 11:04:19", + "modified": "2014-02-28 11:04:19.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice Item", diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.txt b/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.txt index 95241c65f1..cd02e81a56 100644 --- a/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.txt +++ b/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.txt @@ -1,6 +1,6 @@ { "autoname": "INVTD.######", - "creation": "2013-04-24 11:39:32", + "creation": "2013-04-24 11:39:32.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -145,7 +145,7 @@ "hide_heading": 1, "idx": 1, "istable": 1, - "modified": "2014-01-03 15:04:25", + "modified": "2014-01-03 15:04:25.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Taxes and Charges", diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.txt b/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.txt index a8cc0a255b..81cd189d35 100644 --- a/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.txt +++ b/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.txt @@ -2,7 +2,7 @@ "allow_import": 1, "allow_rename": 1, "autoname": "field:title", - "creation": "2013-01-10 16:34:09", + "creation": "2013-01-10 16:34:09.000000", "description": "Standard tax template that can be applied to all Sales Transactions. This template can contain list of tax heads and also other expense / income heads like \"Shipping\", \"Insurance\", \"Handling\" etc.\n\n#### Note\n\nThe tax rate you define here will be the standard tax rate for all **Items**. If there are **Items** that have different rates, they must be added in the **Item Tax** table in the **Item** master.\n\n#### Description of Columns\n\n1. Calculation Type: \n - This can be on **Net Total** (that is the sum of basic amount).\n - **On Previous Row Total / Amount** (for cumulative taxes or charges). If you select this option, the tax will be applied as a percentage of the previous row (in the tax table) amount or total.\n - **Actual** (as mentioned).\n2. Account Head: The Account ledger under which this tax will be booked\n3. Cost Center: If the tax / charge is an income (like shipping) or expense it needs to be booked against a Cost Center.\n4. Description: Description of the tax (that will be printed in invoices / quotes).\n5. Rate: Tax rate.\n6. Amount: Tax amount.\n7. Total: Cumulative total to this point.\n8. Enter Row: If based on \"Previous Row Total\" you can select the row number which will be taken as a base for this calculation (default is the previous row).\n9. Is this Tax included in Basic Rate?: If you check this, it means that this tax will not be shown below the item table, but will be included in the Basic Rate in your main item table. This is useful where you want give a flat price (inclusive of all taxes) price to customers.", "docstatus": 0, "doctype": "DocType", @@ -69,7 +69,7 @@ ], "icon": "icon-money", "idx": 1, - "modified": "2014-01-28 12:28:27", + "modified": "2014-01-28 12:28:27.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Taxes and Charges Master", diff --git a/erpnext/accounts/doctype/shipping_rule/shipping_rule.txt b/erpnext/accounts/doctype/shipping_rule/shipping_rule.txt index a059c7b293..d46bfdf37d 100644 --- a/erpnext/accounts/doctype/shipping_rule/shipping_rule.txt +++ b/erpnext/accounts/doctype/shipping_rule/shipping_rule.txt @@ -1,6 +1,6 @@ { "autoname": "Prompt", - "creation": "2013-06-25 11:48:03", + "creation": "2013-06-25 11:48:03.000000", "description": "Specify conditions to calculate shipping amount", "docstatus": 0, "doctype": "DocType", @@ -102,7 +102,7 @@ ], "icon": "icon-truck", "idx": 1, - "modified": "2014-01-20 17:49:27", + "modified": "2014-01-20 17:49:27.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Shipping Rule", diff --git a/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.txt b/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.txt index 6b3fd2bbff..2d4cf2daba 100644 --- a/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.txt +++ b/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.txt @@ -1,5 +1,5 @@ { - "creation": "2013-06-25 11:54:50", + "creation": "2013-06-25 11:54:50.000000", "description": "A condition for a Shipping Rule", "docstatus": 0, "doctype": "DocType", @@ -32,7 +32,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:21:46", + "modified": "2013-12-20 19:21:46.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Shipping Rule Condition", diff --git a/erpnext/accounts/page/accounts_browser/accounts_browser.txt b/erpnext/accounts/page/accounts_browser/accounts_browser.txt index d4b5f3c204..7fb1815f70 100644 --- a/erpnext/accounts/page/accounts_browser/accounts_browser.txt +++ b/erpnext/accounts/page/accounts_browser/accounts_browser.txt @@ -1,10 +1,10 @@ { - "creation": "2012-06-14 15:07:28", + "creation": "2012-06-14 15:07:28.000000", "docstatus": 0, "doctype": "Page", "icon": "icon-sitemap", "idx": 1, - "modified": "2013-07-11 14:39:42", + "modified": "2013-07-11 14:39:42.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Accounts Browser", diff --git a/erpnext/accounts/page/financial_analytics/financial_analytics.txt b/erpnext/accounts/page/financial_analytics/financial_analytics.txt index 75642f36bf..f551d82b1b 100644 --- a/erpnext/accounts/page/financial_analytics/financial_analytics.txt +++ b/erpnext/accounts/page/financial_analytics/financial_analytics.txt @@ -1,10 +1,10 @@ { - "creation": "2013-01-27 16:30:52", + "creation": "2013-01-27 16:30:52.000000", "docstatus": 0, "doctype": "Page", "icon": "icon-bar-chart", "idx": 1, - "modified": "2013-07-11 14:42:16", + "modified": "2013-07-11 14:42:16.000000", "modified_by": "Administrator", "module": "Accounts", "name": "financial-analytics", diff --git a/erpnext/accounts/page/trial_balance/trial_balance.txt b/erpnext/accounts/page/trial_balance/trial_balance.txt index ed1dfdd234..72fb981f92 100644 --- a/erpnext/accounts/page/trial_balance/trial_balance.txt +++ b/erpnext/accounts/page/trial_balance/trial_balance.txt @@ -1,10 +1,10 @@ { - "creation": "2013-01-27 16:30:52", + "creation": "2013-01-27 16:30:52.000000", "docstatus": 0, "doctype": "Page", "icon": "icon-table", "idx": 1, - "modified": "2013-07-11 14:44:49", + "modified": "2013-07-11 14:44:49.000000", "modified_by": "Administrator", "module": "Accounts", "name": "trial-balance", diff --git a/erpnext/accounts/report/accounts_payable/accounts_payable.txt b/erpnext/accounts/report/accounts_payable/accounts_payable.txt index 41c63fc038..82c9337993 100644 --- a/erpnext/accounts/report/accounts_payable/accounts_payable.txt +++ b/erpnext/accounts/report/accounts_payable/accounts_payable.txt @@ -1,11 +1,11 @@ { "add_total_row": 1, - "creation": "2013-04-22 16:16:03", + "creation": "2013-04-22 16:16:03.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Accounts Payable", diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.txt b/erpnext/accounts/report/accounts_receivable/accounts_receivable.txt index 3e6229d770..558a9fae04 100644 --- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.txt +++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.txt @@ -1,11 +1,11 @@ { "add_total_row": 1, - "creation": "2013-04-16 11:31:13", + "creation": "2013-04-16 11:31:13.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Accounts", "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 ab2bfe6b04..5768fb25a0 100644 --- a/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.txt +++ b/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.txt @@ -1,10 +1,10 @@ { - "creation": "2013-05-01 12:13:25", + "creation": "2013-05-01 12:13:25.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Accounts", "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 8eda364822..3da22e6a13 100644 --- a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.txt +++ b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.txt @@ -1,11 +1,11 @@ { "add_total_row": 0, - "creation": "2013-04-30 18:30:21", + "creation": "2013-04-30 18:30:21.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Accounts", "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 6d738b6e93..592ee6957c 100644 --- a/erpnext/accounts/report/budget_variance_report/budget_variance_report.txt +++ b/erpnext/accounts/report/budget_variance_report/budget_variance_report.txt @@ -1,10 +1,10 @@ { - "creation": "2013-06-18 12:56:36", + "creation": "2013-06-18 12:56:36.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Accounts", "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 c73a7f9b50..c60f5940b1 100644 --- a/erpnext/accounts/report/customer_account_head/customer_account_head.txt +++ b/erpnext/accounts/report/customer_account_head/customer_account_head.txt @@ -1,10 +1,10 @@ { - "creation": "2013-06-03 16:17:34", + "creation": "2013-06-03 16:17:34.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Accounts", "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 3d75039794..53af90726e 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 @@ -1,10 +1,10 @@ { - "creation": "2013-07-30 17:28:49", + "creation": "2013-07-30 17:28:49.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Delivered Items To Be Billed", diff --git a/erpnext/accounts/report/general_ledger/general_ledger.txt b/erpnext/accounts/report/general_ledger/general_ledger.txt index 04f020d5d1..59ac1a58d5 100644 --- a/erpnext/accounts/report/general_ledger/general_ledger.txt +++ b/erpnext/accounts/report/general_ledger/general_ledger.txt @@ -1,10 +1,10 @@ { - "creation": "2013-12-06 13:22:23", + "creation": "2013-12-06 13:22:23.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Accounts", "name": "General Ledger", diff --git a/erpnext/accounts/report/gross_profit/gross_profit.txt b/erpnext/accounts/report/gross_profit/gross_profit.txt index c09d7b3b32..12293bc86a 100644 --- a/erpnext/accounts/report/gross_profit/gross_profit.txt +++ b/erpnext/accounts/report/gross_profit/gross_profit.txt @@ -1,10 +1,10 @@ { - "creation": "2013-02-25 17:03:34", + "creation": "2013-02-25 17:03:34.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Accounts", "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 9c1c55ee8d..f37db79de8 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 @@ -1,11 +1,11 @@ { "add_total_row": 1, - "creation": "2013-06-05 15:37:30", + "creation": "2013-06-05 15:37:30.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Accounts", "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 3a4f296a33..4dffc714c9 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 @@ -1,11 +1,11 @@ { "add_total_row": 1, - "creation": "2013-05-13 17:50:55", + "creation": "2013-05-13 17:50:55.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Accounts", "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 cc62acd55f..b734f0e09d 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 @@ -1,10 +1,10 @@ { - "creation": "2013-02-21 14:26:44", + "creation": "2013-02-21 14:26:44.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Ordered Items To Be Billed", 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 9e3ce55419..a717ff5372 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 @@ -1,11 +1,11 @@ { "add_total_row": 1, - "creation": "2013-12-02 17:06:37", + "creation": "2013-12-02 17:06:37.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Accounts", "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 36d081954d..26d199b1e5 100644 --- a/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.txt +++ b/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.txt @@ -1,10 +1,10 @@ { - "creation": "2013-06-13 18:46:55", + "creation": "2013-06-13 18:46:55.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Accounts", "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 ed03bc0c15..0b9804c12c 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 @@ -1,11 +1,11 @@ { "add_total_row": 1, - "creation": "2013-05-28 15:54:16", + "creation": "2013-05-28 15:54:16.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Purchase Order Items To Be Billed", diff --git a/erpnext/accounts/report/purchase_register/purchase_register.txt b/erpnext/accounts/report/purchase_register/purchase_register.txt index f6e603ab7d..592f4101b5 100644 --- a/erpnext/accounts/report/purchase_register/purchase_register.txt +++ b/erpnext/accounts/report/purchase_register/purchase_register.txt @@ -1,11 +1,11 @@ { "add_total_row": 1, - "creation": "2013-04-29 16:13:11", + "creation": "2013-04-29 16:13:11.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Accounts", "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 b39b88557a..097ddd2e9d 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 @@ -1,10 +1,10 @@ { - "creation": "2013-07-30 18:35:10", + "creation": "2013-07-30 18:35:10.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Received Items To Be Billed", 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 e0df867287..768c0876ea 100644 --- a/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.txt +++ b/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.txt @@ -1,10 +1,10 @@ { - "creation": "2013-06-13 18:44:21", + "creation": "2013-06-13 18:44:21.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Accounts", "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 d8785a36c3..c4dd07481b 100644 --- a/erpnext/accounts/report/sales_partners_commission/sales_partners_commission.txt +++ b/erpnext/accounts/report/sales_partners_commission/sales_partners_commission.txt @@ -1,10 +1,10 @@ { - "creation": "2013-05-06 12:28:23", + "creation": "2013-05-06 12:28:23.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Partners Commission", diff --git a/erpnext/accounts/report/sales_register/sales_register.txt b/erpnext/accounts/report/sales_register/sales_register.txt index b87c24dc25..703d903f50 100644 --- a/erpnext/accounts/report/sales_register/sales_register.txt +++ b/erpnext/accounts/report/sales_register/sales_register.txt @@ -1,11 +1,11 @@ { "add_total_row": 1, - "creation": "2013-04-23 18:15:29", + "creation": "2013-04-23 18:15:29.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Accounts", "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 5734bb72c1..d973c8a174 100644 --- a/erpnext/accounts/report/supplier_account_head/supplier_account_head.txt +++ b/erpnext/accounts/report/supplier_account_head/supplier_account_head.txt @@ -1,10 +1,10 @@ { - "creation": "2013-06-04 12:56:17", + "creation": "2013-06-04 12:56:17.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Accounts", "name": "Supplier Account Head", diff --git a/erpnext/buying/Print Format/Purchase Order Classic/Purchase Order Classic.txt b/erpnext/buying/Print Format/Purchase Order Classic/Purchase Order Classic.txt index 58d95f8231..2df549691d 100644 --- a/erpnext/buying/Print Format/Purchase Order Classic/Purchase Order Classic.txt +++ b/erpnext/buying/Print Format/Purchase Order Classic/Purchase Order Classic.txt @@ -1,11 +1,11 @@ { - "creation": "2012-04-17 11:29:12", + "creation": "2012-04-17 11:29:12.000000", "doc_type": "Purchase Order", "docstatus": 0, "doctype": "Print Format", "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n\n", "idx": 1, - "modified": "2014-02-11 20:00:45", + "modified": "2014-02-11 20:00:45.000000", "modified_by": "Administrator", "module": "Buying", "name": "Purchase Order Classic", diff --git a/erpnext/buying/Print Format/Purchase Order Modern/Purchase Order Modern.txt b/erpnext/buying/Print Format/Purchase Order Modern/Purchase Order Modern.txt index 7d46e2547a..6edb421ae5 100644 --- a/erpnext/buying/Print Format/Purchase Order Modern/Purchase Order Modern.txt +++ b/erpnext/buying/Print Format/Purchase Order Modern/Purchase Order Modern.txt @@ -1,11 +1,11 @@ { - "creation": "2012-04-17 11:29:12", + "creation": "2012-04-17 11:29:12.000000", "doc_type": "Purchase Order", "docstatus": 0, "doctype": "Print Format", "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n\n", "idx": 1, - "modified": "2014-02-11 20:12:05", + "modified": "2014-02-11 20:12:05.000000", "modified_by": "Administrator", "module": "Buying", "name": "Purchase Order Modern", diff --git a/erpnext/buying/Print Format/Purchase Order Spartan/Purchase Order Spartan.txt b/erpnext/buying/Print Format/Purchase Order Spartan/Purchase Order Spartan.txt index e5ce80ac65..d4347c406e 100644 --- a/erpnext/buying/Print Format/Purchase Order Spartan/Purchase Order Spartan.txt +++ b/erpnext/buying/Print Format/Purchase Order Spartan/Purchase Order Spartan.txt @@ -1,11 +1,11 @@ { - "creation": "2012-04-17 11:29:12", + "creation": "2012-04-17 11:29:12.000000", "doc_type": "Purchase Order", "docstatus": 0, "doctype": "Print Format", "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n\n", "idx": 1, - "modified": "2014-02-11 20:01:38", + "modified": "2014-02-11 20:01:38.000000", "modified_by": "Administrator", "module": "Buying", "name": "Purchase Order Spartan", diff --git a/erpnext/buying/doctype/buying_settings/buying_settings.txt b/erpnext/buying/doctype/buying_settings/buying_settings.txt index 53f40922ec..808c39d9f7 100644 --- a/erpnext/buying/doctype/buying_settings/buying_settings.txt +++ b/erpnext/buying/doctype/buying_settings/buying_settings.txt @@ -1,5 +1,5 @@ { - "creation": "2013-06-25 11:04:03", + "creation": "2013-06-25 11:04:03.000000", "description": "Settings for Buying Module", "docstatus": 0, "doctype": "DocType", @@ -56,7 +56,7 @@ "icon": "icon-cog", "idx": 1, "issingle": 1, - "modified": "2014-02-19 19:02:00", + "modified": "2014-02-19 19:02:00.000000", "modified_by": "Administrator", "module": "Buying", "name": "Buying Settings", diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.txt b/erpnext/buying/doctype/purchase_common/purchase_common.txt index 5a7de618f8..2f5ada864a 100644 --- a/erpnext/buying/doctype/purchase_common/purchase_common.txt +++ b/erpnext/buying/doctype/purchase_common/purchase_common.txt @@ -1,10 +1,10 @@ { - "creation": "2012-03-27 14:35:51", + "creation": "2012-03-27 14:35:51.000000", "docstatus": 0, "doctype": "DocType", "idx": 1, "issingle": 1, - "modified": "2013-12-20 19:23:27", + "modified": "2013-12-20 19:23:27.000000", "modified_by": "Administrator", "module": "Buying", "name": "Purchase Common", diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.txt b/erpnext/buying/doctype/purchase_order/purchase_order.txt index 71a14f3f62..53038fcf81 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.txt +++ b/erpnext/buying/doctype/purchase_order/purchase_order.txt @@ -2,7 +2,7 @@ "allow_attach": 1, "allow_import": 1, "autoname": "naming_series:", - "creation": "2013-05-21 16:16:39", + "creation": "2013-05-21 16:16:39.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Transaction", @@ -636,7 +636,7 @@ "icon": "icon-file-text", "idx": 1, "is_submittable": 1, - "modified": "2014-01-29 15:26:21", + "modified": "2014-01-29 15:26:21.000000", "modified_by": "Administrator", "module": "Buying", "name": "Purchase Order", diff --git a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.txt b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.txt index fc41a7b6ef..23fb1c0e95 100755 --- a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.txt +++ b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.txt @@ -1,6 +1,6 @@ { "autoname": "POD/.#####", - "creation": "2013-05-24 19:29:06", + "creation": "2013-05-24 19:29:06.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -474,7 +474,7 @@ ], "idx": 1, "istable": 1, - "modified": "2014-02-28 11:26:25", + "modified": "2014-02-28 11:26:25.000000", "modified_by": "Administrator", "module": "Buying", "name": "Purchase Order Item", diff --git a/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.txt b/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.txt index 3bcd474017..df947e644b 100644 --- a/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.txt +++ b/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.txt @@ -1,5 +1,5 @@ { - "creation": "2013-02-22 01:27:42", + "creation": "2013-02-22 01:27:42.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -100,7 +100,7 @@ "hide_toolbar": 1, "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:33", + "modified": "2013-12-20 19:23:33.000000", "modified_by": "Administrator", "module": "Buying", "name": "Purchase Order Item Supplied", diff --git a/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.txt b/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.txt index 8bee52eb7b..25ff1da98f 100644 --- a/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.txt +++ b/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.txt @@ -1,5 +1,5 @@ { - "creation": "2013-02-22 01:27:42", + "creation": "2013-02-22 01:27:42.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -137,7 +137,7 @@ "hide_toolbar": 0, "idx": 1, "istable": 1, - "modified": "2014-02-13 11:29:35", + "modified": "2014-02-13 11:29:35.000000", "modified_by": "Administrator", "module": "Buying", "name": "Purchase Receipt Item Supplied", diff --git a/erpnext/buying/doctype/quality_inspection/quality_inspection.txt b/erpnext/buying/doctype/quality_inspection/quality_inspection.txt index a3e68aef97..fcd5439030 100644 --- a/erpnext/buying/doctype/quality_inspection/quality_inspection.txt +++ b/erpnext/buying/doctype/quality_inspection/quality_inspection.txt @@ -1,6 +1,6 @@ { "autoname": "naming_series:", - "creation": "2013-04-30 13:13:03", + "creation": "2013-04-30 13:13:03.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -203,7 +203,7 @@ "icon": "icon-search", "idx": 1, "is_submittable": 1, - "modified": "2014-01-20 17:49:14", + "modified": "2014-01-20 17:49:14.000000", "modified_by": "Administrator", "module": "Buying", "name": "Quality Inspection", diff --git a/erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.txt b/erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.txt index 2ca4d92a86..21712efe21 100644 --- a/erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.txt +++ b/erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.txt @@ -1,6 +1,6 @@ { "autoname": "QASD/.#####", - "creation": "2013-02-22 01:27:43", + "creation": "2013-02-22 01:27:43.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -120,7 +120,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:39", + "modified": "2013-12-20 19:23:39.000000", "modified_by": "Administrator", "module": "Buying", "name": "Quality Inspection Reading", diff --git a/erpnext/buying/doctype/supplier/supplier.txt b/erpnext/buying/doctype/supplier/supplier.txt index f241278006..e43c628b8b 100644 --- a/erpnext/buying/doctype/supplier/supplier.txt +++ b/erpnext/buying/doctype/supplier/supplier.txt @@ -2,7 +2,7 @@ "allow_import": 1, "allow_rename": 1, "autoname": "naming_series:", - "creation": "2013-01-10 16:34:11", + "creation": "2013-01-10 16:34:11.000000", "description": "Supplier of Goods or Services.", "docstatus": 0, "doctype": "DocType", @@ -183,7 +183,7 @@ ], "icon": "icon-user", "idx": 1, - "modified": "2014-01-28 19:05:55", + "modified": "2014-01-28 19:05:55.000000", "modified_by": "Administrator", "module": "Buying", "name": "Supplier", diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.txt b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.txt index d59283bcec..ba098c03d5 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.txt +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.txt @@ -2,7 +2,7 @@ "allow_attach": 1, "allow_import": 1, "autoname": "naming_series:", - "creation": "2013-05-21 16:16:45", + "creation": "2013-05-21 16:16:45.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Transaction", @@ -562,7 +562,7 @@ "icon": "icon-shopping-cart", "idx": 1, "is_submittable": 1, - "modified": "2014-01-29 15:25:52", + "modified": "2014-01-29 15:25:52.000000", "modified_by": "Administrator", "module": "Buying", "name": "Supplier Quotation", diff --git a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt index 8ede81d6b3..11cb9d9627 100644 --- a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt +++ b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt @@ -1,6 +1,6 @@ { "autoname": "SQI-.#####", - "creation": "2013-05-22 12:43:10", + "creation": "2013-05-22 12:43:10.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -354,7 +354,7 @@ ], "idx": 1, "istable": 1, - "modified": "2014-02-28 11:25:38", + "modified": "2014-02-28 11:25:38.000000", "modified_by": "Administrator", "module": "Buying", "name": "Supplier Quotation Item", diff --git a/erpnext/buying/page/purchase_analytics/purchase_analytics.txt b/erpnext/buying/page/purchase_analytics/purchase_analytics.txt index 1bf216e7a2..407d888c28 100644 --- a/erpnext/buying/page/purchase_analytics/purchase_analytics.txt +++ b/erpnext/buying/page/purchase_analytics/purchase_analytics.txt @@ -1,10 +1,10 @@ { - "creation": "2012-09-21 20:15:16", + "creation": "2012-09-21 20:15:16.000000", "docstatus": 0, "doctype": "Page", "icon": "icon-bar-chart", "idx": 1, - "modified": "2013-07-11 14:43:52", + "modified": "2013-07-11 14:43:52.000000", "modified_by": "Administrator", "module": "Buying", "name": "purchase-analytics", 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 59b28ebdd4..b15a571460 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 @@ -1,11 +1,11 @@ { "add_total_row": 1, - "creation": "2013-05-03 14:55:53", + "creation": "2013-05-03 14:55:53.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Buying", "name": "Item-wise Purchase History", 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 57eccc263f..e33c657e33 100644 --- a/erpnext/buying/report/purchase_order_trends/purchase_order_trends.txt +++ b/erpnext/buying/report/purchase_order_trends/purchase_order_trends.txt @@ -1,10 +1,10 @@ { - "creation": "2013-06-13 18:45:01", + "creation": "2013-06-13 18:45:01.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Buying", "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 11cd43294f..76dec76efd 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 @@ -1,11 +1,11 @@ { "add_total_row": 1, - "creation": "2013-05-13 16:10:02", + "creation": "2013-05-13 16:10:02.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Buying", "name": "Requested Items To Be Ordered", 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 e2a62b4b16..69c9d8fc52 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 @@ -1,10 +1,10 @@ { - "creation": "2013-10-09 10:38:40", + "creation": "2013-10-09 10:38:40.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Buying", "name": "Supplier Addresses and Contacts", diff --git a/erpnext/home/doctype/feed/feed.txt b/erpnext/home/doctype/feed/feed.txt index 725d94178b..6578d48e24 100644 --- a/erpnext/home/doctype/feed/feed.txt +++ b/erpnext/home/doctype/feed/feed.txt @@ -1,6 +1,6 @@ { "autoname": "_FEED.#####", - "creation": "2012-07-03 13:29:42", + "creation": "2012-07-03 13:29:42.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -43,7 +43,7 @@ ], "icon": "icon-rss", "idx": 1, - "modified": "2013-12-20 19:24:07", + "modified": "2013-12-20 19:24:07.000000", "modified_by": "Administrator", "module": "Home", "name": "Feed", diff --git a/erpnext/home/page/activity/activity.txt b/erpnext/home/page/activity/activity.txt index 8f967fdabe..a65057e778 100644 --- a/erpnext/home/page/activity/activity.txt +++ b/erpnext/home/page/activity/activity.txt @@ -1,10 +1,10 @@ { - "creation": "2013-04-09 11:45:31", + "creation": "2013-04-09 11:45:31.000000", "docstatus": 0, "doctype": "Page", "icon": "icon-play", "idx": 1, - "modified": "2013-07-11 14:40:20", + "modified": "2013-07-11 14:40:20.000000", "modified_by": "Administrator", "module": "Home", "name": "activity", diff --git a/erpnext/hr/doctype/appraisal/appraisal.txt b/erpnext/hr/doctype/appraisal/appraisal.txt index fc63bca8e7..b0082f3316 100644 --- a/erpnext/hr/doctype/appraisal/appraisal.txt +++ b/erpnext/hr/doctype/appraisal/appraisal.txt @@ -1,6 +1,6 @@ { "autoname": "APRSL.#####", - "creation": "2013-01-10 16:34:12", + "creation": "2013-01-10 16:34:12.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -196,7 +196,7 @@ "icon": "icon-thumbs-up", "idx": 1, "is_submittable": 1, - "modified": "2014-01-22 16:05:34", + "modified": "2014-01-22 16:05:34.000000", "modified_by": "Administrator", "module": "HR", "name": "Appraisal", diff --git a/erpnext/hr/doctype/appraisal_goal/appraisal_goal.txt b/erpnext/hr/doctype/appraisal_goal/appraisal_goal.txt index f075f76fb1..a40b2bc57e 100644 --- a/erpnext/hr/doctype/appraisal_goal/appraisal_goal.txt +++ b/erpnext/hr/doctype/appraisal_goal/appraisal_goal.txt @@ -1,6 +1,6 @@ { "autoname": "APRSLD.#####", - "creation": "2013-02-22 01:27:44", + "creation": "2013-02-22 01:27:44.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -59,7 +59,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:22:53", + "modified": "2013-12-20 19:22:53.000000", "modified_by": "Administrator", "module": "HR", "name": "Appraisal Goal", diff --git a/erpnext/hr/doctype/appraisal_template/appraisal_template.txt b/erpnext/hr/doctype/appraisal_template/appraisal_template.txt index 5b543cf195..1ef6307be8 100644 --- a/erpnext/hr/doctype/appraisal_template/appraisal_template.txt +++ b/erpnext/hr/doctype/appraisal_template/appraisal_template.txt @@ -1,7 +1,7 @@ { "allow_import": 1, "autoname": "field:kra_title", - "creation": "2012-07-03 13:30:39", + "creation": "2012-07-03 13:30:39.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Master", @@ -43,7 +43,7 @@ ], "icon": "icon-file-text", "idx": 1, - "modified": "2013-12-20 19:23:55", + "modified": "2013-12-20 19:23:55.000000", "modified_by": "Administrator", "module": "HR", "name": "Appraisal Template", diff --git a/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.txt b/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.txt index 70e4d9f583..f23ec8c00f 100644 --- a/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.txt +++ b/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.txt @@ -1,6 +1,6 @@ { "autoname": "KSHEET.#####", - "creation": "2013-02-22 01:27:44", + "creation": "2013-02-22 01:27:44.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -32,7 +32,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:22:54", + "modified": "2013-12-20 19:22:54.000000", "modified_by": "Administrator", "module": "HR", "name": "Appraisal Template Goal", diff --git a/erpnext/hr/doctype/attendance/attendance.txt b/erpnext/hr/doctype/attendance/attendance.txt index 952dcfe73e..101f618e1f 100644 --- a/erpnext/hr/doctype/attendance/attendance.txt +++ b/erpnext/hr/doctype/attendance/attendance.txt @@ -1,7 +1,7 @@ { "allow_import": 1, "autoname": "naming_series:", - "creation": "2013-01-10 16:34:13", + "creation": "2013-01-10 16:34:13.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Master", @@ -129,7 +129,7 @@ "icon": "icon-ok", "idx": 1, "is_submittable": 1, - "modified": "2014-01-20 17:48:23", + "modified": "2014-01-20 17:48:23.000000", "modified_by": "Administrator", "module": "HR", "name": "Attendance", diff --git a/erpnext/hr/doctype/branch/branch.txt b/erpnext/hr/doctype/branch/branch.txt index f4cc5d04bd..28bc74ad98 100644 --- a/erpnext/hr/doctype/branch/branch.txt +++ b/erpnext/hr/doctype/branch/branch.txt @@ -2,7 +2,7 @@ "allow_import": 1, "allow_rename": 1, "autoname": "field:branch", - "creation": "2013-01-10 16:34:13", + "creation": "2013-01-10 16:34:13.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Master", @@ -28,7 +28,7 @@ ], "icon": "icon-code-fork", "idx": 1, - "modified": "2014-01-20 17:48:26", + "modified": "2014-01-20 17:48:26.000000", "modified_by": "Administrator", "module": "HR", "name": "Branch", diff --git a/erpnext/hr/doctype/deduction_type/deduction_type.txt b/erpnext/hr/doctype/deduction_type/deduction_type.txt index af93bcd9b4..ccfbf03792 100644 --- a/erpnext/hr/doctype/deduction_type/deduction_type.txt +++ b/erpnext/hr/doctype/deduction_type/deduction_type.txt @@ -2,7 +2,7 @@ "allow_import": 1, "allow_rename": 1, "autoname": "field:deduction_name", - "creation": "2013-01-22 16:50:30", + "creation": "2013-01-22 16:50:30.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Master", @@ -37,7 +37,7 @@ ], "icon": "icon-flag", "idx": 1, - "modified": "2014-01-20 17:48:34", + "modified": "2014-01-20 17:48:34.000000", "modified_by": "Administrator", "module": "HR", "name": "Deduction Type", diff --git a/erpnext/hr/doctype/department/department.txt b/erpnext/hr/doctype/department/department.txt index 3e43d7def8..927f56477e 100644 --- a/erpnext/hr/doctype/department/department.txt +++ b/erpnext/hr/doctype/department/department.txt @@ -1,7 +1,7 @@ { "allow_import": 1, "autoname": "field:department_name", - "creation": "2013-02-05 11:48:26", + "creation": "2013-02-05 11:48:26.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Master", @@ -35,7 +35,7 @@ ], "icon": "icon-sitemap", "idx": 1, - "modified": "2014-01-20 17:48:38", + "modified": "2014-01-20 17:48:38.000000", "modified_by": "Administrator", "module": "HR", "name": "Department", diff --git a/erpnext/hr/doctype/designation/designation.txt b/erpnext/hr/doctype/designation/designation.txt index 9fa591ce19..39a4eee229 100644 --- a/erpnext/hr/doctype/designation/designation.txt +++ b/erpnext/hr/doctype/designation/designation.txt @@ -2,7 +2,7 @@ "allow_import": 1, "allow_rename": 1, "autoname": "field:designation_name", - "creation": "2013-01-10 16:34:13", + "creation": "2013-01-10 16:34:13.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Master", @@ -28,7 +28,7 @@ ], "icon": "icon-bookmark", "idx": 1, - "modified": "2014-01-20 17:48:38", + "modified": "2014-01-20 17:48:38.000000", "modified_by": "Administrator", "module": "HR", "name": "Designation", diff --git a/erpnext/hr/doctype/earning_type/earning_type.txt b/erpnext/hr/doctype/earning_type/earning_type.txt index 0d23a369bb..f4678b48e8 100644 --- a/erpnext/hr/doctype/earning_type/earning_type.txt +++ b/erpnext/hr/doctype/earning_type/earning_type.txt @@ -2,7 +2,7 @@ "allow_import": 1, "allow_rename": 1, "autoname": "field:earning_name", - "creation": "2013-01-24 11:03:32", + "creation": "2013-01-24 11:03:32.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Master", @@ -58,7 +58,7 @@ ], "icon": "icon-flag", "idx": 1, - "modified": "2014-01-20 17:48:38", + "modified": "2014-01-20 17:48:38.000000", "modified_by": "Administrator", "module": "HR", "name": "Earning Type", diff --git a/erpnext/hr/doctype/employee/employee.txt b/erpnext/hr/doctype/employee/employee.txt index f8f32db7df..e80dabe021 100644 --- a/erpnext/hr/doctype/employee/employee.txt +++ b/erpnext/hr/doctype/employee/employee.txt @@ -3,7 +3,7 @@ "allow_import": 1, "allow_rename": 1, "autoname": "naming_series:", - "creation": "2013-03-07 09:04:18", + "creation": "2013-03-07 09:04:18.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Master", @@ -722,7 +722,7 @@ ], "icon": "icon-user", "idx": 1, - "modified": "2014-02-03 18:06:04", + "modified": "2014-02-03 18:06:04.000000", "modified_by": "Administrator", "module": "HR", "name": "Employee", diff --git a/erpnext/hr/doctype/employee_education/employee_education.txt b/erpnext/hr/doctype/employee_education/employee_education.txt index 08b93cb422..e1dbb1a649 100644 --- a/erpnext/hr/doctype/employee_education/employee_education.txt +++ b/erpnext/hr/doctype/employee_education/employee_education.txt @@ -1,5 +1,5 @@ { - "creation": "2013-02-22 01:27:45", + "creation": "2013-02-22 01:27:45.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -63,7 +63,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:12", + "modified": "2013-12-20 19:23:12.000000", "modified_by": "Administrator", "module": "HR", "name": "Employee Education", diff --git a/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.txt b/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.txt index 7ad2d8c9ab..41a110f85c 100644 --- a/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.txt +++ b/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.txt @@ -1,5 +1,5 @@ { - "creation": "2013-02-22 01:27:45", + "creation": "2013-02-22 01:27:45.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -61,7 +61,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:12", + "modified": "2013-12-20 19:23:12.000000", "modified_by": "Administrator", "module": "HR", "name": "Employee External Work History", diff --git a/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.txt b/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.txt index c9a9ab0f3b..d3589908d1 100644 --- a/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.txt +++ b/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.txt @@ -1,5 +1,5 @@ { - "creation": "2013-02-22 01:27:45", + "creation": "2013-02-22 01:27:45.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -64,7 +64,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:12", + "modified": "2013-12-20 19:23:12.000000", "modified_by": "Administrator", "module": "HR", "name": "Employee Internal Work History", diff --git a/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.txt b/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.txt index f3b2c298a1..c0cb78d894 100644 --- a/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.txt +++ b/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.txt @@ -1,7 +1,7 @@ { "allow_import": 0, "autoname": "LAPPR-/.#####", - "creation": "2013-04-12 06:56:15", + "creation": "2013-04-12 06:56:15.000000", "description": "Users who can approve a specific employee's leave applications", "docstatus": 0, "doctype": "DocType", @@ -19,7 +19,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:12", + "modified": "2013-12-20 19:23:12.000000", "modified_by": "Administrator", "module": "HR", "name": "Employee Leave Approver", diff --git a/erpnext/hr/doctype/employment_type/employment_type.txt b/erpnext/hr/doctype/employment_type/employment_type.txt index 435e3666e8..4fa41fe345 100644 --- a/erpnext/hr/doctype/employment_type/employment_type.txt +++ b/erpnext/hr/doctype/employment_type/employment_type.txt @@ -1,7 +1,7 @@ { "allow_import": 1, "autoname": "field:employee_type_name", - "creation": "2013-01-10 16:34:14", + "creation": "2013-01-10 16:34:14.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Master", @@ -27,7 +27,7 @@ ], "icon": "icon-flag", "idx": 1, - "modified": "2014-01-20 17:48:43", + "modified": "2014-01-20 17:48:43.000000", "modified_by": "Administrator", "module": "HR", "name": "Employment Type", diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.txt b/erpnext/hr/doctype/expense_claim/expense_claim.txt index b73594883f..103831c598 100644 --- a/erpnext/hr/doctype/expense_claim/expense_claim.txt +++ b/erpnext/hr/doctype/expense_claim/expense_claim.txt @@ -1,6 +1,6 @@ { "autoname": "EXP.######", - "creation": "2013-01-10 16:34:14", + "creation": "2013-01-10 16:34:14.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -187,7 +187,7 @@ "icon": "icon-money", "idx": 1, "is_submittable": 1, - "modified": "2014-01-22 16:05:34", + "modified": "2014-01-22 16:05:34.000000", "modified_by": "Administrator", "module": "HR", "name": "Expense Claim", diff --git a/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.txt b/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.txt index c04a2be7b2..54bedc474d 100644 --- a/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.txt +++ b/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.txt @@ -1,5 +1,5 @@ { - "creation": "2013-02-22 01:27:46", + "creation": "2013-02-22 01:27:46.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -69,7 +69,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:13", + "modified": "2013-12-20 19:23:13.000000", "modified_by": "Administrator", "module": "HR", "name": "Expense Claim Detail", diff --git a/erpnext/hr/doctype/expense_claim_type/expense_claim_type.txt b/erpnext/hr/doctype/expense_claim_type/expense_claim_type.txt index 7f08f3b6e7..e733da0695 100644 --- a/erpnext/hr/doctype/expense_claim_type/expense_claim_type.txt +++ b/erpnext/hr/doctype/expense_claim_type/expense_claim_type.txt @@ -1,7 +1,7 @@ { "allow_import": 1, "autoname": "field:expense_type", - "creation": "2012-03-27 14:35:55", + "creation": "2012-03-27 14:35:55.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Master", @@ -29,7 +29,7 @@ ], "icon": "icon-flag", "idx": 1, - "modified": "2013-12-20 19:24:07", + "modified": "2013-12-20 19:24:07.000000", "modified_by": "Administrator", "module": "HR", "name": "Expense Claim Type", diff --git a/erpnext/hr/doctype/grade/grade.txt b/erpnext/hr/doctype/grade/grade.txt index 1f56bda8a7..24de355893 100644 --- a/erpnext/hr/doctype/grade/grade.txt +++ b/erpnext/hr/doctype/grade/grade.txt @@ -1,7 +1,7 @@ { "allow_import": 1, "autoname": "field:grade_name", - "creation": "2013-01-10 16:34:14", + "creation": "2013-01-10 16:34:14.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Master", @@ -18,7 +18,7 @@ ], "icon": "icon-star-half-empty", "idx": 1, - "modified": "2014-01-20 17:48:46", + "modified": "2014-01-20 17:48:46.000000", "modified_by": "Administrator", "module": "HR", "name": "Grade", diff --git a/erpnext/hr/doctype/holiday/holiday.txt b/erpnext/hr/doctype/holiday/holiday.txt index 39f93833c0..a00fbe8c06 100644 --- a/erpnext/hr/doctype/holiday/holiday.txt +++ b/erpnext/hr/doctype/holiday/holiday.txt @@ -1,5 +1,5 @@ { - "creation": "2013-02-22 01:27:46", + "creation": "2013-02-22 01:27:46.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -24,7 +24,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:14", + "modified": "2013-12-20 19:23:14.000000", "modified_by": "Administrator", "module": "HR", "name": "Holiday", diff --git a/erpnext/hr/doctype/holiday_list/holiday_list.txt b/erpnext/hr/doctype/holiday_list/holiday_list.txt index 66e57fc424..11b6911cb1 100644 --- a/erpnext/hr/doctype/holiday_list/holiday_list.txt +++ b/erpnext/hr/doctype/holiday_list/holiday_list.txt @@ -1,6 +1,6 @@ { "allow_import": 1, - "creation": "2013-01-10 16:34:14", + "creation": "2013-01-10 16:34:14.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Master", @@ -77,7 +77,7 @@ ], "icon": "icon-calendar", "idx": 1, - "modified": "2014-01-20 17:48:46", + "modified": "2014-01-20 17:48:46.000000", "modified_by": "Administrator", "module": "HR", "name": "Holiday List", diff --git a/erpnext/hr/doctype/hr_settings/hr_settings.txt b/erpnext/hr/doctype/hr_settings/hr_settings.txt index 2b94c0b9e3..15443db685 100644 --- a/erpnext/hr/doctype/hr_settings/hr_settings.txt +++ b/erpnext/hr/doctype/hr_settings/hr_settings.txt @@ -1,5 +1,5 @@ { - "creation": "2013-08-02 13:45:23", + "creation": "2013-08-02 13:45:23.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Other", @@ -43,7 +43,7 @@ "icon": "icon-cog", "idx": 1, "issingle": 1, - "modified": "2014-02-19 17:40:18", + "modified": "2014-02-19 17:40:18.000000", "modified_by": "Administrator", "module": "HR", "name": "HR Settings", diff --git a/erpnext/hr/doctype/job_applicant/job_applicant.txt b/erpnext/hr/doctype/job_applicant/job_applicant.txt index a7edcfff9d..ae9e9f6194 100644 --- a/erpnext/hr/doctype/job_applicant/job_applicant.txt +++ b/erpnext/hr/doctype/job_applicant/job_applicant.txt @@ -1,7 +1,7 @@ { "allow_attach": 1, "autoname": "field:applicant_name", - "creation": "2013-01-29 19:25:37", + "creation": "2013-01-29 19:25:37.000000", "description": "Applicant for a Job", "docstatus": 0, "doctype": "DocType", @@ -66,7 +66,7 @@ ], "icon": "icon-user", "idx": 1, - "modified": "2014-01-20 17:48:50", + "modified": "2014-01-20 17:48:50.000000", "modified_by": "Administrator", "module": "HR", "name": "Job Applicant", diff --git a/erpnext/hr/doctype/job_opening/job_opening.txt b/erpnext/hr/doctype/job_opening/job_opening.txt index 827f94c5ab..a5bff4b7dd 100644 --- a/erpnext/hr/doctype/job_opening/job_opening.txt +++ b/erpnext/hr/doctype/job_opening/job_opening.txt @@ -1,6 +1,6 @@ { "autoname": "field:job_title", - "creation": "2013-01-15 16:13:36", + "creation": "2013-01-15 16:13:36.000000", "description": "Description of a Job Opening", "docstatus": 0, "doctype": "DocType", @@ -30,7 +30,7 @@ ], "icon": "icon-bookmark", "idx": 1, - "modified": "2014-01-20 17:48:51", + "modified": "2014-01-20 17:48:51.000000", "modified_by": "Administrator", "module": "HR", "name": "Job Opening", diff --git a/erpnext/hr/doctype/leave_allocation/leave_allocation.txt b/erpnext/hr/doctype/leave_allocation/leave_allocation.txt index bf576303f0..c8d67ca64f 100644 --- a/erpnext/hr/doctype/leave_allocation/leave_allocation.txt +++ b/erpnext/hr/doctype/leave_allocation/leave_allocation.txt @@ -1,7 +1,7 @@ { "allow_import": 1, "autoname": "LAL/.#####", - "creation": "2013-02-20 19:10:38", + "creation": "2013-02-20 19:10:38.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -132,7 +132,7 @@ "icon": "icon-ok", "idx": 1, "is_submittable": 1, - "modified": "2014-01-22 16:05:35", + "modified": "2014-01-22 16:05:35.000000", "modified_by": "Administrator", "module": "HR", "name": "Leave Allocation", diff --git a/erpnext/hr/doctype/leave_application/leave_application.txt b/erpnext/hr/doctype/leave_application/leave_application.txt index 38160ccb85..777d036d37 100644 --- a/erpnext/hr/doctype/leave_application/leave_application.txt +++ b/erpnext/hr/doctype/leave_application/leave_application.txt @@ -1,7 +1,7 @@ { "allow_attach": 1, "autoname": "LAP/.#####", - "creation": "2013-02-20 11:18:11", + "creation": "2013-02-20 11:18:11.000000", "description": "Apply / Approve Leaves", "docstatus": 0, "doctype": "DocType", @@ -182,7 +182,7 @@ "idx": 1, "is_submittable": 1, "max_attachments": 3, - "modified": "2014-01-20 17:48:56", + "modified": "2014-01-20 17:48:56.000000", "modified_by": "Administrator", "module": "HR", "name": "Leave Application", diff --git a/erpnext/hr/doctype/leave_block_list/leave_block_list.txt b/erpnext/hr/doctype/leave_block_list/leave_block_list.txt index 0ddab075e3..cb3b6537a4 100644 --- a/erpnext/hr/doctype/leave_block_list/leave_block_list.txt +++ b/erpnext/hr/doctype/leave_block_list/leave_block_list.txt @@ -1,7 +1,7 @@ { "allow_import": 1, "autoname": "field:leave_block_list_name", - "creation": "2013-02-18 17:43:12", + "creation": "2013-02-18 17:43:12.000000", "description": "Block Holidays on important days.", "docstatus": 0, "doctype": "DocType", @@ -68,7 +68,7 @@ ], "icon": "icon-calendar", "idx": 1, - "modified": "2013-12-20 19:24:13", + "modified": "2013-12-20 19:24:13.000000", "modified_by": "Administrator", "module": "HR", "name": "Leave Block List", 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 d0f3855a32..bec2313b60 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 @@ -1,5 +1,5 @@ { - "creation": "2013-02-22 01:27:47", + "creation": "2013-02-22 01:27:47.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -17,7 +17,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:18", + "modified": "2013-12-20 19:23:18.000000", "modified_by": "Administrator", "module": "HR", "name": "Leave Block List Allow", diff --git a/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.txt b/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.txt index dd068a8bd9..f620501b49 100644 --- a/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.txt +++ b/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.txt @@ -1,5 +1,5 @@ { - "creation": "2013-02-22 01:27:47", + "creation": "2013-02-22 01:27:47.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -26,7 +26,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:19", + "modified": "2013-12-20 19:23:19.000000", "modified_by": "Administrator", "module": "HR", "name": "Leave Block List Date", diff --git a/erpnext/hr/doctype/leave_control_panel/leave_control_panel.txt b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.txt index adef0d59ba..65fa38d80a 100644 --- a/erpnext/hr/doctype/leave_control_panel/leave_control_panel.txt +++ b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.txt @@ -2,7 +2,7 @@ "allow_copy": 1, "allow_email": 1, "allow_print": 1, - "creation": "2013-01-10 16:34:15", + "creation": "2013-01-10 16:34:15.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -102,7 +102,7 @@ "icon": "icon-cog", "idx": 1, "issingle": 1, - "modified": "2013-07-05 14:44:50", + "modified": "2013-07-05 14:44:50.000000", "modified_by": "Administrator", "module": "HR", "name": "Leave Control Panel", diff --git a/erpnext/hr/doctype/leave_type/leave_type.txt b/erpnext/hr/doctype/leave_type/leave_type.txt index 19eb7e791f..be3123f2e5 100644 --- a/erpnext/hr/doctype/leave_type/leave_type.txt +++ b/erpnext/hr/doctype/leave_type/leave_type.txt @@ -1,7 +1,7 @@ { "allow_import": 1, "autoname": "field:leave_type_name", - "creation": "2013-02-21 09:55:58", + "creation": "2013-02-21 09:55:58.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Master", @@ -67,7 +67,7 @@ ], "icon": "icon-flag", "idx": 1, - "modified": "2014-01-20 17:48:56", + "modified": "2014-01-20 17:48:56.000000", "modified_by": "Administrator", "module": "HR", "name": "Leave Type", diff --git a/erpnext/hr/doctype/salary_manager/salary_manager.txt b/erpnext/hr/doctype/salary_manager/salary_manager.txt index aa86e06299..7a65b3f1b0 100644 --- a/erpnext/hr/doctype/salary_manager/salary_manager.txt +++ b/erpnext/hr/doctype/salary_manager/salary_manager.txt @@ -2,7 +2,7 @@ "allow_copy": 1, "allow_email": 1, "allow_print": 1, - "creation": "2012-03-27 14:35:59", + "creation": "2012-03-27 14:35:59.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Other", @@ -149,7 +149,7 @@ "icon": "icon-cog", "idx": 1, "issingle": 1, - "modified": "2013-07-22 15:22:58", + "modified": "2013-07-22 15:22:58.000000", "modified_by": "Administrator", "module": "HR", "name": "Salary Manager", diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.txt b/erpnext/hr/doctype/salary_slip/salary_slip.txt index 50779646c3..2896f11f50 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.txt +++ b/erpnext/hr/doctype/salary_slip/salary_slip.txt @@ -1,5 +1,5 @@ { - "creation": "2013-01-10 16:34:15", + "creation": "2013-01-10 16:34:15.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -355,7 +355,7 @@ "icon": "icon-file-text", "idx": 1, "is_submittable": 1, - "modified": "2014-01-20 17:49:18", + "modified": "2014-01-20 17:49:18.000000", "modified_by": "Administrator", "module": "HR", "name": "Salary Slip", diff --git a/erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.txt b/erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.txt index 23693ceaab..ae07c2c523 100644 --- a/erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.txt +++ b/erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.txt @@ -1,5 +1,5 @@ { - "creation": "2013-02-22 01:27:48", + "creation": "2013-02-22 01:27:48.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -44,7 +44,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:42", + "modified": "2013-12-20 19:23:42.000000", "modified_by": "Administrator", "module": "HR", "name": "Salary Slip Deduction", diff --git a/erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.txt b/erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.txt index bc9684ab34..eae64473a3 100644 --- a/erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.txt +++ b/erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.txt @@ -1,5 +1,5 @@ { - "creation": "2013-02-22 01:27:48", + "creation": "2013-02-22 01:27:48.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -44,7 +44,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:43", + "modified": "2013-12-20 19:23:43.000000", "modified_by": "Administrator", "module": "HR", "name": "Salary Slip Earning", diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.txt b/erpnext/hr/doctype/salary_structure/salary_structure.txt index 6aae2fba43..9394fce1c7 100644 --- a/erpnext/hr/doctype/salary_structure/salary_structure.txt +++ b/erpnext/hr/doctype/salary_structure/salary_structure.txt @@ -1,6 +1,6 @@ { "allow_import": 1, - "creation": "2013-03-07 18:50:29", + "creation": "2013-03-07 18:50:29.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -239,7 +239,7 @@ ], "icon": "icon-file-text", "idx": 1, - "modified": "2013-12-20 19:24:28", + "modified": "2013-12-20 19:24:28.000000", "modified_by": "Administrator", "module": "HR", "name": "Salary Structure", diff --git a/erpnext/hr/doctype/salary_structure_deduction/salary_structure_deduction.txt b/erpnext/hr/doctype/salary_structure_deduction/salary_structure_deduction.txt index 7b31d861ae..7f9f1a4879 100644 --- a/erpnext/hr/doctype/salary_structure_deduction/salary_structure_deduction.txt +++ b/erpnext/hr/doctype/salary_structure_deduction/salary_structure_deduction.txt @@ -1,5 +1,5 @@ { - "creation": "2013-02-22 01:27:48", + "creation": "2013-02-22 01:27:48.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -38,7 +38,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:43", + "modified": "2013-12-20 19:23:43.000000", "modified_by": "Administrator", "module": "HR", "name": "Salary Structure Deduction", diff --git a/erpnext/hr/doctype/salary_structure_earning/salary_structure_earning.txt b/erpnext/hr/doctype/salary_structure_earning/salary_structure_earning.txt index b0e91bf41b..534ff29d70 100644 --- a/erpnext/hr/doctype/salary_structure_earning/salary_structure_earning.txt +++ b/erpnext/hr/doctype/salary_structure_earning/salary_structure_earning.txt @@ -1,5 +1,5 @@ { - "creation": "2013-02-22 01:27:48", + "creation": "2013-02-22 01:27:48.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -40,7 +40,7 @@ "hide_toolbar": 0, "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:43", + "modified": "2013-12-20 19:23:43.000000", "modified_by": "Administrator", "module": "HR", "name": "Salary Structure Earning", diff --git a/erpnext/hr/doctype/upload_attendance/upload_attendance.txt b/erpnext/hr/doctype/upload_attendance/upload_attendance.txt index a1b632adbe..5037b3e693 100644 --- a/erpnext/hr/doctype/upload_attendance/upload_attendance.txt +++ b/erpnext/hr/doctype/upload_attendance/upload_attendance.txt @@ -1,6 +1,6 @@ { "allow_attach": 0, - "creation": "2013-01-25 11:34:53", + "creation": "2013-01-25 11:34:53.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -58,7 +58,7 @@ "idx": 1, "issingle": 1, "max_attachments": 1, - "modified": "2013-12-20 19:21:54", + "modified": "2013-12-20 19:21:54.000000", "modified_by": "Administrator", "module": "HR", "name": "Upload Attendance", diff --git a/erpnext/hr/report/employee_birthday/employee_birthday.txt b/erpnext/hr/report/employee_birthday/employee_birthday.txt index 8bff51ccfd..5839d01c61 100644 --- a/erpnext/hr/report/employee_birthday/employee_birthday.txt +++ b/erpnext/hr/report/employee_birthday/employee_birthday.txt @@ -1,10 +1,10 @@ { - "creation": "2013-05-06 17:56:03", + "creation": "2013-05-06 17:56:03.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "HR", "name": "Employee Birthday", diff --git a/erpnext/hr/report/employee_information/employee_information.txt b/erpnext/hr/report/employee_information/employee_information.txt index a92d5816d4..0dc3d4066a 100644 --- a/erpnext/hr/report/employee_information/employee_information.txt +++ b/erpnext/hr/report/employee_information/employee_information.txt @@ -1,11 +1,11 @@ { - "creation": "2013-05-06 18:43:53", + "creation": "2013-05-06 18:43:53.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "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\"}", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "HR", "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 dfee82d60e..4ffd7c89d7 100644 --- a/erpnext/hr/report/employee_leave_balance/employee_leave_balance.txt +++ b/erpnext/hr/report/employee_leave_balance/employee_leave_balance.txt @@ -1,10 +1,10 @@ { - "creation": "2013-02-22 15:29:34", + "creation": "2013-02-22 15:29:34.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "HR", "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 2bc4e86e67..5f55fee5b5 100644 --- a/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.txt +++ b/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.txt @@ -1,11 +1,11 @@ { "add_total_row": 0, - "creation": "2013-05-13 14:04:03", + "creation": "2013-05-13 14:04:03.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "HR", "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 f03fdeed7a..51b8e2c21c 100644 --- a/erpnext/hr/report/monthly_salary_register/monthly_salary_register.txt +++ b/erpnext/hr/report/monthly_salary_register/monthly_salary_register.txt @@ -1,11 +1,11 @@ { "add_total_row": 1, - "creation": "2013-05-07 18:09:42", + "creation": "2013-05-07 18:09:42.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "HR", "name": "Monthly Salary Register", diff --git a/erpnext/manufacturing/doctype/bom/bom.txt b/erpnext/manufacturing/doctype/bom/bom.txt index 14f8dd4e00..54299d0b73 100644 --- a/erpnext/manufacturing/doctype/bom/bom.txt +++ b/erpnext/manufacturing/doctype/bom/bom.txt @@ -3,7 +3,7 @@ "allow_copy": 0, "allow_import": 1, "allow_rename": 0, - "creation": "2013-01-22 15:11:38", + "creation": "2013-01-22 15:11:38.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Master", @@ -233,7 +233,7 @@ "is_submittable": 1, "issingle": 0, "istable": 0, - "modified": "2014-01-20 17:48:26", + "modified": "2014-01-20 17:48:26.000000", "modified_by": "Administrator", "module": "Manufacturing", "name": "BOM", diff --git a/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.txt b/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.txt index c0bd7798fe..6465e6aee9 100644 --- a/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.txt +++ b/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.txt @@ -1,6 +1,6 @@ { "autoname": "FBD/.######", - "creation": "2013-03-07 11:42:57", + "creation": "2013-03-07 11:42:57.000000", "default_print_format": "Standard", "docstatus": 0, "doctype": "DocType", @@ -82,7 +82,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:22:57", + "modified": "2013-12-20 19:22:57.000000", "modified_by": "Administrator", "module": "Manufacturing", "name": "BOM Explosion Item", diff --git a/erpnext/manufacturing/doctype/bom_item/bom_item.txt b/erpnext/manufacturing/doctype/bom_item/bom_item.txt index 2e504359b4..fbf478c756 100644 --- a/erpnext/manufacturing/doctype/bom_item/bom_item.txt +++ b/erpnext/manufacturing/doctype/bom_item/bom_item.txt @@ -1,5 +1,5 @@ { - "creation": "2013-02-22 01:27:49", + "creation": "2013-02-22 01:27:49.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -133,7 +133,7 @@ ], "idx": 1, "istable": 1, - "modified": "2014-02-03 12:47:39", + "modified": "2014-02-03 12:47:39.000000", "modified_by": "Administrator", "module": "Manufacturing", "name": "BOM Item", diff --git a/erpnext/manufacturing/doctype/bom_operation/bom_operation.txt b/erpnext/manufacturing/doctype/bom_operation/bom_operation.txt index e164e10fc2..3bf5862c19 100644 --- a/erpnext/manufacturing/doctype/bom_operation/bom_operation.txt +++ b/erpnext/manufacturing/doctype/bom_operation/bom_operation.txt @@ -1,5 +1,5 @@ { - "creation": "2013-02-22 01:27:49", + "creation": "2013-02-22 01:27:49.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -73,7 +73,7 @@ ], "idx": 1, "istable": 1, - "modified": "2014-02-03 12:53:03", + "modified": "2014-02-03 12:53:03.000000", "modified_by": "Administrator", "module": "Manufacturing", "name": "BOM Operation", diff --git a/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.txt b/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.txt index 872881bbbc..a5e3b4d629 100644 --- a/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.txt +++ b/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.txt @@ -2,7 +2,7 @@ "allow_copy": 1, "allow_email": 1, "allow_print": 1, - "creation": "2012-12-06 12:10:10", + "creation": "2012-12-06 12:10:10.000000", "description": "Replace a particular BOM in all other BOMs where it is used. It will replace the old BOM link, update cost and regenerate \"BOM Explosion Item\" table as per new BOM", "docstatus": 0, "doctype": "DocType", @@ -43,7 +43,7 @@ "idx": 1, "in_create": 1, "issingle": 1, - "modified": "2013-07-05 14:27:52", + "modified": "2013-07-05 14:27:52.000000", "modified_by": "Administrator", "module": "Manufacturing", "name": "BOM Replace Tool", diff --git a/erpnext/manufacturing/doctype/production_order/production_order.txt b/erpnext/manufacturing/doctype/production_order/production_order.txt index 539d919f15..b1ff6289fe 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.txt +++ b/erpnext/manufacturing/doctype/production_order/production_order.txt @@ -1,7 +1,7 @@ { "allow_import": 1, "autoname": "naming_series:", - "creation": "2013-01-10 16:34:16", + "creation": "2013-01-10 16:34:16.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -224,7 +224,7 @@ "idx": 1, "in_create": 0, "is_submittable": 1, - "modified": "2014-01-20 17:49:01", + "modified": "2014-01-20 17:49:01.000000", "modified_by": "Administrator", "module": "Manufacturing", "name": "Production Order", diff --git a/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.txt b/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.txt index 16ff1414e9..cb5d24f8c9 100644 --- a/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.txt +++ b/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.txt @@ -1,6 +1,6 @@ { "autoname": "PPID/.#####", - "creation": "2013-02-22 01:27:49", + "creation": "2013-02-22 01:27:49.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -104,7 +104,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:25", + "modified": "2013-12-20 19:23:25.000000", "modified_by": "Administrator", "module": "Manufacturing", "name": "Production Plan Item", diff --git a/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.txt b/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.txt index 38241eafb4..2b6c39314d 100644 --- a/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.txt +++ b/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.txt @@ -1,6 +1,6 @@ { "autoname": "PP/.SO/.#####", - "creation": "2013-02-22 01:27:49", + "creation": "2013-02-22 01:27:49.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -53,7 +53,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:25", + "modified": "2013-12-20 19:23:25.000000", "modified_by": "Administrator", "module": "Manufacturing", "name": "Production Plan Sales Order", diff --git a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.txt b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.txt index b758c1a7b9..bdfab41fba 100644 --- a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.txt +++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.txt @@ -1,5 +1,5 @@ { - "creation": "2013-01-21 12:03:47", + "creation": "2013-01-21 12:03:47.000000", "default_print_format": "Standard", "docstatus": 0, "doctype": "DocType", @@ -155,7 +155,7 @@ "idx": 1, "in_create": 1, "issingle": 1, - "modified": "2013-12-20 19:23:25", + "modified": "2013-12-20 19:23:25.000000", "modified_by": "Administrator", "module": "Manufacturing", "name": "Production Planning Tool", diff --git a/erpnext/manufacturing/doctype/workstation/workstation.txt b/erpnext/manufacturing/doctype/workstation/workstation.txt index d4da5864ce..db3b440ab8 100644 --- a/erpnext/manufacturing/doctype/workstation/workstation.txt +++ b/erpnext/manufacturing/doctype/workstation/workstation.txt @@ -1,7 +1,7 @@ { "allow_import": 1, "autoname": "field:workstation_name", - "creation": "2013-01-10 16:34:17", + "creation": "2013-01-10 16:34:17.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Master", @@ -126,7 +126,7 @@ ], "icon": "icon-wrench", "idx": 1, - "modified": "2014-01-20 17:49:35", + "modified": "2014-01-20 17:49:35.000000", "modified_by": "Administrator", "module": "Manufacturing", "name": "Workstation", 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 7fd484736f..dbfd405b46 100644 --- a/erpnext/manufacturing/report/completed_production_orders/completed_production_orders.txt +++ b/erpnext/manufacturing/report/completed_production_orders/completed_production_orders.txt @@ -1,10 +1,10 @@ { - "creation": "2013-08-12 12:44:27", + "creation": "2013-08-12 12:44:27.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Manufacturing", "name": "Completed Production Orders", 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 032db0b3f4..35f7225165 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 @@ -1,11 +1,11 @@ { "add_total_row": 0, - "creation": "2013-05-03 17:48:46", + "creation": "2013-05-03 17:48:46.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Manufacturing", "name": "Issued Items Against 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 e952a20c5a..4fbcc46482 100644 --- a/erpnext/manufacturing/report/open_production_orders/open_production_orders.txt +++ b/erpnext/manufacturing/report/open_production_orders/open_production_orders.txt @@ -1,10 +1,10 @@ { - "creation": "2013-08-12 12:32:30", + "creation": "2013-08-12 12:32:30.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Manufacturing", "name": "Open Production Orders", 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 b0412073a7..11f5b2b3ff 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 @@ -1,10 +1,10 @@ { - "creation": "2013-08-12 12:43:47", + "creation": "2013-08-12 12:43:47.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Manufacturing", "name": "Production Orders in Progress", diff --git a/erpnext/projects/doctype/activity_type/activity_type.txt b/erpnext/projects/doctype/activity_type/activity_type.txt index 7f76abcf5c..7ef2ec1b9e 100644 --- a/erpnext/projects/doctype/activity_type/activity_type.txt +++ b/erpnext/projects/doctype/activity_type/activity_type.txt @@ -1,7 +1,7 @@ { "allow_import": 1, "autoname": "field:activity_type", - "creation": "2013-03-05 10:14:59", + "creation": "2013-03-05 10:14:59.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Master", @@ -17,7 +17,7 @@ "icon": "icon-flag", "idx": 1, "in_dialog": 0, - "modified": "2013-12-20 19:23:54", + "modified": "2013-12-20 19:23:54.000000", "modified_by": "Administrator", "module": "Projects", "name": "Activity Type", diff --git a/erpnext/projects/doctype/project/project.txt b/erpnext/projects/doctype/project/project.txt index e1b2414005..b757bedacc 100644 --- a/erpnext/projects/doctype/project/project.txt +++ b/erpnext/projects/doctype/project/project.txt @@ -2,7 +2,7 @@ "allow_attach": 1, "allow_import": 1, "autoname": "field:project_name", - "creation": "2013-03-07 11:55:07", + "creation": "2013-03-07 11:55:07.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Master", @@ -258,7 +258,7 @@ "icon": "icon-puzzle-piece", "idx": 1, "max_attachments": 4, - "modified": "2014-01-20 17:49:02", + "modified": "2014-01-20 17:49:02.000000", "modified_by": "Administrator", "module": "Projects", "name": "Project", diff --git a/erpnext/projects/doctype/project_milestone/project_milestone.txt b/erpnext/projects/doctype/project_milestone/project_milestone.txt index 3c79108cfa..7de9948753 100644 --- a/erpnext/projects/doctype/project_milestone/project_milestone.txt +++ b/erpnext/projects/doctype/project_milestone/project_milestone.txt @@ -1,5 +1,5 @@ { - "creation": "2013-02-22 01:27:50", + "creation": "2013-02-22 01:27:50.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -37,7 +37,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:27", + "modified": "2013-12-20 19:23:27.000000", "modified_by": "Administrator", "module": "Projects", "name": "Project Milestone", diff --git a/erpnext/projects/doctype/task/task.txt b/erpnext/projects/doctype/task/task.txt index 6dbd0a4a53..71327bbc0a 100644 --- a/erpnext/projects/doctype/task/task.txt +++ b/erpnext/projects/doctype/task/task.txt @@ -2,7 +2,7 @@ "allow_attach": 1, "allow_import": 1, "autoname": "TASK.#####", - "creation": "2013-01-29 19:25:50", + "creation": "2013-01-29 19:25:50.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Master", @@ -218,7 +218,7 @@ "icon": "icon-check", "idx": 1, "max_attachments": 5, - "modified": "2014-01-24 13:01:46", + "modified": "2014-01-24 13:01:46.000000", "modified_by": "Administrator", "module": "Projects", "name": "Task", diff --git a/erpnext/projects/doctype/time_log/time_log.txt b/erpnext/projects/doctype/time_log/time_log.txt index 137ad86ea3..cd5a8d1499 100644 --- a/erpnext/projects/doctype/time_log/time_log.txt +++ b/erpnext/projects/doctype/time_log/time_log.txt @@ -2,7 +2,7 @@ "allow_attach": 1, "allow_import": 1, "autoname": "naming_series:", - "creation": "2013-04-03 16:38:41", + "creation": "2013-04-03 16:38:41.000000", "description": "Log of Activities performed by users against Tasks that can be used for tracking time, billing.", "docstatus": 0, "doctype": "DocType", @@ -151,7 +151,7 @@ "icon": "icon-time", "idx": 1, "is_submittable": 1, - "modified": "2014-01-22 16:05:35", + "modified": "2014-01-22 16:05:35.000000", "modified_by": "Administrator", "module": "Projects", "name": "Time Log", diff --git a/erpnext/projects/doctype/time_log_batch/time_log_batch.txt b/erpnext/projects/doctype/time_log_batch/time_log_batch.txt index 36761175dd..9d98a34b6b 100644 --- a/erpnext/projects/doctype/time_log_batch/time_log_batch.txt +++ b/erpnext/projects/doctype/time_log_batch/time_log_batch.txt @@ -1,6 +1,6 @@ { "autoname": "naming_series:", - "creation": "2013-02-28 17:57:33", + "creation": "2013-02-28 17:57:33.000000", "description": "Batch Time Logs for Billing.", "docstatus": 0, "doctype": "DocType", @@ -83,7 +83,7 @@ "icon": "icon-time", "idx": 1, "is_submittable": 1, - "modified": "2014-01-20 17:49:34", + "modified": "2014-01-20 17:49:34.000000", "modified_by": "Administrator", "module": "Projects", "name": "Time Log Batch", 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 565402a560..15e7e8e29b 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 @@ -1,5 +1,5 @@ { - "creation": "2013-03-05 09:11:06", + "creation": "2013-03-05 09:11:06.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -41,7 +41,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:21:54", + "modified": "2013-12-20 19:21:54.000000", "modified_by": "Administrator", "module": "Projects", "name": "Time Log Batch Detail", 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 3422010c96..1be419a628 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 @@ -1,10 +1,10 @@ { - "creation": "2013-04-03 11:27:52", + "creation": "2013-04-03 11:27:52.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Projects", "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 5296920f62..467c83eaac 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 @@ -1,10 +1,10 @@ { - "creation": "2013-06-03 17:37:41", + "creation": "2013-06-03 17:37:41.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Projects", "name": "Project wise Stock Tracking", diff --git a/erpnext/selling/Print Format/Quotation Classic/Quotation Classic.txt b/erpnext/selling/Print Format/Quotation Classic/Quotation Classic.txt index 220f1ead77..977a225799 100644 --- a/erpnext/selling/Print Format/Quotation Classic/Quotation Classic.txt +++ b/erpnext/selling/Print Format/Quotation Classic/Quotation Classic.txt @@ -1,11 +1,11 @@ { - "creation": "2013-04-19 13:30:51", + "creation": "2013-04-19 13:30:51.000000", "doc_type": "Quotation", "docstatus": 0, "doctype": "Print Format", "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", "idx": 1, - "modified": "2014-02-11 17:45:37", + "modified": "2014-02-11 17:45:37.000000", "modified_by": "Administrator", "module": "Selling", "name": "Quotation Classic", diff --git a/erpnext/selling/Print Format/Quotation Modern/Quotation Modern.txt b/erpnext/selling/Print Format/Quotation Modern/Quotation Modern.txt index 2073a9ea52..6b0ed48ccf 100644 --- a/erpnext/selling/Print Format/Quotation Modern/Quotation Modern.txt +++ b/erpnext/selling/Print Format/Quotation Modern/Quotation Modern.txt @@ -1,11 +1,11 @@ { - "creation": "2013-04-19 13:30:51", + "creation": "2013-04-19 13:30:51.000000", "doc_type": "Quotation", "docstatus": 0, "doctype": "Print Format", "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", "idx": 1, - "modified": "2014-02-11 17:45:15", + "modified": "2014-02-11 17:45:15.000000", "modified_by": "Administrator", "module": "Selling", "name": "Quotation Modern", diff --git a/erpnext/selling/Print Format/Quotation Spartan/Quotation Spartan.txt b/erpnext/selling/Print Format/Quotation Spartan/Quotation Spartan.txt index 1ace24649e..5e21b6cbf8 100644 --- a/erpnext/selling/Print Format/Quotation Spartan/Quotation Spartan.txt +++ b/erpnext/selling/Print Format/Quotation Spartan/Quotation Spartan.txt @@ -1,11 +1,11 @@ { - "creation": "2013-04-19 13:30:51", + "creation": "2013-04-19 13:30:51.000000", "doc_type": "Quotation", "docstatus": 0, "doctype": "Print Format", "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", "idx": 1, - "modified": "2014-02-11 17:45:50", + "modified": "2014-02-11 17:45:50.000000", "modified_by": "Administrator", "module": "Selling", "name": "Quotation Spartan", diff --git a/erpnext/selling/Print Format/Sales Order Classic/Sales Order Classic.txt b/erpnext/selling/Print Format/Sales Order Classic/Sales Order Classic.txt index 2e9abb3c21..3aee798d12 100644 --- a/erpnext/selling/Print Format/Sales Order Classic/Sales Order Classic.txt +++ b/erpnext/selling/Print Format/Sales Order Classic/Sales Order Classic.txt @@ -1,11 +1,11 @@ { - "creation": "2013-04-19 13:30:51", + "creation": "2013-04-19 13:30:51.000000", "doc_type": "Sales Order", "docstatus": 0, "doctype": "Print Format", "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", "idx": 1, - "modified": "2014-02-11 17:35:51", + "modified": "2014-02-11 17:35:51.000000", "modified_by": "Administrator", "module": "Selling", "name": "Sales Order Classic", diff --git a/erpnext/selling/Print Format/Sales Order Modern/Sales Order Modern.txt b/erpnext/selling/Print Format/Sales Order Modern/Sales Order Modern.txt index 1a7432c397..76ee34af4d 100644 --- a/erpnext/selling/Print Format/Sales Order Modern/Sales Order Modern.txt +++ b/erpnext/selling/Print Format/Sales Order Modern/Sales Order Modern.txt @@ -1,11 +1,11 @@ { - "creation": "2013-04-19 13:30:51", + "creation": "2013-04-19 13:30:51.000000", "doc_type": "Sales Order", "docstatus": 0, "doctype": "Print Format", "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", "idx": 1, - "modified": "2014-02-11 17:34:24", + "modified": "2014-02-11 17:34:24.000000", "modified_by": "Administrator", "module": "Selling", "name": "Sales Order Modern", diff --git a/erpnext/selling/Print Format/Sales Order Spartan/Sales Order Spartan.txt b/erpnext/selling/Print Format/Sales Order Spartan/Sales Order Spartan.txt index 1e51dd3997..1628da71a6 100644 --- a/erpnext/selling/Print Format/Sales Order Spartan/Sales Order Spartan.txt +++ b/erpnext/selling/Print Format/Sales Order Spartan/Sales Order Spartan.txt @@ -1,11 +1,11 @@ { - "creation": "2013-04-19 13:30:51", + "creation": "2013-04-19 13:30:51.000000", "doc_type": "Sales Order", "docstatus": 0, "doctype": "Print Format", "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", "idx": 1, - "modified": "2014-02-11 17:35:29", + "modified": "2014-02-11 17:35:29.000000", "modified_by": "Administrator", "module": "Selling", "name": "Sales Order Spartan", diff --git a/erpnext/selling/doctype/campaign/campaign.txt b/erpnext/selling/doctype/campaign/campaign.txt index f7895fc29d..9b45c6afa1 100644 --- a/erpnext/selling/doctype/campaign/campaign.txt +++ b/erpnext/selling/doctype/campaign/campaign.txt @@ -2,7 +2,7 @@ "allow_import": 1, "allow_rename": 1, "autoname": "field:campaign_name", - "creation": "2013-01-10 16:34:18", + "creation": "2013-01-10 16:34:18.000000", "description": "Keep Track of Sales Campaigns. Keep track of Leads, Quotations, Sales Order etc from Campaigns to gauge Return on Investment. ", "docstatus": 0, "doctype": "DocType", @@ -45,7 +45,7 @@ ], "icon": "icon-bullhorn", "idx": 1, - "modified": "2014-01-20 17:48:27", + "modified": "2014-01-20 17:48:27.000000", "modified_by": "Administrator", "module": "Selling", "name": "Campaign", diff --git a/erpnext/selling/doctype/customer/customer.txt b/erpnext/selling/doctype/customer/customer.txt index a2afe64e1d..2bb65f347b 100644 --- a/erpnext/selling/doctype/customer/customer.txt +++ b/erpnext/selling/doctype/customer/customer.txt @@ -2,7 +2,7 @@ "allow_import": 1, "allow_rename": 1, "autoname": "naming_series:", - "creation": "2013-06-11 14:26:44", + "creation": "2013-06-11 14:26:44.000000", "description": "Buyer of Goods and Services.", "docstatus": 0, "doctype": "DocType", @@ -278,7 +278,7 @@ ], "icon": "icon-user", "idx": 1, - "modified": "2014-03-03 19:05:58", + "modified": "2014-03-03 19:05:58.000000", "modified_by": "Administrator", "module": "Selling", "name": "Customer", diff --git a/erpnext/selling/doctype/industry_type/industry_type.txt b/erpnext/selling/doctype/industry_type/industry_type.txt index f55a9410d6..2beda93718 100644 --- a/erpnext/selling/doctype/industry_type/industry_type.txt +++ b/erpnext/selling/doctype/industry_type/industry_type.txt @@ -1,7 +1,7 @@ { "allow_import": 1, "autoname": "field:industry", - "creation": "2012-03-27 14:36:09", + "creation": "2012-03-27 14:36:09.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Master", @@ -18,7 +18,7 @@ ], "icon": "icon-flag", "idx": 1, - "modified": "2013-12-20 19:24:08", + "modified": "2013-12-20 19:24:08.000000", "modified_by": "Administrator", "module": "Selling", "name": "Industry Type", diff --git a/erpnext/selling/doctype/installation_note/installation_note.txt b/erpnext/selling/doctype/installation_note/installation_note.txt index c3e34108a6..cffd39d3f9 100644 --- a/erpnext/selling/doctype/installation_note/installation_note.txt +++ b/erpnext/selling/doctype/installation_note/installation_note.txt @@ -1,6 +1,6 @@ { "autoname": "naming_series:", - "creation": "2013-04-30 13:13:06", + "creation": "2013-04-30 13:13:06.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -233,7 +233,7 @@ "icon": "icon-wrench", "idx": 1, "is_submittable": 1, - "modified": "2014-01-20 17:48:47", + "modified": "2014-01-20 17:48:47.000000", "modified_by": "Administrator", "module": "Selling", "name": "Installation Note", diff --git a/erpnext/selling/doctype/installation_note_item/installation_note_item.txt b/erpnext/selling/doctype/installation_note_item/installation_note_item.txt index 79b0980452..0e94d10013 100644 --- a/erpnext/selling/doctype/installation_note_item/installation_note_item.txt +++ b/erpnext/selling/doctype/installation_note_item/installation_note_item.txt @@ -1,6 +1,6 @@ { "autoname": "IID/.#####", - "creation": "2013-02-22 01:27:51", + "creation": "2013-02-22 01:27:51.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -100,7 +100,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:14", + "modified": "2013-12-20 19:23:14.000000", "modified_by": "Administrator", "module": "Selling", "name": "Installation Note Item", diff --git a/erpnext/selling/doctype/lead/lead.txt b/erpnext/selling/doctype/lead/lead.txt index 01845e8a58..c423bfaa85 100644 --- a/erpnext/selling/doctype/lead/lead.txt +++ b/erpnext/selling/doctype/lead/lead.txt @@ -1,7 +1,7 @@ { "allow_import": 1, "autoname": "naming_series:", - "creation": "2013-04-10 11:45:37", + "creation": "2013-04-10 11:45:37.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Master", @@ -362,7 +362,7 @@ ], "icon": "icon-user", "idx": 1, - "modified": "2014-01-20 17:48:54", + "modified": "2014-01-20 17:48:54.000000", "modified_by": "Administrator", "module": "Selling", "name": "Lead", diff --git a/erpnext/selling/doctype/opportunity/opportunity.txt b/erpnext/selling/doctype/opportunity/opportunity.txt index e98648dd0c..51129c5d46 100644 --- a/erpnext/selling/doctype/opportunity/opportunity.txt +++ b/erpnext/selling/doctype/opportunity/opportunity.txt @@ -1,7 +1,7 @@ { "allow_import": 1, "autoname": "naming_series:", - "creation": "2013-03-07 18:50:30", + "creation": "2013-03-07 18:50:30.000000", "description": "Potential Sales Deal", "docstatus": 0, "doctype": "DocType", @@ -409,7 +409,7 @@ "icon": "icon-info-sign", "idx": 1, "is_submittable": 1, - "modified": "2014-01-20 17:48:59", + "modified": "2014-01-20 17:48:59.000000", "modified_by": "Administrator", "module": "Selling", "name": "Opportunity", diff --git a/erpnext/selling/doctype/opportunity_item/opportunity_item.txt b/erpnext/selling/doctype/opportunity_item/opportunity_item.txt index e16731b3bb..55c33e5c5f 100644 --- a/erpnext/selling/doctype/opportunity_item/opportunity_item.txt +++ b/erpnext/selling/doctype/opportunity_item/opportunity_item.txt @@ -1,5 +1,5 @@ { - "creation": "2013-02-22 01:27:51", + "creation": "2013-02-22 01:27:51.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -115,7 +115,7 @@ ], "idx": 1, "istable": 1, - "modified": "2014-02-03 12:40:44", + "modified": "2014-02-03 12:40:44.000000", "modified_by": "Administrator", "module": "Selling", "name": "Opportunity Item", diff --git a/erpnext/selling/doctype/quotation/quotation.txt b/erpnext/selling/doctype/quotation/quotation.txt index 753b344cba..4b99d9e3e7 100644 --- a/erpnext/selling/doctype/quotation/quotation.txt +++ b/erpnext/selling/doctype/quotation/quotation.txt @@ -2,7 +2,7 @@ "allow_attach": 1, "allow_import": 1, "autoname": "naming_series:", - "creation": "2013-05-24 19:29:08", + "creation": "2013-05-24 19:29:08.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Transaction", @@ -818,7 +818,7 @@ "idx": 1, "is_submittable": 1, "max_attachments": 1, - "modified": "2014-01-31 19:43:00", + "modified": "2014-01-31 19:43:00.000000", "modified_by": "Administrator", "module": "Selling", "name": "Quotation", diff --git a/erpnext/selling/doctype/quotation_item/quotation_item.txt b/erpnext/selling/doctype/quotation_item/quotation_item.txt index fccbc5a755..4e19ee7970 100644 --- a/erpnext/selling/doctype/quotation_item/quotation_item.txt +++ b/erpnext/selling/doctype/quotation_item/quotation_item.txt @@ -1,6 +1,6 @@ { "autoname": "QUOD/.#####", - "creation": "2013-03-07 11:42:57", + "creation": "2013-03-07 11:42:57.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -353,7 +353,7 @@ ], "idx": 1, "istable": 1, - "modified": "2014-02-28 11:20:34", + "modified": "2014-02-28 11:20:34.000000", "modified_by": "Administrator", "module": "Selling", "name": "Quotation Item", diff --git a/erpnext/selling/doctype/sales_bom/sales_bom.txt b/erpnext/selling/doctype/sales_bom/sales_bom.txt index c747615aae..91fac19a27 100644 --- a/erpnext/selling/doctype/sales_bom/sales_bom.txt +++ b/erpnext/selling/doctype/sales_bom/sales_bom.txt @@ -1,6 +1,6 @@ { "allow_import": 1, - "creation": "2013-06-20 11:53:21", + "creation": "2013-06-20 11:53:21.000000", "description": "Aggregate group of **Items** into another **Item**. This is useful if you are bundling a certain **Items** into a package and you maintain stock of the packed **Items** and not the aggregate **Item**. \n\nThe package **Item** will have \"Is Stock Item\" as \"No\" and \"Is Sales Item\" as \"Yes\".\n\nFor Example: If you are selling Laptops and Backpacks separately and have a special price if the customer buys both, then the Laptop + Backpack will be a new Sales BOM Item.\n\nNote: BOM = Bill of Materials", "docstatus": 0, "doctype": "DocType", @@ -45,7 +45,7 @@ "icon": "icon-sitemap", "idx": 1, "is_submittable": 0, - "modified": "2014-01-20 17:49:19", + "modified": "2014-01-20 17:49:19.000000", "modified_by": "Administrator", "module": "Selling", "name": "Sales BOM", diff --git a/erpnext/selling/doctype/sales_bom_item/sales_bom_item.txt b/erpnext/selling/doctype/sales_bom_item/sales_bom_item.txt index 57642c3820..c48debdd8c 100644 --- a/erpnext/selling/doctype/sales_bom_item/sales_bom_item.txt +++ b/erpnext/selling/doctype/sales_bom_item/sales_bom_item.txt @@ -1,5 +1,5 @@ { - "creation": "2013-05-23 16:55:51", + "creation": "2013-05-23 16:55:51.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -60,7 +60,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:21:38", + "modified": "2013-12-20 19:21:38.000000", "modified_by": "Administrator", "module": "Selling", "name": "Sales BOM Item", diff --git a/erpnext/selling/doctype/sales_order/sales_order.txt b/erpnext/selling/doctype/sales_order/sales_order.txt index a856a53b28..102abc0eef 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.txt +++ b/erpnext/selling/doctype/sales_order/sales_order.txt @@ -2,7 +2,7 @@ "allow_attach": 1, "allow_import": 1, "autoname": "naming_series:", - "creation": "2013-06-18 12:39:59", + "creation": "2013-06-18 12:39:59.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Transaction", @@ -874,7 +874,7 @@ "idx": 1, "is_submittable": 1, "issingle": 0, - "modified": "2014-01-28 18:47:42", + "modified": "2014-01-28 18:47:42.000000", "modified_by": "Administrator", "module": "Selling", "name": "Sales Order", diff --git a/erpnext/selling/doctype/sales_order_item/sales_order_item.txt b/erpnext/selling/doctype/sales_order_item/sales_order_item.txt index d5b4d78560..9d0ae0e031 100644 --- a/erpnext/selling/doctype/sales_order_item/sales_order_item.txt +++ b/erpnext/selling/doctype/sales_order_item/sales_order_item.txt @@ -1,6 +1,6 @@ { "autoname": "SOD/.#####", - "creation": "2013-03-07 11:42:58", + "creation": "2013-03-07 11:42:58.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -439,7 +439,7 @@ ], "idx": 1, "istable": 1, - "modified": "2014-02-28 11:20:05", + "modified": "2014-02-28 11:20:05.000000", "modified_by": "Administrator", "module": "Selling", "name": "Sales Order Item", diff --git a/erpnext/selling/doctype/sales_team/sales_team.txt b/erpnext/selling/doctype/sales_team/sales_team.txt index 11bf5447b8..dda6046e7e 100644 --- a/erpnext/selling/doctype/sales_team/sales_team.txt +++ b/erpnext/selling/doctype/sales_team/sales_team.txt @@ -1,5 +1,5 @@ { - "creation": "2013-04-19 13:30:51", + "creation": "2013-04-19 13:30:51.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -99,7 +99,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-31 19:00:14", + "modified": "2013-12-31 19:00:14.000000", "modified_by": "Administrator", "module": "Selling", "name": "Sales Team", diff --git a/erpnext/selling/doctype/selling_settings/selling_settings.txt b/erpnext/selling/doctype/selling_settings/selling_settings.txt index cee3a5c061..ade8449d4c 100644 --- a/erpnext/selling/doctype/selling_settings/selling_settings.txt +++ b/erpnext/selling/doctype/selling_settings/selling_settings.txt @@ -1,5 +1,5 @@ { - "creation": "2013-06-25 10:25:16", + "creation": "2013-06-25 10:25:16.000000", "description": "Settings for Selling Module", "docstatus": 0, "doctype": "DocType", @@ -71,7 +71,7 @@ "icon": "icon-cog", "idx": 1, "issingle": 1, - "modified": "2014-02-19 18:35:36", + "modified": "2014-02-19 18:35:36.000000", "modified_by": "Administrator", "module": "Selling", "name": "Selling Settings", diff --git a/erpnext/selling/doctype/sms_center/sms_center.txt b/erpnext/selling/doctype/sms_center/sms_center.txt index 98e630d792..56143c4d8c 100644 --- a/erpnext/selling/doctype/sms_center/sms_center.txt +++ b/erpnext/selling/doctype/sms_center/sms_center.txt @@ -1,7 +1,7 @@ { "allow_attach": 0, "allow_copy": 1, - "creation": "2013-01-10 16:34:22", + "creation": "2013-01-10 16:34:22.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -105,7 +105,7 @@ "idx": 1, "in_create": 0, "issingle": 1, - "modified": "2014-01-30 15:29:04", + "modified": "2014-01-30 15:29:04.000000", "modified_by": "Administrator", "module": "Selling", "name": "SMS Center", diff --git a/erpnext/selling/page/sales_analytics/sales_analytics.txt b/erpnext/selling/page/sales_analytics/sales_analytics.txt index 113d4326f4..12bc4874b3 100644 --- a/erpnext/selling/page/sales_analytics/sales_analytics.txt +++ b/erpnext/selling/page/sales_analytics/sales_analytics.txt @@ -1,10 +1,10 @@ { - "creation": "2012-09-21 20:15:12", + "creation": "2012-09-21 20:15:12.000000", "docstatus": 0, "doctype": "Page", "icon": "icon-bar-chart", "idx": 1, - "modified": "2013-07-11 14:43:59", + "modified": "2013-07-11 14:43:59.000000", "modified_by": "Administrator", "module": "Selling", "name": "sales-analytics", diff --git a/erpnext/selling/page/sales_browser/sales_browser.txt b/erpnext/selling/page/sales_browser/sales_browser.txt index d950d90598..ace9203ef6 100644 --- a/erpnext/selling/page/sales_browser/sales_browser.txt +++ b/erpnext/selling/page/sales_browser/sales_browser.txt @@ -1,10 +1,10 @@ { - "creation": "2012-06-14 15:07:26", + "creation": "2012-06-14 15:07:26.000000", "docstatus": 0, "doctype": "Page", "icon": "icon-sitemap", "idx": 1, - "modified": "2013-07-11 14:43:56", + "modified": "2013-07-11 14:43:56.000000", "modified_by": "Administrator", "module": "Selling", "name": "Sales Browser", diff --git a/erpnext/selling/page/sales_funnel/sales_funnel.txt b/erpnext/selling/page/sales_funnel/sales_funnel.txt index 2e61c0e8ca..3a50968f2c 100644 --- a/erpnext/selling/page/sales_funnel/sales_funnel.txt +++ b/erpnext/selling/page/sales_funnel/sales_funnel.txt @@ -1,10 +1,10 @@ { - "creation": "2013-10-04 13:17:18", + "creation": "2013-10-04 13:17:18.000000", "docstatus": 0, "doctype": "Page", "icon": "icon-filter", "idx": 1, - "modified": "2013-10-04 13:17:18", + "modified": "2013-10-04 13:17:18.000000", "modified_by": "Administrator", "module": "Selling", "name": "sales-funnel", diff --git a/erpnext/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.txt b/erpnext/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.txt index c81e8d3778..29b47c8fbb 100644 --- a/erpnext/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.txt +++ b/erpnext/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.txt @@ -1,10 +1,10 @@ { - "creation": "2013-06-21 13:40:05", + "creation": "2013-06-21 13:40:05.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Selling", "name": "Available Stock for Packing Items", diff --git a/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.txt b/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.txt index 6805f90005..b04e5dad25 100644 --- a/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.txt +++ b/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.txt @@ -1,11 +1,11 @@ { "add_total_row": 1, - "creation": "2013-11-28 14:58:06", + "creation": "2013-11-28 14:58:06.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Selling", "name": "Customer Acquisition and Loyalty", diff --git a/erpnext/selling/report/customer_addresses_and_contacts/customer_addresses_and_contacts.txt b/erpnext/selling/report/customer_addresses_and_contacts/customer_addresses_and_contacts.txt index a2805c5257..9fe5291cb4 100644 --- a/erpnext/selling/report/customer_addresses_and_contacts/customer_addresses_and_contacts.txt +++ b/erpnext/selling/report/customer_addresses_and_contacts/customer_addresses_and_contacts.txt @@ -1,10 +1,10 @@ { - "creation": "2012-10-04 18:45:27", + "creation": "2012-10-04 18:45:27.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Selling", "name": "Customer Addresses And Contacts", diff --git a/erpnext/selling/report/customers_not_buying_since_long_time/customers_not_buying_since_long_time.txt b/erpnext/selling/report/customers_not_buying_since_long_time/customers_not_buying_since_long_time.txt index 62d523c0b9..04b662e119 100644 --- a/erpnext/selling/report/customers_not_buying_since_long_time/customers_not_buying_since_long_time.txt +++ b/erpnext/selling/report/customers_not_buying_since_long_time/customers_not_buying_since_long_time.txt @@ -1,10 +1,10 @@ { - "creation": "2013-06-07 12:27:07", + "creation": "2013-06-07 12:27:07.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Selling", "name": "Customers Not Buying Since Long Time", diff --git a/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.txt b/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.txt index 0e4551bad3..27bd1538de 100644 --- a/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.txt +++ b/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.txt @@ -1,12 +1,12 @@ { "add_total_row": 1, - "creation": "2013-05-23 17:42:24", + "creation": "2013-05-23 17:42:24.000000", "disabled": 0, "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Selling", "name": "Item-wise Sales History", diff --git a/erpnext/selling/report/lead_details/lead_details.txt b/erpnext/selling/report/lead_details/lead_details.txt index 4c1021f7d8..20c964b8ae 100644 --- a/erpnext/selling/report/lead_details/lead_details.txt +++ b/erpnext/selling/report/lead_details/lead_details.txt @@ -1,10 +1,10 @@ { - "creation": "2013-10-22 11:58:16", + "creation": "2013-10-22 11:58:16.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Selling", "name": "Lead Details", diff --git a/erpnext/selling/report/pending_so_items_for_purchase_request/pending_so_items_for_purchase_request.txt b/erpnext/selling/report/pending_so_items_for_purchase_request/pending_so_items_for_purchase_request.txt index 1c84245a7b..b3282b98a3 100644 --- a/erpnext/selling/report/pending_so_items_for_purchase_request/pending_so_items_for_purchase_request.txt +++ b/erpnext/selling/report/pending_so_items_for_purchase_request/pending_so_items_for_purchase_request.txt @@ -1,10 +1,10 @@ { - "creation": "2013-06-21 16:46:45", + "creation": "2013-06-21 16:46:45.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Selling", "name": "Pending SO Items For Purchase Request", diff --git a/erpnext/selling/report/quotation_trends/quotation_trends.txt b/erpnext/selling/report/quotation_trends/quotation_trends.txt index 0a1ca8a6bc..6be53acf47 100644 --- a/erpnext/selling/report/quotation_trends/quotation_trends.txt +++ b/erpnext/selling/report/quotation_trends/quotation_trends.txt @@ -1,11 +1,11 @@ { "add_total_row": 0, - "creation": "2013-06-07 16:01:16", + "creation": "2013-06-07 16:01:16.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Selling", "name": "Quotation Trends", diff --git a/erpnext/selling/report/sales_order_trends/sales_order_trends.txt b/erpnext/selling/report/sales_order_trends/sales_order_trends.txt index 9624889dbb..cb08af1c12 100644 --- a/erpnext/selling/report/sales_order_trends/sales_order_trends.txt +++ b/erpnext/selling/report/sales_order_trends/sales_order_trends.txt @@ -1,10 +1,10 @@ { - "creation": "2013-06-13 18:43:30", + "creation": "2013-06-13 18:43:30.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Selling", "name": "Sales Order Trends", diff --git a/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.txt b/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.txt index ed1f64e5b6..6c45ba9f8d 100644 --- a/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.txt +++ b/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.txt @@ -1,10 +1,10 @@ { - "creation": "2013-06-21 12:14:15", + "creation": "2013-06-21 12:14:15.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Selling", "name": "Sales Person Target Variance Item Group-Wise", diff --git a/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.txt b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.txt index 3b1b3f28e3..4ecba96f60 100644 --- a/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.txt +++ b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.txt @@ -1,11 +1,11 @@ { "add_total_row": 1, - "creation": "2013-05-03 11:31:05", + "creation": "2013-05-03 11:31:05.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Selling", "name": "Sales Person-wise Transaction Summary", diff --git a/erpnext/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.txt b/erpnext/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.txt index 321a5feb03..b03bb02399 100644 --- a/erpnext/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.txt +++ b/erpnext/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.txt @@ -1,10 +1,10 @@ { - "creation": "2013-06-21 12:15:00", + "creation": "2013-06-21 12:15:00.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Selling", "name": "Territory Target Variance Item Group-Wise", diff --git a/erpnext/setup/doctype/applicable_territory/applicable_territory.txt b/erpnext/setup/doctype/applicable_territory/applicable_territory.txt index 572015c43d..cc41933f23 100644 --- a/erpnext/setup/doctype/applicable_territory/applicable_territory.txt +++ b/erpnext/setup/doctype/applicable_territory/applicable_territory.txt @@ -1,5 +1,5 @@ { - "creation": "2013-06-20 12:48:38", + "creation": "2013-06-20 12:48:38.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -16,7 +16,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:22:53", + "modified": "2013-12-20 19:22:53.000000", "modified_by": "Administrator", "module": "Setup", "name": "Applicable Territory", diff --git a/erpnext/setup/doctype/authorization_control/authorization_control.txt b/erpnext/setup/doctype/authorization_control/authorization_control.txt index 66db33a91f..da35634292 100644 --- a/erpnext/setup/doctype/authorization_control/authorization_control.txt +++ b/erpnext/setup/doctype/authorization_control/authorization_control.txt @@ -1,10 +1,10 @@ { - "creation": "2012-03-27 14:36:18", + "creation": "2012-03-27 14:36:18.000000", "docstatus": 0, "doctype": "DocType", "idx": 1, "issingle": 1, - "modified": "2013-12-20 19:22:54", + "modified": "2013-12-20 19:22:54.000000", "modified_by": "Administrator", "module": "Setup", "name": "Authorization Control", diff --git a/erpnext/setup/doctype/authorization_rule/authorization_rule.txt b/erpnext/setup/doctype/authorization_rule/authorization_rule.txt index 5d88cb68ff..23c06005ce 100644 --- a/erpnext/setup/doctype/authorization_rule/authorization_rule.txt +++ b/erpnext/setup/doctype/authorization_rule/authorization_rule.txt @@ -1,7 +1,7 @@ { "allow_import": 1, "autoname": "AR.####", - "creation": "2013-01-10 16:34:22", + "creation": "2013-01-10 16:34:22.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Master", @@ -123,7 +123,7 @@ ], "icon": "icon-shield", "idx": 1, - "modified": "2014-01-20 17:48:25", + "modified": "2014-01-20 17:48:25.000000", "modified_by": "Administrator", "module": "Setup", "name": "Authorization Rule", diff --git a/erpnext/setup/doctype/backup_manager/backup_manager.txt b/erpnext/setup/doctype/backup_manager/backup_manager.txt index ddb7096de1..a82ab6515c 100644 --- a/erpnext/setup/doctype/backup_manager/backup_manager.txt +++ b/erpnext/setup/doctype/backup_manager/backup_manager.txt @@ -1,5 +1,5 @@ { - "creation": "2013-04-30 12:58:38", + "creation": "2013-04-30 12:58:38.000000", "description": "System for managing Backups", "docstatus": 0, "doctype": "DocType", @@ -140,7 +140,7 @@ "icon": "icon-cloud-upload", "idx": 1, "issingle": 1, - "modified": "2013-12-20 19:22:55", + "modified": "2013-12-20 19:22:55.000000", "modified_by": "Administrator", "module": "Setup", "name": "Backup Manager", diff --git a/erpnext/setup/doctype/brand/brand.txt b/erpnext/setup/doctype/brand/brand.txt index 7fa15c1810..493eb5b714 100644 --- a/erpnext/setup/doctype/brand/brand.txt +++ b/erpnext/setup/doctype/brand/brand.txt @@ -1,7 +1,7 @@ { "allow_import": 1, "autoname": "field:brand", - "creation": "2013-02-22 01:27:54", + "creation": "2013-02-22 01:27:54.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Master", @@ -30,7 +30,7 @@ "icon": "icon-certificate", "idx": 1, "in_dialog": 0, - "modified": "2014-01-20 17:48:27", + "modified": "2014-01-20 17:48:27.000000", "modified_by": "Administrator", "module": "Setup", "name": "Brand", diff --git a/erpnext/setup/doctype/company/company.txt b/erpnext/setup/doctype/company/company.txt index 5bd408e28d..555d0f131f 100644 --- a/erpnext/setup/doctype/company/company.txt +++ b/erpnext/setup/doctype/company/company.txt @@ -2,7 +2,7 @@ "allow_import": 1, "allow_rename": 1, "autoname": "field:company_name", - "creation": "2013-04-10 08:35:39", + "creation": "2013-04-10 08:35:39.000000", "description": "Legal Entity / Subsidiary with a separate Chart of Accounts belonging to the Organization.", "docstatus": 0, "doctype": "DocType", @@ -345,7 +345,7 @@ ], "icon": "icon-building", "idx": 1, - "modified": "2014-03-05 14:54:29", + "modified": "2014-03-05 14:54:29.000000", "modified_by": "Administrator", "module": "Setup", "name": "Company", diff --git a/erpnext/setup/doctype/contact_control/contact_control.txt b/erpnext/setup/doctype/contact_control/contact_control.txt index 7c6768a048..560aed5424 100644 --- a/erpnext/setup/doctype/contact_control/contact_control.txt +++ b/erpnext/setup/doctype/contact_control/contact_control.txt @@ -1,5 +1,5 @@ { - "creation": "2012-03-27 14:36:19", + "creation": "2012-03-27 14:36:19.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -28,7 +28,7 @@ "idx": 1, "in_create": 1, "issingle": 1, - "modified": "2013-12-20 19:23:02", + "modified": "2013-12-20 19:23:02.000000", "modified_by": "Administrator", "module": "Setup", "name": "Contact Control", diff --git a/erpnext/setup/doctype/country/country.txt b/erpnext/setup/doctype/country/country.txt index 1652d59491..487a160f75 100644 --- a/erpnext/setup/doctype/country/country.txt +++ b/erpnext/setup/doctype/country/country.txt @@ -1,7 +1,7 @@ { "allow_import": 1, "autoname": "field:country_name", - "creation": "2013-01-19 10:23:30", + "creation": "2013-01-19 10:23:30.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Master", @@ -37,7 +37,7 @@ "icon": "icon-globe", "idx": 1, "in_create": 0, - "modified": "2014-03-05 14:36:16", + "modified": "2014-03-05 14:36:16.000000", "modified_by": "Administrator", "module": "Setup", "name": "Country", diff --git a/erpnext/setup/doctype/currency/currency.txt b/erpnext/setup/doctype/currency/currency.txt index d3cbc279ab..6c66bca070 100644 --- a/erpnext/setup/doctype/currency/currency.txt +++ b/erpnext/setup/doctype/currency/currency.txt @@ -1,6 +1,6 @@ { "autoname": "field:currency_name", - "creation": "2013-01-28 10:06:02", + "creation": "2013-01-28 10:06:02.000000", "description": "**Currency** Master", "docstatus": 0, "doctype": "DocType", @@ -58,7 +58,7 @@ "icon": "icon-bitcoin", "idx": 1, "in_create": 0, - "modified": "2014-01-20 17:48:31", + "modified": "2014-01-20 17:48:31.000000", "modified_by": "Administrator", "module": "Setup", "name": "Currency", diff --git a/erpnext/setup/doctype/currency_exchange/currency_exchange.txt b/erpnext/setup/doctype/currency_exchange/currency_exchange.txt index 2172c13efe..7556968fe2 100644 --- a/erpnext/setup/doctype/currency_exchange/currency_exchange.txt +++ b/erpnext/setup/doctype/currency_exchange/currency_exchange.txt @@ -1,6 +1,6 @@ { "allow_import": 1, - "creation": "2013-06-20 15:40:29", + "creation": "2013-06-20 15:40:29.000000", "description": "Specify Exchange Rate to convert one currency into another", "docstatus": 0, "doctype": "DocType", @@ -32,7 +32,7 @@ ], "icon": "icon-exchange", "idx": 1, - "modified": "2014-01-20 17:48:31", + "modified": "2014-01-20 17:48:31.000000", "modified_by": "Administrator", "module": "Setup", "name": "Currency Exchange", diff --git a/erpnext/setup/doctype/customer_group/customer_group.txt b/erpnext/setup/doctype/customer_group/customer_group.txt index d26f8e50b1..e5ade41fbf 100644 --- a/erpnext/setup/doctype/customer_group/customer_group.txt +++ b/erpnext/setup/doctype/customer_group/customer_group.txt @@ -2,7 +2,7 @@ "allow_import": 1, "allow_rename": 1, "autoname": "field:customer_group_name", - "creation": "2013-01-10 16:34:23", + "creation": "2013-01-10 16:34:23.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Master", @@ -106,7 +106,7 @@ "icon": "icon-sitemap", "idx": 1, "in_create": 1, - "modified": "2014-01-20 17:48:33", + "modified": "2014-01-20 17:48:33.000000", "modified_by": "Administrator", "module": "Setup", "name": "Customer Group", diff --git a/erpnext/setup/doctype/email_digest/email_digest.txt b/erpnext/setup/doctype/email_digest/email_digest.txt index 55b334e17b..0ffc60d0b0 100644 --- a/erpnext/setup/doctype/email_digest/email_digest.txt +++ b/erpnext/setup/doctype/email_digest/email_digest.txt @@ -1,6 +1,6 @@ { "autoname": "Prompt", - "creation": "2013-02-21 14:15:31", + "creation": "2013-02-21 14:15:31.000000", "description": "Send regular summary reports via Email.", "docstatus": 0, "doctype": "DocType", @@ -319,7 +319,7 @@ ], "icon": "icon-envelope", "idx": 1, - "modified": "2014-03-19 11:39:27", + "modified": "2014-03-19 11:39:27.000000", "modified_by": "Administrator", "module": "Setup", "name": "Email Digest", diff --git a/erpnext/setup/doctype/features_setup/features_setup.txt b/erpnext/setup/doctype/features_setup/features_setup.txt index fd2db4e537..8122da0c1e 100644 --- a/erpnext/setup/doctype/features_setup/features_setup.txt +++ b/erpnext/setup/doctype/features_setup/features_setup.txt @@ -1,5 +1,5 @@ { - "creation": "2012-12-20 12:50:49", + "creation": "2012-12-20 12:50:49.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -208,7 +208,7 @@ "icon": "icon-glass", "idx": 1, "issingle": 1, - "modified": "2013-12-24 11:40:19", + "modified": "2013-12-24 11:40:19.000000", "modified_by": "Administrator", "module": "Setup", "name": "Features Setup", diff --git a/erpnext/setup/doctype/global_defaults/global_defaults.txt b/erpnext/setup/doctype/global_defaults/global_defaults.txt index adf82a533c..5a5f21e38a 100644 --- a/erpnext/setup/doctype/global_defaults/global_defaults.txt +++ b/erpnext/setup/doctype/global_defaults/global_defaults.txt @@ -1,6 +1,6 @@ { "allow_copy": 1, - "creation": "2013-05-02 17:53:24", + "creation": "2013-05-02 17:53:24.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -152,7 +152,7 @@ "idx": 1, "in_create": 1, "issingle": 1, - "modified": "2014-02-19 19:11:58", + "modified": "2014-02-19 19:11:58.000000", "modified_by": "Administrator", "module": "Setup", "name": "Global Defaults", diff --git a/erpnext/setup/doctype/item_group/item_group.txt b/erpnext/setup/doctype/item_group/item_group.txt index b463cb0ad1..592673edcb 100644 --- a/erpnext/setup/doctype/item_group/item_group.txt +++ b/erpnext/setup/doctype/item_group/item_group.txt @@ -3,7 +3,7 @@ "allow_import": 1, "allow_rename": 1, "autoname": "field:item_group_name", - "creation": "2013-03-28 10:35:29", + "creation": "2013-03-28 10:35:29.000000", "description": "Item Classification", "docstatus": 0, "doctype": "DocType", @@ -157,7 +157,7 @@ "in_create": 1, "issingle": 0, "max_attachments": 3, - "modified": "2014-02-20 18:29:57", + "modified": "2014-02-20 18:29:57.000000", "modified_by": "Administrator", "module": "Setup", "name": "Item Group", diff --git a/erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.txt b/erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.txt index 18f71febdf..e6fec9d61c 100644 --- a/erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.txt +++ b/erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.txt @@ -1,5 +1,5 @@ { - "creation": "2013-01-15 16:50:01", + "creation": "2013-01-15 16:50:01.000000", "description": "Email settings for jobs email id \"jobs@example.com\"", "docstatus": 0, "doctype": "DocType", @@ -54,7 +54,7 @@ "icon": "icon-cog", "idx": 1, "issingle": 1, - "modified": "2013-12-20 19:23:16", + "modified": "2013-12-20 19:23:16.000000", "modified_by": "Administrator", "module": "Setup", "name": "Jobs Email Settings", diff --git a/erpnext/setup/doctype/naming_series/naming_series.txt b/erpnext/setup/doctype/naming_series/naming_series.txt index 36b1184784..95faa48745 100644 --- a/erpnext/setup/doctype/naming_series/naming_series.txt +++ b/erpnext/setup/doctype/naming_series/naming_series.txt @@ -1,5 +1,5 @@ { - "creation": "2013-01-25 11:35:08", + "creation": "2013-01-25 11:35:08.000000", "description": "Set prefix for numbering series on your transactions", "docstatus": 0, "doctype": "DocType", @@ -76,7 +76,7 @@ "icon": "icon-sort-by-order", "idx": 1, "issingle": 1, - "modified": "2013-12-20 19:23:21", + "modified": "2013-12-20 19:23:21.000000", "modified_by": "Administrator", "module": "Setup", "name": "Naming Series", diff --git a/erpnext/setup/doctype/notification_control/notification_control.txt b/erpnext/setup/doctype/notification_control/notification_control.txt index 628db7714d..e6a6a7f36e 100644 --- a/erpnext/setup/doctype/notification_control/notification_control.txt +++ b/erpnext/setup/doctype/notification_control/notification_control.txt @@ -2,7 +2,7 @@ "allow_copy": 1, "allow_email": 1, "allow_print": 1, - "creation": "2012-07-12 23:29:45", + "creation": "2012-07-12 23:29:45.000000", "description": "Send automatic emails to Contacts on Submitting transactions.", "docstatus": 0, "doctype": "DocType", @@ -176,7 +176,7 @@ "icon": "icon-envelope", "idx": 1, "issingle": 1, - "modified": "2013-07-10 19:24:07", + "modified": "2013-07-10 19:24:07.000000", "modified_by": "Administrator", "module": "Setup", "name": "Notification Control", diff --git a/erpnext/setup/doctype/print_heading/print_heading.txt b/erpnext/setup/doctype/print_heading/print_heading.txt index 9724f6203e..fc558f2b7d 100644 --- a/erpnext/setup/doctype/print_heading/print_heading.txt +++ b/erpnext/setup/doctype/print_heading/print_heading.txt @@ -1,7 +1,7 @@ { "allow_import": 1, "autoname": "field:print_heading", - "creation": "2013-01-10 16:34:24", + "creation": "2013-01-10 16:34:24.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Master", @@ -37,7 +37,7 @@ ], "icon": "icon-font", "idx": 1, - "modified": "2014-01-20 17:49:01", + "modified": "2014-01-20 17:49:01.000000", "modified_by": "Administrator", "module": "Setup", "name": "Print Heading", diff --git a/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.txt b/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.txt index b27d349552..0d58279f12 100644 --- a/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.txt +++ b/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.txt @@ -1,7 +1,7 @@ { "allow_import": 1, "autoname": "field:order_lost_reason", - "creation": "2013-01-10 16:34:24", + "creation": "2013-01-10 16:34:24.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Master", @@ -27,7 +27,7 @@ ], "icon": "icon-flag", "idx": 1, - "modified": "2014-01-20 17:49:17", + "modified": "2014-01-20 17:49:17.000000", "modified_by": "Administrator", "module": "Setup", "name": "Quotation Lost Reason", diff --git a/erpnext/setup/doctype/sales_email_settings/sales_email_settings.txt b/erpnext/setup/doctype/sales_email_settings/sales_email_settings.txt index 4e0891e0d8..c19f2e2e22 100644 --- a/erpnext/setup/doctype/sales_email_settings/sales_email_settings.txt +++ b/erpnext/setup/doctype/sales_email_settings/sales_email_settings.txt @@ -1,5 +1,5 @@ { - "creation": "2013-01-16 10:25:26", + "creation": "2013-01-16 10:25:26.000000", "description": "Email settings to extract Leads from sales email id e.g. \"sales@example.com\"", "docstatus": 0, "doctype": "DocType", @@ -54,7 +54,7 @@ "icon": "icon-cog", "idx": 1, "issingle": 1, - "modified": "2013-12-20 19:21:38", + "modified": "2013-12-20 19:21:38.000000", "modified_by": "Administrator", "module": "Setup", "name": "Sales Email Settings", diff --git a/erpnext/setup/doctype/sales_partner/sales_partner.txt b/erpnext/setup/doctype/sales_partner/sales_partner.txt index 4563fe51e2..7bc0edd679 100644 --- a/erpnext/setup/doctype/sales_partner/sales_partner.txt +++ b/erpnext/setup/doctype/sales_partner/sales_partner.txt @@ -1,7 +1,7 @@ { "allow_import": 1, "autoname": "field:partner_name", - "creation": "2013-04-12 15:34:06", + "creation": "2013-04-12 15:34:06.000000", "description": "A third party distributor / dealer / commission agent / affiliate / reseller who sells the companies products for a commission.", "docstatus": 0, "doctype": "DocType", @@ -194,7 +194,7 @@ "icon": "icon-user", "idx": 1, "in_create": 0, - "modified": "2014-02-20 18:30:32", + "modified": "2014-02-20 18:30:32.000000", "modified_by": "Administrator", "module": "Setup", "name": "Sales Partner", diff --git a/erpnext/setup/doctype/sales_person/sales_person.txt b/erpnext/setup/doctype/sales_person/sales_person.txt index e321390793..55b32a283b 100644 --- a/erpnext/setup/doctype/sales_person/sales_person.txt +++ b/erpnext/setup/doctype/sales_person/sales_person.txt @@ -2,7 +2,7 @@ "allow_import": 1, "allow_rename": 1, "autoname": "field:sales_person_name", - "creation": "2013-01-10 16:34:24", + "creation": "2013-01-10 16:34:24.000000", "description": "All Sales Transactions can be tagged against multiple **Sales Persons** so that you can set and monitor targets.", "docstatus": 0, "doctype": "DocType", @@ -140,7 +140,7 @@ "icon": "icon-user", "idx": 1, "in_create": 1, - "modified": "2014-01-20 17:49:25", + "modified": "2014-01-20 17:49:25.000000", "modified_by": "Administrator", "module": "Setup", "name": "Sales Person", diff --git a/erpnext/setup/doctype/sms_parameter/sms_parameter.txt b/erpnext/setup/doctype/sms_parameter/sms_parameter.txt index 5c08bc0efc..cfa3d98498 100755 --- a/erpnext/setup/doctype/sms_parameter/sms_parameter.txt +++ b/erpnext/setup/doctype/sms_parameter/sms_parameter.txt @@ -1,5 +1,5 @@ { - "creation": "2013-02-22 01:27:58", + "creation": "2013-02-22 01:27:58.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -26,7 +26,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:21:47", + "modified": "2013-12-20 19:21:47.000000", "modified_by": "Administrator", "module": "Setup", "name": "SMS Parameter", diff --git a/erpnext/setup/doctype/sms_settings/sms_settings.txt b/erpnext/setup/doctype/sms_settings/sms_settings.txt index f8e49fe027..a966ddbd4c 100755 --- a/erpnext/setup/doctype/sms_settings/sms_settings.txt +++ b/erpnext/setup/doctype/sms_settings/sms_settings.txt @@ -2,7 +2,7 @@ "allow_copy": 1, "allow_email": 1, "allow_print": 1, - "creation": "2013-01-10 16:34:24", + "creation": "2013-01-10 16:34:24.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -55,7 +55,7 @@ "idx": 1, "in_create": 0, "issingle": 1, - "modified": "2013-09-10 17:20:25", + "modified": "2013-09-10 17:20:25.000000", "modified_by": "Administrator", "module": "Setup", "name": "SMS Settings", diff --git a/erpnext/setup/doctype/supplier_type/supplier_type.txt b/erpnext/setup/doctype/supplier_type/supplier_type.txt index aeb90c856b..03c8ece9e0 100644 --- a/erpnext/setup/doctype/supplier_type/supplier_type.txt +++ b/erpnext/setup/doctype/supplier_type/supplier_type.txt @@ -2,7 +2,7 @@ "allow_import": 1, "allow_rename": 1, "autoname": "field:supplier_type", - "creation": "2013-01-10 16:34:24", + "creation": "2013-01-10 16:34:24.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Master", @@ -28,7 +28,7 @@ ], "icon": "icon-flag", "idx": 1, - "modified": "2014-01-20 17:49:31", + "modified": "2014-01-20 17:49:31.000000", "modified_by": "Administrator", "module": "Setup", "name": "Supplier Type", diff --git a/erpnext/setup/doctype/target_detail/target_detail.txt b/erpnext/setup/doctype/target_detail/target_detail.txt index 55667c243f..a3df0e5690 100644 --- a/erpnext/setup/doctype/target_detail/target_detail.txt +++ b/erpnext/setup/doctype/target_detail/target_detail.txt @@ -1,5 +1,5 @@ { - "creation": "2013-02-22 01:27:58", + "creation": "2013-02-22 01:27:58.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -54,7 +54,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:21:51", + "modified": "2013-12-20 19:21:51.000000", "modified_by": "Administrator", "module": "Setup", "name": "Target Detail", diff --git a/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.txt b/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.txt index 4076ecd5a7..b43790bbee 100644 --- a/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.txt +++ b/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.txt @@ -2,7 +2,7 @@ "allow_import": 1, "allow_rename": 1, "autoname": "field:title", - "creation": "2013-01-10 16:34:24", + "creation": "2013-01-10 16:34:24.000000", "description": "Standard Terms and Conditions that can be added to Sales and Purchases.\n\nExamples:\n\n1. Validity of the offer.\n1. Payment Terms (In Advance, On Credit, part advance etc).\n1. What is extra (or payable by the Customer).\n1. Safety / usage warning.\n1. Warranty if any.\n1. Returns Policy.\n1. Terms of shipping, if applicable.\n1. Ways of addressing disputes, indemnity, liability, etc.\n1. Address and Contact of your Company.", "docstatus": 0, "doctype": "DocType", @@ -39,7 +39,7 @@ ], "icon": "icon-legal", "idx": 1, - "modified": "2014-01-20 17:49:33", + "modified": "2014-01-20 17:49:33.000000", "modified_by": "Administrator", "module": "Setup", "name": "Terms and Conditions", diff --git a/erpnext/setup/doctype/territory/territory.txt b/erpnext/setup/doctype/territory/territory.txt index a3ed0b2ecd..e3456e9322 100644 --- a/erpnext/setup/doctype/territory/territory.txt +++ b/erpnext/setup/doctype/territory/territory.txt @@ -2,7 +2,7 @@ "allow_import": 1, "allow_rename": 1, "autoname": "field:territory_name", - "creation": "2013-01-10 16:34:24", + "creation": "2013-01-10 16:34:24.000000", "description": "Classification of Customers by region", "docstatus": 0, "doctype": "DocType", @@ -141,7 +141,7 @@ "icon": "icon-map-marker", "idx": 1, "in_create": 1, - "modified": "2014-01-20 17:49:33", + "modified": "2014-01-20 17:49:33.000000", "modified_by": "Administrator", "module": "Setup", "name": "Territory", diff --git a/erpnext/setup/doctype/uom/uom.txt b/erpnext/setup/doctype/uom/uom.txt index ee075592ed..42e31eb1f1 100644 --- a/erpnext/setup/doctype/uom/uom.txt +++ b/erpnext/setup/doctype/uom/uom.txt @@ -1,7 +1,7 @@ { "allow_import": 1, "autoname": "field:uom_name", - "creation": "2013-01-10 16:34:24", + "creation": "2013-01-10 16:34:24.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Master", @@ -25,7 +25,7 @@ ], "icon": "icon-compass", "idx": 1, - "modified": "2014-01-20 17:49:34", + "modified": "2014-01-20 17:49:34.000000", "modified_by": "Administrator", "module": "Setup", "name": "UOM", diff --git a/erpnext/setup/doctype/website_item_group/website_item_group.txt b/erpnext/setup/doctype/website_item_group/website_item_group.txt index 6d3a801640..2f68e0a387 100644 --- a/erpnext/setup/doctype/website_item_group/website_item_group.txt +++ b/erpnext/setup/doctype/website_item_group/website_item_group.txt @@ -1,5 +1,5 @@ { - "creation": "2013-02-22 01:28:09", + "creation": "2013-02-22 01:28:09.000000", "description": "Cross Listing of Item in multiple groups", "docstatus": 0, "doctype": "DocType", @@ -18,7 +18,7 @@ ], "idx": 1, "istable": 1, - "modified": "2014-02-28 13:00:07", + "modified": "2014-02-28 13:00:07.000000", "modified_by": "Administrator", "module": "Setup", "name": "Website Item Group", diff --git a/erpnext/setup/page/setup_wizard/setup_wizard.txt b/erpnext/setup/page/setup_wizard/setup_wizard.txt index fcb8e380cd..e90c87c77c 100644 --- a/erpnext/setup/page/setup_wizard/setup_wizard.txt +++ b/erpnext/setup/page/setup_wizard/setup_wizard.txt @@ -1,9 +1,9 @@ { - "creation": "2013-10-04 13:49:33", + "creation": "2013-10-04 13:49:33.000000", "docstatus": 0, "doctype": "Page", "idx": 1, - "modified": "2013-10-04 13:49:33", + "modified": "2013-10-04 13:49:33.000000", "modified_by": "Administrator", "module": "Setup", "name": "setup-wizard", diff --git a/erpnext/stock/Print Format/Delivery Note Classic/Delivery Note Classic.txt b/erpnext/stock/Print Format/Delivery Note Classic/Delivery Note Classic.txt index 6eeef251ab..c0a198fa71 100644 --- a/erpnext/stock/Print Format/Delivery Note Classic/Delivery Note Classic.txt +++ b/erpnext/stock/Print Format/Delivery Note Classic/Delivery Note Classic.txt @@ -1,11 +1,11 @@ { - "creation": "2013-04-19 13:31:11", + "creation": "2013-04-19 13:31:11.000000", "doc_type": "Delivery Note", "docstatus": 0, "doctype": "Print Format", "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", "idx": 1, - "modified": "2014-02-11 17:36:51", + "modified": "2014-02-11 17:36:51.000000", "modified_by": "Administrator", "module": "Stock", "name": "Delivery Note Classic", diff --git a/erpnext/stock/Print Format/Delivery Note Modern/Delivery Note Modern.txt b/erpnext/stock/Print Format/Delivery Note Modern/Delivery Note Modern.txt index 907c3b5fb1..9a4999db86 100644 --- a/erpnext/stock/Print Format/Delivery Note Modern/Delivery Note Modern.txt +++ b/erpnext/stock/Print Format/Delivery Note Modern/Delivery Note Modern.txt @@ -1,11 +1,11 @@ { - "creation": "2013-04-19 13:31:11", + "creation": "2013-04-19 13:31:11.000000", "doc_type": "Delivery Note", "docstatus": 0, "doctype": "Print Format", "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", "idx": 1, - "modified": "2014-02-11 17:36:26", + "modified": "2014-02-11 17:36:26.000000", "modified_by": "Administrator", "module": "Stock", "name": "Delivery Note Modern", diff --git a/erpnext/stock/Print Format/Delivery Note Packing List Wise/Delivery Note Packing List Wise.txt b/erpnext/stock/Print Format/Delivery Note Packing List Wise/Delivery Note Packing List Wise.txt index b0976c2531..eb420341ea 100644 --- a/erpnext/stock/Print Format/Delivery Note Packing List Wise/Delivery Note Packing List Wise.txt +++ b/erpnext/stock/Print Format/Delivery Note Packing List Wise/Delivery Note Packing List Wise.txt @@ -1,10 +1,10 @@ { - "creation": "2011-08-23 16:49:40", + "creation": "2011-08-23 16:49:40.000000", "docstatus": 0, "doctype": "Print Format", "html": "\n\n\n\n\n\n\n\n\n\n", "idx": 1, - "modified": "2011-10-19 14:12:11", + "modified": "2011-10-19 14:12:11.000000", "modified_by": "Administrator", "module": "Stock", "name": "Delivery Note Packing List Wise", diff --git a/erpnext/stock/Print Format/Delivery Note Spartan/Delivery Note Spartan.txt b/erpnext/stock/Print Format/Delivery Note Spartan/Delivery Note Spartan.txt index 5e341f3f2c..626dcda0bc 100644 --- a/erpnext/stock/Print Format/Delivery Note Spartan/Delivery Note Spartan.txt +++ b/erpnext/stock/Print Format/Delivery Note Spartan/Delivery Note Spartan.txt @@ -1,11 +1,11 @@ { - "creation": "2013-04-19 13:31:11", + "creation": "2013-04-19 13:31:11.000000", "doc_type": "Delivery Note", "docstatus": 0, "doctype": "Print Format", "html": "\n\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n
\n", "idx": 1, - "modified": "2014-02-11 17:37:14", + "modified": "2014-02-11 17:37:14.000000", "modified_by": "Administrator", "module": "Stock", "name": "Delivery Note Spartan", diff --git a/erpnext/stock/doctype/batch/batch.txt b/erpnext/stock/doctype/batch/batch.txt index b5a1e64da3..df9c8c5d47 100644 --- a/erpnext/stock/doctype/batch/batch.txt +++ b/erpnext/stock/doctype/batch/batch.txt @@ -2,7 +2,7 @@ "allow_attach": 1, "allow_import": 1, "autoname": "field:batch_id", - "creation": "2013-03-05 14:50:38", + "creation": "2013-03-05 14:50:38.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Master", @@ -67,7 +67,7 @@ "icon": "icon-archive", "idx": 1, "max_attachments": 5, - "modified": "2014-01-20 17:48:24", + "modified": "2014-01-20 17:48:24.000000", "modified_by": "Administrator", "module": "Stock", "name": "Batch", diff --git a/erpnext/stock/doctype/bin/bin.txt b/erpnext/stock/doctype/bin/bin.txt index b2ce6e9580..03fa4bfe1b 100644 --- a/erpnext/stock/doctype/bin/bin.txt +++ b/erpnext/stock/doctype/bin/bin.txt @@ -1,6 +1,6 @@ { "autoname": "BIN/.#######", - "creation": "2013-01-10 16:34:25", + "creation": "2013-01-10 16:34:25.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -162,7 +162,7 @@ "hide_toolbar": 1, "idx": 1, "in_create": 1, - "modified": "2013-12-20 19:23:56", + "modified": "2013-12-20 19:23:56.000000", "modified_by": "Administrator", "module": "Stock", "name": "Bin", diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.txt b/erpnext/stock/doctype/delivery_note/delivery_note.txt index e4ad47d10e..2300f9a11b 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.txt +++ b/erpnext/stock/doctype/delivery_note/delivery_note.txt @@ -1,7 +1,7 @@ { "allow_attach": 1, "autoname": "naming_series:", - "creation": "2013-05-24 19:29:09", + "creation": "2013-05-24 19:29:09.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Transaction", @@ -999,7 +999,7 @@ "idx": 1, "in_create": 0, "is_submittable": 1, - "modified": "2014-01-28 18:51:42", + "modified": "2014-01-28 18:51:42.000000", "modified_by": "Administrator", "module": "Stock", "name": "Delivery Note", diff --git a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.txt b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.txt index e7be79f744..e093def886 100644 --- a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.txt +++ b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.txt @@ -1,6 +1,6 @@ { "autoname": "DND/.#######", - "creation": "2013-04-22 13:15:44", + "creation": "2013-04-22 13:15:44.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -437,7 +437,7 @@ ], "idx": 1, "istable": 1, - "modified": "2014-02-28 11:20:58", + "modified": "2014-02-28 11:20:58.000000", "modified_by": "Administrator", "module": "Stock", "name": "Delivery Note Item", diff --git a/erpnext/stock/doctype/item/item.txt b/erpnext/stock/doctype/item/item.txt index 7aac35c773..77c992a61f 100644 --- a/erpnext/stock/doctype/item/item.txt +++ b/erpnext/stock/doctype/item/item.txt @@ -3,7 +3,7 @@ "allow_import": 1, "allow_rename": 1, "autoname": "field:item_code", - "creation": "2013-05-03 10:45:46", + "creation": "2013-05-03 10:45:46.000000", "default_print_format": "Standard", "description": "A Product or a Service that is bought, sold or kept in stock.", "docstatus": 0, @@ -832,7 +832,7 @@ "icon": "icon-tag", "idx": 1, "max_attachments": 1, - "modified": "2014-03-13 15:54:09", + "modified": "2014-03-13 15:54:09.000000", "modified_by": "Administrator", "module": "Stock", "name": "Item", diff --git a/erpnext/stock/doctype/item_customer_detail/item_customer_detail.txt b/erpnext/stock/doctype/item_customer_detail/item_customer_detail.txt index b3a575371c..42b917bce7 100644 --- a/erpnext/stock/doctype/item_customer_detail/item_customer_detail.txt +++ b/erpnext/stock/doctype/item_customer_detail/item_customer_detail.txt @@ -1,6 +1,6 @@ { "autoname": "ITEMCUST/.#####", - "creation": "2013-03-08 15:37:16", + "creation": "2013-03-08 15:37:16.000000", "description": "For the convenience of customers, these codes can be used in print formats like Invoices and Delivery Notes", "docstatus": 0, "doctype": "DocType", @@ -38,7 +38,7 @@ "idx": 1, "in_create": 0, "istable": 1, - "modified": "2013-12-20 19:23:16", + "modified": "2013-12-20 19:23:16.000000", "modified_by": "Administrator", "module": "Stock", "name": "Item Customer Detail", diff --git a/erpnext/stock/doctype/item_price/item_price.txt b/erpnext/stock/doctype/item_price/item_price.txt index 8ff8b2e571..6b50349dc2 100644 --- a/erpnext/stock/doctype/item_price/item_price.txt +++ b/erpnext/stock/doctype/item_price/item_price.txt @@ -1,7 +1,7 @@ { "allow_import": 1, "autoname": "RFD/.#####", - "creation": "2013-05-02 16:29:48", + "creation": "2013-05-02 16:29:48.000000", "description": "Multiple Item prices.", "docstatus": 0, "doctype": "DocType", @@ -105,7 +105,7 @@ "idx": 1, "in_create": 0, "istable": 0, - "modified": "2014-02-10 17:27:32", + "modified": "2014-02-10 17:27:32.000000", "modified_by": "Administrator", "module": "Stock", "name": "Item Price", diff --git a/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.txt b/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.txt index 9f48329222..f7c35f2102 100644 --- a/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.txt +++ b/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.txt @@ -1,6 +1,6 @@ { "autoname": "IISD/.#####", - "creation": "2013-02-22 01:28:01", + "creation": "2013-02-22 01:28:01.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -30,7 +30,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:16", + "modified": "2013-12-20 19:23:16.000000", "modified_by": "Administrator", "module": "Stock", "name": "Item Quality Inspection Parameter", diff --git a/erpnext/stock/doctype/item_reorder/item_reorder.txt b/erpnext/stock/doctype/item_reorder/item_reorder.txt index d029e49d1e..bc96b4a923 100644 --- a/erpnext/stock/doctype/item_reorder/item_reorder.txt +++ b/erpnext/stock/doctype/item_reorder/item_reorder.txt @@ -1,6 +1,6 @@ { "autoname": "REORD-.#####", - "creation": "2013-03-07 11:42:59", + "creation": "2013-03-07 11:42:59.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -45,7 +45,7 @@ "idx": 1, "in_create": 1, "istable": 1, - "modified": "2013-12-20 19:23:16", + "modified": "2013-12-20 19:23:16.000000", "modified_by": "Administrator", "module": "Stock", "name": "Item Reorder", diff --git a/erpnext/stock/doctype/item_supplier/item_supplier.txt b/erpnext/stock/doctype/item_supplier/item_supplier.txt index 64d32d6888..e56f29e704 100644 --- a/erpnext/stock/doctype/item_supplier/item_supplier.txt +++ b/erpnext/stock/doctype/item_supplier/item_supplier.txt @@ -1,5 +1,5 @@ { - "creation": "2013-02-22 01:28:01", + "creation": "2013-02-22 01:28:01.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -23,7 +23,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:16", + "modified": "2013-12-20 19:23:16.000000", "modified_by": "Administrator", "module": "Stock", "name": "Item Supplier", diff --git a/erpnext/stock/doctype/item_tax/item_tax.txt b/erpnext/stock/doctype/item_tax/item_tax.txt index c2df3219f8..b2b9256422 100644 --- a/erpnext/stock/doctype/item_tax/item_tax.txt +++ b/erpnext/stock/doctype/item_tax/item_tax.txt @@ -1,5 +1,5 @@ { - "creation": "2013-02-22 01:28:01", + "creation": "2013-02-22 01:28:01.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -27,7 +27,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:16", + "modified": "2013-12-20 19:23:16.000000", "modified_by": "Administrator", "module": "Stock", "name": "Item Tax", diff --git a/erpnext/stock/doctype/item_website_specification/item_website_specification.txt b/erpnext/stock/doctype/item_website_specification/item_website_specification.txt index 87e5dd7e47..1cf2189dbd 100644 --- a/erpnext/stock/doctype/item_website_specification/item_website_specification.txt +++ b/erpnext/stock/doctype/item_website_specification/item_website_specification.txt @@ -1,5 +1,5 @@ { - "creation": "2013-02-22 01:28:01", + "creation": "2013-02-22 01:28:01.000000", "description": "Table for Item that will be shown in Web Site", "docstatus": 0, "doctype": "DocType", @@ -25,7 +25,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:16", + "modified": "2013-12-20 19:23:16.000000", "modified_by": "Administrator", "module": "Stock", "name": "Item Website Specification", diff --git a/erpnext/stock/doctype/landed_cost_item/landed_cost_item.txt b/erpnext/stock/doctype/landed_cost_item/landed_cost_item.txt index 0eab747d30..f761ebabb1 100644 --- a/erpnext/stock/doctype/landed_cost_item/landed_cost_item.txt +++ b/erpnext/stock/doctype/landed_cost_item/landed_cost_item.txt @@ -1,5 +1,5 @@ { - "creation": "2013-02-22 01:28:02", + "creation": "2013-02-22 01:28:02.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -49,7 +49,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:18", + "modified": "2013-12-20 19:23:18.000000", "modified_by": "Administrator", "module": "Stock", "name": "Landed Cost Item", diff --git a/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.txt b/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.txt index 904c20da89..b50c148292 100644 --- a/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.txt +++ b/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.txt @@ -1,5 +1,5 @@ { - "creation": "2013-02-22 01:28:02", + "creation": "2013-02-22 01:28:02.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -18,7 +18,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:18", + "modified": "2013-12-20 19:23:18.000000", "modified_by": "Administrator", "module": "Stock", "name": "Landed Cost Purchase Receipt", diff --git a/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.txt b/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.txt index 461c909065..59c9478125 100644 --- a/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.txt +++ b/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.txt @@ -1,5 +1,5 @@ { - "creation": "2013-01-22 16:50:39", + "creation": "2013-01-22 16:50:39.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -49,7 +49,7 @@ "icon": "icon-magic", "idx": 1, "issingle": 1, - "modified": "2013-12-20 19:23:18", + "modified": "2013-12-20 19:23:18.000000", "modified_by": "Administrator", "module": "Stock", "name": "Landed Cost Wizard", diff --git a/erpnext/stock/doctype/material_request/material_request.txt b/erpnext/stock/doctype/material_request/material_request.txt index efff22410b..7db60dd21c 100644 --- a/erpnext/stock/doctype/material_request/material_request.txt +++ b/erpnext/stock/doctype/material_request/material_request.txt @@ -2,7 +2,7 @@ "allow_attach": 1, "allow_import": 1, "autoname": "naming_series:", - "creation": "2013-03-07 14:48:38", + "creation": "2013-03-07 14:48:38.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -229,7 +229,7 @@ "icon": "icon-ticket", "idx": 1, "is_submittable": 1, - "modified": "2014-01-20 17:48:57", + "modified": "2014-01-20 17:48:57.000000", "modified_by": "Administrator", "module": "Stock", "name": "Material Request", diff --git a/erpnext/stock/doctype/material_request_item/material_request_item.txt b/erpnext/stock/doctype/material_request_item/material_request_item.txt index bd916a8783..bff669f5f7 100644 --- a/erpnext/stock/doctype/material_request_item/material_request_item.txt +++ b/erpnext/stock/doctype/material_request_item/material_request_item.txt @@ -1,6 +1,6 @@ { "autoname": "MREQD-.#####", - "creation": "2013-02-22 01:28:02", + "creation": "2013-02-22 01:28:02.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -232,7 +232,7 @@ ], "idx": 1, "istable": 1, - "modified": "2014-02-03 11:35:26", + "modified": "2014-02-03 11:35:26.000000", "modified_by": "Administrator", "module": "Stock", "name": "Material Request Item", diff --git a/erpnext/stock/doctype/packed_item/packed_item.txt b/erpnext/stock/doctype/packed_item/packed_item.txt index 57d32cdc69..6558efbafc 100644 --- a/erpnext/stock/doctype/packed_item/packed_item.txt +++ b/erpnext/stock/doctype/packed_item/packed_item.txt @@ -1,5 +1,5 @@ { - "creation": "2013-02-22 01:28:00", + "creation": "2013-02-22 01:28:00.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -149,7 +149,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:23", + "modified": "2013-12-20 19:23:23.000000", "modified_by": "Administrator", "module": "Stock", "name": "Packed Item", diff --git a/erpnext/stock/doctype/packing_slip/packing_slip.txt b/erpnext/stock/doctype/packing_slip/packing_slip.txt index 2cba25b18c..634f11f99a 100644 --- a/erpnext/stock/doctype/packing_slip/packing_slip.txt +++ b/erpnext/stock/doctype/packing_slip/packing_slip.txt @@ -1,6 +1,6 @@ { "autoname": "PS.#######", - "creation": "2013-04-11 15:32:24", + "creation": "2013-04-11 15:32:24.000000", "description": "Generate packing slips for packages to be delivered. Used to notify package number, package contents and its weight.", "docstatus": 0, "doctype": "DocType", @@ -177,7 +177,7 @@ "icon": "icon-suitcase", "idx": 1, "is_submittable": 1, - "modified": "2014-01-20 17:48:59", + "modified": "2014-01-20 17:48:59.000000", "modified_by": "Administrator", "module": "Stock", "name": "Packing Slip", diff --git a/erpnext/stock/doctype/packing_slip_item/packing_slip_item.txt b/erpnext/stock/doctype/packing_slip_item/packing_slip_item.txt index 8844754b56..9d5c1bb809 100644 --- a/erpnext/stock/doctype/packing_slip_item/packing_slip_item.txt +++ b/erpnext/stock/doctype/packing_slip_item/packing_slip_item.txt @@ -1,6 +1,6 @@ { "autoname": "PSD/.#######", - "creation": "2013-04-08 13:10:16", + "creation": "2013-04-08 13:10:16.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -89,7 +89,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:23", + "modified": "2013-12-20 19:23:23.000000", "modified_by": "Administrator", "module": "Stock", "name": "Packing Slip Item", diff --git a/erpnext/stock/doctype/price_list/price_list.txt b/erpnext/stock/doctype/price_list/price_list.txt index c22355a2d2..da69ff60c0 100644 --- a/erpnext/stock/doctype/price_list/price_list.txt +++ b/erpnext/stock/doctype/price_list/price_list.txt @@ -6,7 +6,7 @@ "allow_print": 1, "allow_rename": 1, "autoname": "field:price_list_name", - "creation": "2013-01-25 11:35:09", + "creation": "2013-01-25 11:35:09.000000", "description": "Price List Master", "docstatus": 0, "doctype": "DocType", @@ -75,7 +75,7 @@ "icon": "icon-tags", "idx": 1, "max_attachments": 1, - "modified": "2014-01-27 11:11:08", + "modified": "2014-01-27 11:11:08.000000", "modified_by": "Administrator", "module": "Stock", "name": "Price List", diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.txt b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.txt index 7d81392fe9..0d9e9e1d49 100755 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.txt +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.txt @@ -1,7 +1,7 @@ { "allow_attach": 1, "autoname": "naming_series:", - "creation": "2013-05-21 16:16:39", + "creation": "2013-05-21 16:16:39.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Transaction", @@ -782,7 +782,7 @@ "icon": "icon-truck", "idx": 1, "is_submittable": 1, - "modified": "2014-02-17 12:01:00", + "modified": "2014-02-17 12:01:00.000000", "modified_by": "Administrator", "module": "Stock", "name": "Purchase Receipt", diff --git a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt index f2c69e91c9..0c8100ce7d 100755 --- a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt +++ b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt @@ -1,6 +1,6 @@ { "autoname": "GRND/.#######", - "creation": "2013-05-24 19:29:10", + "creation": "2013-05-24 19:29:10.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -553,7 +553,7 @@ ], "idx": 1, "istable": 1, - "modified": "2014-02-28 11:27:09", + "modified": "2014-02-28 11:27:09.000000", "modified_by": "Administrator", "module": "Stock", "name": "Purchase Receipt Item", diff --git a/erpnext/stock/doctype/serial_no/serial_no.txt b/erpnext/stock/doctype/serial_no/serial_no.txt index cb1b5ad556..76955780c7 100644 --- a/erpnext/stock/doctype/serial_no/serial_no.txt +++ b/erpnext/stock/doctype/serial_no/serial_no.txt @@ -3,7 +3,7 @@ "allow_import": 1, "allow_rename": 1, "autoname": "field:serial_no", - "creation": "2013-05-16 10:59:15", + "creation": "2013-05-16 10:59:15.000000", "description": "Distinct unit of an Item", "docstatus": 0, "doctype": "DocType", @@ -418,7 +418,7 @@ "icon": "icon-barcode", "idx": 1, "in_create": 0, - "modified": "2014-01-20 17:49:26", + "modified": "2014-01-20 17:49:26.000000", "modified_by": "Administrator", "module": "Stock", "name": "Serial No", diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.txt b/erpnext/stock/doctype/stock_entry/stock_entry.txt index ef537e0353..f4a52de549 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.txt +++ b/erpnext/stock/doctype/stock_entry/stock_entry.txt @@ -4,7 +4,7 @@ "allow_import": 1, "allow_rename": 0, "autoname": "naming_series:", - "creation": "2013-04-09 11:43:55", + "creation": "2013-04-09 11:43:55.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -580,7 +580,7 @@ "is_submittable": 1, "issingle": 0, "max_attachments": 0, - "modified": "2014-02-26 10:59:19", + "modified": "2014-02-26 10:59:19.000000", "modified_by": "Administrator", "module": "Stock", "name": "Stock Entry", diff --git a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.txt b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.txt index b141aa4418..0bdc9a8e5e 100644 --- a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.txt +++ b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.txt @@ -1,6 +1,6 @@ { "autoname": "MTND/.######", - "creation": "2013-03-29 18:22:12", + "creation": "2013-03-29 18:22:12.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -300,7 +300,7 @@ ], "idx": 1, "istable": 1, - "modified": "2014-02-03 12:59:27", + "modified": "2014-02-03 12:59:27.000000", "modified_by": "Administrator", "module": "Stock", "name": "Stock Entry Detail", diff --git a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.txt b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.txt index 68fd18ce00..2f7628fc48 100644 --- a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.txt +++ b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.txt @@ -3,7 +3,7 @@ "allow_email": 1, "allow_print": 1, "autoname": "SLE/.########", - "creation": "2013-01-29 19:25:42", + "creation": "2013-01-29 19:25:42.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Other", @@ -259,7 +259,7 @@ "icon": "icon-list", "idx": 1, "in_create": 1, - "modified": "2013-11-03 14:11:43", + "modified": "2013-11-03 14:11:43.000000", "modified_by": "Administrator", "module": "Stock", "name": "Stock Ledger Entry", diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.txt b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.txt index 784f99ef83..772830f2b9 100644 --- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.txt +++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.txt @@ -2,7 +2,7 @@ "allow_attach": 0, "allow_copy": 1, "autoname": "SR/.######", - "creation": "2013-03-28 10:35:31", + "creation": "2013-03-28 10:35:31.000000", "description": "This tool helps you to update or fix the quantity and valuation of stock in the system. It is typically used to synchronise the system values and what actually exists in your warehouses.", "docstatus": 0, "doctype": "DocType", @@ -119,7 +119,7 @@ "idx": 1, "is_submittable": 1, "max_attachments": 1, - "modified": "2014-01-20 17:49:28", + "modified": "2014-01-20 17:49:28.000000", "modified_by": "Administrator", "module": "Stock", "name": "Stock Reconciliation", diff --git a/erpnext/stock/doctype/stock_settings/stock_settings.txt b/erpnext/stock/doctype/stock_settings/stock_settings.txt index 8f5fc03fe2..2879c4b102 100644 --- a/erpnext/stock/doctype/stock_settings/stock_settings.txt +++ b/erpnext/stock/doctype/stock_settings/stock_settings.txt @@ -1,5 +1,5 @@ { - "creation": "2013-06-24 16:37:54", + "creation": "2013-06-24 16:37:54.000000", "description": "Settings", "docstatus": 0, "doctype": "DocType", @@ -99,7 +99,7 @@ "icon": "icon-cog", "idx": 1, "issingle": 1, - "modified": "2014-02-19 19:02:23", + "modified": "2014-02-19 19:02:23.000000", "modified_by": "Administrator", "module": "Stock", "name": "Stock Settings", diff --git a/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.txt b/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.txt index 58142682b0..4a0a0ac1b7 100644 --- a/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.txt +++ b/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.txt @@ -1,5 +1,5 @@ { - "creation": "2013-01-10 16:34:30", + "creation": "2013-01-10 16:34:30.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -43,7 +43,7 @@ "idx": 1, "in_create": 0, "issingle": 1, - "modified": "2013-12-20 19:21:48", + "modified": "2013-12-20 19:21:48.000000", "modified_by": "Administrator", "module": "Stock", "name": "Stock UOM Replace Utility", diff --git a/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.txt b/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.txt index b64d0578fb..3c9c022bbe 100644 --- a/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.txt +++ b/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.txt @@ -1,6 +1,6 @@ { "autoname": "UCDD/.#####", - "creation": "2013-02-22 01:28:04", + "creation": "2013-02-22 01:28:04.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -26,7 +26,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:21:53", + "modified": "2013-12-20 19:21:53.000000", "modified_by": "Administrator", "module": "Stock", "name": "UOM Conversion Detail", diff --git a/erpnext/stock/doctype/warehouse/warehouse.txt b/erpnext/stock/doctype/warehouse/warehouse.txt index 1831f35bbb..52bb7e9e8f 100644 --- a/erpnext/stock/doctype/warehouse/warehouse.txt +++ b/erpnext/stock/doctype/warehouse/warehouse.txt @@ -1,7 +1,7 @@ { "allow_import": 1, "allow_rename": 1, - "creation": "2013-03-07 18:50:32", + "creation": "2013-03-07 18:50:32.000000", "description": "A logical Warehouse against which stock entries are made.", "docstatus": 0, "doctype": "DocType", @@ -150,7 +150,7 @@ ], "icon": "icon-building", "idx": 1, - "modified": "2014-03-13 16:26:29", + "modified": "2014-03-13 16:26:29.000000", "modified_by": "Administrator", "module": "Stock", "name": "Warehouse", diff --git a/erpnext/stock/doctype/warehouse_user/warehouse_user.txt b/erpnext/stock/doctype/warehouse_user/warehouse_user.txt index 8c34697968..6e797a1ede 100644 --- a/erpnext/stock/doctype/warehouse_user/warehouse_user.txt +++ b/erpnext/stock/doctype/warehouse_user/warehouse_user.txt @@ -1,5 +1,5 @@ { - "creation": "2013-02-22 01:28:05", + "creation": "2013-02-22 01:28:05.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Other", @@ -17,7 +17,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:21:54", + "modified": "2013-12-20 19:21:54.000000", "modified_by": "Administrator", "module": "Stock", "name": "Warehouse User", diff --git a/erpnext/stock/page/stock_ageing/stock_ageing.txt b/erpnext/stock/page/stock_ageing/stock_ageing.txt index 29d52ffd54..34c259e46d 100644 --- a/erpnext/stock/page/stock_ageing/stock_ageing.txt +++ b/erpnext/stock/page/stock_ageing/stock_ageing.txt @@ -1,10 +1,10 @@ { - "creation": "2012-09-21 20:15:14", + "creation": "2012-09-21 20:15:14.000000", "docstatus": 0, "doctype": "Page", "icon": "icon-table", "idx": 1, - "modified": "2013-07-11 14:44:08", + "modified": "2013-07-11 14:44:08.000000", "modified_by": "Administrator", "module": "Stock", "name": "stock-ageing", diff --git a/erpnext/stock/page/stock_analytics/stock_analytics.txt b/erpnext/stock/page/stock_analytics/stock_analytics.txt index f732a9a6c6..3b8380acc2 100644 --- a/erpnext/stock/page/stock_analytics/stock_analytics.txt +++ b/erpnext/stock/page/stock_analytics/stock_analytics.txt @@ -1,10 +1,10 @@ { - "creation": "2012-09-21 20:15:14", + "creation": "2012-09-21 20:15:14.000000", "docstatus": 0, "doctype": "Page", "icon": "icon-bar-chart", "idx": 1, - "modified": "2013-07-11 14:44:10", + "modified": "2013-07-11 14:44:10.000000", "modified_by": "Administrator", "module": "Stock", "name": "stock-analytics", diff --git a/erpnext/stock/page/stock_balance/stock_balance.txt b/erpnext/stock/page/stock_balance/stock_balance.txt index 4c99474daa..6f25be4407 100644 --- a/erpnext/stock/page/stock_balance/stock_balance.txt +++ b/erpnext/stock/page/stock_balance/stock_balance.txt @@ -1,10 +1,10 @@ { - "creation": "2012-12-27 18:57:47", + "creation": "2012-12-27 18:57:47.000000", "docstatus": 0, "doctype": "Page", "icon": "icon-table", "idx": 1, - "modified": "2013-07-11 14:44:15", + "modified": "2013-07-11 14:44:15.000000", "modified_by": "Administrator", "module": "Stock", "name": "stock-balance", diff --git a/erpnext/stock/page/stock_ledger/stock_ledger.txt b/erpnext/stock/page/stock_ledger/stock_ledger.txt index f031627a2c..e2bd8f7729 100644 --- a/erpnext/stock/page/stock_ledger/stock_ledger.txt +++ b/erpnext/stock/page/stock_ledger/stock_ledger.txt @@ -1,10 +1,10 @@ { - "creation": "2012-09-21 20:15:14", + "creation": "2012-09-21 20:15:14.000000", "docstatus": 0, "doctype": "Page", "icon": "icon-table", "idx": 1, - "modified": "2013-07-11 14:44:19", + "modified": "2013-07-11 14:44:19.000000", "modified_by": "Administrator", "module": "Stock", "name": "stock-ledger", diff --git a/erpnext/stock/page/stock_level/stock_level.txt b/erpnext/stock/page/stock_level/stock_level.txt index 2026d1dc40..c6f3f96d76 100644 --- a/erpnext/stock/page/stock_level/stock_level.txt +++ b/erpnext/stock/page/stock_level/stock_level.txt @@ -1,10 +1,10 @@ { - "creation": "2012-12-31 10:52:14", + "creation": "2012-12-31 10:52:14.000000", "docstatus": 0, "doctype": "Page", "icon": "icon-table", "idx": 1, - "modified": "2013-07-11 14:44:21", + "modified": "2013-07-11 14:44:21.000000", "modified_by": "Administrator", "module": "Stock", "name": "stock-level", diff --git a/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.txt b/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.txt index 6fdbf93afe..e79ca823e6 100644 --- a/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.txt +++ b/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.txt @@ -1,10 +1,10 @@ { - "creation": "2013-06-04 11:03:47", + "creation": "2013-06-04 11:03:47.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Stock", "name": "Batch-Wise Balance History", diff --git a/erpnext/stock/report/delivery_note_trends/delivery_note_trends.txt b/erpnext/stock/report/delivery_note_trends/delivery_note_trends.txt index 99c086d75d..ccedc4b255 100644 --- a/erpnext/stock/report/delivery_note_trends/delivery_note_trends.txt +++ b/erpnext/stock/report/delivery_note_trends/delivery_note_trends.txt @@ -1,10 +1,10 @@ { - "creation": "2013-06-13 18:42:11", + "creation": "2013-06-13 18:42:11.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Stock", "name": "Delivery Note Trends", diff --git a/erpnext/stock/report/item_prices/item_prices.txt b/erpnext/stock/report/item_prices/item_prices.txt index 8e62bcd2da..cf0dde26a4 100644 --- a/erpnext/stock/report/item_prices/item_prices.txt +++ b/erpnext/stock/report/item_prices/item_prices.txt @@ -1,10 +1,10 @@ { - "creation": "2013-06-05 11:43:30", + "creation": "2013-06-05 11:43:30.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Stock", "name": "Item Prices", diff --git a/erpnext/stock/report/item_shortage_report/item_shortage_report.txt b/erpnext/stock/report/item_shortage_report/item_shortage_report.txt index 4a505cc456..4af235a871 100644 --- a/erpnext/stock/report/item_shortage_report/item_shortage_report.txt +++ b/erpnext/stock/report/item_shortage_report/item_shortage_report.txt @@ -1,11 +1,11 @@ { - "creation": "2013-08-20 13:43:30", + "creation": "2013-08-20 13:43:30.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", "json": "{\"filters\":[[\"Bin\",\"projected_qty\",\"<\",\"0\"]],\"columns\":[[\"warehouse\",\"Bin\"],[\"item_code\",\"Bin\"],[\"actual_qty\",\"Bin\"],[\"ordered_qty\",\"Bin\"],[\"planned_qty\",\"Bin\"],[\"reserved_qty\",\"Bin\"],[\"projected_qty\",\"Bin\"]],\"sort_by\":\"Bin.projected_qty\",\"sort_order\":\"asc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Stock", "name": "Item Shortage Report", diff --git a/erpnext/stock/report/item_wise_price_list_rate/item_wise_price_list_rate.txt b/erpnext/stock/report/item_wise_price_list_rate/item_wise_price_list_rate.txt index 962db3747a..6d4b7f74df 100644 --- a/erpnext/stock/report/item_wise_price_list_rate/item_wise_price_list_rate.txt +++ b/erpnext/stock/report/item_wise_price_list_rate/item_wise_price_list_rate.txt @@ -1,11 +1,11 @@ { - "creation": "2013-09-25 10:21:15", + "creation": "2013-09-25 10:21:15.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", "json": "{\"filters\":[[\"Item Price\",\"price_list\",\"like\",\"%\"],[\"Item Price\",\"item_code\",\"like\",\"%\"]],\"columns\":[[\"name\",\"Item Price\"],[\"price_list\",\"Item Price\"],[\"item_code\",\"Item Price\"],[\"item_name\",\"Item Price\"],[\"item_description\",\"Item Price\"],[\"ref_rate\",\"Item Price\"],[\"buying\",\"Item Price\"],[\"selling\",\"Item Price\"],[\"currency\",\"Item Price\"]],\"sort_by\":\"Item Price.modified\",\"sort_order\":\"desc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Stock", "name": "Item-wise Price List Rate", diff --git a/erpnext/stock/report/items_to_be_requested/items_to_be_requested.txt b/erpnext/stock/report/items_to_be_requested/items_to_be_requested.txt index f392693c27..a975110e09 100644 --- a/erpnext/stock/report/items_to_be_requested/items_to_be_requested.txt +++ b/erpnext/stock/report/items_to_be_requested/items_to_be_requested.txt @@ -1,10 +1,10 @@ { - "creation": "2013-08-20 15:08:10", + "creation": "2013-08-20 15:08:10.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Stock", "name": "Items To Be Requested", diff --git a/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.txt b/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.txt index b7284223db..36cbcaa087 100644 --- a/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.txt +++ b/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.txt @@ -1,10 +1,10 @@ { - "creation": "2013-06-07 12:47:22", + "creation": "2013-06-07 12:47:22.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Stock", "name": "Itemwise Recommended Reorder Level", diff --git a/erpnext/stock/report/material_requests_for_which_supplier_quotations_are_not_created/material_requests_for_which_supplier_quotations_are_not_created.txt b/erpnext/stock/report/material_requests_for_which_supplier_quotations_are_not_created/material_requests_for_which_supplier_quotations_are_not_created.txt index af1a310b12..c79c0bc74b 100644 --- a/erpnext/stock/report/material_requests_for_which_supplier_quotations_are_not_created/material_requests_for_which_supplier_quotations_are_not_created.txt +++ b/erpnext/stock/report/material_requests_for_which_supplier_quotations_are_not_created/material_requests_for_which_supplier_quotations_are_not_created.txt @@ -1,10 +1,10 @@ { - "creation": "2013-08-09 12:20:58", + "creation": "2013-08-09 12:20:58.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Stock", "name": "Material Requests for which Supplier Quotations are not created", diff --git a/erpnext/stock/report/ordered_items_to_be_delivered/ordered_items_to_be_delivered.txt b/erpnext/stock/report/ordered_items_to_be_delivered/ordered_items_to_be_delivered.txt index a8f4cdf0eb..d37cdab410 100644 --- a/erpnext/stock/report/ordered_items_to_be_delivered/ordered_items_to_be_delivered.txt +++ b/erpnext/stock/report/ordered_items_to_be_delivered/ordered_items_to_be_delivered.txt @@ -1,10 +1,10 @@ { - "creation": "2013-02-22 18:01:55", + "creation": "2013-02-22 18:01:55.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Stock", "name": "Ordered Items To Be Delivered", diff --git a/erpnext/stock/report/purchase_in_transit/purchase_in_transit.txt b/erpnext/stock/report/purchase_in_transit/purchase_in_transit.txt index c88b366c03..f80538503b 100644 --- a/erpnext/stock/report/purchase_in_transit/purchase_in_transit.txt +++ b/erpnext/stock/report/purchase_in_transit/purchase_in_transit.txt @@ -1,10 +1,10 @@ { - "creation": "2013-05-06 12:09:05", + "creation": "2013-05-06 12:09:05.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Stock", "name": "Purchase In Transit", diff --git a/erpnext/stock/report/purchase_order_items_to_be_received/purchase_order_items_to_be_received.txt b/erpnext/stock/report/purchase_order_items_to_be_received/purchase_order_items_to_be_received.txt index 529544a210..3fb562f2b5 100644 --- a/erpnext/stock/report/purchase_order_items_to_be_received/purchase_order_items_to_be_received.txt +++ b/erpnext/stock/report/purchase_order_items_to_be_received/purchase_order_items_to_be_received.txt @@ -1,11 +1,11 @@ { "add_total_row": 1, - "creation": "2013-02-22 18:01:55", + "creation": "2013-02-22 18:01:55.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Stock", "name": "Purchase Order Items To Be Received", diff --git a/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.txt b/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.txt index da2dceaa05..cd564ef72a 100644 --- a/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.txt +++ b/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.txt @@ -1,10 +1,10 @@ { - "creation": "2013-06-13 18:45:44", + "creation": "2013-06-13 18:45:44.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Stock", "name": "Purchase Receipt Trends", diff --git a/erpnext/stock/report/requested_items_to_be_transferred/requested_items_to_be_transferred.txt b/erpnext/stock/report/requested_items_to_be_transferred/requested_items_to_be_transferred.txt index b69950788e..1f31d20132 100644 --- a/erpnext/stock/report/requested_items_to_be_transferred/requested_items_to_be_transferred.txt +++ b/erpnext/stock/report/requested_items_to_be_transferred/requested_items_to_be_transferred.txt @@ -1,11 +1,11 @@ { "add_total_row": 1, - "creation": "2013-05-13 16:23:05", + "creation": "2013-05-13 16:23:05.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Stock", "name": "Requested Items To Be Transferred", diff --git a/erpnext/stock/report/serial_no_service_contract_expiry/serial_no_service_contract_expiry.txt b/erpnext/stock/report/serial_no_service_contract_expiry/serial_no_service_contract_expiry.txt index b9718337dd..e47627ad5d 100644 --- a/erpnext/stock/report/serial_no_service_contract_expiry/serial_no_service_contract_expiry.txt +++ b/erpnext/stock/report/serial_no_service_contract_expiry/serial_no_service_contract_expiry.txt @@ -1,11 +1,11 @@ { - "creation": "2013-01-14 10:52:58", + "creation": "2013-01-14 10:52:58.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", "json": "{\"filters\":[[\"Serial No\",\"status\",\"=\",\"Delivered\"]],\"columns\":[[\"name\",\"Serial No\"],[\"item_code\",\"Serial No\"],[\"amc_expiry_date\",\"Serial No\"],[\"maintenance_status\",\"Serial No\"],[\"delivery_document_no\",\"Serial No\"],[\"customer\",\"Serial No\"],[\"customer_name\",\"Serial No\"],[\"item_name\",\"Serial No\"],[\"description\",\"Serial No\"],[\"item_group\",\"Serial No\"],[\"brand\",\"Serial No\"]],\"sort_by\":\"Serial No.amc_expiry_date\",\"sort_order\":\"asc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Stock", "name": "Serial No Service Contract Expiry", diff --git a/erpnext/stock/report/serial_no_status/serial_no_status.txt b/erpnext/stock/report/serial_no_status/serial_no_status.txt index 83bdcd6905..047259c6d1 100644 --- a/erpnext/stock/report/serial_no_status/serial_no_status.txt +++ b/erpnext/stock/report/serial_no_status/serial_no_status.txt @@ -1,11 +1,11 @@ { - "creation": "2013-01-14 10:52:58", + "creation": "2013-01-14 10:52:58.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", "json": "{\"filters\":[],\"columns\":[[\"name\",\"Serial No\"],[\"item_code\",\"Serial No\"],[\"warehouse\",\"Serial No\"],[\"status\",\"Serial No\"],[\"item_name\",\"Serial No\"],[\"description\",\"Serial No\"],[\"item_group\",\"Serial No\"],[\"brand\",\"Serial No\"],[\"purchase_document_no\",\"Serial No\"],[\"purchase_date\",\"Serial No\"],[\"customer\",\"Serial No\"],[\"customer_name\",\"Serial No\"],[\"purchase_rate\",\"Serial No\"],[\"delivery_document_no\",\"Serial No\"],[\"delivery_date\",\"Serial No\"],[\"supplier\",\"Serial No\"],[\"supplier_name\",\"Serial No\"]],\"sort_by\":\"Serial No.name\",\"sort_order\":\"desc\",\"sort_by_next\":\"\",\"sort_order_next\":\"desc\"}", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Stock", "name": "Serial No Status", diff --git a/erpnext/stock/report/serial_no_warranty_expiry/serial_no_warranty_expiry.txt b/erpnext/stock/report/serial_no_warranty_expiry/serial_no_warranty_expiry.txt index 4b9da02cb7..0e48a3c47d 100644 --- a/erpnext/stock/report/serial_no_warranty_expiry/serial_no_warranty_expiry.txt +++ b/erpnext/stock/report/serial_no_warranty_expiry/serial_no_warranty_expiry.txt @@ -1,11 +1,11 @@ { - "creation": "2013-01-14 10:52:58", + "creation": "2013-01-14 10:52:58.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", "json": "{\"filters\":[[\"Serial No\",\"status\",\"=\",\"Delivered\"]],\"columns\":[[\"name\",\"Serial No\"],[\"item_code\",\"Serial No\"],[\"warranty_expiry_date\",\"Serial No\"],[\"warranty_period\",\"Serial No\"],[\"maintenance_status\",\"Serial No\"],[\"purchase_document_no\",\"Serial No\"],[\"purchase_date\",\"Serial No\"],[\"supplier\",\"Serial No\"],[\"supplier_name\",\"Serial No\"],[\"delivery_document_no\",\"Serial No\"],[\"delivery_date\",\"Serial No\"],[\"customer\",\"Serial No\"],[\"customer_name\",\"Serial No\"],[\"item_name\",\"Serial No\"],[\"description\",\"Serial No\"],[\"item_group\",\"Serial No\"],[\"brand\",\"Serial No\"]],\"sort_by\":\"Serial No.warranty_expiry_date\",\"sort_order\":\"asc\",\"sort_by_next\":\"\",\"sort_order_next\":\"asc\"}", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Stock", "name": "Serial No Warranty Expiry", diff --git a/erpnext/stock/report/stock_ageing/stock_ageing.txt b/erpnext/stock/report/stock_ageing/stock_ageing.txt index bb594e6492..af8b9c37e4 100644 --- a/erpnext/stock/report/stock_ageing/stock_ageing.txt +++ b/erpnext/stock/report/stock_ageing/stock_ageing.txt @@ -1,10 +1,10 @@ { - "creation": "2013-12-02 17:09:31", + "creation": "2013-12-02 17:09:31.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Stock", "name": "Stock Ageing", diff --git a/erpnext/stock/report/stock_ledger/stock_ledger.txt b/erpnext/stock/report/stock_ledger/stock_ledger.txt index 96604cbcc6..da2056ef60 100644 --- a/erpnext/stock/report/stock_ledger/stock_ledger.txt +++ b/erpnext/stock/report/stock_ledger/stock_ledger.txt @@ -1,10 +1,10 @@ { - "creation": "2013-11-29 17:08:23", + "creation": "2013-11-29 17:08:23.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Stock", "name": "Stock Ledger", diff --git a/erpnext/stock/report/stock_projected_qty/stock_projected_qty.txt b/erpnext/stock/report/stock_projected_qty/stock_projected_qty.txt index db603d5b8c..2b6be03329 100644 --- a/erpnext/stock/report/stock_projected_qty/stock_projected_qty.txt +++ b/erpnext/stock/report/stock_projected_qty/stock_projected_qty.txt @@ -1,11 +1,11 @@ { "add_total_row": 1, - "creation": "2013-12-04 18:21:56", + "creation": "2013-12-04 18:21:56.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Stock", "name": "Stock Projected Qty", diff --git a/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.txt b/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.txt index a5ccf34fbb..ff495d94bf 100644 --- a/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.txt +++ b/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.txt @@ -1,11 +1,11 @@ { "add_total_row": 1, - "creation": "2013-11-29 15:45:39", + "creation": "2013-11-29 15:45:39.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Stock", "name": "Supplier-Wise Sales Analytics", diff --git a/erpnext/stock/report/warehouse_wise_stock_balance/warehouse_wise_stock_balance.txt b/erpnext/stock/report/warehouse_wise_stock_balance/warehouse_wise_stock_balance.txt index 09a3777be3..c91906f54e 100644 --- a/erpnext/stock/report/warehouse_wise_stock_balance/warehouse_wise_stock_balance.txt +++ b/erpnext/stock/report/warehouse_wise_stock_balance/warehouse_wise_stock_balance.txt @@ -1,10 +1,10 @@ { - "creation": "2013-06-05 11:00:31", + "creation": "2013-06-05 11:00:31.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:28", + "modified": "2014-03-07 15:30:28.000000", "modified_by": "Administrator", "module": "Stock", "name": "Warehouse-Wise Stock Balance", diff --git a/erpnext/support/doctype/customer_issue/customer_issue.txt b/erpnext/support/doctype/customer_issue/customer_issue.txt index b1d14c442c..1f357444ea 100644 --- a/erpnext/support/doctype/customer_issue/customer_issue.txt +++ b/erpnext/support/doctype/customer_issue/customer_issue.txt @@ -1,7 +1,7 @@ { "allow_import": 1, "autoname": "naming_series:", - "creation": "2013-01-10 16:34:30", + "creation": "2013-01-10 16:34:30.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -394,7 +394,7 @@ "icon": "icon-bug", "idx": 1, "is_submittable": 0, - "modified": "2014-01-20 17:48:35", + "modified": "2014-01-20 17:48:35.000000", "modified_by": "Administrator", "module": "Support", "name": "Customer Issue", diff --git a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.txt b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.txt index ac9d99778e..7035f43215 100644 --- a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.txt +++ b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.txt @@ -1,6 +1,6 @@ { "autoname": "MS.#####", - "creation": "2013-01-10 16:34:30", + "creation": "2013-01-10 16:34:30.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -218,7 +218,7 @@ "icon": "icon-calendar", "idx": 1, "is_submittable": 1, - "modified": "2014-01-20 17:48:56", + "modified": "2014-01-20 17:48:56.000000", "modified_by": "Administrator", "module": "Support", "name": "Maintenance Schedule", diff --git a/erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.txt b/erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.txt index 09098f028f..aee7274608 100644 --- a/erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.txt +++ b/erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.txt @@ -1,6 +1,6 @@ { "autoname": "MSD.#####", - "creation": "2013-02-22 01:28:05", + "creation": "2013-02-22 01:28:05.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -89,7 +89,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-31 12:13:38", + "modified": "2013-12-31 12:13:38.000000", "modified_by": "Administrator", "module": "Support", "name": "Maintenance Schedule Detail", diff --git a/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.txt b/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.txt index 076317a59f..38fa4b590c 100644 --- a/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.txt +++ b/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.txt @@ -1,6 +1,6 @@ { "autoname": "IMD.#####", - "creation": "2013-02-22 01:28:05", + "creation": "2013-02-22 01:28:05.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -133,7 +133,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-31 12:08:32", + "modified": "2013-12-31 12:08:32.000000", "modified_by": "Administrator", "module": "Support", "name": "Maintenance Schedule Item", diff --git a/erpnext/support/doctype/maintenance_visit/maintenance_visit.txt b/erpnext/support/doctype/maintenance_visit/maintenance_visit.txt index fde4bbd1db..7d93bba6c9 100644 --- a/erpnext/support/doctype/maintenance_visit/maintenance_visit.txt +++ b/erpnext/support/doctype/maintenance_visit/maintenance_visit.txt @@ -1,6 +1,6 @@ { "autoname": "MV.#####", - "creation": "2013-01-10 16:34:31", + "creation": "2013-01-10 16:34:31.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -277,7 +277,7 @@ "icon": "icon-file-text", "idx": 1, "is_submittable": 1, - "modified": "2014-01-20 17:48:57", + "modified": "2014-01-20 17:48:57.000000", "modified_by": "Administrator", "module": "Support", "name": "Maintenance Visit", diff --git a/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.txt b/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.txt index d0b6850d36..32e3769b7c 100644 --- a/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.txt +++ b/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.txt @@ -1,6 +1,6 @@ { "autoname": "MVD.#####", - "creation": "2013-02-22 01:28:06", + "creation": "2013-02-22 01:28:06.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -121,7 +121,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:20", + "modified": "2013-12-20 19:23:20.000000", "modified_by": "Administrator", "module": "Support", "name": "Maintenance Visit Purpose", diff --git a/erpnext/support/doctype/newsletter/newsletter.txt b/erpnext/support/doctype/newsletter/newsletter.txt index 1c762701ec..600ac3fad5 100644 --- a/erpnext/support/doctype/newsletter/newsletter.txt +++ b/erpnext/support/doctype/newsletter/newsletter.txt @@ -1,6 +1,6 @@ { "autoname": "naming_series:", - "creation": "2013-01-10 16:34:31", + "creation": "2013-01-10 16:34:31.000000", "description": "Create and Send Newsletters", "docstatus": 0, "doctype": "DocType", @@ -132,7 +132,7 @@ ], "icon": "icon-envelope", "idx": 1, - "modified": "2014-02-03 11:32:22", + "modified": "2014-02-03 11:32:22.000000", "modified_by": "Administrator", "module": "Support", "name": "Newsletter", diff --git a/erpnext/support/doctype/support_email_settings/support_email_settings.txt b/erpnext/support/doctype/support_email_settings/support_email_settings.txt index 2b90a8522c..dd45049d27 100644 --- a/erpnext/support/doctype/support_email_settings/support_email_settings.txt +++ b/erpnext/support/doctype/support_email_settings/support_email_settings.txt @@ -1,6 +1,6 @@ { "allow_copy": 1, - "creation": "2014-03-03 19:48:46", + "creation": "2014-03-03 19:48:46.000000", "description": "Email Settings for Outgoing and Incoming Emails.", "docstatus": 0, "doctype": "DocType", @@ -75,7 +75,7 @@ "idx": 1, "in_create": 1, "issingle": 1, - "modified": "2014-03-03 20:20:34", + "modified": "2014-03-03 20:20:34.000000", "modified_by": "Administrator", "module": "Support", "name": "Support Email Settings", diff --git a/erpnext/support/doctype/support_ticket/support_ticket.txt b/erpnext/support/doctype/support_ticket/support_ticket.txt index 7ffbbb81a9..1a2e856c54 100644 --- a/erpnext/support/doctype/support_ticket/support_ticket.txt +++ b/erpnext/support/doctype/support_ticket/support_ticket.txt @@ -1,7 +1,7 @@ { "allow_attach": 1, "autoname": "naming_series:", - "creation": "2013-02-01 10:36:25", + "creation": "2013-02-01 10:36:25.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -237,7 +237,7 @@ ], "icon": "icon-ticket", "idx": 1, - "modified": "2014-01-20 17:49:31", + "modified": "2014-01-20 17:49:31.000000", "modified_by": "Administrator", "module": "Support", "name": "Support Ticket", diff --git a/erpnext/support/page/support_analytics/support_analytics.txt b/erpnext/support/page/support_analytics/support_analytics.txt index 899f49cd8a..3d8b4860ce 100644 --- a/erpnext/support/page/support_analytics/support_analytics.txt +++ b/erpnext/support/page/support_analytics/support_analytics.txt @@ -1,10 +1,10 @@ { - "creation": "2013-01-04 15:31:45", + "creation": "2013-01-04 15:31:45.000000", "docstatus": 0, "doctype": "Page", "icon": "icon-bar-chart", "idx": 1, - "modified": "2013-07-11 14:44:24", + "modified": "2013-07-11 14:44:24.000000", "modified_by": "Administrator", "module": "Support", "name": "support-analytics", diff --git a/erpnext/support/report/maintenance_schedules/maintenance_schedules.txt b/erpnext/support/report/maintenance_schedules/maintenance_schedules.txt index b891aed97e..b8885d4764 100644 --- a/erpnext/support/report/maintenance_schedules/maintenance_schedules.txt +++ b/erpnext/support/report/maintenance_schedules/maintenance_schedules.txt @@ -1,10 +1,10 @@ { - "creation": "2013-05-06 14:25:21", + "creation": "2013-05-06 14:25:21.000000", "docstatus": 0, "doctype": "Report", "idx": 1, "is_standard": "Yes", - "modified": "2014-03-07 15:30:27", + "modified": "2014-03-07 15:30:27.000000", "modified_by": "Administrator", "module": "Support", "name": "Maintenance Schedules", diff --git a/erpnext/utilities/doctype/address/address.txt b/erpnext/utilities/doctype/address/address.txt index a958c578ef..e1532d681d 100644 --- a/erpnext/utilities/doctype/address/address.txt +++ b/erpnext/utilities/doctype/address/address.txt @@ -1,7 +1,7 @@ { "allow_import": 1, "allow_rename": 1, - "creation": "2013-01-10 16:34:32", + "creation": "2013-01-10 16:34:32.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Master", @@ -199,7 +199,7 @@ "icon": "icon-map-marker", "idx": 1, "in_dialog": 0, - "modified": "2014-01-27 11:19:06", + "modified": "2014-01-27 11:19:06.000000", "modified_by": "Administrator", "module": "Utilities", "name": "Address", diff --git a/erpnext/utilities/doctype/contact/contact.txt b/erpnext/utilities/doctype/contact/contact.txt index ab828f99e4..bf9f075d1f 100644 --- a/erpnext/utilities/doctype/contact/contact.txt +++ b/erpnext/utilities/doctype/contact/contact.txt @@ -1,7 +1,7 @@ { "allow_import": 1, "allow_rename": 1, - "creation": "2013-01-10 16:34:32", + "creation": "2013-01-10 16:34:32.000000", "docstatus": 0, "doctype": "DocType", "document_type": "Master", @@ -208,7 +208,7 @@ "idx": 1, "in_create": 0, "in_dialog": 0, - "modified": "2014-01-20 17:48:29", + "modified": "2014-01-20 17:48:29.000000", "modified_by": "Administrator", "module": "Utilities", "name": "Contact", diff --git a/erpnext/utilities/doctype/note/note.txt b/erpnext/utilities/doctype/note/note.txt index e281f6c336..9eab6a18ac 100644 --- a/erpnext/utilities/doctype/note/note.txt +++ b/erpnext/utilities/doctype/note/note.txt @@ -1,6 +1,6 @@ { "allow_rename": 1, - "creation": "2013-05-24 13:41:00", + "creation": "2013-05-24 13:41:00.000000", "description": "Note is a free page where users can share documents / notes", "docstatus": 0, "doctype": "DocType", @@ -46,7 +46,7 @@ ], "icon": "icon-file-text", "idx": 1, - "modified": "2014-01-22 16:05:35", + "modified": "2014-01-22 16:05:35.000000", "modified_by": "Administrator", "module": "Utilities", "name": "Note", diff --git a/erpnext/utilities/doctype/note_user/note_user.txt b/erpnext/utilities/doctype/note_user/note_user.txt index 09bfb69307..f72f1bd291 100644 --- a/erpnext/utilities/doctype/note_user/note_user.txt +++ b/erpnext/utilities/doctype/note_user/note_user.txt @@ -1,5 +1,5 @@ { - "creation": "2013-05-24 14:24:48", + "creation": "2013-05-24 14:24:48.000000", "description": "List of users who can edit a particular Note", "docstatus": 0, "doctype": "DocType", @@ -26,7 +26,7 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:23:23", + "modified": "2013-12-20 19:23:23.000000", "modified_by": "Administrator", "module": "Utilities", "name": "Note User", diff --git a/erpnext/utilities/doctype/rename_tool/rename_tool.txt b/erpnext/utilities/doctype/rename_tool/rename_tool.txt index 4c09d90f68..a7384ec59c 100644 --- a/erpnext/utilities/doctype/rename_tool/rename_tool.txt +++ b/erpnext/utilities/doctype/rename_tool/rename_tool.txt @@ -2,7 +2,7 @@ "allow_attach": 0, "allow_email": 1, "allow_print": 1, - "creation": "2012-12-03 10:25:59", + "creation": "2012-12-03 10:25:59.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -32,7 +32,7 @@ "idx": 1, "issingle": 1, "max_attachments": 1, - "modified": "2013-07-05 14:52:51", + "modified": "2013-07-05 14:52:51.000000", "modified_by": "Administrator", "module": "Utilities", "name": "Rename Tool", diff --git a/erpnext/utilities/doctype/sms_control/sms_control.txt b/erpnext/utilities/doctype/sms_control/sms_control.txt index 80c4ef2c4c..1c933f2765 100644 --- a/erpnext/utilities/doctype/sms_control/sms_control.txt +++ b/erpnext/utilities/doctype/sms_control/sms_control.txt @@ -1,12 +1,12 @@ { - "creation": "2013-01-10 16:34:32", + "creation": "2013-01-10 16:34:32.000000", "docstatus": 0, "doctype": "DocType", "icon": "icon-mobile-phone", "idx": 1, "in_create": 0, "issingle": 1, - "modified": "2013-12-20 19:21:47", + "modified": "2013-12-20 19:21:47.000000", "modified_by": "Administrator", "module": "Utilities", "name": "SMS Control", diff --git a/erpnext/utilities/doctype/sms_log/sms_log.txt b/erpnext/utilities/doctype/sms_log/sms_log.txt index a60eb1aff8..e3c7741676 100644 --- a/erpnext/utilities/doctype/sms_log/sms_log.txt +++ b/erpnext/utilities/doctype/sms_log/sms_log.txt @@ -1,6 +1,6 @@ { "autoname": "SMSLOG/.########", - "creation": "2012-03-27 14:36:47", + "creation": "2012-03-27 14:36:47.000000", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -55,7 +55,7 @@ ], "icon": "icon-mobile-phone", "idx": 1, - "modified": "2013-12-20 19:24:35", + "modified": "2013-12-20 19:24:35.000000", "modified_by": "Administrator", "module": "Utilities", "name": "SMS Log", From f78d1aee286416c47cea5ee18a63f7b4edfd3352 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 28 Mar 2014 13:55:00 +0530 Subject: [PATCH 07/42] Replaced doc, doc.fields frappe/frappe#478 --- erpnext/accounts/doctype/account/account.py | 84 ++--- .../accounts_settings/accounts_settings.py | 4 +- .../bank_reconciliation.py | 10 +- erpnext/accounts/doctype/c_form/c_form.py | 8 +- .../chart_of_accounts/chart_of_accounts.py | 8 +- .../chart_of_accounts/import_charts.py | 2 +- .../doctype/cost_center/cost_center.py | 30 +- .../doctype/fiscal_year/fiscal_year.py | 16 +- erpnext/accounts/doctype/gl_entry/gl_entry.py | 60 ++-- .../journal_voucher/journal_voucher.py | 136 ++++---- .../journal_voucher/test_journal_voucher.py | 18 +- .../payment_to_invoice_matching_tool.py | 34 +- .../period_closing_voucher.py | 16 +- .../test_period_closing_voucher.py | 2 +- .../doctype/pos_setting/pos_setting.py | 20 +- .../doctype/pricing_rule/pricing_rule.py | 8 +- .../doctype/pricing_rule/test_pricing_rule.py | 20 +- .../purchase_invoice/purchase_invoice.py | 112 +++---- .../purchase_invoice/test_purchase_invoice.py | 16 +- .../doctype/sales_invoice/sales_invoice.py | 270 ++++++++-------- .../sales_invoice/test_sales_invoice.py | 194 ++++++------ .../sales_taxes_and_charges_master.py | 4 +- .../doctype/shipping_rule/shipping_rule.py | 2 +- erpnext/accounts/party.py | 2 +- erpnext/accounts/utils.py | 18 +- .../buying_settings/buying_settings.py | 4 +- .../purchase_common/purchase_common.py | 10 +- .../doctype/purchase_order/purchase_order.py | 26 +- .../purchase_order/test_purchase_order.py | 26 +- .../quality_inspection/quality_inspection.py | 14 +- erpnext/buying/doctype/supplier/supplier.py | 30 +- .../supplier_quotation/supplier_quotation.py | 6 +- .../test_supplier_quotation.py | 6 +- erpnext/controllers/accounts_controller.py | 123 ++++---- erpnext/controllers/buying_controller.py | 80 ++--- erpnext/controllers/selling_controller.py | 96 +++--- erpnext/controllers/status_updater.py | 52 +-- erpnext/controllers/stock_controller.py | 40 +-- erpnext/hr/doctype/appraisal/appraisal.py | 18 +- .../appraisal_template/appraisal_template.py | 8 +- erpnext/hr/doctype/attendance/attendance.py | 24 +- erpnext/hr/doctype/employee/employee.py | 110 +++---- .../hr/doctype/expense_claim/expense_claim.py | 4 +- .../hr/doctype/holiday_list/holiday_list.py | 16 +- erpnext/hr/doctype/hr_settings/hr_settings.py | 6 +- .../job_applicant/get_job_applications.py | 8 +- .../leave_allocation/leave_allocation.py | 42 +-- .../leave_application/leave_application.py | 104 +++--- .../test_leave_application.py | 32 +- .../leave_block_list/leave_block_list.py | 2 +- .../leave_control_panel.py | 10 +- .../doctype/salary_manager/salary_manager.py | 32 +- erpnext/hr/doctype/salary_slip/salary_slip.py | 106 +++---- .../doctype/salary_slip/test_salary_slip.py | 18 +- .../salary_structure/salary_structure.py | 16 +- erpnext/manufacturing/doctype/bom/bom.py | 88 +++--- .../bom_replace_tool/bom_replace_tool.py | 8 +- .../production_order/production_order.py | 76 ++--- .../production_order/test_production_order.py | 20 +- .../production_planning_tool.py | 50 +-- .../doctype/workstation/workstation.py | 10 +- erpnext/patches/4_0/fix_contact_address.py | 2 +- erpnext/patches/4_0/split_email_settings.py | 4 +- erpnext/projects/doctype/project/project.py | 26 +- erpnext/projects/doctype/task/task.py | 22 +- erpnext/projects/doctype/time_log/time_log.py | 20 +- .../time_log_batch/test_time_log_batch.py | 10 +- .../doctype/time_log_batch/time_log_batch.py | 22 +- erpnext/selling/doctype/customer/customer.py | 50 +-- .../installation_note/installation_note.py | 4 +- erpnext/selling/doctype/lead/get_leads.py | 2 +- erpnext/selling/doctype/lead/lead.py | 46 +-- .../doctype/opportunity/opportunity.py | 42 +-- .../selling/doctype/quotation/quotation.py | 14 +- .../doctype/quotation/test_quotation.py | 6 +- .../selling/doctype/sales_bom/sales_bom.py | 4 +- .../doctype/sales_order/sales_order.py | 86 ++--- .../doctype/sales_order/test_sales_order.py | 30 +- .../selling_settings/selling_settings.py | 4 +- .../selling/doctype/sms_center/sms_center.py | 44 +-- .../authorization_control.py | 12 +- .../authorization_rule/authorization_rule.py | 52 +-- erpnext/setup/doctype/company/company.py | 296 +++++++++--------- .../currency_exchange/currency_exchange.py | 4 +- .../doctype/customer_group/customer_group.py | 14 +- .../doctype/email_digest/email_digest.py | 44 +-- .../doctype/features_setup/features_setup.py | 4 +- .../global_defaults/global_defaults.py | 20 +- .../setup/doctype/item_group/item_group.py | 10 +- .../doctype/item_group/test_item_group.py | 20 +- .../jobs_email_settings.py | 4 +- .../doctype/naming_series/naming_series.py | 30 +- .../notification_control.py | 6 +- .../sales_email_settings.py | 4 +- .../doctype/sales_partner/sales_partner.py | 6 +- .../doctype/sales_person/sales_person.py | 6 +- erpnext/setup/install.py | 8 +- .../setup/page/setup_wizard/setup_wizard.py | 40 +-- erpnext/startup/boot.py | 2 +- erpnext/stock/doctype/bin/bin.py | 34 +- .../doctype/delivery_note/delivery_note.py | 50 +-- .../delivery_note/test_delivery_note.py | 34 +- erpnext/stock/doctype/item/item.py | 104 +++--- erpnext/stock/doctype/item/test_item.py | 4 +- .../stock/doctype/item_price/item_price.py | 22 +- .../landed_cost_wizard/landed_cost_wizard.py | 2 +- .../material_request/material_request.py | 48 +-- .../material_request/test_material_request.py | 38 +-- .../stock/doctype/packed_item/packed_item.py | 2 +- .../doctype/packing_slip/packing_slip.py | 24 +- .../stock/doctype/price_list/price_list.py | 16 +- .../purchase_receipt/purchase_receipt.py | 34 +- .../purchase_receipt/test_purchase_receipt.py | 18 +- erpnext/stock/doctype/serial_no/serial_no.py | 130 ++++---- .../stock/doctype/serial_no/test_serial_no.py | 16 +- .../stock/doctype/stock_entry/stock_entry.py | 198 ++++++------ .../doctype/stock_entry/test_stock_entry.py | 156 ++++----- .../doctype/stock_ledger/stock_ledger.py | 2 +- .../stock_ledger_entry/stock_ledger_entry.py | 48 +-- .../stock_reconciliation.py | 42 +-- .../test_stock_reconciliation.py | 26 +- .../doctype/stock_settings/stock_settings.py | 8 +- .../stock_uom_replace_utility.py | 46 +-- erpnext/stock/doctype/warehouse/warehouse.py | 60 ++-- erpnext/stock/get_item_details.py | 6 +- erpnext/stock/stock_ledger.py | 2 +- erpnext/stock/utils.py | 2 +- .../doctype/customer_issue/customer_issue.py | 12 +- .../maintenance_schedule.py | 18 +- .../maintenance_visit/maintenance_visit.py | 10 +- .../support/doctype/newsletter/newsletter.py | 42 +-- .../doctype/newsletter/test_newsletter.py | 4 +- .../support_email_settings.py | 12 +- .../support_ticket/get_support_mails.py | 14 +- .../doctype/support_ticket/support_ticket.py | 36 +-- erpnext/utilities/cleanup_data.py | 4 +- erpnext/utilities/doctype/address/address.py | 26 +- erpnext/utilities/doctype/contact/contact.py | 42 +-- erpnext/utilities/doctype/note/note.py | 10 +- .../doctype/sms_control/sms_control.py | 6 +- erpnext/utilities/repost_stock.py | 10 +- erpnext/utilities/transaction_base.py | 34 +- 142 files changed, 2443 insertions(+), 2444 deletions(-) diff --git a/erpnext/accounts/doctype/account/account.py b/erpnext/accounts/doctype/account/account.py index 0c88aebd92..18ae244fd9 100644 --- a/erpnext/accounts/doctype/account/account.py +++ b/erpnext/accounts/doctype/account/account.py @@ -15,13 +15,13 @@ class Account(Document): nsm_parent_field = 'parent_account' def autoname(self): - self.doc.name = self.doc.account_name.strip() + ' - ' + \ - frappe.db.get_value("Company", self.doc.company, "abbr") + self.name = self.account_name.strip() + ' - ' + \ + frappe.db.get_value("Company", self.company, "abbr") def get_address(self): return { - 'address': frappe.db.get_value(self.doc.master_type, - self.doc.master_name, "address") + 'address': frappe.db.get_value(self.master_type, + self.master_name, "address") } def validate(self): @@ -33,54 +33,54 @@ class Account(Document): self.validate_warehouse_account() self.validate_frozen_accounts_modifier() - if not self.doc.parent_account: - self.doc.parent_account = '' + if not self.parent_account: + self.parent_account = '' def validate_master_name(self): """Remind to add master name""" - if self.doc.master_type in ('Customer', 'Supplier') or self.doc.account_type == "Warehouse": - if not self.doc.master_name: + if self.master_type in ('Customer', 'Supplier') or self.account_type == "Warehouse": + if not self.master_name: msgprint(_("Please enter Master Name once the account is created.")) - elif not frappe.db.exists(self.doc.master_type or self.doc.account_type, - self.doc.master_name): + elif not frappe.db.exists(self.master_type or self.account_type, + self.master_name): throw(_("Invalid Master Name")) def validate_parent(self): """Fetch Parent Details and validation for account not to be created under ledger""" - if self.doc.parent_account: + if self.parent_account: par = frappe.db.sql("""select name, group_or_ledger, report_type - from tabAccount where name =%s""", self.doc.parent_account, as_dict=1) + from tabAccount where name =%s""", self.parent_account, as_dict=1) if not par: throw(_("Parent account does not exists")) - elif par[0]["name"] == self.doc.name: + elif par[0]["name"] == self.name: throw(_("You can not assign itself as parent account")) elif par[0]["group_or_ledger"] != 'Group': throw(_("Parent account can not be a ledger")) if par[0]["report_type"]: - self.doc.report_type = par[0]["report_type"] + self.report_type = par[0]["report_type"] def validate_duplicate_account(self): - if self.doc.fields.get('__islocal') or not self.doc.name: - company_abbr = frappe.db.get_value("Company", self.doc.company, "abbr") + if self.get('__islocal') or not self.name: + company_abbr = frappe.db.get_value("Company", self.company, "abbr") if frappe.db.sql("""select name from tabAccount where name=%s""", - (self.doc.account_name + " - " + company_abbr)): + (self.account_name + " - " + company_abbr)): throw("{name}: {acc_name} {exist}, {rename}".format(**{ "name": _("Account Name"), - "acc_name": self.doc.account_name, + "acc_name": self.account_name, "exist": _("already exists"), "rename": _("please rename") })) def validate_root_details(self): #does not exists parent - if frappe.db.exists("Account", self.doc.name): - if not frappe.db.get_value("Account", self.doc.name, "parent_account"): + if frappe.db.exists("Account", self.name): + if not frappe.db.get_value("Account", self.name, "parent_account"): throw(_("Root cannot be edited.")) def validate_frozen_accounts_modifier(self): - old_value = frappe.db.get_value("Account", self.doc.name, "freeze_account") - if old_value and old_value != self.doc.freeze_account: + old_value = frappe.db.get_value("Account", self.name, "freeze_account") + if old_value and old_value != self.freeze_account: frozen_accounts_modifier = frappe.db.get_value( 'Accounts Settings', None, 'frozen_accounts_modifier') if not frozen_accounts_modifier or \ @@ -91,50 +91,50 @@ class Account(Document): if self.check_if_child_exists(): throw("{acc}: {account_name} {child}. {msg}".format(**{ "acc": _("Account"), - "account_name": self.doc.name, + "account_name": self.name, "child": _("has existing child"), "msg": _("You can not convert this account to ledger") })) elif self.check_gle_exists(): throw(_("Account with existing transaction can not be converted to ledger.")) else: - self.doc.group_or_ledger = 'Ledger' - self.doc.save() + self.group_or_ledger = 'Ledger' + self.save() return 1 def convert_ledger_to_group(self): if self.check_gle_exists(): throw(_("Account with existing transaction can not be converted to group.")) - elif self.doc.master_type or self.doc.account_type: + elif self.master_type or self.account_type: throw(_("Cannot covert to Group because Master Type or Account Type is selected.")) else: - self.doc.group_or_ledger = 'Group' - self.doc.save() + self.group_or_ledger = 'Group' + self.save() return 1 # Check if any previous balance exists def check_gle_exists(self): - return frappe.db.get_value("GL Entry", {"account": self.doc.name}) + return frappe.db.get_value("GL Entry", {"account": self.name}) def check_if_child_exists(self): return frappe.db.sql("""select name from `tabAccount` where parent_account = %s - and docstatus != 2""", self.doc.name) + and docstatus != 2""", self.name) def validate_mandatory(self): - if not self.doc.report_type: + if not self.report_type: throw(_("Report Type is mandatory")) def validate_warehouse_account(self): if not cint(frappe.defaults.get_global_default("auto_accounting_for_stock")): return - if self.doc.account_type == "Warehouse": - old_warehouse = cstr(frappe.db.get_value("Account", self.doc.name, "master_name")) - if old_warehouse != cstr(self.doc.master_name): + if self.account_type == "Warehouse": + old_warehouse = cstr(frappe.db.get_value("Account", self.name, "master_name")) + if old_warehouse != cstr(self.master_name): if old_warehouse: self.validate_warehouse(old_warehouse) - if self.doc.master_name: - self.validate_warehouse(self.doc.master_name) + if self.master_name: + self.validate_warehouse(self.master_name) else: throw(_("Master Name is mandatory if account type is Warehouse")) @@ -163,10 +163,10 @@ class Account(Document): credit_limit_from = 'Customer' cr_limit = frappe.db.sql("""select t1.credit_limit from tabCustomer t1, `tabAccount` t2 - where t2.name=%s and t1.name = t2.master_name""", self.doc.name) + where t2.name=%s and t1.name = t2.master_name""", self.name) credit_limit = cr_limit and flt(cr_limit[0][0]) or 0 if not credit_limit: - credit_limit = frappe.db.get_value('Company', self.doc.company, 'credit_limit') + credit_limit = frappe.db.get_value('Company', self.company, 'credit_limit') credit_limit_from = 'Company' # If outstanding greater than credit limit and not authorized person raise exception @@ -175,11 +175,11 @@ class Account(Document): throw("""Total Outstanding amount (%s) for %s can not be \ greater than credit limit (%s). To change your credit limit settings, \ please update in the %s master""" % (fmt_money(total_outstanding), - self.doc.name, fmt_money(credit_limit), credit_limit_from)) + self.name, fmt_money(credit_limit), credit_limit_from)) def validate_trash(self): """checks gl entries and if child exists""" - if not self.doc.parent_account: + if not self.parent_account: throw(_("Root account can not be deleted")) if self.check_gle_exists(): @@ -195,7 +195,7 @@ class Account(Document): def before_rename(self, old, new, merge=False): # Add company abbr if not provided from erpnext.setup.doctype.company.company import get_name_with_abbr - new_account = get_name_with_abbr(new, self.doc.company) + new_account = get_name_with_abbr(new, self.company) # Validate properties before merging if merge: @@ -205,7 +205,7 @@ class Account(Document): val = list(frappe.db.get_value("Account", new_account, ["group_or_ledger", "report_type", "company"])) - if val != [self.doc.group_or_ledger, self.doc.report_type, self.doc.company]: + if val != [self.group_or_ledger, self.report_type, self.company]: throw(_("""Merging is only possible if following \ properties are same in both records. Group or Ledger, Report Type, Company""")) diff --git a/erpnext/accounts/doctype/accounts_settings/accounts_settings.py b/erpnext/accounts/doctype/accounts_settings/accounts_settings.py index ab7e8ab286..0559559a20 100644 --- a/erpnext/accounts/doctype/accounts_settings/accounts_settings.py +++ b/erpnext/accounts/doctype/accounts_settings/accounts_settings.py @@ -13,9 +13,9 @@ from frappe.model.document import Document class AccountsSettings(Document): def on_update(self): - frappe.db.set_default("auto_accounting_for_stock", self.doc.auto_accounting_for_stock) + frappe.db.set_default("auto_accounting_for_stock", self.auto_accounting_for_stock) - if cint(self.doc.auto_accounting_for_stock): + if cint(self.auto_accounting_for_stock): # set default perpetual account in company for company in frappe.db.sql("select name from tabCompany"): frappe.bean("Company", company[0]).save() diff --git a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py index 5ad447cceb..d8edb20def 100644 --- a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py +++ b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py @@ -12,17 +12,17 @@ from frappe.model.document import Document class BankReconciliation(Document): def get_details(self): - if not (self.doc.bank_account and self.doc.from_date and self.doc.to_date): + if not (self.bank_account and self.from_date and self.to_date): msgprint("Bank Account, From Date and To Date are Mandatory") return - dl = frappe.db.sql("select t1.name, t1.cheque_no, t1.cheque_date, t2.debit, t2.credit, t1.posting_date, t2.against_account from `tabJournal Voucher` t1, `tabJournal Voucher Detail` t2 where t2.parent = t1.name and t2.account = %s and (clearance_date is null or clearance_date = '0000-00-00' or clearance_date = '') and t1.posting_date >= %s and t1.posting_date <= %s and t1.docstatus=1", (self.doc.bank_account, self.doc.from_date, self.doc.to_date)) + dl = frappe.db.sql("select t1.name, t1.cheque_no, t1.cheque_date, t2.debit, t2.credit, t1.posting_date, t2.against_account from `tabJournal Voucher` t1, `tabJournal Voucher Detail` t2 where t2.parent = t1.name and t2.account = %s and (clearance_date is null or clearance_date = '0000-00-00' or clearance_date = '') and t1.posting_date >= %s and t1.posting_date <= %s and t1.docstatus=1", (self.bank_account, self.from_date, self.to_date)) self.set('entries', []) - self.doc.total_amount = 0.0 + self.total_amount = 0.0 for d in dl: - nl = self.doc.append('entries', {}) + nl = self.append('entries', {}) nl.posting_date = cstr(d[5]) nl.voucher_id = cstr(d[0]) nl.cheque_number = cstr(d[1]) @@ -30,7 +30,7 @@ class BankReconciliation(Document): nl.debit = flt(d[3]) nl.credit = flt(d[4]) nl.against_account = cstr(d[6]) - self.doc.total_amount += flt(flt(d[4]) - flt(d[3])) + self.total_amount += flt(flt(d[4]) - flt(d[3])) def update_details(self): vouchers = [] diff --git a/erpnext/accounts/doctype/c_form/c_form.py b/erpnext/accounts/doctype/c_form/c_form.py index b832554164..48c952f16a 100644 --- a/erpnext/accounts/doctype/c_form/c_form.py +++ b/erpnext/accounts/doctype/c_form/c_form.py @@ -28,7 +28,7 @@ class CForm(Document): frappe.msgprint("C-form is not applicable for Invoice: %s" % d.invoice_no, raise_exception=1) - elif inv[0][1] and inv[0][1] != self.doc.name: + elif inv[0][1] and inv[0][1] != self.name: frappe.msgprint("""Invoice %s is tagged in another C-form: %s. If you want to change C-form no for this invoice, please remove invoice no from the previous c-form and then try again""" % @@ -44,19 +44,19 @@ class CForm(Document): def before_cancel(self): # remove cform reference frappe.db.sql("""update `tabSales Invoice` set c_form_no=null - where c_form_no=%s""", self.doc.name) + where c_form_no=%s""", self.name) def set_cform_in_sales_invoices(self): inv = [d.invoice_no for d in self.get('invoice_details')] if inv: frappe.db.sql("""update `tabSales Invoice` set c_form_no=%s, modified=%s where name in (%s)""" % ('%s', '%s', ', '.join(['%s'] * len(inv))), - tuple([self.doc.name, self.doc.modified] + inv)) + tuple([self.name, self.modified] + inv)) frappe.db.sql("""update `tabSales Invoice` set c_form_no = null, modified = %s where name not in (%s) and ifnull(c_form_no, '') = %s""" % ('%s', ', '.join(['%s']*len(inv)), '%s'), - tuple([self.doc.modified] + inv + [self.doc.name])) + tuple([self.modified] + inv + [self.name])) else: frappe.msgprint("Please enter atleast 1 invoice in the table", raise_exception=1) diff --git a/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.py b/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.py index 3b377fc54f..536b1998c3 100644 --- a/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.py +++ b/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.py @@ -15,7 +15,7 @@ class ChartOfAccounts(Document): def create_accounts(self, company): chart = {} with open(os.path.join(os.path.dirname(__file__), "charts", - self.doc.source_file), "r") as f: + self.source_file), "r") as f: chart = json.loads(f.read()) from erpnext.accounts.doctype.chart_of_accounts.charts.account_properties \ @@ -49,15 +49,15 @@ class ChartOfAccounts(Document): accounts.append(account_name_in_db) # set report_type for all parents where blank - if not account.doc.report_type or account.doc.report_type == 'None': + if not account.report_type or account.report_type == 'None': self.no_report_type = True elif self.no_report_type: frappe.db.sql("""update tabAccount set report_type=%s where lft<=%s and rgt>=%s and ifnull(report_type, '')=''""", - (account.doc.report_type, account.doc.lft, account.doc.rgt)) + (account.report_type, account.lft, account.rgt)) if child.get("children"): - _import_accounts(child.get("children"), account.doc.name) + _import_accounts(child.get("children"), account.name) _import_accounts(chart.get("root").get("children"), None) diff --git a/erpnext/accounts/doctype/chart_of_accounts/import_charts.py b/erpnext/accounts/doctype/chart_of_accounts/import_charts.py index f95a4ed5fc..1d34ab2be0 100644 --- a/erpnext/accounts/doctype/chart_of_accounts/import_charts.py +++ b/erpnext/accounts/doctype/chart_of_accounts/import_charts.py @@ -19,7 +19,7 @@ def import_charts(): "source_file": fname, "country": country }).insert() - print bean.doc.name.encode("utf-8") + print bean.name.encode("utf-8") else: print "No chart for: " + chart.get("name").encode("utf-8") diff --git a/erpnext/accounts/doctype/cost_center/cost_center.py b/erpnext/accounts/doctype/cost_center/cost_center.py index 720b0bab19..79bd1213bf 100644 --- a/erpnext/accounts/doctype/cost_center/cost_center.py +++ b/erpnext/accounts/doctype/cost_center/cost_center.py @@ -14,47 +14,47 @@ class CostCenter(DocTypeNestedSet): def autoname(self): company_abbr = frappe.db.sql("select abbr from tabCompany where name=%s", - self.doc.company)[0][0] - self.doc.name = self.doc.cost_center_name.strip() + ' - ' + company_abbr + self.company)[0][0] + self.name = self.cost_center_name.strip() + ' - ' + company_abbr def validate_mandatory(self): - if not self.doc.group_or_ledger: + if not self.group_or_ledger: msgprint("Please select Group or Ledger value", raise_exception=1) - if self.doc.cost_center_name != self.doc.company and not self.doc.parent_cost_center: + if self.cost_center_name != self.company and not self.parent_cost_center: msgprint("Please enter parent cost center", raise_exception=1) - elif self.doc.cost_center_name == self.doc.company and self.doc.parent_cost_center: + elif self.cost_center_name == self.company and self.parent_cost_center: msgprint(_("Root cannot have a parent cost center"), raise_exception=1) def convert_group_to_ledger(self): if self.check_if_child_exists(): - msgprint("Cost Center: %s has existing child. You can not convert this cost center to ledger" % (self.doc.name), raise_exception=1) + msgprint("Cost Center: %s has existing child. You can not convert this cost center to ledger" % (self.name), raise_exception=1) elif self.check_gle_exists(): msgprint("Cost Center with existing transaction can not be converted to ledger.", raise_exception=1) else: - self.doc.group_or_ledger = 'Ledger' - self.doc.save() + self.group_or_ledger = 'Ledger' + self.save() return 1 def convert_ledger_to_group(self): if self.check_gle_exists(): msgprint("Cost Center with existing transaction can not be converted to group.", raise_exception=1) else: - self.doc.group_or_ledger = 'Group' - self.doc.save() + self.group_or_ledger = 'Group' + self.save() return 1 def check_gle_exists(self): - return frappe.db.get_value("GL Entry", {"cost_center": self.doc.name}) + return frappe.db.get_value("GL Entry", {"cost_center": self.name}) def check_if_child_exists(self): return frappe.db.sql("select name from `tabCost Center` where \ - parent_cost_center = %s and docstatus != 2", self.doc.name) + parent_cost_center = %s and docstatus != 2", self.name) def validate_budget_details(self): check_acc_list = [] for d in self.get('budget_details'): - if self.doc.group_or_ledger=="Group": + if self.group_or_ledger=="Group": msgprint("Budget cannot be set for Group Cost Centers", raise_exception=1) if [d.account, d.fiscal_year] in check_acc_list: @@ -66,7 +66,7 @@ class CostCenter(DocTypeNestedSet): """ Cost Center name must be unique """ - if (self.doc.fields.get("__islocal") or not self.doc.name) and frappe.db.sql("select name from `tabCost Center` where cost_center_name = %s and company=%s", (self.doc.cost_center_name, self.doc.company)): + if (self.get("__islocal") or not self.name) and frappe.db.sql("select name from `tabCost Center` where cost_center_name = %s and company=%s", (self.cost_center_name, self.company)): msgprint("Cost Center Name already exists, please rename", raise_exception=1) self.validate_mandatory() @@ -75,7 +75,7 @@ class CostCenter(DocTypeNestedSet): def before_rename(self, olddn, newdn, merge=False): # Add company abbr if not provided from erpnext.setup.doctype.company.company import get_name_with_abbr - new_cost_center = get_name_with_abbr(newdn, self.doc.company) + new_cost_center = get_name_with_abbr(newdn, self.company) # Validate properties before merging super(DocType, self).before_rename(olddn, new_cost_center, merge, "group_or_ledger") diff --git a/erpnext/accounts/doctype/fiscal_year/fiscal_year.py b/erpnext/accounts/doctype/fiscal_year/fiscal_year.py index 34110d3386..aa393e0a1a 100644 --- a/erpnext/accounts/doctype/fiscal_year/fiscal_year.py +++ b/erpnext/accounts/doctype/fiscal_year/fiscal_year.py @@ -11,35 +11,35 @@ from frappe.model.document import Document class FiscalYear(Document): def set_as_default(self): - frappe.db.set_value("Global Defaults", None, "current_fiscal_year", self.doc.name) + frappe.db.set_value("Global Defaults", None, "current_fiscal_year", self.name) frappe.get_obj("Global Defaults").on_update() # clear cache frappe.clear_cache() - msgprint(self.doc.name + _(""" is now the default Fiscal Year. \ + msgprint(self.name + _(""" is now the default Fiscal Year. \ Please refresh your browser for the change to take effect.""")) def validate(self): year_start_end_dates = frappe.db.sql("""select year_start_date, year_end_date - from `tabFiscal Year` where name=%s""", (self.doc.name)) + from `tabFiscal Year` where name=%s""", (self.name)) if year_start_end_dates: - if getdate(self.doc.year_start_date) != year_start_end_dates[0][0] or getdate(self.doc.year_end_date) != year_start_end_dates[0][1]: + if getdate(self.year_start_date) != year_start_end_dates[0][0] or getdate(self.year_end_date) != year_start_end_dates[0][1]: frappe.throw(_("Cannot change Year Start Date and Year End Date once the Fiscal Year is saved.")) def on_update(self): # validate year start date and year end date - if getdate(self.doc.year_start_date) > getdate(self.doc.year_end_date): + if getdate(self.year_start_date) > getdate(self.year_end_date): frappe.throw(_("Year Start Date should not be greater than Year End Date")) - if (getdate(self.doc.year_end_date) - getdate(self.doc.year_start_date)).days > 366: + if (getdate(self.year_end_date) - getdate(self.year_start_date)).days > 366: frappe.throw(_("Year Start Date and Year End Date are not within Fiscal Year.")) year_start_end_dates = frappe.db.sql("""select name, year_start_date, year_end_date - from `tabFiscal Year` where name!=%s""", (self.doc.name)) + from `tabFiscal Year` where name!=%s""", (self.name)) for fiscal_year, ysd, yed in year_start_end_dates: - if (getdate(self.doc.year_start_date) == ysd and getdate(self.doc.year_end_date) == yed) \ + if (getdate(self.year_start_date) == ysd and getdate(self.year_end_date) == yed) \ and (not frappe.flags.in_test): frappe.throw(_("Year Start Date and Year End Date are already set in Fiscal Year: ") + fiscal_year) \ No newline at end of file diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.py b/erpnext/accounts/doctype/gl_entry/gl_entry.py index b6a52953c5..b7266825d0 100644 --- a/erpnext/accounts/doctype/gl_entry/gl_entry.py +++ b/erpnext/accounts/doctype/gl_entry/gl_entry.py @@ -20,42 +20,42 @@ class GlEntry(Document): def on_update_with_args(self, adv_adj, update_outstanding = 'Yes'): self.validate_account_details(adv_adj) - validate_frozen_account(self.doc.account, adv_adj) - check_freezing_date(self.doc.posting_date, adv_adj) - validate_balance_type(self.doc.account, adv_adj) + validate_frozen_account(self.account, adv_adj) + check_freezing_date(self.posting_date, adv_adj) + validate_balance_type(self.account, adv_adj) # Update outstanding amt on against voucher - if self.doc.against_voucher and self.doc.against_voucher_type != "POS" \ + if self.against_voucher and self.against_voucher_type != "POS" \ and update_outstanding == 'Yes': - update_outstanding_amt(self.doc.account, self.doc.against_voucher_type, - self.doc.against_voucher) + update_outstanding_amt(self.account, self.against_voucher_type, + self.against_voucher) def check_mandatory(self): mandatory = ['account','remarks','voucher_type','voucher_no','fiscal_year','company'] for k in mandatory: - if not self.doc.fields.get(k): + if not self.get(k): frappe.throw(k + _(" is mandatory for GL Entry")) # Zero value transaction is not allowed - if not (flt(self.doc.debit) or flt(self.doc.credit)): + if not (flt(self.debit) or flt(self.credit)): frappe.throw(_("GL Entry: Debit or Credit amount is mandatory for ") + - self.doc.account) + self.account) def pl_must_have_cost_center(self): - if frappe.db.get_value("Account", self.doc.account, "report_type") == "Profit and Loss": - if not self.doc.cost_center and self.doc.voucher_type != 'Period Closing Voucher': + if frappe.db.get_value("Account", self.account, "report_type") == "Profit and Loss": + if not self.cost_center and self.voucher_type != 'Period Closing Voucher': frappe.throw(_("Cost Center must be specified for Profit and Loss type account: ") - + self.doc.account) - elif self.doc.cost_center: - self.doc.cost_center = None + + self.account) + elif self.cost_center: + self.cost_center = None def validate_posting_date(self): from erpnext.accounts.utils import validate_fiscal_year - validate_fiscal_year(self.doc.posting_date, self.doc.fiscal_year, "Posting Date") + validate_fiscal_year(self.posting_date, self.fiscal_year, "Posting Date") def check_pl_account(self): - if self.doc.is_opening=='Yes' and \ - frappe.db.get_value("Account", self.doc.account, "report_type")=="Profit and Loss": + if self.is_opening=='Yes' and \ + frappe.db.get_value("Account", self.account, "report_type")=="Profit and Loss": frappe.throw(_("For opening balance entry, account can not be \ a Profit and Loss type account")) @@ -63,32 +63,32 @@ class GlEntry(Document): """Account must be ledger, active and not freezed""" ret = frappe.db.sql("""select group_or_ledger, docstatus, company - from tabAccount where name=%s""", self.doc.account, as_dict=1)[0] + from tabAccount where name=%s""", self.account, as_dict=1)[0] if ret.group_or_ledger=='Group': - frappe.throw(_("Account") + ": " + self.doc.account + _(" is not a ledger")) + frappe.throw(_("Account") + ": " + self.account + _(" is not a ledger")) if ret.docstatus==2: - frappe.throw(_("Account") + ": " + self.doc.account + _(" is not active")) + frappe.throw(_("Account") + ": " + self.account + _(" is not active")) - if ret.company != self.doc.company: - frappe.throw(_("Account") + ": " + self.doc.account + - _(" does not belong to the company") + ": " + self.doc.company) + if ret.company != self.company: + frappe.throw(_("Account") + ": " + self.account + + _(" does not belong to the company") + ": " + self.company) def validate_cost_center(self): if not hasattr(self, "cost_center_company"): self.cost_center_company = {} def _get_cost_center_company(): - if not self.cost_center_company.get(self.doc.cost_center): - self.cost_center_company[self.doc.cost_center] = frappe.db.get_value( - "Cost Center", self.doc.cost_center, "company") + if not self.cost_center_company.get(self.cost_center): + self.cost_center_company[self.cost_center] = frappe.db.get_value( + "Cost Center", self.cost_center, "company") - return self.cost_center_company[self.doc.cost_center] + return self.cost_center_company[self.cost_center] - if self.doc.cost_center and _get_cost_center_company() != self.doc.company: - frappe.throw(_("Cost Center") + ": " + self.doc.cost_center + - _(" does not belong to the company") + ": " + self.doc.company) + if self.cost_center and _get_cost_center_company() != self.company: + frappe.throw(_("Cost Center") + ": " + self.cost_center + + _(" does not belong to the company") + ": " + self.company) def validate_balance_type(account, adv_adj=False): if not adv_adj and account: diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher.py b/erpnext/accounts/doctype/journal_voucher/journal_voucher.py index 5727ed4855..99aae56715 100644 --- a/erpnext/accounts/doctype/journal_voucher/journal_voucher.py +++ b/erpnext/accounts/doctype/journal_voucher/journal_voucher.py @@ -18,10 +18,10 @@ class JournalVoucher(AccountsController): self.is_approving_authority = -1 def validate(self): - if not self.doc.is_opening: - self.doc.is_opening='No' + if not self.is_opening: + self.is_opening='No' - self.doc.clearance_date = None + self.clearance_date = None super(DocType, self).validate_date_with_fiscal_year() @@ -37,21 +37,21 @@ class JournalVoucher(AccountsController): def on_submit(self): - if self.doc.voucher_type in ['Bank Voucher', 'Contra Voucher', 'Journal Entry']: + if self.voucher_type in ['Bank Voucher', 'Contra Voucher', 'Journal Entry']: self.check_credit_days() self.make_gl_entries() self.check_credit_limit() def on_cancel(self): from erpnext.accounts.utils import remove_against_link_from_jv - remove_against_link_from_jv(self.doc.doctype, self.doc.name, "against_jv") + remove_against_link_from_jv(self.doctype, self.name, "against_jv") self.make_gl_entries(1) def on_trash(self): pass - #if self.doc.amended_from: - # frappe.delete_doc("Journal Voucher", self.doc.amended_from) + #if self.amended_from: + # frappe.delete_doc("Journal Voucher", self.amended_from) def validate_debit_credit(self): for d in self.get('entries'): @@ -60,12 +60,12 @@ class JournalVoucher(AccountsController): raise_exception=1) def validate_cheque_info(self): - if self.doc.voucher_type in ['Bank Voucher']: - if not self.doc.cheque_no or not self.doc.cheque_date: + if self.voucher_type in ['Bank Voucher']: + if not self.cheque_no or not self.cheque_date: msgprint("Reference No & Reference Date is required for %s" % - self.doc.voucher_type, raise_exception=1) + self.voucher_type, raise_exception=1) - if self.doc.cheque_date and not self.doc.cheque_no: + if self.cheque_date and not self.cheque_no: msgprint("Reference No is mandatory if you entered Reference Date", raise_exception=1) def validate_entries_for_advance(self): @@ -81,7 +81,7 @@ class JournalVoucher(AccountsController): def validate_against_jv(self): for d in self.get('entries'): if d.against_jv: - if d.against_jv == self.doc.name: + if d.against_jv == self.name: msgprint("You can not enter current voucher in 'Against JV' column", raise_exception=1) elif not frappe.db.sql("""select name from `tabJournal Voucher Detail` @@ -99,12 +99,12 @@ class JournalVoucher(AccountsController): if flt(d.debit)>0 and (d.account not in debit_list): debit_list.append(d.account) if flt(d.credit)>0 and (d.account not in credit_list): credit_list.append(d.account) - self.doc.total_debit = debit - self.doc.total_credit = credit + self.total_debit = debit + self.total_credit = credit - if abs(self.doc.total_debit-self.doc.total_credit) > 0.001: + if abs(self.total_debit-self.total_credit) > 0.001: msgprint("Debit must be equal to Credit. The difference is %s" % - (self.doc.total_debit-self.doc.total_credit), raise_exception=1) + (self.total_debit-self.total_credit), raise_exception=1) # update against account for d in self.get('entries'): @@ -113,10 +113,10 @@ class JournalVoucher(AccountsController): def create_remarks(self): r = [] - if self.doc.cheque_no : - if self.doc.cheque_date: + if self.cheque_no : + if self.cheque_date: r.append('Via Reference #%s dated %s' % - (self.doc.cheque_no, formatdate(self.doc.cheque_date))) + (self.cheque_no, formatdate(self.cheque_date))) else : msgprint("Please enter Reference date", raise_exception=1) @@ -135,17 +135,17 @@ class JournalVoucher(AccountsController): (cstr(bill_no[0][2]), fmt_money(flt(d.debit)), bill_no[0][0], bill_no[0][1] and formatdate(bill_no[0][1].strftime('%Y-%m-%d')) or '')) - if self.doc.user_remark: - r.append("User Remark : %s"%self.doc.user_remark) + if self.user_remark: + r.append("User Remark : %s"%self.user_remark) if r: - self.doc.remark = ("\n").join(r) + self.remark = ("\n").join(r) else: frappe.msgprint("User Remarks is mandatory", raise_exception=1) def set_aging_date(self): - if self.doc.is_opening != 'Yes': - self.doc.aging_date = self.doc.posting_date + if self.is_opening != 'Yes': + self.aging_date = self.posting_date else: # check account type whether supplier or customer exists = False @@ -156,10 +156,10 @@ class JournalVoucher(AccountsController): break # If customer/supplier account, aging date is mandatory - if exists and not self.doc.aging_date: + if exists and not self.aging_date: msgprint("Aging Date is mandatory for opening entry", raise_exception=1) else: - self.doc.aging_date = self.doc.posting_date + self.aging_date = self.posting_date def set_print_format_fields(self): for d in self.get('entries'): @@ -167,22 +167,22 @@ class JournalVoucher(AccountsController): ["account_type", "master_type"]) if master_type in ['Supplier', 'Customer']: - if not self.doc.pay_to_recd_from: - self.doc.pay_to_recd_from = frappe.db.get_value(master_type, + if not self.pay_to_recd_from: + self.pay_to_recd_from = frappe.db.get_value(master_type, ' - '.join(d.account.split(' - ')[:-1]), master_type == 'Customer' and 'customer_name' or 'supplier_name') if account_type in ['Bank', 'Cash']: - company_currency = get_company_currency(self.doc.company) + company_currency = get_company_currency(self.company) amt = flt(d.debit) and d.debit or d.credit - self.doc.total_amount = company_currency + ' ' + cstr(amt) + self.total_amount = company_currency + ' ' + cstr(amt) from frappe.utils import money_in_words - self.doc.total_amount_in_words = money_in_words(amt, company_currency) + self.total_amount_in_words = money_in_words(amt, company_currency) def check_credit_days(self): date_diff = 0 - if self.doc.cheque_date: - date_diff = (getdate(self.doc.cheque_date)-getdate(self.doc.posting_date)).days + if self.cheque_date: + date_diff = (getdate(self.cheque_date)-getdate(self.posting_date)).days if date_diff <= 0: return @@ -204,7 +204,7 @@ class JournalVoucher(AccountsController): if not self.credit_days_for[ac]: if self.credit_days_global==-1: self.credit_days_global = cint(frappe.db.get_value("Company", - self.doc.company, "credit_days")) + self.company, "credit_days")) return self.credit_days_global else: @@ -255,7 +255,7 @@ class JournalVoucher(AccountsController): or (d.against_invoice and "Sales Invoice") or (d.against_jv and "Journal Voucher")), "against_voucher": d.against_voucher or d.against_invoice or d.against_jv, - "remarks": self.doc.remark, + "remarks": self.remark, "cost_center": d.cost_center }) ) @@ -273,8 +273,8 @@ class JournalVoucher(AccountsController): if not self.get('entries'): msgprint("Please enter atleast 1 entry in 'GL Entries' table") else: - flag, self.doc.total_debit, self.doc.total_credit = 0, 0, 0 - diff = flt(self.doc.difference, 2) + flag, self.total_debit, self.total_credit = 0, 0, 0 + diff = flt(self.difference, 2) # If any row without amount, set the diff on that row for d in self.get('entries'): @@ -287,7 +287,7 @@ class JournalVoucher(AccountsController): # Set the diff in a new row if flag == 0 and diff != 0: - jd = self.doc.append('entries', {}) + jd = self.append('entries', {}) if diff>0: jd.credit = abs(diff) elif diff<0: @@ -295,43 +295,43 @@ class JournalVoucher(AccountsController): # Set the total debit, total credit and difference for d in self.get('entries'): - self.doc.total_debit += flt(d.debit, 2) - self.doc.total_credit += flt(d.credit, 2) + self.total_debit += flt(d.debit, 2) + self.total_credit += flt(d.credit, 2) - self.doc.difference = flt(self.doc.total_debit, 2) - flt(self.doc.total_credit, 2) + self.difference = flt(self.total_debit, 2) - flt(self.total_credit, 2) def get_outstanding_invoices(self): self.set('entries', []) total = 0 for d in self.get_values(): total += flt(d[2]) - jd = self.doc.append('entries', {}) + jd = self.append('entries', {}) jd.account = cstr(d[1]) - if self.doc.write_off_based_on == 'Accounts Receivable': + if self.write_off_based_on == 'Accounts Receivable': jd.credit = flt(d[2]) jd.against_invoice = cstr(d[0]) - elif self.doc.write_off_based_on == 'Accounts Payable': + elif self.write_off_based_on == 'Accounts Payable': jd.debit = flt(d[2]) jd.against_voucher = cstr(d[0]) jd.save(1) - jd = self.doc.append('entries', {}) - if self.doc.write_off_based_on == 'Accounts Receivable': + jd = self.append('entries', {}) + if self.write_off_based_on == 'Accounts Receivable': jd.debit = total - elif self.doc.write_off_based_on == 'Accounts Payable': + elif self.write_off_based_on == 'Accounts Payable': jd.credit = total jd.save(1) def get_values(self): - cond = (flt(self.doc.write_off_amount) > 0) and \ - ' and outstanding_amount <= '+ self.doc.write_off_amount or '' - if self.doc.write_off_based_on == 'Accounts Receivable': + cond = (flt(self.write_off_amount) > 0) and \ + ' and outstanding_amount <= '+ self.write_off_amount or '' + if self.write_off_based_on == 'Accounts Receivable': return frappe.db.sql("""select name, debit_to, outstanding_amount from `tabSales Invoice` where docstatus = 1 and company = %s - and outstanding_amount > 0 %s""" % ('%s', cond), self.doc.company) - elif self.doc.write_off_based_on == 'Accounts Payable': + and outstanding_amount > 0 %s""" % ('%s', cond), self.company) + elif self.write_off_based_on == 'Accounts Payable': return frappe.db.sql("""select name, credit_to, outstanding_amount from `tabPurchase Invoice` where docstatus = 1 and company = %s - and outstanding_amount > 0 %s""" % ('%s', cond), self.doc.company) + and outstanding_amount > 0 %s""" % ('%s', cond), self.company) @frappe.whitelist() def get_default_bank_cash_account(company, voucher_type): @@ -349,16 +349,16 @@ def get_payment_entry_from_sales_invoice(sales_invoice): from erpnext.accounts.utils import get_balance_on si = frappe.bean("Sales Invoice", sales_invoice) jv = get_payment_entry(si.doc) - jv.doc.remark = 'Payment received against Sales Invoice %(name)s. %(remarks)s' % si.doc.fields + jv.remark = 'Payment received against Sales Invoice %(name)s. %(remarks)s' % si.fields # credit customer - jv.doclist[1].account = si.doc.debit_to - jv.doclist[1].balance = get_balance_on(si.doc.debit_to) - jv.doclist[1].credit = si.doc.outstanding_amount - jv.doclist[1].against_invoice = si.doc.name + jv.doclist[1].account = si.debit_to + jv.doclist[1].balance = get_balance_on(si.debit_to) + jv.doclist[1].credit = si.outstanding_amount + jv.doclist[1].against_invoice = si.name # debit bank - jv.doclist[2].debit = si.doc.outstanding_amount + jv.doclist[2].debit = si.outstanding_amount return [d.fields for d in jv.doclist] @@ -367,16 +367,16 @@ def get_payment_entry_from_purchase_invoice(purchase_invoice): from erpnext.accounts.utils import get_balance_on pi = frappe.bean("Purchase Invoice", purchase_invoice) jv = get_payment_entry(pi.doc) - jv.doc.remark = 'Payment against Purchase Invoice %(name)s. %(remarks)s' % pi.doc.fields + jv.remark = 'Payment against Purchase Invoice %(name)s. %(remarks)s' % pi.fields # credit supplier - jv.doclist[1].account = pi.doc.credit_to - jv.doclist[1].balance = get_balance_on(pi.doc.credit_to) - jv.doclist[1].debit = pi.doc.outstanding_amount - jv.doclist[1].against_voucher = pi.doc.name + jv.doclist[1].account = pi.credit_to + jv.doclist[1].balance = get_balance_on(pi.credit_to) + jv.doclist[1].debit = pi.outstanding_amount + jv.doclist[1].against_voucher = pi.name # credit bank - jv.doclist[2].credit = pi.doc.outstanding_amount + jv.doclist[2].credit = pi.outstanding_amount return [d.fields for d in jv.doclist] @@ -384,10 +384,10 @@ def get_payment_entry(doc): bank_account = get_default_bank_cash_account(doc.company, "Bank Voucher") jv = frappe.new_bean('Journal Voucher') - jv.doc.voucher_type = 'Bank Voucher' + jv.voucher_type = 'Bank Voucher' - jv.doc.company = doc.company - jv.doc.fiscal_year = doc.fiscal_year + jv.company = doc.company + jv.fiscal_year = doc.fiscal_year d1 = jv.append("entries") d2 = jv.append("entries") diff --git a/erpnext/accounts/doctype/journal_voucher/test_journal_voucher.py b/erpnext/accounts/doctype/journal_voucher/test_journal_voucher.py index 35e2155d69..0e02e02124 100644 --- a/erpnext/accounts/doctype/journal_voucher/test_journal_voucher.py +++ b/erpnext/accounts/doctype/journal_voucher/test_journal_voucher.py @@ -14,24 +14,24 @@ class TestJournalVoucher(unittest.TestCase): jv_invoice.submit() self.assertTrue(not frappe.db.sql("""select name from `tabJournal Voucher Detail` - where against_jv=%s""", jv_invoice.doc.name)) + where against_jv=%s""", jv_invoice.name)) jv_payment = frappe.bean(copy=test_records[0]) - jv_payment.doclist[1].against_jv = jv_invoice.doc.name + jv_payment.doclist[1].against_jv = jv_invoice.name jv_payment.insert() jv_payment.submit() self.assertTrue(frappe.db.sql("""select name from `tabJournal Voucher Detail` - where against_jv=%s""", jv_invoice.doc.name)) + where against_jv=%s""", jv_invoice.name)) self.assertTrue(frappe.db.sql("""select name from `tabJournal Voucher Detail` - where against_jv=%s and credit=400""", jv_invoice.doc.name)) + where against_jv=%s and credit=400""", jv_invoice.name)) # cancel jv_invoice jv_invoice.cancel() self.assertTrue(not frappe.db.sql("""select name from `tabJournal Voucher Detail` - where against_jv=%s""", jv_invoice.doc.name)) + where against_jv=%s""", jv_invoice.name)) def test_jv_against_stock_account(self): from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory @@ -58,7 +58,7 @@ class TestJournalVoucher(unittest.TestCase): jv.insert() jv.submit() self.assertTrue(frappe.db.get_value("GL Entry", - {"voucher_type": "Journal Voucher", "voucher_no": jv.doc.name})) + {"voucher_type": "Journal Voucher", "voucher_no": jv.name})) def test_monthly_budget_crossed_stop(self): from erpnext.accounts.utils import BudgetError @@ -84,7 +84,7 @@ class TestJournalVoucher(unittest.TestCase): frappe.db.set_value("Company", "_Test Company", "yearly_bgt_flag", "Stop") jv = frappe.bean(copy=test_records[0]) - jv.doc.posting_date = "2013-08-12" + jv.posting_date = "2013-08-12" jv.doclist[2].account = "_Test Account Cost for Goods Sold - _TC" jv.doclist[2].cost_center = "_Test Cost Center - _TC" jv.doclist[2].debit = 150000.0 @@ -108,7 +108,7 @@ class TestJournalVoucher(unittest.TestCase): jv.submit() self.assertTrue(frappe.db.get_value("GL Entry", - {"voucher_type": "Journal Voucher", "voucher_no": jv.doc.name})) + {"voucher_type": "Journal Voucher", "voucher_no": jv.name})) jv1 = frappe.bean(copy=test_records[0]) jv1.doclist[2].account = "_Test Account Cost for Goods Sold - _TC" @@ -118,7 +118,7 @@ class TestJournalVoucher(unittest.TestCase): jv1.submit() self.assertTrue(frappe.db.get_value("GL Entry", - {"voucher_type": "Journal Voucher", "voucher_no": jv1.doc.name})) + {"voucher_type": "Journal Voucher", "voucher_no": jv1.name})) self.assertRaises(BudgetError, jv.cancel) diff --git a/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py b/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py index 51c2c7da7a..fb1508e8bd 100644 --- a/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py +++ b/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py @@ -15,13 +15,13 @@ class PaymentToInvoiceMatchingTool(Document): total_amount = frappe.db.sql("""select sum(ifnull(debit, 0)) - sum(ifnull(credit, 0)) from `tabGL Entry` where voucher_type = %s and voucher_no = %s - and account = %s""", (self.doc.voucher_type, self.doc.voucher_no, self.doc.account)) + and account = %s""", (self.voucher_type, self.voucher_no, self.account)) total_amount = total_amount and flt(total_amount[0][0]) or 0 reconciled_payment = frappe.db.sql(""" select abs(sum(ifnull(debit, 0)) - sum(ifnull(credit, 0))) from `tabGL Entry` where against_voucher = %s and voucher_no != %s - and account = %s""", (self.doc.voucher_no, self.doc.voucher_no, self.doc.account)) + and account = %s""", (self.voucher_no, self.voucher_no, self.account)) reconciled_payment = reconciled_payment and flt(reconciled_payment[0][0]) or 0 ret = { @@ -44,15 +44,15 @@ class PaymentToInvoiceMatchingTool(Document): def get_gl_entries(self): self.validate_mandatory() - cond = self.doc.from_date and " and t1.posting_date >= '" + self.doc.from_date + "'" or "" - cond += self.doc.to_date and " and t1.posting_date <= '" + self.doc.to_date + "'"or "" + cond = self.from_date and " and t1.posting_date >= '" + self.from_date + "'" or "" + cond += self.to_date and " and t1.posting_date <= '" + self.to_date + "'"or "" - if self.doc.amt_greater_than: + if self.amt_greater_than: cond += ' and abs(ifnull(t2.debit, 0) - ifnull(t2.credit, 0)) >= ' + \ - self.doc.amt_greater_than - if self.doc.amt_less_than: + self.amt_greater_than + if self.amt_less_than: cond += ' and abs(ifnull(t2.debit, 0) - ifnull(t2.credit, 0)) >= ' + \ - self.doc.amt_less_than + self.amt_less_than gle = frappe.db.sql(""" select t1.name as voucher_no, t1.posting_date, t1.total_debit as total_amt, @@ -62,13 +62,13 @@ class PaymentToInvoiceMatchingTool(Document): where t1.name = t2.parent and t1.docstatus = 1 and t2.account = %s and ifnull(t2.against_voucher, '')='' and ifnull(t2.against_invoice, '')='' and ifnull(t2.against_jv, '')='' and t1.name != %s %s group by t1.name, t2.name """ % - ('%s', '%s', cond), (self.doc.account, self.doc.voucher_no), as_dict=1) + ('%s', '%s', cond), (self.account, self.voucher_no), as_dict=1) return gle def create_payment_table(self, gle): for d in gle: - ch = self.doc.append('ir_payment_details', {}) + ch = self.append('ir_payment_details', {}) ch.voucher_no = d.get('voucher_no') ch.posting_date = d.get('posting_date') ch.amt_due = flt(d.get('amt_due')) @@ -78,7 +78,7 @@ class PaymentToInvoiceMatchingTool(Document): ch.voucher_detail_no = d.get('voucher_detail_no') def validate_mandatory(self): - if not self.doc.account: + if not self.account: msgprint("Please select Account first", raise_exception=1) def reconcile(self): @@ -88,8 +88,8 @@ class PaymentToInvoiceMatchingTool(Document): 2. split into multiple rows if partially adjusted, assign against voucher 3. submit payment voucher """ - if not self.doc.voucher_no or not frappe.db.sql("""select name from `tab%s` - where name = %s""" % (self.doc.voucher_type, '%s'), self.doc.voucher_no): + if not self.voucher_no or not frappe.db.sql("""select name from `tab%s` + where name = %s""" % (self.voucher_type, '%s'), self.voucher_no): frappe.throw(_("Please select valid Voucher No to proceed")) lst = [] @@ -98,11 +98,11 @@ class PaymentToInvoiceMatchingTool(Document): args = { 'voucher_no' : d.voucher_no, 'voucher_detail_no' : d.voucher_detail_no, - 'against_voucher_type' : self.doc.voucher_type, - 'against_voucher' : self.doc.voucher_no, - 'account' : self.doc.account, + 'against_voucher_type' : self.voucher_type, + 'against_voucher' : self.voucher_no, + 'account' : self.account, 'is_advance' : 'No', - # 'dr_or_cr' : self.doc.account_type=='debit' and 'credit' or 'debit', + # 'dr_or_cr' : self.account_type=='debit' and 'credit' or 'debit', 'unadjusted_amt' : flt(d.amt_due), 'allocated_amt' : flt(d.amt_to_be_reconciled) } diff --git a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py index cdc20e85f0..a07ed2f3a5 100644 --- a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py +++ b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py @@ -19,24 +19,24 @@ class PeriodClosingVoucher(AccountsController): def on_cancel(self): frappe.db.sql("""delete from `tabGL Entry` - where voucher_type = 'Period Closing Voucher' and voucher_no=%s""", self.doc.name) + where voucher_type = 'Period Closing Voucher' and voucher_no=%s""", self.name) def validate_account_head(self): - if frappe.db.get_value("Account", self.doc.closing_account_head, "report_type") \ + if frappe.db.get_value("Account", self.closing_account_head, "report_type") \ != "Balance Sheet": - frappe.throw(_("Account") + ": " + self.doc.closing_account_head + + frappe.throw(_("Account") + ": " + self.closing_account_head + _("must be a Liability account")) def validate_posting_date(self): from erpnext.accounts.utils import get_fiscal_year - self.year_start_date = get_fiscal_year(self.doc.posting_date, self.doc.fiscal_year)[1] + self.year_start_date = get_fiscal_year(self.posting_date, self.fiscal_year)[1] pce = frappe.db.sql("""select name from `tabPeriod Closing Voucher` where posting_date > %s and fiscal_year = %s and docstatus = 1""", - (self.doc.posting_date, self.doc.fiscal_year)) + (self.posting_date, self.fiscal_year)) if pce and pce[0][0]: frappe.throw(_("Another Period Closing Entry") + ": " + cstr(pce[0][0]) + - _("has been made after posting date") + ": " + self.doc.posting_date) + _("has been made after posting date") + ": " + self.posting_date) def get_pl_balances(self): """Get balance for pl accounts""" @@ -47,7 +47,7 @@ class PeriodClosingVoucher(AccountsController): and t2.docstatus < 2 and t2.company = %s and t1.posting_date between %s and %s group by t1.account - """, (self.doc.company, self.year_start_date, self.doc.posting_date), as_dict=1) + """, (self.company, self.year_start_date, self.posting_date), as_dict=1) def make_gl_entries(self): gl_entries = [] @@ -65,7 +65,7 @@ class PeriodClosingVoucher(AccountsController): if net_pl_balance: gl_entries.append(self.get_gl_dict({ - "account": self.doc.closing_account_head, + "account": self.closing_account_head, "debit": abs(net_pl_balance) if net_pl_balance > 0 else 0, "credit": abs(net_pl_balance) if net_pl_balance < 0 else 0 })) diff --git a/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py b/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py index 9b62af19bc..b9dca05e99 100644 --- a/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py +++ b/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py @@ -29,7 +29,7 @@ class TestPeriodClosingVoucher(unittest.TestCase): gl_entries = frappe.db.sql("""select account, debit, credit from `tabGL Entry` where voucher_type='Period Closing Voucher' and voucher_no=%s - order by account asc, debit asc""", pcv.doc.name, as_dict=1) + order by account asc, debit asc""", pcv.name, as_dict=1) self.assertTrue(gl_entries) diff --git a/erpnext/accounts/doctype/pos_setting/pos_setting.py b/erpnext/accounts/doctype/pos_setting/pos_setting.py index 61d405bccd..ed3f5f4a42 100755 --- a/erpnext/accounts/doctype/pos_setting/pos_setting.py +++ b/erpnext/accounts/doctype/pos_setting/pos_setting.py @@ -24,30 +24,30 @@ class PosSetting(Document): def check_for_duplicate(self): res = frappe.db.sql("""select name, user from `tabPOS Setting` where ifnull(user, '') = %s and name != %s and company = %s""", - (self.doc.user, self.doc.name, self.doc.company)) + (self.user, self.name, self.company)) if res: if res[0][1]: msgprint("POS Setting '%s' already created for user: '%s' and company: '%s'" % - (res[0][0], res[0][1], self.doc.company), raise_exception=1) + (res[0][0], res[0][1], self.company), raise_exception=1) else: msgprint("Global POS Setting already created - %s for this company: '%s'" % - (res[0][0], self.doc.company), raise_exception=1) + (res[0][0], self.company), raise_exception=1) def validate_expense_account(self): if cint(frappe.defaults.get_global_default("auto_accounting_for_stock")) \ - and not self.doc.expense_account: + and not self.expense_account: msgprint(_("Expense Account is mandatory"), raise_exception=1) def validate_all_link_fields(self): - accounts = {"Account": [self.doc.cash_bank_account, self.doc.income_account, - self.doc.expense_account], "Cost Center": [self.doc.cost_center], - "Warehouse": [self.doc.warehouse]} + accounts = {"Account": [self.cash_bank_account, self.income_account, + self.expense_account], "Cost Center": [self.cost_center], + "Warehouse": [self.warehouse]} for link_dt, dn_list in accounts.items(): for link_dn in dn_list: if link_dn and not frappe.db.exists({"doctype": link_dt, - "company": self.doc.company, "name": link_dn}): - frappe.throw(link_dn +_(" does not belong to ") + self.doc.company) + "company": self.company, "name": link_dn}): + frappe.throw(link_dn +_(" does not belong to ") + self.company) def on_update(self): self.set_defaults() @@ -59,7 +59,7 @@ class PosSetting(Document): frappe.defaults.clear_default("is_pos") if not include_current_pos: - condition = " where name != '%s'" % self.doc.name.replace("'", "\'") + condition = " where name != '%s'" % self.name.replace("'", "\'") else: condition = "" diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py index 831efacb9d..eb70ee1b44 100644 --- a/erpnext/accounts/doctype/pricing_rule/pricing_rule.py +++ b/erpnext/accounts/doctype/pricing_rule/pricing_rule.py @@ -16,14 +16,14 @@ class PricingRule(DocListController): def validate_mandatory(self): for field in ["apply_on", "applicable_for", "price_or_discount"]: - val = self.doc.fields.get("applicable_for") - if val and not self.doc.fields.get(frappe.scrub(val)): + val = self.get("applicable_for") + if val and not self.get(frappe.scrub(val)): throw("{fname} {msg}".format(fname = _(val), msg = _(" is mandatory")), frappe.MandatoryError) def cleanup_fields_value(self): for logic_field in ["apply_on", "applicable_for", "price_or_discount"]: - fieldname = frappe.scrub(self.doc.fields.get(logic_field) or "") + fieldname = frappe.scrub(self.get(logic_field) or "") # reset all values except for the logic field options = (self.meta.get_options(logic_field) or "").split("\n") @@ -32,5 +32,5 @@ class PricingRule(DocListController): f = frappe.scrub(f) if f!=fieldname: - self.doc.fields[f] = None + self.set(f, None) \ No newline at end of file diff --git a/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py index a28db322b2..9d1e5da8f8 100644 --- a/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py +++ b/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py @@ -39,18 +39,18 @@ class TestPricingRule(unittest.TestCase): self.assertEquals(details.get("discount_percentage"), 10) prule = frappe.bean(copy=test_record) - prule.doc.applicable_for = "Customer" + prule.applicable_for = "Customer" self.assertRaises(MandatoryError, prule.insert) - prule.doc.customer = "_Test Customer" - prule.doc.discount_percentage = 20 + prule.customer = "_Test Customer" + prule.discount_percentage = 20 prule.insert() details = get_item_details(args) self.assertEquals(details.get("discount_percentage"), 20) prule = frappe.bean(copy=test_record) - prule.doc.apply_on = "Item Group" - prule.doc.item_group = "All Item Groups" - prule.doc.discount_percentage = 15 + prule.apply_on = "Item Group" + prule.item_group = "All Item Groups" + prule.discount_percentage = 15 prule.insert() args.customer = None @@ -58,10 +58,10 @@ class TestPricingRule(unittest.TestCase): self.assertEquals(details.get("discount_percentage"), 10) prule = frappe.bean(copy=test_record) - prule.doc.applicable_for = "Campaign" - prule.doc.campaign = "_Test Campaign" - prule.doc.discount_percentage = 5 - prule.doc.priority = 8 + prule.applicable_for = "Campaign" + prule.campaign = "_Test Campaign" + prule.discount_percentage = 5 + prule.priority = 8 prule.insert() args.campaign = "_Test Campaign" diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index c07b2c8e29..f9e9481b23 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -31,8 +31,8 @@ class PurchaseInvoice(BuyingController): }] def validate(self): - if not self.doc.is_opening: - self.doc.is_opening = 'No' + if not self.is_opening: + self.is_opening = 'No' super(DocType, self).validate() @@ -56,16 +56,16 @@ class PurchaseInvoice(BuyingController): "purchase_receipt_details") def set_missing_values(self, for_validate=False): - if not self.doc.credit_to: - self.doc.credit_to = get_party_account(self.doc.company, self.doc.supplier, "Supplier") - if not self.doc.due_date: - self.doc.due_date = get_due_date(self.doc.posting_date, self.doc.supplier, "Supplier", - self.doc.credit_to, self.doc.company) + if not self.credit_to: + self.credit_to = get_party_account(self.company, self.supplier, "Supplier") + if not self.due_date: + self.due_date = get_due_date(self.posting_date, self.supplier, "Supplier", + self.credit_to, self.company) super(DocType, self).set_missing_values(for_validate) def get_advances(self): - super(DocType, self).get_advances(self.doc.credit_to, + super(DocType, self).get_advances(self.credit_to, "Purchase Invoice Advance", "advance_allocation_details", "debit") def check_active_purchase_items(self): @@ -80,44 +80,44 @@ class PurchaseInvoice(BuyingController): raise Exception def check_conversion_rate(self): - default_currency = get_company_currency(self.doc.company) + default_currency = get_company_currency(self.company) if not default_currency: msgprint('Message: Please enter default currency in Company Master') raise Exception - if (self.doc.currency == default_currency and flt(self.doc.conversion_rate) != 1.00) or not self.doc.conversion_rate or (self.doc.currency != default_currency and flt(self.doc.conversion_rate) == 1.00): + if (self.currency == default_currency and flt(self.conversion_rate) != 1.00) or not self.conversion_rate or (self.currency != default_currency and flt(self.conversion_rate) == 1.00): msgprint("Message: Please Enter Appropriate Conversion Rate.") raise Exception def validate_bill_no(self): - if self.doc.bill_no and self.doc.bill_no.lower().strip() \ + if self.bill_no and self.bill_no.lower().strip() \ not in ['na', 'not applicable', 'none']: b_no = frappe.db.sql("""select bill_no, name, ifnull(is_opening,'') from `tabPurchase Invoice` where bill_no = %s and credit_to = %s and docstatus = 1 and name != %s""", - (self.doc.bill_no, self.doc.credit_to, self.doc.name)) - if b_no and cstr(b_no[0][2]) == cstr(self.doc.is_opening): + (self.bill_no, self.credit_to, self.name)) + if b_no and cstr(b_no[0][2]) == cstr(self.is_opening): msgprint("Please check you have already booked expense against Bill No. %s \ in Purchase Invoice %s" % (cstr(b_no[0][0]), cstr(b_no[0][1])), raise_exception=1) - if not self.doc.remarks and self.doc.bill_date: - self.doc.remarks = (self.doc.remarks or '') + "\n" + ("Against Bill %s dated %s" - % (self.doc.bill_no, formatdate(self.doc.bill_date))) + if not self.remarks and self.bill_date: + self.remarks = (self.remarks or '') + "\n" + ("Against Bill %s dated %s" + % (self.bill_no, formatdate(self.bill_date))) - if not self.doc.remarks: - self.doc.remarks = "No Remarks" + if not self.remarks: + self.remarks = "No Remarks" def validate_credit_acc(self): - if frappe.db.get_value("Account", self.doc.credit_to, "report_type") != "Balance Sheet": + if frappe.db.get_value("Account", self.credit_to, "report_type") != "Balance Sheet": frappe.throw(_("Account must be a balance sheet account")) # Validate Acc Head of Supplier and Credit To Account entered # ------------------------------------------------------------ def check_for_acc_head_of_supplier(self): - if self.doc.supplier and self.doc.credit_to: - acc_head = frappe.db.sql("select master_name from `tabAccount` where name = %s", self.doc.credit_to) + if self.supplier and self.credit_to: + acc_head = frappe.db.sql("select master_name from `tabAccount` where name = %s", self.credit_to) - if (acc_head and cstr(acc_head[0][0]) != cstr(self.doc.supplier)) or (not acc_head and (self.doc.credit_to != cstr(self.doc.supplier) + " - " + self.company_abbr)): - msgprint("Credit To: %s do not match with Supplier: %s for Company: %s.\n If both correctly entered, please select Master Type and Master Name in account master." %(self.doc.credit_to,self.doc.supplier,self.doc.company), raise_exception=1) + if (acc_head and cstr(acc_head[0][0]) != cstr(self.supplier)) or (not acc_head and (self.credit_to != cstr(self.supplier) + " - " + self.company_abbr)): + msgprint("Credit To: %s do not match with Supplier: %s for Company: %s.\n If both correctly entered, please select Master Type and Master Name in account master." %(self.credit_to,self.supplier,self.company), raise_exception=1) # Check for Stopped PO # --------------------- @@ -171,9 +171,9 @@ class PurchaseInvoice(BuyingController): def set_aging_date(self): - if self.doc.is_opening != 'Yes': - self.doc.aging_date = self.doc.posting_date - elif not self.doc.aging_date: + if self.is_opening != 'Yes': + self.aging_date = self.posting_date + elif not self.aging_date: msgprint("Aging Date is mandatory for opening entry") raise Exception @@ -187,7 +187,7 @@ class PurchaseInvoice(BuyingController): stock_items = self.get_stock_items() for item in self.get("entries"): if auto_accounting_for_stock and item.item_code in stock_items \ - and self.doc.is_opening == 'No': + and self.is_opening == 'No': # in case of auto inventory accounting, against expense account is always # Stock Received But Not Billed for a stock item item.expense_account = stock_not_billed_account @@ -204,7 +204,7 @@ class PurchaseInvoice(BuyingController): # if no auto_accounting_for_stock or not a stock item against_accounts.append(item.expense_account) - self.doc.against_expense_account = ",".join(against_accounts) + self.against_expense_account = ",".join(against_accounts) def po_required(self): if frappe.db.get_value("Buying Settings", None, "po_required") == 'Yes': @@ -221,7 +221,7 @@ class PurchaseInvoice(BuyingController): raise Exception def validate_write_off_account(self): - if self.doc.write_off_amount and not self.doc.write_off_account: + if self.write_off_amount and not self.write_off_account: msgprint("Please enter Write Off Account", raise_exception=1) def check_prev_docstatus(self): @@ -251,8 +251,8 @@ class PurchaseInvoice(BuyingController): 'voucher_no' : d.journal_voucher, 'voucher_detail_no' : d.jv_detail_no, 'against_voucher_type' : 'Purchase Invoice', - 'against_voucher' : self.doc.name, - 'account' : self.doc.credit_to, + 'against_voucher' : self.name, + 'account' : self.credit_to, 'is_advance' : 'Yes', 'dr_or_cr' : 'debit', 'unadjusted_amt' : flt(d.advance_amount), @@ -267,8 +267,8 @@ class PurchaseInvoice(BuyingController): def on_submit(self): self.check_prev_docstatus() - get_obj('Authorization Control').validate_approving_authority(self.doc.doctype, - self.doc.company, self.doc.grand_total) + get_obj('Authorization Control').validate_approving_authority(self.doctype, + self.company, self.grand_total) # this sequence because outstanding may get -negative self.make_gl_entries() @@ -283,15 +283,15 @@ class PurchaseInvoice(BuyingController): gl_entries = [] # parent's gl entry - if self.doc.grand_total: + if self.grand_total: gl_entries.append( self.get_gl_dict({ - "account": self.doc.credit_to, - "against": self.doc.against_expense_account, - "credit": self.doc.total_amount_to_pay, - "remarks": self.doc.remarks, - "against_voucher": self.doc.name, - "against_voucher_type": self.doc.doctype, + "account": self.credit_to, + "against": self.against_expense_account, + "credit": self.total_amount_to_pay, + "remarks": self.remarks, + "against_voucher": self.name, + "against_voucher_type": self.doctype, }) ) @@ -302,10 +302,10 @@ class PurchaseInvoice(BuyingController): gl_entries.append( self.get_gl_dict({ "account": tax.account_head, - "against": self.doc.credit_to, + "against": self.credit_to, "debit": tax.add_deduct_tax == "Add" and tax.tax_amount or 0, "credit": tax.add_deduct_tax == "Deduct" and tax.tax_amount or 0, - "remarks": self.doc.remarks, + "remarks": self.remarks, "cost_center": tax.cost_center }) ) @@ -337,9 +337,9 @@ class PurchaseInvoice(BuyingController): gl_entries.append( self.get_gl_dict({ "account": item.expense_account, - "against": self.doc.credit_to, + "against": self.credit_to, "debit": valuation_amt, - "remarks": self.doc.remarks or "Accounting Entry for Stock" + "remarks": self.remarks or "Accounting Entry for Stock" }) ) @@ -348,9 +348,9 @@ class PurchaseInvoice(BuyingController): gl_entries.append( self.get_gl_dict({ "account": item.expense_account, - "against": self.doc.credit_to, + "against": self.credit_to, "debit": item.base_amount, - "remarks": self.doc.remarks, + "remarks": self.remarks, "cost_center": item.cost_center }) ) @@ -366,32 +366,32 @@ class PurchaseInvoice(BuyingController): self.get_gl_dict({ "account": expenses_included_in_valuation, "cost_center": cost_center, - "against": self.doc.credit_to, + "against": self.credit_to, "credit": amount, - "remarks": self.doc.remarks or "Accounting Entry for Stock" + "remarks": self.remarks or "Accounting Entry for Stock" }) ) # writeoff account includes petty difference in the invoice amount # and the amount that is paid - if self.doc.write_off_account and flt(self.doc.write_off_amount): + if self.write_off_account and flt(self.write_off_amount): gl_entries.append( self.get_gl_dict({ - "account": self.doc.write_off_account, - "against": self.doc.credit_to, - "credit": flt(self.doc.write_off_amount), - "remarks": self.doc.remarks, - "cost_center": self.doc.write_off_cost_center + "account": self.write_off_account, + "against": self.credit_to, + "credit": flt(self.write_off_amount), + "remarks": self.remarks, + "cost_center": self.write_off_cost_center }) ) if gl_entries: from erpnext.accounts.general_ledger import make_gl_entries - make_gl_entries(gl_entries, cancel=(self.doc.docstatus == 2)) + make_gl_entries(gl_entries, cancel=(self.docstatus == 2)) def on_cancel(self): from erpnext.accounts.utils import remove_against_link_from_jv - remove_against_link_from_jv(self.doc.doctype, self.doc.name, "against_voucher") + remove_against_link_from_jv(self.doctype, self.name, "against_voucher") self.update_prevdoc_status() self.update_billing_status_for_zero_amount_refdoc("Purchase Order") diff --git a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py index c648c37f15..f3fae30731 100644 --- a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py @@ -51,7 +51,7 @@ class TestPurchaseInvoice(unittest.TestCase): gl_entries = frappe.db.sql("""select account, debit, credit from `tabGL Entry` where voucher_type='Purchase Invoice' and voucher_no=%s - order by account asc""", pi.doc.name, as_dict=1) + order by account asc""", pi.name, as_dict=1) self.assertTrue(gl_entries) expected_values = sorted([ @@ -83,7 +83,7 @@ class TestPurchaseInvoice(unittest.TestCase): gl_entries = frappe.db.sql("""select account, debit, credit from `tabGL Entry` where voucher_type='Purchase Invoice' and voucher_no=%s - order by account asc""", pi.doc.name, as_dict=1) + order by account asc""", pi.name, as_dict=1) self.assertTrue(gl_entries) expected_values = sorted([ @@ -175,28 +175,28 @@ class TestPurchaseInvoice(unittest.TestCase): pi = frappe.bean(copy=test_records[0]) pi.append("advance_allocation_details", { - "journal_voucher": jv.doc.name, + "journal_voucher": jv.name, "jv_detail_no": jv.doclist[1].name, "advance_amount": 400, "allocated_amount": 300, - "remarks": jv.doc.remark + "remarks": jv.remark }) pi.insert() pi.submit() pi.load_from_db() self.assertTrue(frappe.db.sql("""select name from `tabJournal Voucher Detail` - where against_voucher=%s""", pi.doc.name)) + where against_voucher=%s""", pi.name)) self.assertTrue(frappe.db.sql("""select name from `tabJournal Voucher Detail` - where against_voucher=%s and debit=300""", pi.doc.name)) + where against_voucher=%s and debit=300""", pi.name)) - self.assertEqual(pi.doc.outstanding_amount, 1212.30) + self.assertEqual(pi.outstanding_amount, 1212.30) pi.cancel() self.assertTrue(not frappe.db.sql("""select name from `tabJournal Voucher Detail` - where against_voucher=%s""", pi.doc.name)) + where against_voucher=%s""", pi.name)) test_records = [ [ diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index f62efa41e1..d916adb295 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -52,17 +52,17 @@ class SalesInvoice(SellingController): self.clear_unallocated_advances("Sales Invoice Advance", "advance_adjustment_details") self.add_remarks() - if cint(self.doc.is_pos): + if cint(self.is_pos): self.validate_pos() self.validate_write_off_account() - if cint(self.doc.update_stock): + if cint(self.update_stock): self.validate_item_code() self.update_current_stock() self.validate_delivery_note() - if not self.doc.is_opening: - self.doc.is_opening = 'No' + if not self.is_opening: + self.is_opening = 'No' self.set_aging_date() self.set_against_income_account() @@ -73,13 +73,13 @@ class SalesInvoice(SellingController): "delivery_note_details") def on_submit(self): - if cint(self.doc.update_stock) == 1: + if cint(self.update_stock) == 1: self.update_stock_ledger() else: # Check for Approving Authority - if not self.doc.recurring_id: - get_obj('Authorization Control').validate_approving_authority(self.doc.doctype, - self.doc.company, self.doc.grand_total, self) + if not self.recurring_id: + get_obj('Authorization Control').validate_approving_authority(self.doctype, + self.company, self.grand_total, self) self.check_prev_docstatus() @@ -89,26 +89,26 @@ class SalesInvoice(SellingController): # this sequence because outstanding may get -ve self.make_gl_entries() - self.check_credit_limit(self.doc.debit_to) + self.check_credit_limit(self.debit_to) - if not cint(self.doc.is_pos) == 1: + if not cint(self.is_pos) == 1: self.update_against_document_in_jv() self.update_c_form() - self.update_time_log_batch(self.doc.name) + self.update_time_log_batch(self.name) self.convert_to_recurring() def before_cancel(self): self.update_time_log_batch(None) def on_cancel(self): - if cint(self.doc.update_stock) == 1: + if cint(self.update_stock) == 1: self.update_stock_ledger() self.check_stop_sales_order("sales_order") from erpnext.accounts.utils import remove_against_link_from_jv - remove_against_link_from_jv(self.doc.doctype, self.doc.name, "against_invoice") + remove_against_link_from_jv(self.doctype, self.name, "against_invoice") self.update_status_updater_args() self.update_prevdoc_status() @@ -117,7 +117,7 @@ class SalesInvoice(SellingController): self.make_cancel_gl_entries() def update_status_updater_args(self): - if cint(self.doc.update_stock): + if cint(self.update_stock): self.status_updater.append({ 'source_dt':'Sales Invoice Item', 'target_dt':'Sales Order Item', @@ -140,16 +140,16 @@ class SalesInvoice(SellingController): self.convert_to_recurring() def get_portal_page(self): - return "invoice" if self.doc.docstatus==1 else None + return "invoice" if self.docstatus==1 else None def set_missing_values(self, for_validate=False): self.set_pos_fields(for_validate) - if not self.doc.debit_to: - self.doc.debit_to = get_party_account(self.doc.company, self.doc.customer, "Customer") - if not self.doc.due_date: - self.doc.due_date = get_due_date(self.doc.posting_date, self.doc.customer, "Customer", - self.doc.debit_to, self.doc.company) + if not self.debit_to: + self.debit_to = get_party_account(self.company, self.customer, "Customer") + if not self.due_date: + self.due_date = get_due_date(self.posting_date, self.customer, "Customer", + self.debit_to, self.company) super(DocType, self).set_missing_values(for_validate) @@ -157,7 +157,7 @@ class SalesInvoice(SellingController): for d in self.doclist.get({"doctype":"Sales Invoice Item"}): if d.time_log_batch: tlb = frappe.bean("Time Log Batch", d.time_log_batch) - tlb.doc.sales_invoice = sales_invoice + tlb.sales_invoice = sales_invoice tlb.update_after_submit() def validate_time_logs_are_submitted(self): @@ -170,48 +170,48 @@ class SalesInvoice(SellingController): def set_pos_fields(self, for_validate=False): """Set retail related fields from pos settings""" - if cint(self.doc.is_pos) != 1: + if cint(self.is_pos) != 1: return from erpnext.stock.get_item_details import get_pos_settings_item_details, get_pos_settings - pos = get_pos_settings(self.doc.company) + pos = get_pos_settings(self.company) if pos: - if not for_validate and not self.doc.customer: - self.doc.customer = pos.customer + if not for_validate and not self.customer: + self.customer = pos.customer # self.set_customer_defaults() for fieldname in ('territory', 'naming_series', 'currency', 'taxes_and_charges', 'letter_head', 'tc_name', 'selling_price_list', 'company', 'select_print_heading', 'cash_bank_account'): - if (not for_validate) or (for_validate and not self.doc.fields.get(fieldname)): - self.doc.fields[fieldname] = pos.get(fieldname) + if (not for_validate) or (for_validate and not self.get(fieldname)): + self.set(fieldname, pos.get(fieldname)) if not for_validate: - self.doc.update_stock = cint(pos.get("update_stock")) + self.update_stock = cint(pos.get("update_stock")) # set pos values in items for item in self.get("entries"): - if item.fields.get('item_code'): + if item.get('item_code'): for fname, val in get_pos_settings_item_details(pos, frappe._dict(item.fields), pos).items(): - if (not for_validate) or (for_validate and not item.fields.get(fname)): - item.fields[fname] = val + if (not for_validate) or (for_validate and not item.get(fname)): + item.set(fname, val) # fetch terms - if self.doc.tc_name and not self.doc.terms: - self.doc.terms = frappe.db.get_value("Terms and Conditions", self.doc.tc_name, "terms") + if self.tc_name and not self.terms: + self.terms = frappe.db.get_value("Terms and Conditions", self.tc_name, "terms") # fetch charges - if self.doc.charge and not len(self.get("other_charges")): + if self.charge and not len(self.get("other_charges")): self.set_taxes("other_charges", "taxes_and_charges") def get_advances(self): - super(DocType, self).get_advances(self.doc.debit_to, + super(DocType, self).get_advances(self.debit_to, "Sales Invoice Advance", "advance_adjustment_details", "credit") def get_company_abbr(self): - return frappe.db.sql("select abbr from tabCompany where name=%s", self.doc.company)[0][0] + return frappe.db.sql("select abbr from tabCompany where name=%s", self.company)[0][0] def update_against_document_in_jv(self): """ @@ -228,8 +228,8 @@ class SalesInvoice(SellingController): 'voucher_no' : d.journal_voucher, 'voucher_detail_no' : d.jv_detail_no, 'against_voucher_type' : 'Sales Invoice', - 'against_voucher' : self.doc.name, - 'account' : self.doc.debit_to, + 'against_voucher' : self.name, + 'account' : self.debit_to, 'is_advance' : 'Yes', 'dr_or_cr' : 'credit', 'unadjusted_amt' : flt(d.advance_amount), @@ -243,17 +243,17 @@ class SalesInvoice(SellingController): def validate_customer_account(self): """Validates Debit To Account and Customer Matches""" - if self.doc.customer and self.doc.debit_to and not cint(self.doc.is_pos): - acc_head = frappe.db.sql("select master_name from `tabAccount` where name = %s and docstatus != 2", self.doc.debit_to) + if self.customer and self.debit_to and not cint(self.is_pos): + acc_head = frappe.db.sql("select master_name from `tabAccount` where name = %s and docstatus != 2", self.debit_to) - if (acc_head and cstr(acc_head[0][0]) != cstr(self.doc.customer)) or \ - (not acc_head and (self.doc.debit_to != cstr(self.doc.customer) + " - " + self.get_company_abbr())): + if (acc_head and cstr(acc_head[0][0]) != cstr(self.customer)) or \ + (not acc_head and (self.debit_to != cstr(self.customer) + " - " + self.get_company_abbr())): msgprint("Debit To: %s do not match with Customer: %s for Company: %s.\n If both correctly entered, please select Master Type \ - and Master Name in account master." %(self.doc.debit_to, self.doc.customer,self.doc.company), raise_exception=1) + and Master Name in account master." %(self.debit_to, self.customer,self.company), raise_exception=1) def validate_debit_acc(self): - if frappe.db.get_value("Account", self.doc.debit_to, "report_type") != "Balance Sheet": + if frappe.db.get_value("Account", self.debit_to, "report_type") != "Balance Sheet": frappe.throw(_("Account must be a balance sheet account")) def validate_fixed_asset_account(self): @@ -300,9 +300,9 @@ class SalesInvoice(SellingController): def set_aging_date(self): - if self.doc.is_opening != 'Yes': - self.doc.aging_date = self.doc.posting_date - elif not self.doc.aging_date: + if self.is_opening != 'Yes': + self.aging_date = self.posting_date + elif not self.aging_date: msgprint("Aging Date is mandatory for opening entry") raise Exception @@ -313,11 +313,11 @@ class SalesInvoice(SellingController): for d in self.get('entries'): if d.income_account not in against_acc: against_acc.append(d.income_account) - self.doc.against_income_account = ','.join(against_acc) + self.against_income_account = ','.join(against_acc) def add_remarks(self): - if not self.doc.remarks: self.doc.remarks = 'No Remarks' + if not self.remarks: self.remarks = 'No Remarks' def so_dn_required(self): @@ -333,20 +333,20 @@ class SalesInvoice(SellingController): def validate_proj_cust(self): """check for does customer belong to same project as entered..""" - if self.doc.project_name and self.doc.customer: + if self.project_name and self.customer: res = frappe.db.sql("""select name from `tabProject` where name = %s and (customer = %s or - ifnull(customer,'')='')""", (self.doc.project_name, self.doc.customer)) + ifnull(customer,'')='')""", (self.project_name, self.customer)) if not res: - msgprint("Customer - %s does not belong to project - %s. \n\nIf you want to use project for multiple customers then please make customer details blank in that project."%(self.doc.customer,self.doc.project_name)) + msgprint("Customer - %s does not belong to project - %s. \n\nIf you want to use project for multiple customers then please make customer details blank in that project."%(self.customer,self.project_name)) raise Exception def validate_pos(self): - if not self.doc.cash_bank_account and flt(self.doc.paid_amount): + if not self.cash_bank_account and flt(self.paid_amount): msgprint("Cash/Bank Account is mandatory for POS, for making payment entry") raise Exception - if flt(self.doc.paid_amount) + flt(self.doc.write_off_amount) \ - - flt(self.doc.grand_total) > 1/(10**(self.precision("grand_total") + 1)): + if flt(self.paid_amount) + flt(self.write_off_amount) \ + - flt(self.grand_total) > 1/(10**(self.precision("grand_total") + 1)): frappe.throw(_("""(Paid amount + Write Off Amount) can not be \ greater than Grand Total""")) @@ -364,15 +364,15 @@ class SalesInvoice(SellingController): def validate_write_off_account(self): - if flt(self.doc.write_off_amount) and not self.doc.write_off_account: + if flt(self.write_off_amount) and not self.write_off_account: msgprint("Please enter Write Off Account", raise_exception=1) def validate_c_form(self): """ Blank C-form no if C-form applicable marked as 'No'""" - if self.doc.amended_from and self.doc.c_form_applicable == 'No' and self.doc.c_form_no: + if self.amended_from and self.c_form_applicable == 'No' and self.c_form_no: frappe.db.sql("""delete from `tabC-Form Invoice Detail` where invoice_no = %s - and parent = %s""", (self.doc.amended_from, self.doc.c_form_no)) + and parent = %s""", (self.amended_from, self.c_form_no)) frappe.db.set(self.doc, 'c_form_no', '') @@ -391,11 +391,11 @@ class SalesInvoice(SellingController): def get_warehouse(self): w = frappe.db.sql("""select warehouse from `tabPOS Setting` where ifnull(user,'') = %s and company = %s""", - (frappe.session['user'], self.doc.company)) + (frappe.session['user'], self.company)) w = w and w[0][0] or '' if not w: ps = frappe.db.sql("""select name, warehouse from `tabPOS Setting` - where ifnull(user,'') = '' and company = %s""", self.doc.company) + where ifnull(user,'') = '' and company = %s""", self.company) if not ps: msgprint("To make POS entry, please create POS Setting from Accounts --> POS Setting page and refresh the system.", raise_exception=True) elif not ps[0][1]: @@ -405,9 +405,9 @@ class SalesInvoice(SellingController): return w def on_update(self): - if cint(self.doc.update_stock) == 1: + if cint(self.update_stock) == 1: # Set default warehouse from pos setting - if cint(self.doc.is_pos) == 1: + if cint(self.is_pos) == 1: w = self.get_warehouse() if w: for d in self.get('entries'): @@ -419,11 +419,11 @@ class SalesInvoice(SellingController): else: self.set('packing_details', []) - if cint(self.doc.is_pos) == 1: - if flt(self.doc.paid_amount) == 0: - if self.doc.cash_bank_account: + if cint(self.is_pos) == 1: + if flt(self.paid_amount) == 0: + if self.cash_bank_account: frappe.db.set(self.doc, 'paid_amount', - (flt(self.doc.grand_total) - flt(self.doc.write_off_amount))) + (flt(self.grand_total) - flt(self.write_off_amount))) else: # show message that the amount is not paid frappe.db.set(self.doc,'paid_amount',0) @@ -465,16 +465,16 @@ class SalesInvoice(SellingController): if gl_entries: from erpnext.accounts.general_ledger import make_gl_entries - update_outstanding = cint(self.doc.is_pos) and self.doc.write_off_account \ + update_outstanding = cint(self.is_pos) and self.write_off_account \ and 'No' or 'Yes' - make_gl_entries(gl_entries, cancel=(self.doc.docstatus == 2), + make_gl_entries(gl_entries, cancel=(self.docstatus == 2), update_outstanding=update_outstanding, merge_entries=False) - if repost_future_gle and cint(self.doc.update_stock) \ + if repost_future_gle and cint(self.update_stock) \ and cint(frappe.defaults.get_global_default("auto_accounting_for_stock")): items, warehouse_account = self.get_items_and_warehouse_accounts() from controllers.stock_controller import update_gl_entries_after - update_gl_entries_after(self.doc.posting_date, self.doc.posting_time, + update_gl_entries_after(self.posting_date, self.posting_time, warehouse_account, items) def get_gl_entries(self, warehouse_account=None): @@ -496,15 +496,15 @@ class SalesInvoice(SellingController): return gl_entries def make_customer_gl_entry(self, gl_entries): - if self.doc.grand_total: + if self.grand_total: gl_entries.append( self.get_gl_dict({ - "account": self.doc.debit_to, - "against": self.doc.against_income_account, - "debit": self.doc.grand_total, - "remarks": self.doc.remarks, - "against_voucher": self.doc.name, - "against_voucher_type": self.doc.doctype, + "account": self.debit_to, + "against": self.against_income_account, + "debit": self.grand_total, + "remarks": self.remarks, + "against_voucher": self.name, + "against_voucher_type": self.doctype, }) ) @@ -514,9 +514,9 @@ class SalesInvoice(SellingController): gl_entries.append( self.get_gl_dict({ "account": tax.account_head, - "against": self.doc.debit_to, + "against": self.debit_to, "credit": flt(tax.tax_amount_after_discount_amount), - "remarks": self.doc.remarks, + "remarks": self.remarks, "cost_center": tax.cost_center }) ) @@ -528,101 +528,101 @@ class SalesInvoice(SellingController): gl_entries.append( self.get_gl_dict({ "account": item.income_account, - "against": self.doc.debit_to, + "against": self.debit_to, "credit": item.base_amount, - "remarks": self.doc.remarks, + "remarks": self.remarks, "cost_center": item.cost_center }) ) # expense account gl entries if cint(frappe.defaults.get_global_default("auto_accounting_for_stock")) \ - and cint(self.doc.update_stock): + and cint(self.update_stock): gl_entries += super(DocType, self).get_gl_entries() def make_pos_gl_entries(self, gl_entries): - if cint(self.doc.is_pos) and self.doc.cash_bank_account and self.doc.paid_amount: + if cint(self.is_pos) and self.cash_bank_account and self.paid_amount: # POS, make payment entries gl_entries.append( self.get_gl_dict({ - "account": self.doc.debit_to, - "against": self.doc.cash_bank_account, - "credit": self.doc.paid_amount, - "remarks": self.doc.remarks, - "against_voucher": self.doc.name, - "against_voucher_type": self.doc.doctype, + "account": self.debit_to, + "against": self.cash_bank_account, + "credit": self.paid_amount, + "remarks": self.remarks, + "against_voucher": self.name, + "against_voucher_type": self.doctype, }) ) gl_entries.append( self.get_gl_dict({ - "account": self.doc.cash_bank_account, - "against": self.doc.debit_to, - "debit": self.doc.paid_amount, - "remarks": self.doc.remarks, + "account": self.cash_bank_account, + "against": self.debit_to, + "debit": self.paid_amount, + "remarks": self.remarks, }) ) # write off entries, applicable if only pos - if self.doc.write_off_account and self.doc.write_off_amount: + if self.write_off_account and self.write_off_amount: gl_entries.append( self.get_gl_dict({ - "account": self.doc.debit_to, - "against": self.doc.write_off_account, - "credit": self.doc.write_off_amount, - "remarks": self.doc.remarks, - "against_voucher": self.doc.name, - "against_voucher_type": self.doc.doctype, + "account": self.debit_to, + "against": self.write_off_account, + "credit": self.write_off_amount, + "remarks": self.remarks, + "against_voucher": self.name, + "against_voucher_type": self.doctype, }) ) gl_entries.append( self.get_gl_dict({ - "account": self.doc.write_off_account, - "against": self.doc.debit_to, - "debit": self.doc.write_off_amount, - "remarks": self.doc.remarks, - "cost_center": self.doc.write_off_cost_center + "account": self.write_off_account, + "against": self.debit_to, + "debit": self.write_off_amount, + "remarks": self.remarks, + "cost_center": self.write_off_cost_center }) ) def update_c_form(self): """Update amended id in C-form""" - if self.doc.c_form_no and self.doc.amended_from: + if self.c_form_no and self.amended_from: frappe.db.sql("""update `tabC-Form Invoice Detail` set invoice_no = %s, invoice_date = %s, territory = %s, net_total = %s, grand_total = %s where invoice_no = %s and parent = %s""", - (self.doc.name, self.doc.amended_from, self.doc.c_form_no)) + (self.name, self.amended_from, self.c_form_no)) def validate_recurring_invoice(self): - if self.doc.convert_into_recurring_invoice: + if self.convert_into_recurring_invoice: self.validate_notification_email_id() - if not self.doc.recurring_type: + if not self.recurring_type: msgprint(_("Please select: ") + self.meta.get_label("recurring_type"), raise_exception=1) - elif not (self.doc.invoice_period_from_date and \ - self.doc.invoice_period_to_date): + elif not (self.invoice_period_from_date and \ + self.invoice_period_to_date): msgprint(comma_and([self.meta.get_label("invoice_period_from_date"), self.meta.get_label("invoice_period_to_date")]) + _(": Mandatory for a Recurring Invoice."), raise_exception=True) def convert_to_recurring(self): - if self.doc.convert_into_recurring_invoice: - if not self.doc.recurring_id: + if self.convert_into_recurring_invoice: + if not self.recurring_id: frappe.db.set(self.doc, "recurring_id", make_autoname("RECINV/.#####")) self.set_next_date() - elif self.doc.recurring_id: + elif self.recurring_id: frappe.db.sql("""update `tabSales Invoice` set convert_into_recurring_invoice = 0 - where recurring_id = %s""", (self.doc.recurring_id,)) + where recurring_id = %s""", (self.recurring_id,)) def validate_notification_email_id(self): - if self.doc.notification_email_address: + if self.notification_email_address: email_list = filter(None, [cstr(email).strip() for email in - self.doc.notification_email_address.replace("\n", "").split(",")]) + self.notification_email_address.replace("\n", "").split(",")]) from frappe.utils import validate_email_add for email in email_list: @@ -637,13 +637,13 @@ class SalesInvoice(SellingController): def set_next_date(self): """ Set next date on which auto invoice will be created""" - if not self.doc.repeat_on_day_of_month: + if not self.repeat_on_day_of_month: msgprint("""Please enter 'Repeat on Day of Month' field value. The day of the month on which auto invoice will be generated e.g. 05, 28 etc.""", raise_exception=1) - next_date = get_next_date(self.doc.posting_date, - month_map[self.doc.recurring_type], cint(self.doc.repeat_on_day_of_month)) + next_date = get_next_date(self.posting_date, + month_map[self.recurring_type], cint(self.repeat_on_day_of_month)) frappe.db.set(self.doc, 'next_date', next_date) @@ -684,7 +684,7 @@ def manage_recurring_invoices(next_date=None, commit=True): frappe.db.begin() frappe.db.sql("update `tabSales Invoice` set \ convert_into_recurring_invoice = 0 where name = %s", ref_invoice) - notify_errors(ref_invoice, ref_wrapper.doc.customer, ref_wrapper.doc.owner) + notify_errors(ref_invoice, ref_wrapper.customer, ref_wrapper.owner) frappe.db.commit() exception_list.append(frappe.get_traceback()) @@ -701,30 +701,30 @@ def make_new_invoice(ref_wrapper, posting_date): from erpnext.accounts.utils import get_fiscal_year new_invoice = clone(ref_wrapper) - mcount = month_map[ref_wrapper.doc.recurring_type] + mcount = month_map[ref_wrapper.recurring_type] - invoice_period_from_date = get_next_date(ref_wrapper.doc.invoice_period_from_date, mcount) + invoice_period_from_date = get_next_date(ref_wrapper.invoice_period_from_date, mcount) # get last day of the month to maintain period if the from date is first day of its own month # and to date is the last day of its own month - if (cstr(get_first_day(ref_wrapper.doc.invoice_period_from_date)) == \ - cstr(ref_wrapper.doc.invoice_period_from_date)) and \ - (cstr(get_last_day(ref_wrapper.doc.invoice_period_to_date)) == \ - cstr(ref_wrapper.doc.invoice_period_to_date)): - invoice_period_to_date = get_last_day(get_next_date(ref_wrapper.doc.invoice_period_to_date, + if (cstr(get_first_day(ref_wrapper.invoice_period_from_date)) == \ + cstr(ref_wrapper.invoice_period_from_date)) and \ + (cstr(get_last_day(ref_wrapper.invoice_period_to_date)) == \ + cstr(ref_wrapper.invoice_period_to_date)): + invoice_period_to_date = get_last_day(get_next_date(ref_wrapper.invoice_period_to_date, mcount)) else: - invoice_period_to_date = get_next_date(ref_wrapper.doc.invoice_period_to_date, mcount) + invoice_period_to_date = get_next_date(ref_wrapper.invoice_period_to_date, mcount) - new_invoice.doc.fields.update({ + new_invoice.update({ "posting_date": posting_date, "aging_date": posting_date, - "due_date": add_days(posting_date, cint(date_diff(ref_wrapper.doc.due_date, - ref_wrapper.doc.posting_date))), + "due_date": add_days(posting_date, cint(date_diff(ref_wrapper.due_date, + ref_wrapper.posting_date))), "invoice_period_from_date": invoice_period_from_date, "invoice_period_to_date": invoice_period_to_date, "fiscal_year": get_fiscal_year(posting_date)[0], - "owner": ref_wrapper.doc.owner, + "owner": ref_wrapper.owner, }) new_invoice.submit() @@ -735,8 +735,8 @@ def send_notification(new_rv): """Notify concerned persons about recurring invoice generation""" from frappe.core.doctype.print_format.print_format import get_html - frappe.sendmail(new_rv.doc.notification_email_address, - subject="New Invoice : " + new_rv.doc.name, + frappe.sendmail(new_rv.notification_email_address, + subject="New Invoice : " + new_rv.name, message = get_html(new_rv.doc, new_rv.doclist, "SalesInvoice")) def notify_errors(inv, customer, owner): diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index 1c67e711a3..740e752dee 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -11,14 +11,14 @@ from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_per class TestSalesInvoice(unittest.TestCase): def make(self): w = frappe.bean(copy=test_records[0]) - w.doc.is_pos = 0 + w.is_pos = 0 w.insert() w.submit() return w def test_double_submission(self): w = frappe.bean(copy=test_records[0]) - w.doc.docstatus = '0' + w.docstatus = '0' w.insert() w2 = [d for d in w.doclist] @@ -29,7 +29,7 @@ class TestSalesInvoice(unittest.TestCase): def test_timestamp_change(self): w = frappe.bean(copy=test_records[0]) - w.doc.docstatus = '0' + w.docstatus = '0' w.insert() w2 = frappe.bean([d.fields.copy() for d in w.doclist]) @@ -60,11 +60,11 @@ class TestSalesInvoice(unittest.TestCase): # check if item values are calculated for d in si.get("entries"): for i, k in enumerate(expected_values["keys"]): - self.assertEquals(d.fields.get(k), expected_values[d.item_code][i]) + self.assertEquals(d.get(k), expected_values[d.item_code][i]) # check net total - self.assertEquals(si.doc.net_total, 1250) - self.assertEquals(si.doc.net_total_export, 1250) + self.assertEquals(si.net_total, 1250) + self.assertEquals(si.net_total_export, 1250) # check tax calculation expected_values = { @@ -81,15 +81,15 @@ class TestSalesInvoice(unittest.TestCase): for d in si.get("other_charges"): for i, k in enumerate(expected_values["keys"]): - self.assertEquals(d.fields.get(k), expected_values[d.account_head][i]) + self.assertEquals(d.get(k), expected_values[d.account_head][i]) - self.assertEquals(si.doc.grand_total, 1627.05) - self.assertEquals(si.doc.grand_total_export, 1627.05) + self.assertEquals(si.grand_total, 1627.05) + self.assertEquals(si.grand_total_export, 1627.05) def test_sales_invoice_calculation_export_currency(self): si = frappe.bean(copy=test_records[2]) - si.doc.currency = "USD" - si.doc.conversion_rate = 50 + si.currency = "USD" + si.conversion_rate = 50 si.doclist[1].rate = 1 si.doclist[1].price_list_rate = 1 si.doclist[2].rate = 3 @@ -110,11 +110,11 @@ class TestSalesInvoice(unittest.TestCase): # check if item values are calculated for d in si.get("entries"): for i, k in enumerate(expected_values["keys"]): - self.assertEquals(d.fields.get(k), expected_values[d.item_code][i]) + self.assertEquals(d.get(k), expected_values[d.item_code][i]) # check net total - self.assertEquals(si.doc.net_total, 1250) - self.assertEquals(si.doc.net_total_export, 25) + self.assertEquals(si.net_total, 1250) + self.assertEquals(si.net_total_export, 25) # check tax calculation expected_values = { @@ -131,14 +131,14 @@ class TestSalesInvoice(unittest.TestCase): for d in si.get("other_charges"): for i, k in enumerate(expected_values["keys"]): - self.assertEquals(d.fields.get(k), expected_values[d.account_head][i]) + self.assertEquals(d.get(k), expected_values[d.account_head][i]) - self.assertEquals(si.doc.grand_total, 1627.05) - self.assertEquals(si.doc.grand_total_export, 32.54) + self.assertEquals(si.grand_total, 1627.05) + self.assertEquals(si.grand_total_export, 32.54) def test_sales_invoice_discount_amount(self): si = frappe.bean(copy=test_records[3]) - si.doc.discount_amount = 104.95 + si.discount_amount = 104.95 si.append("other_charges", { "doctype": "Sales Taxes and Charges", "charge_type": "On Previous Row Amount", @@ -164,11 +164,11 @@ class TestSalesInvoice(unittest.TestCase): # check if item values are calculated for d in si.get("entries"): for i, k in enumerate(expected_values["keys"]): - self.assertEquals(d.fields.get(k), expected_values[d.item_code][i]) + self.assertEquals(d.get(k), expected_values[d.item_code][i]) # check net total - self.assertEquals(si.doc.net_total, 1163.45) - self.assertEquals(si.doc.net_total_export, 1578.3) + self.assertEquals(si.net_total, 1163.45) + self.assertEquals(si.net_total_export, 1578.3) # check tax calculation expected_values = { @@ -186,14 +186,14 @@ class TestSalesInvoice(unittest.TestCase): for d in si.get("other_charges"): for i, k in enumerate(expected_values["keys"]): - self.assertEquals(d.fields.get(k), expected_values[d.account_head][i]) + self.assertEquals(d.get(k), expected_values[d.account_head][i]) - self.assertEquals(si.doc.grand_total, 1500) - self.assertEquals(si.doc.grand_total_export, 1500) + self.assertEquals(si.grand_total, 1500) + self.assertEquals(si.grand_total_export, 1500) def test_discount_amount_gl_entry(self): si = frappe.bean(copy=test_records[3]) - si.doc.discount_amount = 104.95 + si.discount_amount = 104.95 si.append("other_charges", { "doctype": "Sales Taxes and Charges", "charge_type": "On Previous Row Amount", @@ -208,12 +208,12 @@ class TestSalesInvoice(unittest.TestCase): gl_entries = frappe.db.sql("""select account, debit, credit from `tabGL Entry` where voucher_type='Sales Invoice' and voucher_no=%s - order by account asc""", si.doc.name, as_dict=1) + order by account asc""", si.name, as_dict=1) self.assertTrue(gl_entries) expected_values = sorted([ - [si.doc.debit_to, 1500, 0.0], + [si.debit_to, 1500, 0.0], [test_records[3][1]["income_account"], 0.0, 1163.45], [test_records[3][3]["account_head"], 0.0, 130.31], [test_records[3][4]["account_head"], 0.0, 2.61], @@ -235,7 +235,7 @@ class TestSalesInvoice(unittest.TestCase): si.cancel() gle = frappe.db.sql("""select * from `tabGL Entry` - where voucher_type='Sales Invoice' and voucher_no=%s""", si.doc.name) + where voucher_type='Sales Invoice' and voucher_no=%s""", si.name) self.assertFalse(gle) @@ -275,11 +275,11 @@ class TestSalesInvoice(unittest.TestCase): # check if item values are calculated for d in si.get("entries"): for i, k in enumerate(expected_values["keys"]): - self.assertEquals(d.fields.get(k), expected_values[d.item_code][i]) + self.assertEquals(d.get(k), expected_values[d.item_code][i]) # check net total - self.assertEquals(si.doc.net_total, 1249.98) - self.assertEquals(si.doc.net_total_export, 1578.3) + self.assertEquals(si.net_total, 1249.98) + self.assertEquals(si.net_total_export, 1578.3) # check tax calculation expected_values = { @@ -296,16 +296,16 @@ class TestSalesInvoice(unittest.TestCase): for d in si.get("other_charges"): for i, k in enumerate(expected_values["keys"]): - self.assertEquals(d.fields.get(k), expected_values[d.account_head][i]) + self.assertEquals(d.get(k), expected_values[d.account_head][i]) - self.assertEquals(si.doc.grand_total, 1622.98) - self.assertEquals(si.doc.grand_total_export, 1622.98) + self.assertEquals(si.grand_total, 1622.98) + self.assertEquals(si.grand_total_export, 1622.98) def test_sales_invoice_calculation_export_currency_with_tax_inclusive_price(self): # prepare si = frappe.bean(copy=test_records[3]) - si.doc.currency = "USD" - si.doc.conversion_rate = 50 + si.currency = "USD" + si.conversion_rate = 50 si.doclist[1].price_list_rate = 55.56 si.doclist[1].discount_percentage = 10 si.doclist[2].price_list_rate = 187.5 @@ -328,11 +328,11 @@ class TestSalesInvoice(unittest.TestCase): # check if item values are calculated for d in si.get("entries"): for i, k in enumerate(expected_values["keys"]): - self.assertEquals(d.fields.get(k), expected_values[d.item_code][i]) + self.assertEquals(d.get(k), expected_values[d.item_code][i]) # check net total - self.assertEquals(si.doc.net_total, 49501.7) - self.assertEquals(si.doc.net_total_export, 1250) + self.assertEquals(si.net_total, 49501.7) + self.assertEquals(si.net_total_export, 1250) # check tax calculation expected_values = { @@ -349,14 +349,14 @@ class TestSalesInvoice(unittest.TestCase): for d in si.get("other_charges"): for i, k in enumerate(expected_values["keys"]): - self.assertEquals(d.fields.get(k), expected_values[d.account_head][i]) + self.assertEquals(d.get(k), expected_values[d.account_head][i]) - self.assertEquals(si.doc.grand_total, 65205.16) - self.assertEquals(si.doc.grand_total_export, 1304.1) + self.assertEquals(si.grand_total, 65205.16) + self.assertEquals(si.grand_total_export, 1304.1) def test_outstanding(self): w = self.make() - self.assertEquals(w.doc.outstanding_amount, w.doc.grand_total) + self.assertEquals(w.outstanding_amount, w.grand_total) def test_payment(self): frappe.db.sql("""delete from `tabGL Entry`""") @@ -366,15 +366,15 @@ class TestSalesInvoice(unittest.TestCase): import test_records as jv_test_records jv = frappe.bean(frappe.copy_doc(jv_test_records[0])) - jv.doclist[1].against_invoice = w.doc.name + jv.doclist[1].against_invoice = w.name jv.insert() jv.submit() - self.assertEquals(frappe.db.get_value("Sales Invoice", w.doc.name, "outstanding_amount"), + self.assertEquals(frappe.db.get_value("Sales Invoice", w.name, "outstanding_amount"), 161.8) jv.cancel() - self.assertEquals(frappe.db.get_value("Sales Invoice", w.doc.name, "outstanding_amount"), + self.assertEquals(frappe.db.get_value("Sales Invoice", w.name, "outstanding_amount"), 561.8) def test_time_log_batch(self): @@ -409,12 +409,12 @@ class TestSalesInvoice(unittest.TestCase): gl_entries = frappe.db.sql("""select account, debit, credit from `tabGL Entry` where voucher_type='Sales Invoice' and voucher_no=%s - order by account asc""", si.doc.name, as_dict=1) + order by account asc""", si.name, as_dict=1) self.assertTrue(gl_entries) expected_values = sorted([ - [si.doc.debit_to, 630.0, 0.0], + [si.debit_to, 630.0, 0.0], [test_records[1][1]["income_account"], 0.0, 500.0], [test_records[1][2]["account_head"], 0.0, 80.0], [test_records[1][3]["account_head"], 0.0, 50.0], @@ -429,7 +429,7 @@ class TestSalesInvoice(unittest.TestCase): si.cancel() gle = frappe.db.sql("""select * from `tabGL Entry` - where voucher_type='Sales Invoice' and voucher_no=%s""", si.doc.name) + where voucher_type='Sales Invoice' and voucher_no=%s""", si.name) self.assertFalse(gle) @@ -454,7 +454,7 @@ class TestSalesInvoice(unittest.TestCase): # check stock ledger entries sle = frappe.db.sql("""select * from `tabStock Ledger Entry` where voucher_type = 'Sales Invoice' and voucher_no = %s""", - si.doc.name, as_dict=1)[0] + si.name, as_dict=1)[0] self.assertTrue(sle) self.assertEquals([sle.item_code, sle.warehouse, sle.actual_qty], ["_Test Item", "_Test Warehouse - _TC", -1.0]) @@ -462,19 +462,19 @@ class TestSalesInvoice(unittest.TestCase): # check gl entries gl_entries = frappe.db.sql("""select account, debit, credit from `tabGL Entry` where voucher_type='Sales Invoice' and voucher_no=%s - order by account asc, debit asc""", si.doc.name, as_dict=1) + order by account asc, debit asc""", si.name, as_dict=1) self.assertTrue(gl_entries) stock_in_hand = frappe.db.get_value("Account", {"master_name": "_Test Warehouse - _TC"}) expected_gl_entries = sorted([ - [si.doc.debit_to, 630.0, 0.0], + [si.debit_to, 630.0, 0.0], [pos[1]["income_account"], 0.0, 500.0], [pos[2]["account_head"], 0.0, 80.0], [pos[3]["account_head"], 0.0, 50.0], [stock_in_hand, 0.0, 75.0], [pos[1]["expense_account"], 75.0, 0.0], - [si.doc.debit_to, 0.0, 600.0], + [si.debit_to, 0.0, 600.0], ["_Test Account Bank Account - _TC", 600.0, 0.0] ]) for i, gle in enumerate(gl_entries): @@ -484,7 +484,7 @@ class TestSalesInvoice(unittest.TestCase): si.cancel() gle = frappe.db.sql("""select * from `tabGL Entry` - where voucher_type='Sales Invoice' and voucher_no=%s""", si.doc.name) + where voucher_type='Sales Invoice' and voucher_no=%s""", si.name) self.assertFalse(gle) @@ -501,7 +501,7 @@ class TestSalesInvoice(unittest.TestCase): from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import test_records \ as pr_test_records pr = frappe.bean(copy=pr_test_records[0]) - pr.doc.naming_series = "_T-Purchase Receipt-" + pr.naming_series = "_T-Purchase Receipt-" pr.doclist[1].warehouse = "_Test Warehouse No Account - _TC" pr.insert() pr.submit() @@ -518,7 +518,7 @@ class TestSalesInvoice(unittest.TestCase): # check stock ledger entries sle = frappe.db.sql("""select * from `tabStock Ledger Entry` where voucher_type = 'Sales Invoice' and voucher_no = %s""", - si.doc.name, as_dict=1)[0] + si.name, as_dict=1)[0] self.assertTrue(sle) self.assertEquals([sle.item_code, sle.warehouse, sle.actual_qty], ["_Test Item", "_Test Warehouse No Account - _TC", -1.0]) @@ -526,11 +526,11 @@ class TestSalesInvoice(unittest.TestCase): # check gl entries gl_entries = frappe.db.sql("""select account, debit, credit from `tabGL Entry` where voucher_type='Sales Invoice' and voucher_no=%s - order by account asc, debit asc""", si.doc.name, as_dict=1) + order by account asc, debit asc""", si.name, as_dict=1) self.assertTrue(gl_entries) expected_gl_entries = sorted([ - [si.doc.debit_to, 630.0, 0.0], + [si.debit_to, 630.0, 0.0], [si_doclist[1]["income_account"], 0.0, 500.0], [si_doclist[2]["account_head"], 0.0, 80.0], [si_doclist[3]["account_head"], 0.0, 50.0], @@ -542,7 +542,7 @@ class TestSalesInvoice(unittest.TestCase): si.cancel() gle = frappe.db.sql("""select * from `tabGL Entry` - where voucher_type='Sales Invoice' and voucher_no=%s""", si.doc.name) + where voucher_type='Sales Invoice' and voucher_no=%s""", si.name) self.assertFalse(gle) set_perpetual_inventory(0) @@ -559,11 +559,11 @@ class TestSalesInvoice(unittest.TestCase): gl_entries = frappe.db.sql("""select account, debit, credit from `tabGL Entry` where voucher_type='Sales Invoice' and voucher_no=%s - order by account asc""", si.doc.name, as_dict=1) + order by account asc""", si.name, as_dict=1) self.assertTrue(gl_entries) expected_values = sorted([ - [si.doc.debit_to, 630.0, 0.0], + [si.debit_to, 630.0, 0.0], [test_records[1][1]["income_account"], 0.0, 500.0], [test_records[1][2]["account_head"], 0.0, 80.0], [test_records[1][3]["account_head"], 0.0, 50.0], @@ -586,11 +586,11 @@ class TestSalesInvoice(unittest.TestCase): gl_entries = frappe.db.sql("""select account, debit, credit from `tabGL Entry` where voucher_type='Sales Invoice' and voucher_no=%s - order by account asc""", si.doc.name, as_dict=1) + order by account asc""", si.name, as_dict=1) self.assertTrue(gl_entries) expected_values = sorted([ - [si.doc.debit_to, 630.0, 0.0], + [si.debit_to, 630.0, 0.0], [test_records[1][1]["income_account"], 0.0, 500.0], [test_records[1][2]["account_head"], 0.0, 80.0], [test_records[1][3]["account_head"], 0.0, 50.0], @@ -606,7 +606,7 @@ class TestSalesInvoice(unittest.TestCase): from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import test_records \ as pr_test_records pr = frappe.bean(copy=pr_test_records[0]) - pr.doc.naming_series = "_T-Purchase Receipt-" + pr.naming_series = "_T-Purchase Receipt-" pr.insert() pr.submit() @@ -614,7 +614,7 @@ class TestSalesInvoice(unittest.TestCase): from erpnext.stock.doctype.delivery_note.test_delivery_note import test_records \ as dn_test_records dn = frappe.bean(copy=dn_test_records[0]) - dn.doc.naming_series = "_T-Delivery Note-" + dn.naming_series = "_T-Delivery Note-" dn.insert() dn.submit() return dn @@ -638,35 +638,35 @@ class TestSalesInvoice(unittest.TestCase): si = frappe.bean(copy=test_records[0]) si.append("advance_adjustment_details", { "doctype": "Sales Invoice Advance", - "journal_voucher": jv.doc.name, + "journal_voucher": jv.name, "jv_detail_no": jv.doclist[1].name, "advance_amount": 400, "allocated_amount": 300, - "remarks": jv.doc.remark + "remarks": jv.remark }) si.insert() si.submit() si.load_from_db() self.assertTrue(frappe.db.sql("""select name from `tabJournal Voucher Detail` - where against_invoice=%s""", si.doc.name)) + where against_invoice=%s""", si.name)) self.assertTrue(frappe.db.sql("""select name from `tabJournal Voucher Detail` - where against_invoice=%s and credit=300""", si.doc.name)) + where against_invoice=%s and credit=300""", si.name)) - self.assertEqual(si.doc.outstanding_amount, 261.8) + self.assertEqual(si.outstanding_amount, 261.8) si.cancel() self.assertTrue(not frappe.db.sql("""select name from `tabJournal Voucher Detail` - where against_invoice=%s""", si.doc.name)) + where against_invoice=%s""", si.name)) def test_recurring_invoice(self): from frappe.utils import get_first_day, get_last_day, add_to_date, nowdate, getdate from erpnext.accounts.utils import get_fiscal_year today = nowdate() base_si = frappe.bean(copy=test_records[0]) - base_si.doc.fields.update({ + base_si.update({ "convert_into_recurring_invoice": 1, "recurring_type": "Monthly", "notification_email_address": "test@example.com, test1@example.com, test2@example.com", @@ -685,7 +685,7 @@ class TestSalesInvoice(unittest.TestCase): # monthly without a first and last day period si2 = frappe.bean(copy=base_si.doclist) - si2.doc.fields.update({ + si2.update({ "invoice_period_from_date": today, "invoice_period_to_date": add_to_date(today, days=30) }) @@ -695,7 +695,7 @@ class TestSalesInvoice(unittest.TestCase): # quarterly si3 = frappe.bean(copy=base_si.doclist) - si3.doc.fields.update({ + si3.update({ "recurring_type": "Quarterly", "invoice_period_from_date": get_first_day(today), "invoice_period_to_date": get_last_day(add_to_date(today, months=3)) @@ -706,7 +706,7 @@ class TestSalesInvoice(unittest.TestCase): # quarterly without a first and last day period si4 = frappe.bean(copy=base_si.doclist) - si4.doc.fields.update({ + si4.update({ "recurring_type": "Quarterly", "invoice_period_from_date": today, "invoice_period_to_date": add_to_date(today, months=3) @@ -717,7 +717,7 @@ class TestSalesInvoice(unittest.TestCase): # yearly si5 = frappe.bean(copy=base_si.doclist) - si5.doc.fields.update({ + si5.update({ "recurring_type": "Yearly", "invoice_period_from_date": get_first_day(today), "invoice_period_to_date": get_last_day(add_to_date(today, years=1)) @@ -728,7 +728,7 @@ class TestSalesInvoice(unittest.TestCase): # yearly without a first and last day period si6 = frappe.bean(copy=base_si.doclist) - si6.doc.fields.update({ + si6.update({ "recurring_type": "Yearly", "invoice_period_from_date": today, "invoice_period_to_date": add_to_date(today, years=1) @@ -739,14 +739,14 @@ class TestSalesInvoice(unittest.TestCase): # change posting date but keep recuring day to be today si7 = frappe.bean(copy=base_si.doclist) - si7.doc.fields.update({ + si7.update({ "posting_date": add_to_date(today, days=-1) }) si7.insert() si7.submit() # setting so that _test function works - si7.doc.posting_date = today + si7.posting_date = today self._test_recurring_invoice(si7, True) def _test_recurring_invoice(self, base_si, first_and_last_day): @@ -754,20 +754,20 @@ class TestSalesInvoice(unittest.TestCase): from erpnext.accounts.doctype.sales_invoice.sales_invoice \ import manage_recurring_invoices, get_next_date - no_of_months = ({"Monthly": 1, "Quarterly": 3, "Yearly": 12})[base_si.doc.recurring_type] + no_of_months = ({"Monthly": 1, "Quarterly": 3, "Yearly": 12})[base_si.recurring_type] def _test(i): self.assertEquals(i+1, frappe.db.sql("""select count(*) from `tabSales Invoice` - where recurring_id=%s and docstatus=1""", base_si.doc.recurring_id)[0][0]) + where recurring_id=%s and docstatus=1""", base_si.recurring_id)[0][0]) - next_date = get_next_date(base_si.doc.posting_date, no_of_months, - base_si.doc.repeat_on_day_of_month) + next_date = get_next_date(base_si.posting_date, no_of_months, + base_si.repeat_on_day_of_month) manage_recurring_invoices(next_date=next_date, commit=False) recurred_invoices = frappe.db.sql("""select name from `tabSales Invoice` where recurring_id=%s and docstatus=1 order by name desc""", - base_si.doc.recurring_id) + base_si.recurring_id) self.assertEquals(i+2, len(recurred_invoices)) @@ -775,21 +775,21 @@ class TestSalesInvoice(unittest.TestCase): for fieldname in ["convert_into_recurring_invoice", "recurring_type", "repeat_on_day_of_month", "notification_email_address"]: - self.assertEquals(base_si.doc.fields.get(fieldname), - new_si.doc.fields.get(fieldname)) + self.assertEquals(base_si.get(fieldname), + new_si.get(fieldname)) - self.assertEquals(new_si.doc.posting_date, unicode(next_date)) + self.assertEquals(new_si.posting_date, unicode(next_date)) - self.assertEquals(new_si.doc.invoice_period_from_date, - unicode(add_months(base_si.doc.invoice_period_from_date, no_of_months))) + self.assertEquals(new_si.invoice_period_from_date, + unicode(add_months(base_si.invoice_period_from_date, no_of_months))) if first_and_last_day: - self.assertEquals(new_si.doc.invoice_period_to_date, - unicode(get_last_day(add_months(base_si.doc.invoice_period_to_date, + self.assertEquals(new_si.invoice_period_to_date, + unicode(get_last_day(add_months(base_si.invoice_period_to_date, no_of_months)))) else: - self.assertEquals(new_si.doc.invoice_period_to_date, - unicode(add_months(base_si.doc.invoice_period_to_date, no_of_months))) + self.assertEquals(new_si.invoice_period_to_date, + unicode(add_months(base_si.invoice_period_to_date, no_of_months))) return new_si @@ -812,7 +812,7 @@ class TestSalesInvoice(unittest.TestCase): serial_nos = get_serial_nos(se.doclist[1].serial_no) si = frappe.bean(copy=test_records[0]) - si.doc.update_stock = 1 + si.update_stock = 1 si.doclist[1].item_code = "_Test Serialized Item With Series" si.doclist[1].qty = 1 si.doclist[1].serial_no = serial_nos[0] @@ -822,7 +822,7 @@ class TestSalesInvoice(unittest.TestCase): self.assertEquals(frappe.db.get_value("Serial No", serial_nos[0], "status"), "Delivered") self.assertFalse(frappe.db.get_value("Serial No", serial_nos[0], "warehouse")) self.assertEquals(frappe.db.get_value("Serial No", serial_nos[0], - "delivery_document_no"), si.doc.name) + "delivery_document_no"), si.name) return si @@ -846,11 +846,11 @@ class TestSalesInvoice(unittest.TestCase): serial_nos = get_serial_nos(se.doclist[1].serial_no) sr = frappe.bean("Serial No", serial_nos[0]) - sr.doc.status = "Not Available" + sr.status = "Not Available" sr.save() si = frappe.bean(copy=test_records[0]) - si.doc.update_stock = 1 + si.update_stock = 1 si.doclist[1].item_code = "_Test Serialized Item With Series" si.doclist[1].qty = 1 si.doclist[1].serial_no = serial_nos[0] diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.py b/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.py index 0546ce721b..76417e369e 100644 --- a/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.py +++ b/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.py @@ -8,10 +8,10 @@ from frappe.model.controller import DocListController class SalesTaxesAndChargesMaster(DocListController): def validate(self): - if self.doc.is_default == 1: + if self.is_default == 1: frappe.db.sql("""update `tabSales Taxes and Charges Master` set is_default = 0 where ifnull(is_default,0) = 1 and name != %s and company = %s""", - (self.doc.name, self.doc.company)) + (self.name, self.company)) # at least one territory self.validate_table_has_rows("valid_for_territories") \ No newline at end of file diff --git a/erpnext/accounts/doctype/shipping_rule/shipping_rule.py b/erpnext/accounts/doctype/shipping_rule/shipping_rule.py index e450e70a23..d27565e89a 100644 --- a/erpnext/accounts/doctype/shipping_rule/shipping_rule.py +++ b/erpnext/accounts/doctype/shipping_rule/shipping_rule.py @@ -74,7 +74,7 @@ class ShippingRule(DocListController): overlaps.append([d1, d2]) if overlaps: - company_currency = get_company_currency(self.doc.company) + company_currency = get_company_currency(self.company) msgprint(_("Error") + ": " + _("Overlapping Conditions found between") + ":") messages = [] for d1, d2 in overlaps: diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py index 97c22fd9e1..1557e3f3c6 100644 --- a/erpnext/accounts/party.py +++ b/erpnext/accounts/party.py @@ -178,4 +178,4 @@ def create_party_account(party, party_type, company): "report_type": "Balance Sheet" }).insert(ignore_permissions=True) - frappe.msgprint(_("Account Created") + ": " + account.doc.name) + frappe.msgprint(_("Account Created") + ": " + account.name) diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index 260344c241..db13d62012 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -104,11 +104,11 @@ def add_ac(args=None): args.pop("cmd") ac = frappe.bean(args) - ac.doc.doctype = "Account" - ac.doc.old_parent = "" - ac.doc.freeze_account = "No" + ac.doctype = "Account" + ac.old_parent = "" + ac.freeze_account = "No" ac.insert() - return ac.doc.name + return ac.name @frappe.whitelist() def add_cc(args=None): @@ -117,10 +117,10 @@ def add_cc(args=None): args.pop("cmd") cc = frappe.bean(args) - cc.doc.doctype = "Cost Center" - cc.doc.old_parent = "" + cc.doctype = "Cost Center" + cc.old_parent = "" cc.insert() - return cc.doc.name + return cc.name def reconcile_against_document(args): """ @@ -185,8 +185,8 @@ def update_against_doc(d, jv_obj): ch.account = d['account'] ch.cost_center = cstr(jvd[0][0]) ch.balance = cstr(jvd[0][1]) - ch.fields[d['dr_or_cr']] = flt(d['unadjusted_amt']) - flt(d['allocated_amt']) - ch.fields[d['dr_or_cr']== 'debit' and 'credit' or 'debit'] = 0 + ch.set(d['dr_or_cr'], flt(d['unadjusted_amt']) - flt(d['allocated_amt'])) + ch.set(d['dr_or_cr']== 'debit' and 'credit' or 'debit', 0) ch.against_account = cstr(jvd[0][2]) ch.is_advance = cstr(jvd[0][3]) ch.docstatus = 1 diff --git a/erpnext/buying/doctype/buying_settings/buying_settings.py b/erpnext/buying/doctype/buying_settings/buying_settings.py index 1f63798ed9..eea9f9ce19 100644 --- a/erpnext/buying/doctype/buying_settings/buying_settings.py +++ b/erpnext/buying/doctype/buying_settings/buying_settings.py @@ -12,8 +12,8 @@ class BuyingSettings(Document): def validate(self): for key in ["supplier_type", "supp_master_name", "maintain_same_rate", "buying_price_list"]: - frappe.db.set_default(key, self.doc.fields.get(key, "")) + frappe.db.set_default(key, self.get(key, "")) from erpnext.setup.doctype.naming_series.naming_series import set_by_naming_series set_by_naming_series("Supplier", "supplier_name", - self.doc.get("supp_master_name")=="Naming Series", hide_name_field=False) + self.get("supp_master_name")=="Naming Series", hide_name_field=False) diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.py b/erpnext/buying/doctype/purchase_common/purchase_common.py index 8ae364906c..ec8c281eea 100644 --- a/erpnext/buying/doctype/purchase_common/purchase_common.py +++ b/erpnext/buying/doctype/purchase_common/purchase_common.py @@ -17,11 +17,11 @@ class PurchaseCommon(BuyingController): """updates last_purchase_rate in item table for each item""" import frappe.utils - this_purchase_date = frappe.utils.getdate(obj.doc.fields.get('posting_date') or obj.doc.fields.get('transaction_date')) + this_purchase_date = frappe.utils.getdate(obj.get('posting_date') or obj.get('transaction_date')) for d in getlist(obj.doclist,obj.fname): # get last purchase details - last_purchase_details = get_last_purchase_details(d.item_code, obj.doc.name) + last_purchase_details = get_last_purchase_details(d.item_code, obj.name) # compare last purchase date and this transaction's date last_purchase_rate = None @@ -44,8 +44,8 @@ class PurchaseCommon(BuyingController): def get_last_purchase_rate(self, obj): """get last purchase rates for all items""" - doc_name = obj.doc.name - conversion_rate = flt(obj.doc.fields.get('conversion_rate')) or 1.0 + doc_name = obj.name + conversion_rate = flt(obj.get('conversion_rate')) or 1.0 for d in getlist(obj.doclist, obj.fname): if d.item_code: @@ -83,7 +83,7 @@ class PurchaseCommon(BuyingController): f_lst.pop('received_qty') for x in f_lst : if d.fields.has_key(x): - d.fields[x] = f_lst[x] + d.set(x, f_lst[x]) item = frappe.db.sql("""select is_stock_item, is_purchase_item, is_sub_contracted_item, end_of_life from `tabItem` where name=%s""", d.item_code) diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index 587256ee89..7b1c24d37e 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -29,11 +29,11 @@ class PurchaseOrder(BuyingController): def validate(self): super(DocType, self).validate() - if not self.doc.status: - self.doc.status = "Draft" + if not self.status: + self.status = "Draft" from erpnext.utilities import validate_status - validate_status(self.doc.status, ["Draft", "Submitted", "Stopped", + validate_status(self.status, ["Draft", "Submitted", "Stopped", "Cancelled"]) pc_obj = get_obj(dt='Purchase Common') @@ -99,7 +99,7 @@ class PurchaseOrder(BuyingController): # get qty and pending_qty of prevdoc curr_ref_qty = pc_obj.get_qty(d.doctype, 'prevdoc_detail_docname', d.prevdoc_detail_docname, 'Material Request Item', - 'Material Request - Purchase Order', self.doc.name) + 'Material Request - Purchase Order', self.name) max_qty, qty, curr_qty = flt(curr_ref_qty.split('~~~')[1]), \ flt(curr_ref_qty.split('~~~')[0]), 0 @@ -119,17 +119,17 @@ class PurchaseOrder(BuyingController): "warehouse": d.warehouse, "ordered_qty": (is_submit and 1 or -1) * flt(po_qty), "indented_qty": (is_submit and 1 or -1) * flt(ind_qty), - "posting_date": self.doc.transaction_date + "posting_date": self.transaction_date } update_bin(args) def check_modified_date(self): mod_db = frappe.db.sql("select modified from `tabPurchase Order` where name = %s", - self.doc.name) - date_diff = frappe.db.sql("select TIMEDIFF('%s', '%s')" % ( mod_db[0][0],cstr(self.doc.modified))) + self.name) + date_diff = frappe.db.sql("select TIMEDIFF('%s', '%s')" % ( mod_db[0][0],cstr(self.modified))) if date_diff and date_diff[0][0]: - msgprint(cstr(self.doc.doctype) +" => "+ cstr(self.doc.name) +" has been modified. Please Refresh. ") + msgprint(cstr(self.doctype) +" => "+ cstr(self.name) +" has been modified. Please Refresh. ") raise Exception def update_status(self, status): @@ -141,7 +141,7 @@ class PurchaseOrder(BuyingController): self.update_bin(is_submit = (status == 'Submitted') and 1 or 0, is_stopped = 1) # step 3:=> Acknowledge user - msgprint(self.doc.doctype + ": " + self.doc.name + " has been %s." % ((status == 'Submitted') and 'Unstopped' or cstr(status))) + msgprint(self.doctype + ": " + self.name + " has been %s." % ((status == 'Submitted') and 'Unstopped' or cstr(status))) def on_submit(self): purchase_controller = frappe.get_obj("Purchase Common") @@ -149,8 +149,8 @@ class PurchaseOrder(BuyingController): self.update_prevdoc_status() self.update_bin(is_submit = 1, is_stopped = 0) - get_obj('Authorization Control').validate_approving_authority(self.doc.doctype, - self.doc.company, self.doc.grand_total) + get_obj('Authorization Control').validate_approving_authority(self.doctype, + self.company, self.grand_total) purchase_controller.update_last_purchase_rate(self, is_submit = 1) @@ -161,13 +161,13 @@ class PurchaseOrder(BuyingController): self.check_for_stopped_status(pc_obj) # Check if Purchase Receipt has been submitted against current Purchase Order - pc_obj.check_docstatus(check = 'Next', doctype = 'Purchase Receipt', docname = self.doc.name, detail_doctype = 'Purchase Receipt Item') + pc_obj.check_docstatus(check = 'Next', doctype = 'Purchase Receipt', docname = self.name, detail_doctype = 'Purchase Receipt Item') # Check if Purchase Invoice has been submitted against current Purchase Order submitted = frappe.db.sql("""select t1.name from `tabPurchase Invoice` t1,`tabPurchase Invoice Item` t2 where t1.name = t2.parent and t2.purchase_order = %s and t1.docstatus = 1""", - self.doc.name) + self.name) if submitted: msgprint("Purchase Invoice : " + cstr(submitted[0][0]) + " has already been submitted !") raise Exception diff --git a/erpnext/buying/doctype/purchase_order/test_purchase_order.py b/erpnext/buying/doctype/purchase_order/test_purchase_order.py index d0df0df068..1bc7c5473d 100644 --- a/erpnext/buying/doctype/purchase_order/test_purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/test_purchase_order.py @@ -14,12 +14,12 @@ class TestPurchaseOrder(unittest.TestCase): po = frappe.bean(copy=test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_purchase_receipt, - po.doc.name) + po.name) - po = frappe.bean("Purchase Order", po.doc.name) + po = frappe.bean("Purchase Order", po.name) po.submit() - pr = make_purchase_receipt(po.doc.name) + pr = make_purchase_receipt(po.name) pr[0]["supplier_warehouse"] = "_Test Warehouse 1 - _TC" pr[0]["posting_date"] = "2013-05-12" self.assertEquals(pr[0]["doctype"], "Purchase Receipt") @@ -37,17 +37,17 @@ class TestPurchaseOrder(unittest.TestCase): po = frappe.bean(copy=test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_purchase_receipt, - po.doc.name) + po.name) - po = frappe.bean("Purchase Order", po.doc.name) - po.doc.is_subcontracted = "No" + po = frappe.bean("Purchase Order", po.name) + po.is_subcontracted = "No" po.doclist[1].item_code = "_Test Item" po.submit() self.assertEquals(frappe.db.get_value("Bin", {"item_code": "_Test Item", "warehouse": "_Test Warehouse - _TC"}, "ordered_qty"), 10) - pr = make_purchase_receipt(po.doc.name) + pr = make_purchase_receipt(po.name) self.assertEquals(pr[0]["doctype"], "Purchase Receipt") self.assertEquals(len(pr), len(test_records[0])) @@ -63,7 +63,7 @@ class TestPurchaseOrder(unittest.TestCase): frappe.db.set_value('Item', '_Test Item', 'tolerance', 50) - pr1 = make_purchase_receipt(po.doc.name) + pr1 = make_purchase_receipt(po.name) pr1[0]["naming_series"] = "_T-Purchase Receipt-" pr1[0]["posting_date"] = "2013-05-12" pr1[1]["qty"] = 8 @@ -80,11 +80,11 @@ class TestPurchaseOrder(unittest.TestCase): po = frappe.bean(copy=test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_purchase_invoice, - po.doc.name) + po.name) - po = frappe.bean("Purchase Order", po.doc.name) + po = frappe.bean("Purchase Order", po.name) po.submit() - pi = make_purchase_invoice(po.doc.name) + pi = make_purchase_invoice(po.name) self.assertEquals(pi[0]["doctype"], "Purchase Invoice") self.assertEquals(len(pi), len(test_records[0])) @@ -100,8 +100,8 @@ class TestPurchaseOrder(unittest.TestCase): def test_warehouse_company_validation(self): from erpnext.stock.utils import InvalidWarehouseCompany po = frappe.bean(copy=test_records[0]) - po.doc.company = "_Test Company 1" - po.doc.conversion_rate = 0.0167 + po.company = "_Test Company 1" + po.conversion_rate = 0.0167 self.assertRaises(InvalidWarehouseCompany, po.insert) def test_uom_integer_validation(self): diff --git a/erpnext/buying/doctype/quality_inspection/quality_inspection.py b/erpnext/buying/doctype/quality_inspection/quality_inspection.py index 4e289dcfcc..3fc130a7ac 100644 --- a/erpnext/buying/doctype/quality_inspection/quality_inspection.py +++ b/erpnext/buying/doctype/quality_inspection/quality_inspection.py @@ -12,28 +12,28 @@ class QualityInspection(Document): def get_item_specification_details(self): self.set('qa_specification_details', []) specification = frappe.db.sql("select specification, value from `tabItem Quality Inspection Parameter` \ - where parent = '%s' order by idx" % (self.doc.item_code)) + where parent = '%s' order by idx" % (self.item_code)) for d in specification: - child = self.doc.append('qa_specification_details', {}) + child = self.append('qa_specification_details', {}) child.specification = d[0] child.value = d[1] child.status = 'Accepted' def on_submit(self): - if self.doc.purchase_receipt_no: + if self.purchase_receipt_no: frappe.db.sql("""update `tabPurchase Receipt Item` t1, `tabPurchase Receipt` t2 set t1.qa_no = %s, t2.modified = %s where t1.parent = %s and t1.item_code = %s and t1.parent = t2.name""", - (self.doc.name, self.doc.modified, self.doc.purchase_receipt_no, - self.doc.item_code)) + (self.name, self.modified, self.purchase_receipt_no, + self.item_code)) def on_cancel(self): - if self.doc.purchase_receipt_no: + if self.purchase_receipt_no: frappe.db.sql("""update `tabPurchase Receipt Item` t1, `tabPurchase Receipt` t2 set t1.qa_no = '', t2.modified = %s where t1.parent = %s and t1.item_code = %s and t1.parent = t2.name""", - (self.doc.modified, self.doc.purchase_receipt_no, self.doc.item_code)) + (self.modified, self.purchase_receipt_no, self.item_code)) def item_query(doctype, txt, searchfield, start, page_len, filters): diff --git a/erpnext/buying/doctype/supplier/supplier.py b/erpnext/buying/doctype/supplier/supplier.py index 0102edca64..cb97d72432 100644 --- a/erpnext/buying/doctype/supplier/supplier.py +++ b/erpnext/buying/doctype/supplier/supplier.py @@ -18,44 +18,44 @@ class Supplier(TransactionBase): supp_master_name = frappe.defaults.get_global_default('supp_master_name') if supp_master_name == 'Supplier Name': - if frappe.db.exists("Customer", self.doc.supplier_name): + if frappe.db.exists("Customer", self.supplier_name): frappe.msgprint(_("A Customer exists with same name"), raise_exception=1) - self.doc.name = self.doc.supplier_name + self.name = self.supplier_name else: - self.doc.name = make_autoname(self.doc.naming_series + '.#####') + self.name = make_autoname(self.naming_series + '.#####') def update_address(self): frappe.db.sql("""update `tabAddress` set supplier_name=%s, modified=NOW() - where supplier=%s""", (self.doc.supplier_name, self.doc.name)) + where supplier=%s""", (self.supplier_name, self.name)) def update_contact(self): frappe.db.sql("""update `tabContact` set supplier_name=%s, modified=NOW() - where supplier=%s""", (self.doc.supplier_name, self.doc.name)) + where supplier=%s""", (self.supplier_name, self.name)) def update_credit_days_limit(self): frappe.db.sql("""update tabAccount set credit_days = %s where name = %s""", - (cint(self.doc.credit_days), self.doc.name + " - " + self.get_company_abbr())) + (cint(self.credit_days), self.name + " - " + self.get_company_abbr())) def on_update(self): - if not self.doc.naming_series: - self.doc.naming_series = '' + if not self.naming_series: + self.naming_series = '' self.update_address() self.update_contact() # create account head - create_party_account(self.doc.name, "Supplier", self.doc.company) + create_party_account(self.name, "Supplier", self.company) # update credit days and limit in account self.update_credit_days_limit() def get_company_abbr(self): - return frappe.db.sql("select abbr from tabCompany where name=%s", self.doc.company)[0][0] + return frappe.db.sql("select abbr from tabCompany where name=%s", self.company)[0][0] def validate(self): #validation for Naming Series mandatory field... if frappe.defaults.get_global_default('supp_master_name') == 'Naming Series': - if not self.doc.naming_series: + if not self.naming_series: msgprint("Series is Mandatory.", raise_exception=1) def get_contacts(self,nm): @@ -67,18 +67,18 @@ class Supplier(TransactionBase): return '' def delete_supplier_address(self): - for rec in frappe.db.sql("select * from `tabAddress` where supplier=%s", (self.doc.name,), as_dict=1): + for rec in frappe.db.sql("select * from `tabAddress` where supplier=%s", (self.name,), as_dict=1): frappe.db.sql("delete from `tabAddress` where name=%s",(rec['name'])) def delete_supplier_contact(self): for contact in frappe.db.sql_list("""select name from `tabContact` - where supplier=%s""", self.doc.name): + where supplier=%s""", self.name): frappe.delete_doc("Contact", contact) def delete_supplier_account(self): """delete supplier's ledger if exist and check balance before deletion""" acc = frappe.db.sql("select name from `tabAccount` where master_type = 'Supplier' \ - and master_name = %s and docstatus < 2", self.doc.name) + and master_name = %s and docstatus < 2", self.name) if acc: frappe.delete_doc('Account', acc[0][0]) @@ -89,7 +89,7 @@ class Supplier(TransactionBase): def before_rename(self, olddn, newdn, merge=False): from erpnext.accounts.utils import rename_account_for - rename_account_for("Supplier", olddn, newdn, merge, self.doc.company) + rename_account_for("Supplier", olddn, newdn, merge, self.company) def after_rename(self, olddn, newdn, merge=False): set_field = '' diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py index edebfb3015..8a11bfe7c1 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py @@ -14,11 +14,11 @@ class SupplierQuotation(BuyingController): def validate(self): super(DocType, self).validate() - if not self.doc.status: - self.doc.status = "Draft" + if not self.status: + self.status = "Draft" from erpnext.utilities import validate_status - validate_status(self.doc.status, ["Draft", "Submitted", "Stopped", + validate_status(self.status, ["Draft", "Submitted", "Stopped", "Cancelled"]) self.validate_common() diff --git a/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py b/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py index a5374fbe55..3e5461ab3a 100644 --- a/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py +++ b/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py @@ -14,11 +14,11 @@ class TestPurchaseOrder(unittest.TestCase): sq = frappe.bean(copy=test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_purchase_order, - sq.doc.name) + sq.name) - sq = frappe.bean("Supplier Quotation", sq.doc.name) + sq = frappe.bean("Supplier Quotation", sq.name) sq.submit() - po = make_purchase_order(sq.doc.name) + po = make_purchase_order(sq.name) self.assertEquals(po[0]["doctype"], "Purchase Order") self.assertEquals(len(po), len(sq.doclist)) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 3eac80f440..7ebd1af919 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -24,10 +24,10 @@ class AccountsController(TransactionBase): def set_missing_values(self, for_validate=False): for fieldname in ["posting_date", "transaction_date"]: - if not self.doc.fields.get(fieldname) and self.meta.get_field(fieldname): - self.doc.fields[fieldname] = today() - if not self.doc.fiscal_year: - self.doc.fiscal_year = get_fiscal_year(self.doc.fields[fieldname])[0] + if not self.get(fieldname) and self.meta.get_field(fieldname): + self.set(fieldname, today()) + if not self.fiscal_year: + self.fiscal_year = get_fiscal_year(self.fields[fieldname])[0] def validate_date_with_fiscal_year(self): if self.meta.get_field("fiscal_year") : @@ -37,16 +37,16 @@ class AccountsController(TransactionBase): elif self.meta.get_field("transaction_date"): date_field = "transaction_date" - if date_field and self.doc.fields[date_field]: - validate_fiscal_year(self.doc.fields[date_field], self.doc.fiscal_year, + if date_field and self.fields[date_field]: + validate_fiscal_year(self.fields[date_field], self.fiscal_year, label=self.meta.get_label(date_field)) def validate_for_freezed_account(self): for fieldname in ["customer", "supplier"]: - if self.meta.get_field(fieldname) and self.doc.fields.get(fieldname): + if self.meta.get_field(fieldname) and self.get(fieldname): accounts = frappe.db.get_values("Account", - {"master_type": fieldname.title(), "master_name": self.doc.fields[fieldname], - "company": self.doc.company}, "name") + {"master_type": fieldname.title(), "master_name": self.fields[fieldname], + "company": self.company}, "name") if accounts: from erpnext.accounts.doctype.gl_entry.gl_entry import validate_frozen_account for account in accounts: @@ -54,30 +54,30 @@ class AccountsController(TransactionBase): def set_price_list_currency(self, buying_or_selling): if self.meta.get_field("currency"): - company_currency = get_company_currency(self.doc.company) + company_currency = get_company_currency(self.company) # price list part fieldname = "selling_price_list" if buying_or_selling.lower() == "selling" \ else "buying_price_list" - if self.meta.get_field(fieldname) and self.doc.fields.get(fieldname): - self.doc.price_list_currency = frappe.db.get_value("Price List", - self.doc.fields.get(fieldname), "currency") + if self.meta.get_field(fieldname) and self.get(fieldname): + self.price_list_currency = frappe.db.get_value("Price List", + self.get(fieldname), "currency") - if self.doc.price_list_currency == company_currency: - self.doc.plc_conversion_rate = 1.0 + if self.price_list_currency == company_currency: + self.plc_conversion_rate = 1.0 - elif not self.doc.plc_conversion_rate: - self.doc.plc_conversion_rate = self.get_exchange_rate( - self.doc.price_list_currency, company_currency) + elif not self.plc_conversion_rate: + self.plc_conversion_rate = self.get_exchange_rate( + self.price_list_currency, company_currency) # currency - if not self.doc.currency: - self.doc.currency = self.doc.price_list_currency - self.doc.conversion_rate = self.doc.plc_conversion_rate - elif self.doc.currency == company_currency: - self.doc.conversion_rate = 1.0 - elif not self.doc.conversion_rate: - self.doc.conversion_rate = self.get_exchange_rate(self.doc.currency, + if not self.currency: + self.currency = self.price_list_currency + self.conversion_rate = self.plc_conversion_rate + elif self.currency == company_currency: + self.conversion_rate = 1.0 + elif not self.conversion_rate: + self.conversion_rate = self.get_exchange_rate(self.currency, company_currency) def get_exchange_rate(self, from_currency, to_currency): @@ -88,14 +88,14 @@ class AccountsController(TransactionBase): """set missing item values""" from erpnext.stock.get_item_details import get_item_details for item in self.get(self.fname): - if item.fields.get("item_code"): + if item.get("item_code"): args = item.fields.copy() - args.update(self.doc.fields) + args.update(self.fields) ret = get_item_details(args) for fieldname, value in ret.items(): if self.meta.get_field(fieldname, parentfield=self.fname) and \ - item.fields.get(fieldname) is None and value is not None: - item.fields[fieldname] = value + item.get(fieldname) is None and value is not None: + item.set(fieldname, value) def set_taxes(self, tax_parentfield, tax_master_field): if not self.meta.get_field(tax_parentfield): @@ -104,22 +104,21 @@ class AccountsController(TransactionBase): tax_master_doctype = self.meta.get_field(tax_master_field).options if not self.get(tax_parentfield): - if not self.doc.fields.get(tax_master_field): + if not self.get(tax_master_field): # get the default tax master - self.doc.fields[tax_master_field] = \ - frappe.db.get_value(tax_master_doctype, {"is_default": 1}) + self.set(tax_master_field, frappe.db.get_value(tax_master_doctype, {"is_default": 1})) self.append_taxes_from_master(tax_parentfield, tax_master_field, tax_master_doctype) def append_taxes_from_master(self, tax_parentfield, tax_master_field, tax_master_doctype=None): - if self.doc.fields.get(tax_master_field): + if self.get(tax_master_field): if not tax_master_doctype: tax_master_doctype = self.meta.get_field(tax_master_field).options tax_doctype = self.meta.get_field(tax_parentfield).options from frappe.model import default_fields - tax_master = frappe.bean(tax_master_doctype, self.doc.fields.get(tax_master_field)) + tax_master = frappe.bean(tax_master_doctype, self.get(tax_master_field)) for i, tax in enumerate(tax_master.get(tax_parentfield)): for fieldname in default_fields: @@ -140,16 +139,16 @@ class AccountsController(TransactionBase): def _calculate_taxes_and_totals(self): # validate conversion rate - company_currency = get_company_currency(self.doc.company) - if not self.doc.currency or self.doc.currency == company_currency: - self.doc.currency = company_currency - self.doc.conversion_rate = 1.0 + company_currency = get_company_currency(self.company) + if not self.currency or self.currency == company_currency: + self.currency = company_currency + self.conversion_rate = 1.0 else: from erpnext.setup.doctype.currency.currency import validate_conversion_rate - validate_conversion_rate(self.doc.currency, self.doc.conversion_rate, - self.meta.get_label("conversion_rate"), self.doc.company) + validate_conversion_rate(self.currency, self.conversion_rate, + self.meta.get_label("conversion_rate"), self.company) - self.doc.conversion_rate = flt(self.doc.conversion_rate) + self.conversion_rate = flt(self.conversion_rate) self.item_doclist = self.get(self.fname) self.tax_doclist = self.get(self.other_fname) @@ -175,7 +174,7 @@ class AccountsController(TransactionBase): tax_fields.append("tax_amount") for fieldname in tax_fields: - tax.fields[fieldname] = 0.0 + tax.set(fieldname, 0.0) self.validate_on_previous_row(tax) self.validate_inclusive_tax(tax) @@ -297,7 +296,7 @@ class AccountsController(TransactionBase): self.precision("tax_amount", tax)) def adjust_discount_amount_loss(self, tax): - discount_amount_loss = self.doc.grand_total - flt(self.doc.discount_amount) - tax.total + discount_amount_loss = self.grand_total - flt(self.discount_amount) - tax.total tax.tax_amount_after_discount_amount = flt(tax.tax_amount_after_discount_amount + discount_amount_loss, self.precision("tax_amount", tax)) tax.total = flt(tax.total + discount_amount_loss, self.precision("total", tax)) @@ -309,8 +308,8 @@ class AccountsController(TransactionBase): if tax.charge_type == "Actual": # distribute the tax amount proportionally to each item row actual = flt(tax.rate, self.precision("tax_amount", tax)) - current_tax_amount = (self.doc.net_total - and ((item.base_amount / self.doc.net_total) * actual) + current_tax_amount = (self.net_total + and ((item.base_amount / self.net_total) * actual) or 0) elif tax.charge_type == "On Net Total": current_tax_amount = (tax_rate / 100.0) * item.base_amount @@ -355,32 +354,32 @@ class AccountsController(TransactionBase): def _set_in_company_currency(self, item, print_field, base_field): """set values in base currency""" - item.fields[base_field] = flt((flt(item.fields[print_field], - self.precision(print_field, item)) * self.doc.conversion_rate), + item.set(base_field, flt((flt(item.fields[print_field],) + self.precision(print_field, item)) * self.conversion_rate), self.precision(base_field, item)) def calculate_total_advance(self, parenttype, advance_parentfield): - if self.doc.doctype == parenttype and self.doc.docstatus < 2: + if self.doctype == parenttype and self.docstatus < 2: sum_of_allocated_amount = sum([flt(adv.allocated_amount, self.precision("allocated_amount", adv)) for adv in self.get(advance_parentfield)]) - self.doc.total_advance = flt(sum_of_allocated_amount, self.precision("total_advance")) + self.total_advance = flt(sum_of_allocated_amount, self.precision("total_advance")) self.calculate_outstanding_amount() def get_gl_dict(self, args): """this method populates the common properties of a gl entry record""" gl_dict = frappe._dict({ - 'company': self.doc.company, - 'posting_date': self.doc.posting_date, - 'voucher_type': self.doc.doctype, - 'voucher_no': self.doc.name, - 'aging_date': self.doc.fields.get("aging_date") or self.doc.posting_date, - 'remarks': self.doc.remarks, - 'fiscal_year': self.doc.fiscal_year, + 'company': self.company, + 'posting_date': self.posting_date, + 'voucher_type': self.doctype, + 'voucher_no': self.name, + 'aging_date': self.get("aging_date") or self.posting_date, + 'remarks': self.remarks, + 'fiscal_year': self.fiscal_year, 'debit': 0, 'credit': 0, - 'is_opening': self.doc.fields.get("is_opening") or "No", + 'is_opening': self.get("is_opening") or "No", }) gl_dict.update(args) return gl_dict @@ -389,7 +388,7 @@ class AccountsController(TransactionBase): self.doclist.remove_items({"parentfield": parentfield, "allocated_amount": ["in", [0, None, ""]]}) frappe.db.sql("""delete from `tab%s` where parentfield=%s and parent = %s - and ifnull(allocated_amount, 0) = 0""" % (childtype, '%s', '%s'), (parentfield, self.doc.name)) + and ifnull(allocated_amount, 0) = 0""" % (childtype, '%s', '%s'), (parentfield, self.name)) def get_advances(self, account_head, child_doctype, parentfield, dr_or_cr): res = frappe.db.sql("""select t1.name as jv_no, t1.remark, @@ -419,7 +418,7 @@ class AccountsController(TransactionBase): global_tolerance = None for item in self.get("entries"): - if item.fields.get(item_ref_dn): + if item.get(item_ref_dn): ref_amt = flt(frappe.db.get_value(ref_dt + " Item", item.fields[item_ref_dn], based_on), self.precision(based_on, item)) if not ref_amt: @@ -429,7 +428,7 @@ class AccountsController(TransactionBase): already_billed = frappe.db.sql("""select sum(%s) from `tab%s` where %s=%s and docstatus=1 and parent != %s""" % (based_on, self.tname, item_ref_dn, '%s', '%s'), - (item.fields[item_ref_dn], self.doc.name))[0][0] + (item.fields[item_ref_dn], self.name))[0][0] total_billed_amt = flt(flt(already_billed) + flt(item.fields[based_on]), self.precision(based_on, item)) @@ -455,7 +454,7 @@ class AccountsController(TransactionBase): def get_company_default(self, fieldname): from erpnext.accounts.utils import get_company_default - return get_company_default(self.doc.company, fieldname) + return get_company_default(self.company, fieldname) def get_stock_items(self): stock_items = [] @@ -471,7 +470,7 @@ class AccountsController(TransactionBase): @property def company_abbr(self): if not hasattr(self, "_abbr"): - self._abbr = frappe.db.get_value("Company", self.doc.company, "abbr") + self._abbr = frappe.db.get_value("Company", self.company, "abbr") return self._abbr diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index 6392e58cd4..ebf84cdeeb 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -17,9 +17,9 @@ class BuyingController(StockController): def validate(self): super(BuyingController, self).validate() - if self.doc.supplier and not self.doc.supplier_name: - self.doc.supplier_name = frappe.db.get_value("Supplier", - self.doc.supplier, "supplier_name") + if self.supplier and not self.supplier_name: + self.supplier_name = frappe.db.get_value("Supplier", + self.supplier, "supplier_name") self.is_item_table_empty() self.validate_stock_or_nonstock_items() self.validate_warehouse() @@ -31,19 +31,19 @@ class BuyingController(StockController): self.set_price_list_currency("Buying") # set contact and address details for supplier, if they are not mentioned - if self.doc.supplier: - self.doc.update_if_missing(get_party_details(self.doc.supplier, party_type="Supplier")) + if self.supplier: + self.update_if_missing(get_party_details(self.supplier, party_type="Supplier")) self.set_missing_item_details() - if self.doc.fields.get("__islocal"): + if self.get("__islocal"): self.set_taxes("other_charges", "taxes_and_charges") def set_supplier_from_item_default(self): - if self.meta.get_field("supplier") and not self.doc.supplier: + if self.meta.get_field("supplier") and not self.supplier: for d in self.doclist.get({"doctype": self.tname}): supplier = frappe.db.get_value("Item", d.item_code, "default_supplier") if supplier: - self.doc.supplier = supplier + self.supplier = supplier break def validate_warehouse(self): @@ -53,7 +53,7 @@ class BuyingController(StockController): self.doclist.get({"doctype": self.tname}) if d.warehouse])) for w in warehouses: - validate_warehouse_company(w, self.doc.company) + validate_warehouse_company(w, self.company) def validate_stock_or_nonstock_items(self): if not self.get_stock_items(): @@ -65,12 +65,12 @@ class BuyingController(StockController): def set_total_in_words(self): from frappe.utils import money_in_words - company_currency = get_company_currency(self.doc.company) + company_currency = get_company_currency(self.company) if self.meta.get_field("in_words"): - self.doc.in_words = money_in_words(self.doc.grand_total, company_currency) + self.in_words = money_in_words(self.grand_total, company_currency) if self.meta.get_field("in_words_import"): - self.doc.in_words_import = money_in_words(self.doc.grand_total_import, - self.doc.currency) + self.in_words_import = money_in_words(self.grand_total_import, + self.currency) def calculate_taxes_and_totals(self): self.other_fname = "other_charges" @@ -97,54 +97,54 @@ class BuyingController(StockController): def calculate_net_total(self): - self.doc.net_total = self.doc.net_total_import = 0.0 + self.net_total = self.net_total_import = 0.0 for item in self.item_doclist: - self.doc.net_total += item.base_amount - self.doc.net_total_import += item.amount + self.net_total += item.base_amount + self.net_total_import += item.amount self.round_floats_in(self.doc, ["net_total", "net_total_import"]) def calculate_totals(self): - self.doc.grand_total = flt(self.tax_doclist[-1].total if self.tax_doclist - else self.doc.net_total, self.precision("grand_total")) - self.doc.grand_total_import = flt(self.doc.grand_total / self.doc.conversion_rate, + self.grand_total = flt(self.tax_doclist[-1].total if self.tax_doclist + else self.net_total, self.precision("grand_total")) + self.grand_total_import = flt(self.grand_total / self.conversion_rate, self.precision("grand_total_import")) - self.doc.total_tax = flt(self.doc.grand_total - self.doc.net_total, + self.total_tax = flt(self.grand_total - self.net_total, self.precision("total_tax")) if self.meta.get_field("rounded_total"): - self.doc.rounded_total = _round(self.doc.grand_total) + self.rounded_total = _round(self.grand_total) if self.meta.get_field("rounded_total_import"): - self.doc.rounded_total_import = _round(self.doc.grand_total_import) + self.rounded_total_import = _round(self.grand_total_import) if self.meta.get_field("other_charges_added"): - self.doc.other_charges_added = flt(sum([flt(d.tax_amount) for d in self.tax_doclist + self.other_charges_added = flt(sum([flt(d.tax_amount) for d in self.tax_doclist if d.add_deduct_tax=="Add" and d.category in ["Valuation and Total", "Total"]]), self.precision("other_charges_added")) if self.meta.get_field("other_charges_deducted"): - self.doc.other_charges_deducted = flt(sum([flt(d.tax_amount) for d in self.tax_doclist + self.other_charges_deducted = flt(sum([flt(d.tax_amount) for d in self.tax_doclist if d.add_deduct_tax=="Deduct" and d.category in ["Valuation and Total", "Total"]]), self.precision("other_charges_deducted")) if self.meta.get_field("other_charges_added_import"): - self.doc.other_charges_added_import = flt(self.doc.other_charges_added / - self.doc.conversion_rate, self.precision("other_charges_added_import")) + self.other_charges_added_import = flt(self.other_charges_added / + self.conversion_rate, self.precision("other_charges_added_import")) if self.meta.get_field("other_charges_deducted_import"): - self.doc.other_charges_deducted_import = flt(self.doc.other_charges_deducted / - self.doc.conversion_rate, self.precision("other_charges_deducted_import")) + self.other_charges_deducted_import = flt(self.other_charges_deducted / + self.conversion_rate, self.precision("other_charges_deducted_import")) def calculate_outstanding_amount(self): - if self.doc.doctype == "Purchase Invoice" and self.doc.docstatus == 0: - self.doc.total_advance = flt(self.doc.total_advance, + if self.doctype == "Purchase Invoice" and self.docstatus == 0: + self.total_advance = flt(self.total_advance, self.precision("total_advance")) - self.doc.total_amount_to_pay = flt(self.doc.grand_total - flt(self.doc.write_off_amount, + self.total_amount_to_pay = flt(self.grand_total - flt(self.write_off_amount, self.precision("write_off_amount")), self.precision("total_amount_to_pay")) - self.doc.outstanding_amount = flt(self.doc.total_amount_to_pay - self.doc.total_advance, + self.outstanding_amount = flt(self.total_amount_to_pay - self.total_advance, self.precision("outstanding_amount")) def _cleanup(self): @@ -208,18 +208,18 @@ class BuyingController(StockController): item.valuation_rate = 0.0 def validate_for_subcontracting(self): - if not self.doc.is_subcontracted and self.sub_contracted_items: + if not self.is_subcontracted and self.sub_contracted_items: frappe.msgprint(_("""Please enter whether %s is made for subcontracting or purchasing, - in 'Is Subcontracted' field""" % self.doc.doctype), raise_exception=1) + in 'Is Subcontracted' field""" % self.doctype), raise_exception=1) - if self.doc.doctype == "Purchase Receipt" and self.doc.is_subcontracted=="Yes" \ - and not self.doc.supplier_warehouse: + if self.doctype == "Purchase Receipt" and self.is_subcontracted=="Yes" \ + and not self.supplier_warehouse: frappe.msgprint(_("Supplier Warehouse mandatory subcontracted purchase receipt"), raise_exception=1) def update_raw_materials_supplied(self, raw_material_table): self.set(raw_material_table, []) - if self.doc.is_subcontracted=="Yes": + if self.is_subcontracted=="Yes": for item in self.get(self.fname): if item.item_code in self.sub_contracted_items: self.add_bom_items(item, raw_material_table) @@ -230,7 +230,7 @@ class BuyingController(StockController): for item in bom_items: required_qty = flt(item.qty_consumed_per_unit) * flt(d.qty) * flt(d.conversion_factor) rm_doclist = { - "doctype": self.doc.doctype + " Item Supplied", + "doctype": self.doctype + " Item Supplied", "reference_name": d.name, "bom_detail_no": item.name, "main_item_code": d.item_code, @@ -241,7 +241,7 @@ class BuyingController(StockController): "rate": item.rate, "amount": required_qty * flt(item.rate) } - if self.doc.doctype == "Purchase Receipt": + if self.doctype == "Purchase Receipt": rm_doclist.update({ "consumed_qty": required_qty, "description": item.description, @@ -251,7 +251,7 @@ class BuyingController(StockController): raw_materials_cost += required_qty * flt(item.rate) - if self.doc.doctype == "Purchase Receipt": + if self.doctype == "Purchase Receipt": d.rm_supp_cost = raw_materials_cost def get_items_from_default_bom(self, item_code): diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index a3d140bd1e..def5eb0dd5 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -28,27 +28,27 @@ class SellingController(StockController): # set contact and address details for customer, if they are not mentioned self.set_missing_lead_customer_details() self.set_price_list_and_item_details() - if self.doc.fields.get("__islocal"): + if self.get("__islocal"): self.set_taxes("other_charges", "taxes_and_charges") def set_missing_lead_customer_details(self): - if self.doc.customer: + if self.customer: from erpnext.accounts.party import _get_party_details - self.doc.update_if_missing(_get_party_details(self.doc.customer, + self.update_if_missing(_get_party_details(self.customer, ignore_permissions=self.bean.ignore_permissions)) - elif self.doc.lead: + elif self.lead: from erpnext.selling.doctype.lead.lead import get_lead_details - self.doc.update_if_missing(get_lead_details(self.doc.lead)) + self.update_if_missing(get_lead_details(self.lead)) def set_price_list_and_item_details(self): self.set_price_list_currency("Selling") self.set_missing_item_details() def apply_shipping_rule(self): - if self.doc.shipping_rule: - shipping_rule = frappe.bean("Shipping Rule", self.doc.shipping_rule) - value = self.doc.net_total + if self.shipping_rule: + shipping_rule = frappe.bean("Shipping Rule", self.shipping_rule) + value = self.net_total # TODO # shipping rule calculation based on item's net weight @@ -62,25 +62,25 @@ class SellingController(StockController): self.append("other_charges", { "doctype": "Sales Taxes and Charges", "charge_type": "Actual", - "account_head": shipping_rule.doc.account, - "cost_center": shipping_rule.doc.cost_center, - "description": shipping_rule.doc.label, + "account_head": shipping_rule.account, + "cost_center": shipping_rule.cost_center, + "description": shipping_rule.label, "rate": shipping_amount }) def set_total_in_words(self): from frappe.utils import money_in_words - company_currency = get_company_currency(self.doc.company) + company_currency = get_company_currency(self.company) disable_rounded_total = cint(frappe.db.get_value("Global Defaults", None, "disable_rounded_total")) if self.meta.get_field("in_words"): - self.doc.in_words = money_in_words(disable_rounded_total and - self.doc.grand_total or self.doc.rounded_total, company_currency) + self.in_words = money_in_words(disable_rounded_total and + self.grand_total or self.rounded_total, company_currency) if self.meta.get_field("in_words_export"): - self.doc.in_words_export = money_in_words(disable_rounded_total and - self.doc.grand_total_export or self.doc.rounded_total_export, self.doc.currency) + self.in_words_export = money_in_words(disable_rounded_total and + self.grand_total_export or self.rounded_total_export, self.currency) def calculate_taxes_and_totals(self): self.other_fname = "other_charges" @@ -112,7 +112,7 @@ class SellingController(StockController): cumulated_tax_fraction += tax.tax_fraction_for_current_item if cumulated_tax_fraction and not self.discount_amount_applied: - item.base_amount = flt((item.amount * self.doc.conversion_rate) / + item.base_amount = flt((item.amount * self.conversion_rate) / (1 + cumulated_tax_fraction), self.precision("base_amount", item)) item.base_rate = flt(item.base_amount / item.qty, self.precision("base_rate", item)) @@ -166,38 +166,38 @@ class SellingController(StockController): self._set_in_company_currency(item, "amount", "base_amount") def calculate_net_total(self): - self.doc.net_total = self.doc.net_total_export = 0.0 + self.net_total = self.net_total_export = 0.0 for item in self.item_doclist: - self.doc.net_total += item.base_amount - self.doc.net_total_export += item.amount + self.net_total += item.base_amount + self.net_total_export += item.amount self.round_floats_in(self.doc, ["net_total", "net_total_export"]) def calculate_totals(self): - self.doc.grand_total = flt(self.tax_doclist and \ - self.tax_doclist[-1].total or self.doc.net_total, self.precision("grand_total")) - self.doc.grand_total_export = flt(self.doc.grand_total / self.doc.conversion_rate, + self.grand_total = flt(self.tax_doclist and \ + self.tax_doclist[-1].total or self.net_total, self.precision("grand_total")) + self.grand_total_export = flt(self.grand_total / self.conversion_rate, self.precision("grand_total_export")) - self.doc.other_charges_total = flt(self.doc.grand_total - self.doc.net_total, + self.other_charges_total = flt(self.grand_total - self.net_total, self.precision("other_charges_total")) - self.doc.other_charges_total_export = flt(self.doc.grand_total_export - - self.doc.net_total_export + flt(self.doc.discount_amount), + self.other_charges_total_export = flt(self.grand_total_export - + self.net_total_export + flt(self.discount_amount), self.precision("other_charges_total_export")) - self.doc.rounded_total = _round(self.doc.grand_total) - self.doc.rounded_total_export = _round(self.doc.grand_total_export) + self.rounded_total = _round(self.grand_total) + self.rounded_total_export = _round(self.grand_total_export) def apply_discount_amount(self): - if self.doc.discount_amount: + if self.discount_amount: grand_total_for_discount_amount = self.get_grand_total_for_discount_amount() if grand_total_for_discount_amount: # calculate item amount after Discount Amount for item in self.item_doclist: - distributed_amount = flt(self.doc.discount_amount) * item.base_amount / grand_total_for_discount_amount + distributed_amount = flt(self.discount_amount) * item.base_amount / grand_total_for_discount_amount item.base_amount = flt(item.base_amount - distributed_amount, self.precision("base_amount", item)) self.discount_amount_applied = True @@ -214,7 +214,7 @@ class SellingController(StockController): flt(tax.rate) / 100 actual_taxes_dict.setdefault(tax.idx, actual_tax_amount) - grand_total_for_discount_amount = flt(self.doc.grand_total - sum(actual_taxes_dict.values()), + grand_total_for_discount_amount = flt(self.grand_total - sum(actual_taxes_dict.values()), self.precision("grand_total")) return grand_total_for_discount_amount @@ -222,21 +222,21 @@ class SellingController(StockController): # NOTE: # write_off_amount is only for POS Invoice # total_advance is only for non POS Invoice - if self.doc.doctype == "Sales Invoice" and self.doc.docstatus == 0: + if self.doctype == "Sales Invoice" and self.docstatus == 0: self.round_floats_in(self.doc, ["grand_total", "total_advance", "write_off_amount", "paid_amount"]) - total_amount_to_pay = self.doc.grand_total - self.doc.write_off_amount - self.doc.outstanding_amount = flt(total_amount_to_pay - self.doc.total_advance \ - - self.doc.paid_amount, self.precision("outstanding_amount")) + total_amount_to_pay = self.grand_total - self.write_off_amount + self.outstanding_amount = flt(total_amount_to_pay - self.total_advance \ + - self.paid_amount, self.precision("outstanding_amount")) def calculate_commission(self): if self.meta.get_field("commission_rate"): self.round_floats_in(self.doc, ["net_total", "commission_rate"]) - if self.doc.commission_rate > 100.0: + if self.commission_rate > 100.0: msgprint(_(self.meta.get_label("commission_rate")) + " " + _("cannot be greater than 100"), raise_exception=True) - self.doc.total_commission = flt(self.doc.net_total * self.doc.commission_rate / 100.0, + self.total_commission = flt(self.net_total * self.commission_rate / 100.0, self.precision("total_commission")) def calculate_contribution(self): @@ -246,7 +246,7 @@ class SellingController(StockController): self.round_floats_in(sales_person) sales_person.allocated_amount = flt( - self.doc.net_total * sales_person.allocated_percentage / 100.0, + self.net_total * sales_person.allocated_percentage / 100.0, self.precision("allocated_amount", sales_person)) total += sales_person.allocated_percentage @@ -258,15 +258,15 @@ class SellingController(StockController): def validate_order_type(self): valid_types = ["Sales", "Maintenance", "Shopping Cart"] - if not self.doc.order_type: - self.doc.order_type = "Sales" - elif self.doc.order_type not in valid_types: + if not self.order_type: + self.order_type = "Sales" + elif self.order_type not in valid_types: msgprint(_(self.meta.get_label("order_type")) + " " + _("must be one of") + ": " + comma_or(valid_types), raise_exception=True) def check_credit(self, grand_total): - customer_account = frappe.db.get_value("Account", {"company": self.doc.company, - "master_name": self.doc.customer}, "name") + customer_account = frappe.db.get_value("Account", {"company": self.company, + "master_name": self.customer}, "name") if customer_account: total_outstanding = frappe.db.sql("""select sum(ifnull(debit, 0)) - sum(ifnull(credit, 0)) @@ -291,7 +291,7 @@ class SellingController(StockController): reserved_warehouse = "" reserved_qty_for_main_item = 0 - if self.doc.doctype == "Sales Order": + if self.doctype == "Sales Order": if (frappe.db.get_value("Item", d.item_code, "is_stock_item") == 'Yes' or self.has_sales_bom(d.item_code)) and not d.warehouse: frappe.throw(_("Please enter Reserved Warehouse for item ") + @@ -300,11 +300,11 @@ class SellingController(StockController): if flt(d.qty) > flt(d.delivered_qty): reserved_qty_for_main_item = flt(d.qty) - flt(d.delivered_qty) - if self.doc.doctype == "Delivery Note" and d.against_sales_order: + if self.doctype == "Delivery Note" and d.against_sales_order: # if SO qty is 10 and there is tolerance of 20%, then it will allow DN of 12. # But in this case reserved qty should only be reduced by 10 and not 12 - already_delivered_qty = self.get_already_delivered_qty(self.doc.name, + already_delivered_qty = self.get_already_delivered_qty(self.name, d.against_sales_order, d.prevdoc_detail_docname) so_qty, reserved_warehouse = self.get_so_qty_and_warehouse(d.prevdoc_detail_docname) @@ -362,10 +362,10 @@ class SellingController(StockController): def check_stop_sales_order(self, ref_fieldname): for d in self.get(self.fname): - if d.fields.get(ref_fieldname): + if d.get(ref_fieldname): status = frappe.db.get_value("Sales Order", d.fields[ref_fieldname], "status") if status == "Stopped": - frappe.throw(self.doc.doctype + + frappe.throw(self.doctype + _(" can not be created/modified against stopped Sales Order ") + d.fields[ref_fieldname]) diff --git a/erpnext/controllers/status_updater.py b/erpnext/controllers/status_updater.py index 30bc02ec23..dee9833406 100644 --- a/erpnext/controllers/status_updater.py +++ b/erpnext/controllers/status_updater.py @@ -25,27 +25,27 @@ status_map = { ], "Opportunity": [ ["Draft", None], - ["Submitted", "eval:self.doc.docstatus==1"], - ["Lost", "eval:self.doc.status=='Lost'"], + ["Submitted", "eval:self.docstatus==1"], + ["Lost", "eval:self.status=='Lost'"], ["Quotation", "has_quotation"], ["Replied", "communication_sent"], - ["Cancelled", "eval:self.doc.docstatus==2"], + ["Cancelled", "eval:self.docstatus==2"], ["Open", "communication_received"], ], "Quotation": [ ["Draft", None], - ["Submitted", "eval:self.doc.docstatus==1"], - ["Lost", "eval:self.doc.status=='Lost'"], + ["Submitted", "eval:self.docstatus==1"], + ["Lost", "eval:self.status=='Lost'"], ["Ordered", "has_sales_order"], ["Replied", "communication_sent"], - ["Cancelled", "eval:self.doc.docstatus==2"], + ["Cancelled", "eval:self.docstatus==2"], ["Open", "communication_received"], ], "Sales Order": [ ["Draft", None], - ["Submitted", "eval:self.doc.docstatus==1"], - ["Stopped", "eval:self.doc.status=='Stopped'"], - ["Cancelled", "eval:self.doc.docstatus==2"], + ["Submitted", "eval:self.docstatus==1"], + ["Stopped", "eval:self.status=='Stopped'"], + ["Cancelled", "eval:self.docstatus==2"], ], "Support Ticket": [ ["Replied", "communication_sent"], @@ -66,26 +66,26 @@ class StatusUpdater(DocListController): self.validate_qty() def set_status(self, update=False): - if self.doc.get("__islocal"): + if self.get("__islocal"): return - if self.doc.doctype in status_map: - sl = status_map[self.doc.doctype][:] + if self.doctype in status_map: + sl = status_map[self.doctype][:] sl.reverse() for s in sl: if not s[1]: - self.doc.status = s[0] + self.status = s[0] break elif s[1].startswith("eval:"): if eval(s[1][5:]): - self.doc.status = s[0] + self.status = s[0] break elif getattr(self, s[1])(): - self.doc.status = s[0] + self.status = s[0] break if update: - frappe.db.set_value(self.doc.doctype, self.doc.name, "status", self.doc.status) + frappe.db.set_value(self.doctype, self.name, "status", self.status) def on_communication(self): self.communication_set = True @@ -114,7 +114,7 @@ class StatusUpdater(DocListController): for args in self.status_updater: # get unique transactions to update for d in self.doclist: - if d.doctype == args['source_dt'] and d.fields.get(args["join_field"]): + if d.doctype == args['source_dt'] and d.get(args["join_field"]): args['name'] = d.fields[args['join_field']] # get all qty where qty > target_field @@ -181,10 +181,10 @@ class StatusUpdater(DocListController): """ for args in self.status_updater: # condition to include current record (if submit or no if cancel) - if self.doc.docstatus == 1: - args['cond'] = ' or parent="%s"' % self.doc.name.replace('"', '\"') + if self.docstatus == 1: + args['cond'] = ' or parent="%s"' % self.name.replace('"', '\"') else: - args['cond'] = ' and parent!="%s"' % self.doc.name.replace('"', '\"') + args['cond'] = ' and parent!="%s"' % self.name.replace('"', '\"') args['modified_cond'] = '' if change_modified: @@ -194,7 +194,7 @@ class StatusUpdater(DocListController): for d in self.doclist: if d.doctype == args['source_dt']: # updates qty in the child table - args['detail_id'] = d.fields.get(args['join_field']) + args['detail_id'] = d.get(args['join_field']) args['second_source_condition'] = "" if args.get('second_source_dt') and args.get('second_source_field') \ @@ -212,7 +212,7 @@ class StatusUpdater(DocListController): where name='%(detail_id)s'""" % args) # get unique transactions to update - for name in set([d.fields.get(args['percent_join_field']) for d in self.doclist + for name in set([d.get(args['percent_join_field']) for d in self.doclist if d.doctype == args['source_dt']]): if name: args['name'] = name @@ -241,9 +241,9 @@ class StatusUpdater(DocListController): where docstatus=1 and net_total = 0""" % ref_dt) for item in self.get("entries"): - if item.fields.get(ref_fieldname) \ - and item.fields.get(ref_fieldname) in all_zero_amount_refdoc \ - and item.fields.get(ref_fieldname) not in zero_amount_refdoc: + if item.get(ref_fieldname) \ + and item.get(ref_fieldname) in all_zero_amount_refdoc \ + and item.get(ref_fieldname) not in zero_amount_refdoc: zero_amount_refdoc.append(item.fields[ref_fieldname]) if zero_amount_refdoc: @@ -256,7 +256,7 @@ class StatusUpdater(DocListController): billed_qty = flt(frappe.db.sql("""select sum(ifnull(qty, 0)) from `tab%s Item` where %s=%s and docstatus=1""" % - (self.doc.doctype, ref_fieldname, '%s'), (ref_dn))[0][0]) + (self.doctype, ref_fieldname, '%s'), (ref_dn))[0][0]) per_billed = ((ref_doc_qty if billed_qty > ref_doc_qty else billed_qty)\ / ref_doc_qty)*100 diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py index 3c4c566ce9..3ff780d726 100644 --- a/erpnext/controllers/stock_controller.py +++ b/erpnext/controllers/stock_controller.py @@ -12,19 +12,19 @@ from erpnext.accounts.general_ledger import make_gl_entries, delete_gl_entries class StockController(AccountsController): def make_gl_entries(self, repost_future_gle=True): - if self.doc.docstatus == 2: - delete_gl_entries(voucher_type=self.doc.doctype, voucher_no=self.doc.name) + if self.docstatus == 2: + delete_gl_entries(voucher_type=self.doctype, voucher_no=self.name) if cint(frappe.defaults.get_global_default("auto_accounting_for_stock")): warehouse_account = self.get_warehouse_account() - if self.doc.docstatus==1: + if self.docstatus==1: gl_entries = self.get_gl_entries(warehouse_account) make_gl_entries(gl_entries) if repost_future_gle: items, warehouse_account = self.get_items_and_warehouse_accounts(warehouse_account) - update_gl_entries_after(self.doc.posting_date, self.doc.posting_time, + update_gl_entries_after(self.posting_date, self.posting_time, warehouse_account, items) def get_gl_entries(self, warehouse_account=None, default_expense_account=None, @@ -49,7 +49,7 @@ class StockController(AccountsController): "account": warehouse_account[sle.warehouse], "against": detail.expense_account, "cost_center": detail.cost_center, - "remarks": self.doc.remarks or "Accounting Entry for Stock", + "remarks": self.remarks or "Accounting Entry for Stock", "debit": flt(sle.stock_value_difference, 2) })) @@ -58,7 +58,7 @@ class StockController(AccountsController): "account": detail.expense_account, "against": warehouse_account[sle.warehouse], "cost_center": detail.cost_center, - "remarks": self.doc.remarks or "Accounting Entry for Stock", + "remarks": self.remarks or "Accounting Entry for Stock", "credit": flt(sle.stock_value_difference, 2) })) elif sle.warehouse not in warehouse_with_no_account: @@ -91,10 +91,10 @@ class StockController(AccountsController): if hasattr(self, "fname"): item_doclist = self.doclist.get({"parentfield": self.fname}) - elif self.doc.doctype == "Stock Reconciliation": + elif self.doctype == "Stock Reconciliation": import json item_doclist = [] - data = json.loads(self.doc.reconciliation_json) + data = json.loads(self.reconciliation_json) for row in data[data.index(self.head_row)+1:]: d = frappe._dict(zip(["item_code", "warehouse", "qty", "valuation_rate"], row)) item_doclist.append(d) @@ -115,7 +115,7 @@ class StockController(AccountsController): stock_ledger = {} for sle in frappe.db.sql("""select warehouse, stock_value_difference, voucher_detail_no from `tabStock Ledger Entry` where voucher_type=%s and voucher_no=%s""", - (self.doc.doctype, self.doc.name), as_dict=True): + (self.doctype, self.name), as_dict=True): stock_ledger.setdefault(sle.voucher_detail_no, []).append(sle) return stock_ledger @@ -167,7 +167,7 @@ class StockController(AccountsController): from `tabStock Ledger Entry` sle where timestamp(sle.posting_date, sle.posting_time) >= timestamp(%s, %s) %s order by timestamp(sle.posting_date, sle.posting_time) asc, name asc""" % - ('%s', '%s', condition), (self.doc.posting_date, self.doc.posting_time), + ('%s', '%s', condition), (self.posting_date, self.posting_time), as_dict=True): future_stock_vouchers.append([d.voucher_type, d.voucher_no]) @@ -179,7 +179,7 @@ class StockController(AccountsController): for d in frappe.db.sql("""select * from `tabGL Entry` where posting_date >= %s and voucher_no in (%s)""" % ('%s', ', '.join(['%s']*len(future_stock_vouchers))), - tuple([self.doc.posting_date] + [d[1] for d in future_stock_vouchers]), as_dict=1): + tuple([self.posting_date] + [d[1] for d in future_stock_vouchers]), as_dict=1): gl_entries.setdefault((d.voucher_type, d.voucher_no), []).append(d) return gl_entries @@ -235,20 +235,20 @@ class StockController(AccountsController): sl_dict = { "item_code": d.item_code, "warehouse": d.warehouse, - "posting_date": self.doc.posting_date, - "posting_time": self.doc.posting_time, - "voucher_type": self.doc.doctype, - "voucher_no": self.doc.name, + "posting_date": self.posting_date, + "posting_time": self.posting_time, + "voucher_type": self.doctype, + "voucher_no": self.name, "voucher_detail_no": d.name, - "actual_qty": (self.doc.docstatus==1 and 1 or -1)*flt(d.stock_qty), + "actual_qty": (self.docstatus==1 and 1 or -1)*flt(d.stock_qty), "stock_uom": d.stock_uom, "incoming_rate": 0, - "company": self.doc.company, - "fiscal_year": self.doc.fiscal_year, + "company": self.company, + "fiscal_year": self.fiscal_year, "batch_no": cstr(d.batch_no).strip(), "serial_no": d.serial_no, "project": d.project_name, - "is_cancelled": self.doc.docstatus==2 and "Yes" or "No" + "is_cancelled": self.docstatus==2 and "Yes" or "No" } sl_dict.update(args) @@ -260,7 +260,7 @@ class StockController(AccountsController): def make_cancel_gl_entries(self): if frappe.db.sql("""select name from `tabGL Entry` where voucher_type=%s - and voucher_no=%s""", (self.doc.doctype, self.doc.name)): + and voucher_no=%s""", (self.doctype, self.name)): self.make_gl_entries() def update_gl_entries_after(posting_date, posting_time, warehouse_account=None, for_items=None): diff --git a/erpnext/hr/doctype/appraisal/appraisal.py b/erpnext/hr/doctype/appraisal/appraisal.py index 761e38595c..4fd1f99c2a 100644 --- a/erpnext/hr/doctype/appraisal/appraisal.py +++ b/erpnext/hr/doctype/appraisal/appraisal.py @@ -13,21 +13,21 @@ from frappe.model.document import Document class Appraisal(Document): def validate(self): - if not self.doc.status: - self.doc.status = "Draft" + if not self.status: + self.status = "Draft" self.validate_dates() self.validate_existing_appraisal() self.calculate_total() def get_employee_name(self): - emp_nm = frappe.db.sql("select employee_name from `tabEmployee` where name=%s", self.doc.employee) + emp_nm = frappe.db.sql("select employee_name from `tabEmployee` where name=%s", self.employee) emp_nm= emp_nm and emp_nm[0][0] or '' - self.doc.employee_name = emp_nm + self.employee_name = emp_nm return emp_nm def validate_dates(self): - if getdate(self.doc.start_date) > getdate(self.doc.end_date): + if getdate(self.start_date) > getdate(self.end_date): msgprint("End Date can not be less than Start Date") raise Exception @@ -35,11 +35,11 @@ class Appraisal(Document): chk = frappe.db.sql("""select name from `tabAppraisal` where employee=%s and (status='Submitted' or status='Completed') and ((start_date>=%s and start_date<=%s) - or (end_date>=%s and end_date<=%s))""",(self.doc.employee,self.doc.start_date,self.doc.end_date,self.doc.start_date,self.doc.end_date)) + or (end_date>=%s and end_date<=%s))""",(self.employee,self.start_date,self.end_date,self.start_date,self.end_date)) if chk: msgprint("You have already created Appraisal "\ +cstr(chk[0][0])+" in the current date range for employee "\ - +cstr(self.doc.employee_name)) + +cstr(self.employee_name)) raise Exception def calculate_total(self): @@ -54,11 +54,11 @@ class Appraisal(Document): msgprint("Total weightage assigned should be 100%. It is :" + str(total_w) + "%", raise_exception=1) - if frappe.db.get_value("Employee", self.doc.employee, "user_id") != \ + if frappe.db.get_value("Employee", self.employee, "user_id") != \ frappe.session.user and total == 0: msgprint("Total can't be zero. You must atleast give some points!", raise_exception=1) - self.doc.total_score = total + self.total_score = total def on_submit(self): frappe.db.set(self.doc, 'status', 'Submitted') diff --git a/erpnext/hr/doctype/appraisal_template/appraisal_template.py b/erpnext/hr/doctype/appraisal_template/appraisal_template.py index e4fba2cd47..bd3cc5f27a 100644 --- a/erpnext/hr/doctype/appraisal_template/appraisal_template.py +++ b/erpnext/hr/doctype/appraisal_template/appraisal_template.py @@ -10,11 +10,11 @@ from frappe.model.document import Document class AppraisalTemplate(Document): def validate(self): - self.doc.total_points = 0 + self.total_points = 0 for d in self.doclist.get({"doctype":"Appraisal Template Goal"}): - self.doc.total_points += int(d.per_weightage or 0) + self.total_points += int(d.per_weightage or 0) - if int(self.doc.total_points) != 100: + if int(self.total_points) != 100: frappe.msgprint(_("Total (sum of) points distribution for all goals should be 100.") \ - + " " + _("Not") + " " + str(self.doc.total_points), + + " " + _("Not") + " " + str(self.total_points), raise_exception=True) \ No newline at end of file diff --git a/erpnext/hr/doctype/attendance/attendance.py b/erpnext/hr/doctype/attendance/attendance.py index 42cb7b0379..1478e9f303 100644 --- a/erpnext/hr/doctype/attendance/attendance.py +++ b/erpnext/hr/doctype/attendance/attendance.py @@ -15,40 +15,40 @@ class Attendance(Document): def validate_duplicate_record(self): res = frappe.db.sql("""select name from `tabAttendance` where employee = %s and att_date = %s and name != %s and docstatus = 1""", - (self.doc.employee, self.doc.att_date, self.doc.name)) + (self.employee, self.att_date, self.name)) if res: - msgprint(_("Attendance for the employee: ") + self.doc.employee + + msgprint(_("Attendance for the employee: ") + self.employee + _(" already marked"), raise_exception=1) def check_leave_record(self): - if self.doc.status == 'Present': + if self.status == 'Present': leave = frappe.db.sql("""select name from `tabLeave Application` where employee = %s and %s between from_date and to_date and status = 'Approved' - and docstatus = 1""", (self.doc.employee, self.doc.att_date)) + and docstatus = 1""", (self.employee, self.att_date)) if leave: - frappe.msgprint(_("Employee: ") + self.doc.employee + _(" was on leave on ") - + self.doc.att_date + _(". You can not mark his attendance as 'Present'"), + frappe.msgprint(_("Employee: ") + self.employee + _(" was on leave on ") + + self.att_date + _(". You can not mark his attendance as 'Present'"), raise_exception=1) def validate_fiscal_year(self): from erpnext.accounts.utils import validate_fiscal_year - validate_fiscal_year(self.doc.att_date, self.doc.fiscal_year) + validate_fiscal_year(self.att_date, self.fiscal_year) def validate_att_date(self): - if getdate(self.doc.att_date) > getdate(nowdate()): + if getdate(self.att_date) > getdate(nowdate()): msgprint(_("Attendance can not be marked for future dates"), raise_exception=1) def validate_employee(self): emp = frappe.db.sql("select name from `tabEmployee` where name = %s and status = 'Active'", - self.doc.employee) + self.employee) if not emp: - msgprint(_("Employee: ") + self.doc.employee + + msgprint(_("Employee: ") + self.employee + _(" not active or does not exists in the system"), raise_exception=1) def validate(self): from erpnext.utilities import validate_status - validate_status(self.doc.status, ["Present", "Absent", "Half Day"]) + validate_status(self.status, ["Present", "Absent", "Half Day"]) self.validate_fiscal_year() self.validate_att_date() self.validate_duplicate_record() @@ -57,5 +57,5 @@ class Attendance(Document): def on_update(self): # this is done because sometimes user entered wrong employee name # while uploading employee attendance - employee_name = frappe.db.get_value("Employee", self.doc.employee, "employee_name") + employee_name = frappe.db.get_value("Employee", self.employee, "employee_name") frappe.db.set(self.doc, 'employee_name', employee_name) \ No newline at end of file diff --git a/erpnext/hr/doctype/employee/employee.py b/erpnext/hr/doctype/employee/employee.py index d6f1241a21..231e7b9c9b 100644 --- a/erpnext/hr/doctype/employee/employee.py +++ b/erpnext/hr/doctype/employee/employee.py @@ -18,28 +18,28 @@ class Employee(DocListController): throw(_("Please setup Employee Naming System in Human Resource > HR Settings")) else: if naming_method=='Naming Series': - self.doc.name = make_autoname(self.doc.naming_series + '.####') + self.name = make_autoname(self.naming_series + '.####') elif naming_method=='Employee Number': - self.doc.name = self.doc.employee_number + self.name = self.employee_number - self.doc.employee = self.doc.name + self.employee = self.name def validate(self): from erpnext.utilities import validate_status - validate_status(self.doc.status, ["Active", "Left"]) + validate_status(self.status, ["Active", "Left"]) - self.doc.employee = self.doc.name + self.employee = self.name self.validate_date() self.validate_email() self.validate_status() self.validate_employee_leave_approver() - if self.doc.user_id: + if self.user_id: self.validate_for_enabled_user_id() self.validate_duplicate_user_id() def on_update(self): - if self.doc.user_id and frappe.db.get_value("User", self.doc.user_id, 'docstatus') == 0: + if self.user_id and frappe.db.get_value("User", self.user_id, 'docstatus') == 0: self.restrict_user() self.update_user_default() self.update_user() @@ -49,17 +49,17 @@ class Employee(DocListController): def restrict_user(self): """restrict to this employee for user""" - self.add_restriction_if_required("Employee", self.doc.user_id) + self.add_restriction_if_required("Employee", self.user_id) def update_user_default(self): - frappe.db.set_default("employee_name", self.doc.employee_name, self.doc.user_id) - frappe.db.set_default("company", self.doc.company, self.doc.user_id) + frappe.db.set_default("employee_name", self.employee_name, self.user_id) + frappe.db.set_default("company", self.company, self.user_id) def restrict_leave_approver(self): """restrict to this employee for leave approver""" employee_leave_approvers = [d.leave_approver for d in self.get("employee_leave_approvers")] - if self.doc.reports_to and self.doc.reports_to not in employee_leave_approvers: - employee_leave_approvers.append(frappe.db.get_value("Employee", self.doc.reports_to, "user_id")) + if self.reports_to and self.reports_to not in employee_leave_approvers: + employee_leave_approvers.append(frappe.db.get_value("Employee", self.reports_to, "user_id")) for user in employee_leave_approvers: self.add_restriction_if_required("Employee", user) @@ -67,45 +67,45 @@ class Employee(DocListController): def add_restriction_if_required(self, doctype, user): if frappe.permissions.has_only_non_restrict_role(doctype, user) \ - and self.doc.name not in get_restrictions(user).get("Employee", []): + and self.name not in get_restrictions(user).get("Employee", []): - frappe.defaults.add_default("Employee", self.doc.name, user, "Restriction") + frappe.defaults.add_default("Employee", self.name, user, "Restriction") 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): + where parent=%s""", self.user_id): from frappe.utils.user import add_role - add_role(self.doc.user_id, "Employee") + add_role(self.user_id, "Employee") - user_wrapper = frappe.bean("User", self.doc.user_id) + user_wrapper = frappe.bean("User", self.user_id) # copy details like Fullname, DOB and Image to User - if self.doc.employee_name: - employee_name = self.doc.employee_name.split(" ") + if self.employee_name: + employee_name = self.employee_name.split(" ") if len(employee_name) >= 3: - user_wrapper.doc.last_name = " ".join(employee_name[2:]) - user_wrapper.doc.middle_name = employee_name[1] + user_wrapper.last_name = " ".join(employee_name[2:]) + user_wrapper.middle_name = employee_name[1] elif len(employee_name) == 2: - user_wrapper.doc.last_name = employee_name[1] + user_wrapper.last_name = employee_name[1] - user_wrapper.doc.first_name = employee_name[0] + user_wrapper.first_name = employee_name[0] - if self.doc.date_of_birth: - user_wrapper.doc.birth_date = self.doc.date_of_birth + if self.date_of_birth: + user_wrapper.birth_date = self.date_of_birth - if self.doc.gender: - user_wrapper.doc.gender = self.doc.gender + if self.gender: + user_wrapper.gender = self.gender - if self.doc.image: - if not user_wrapper.doc.user_image == self.doc.image: - user_wrapper.doc.user_image = self.doc.image + if self.image: + if not user_wrapper.user_image == self.image: + user_wrapper.user_image = self.image try: frappe.doc({ "doctype": "File Data", - "file_name": self.doc.image, + "file_name": self.image, "attached_to_doctype": "User", - "attached_to_name": self.doc.user_id + "attached_to_name": self.user_id }).insert() except frappe.DuplicateEntryError, e: # already exists @@ -114,51 +114,51 @@ class Employee(DocListController): 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): + if self.date_of_birth and self.date_of_joining and getdate(self.date_of_birth) >= getdate(self.date_of_joining): throw(_("Date of Joining must be greater than Date of Birth")) - elif self.doc.scheduled_confirmation_date and self.doc.date_of_joining and (getdate(self.doc.scheduled_confirmation_date) < getdate(self.doc.date_of_joining)): + elif self.scheduled_confirmation_date and self.date_of_joining and (getdate(self.scheduled_confirmation_date) < getdate(self.date_of_joining)): throw(_("Scheduled Confirmation Date must be greater than Date of Joining")) - elif self.doc.final_confirmation_date and self.doc.date_of_joining and (getdate(self.doc.final_confirmation_date) < getdate(self.doc.date_of_joining)): + elif self.final_confirmation_date and self.date_of_joining and (getdate(self.final_confirmation_date) < getdate(self.date_of_joining)): throw(_("Final Confirmation Date must be greater than Date of Joining")) - elif self.doc.date_of_retirement and self.doc.date_of_joining and (getdate(self.doc.date_of_retirement) <= getdate(self.doc.date_of_joining)): + elif self.date_of_retirement and self.date_of_joining and (getdate(self.date_of_retirement) <= getdate(self.date_of_joining)): throw(_("Date Of Retirement must be greater than Date of Joining")) - elif self.doc.relieving_date and self.doc.date_of_joining and (getdate(self.doc.relieving_date) <= getdate(self.doc.date_of_joining)): + elif self.relieving_date and self.date_of_joining and (getdate(self.relieving_date) <= getdate(self.date_of_joining)): throw(_("Relieving Date must be greater than Date of Joining")) - elif self.doc.contract_end_date and self.doc.date_of_joining and (getdate(self.doc.contract_end_date)<=getdate(self.doc.date_of_joining)): + elif self.contract_end_date and self.date_of_joining and (getdate(self.contract_end_date)<=getdate(self.date_of_joining)): throw(_("Contract End Date must be greater than Date of Joining")) def validate_email(self): - if self.doc.company_email and not validate_email_add(self.doc.company_email): + if self.company_email and not validate_email_add(self.company_email): throw(_("Please enter valid Company Email")) - if self.doc.personal_email and not validate_email_add(self.doc.personal_email): + if self.personal_email and not validate_email_add(self.personal_email): throw(_("Please enter valid Personal Email")) def validate_status(self): - if self.doc.status == 'Left' and not self.doc.relieving_date: + if self.status == 'Left' and not self.relieving_date: throw(_("Please enter relieving date.")) def validate_for_enabled_user_id(self): enabled = frappe.db.sql("""select name from `tabUser` where - name=%s and enabled=1""", self.doc.user_id) + name=%s and enabled=1""", self.user_id) if not enabled: throw("{id}: {user_id} {msg}".format(**{ "id": _("User ID"), - "user_id": self.doc.user_id, + "user_id": self.user_id, "msg": _("is disabled.") })) def validate_duplicate_user_id(self): employee = frappe.db.sql_list("""select name from `tabEmployee` where - user_id=%s and status='Active' and name!=%s""", (self.doc.user_id, self.doc.name)) + user_id=%s and status='Active' and name!=%s""", (self.user_id, self.name)) if employee: throw("{id}: {user_id} {msg}: {employee}".format(**{ "id": _("User ID"), - "user_id": self.doc.user_id, + "user_id": self.user_id, "msg": _("is already assigned to Employee"), "employee": employee[0] })) @@ -173,24 +173,24 @@ class Employee(DocListController): exc=InvalidLeaveApproverError) def update_dob_event(self): - if self.doc.status == "Active" and self.doc.date_of_birth \ + if self.status == "Active" and self.date_of_birth \ and not cint(frappe.db.get_value("HR Settings", None, "stop_birthday_reminders")): birthday_event = frappe.db.sql("""select name from `tabEvent` where repeat_on='Every Year' - and ref_type='Employee' and ref_name=%s""", self.doc.name) + and ref_type='Employee' and ref_name=%s""", self.name) - starts_on = self.doc.date_of_birth + " 00:00:00" - ends_on = self.doc.date_of_birth + " 00:15:00" + starts_on = self.date_of_birth + " 00:00:00" + ends_on = self.date_of_birth + " 00:15:00" if birthday_event: event = frappe.bean("Event", birthday_event[0][0]) - event.doc.starts_on = starts_on - event.doc.ends_on = ends_on + event.starts_on = starts_on + event.ends_on = ends_on event.save() else: frappe.bean({ "doctype": "Event", - "subject": _("Birthday") + ": " + self.doc.employee_name, - "description": _("Happy Birthday!") + " " + self.doc.employee_name, + "subject": _("Birthday") + ": " + self.employee_name, + "description": _("Happy Birthday!") + " " + self.employee_name, "starts_on": starts_on, "ends_on": ends_on, "event_type": "Public", @@ -199,11 +199,11 @@ class Employee(DocListController): "repeat_this_event": 1, "repeat_on": "Every Year", "ref_type": "Employee", - "ref_name": self.doc.name + "ref_name": self.name }).insert() else: frappe.db.sql("""delete from `tabEvent` where repeat_on='Every Year' and - ref_type='Employee' and ref_name=%s""", self.doc.name) + ref_type='Employee' and ref_name=%s""", self.name) @frappe.whitelist() def get_retirement_date(date_of_birth=None): diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.py b/erpnext/hr/doctype/expense_claim/expense_claim.py index 1d02e87b3a..1d3697be3d 100644 --- a/erpnext/hr/doctype/expense_claim/expense_claim.py +++ b/erpnext/hr/doctype/expense_claim/expense_claim.py @@ -16,13 +16,13 @@ class ExpenseClaim(Document): self.validate_exp_details() def on_submit(self): - if self.doc.approval_status=="Draft": + if self.approval_status=="Draft": frappe.msgprint("""Please set Approval Status to 'Approved' or \ 'Rejected' before submitting""", raise_exception=1) def validate_fiscal_year(self): from erpnext.accounts.utils import validate_fiscal_year - validate_fiscal_year(self.doc.posting_date, self.doc.fiscal_year, "Posting Date") + validate_fiscal_year(self.posting_date, self.fiscal_year, "Posting Date") def validate_exp_details(self): if not self.get('expense_voucher_details'): diff --git a/erpnext/hr/doctype/holiday_list/holiday_list.py b/erpnext/hr/doctype/holiday_list/holiday_list.py index 80c14130fa..92cc9f026d 100644 --- a/erpnext/hr/doctype/holiday_list/holiday_list.py +++ b/erpnext/hr/doctype/holiday_list/holiday_list.py @@ -13,7 +13,7 @@ from frappe.model.document import Document class HolidayList(Document): def autoname(self): - self.doc.name = make_autoname(self.doc.fiscal_year + "/" + self.doc.holiday_list_name + "/.###") + self.name = make_autoname(self.fiscal_year + "/" + self.holiday_list_name + "/.###") def validate(self): self.update_default_holiday_list() @@ -25,20 +25,20 @@ class HolidayList(Document): last_idx = max([cint(d.idx) for d in self.doclist.get( {"parentfield": "holiday_list_details"})] or [0,]) for i, d in enumerate(date_list): - ch = self.doc.append('holiday_list_details', {}) - ch.description = self.doc.weekly_off + ch = self.append('holiday_list_details', {}) + ch.description = self.weekly_off ch.holiday_date = d ch.idx = last_idx + i + 1 def validate_values(self): - if not self.doc.fiscal_year: + if not self.fiscal_year: throw(_("Please select Fiscal Year")) - if not self.doc.weekly_off: + if not self.weekly_off: throw(_("Please select weekly off day")) def get_fy_start_end_dates(self): return frappe.db.sql("""select year_start_date, year_end_date - from `tabFiscal Year` where name=%s""", (self.doc.fiscal_year,))[0] + from `tabFiscal Year` where name=%s""", (self.fiscal_year,))[0] def get_weekly_off_date_list(self, year_start_date, year_end_date): from frappe.utils import getdate @@ -49,7 +49,7 @@ class HolidayList(Document): import calendar date_list = [] - weekday = getattr(calendar, (self.doc.weekly_off).upper()) + weekday = getattr(calendar, (self.weekly_off).upper()) reference_date = year_start_date + relativedelta.relativedelta(weekday=weekday) while reference_date <= year_end_date: @@ -63,4 +63,4 @@ class HolidayList(Document): def update_default_holiday_list(self): frappe.db.sql("""update `tabHoliday List` set is_default = 0 - where ifnull(is_default, 0) = 1 and fiscal_year = %s""", (self.doc.fiscal_year,)) + where ifnull(is_default, 0) = 1 and fiscal_year = %s""", (self.fiscal_year,)) diff --git a/erpnext/hr/doctype/hr_settings/hr_settings.py b/erpnext/hr/doctype/hr_settings/hr_settings.py index 6d5f8e07f3..602558ba5c 100644 --- a/erpnext/hr/doctype/hr_settings/hr_settings.py +++ b/erpnext/hr/doctype/hr_settings/hr_settings.py @@ -17,17 +17,17 @@ class HrSettings(Document): from erpnext.setup.doctype.naming_series.naming_series import set_by_naming_series set_by_naming_series("Employee", "employee_number", - self.doc.get("emp_created_by")=="Naming Series", hide_name_field=True) + self.get("emp_created_by")=="Naming Series", hide_name_field=True) def update_birthday_reminders(self): original_stop_birthday_reminders = cint(frappe.db.get_value("HR Settings", None, "stop_birthday_reminders")) # reset birthday reminders - if cint(self.doc.stop_birthday_reminders) != original_stop_birthday_reminders: + if cint(self.stop_birthday_reminders) != original_stop_birthday_reminders: frappe.db.sql("""delete from `tabEvent` where repeat_on='Every Year' and ref_type='Employee'""") - if not self.doc.stop_birthday_reminders: + if not self.stop_birthday_reminders: for employee in frappe.db.sql_list("""select name from `tabEmployee` where status='Active' and ifnull(date_of_birth, '')!=''"""): frappe.get_obj("Employee", employee).update_dob_event() diff --git a/erpnext/hr/doctype/job_applicant/get_job_applications.py b/erpnext/hr/doctype/job_applicant/get_job_applications.py index 4f753450d0..c384ccc159 100644 --- a/erpnext/hr/doctype/job_applicant/get_job_applications.py +++ b/erpnext/hr/doctype/job_applicant/get_job_applications.py @@ -19,10 +19,10 @@ class JobsMailbox(POP3Mailbox): "name") if name: applicant = frappe.bean("Job Applicant", name) - if applicant.doc.status!="Rejected": - applicant.doc.status = "Open" + if applicant.status!="Rejected": + applicant.status = "Open" applicant.ignore_permissions = True - applicant.doc.save() + applicant.save() else: name = (mail.from_real_name and (mail.from_real_name + " - ") or "") \ + mail.from_email @@ -40,7 +40,7 @@ class JobsMailbox(POP3Mailbox): mail.save_attachments_in_doc(applicant.doc) _make(content=mail.content, sender=mail.from_email, subject=mail.subject or "No Subject", - doctype="Job Applicant", name=applicant.doc.name, sent_or_received="Received") + doctype="Job Applicant", name=applicant.name, sent_or_received="Received") def get_job_applications(): if cint(frappe.db.get_value('Jobs Email Settings', None, 'extract_emails')): diff --git a/erpnext/hr/doctype/leave_allocation/leave_allocation.py b/erpnext/hr/doctype/leave_allocation/leave_allocation.py index a78dc1a530..32812e2229 100755 --- a/erpnext/hr/doctype/leave_allocation/leave_allocation.py +++ b/erpnext/hr/doctype/leave_allocation/leave_allocation.py @@ -29,8 +29,8 @@ class LeaveAllocation(Document): def validate_new_leaves_allocated_value(self): """validate that leave allocation is in multiples of 0.5""" - if flt(self.doc.new_leaves_allocated) % 0.5: - guess = round(flt(self.doc.new_leaves_allocated) * 2.0) / 2.0 + if flt(self.new_leaves_allocated) % 0.5: + guess = round(flt(self.new_leaves_allocated) * 2.0) / 2.0 msgprint("""New Leaves Allocated should be a multiple of 0.5. Perhaps you should enter %s or %s""" % (guess, guess + 0.5), @@ -40,25 +40,25 @@ class LeaveAllocation(Document): """check whether leave for same type is already allocated or not""" leave_allocation = frappe.db.sql("""select name from `tabLeave Allocation` where employee=%s and leave_type=%s and fiscal_year=%s and docstatus=1""", - (self.doc.employee, self.doc.leave_type, self.doc.fiscal_year)) + (self.employee, self.leave_type, self.fiscal_year)) if leave_allocation: msgprint("""%s is already allocated to Employee: %s for Fiscal Year: %s. Please refere Leave Allocation: \ %s""" % \ - (self.doc.leave_type, self.doc.employee, self.doc.fiscal_year, + (self.leave_type, self.employee, self.fiscal_year, leave_allocation[0][0], leave_allocation[0][0]), raise_exception=1) def validate_new_leaves_allocated(self): """check if Total Leaves Allocated >= Leave Applications""" - self.doc.total_leaves_allocated = flt(self.doc.carry_forwarded_leaves) + \ - flt(self.doc.new_leaves_allocated) - leaves_applied = self.get_leaves_applied(self.doc.fiscal_year) - if leaves_applied > self.doc.total_leaves_allocated: - expected_new_leaves = flt(self.doc.new_leaves_allocated) + \ - (leaves_applied - self.doc.total_leaves_allocated) + self.total_leaves_allocated = flt(self.carry_forwarded_leaves) + \ + flt(self.new_leaves_allocated) + leaves_applied = self.get_leaves_applied(self.fiscal_year) + if leaves_applied > self.total_leaves_allocated: + expected_new_leaves = flt(self.new_leaves_allocated) + \ + (leaves_applied - self.total_leaves_allocated) msgprint("""Employee: %s has already applied for %s leaves. Hence, New Leaves Allocated should be atleast %s""" % \ - (self.doc.employee, leaves_applied, expected_new_leaves), + (self.employee, leaves_applied, expected_new_leaves), raise_exception=1) def get_leave_bal(self, prev_fyear): @@ -68,40 +68,40 @@ class LeaveAllocation(Document): leaves_applied = frappe.db.sql("""select SUM(ifnull(total_leave_days, 0)) from `tabLeave Application` where employee=%s and leave_type=%s and fiscal_year=%s and docstatus=1""", - (self.doc.employee, self.doc.leave_type, fiscal_year)) + (self.employee, self.leave_type, fiscal_year)) return leaves_applied and flt(leaves_applied[0][0]) or 0 def get_leaves_allocated(self, fiscal_year): leaves_allocated = frappe.db.sql("""select SUM(ifnull(total_leaves_allocated, 0)) from `tabLeave Allocation` where employee=%s and leave_type=%s and fiscal_year=%s and docstatus=1 and name!=%s""", - (self.doc.employee, self.doc.leave_type, fiscal_year, self.doc.name)) + (self.employee, self.leave_type, fiscal_year, self.name)) return leaves_allocated and flt(leaves_allocated[0][0]) or 0 def allow_carry_forward(self): """check whether carry forward is allowed or not for this leave type""" cf = frappe.db.sql("""select is_carry_forward from `tabLeave Type` where name = %s""", - self.doc.leave_type) + self.leave_type) cf = cf and cint(cf[0][0]) or 0 if not cf: frappe.db.set(self.doc,'carry_forward',0) - msgprint("Sorry! You cannot carry forward %s" % (self.doc.leave_type), + msgprint("Sorry! You cannot carry forward %s" % (self.leave_type), raise_exception=1) def get_carry_forwarded_leaves(self): - if self.doc.carry_forward: + if self.carry_forward: self.allow_carry_forward() prev_fiscal_year = frappe.db.sql("""select name from `tabFiscal Year` where year_start_date = (select date_add(year_start_date, interval -1 year) from `tabFiscal Year` where name=%s) - order by name desc limit 1""", self.doc.fiscal_year) + order by name desc limit 1""", self.fiscal_year) prev_fiscal_year = prev_fiscal_year and prev_fiscal_year[0][0] or '' prev_bal = 0 - if prev_fiscal_year and cint(self.doc.carry_forward) == 1: + if prev_fiscal_year and cint(self.carry_forward) == 1: prev_bal = self.get_leave_bal(prev_fiscal_year) ret = { 'carry_forwarded_leaves': prev_bal, - 'total_leaves_allocated': flt(prev_bal) + flt(self.doc.new_leaves_allocated) + 'total_leaves_allocated': flt(prev_bal) + flt(self.new_leaves_allocated) } return ret @@ -113,12 +113,12 @@ class LeaveAllocation(Document): def check_for_leave_application(self): exists = frappe.db.sql("""select name from `tabLeave Application` where employee=%s and leave_type=%s and fiscal_year=%s and docstatus=1""", - (self.doc.employee, self.doc.leave_type, self.doc.fiscal_year)) + (self.employee, self.leave_type, self.fiscal_year)) if exists: msgprint("""Cannot cancel this Leave Allocation as \ Employee : %s has already applied for %s. Please check Leave Application: \ %s""" % \ - (self.doc.employee, self.doc.leave_type, exists[0][0], exists[0][0])) + (self.employee, self.leave_type, exists[0][0], exists[0][0])) raise Exception diff --git a/erpnext/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py index 03045a4c31..de8bff78bc 100755 --- a/erpnext/hr/doctype/leave_application/leave_application.py +++ b/erpnext/hr/doctype/leave_application/leave_application.py @@ -17,8 +17,8 @@ class LeaveApproverIdentityError(frappe.ValidationError): pass from frappe.model.controller import DocListController class LeaveApplication(DocListController): def setup(self): - if frappe.db.exists(self.doc.doctype, self.doc.name): - self.previous_doc = frappe.doc(self.doc.doctype, self.doc.name) + if frappe.db.exists(self.doctype, self.name): + self.previous_doc = frappe.doc(self.doctype, self.name) else: self.previous_doc = None @@ -32,22 +32,22 @@ class LeaveApplication(DocListController): self.validate_leave_approver() def on_update(self): - if (not self.previous_doc and self.doc.leave_approver) or (self.previous_doc and \ - self.doc.status == "Open" and self.previous_doc.leave_approver != self.doc.leave_approver): + if (not self.previous_doc and self.leave_approver) or (self.previous_doc and \ + self.status == "Open" and self.previous_doc.leave_approver != self.leave_approver): # notify leave approver about creation self.notify_leave_approver() elif self.previous_doc and \ - self.previous_doc.status == "Open" and self.doc.status == "Rejected": + self.previous_doc.status == "Open" and self.status == "Rejected": # notify employee about rejection - self.notify_employee(self.doc.status) + self.notify_employee(self.status) def on_submit(self): - if self.doc.status != "Approved": + if self.status != "Approved": frappe.msgprint("""Only Leave Applications with status 'Approved' can be Submitted.""", raise_exception=True) # notify leave applier about approval - self.notify_employee(self.doc.status) + self.notify_employee(self.status) def on_cancel(self): # notify leave applier about cancellation @@ -56,8 +56,8 @@ class LeaveApplication(DocListController): def show_block_day_warning(self): from erpnext.hr.doctype.leave_block_list.leave_block_list import get_applicable_block_dates - block_dates = get_applicable_block_dates(self.doc.from_date, self.doc.to_date, - self.doc.employee, self.doc.company, all_lists=True) + block_dates = get_applicable_block_dates(self.from_date, self.to_date, + self.employee, self.company, all_lists=True) if block_dates: frappe.msgprint(_("Warning: Leave application contains following block dates") + ":") @@ -67,30 +67,30 @@ class LeaveApplication(DocListController): def validate_block_days(self): from erpnext.hr.doctype.leave_block_list.leave_block_list import get_applicable_block_dates - block_dates = get_applicable_block_dates(self.doc.from_date, self.doc.to_date, - self.doc.employee, self.doc.company) + block_dates = get_applicable_block_dates(self.from_date, self.to_date, + self.employee, self.company) if block_dates: - if self.doc.status == "Approved": + if self.status == "Approved": frappe.msgprint(_("Cannot approve leave as you are not authorized to approve leaves on Block Dates.")) raise LeaveDayBlockedError def get_holidays(self): tot_hol = frappe.db.sql("""select count(*) from `tabHoliday` h1, `tabHoliday List` h2, `tabEmployee` e1 where e1.name = %s and h1.parent = h2.name and e1.holiday_list = h2.name - and h1.holiday_date between %s and %s""", (self.doc.employee, self.doc.from_date, self.doc.to_date)) + and h1.holiday_date between %s and %s""", (self.employee, self.from_date, self.to_date)) if not tot_hol: tot_hol = frappe.db.sql("""select count(*) from `tabHoliday` h1, `tabHoliday List` h2 where h1.parent = h2.name and h1.holiday_date between %s and %s and ifnull(h2.is_default,0) = 1 and h2.fiscal_year = %s""", - (self.doc.from_date, self.doc.to_date, self.doc.fiscal_year)) + (self.from_date, self.to_date, self.fiscal_year)) return tot_hol and flt(tot_hol[0][0]) or 0 def get_total_leave_days(self): """Calculates total leave days based on input and holidays""" ret = {'total_leave_days' : 0.5} - if not self.doc.half_day: - tot_days = date_diff(self.doc.to_date, self.doc.from_date) + 1 + if not self.half_day: + tot_days = date_diff(self.to_date, self.from_date) + 1 holidays = self.get_holidays() ret = { 'total_leave_days' : flt(tot_days)-flt(holidays) @@ -98,33 +98,33 @@ class LeaveApplication(DocListController): return ret def validate_to_date(self): - if self.doc.from_date and self.doc.to_date and \ - (getdate(self.doc.to_date) < getdate(self.doc.from_date)): + if self.from_date and self.to_date and \ + (getdate(self.to_date) < getdate(self.from_date)): msgprint("To date cannot be before from date") raise Exception def validate_balance_leaves(self): - if self.doc.from_date and self.doc.to_date: - self.doc.total_leave_days = self.get_total_leave_days()["total_leave_days"] + if self.from_date and self.to_date: + self.total_leave_days = self.get_total_leave_days()["total_leave_days"] - if self.doc.total_leave_days == 0: + if self.total_leave_days == 0: msgprint(_("The day(s) on which you are applying for leave coincide with holiday(s). You need not apply for leave."), raise_exception=1) - if not is_lwp(self.doc.leave_type): - self.doc.leave_balance = get_leave_balance(self.doc.employee, - self.doc.leave_type, self.doc.fiscal_year)["leave_balance"] + if not is_lwp(self.leave_type): + self.leave_balance = get_leave_balance(self.employee, + self.leave_type, self.fiscal_year)["leave_balance"] - if self.doc.status != "Rejected" \ - and self.doc.leave_balance - self.doc.total_leave_days < 0: + if self.status != "Rejected" \ + and self.leave_balance - self.total_leave_days < 0: #check if this leave type allow the remaining balance to be in negative. If yes then warn the user and continue to save else warn the user and don't save. msgprint("There is not enough leave balance for Leave Type: %s" % \ - (self.doc.leave_type,), - raise_exception=not(frappe.db.get_value("Leave Type", self.doc.leave_type,"allow_negative") or None)) + (self.leave_type,), + raise_exception=not(frappe.db.get_value("Leave Type", self.leave_type,"allow_negative") or None)) def validate_leave_overlap(self): - if not self.doc.name: - self.doc.name = "New Leave Application" + if not self.name: + self.name = "New Leave Application" for d in frappe.db.sql("""select name, leave_type, posting_date, from_date, to_date @@ -136,45 +136,45 @@ class LeaveApplication(DocListController): and (from_date between %(from_date)s and %(to_date)s or to_date between %(from_date)s and %(to_date)s or %(from_date)s between from_date and to_date) - and name != %(name)s""", self.doc.fields, as_dict = 1): + and name != %(name)s""", self.fields, as_dict = 1): - msgprint("Employee : %s has already applied for %s between %s and %s on %s. Please refer Leave Application : %s" % (self.doc.employee, cstr(d['leave_type']), formatdate(d['from_date']), formatdate(d['to_date']), formatdate(d['posting_date']), d['name'], d['name']), raise_exception = OverlapError) + msgprint("Employee : %s has already applied for %s between %s and %s on %s. Please refer Leave Application : %s" % (self.employee, cstr(d['leave_type']), formatdate(d['from_date']), formatdate(d['to_date']), formatdate(d['posting_date']), d['name'], d['name']), raise_exception = OverlapError) def validate_max_days(self): - max_days = frappe.db.get_value("Leave Type", self.doc.leave_type, "max_days_allowed") - if max_days and self.doc.total_leave_days > max_days: + max_days = frappe.db.get_value("Leave Type", self.leave_type, "max_days_allowed") + if max_days and self.total_leave_days > max_days: frappe.throw("Sorry ! You cannot apply for %s for more than %s days" % - (self.doc.leave_type, max_days)) + (self.leave_type, max_days)) def validate_leave_approver(self): - employee = frappe.bean("Employee", self.doc.employee) + employee = frappe.bean("Employee", self.employee) leave_approvers = [l.leave_approver for l in employee.get("employee_leave_approvers")] - if len(leave_approvers) and self.doc.leave_approver not in leave_approvers: - msgprint(("[" + _("For Employee") + ' "' + self.doc.employee + '"] ' + if len(leave_approvers) and self.leave_approver not in leave_approvers: + msgprint(("[" + _("For Employee") + ' "' + self.employee + '"] ' + _("Leave Approver can be one of") + ": " + comma_or(leave_approvers)), raise_exception=InvalidLeaveApproverError) - elif self.doc.leave_approver and not frappe.db.sql("""select name from `tabUserRole` - where parent=%s and role='Leave Approver'""", self.doc.leave_approver): - msgprint(get_fullname(self.doc.leave_approver) + ": " \ + elif self.leave_approver and not frappe.db.sql("""select name from `tabUserRole` + where parent=%s and role='Leave Approver'""", self.leave_approver): + msgprint(get_fullname(self.leave_approver) + ": " \ + _("does not have role 'Leave Approver'"), raise_exception=InvalidLeaveApproverError) - elif self.doc.docstatus==1 and len(leave_approvers) and self.doc.leave_approver != frappe.session.user: + elif self.docstatus==1 and len(leave_approvers) and self.leave_approver != frappe.session.user: msgprint(_("Only the selected Leave Approver can submit this Leave Application"), raise_exception=LeaveApproverIdentityError) def notify_employee(self, status): - employee = frappe.doc("Employee", self.doc.employee) + employee = frappe.doc("Employee", self.employee) if not employee.user_id: return def _get_message(url=False): if url: - name = get_url_to_form(self.doc.doctype, self.doc.name) + name = get_url_to_form(self.doctype, self.name) else: - name = self.doc.name + name = self.name return (_("Leave Application") + ": %s - %s") % (name, _(status)) @@ -186,21 +186,21 @@ class LeaveApplication(DocListController): }) def notify_leave_approver(self): - employee = frappe.doc("Employee", self.doc.employee) + employee = frappe.doc("Employee", self.employee) def _get_message(url=False): - name = self.doc.name + name = self.name employee_name = cstr(employee.employee_name) if url: - name = get_url_to_form(self.doc.doctype, self.doc.name) - employee_name = get_url_to_form("Employee", self.doc.employee, label=employee_name) + name = get_url_to_form(self.doctype, self.name) + employee_name = get_url_to_form("Employee", self.employee, label=employee_name) return (_("New Leave Application") + ": %s - " + _("Employee") + ": %s") % (name, employee_name) self.notify({ # for post in messages "message": _get_message(url=True), - "message_to": self.doc.leave_approver, + "message_to": self.leave_approver, # for email "subject": _get_message() @@ -210,7 +210,7 @@ class LeaveApplication(DocListController): args = frappe._dict(args) from frappe.core.page.messages.messages import post post({"txt": args.message, "contact": args.message_to, "subject": args.subject, - "notify": cint(self.doc.follow_via_email)}) + "notify": cint(self.follow_via_email)}) @frappe.whitelist() def get_leave_balance(employee, leave_type, fiscal_year): diff --git a/erpnext/hr/doctype/leave_application/test_leave_application.py b/erpnext/hr/doctype/leave_application/test_leave_application.py index cb8f77ef1a..04d049bca3 100644 --- a/erpnext/hr/doctype/leave_application/test_leave_application.py +++ b/erpnext/hr/doctype/leave_application/test_leave_application.py @@ -33,8 +33,8 @@ class TestLeaveApplication(unittest.TestCase): def get_application(self, doclist): application = frappe.bean(copy=doclist) - application.doc.from_date = "2013-01-01" - application.doc.to_date = "2013-01-05" + application.from_date = "2013-01-01" + application.to_date = "2013-01-05" return application def test_block_list(self): @@ -48,7 +48,7 @@ class TestLeaveApplication(unittest.TestCase): application = self.get_application(test_records[1]) application.insert() - application.doc.status = "Approved" + application.status = "Approved" self.assertRaises(LeaveDayBlockedError, application.submit) frappe.set_user("test1@example.com") @@ -69,11 +69,11 @@ class TestLeaveApplication(unittest.TestCase): frappe.set_user("test@example.com") application = self.get_application(test_records[1]) - application.doc.leave_approver = "test2@example.com" + application.leave_approver = "test2@example.com" application.insert() application = self.get_application(test_records[1]) - application.doc.leave_approver = "test2@example.com" + application.leave_approver = "test2@example.com" self.assertRaises(OverlapError, application.insert) def test_global_block_list(self): @@ -84,7 +84,7 @@ class TestLeaveApplication(unittest.TestCase): add_role("test@example.com", "Leave Approver") application = self.get_application(test_records[3]) - application.doc.leave_approver = "test@example.com" + application.leave_approver = "test@example.com" frappe.db.set_value("Leave Block List", "_Test Leave Block List", "applies_to_all_departments", 1) @@ -95,7 +95,7 @@ class TestLeaveApplication(unittest.TestCase): application.insert() frappe.set_user("test@example.com") - application.doc.status = "Approved" + application.status = "Approved" self.assertRaises(LeaveDayBlockedError, application.submit) frappe.db.set_value("Leave Block List", "_Test Leave Block List", @@ -120,14 +120,14 @@ class TestLeaveApplication(unittest.TestCase): # create leave application as Employee frappe.set_user("test@example.com") application = self.get_application(test_records[1]) - application.doc.leave_approver = "test1@example.com" + application.leave_approver = "test1@example.com" application.insert() # submit leave application by Leave Approver frappe.set_user("test1@example.com") - application.doc.status = "Approved" + application.status = "Approved" application.submit() - self.assertEqual(frappe.db.get_value("Leave Application", application.doc.name, + self.assertEqual(frappe.db.get_value("Leave Application", application.name, "docstatus"), 1) def _test_leave_approval_invalid_leave_approver_insert(self): @@ -143,7 +143,7 @@ class TestLeaveApplication(unittest.TestCase): application = self.get_application(test_records[1]) frappe.set_user("test@example.com") - application.doc.leave_approver = "test1@example.com" + application.leave_approver = "test1@example.com" self.assertRaises(InvalidLeaveApproverError, application.insert) frappe.db.sql("""delete from `tabEmployee Leave Approver` where parent=%s""", @@ -157,10 +157,10 @@ class TestLeaveApplication(unittest.TestCase): # but submit as invalid leave approver - should raise exception frappe.set_user("test@example.com") application = self.get_application(test_records[1]) - application.doc.leave_approver = "test2@example.com" + application.leave_approver = "test2@example.com" application.insert() frappe.set_user("test1@example.com") - application.doc.status = "Approved" + application.status = "Approved" from erpnext.hr.doctype.leave_application.leave_application import LeaveApproverIdentityError self.assertRaises(LeaveApproverIdentityError, application.submit) @@ -177,14 +177,14 @@ class TestLeaveApplication(unittest.TestCase): frappe.set_user("test@example.com") application = self.get_application(test_records[1]) - application.doc.leave_approver = "test2@example.com" + application.leave_approver = "test2@example.com" application.insert() # change to valid leave approver and try to submit leave application frappe.set_user("test2@example.com") - application.doc.status = "Approved" + application.status = "Approved" application.submit() - self.assertEqual(frappe.db.get_value("Leave Application", application.doc.name, + self.assertEqual(frappe.db.get_value("Leave Application", application.name, "docstatus"), 1) frappe.db.sql("""delete from `tabEmployee Leave Approver` where parent=%s""", diff --git a/erpnext/hr/doctype/leave_block_list/leave_block_list.py b/erpnext/hr/doctype/leave_block_list/leave_block_list.py index e1cbf1bfaf..868b990c54 100644 --- a/erpnext/hr/doctype/leave_block_list/leave_block_list.py +++ b/erpnext/hr/doctype/leave_block_list/leave_block_list.py @@ -16,7 +16,7 @@ class LeaveBlockList(Document): dates = [] for d in self.doclist.get({"doctype":"Leave Block List Date"}): # validate fiscal year - validate_fiscal_year(d.block_date, self.doc.year, _("Block Date")) + validate_fiscal_year(d.block_date, self.year, _("Block Date")) # date is not repeated if d.block_date in dates: diff --git a/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py index bf912655ba..57bb224273 100644 --- a/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py +++ b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py @@ -20,7 +20,7 @@ class LeaveControlPanel(Document): def get_employees(self): - lst1 = [[self.doc.employee_type,"employment_type"],[self.doc.branch,"branch"],[self.doc.designation,"designation"],[self.doc.department, "department"],[self.doc.grade,"grade"]] + lst1 = [[self.employee_type,"employment_type"],[self.branch,"branch"],[self.designation,"designation"],[self.department, "department"],[self.grade,"grade"]] condition = "where " flag = 0 for l in lst1: @@ -54,11 +54,11 @@ class LeaveControlPanel(Document): la.set("__islocal", 1) la.employee = cstr(d[0]) la.employee_name = frappe.db.get_value('Employee',cstr(d[0]),'employee_name') - la.leave_type = self.doc.leave_type - la.fiscal_year = self.doc.fiscal_year + la.leave_type = self.leave_type + la.fiscal_year = self.fiscal_year la.posting_date = nowdate() - la.carry_forward = cint(self.doc.carry_forward) - la.new_leaves_allocated = flt(self.doc.no_of_days) + la.carry_forward = cint(self.carry_forward) + la.new_leaves_allocated = flt(self.no_of_days) la.docstatus = 1 la.save() leave_allocated_for.append(d[0]) diff --git a/erpnext/hr/doctype/salary_manager/salary_manager.py b/erpnext/hr/doctype/salary_manager/salary_manager.py index d0af7beaed..cd11598f77 100644 --- a/erpnext/hr/doctype/salary_manager/salary_manager.py +++ b/erpnext/hr/doctype/salary_manager/salary_manager.py @@ -35,14 +35,14 @@ class SalaryManager(Document): cond = '' for f in ['company', 'branch', 'department', 'designation', 'grade']: - if self.doc.fields.get(f): - cond += " and t1." + f + " = '" + self.doc.fields.get(f).replace("'", "\'") + "'" + if self.get(f): + cond += " and t1." + f + " = '" + self.get(f).replace("'", "\'") + "'" return cond def get_joining_releiving_condition(self): - m = self.get_month_details(self.doc.fiscal_year, self.doc.month) + m = self.get_month_details(self.fiscal_year, self.month) cond = """ and ifnull(t1.date_of_joining, '0000-00-00') <= '%(month_end_date)s' and ifnull(t1.relieving_date, '2199-12-31') >= '%(month_start_date)s' @@ -52,7 +52,7 @@ class SalaryManager(Document): def check_mandatory(self): for f in ['company', 'month', 'fiscal_year']: - if not self.doc.fields[f]: + if not self.fields[f]: msgprint("Please select %s to proceed" % f, raise_exception=1) @@ -85,17 +85,17 @@ class SalaryManager(Document): for emp in emp_list: if not frappe.db.sql("""select name from `tabSalary Slip` where docstatus!= 2 and employee = %s and month = %s and fiscal_year = %s and company = %s - """, (emp[0], self.doc.month, self.doc.fiscal_year, self.doc.company)): + """, (emp[0], self.month, self.fiscal_year, self.company)): ss = frappe.bean({ "doctype": "Salary Slip", - "fiscal_year": self.doc.fiscal_year, + "fiscal_year": self.fiscal_year, "employee": emp[0], - "month": self.doc.month, - "email_check": self.doc.send_email, - "company": self.doc.company, + "month": self.month, + "email_check": self.send_email, + "company": self.company, }) ss.insert() - ss_list.append(ss.doc.name) + ss_list.append(ss.name) return self.create_log(ss_list) @@ -117,7 +117,7 @@ class SalaryManager(Document): ss_list = frappe.db.sql(""" select t1.name from `tabSalary Slip` t1 where t1.docstatus = 0 and month = %s and fiscal_year = %s %s - """ % ('%s', '%s', cond), (self.doc.month, self.doc.fiscal_year)) + """ % ('%s', '%s', cond), (self.month, self.fiscal_year)) return ss_list @@ -130,8 +130,8 @@ class SalaryManager(Document): for ss in ss_list: ss_obj = get_obj("Salary Slip",ss[0],with_children=1) try: - frappe.db.set(ss_obj.doc, 'email_check', cint(self.doc.send_mail)) - if cint(self.doc.send_email) == 1: + frappe.db.set(ss_obj.doc, 'email_check', cint(self.send_mail)) + if cint(self.send_email) == 1: ss_obj.send_mail_funct() frappe.db.set(ss_obj.doc, 'docstatus', 1) @@ -152,7 +152,7 @@ class SalaryManager(Document): submitted_ss = list(set(all_ss) - set(not_submitted_ss)) if submitted_ss: - mail_sent_msg = self.doc.send_email and " (Mail has been sent to the employee)" or "" + mail_sent_msg = self.send_email and " (Mail has been sent to the employee)" or "" log = """ Submitted Salary Slips%s:\

%s

@@ -179,7 +179,7 @@ class SalaryManager(Document): tot = frappe.db.sql(""" select sum(rounded_total) from `tabSalary Slip` t1 where t1.docstatus = 1 and month = %s and fiscal_year = %s %s - """ % ('%s', '%s', cond), (self.doc.month, self.doc.fiscal_year)) + """ % ('%s', '%s', cond), (self.month, self.fiscal_year)) return flt(tot[0][0]) @@ -189,7 +189,7 @@ class SalaryManager(Document): get default bank account,default salary acount from company """ amt = self.get_total_salary() - default_bank_account = frappe.db.get_value("Company", self.doc.company, + default_bank_account = frappe.db.get_value("Company", self.company, "default_bank_account") if not default_bank_account: msgprint("You can set Default Bank Account in Company master.") diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py index e167835ad5..dbccaefd9e 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.py +++ b/erpnext/hr/doctype/salary_slip/salary_slip.py @@ -16,10 +16,10 @@ from erpnext.utilities.transaction_base import TransactionBase class SalarySlip(TransactionBase): def autoname(self): - self.doc.name = make_autoname('Sal Slip/' +self.doc.employee + '/.#####') + self.name = make_autoname('Sal Slip/' +self.employee + '/.#####') def get_emp_and_leave_details(self): - if self.doc.employee: + if self.employee: self.get_leave_details() struct = self.check_sal_struct() if struct: @@ -27,10 +27,10 @@ class SalarySlip(TransactionBase): def check_sal_struct(self): struct = frappe.db.sql("""select name from `tabSalary Structure` - where employee=%s and is_active = 'Yes'""", self.doc.employee) + where employee=%s and is_active = 'Yes'""", self.employee) if not struct: - msgprint("Please create Salary Structure for employee '%s'" % self.doc.employee) - self.doc.employee = None + msgprint("Please create Salary Structure for employee '%s'" % self.employee) + self.employee = None return struct and struct[0][0] or '' def pull_sal_struct(self, struct): @@ -38,21 +38,21 @@ class SalarySlip(TransactionBase): self.doclist = get_mapped_doclist(struct, self.doclist) def pull_emp_details(self): - emp = frappe.db.get_value("Employee", self.doc.employee, + emp = frappe.db.get_value("Employee", self.employee, ["bank_name", "bank_ac_no", "esic_card_no", "pf_number"], as_dict=1) if emp: - self.doc.bank_name = emp.bank_name - self.doc.bank_account_no = emp.bank_ac_no - self.doc.esic_no = emp.esic_card_no - self.doc.pf_no = emp.pf_number + self.bank_name = emp.bank_name + self.bank_account_no = emp.bank_ac_no + self.esic_no = emp.esic_card_no + self.pf_no = emp.pf_number def get_leave_details(self, lwp=None): - if not self.doc.fiscal_year: - self.doc.fiscal_year = frappe.get_default("fiscal_year") - if not self.doc.month: - self.doc.month = "%02d" % getdate(nowdate()).month + if not self.fiscal_year: + self.fiscal_year = frappe.get_default("fiscal_year") + if not self.month: + self.month = "%02d" % getdate(nowdate()).month - m = get_obj('Salary Manager').get_month_details(self.doc.fiscal_year, self.doc.month) + m = get_obj('Salary Manager').get_month_details(self.fiscal_year, self.month) holidays = self.get_holidays_for_employee(m) if not cint(frappe.db.get_value("HR Settings", "HR Settings", @@ -64,16 +64,16 @@ class SalarySlip(TransactionBase): if not lwp: lwp = self.calculate_lwp(holidays, m) - self.doc.total_days_in_month = m['month_days'] - self.doc.leave_without_pay = lwp + self.total_days_in_month = m['month_days'] + self.leave_without_pay = lwp payment_days = flt(self.get_payment_days(m)) - flt(lwp) - self.doc.payment_days = payment_days > 0 and payment_days or 0 + self.payment_days = payment_days > 0 and payment_days or 0 def get_payment_days(self, m): payment_days = m['month_days'] emp = frappe.db.sql("select date_of_joining, relieving_date from `tabEmployee` \ - where name = %s", self.doc.employee, as_dict=1)[0] + where name = %s", self.employee, as_dict=1)[0] if emp['relieving_date']: if getdate(emp['relieving_date']) > m['month_start_date'] and \ @@ -98,13 +98,13 @@ class SalarySlip(TransactionBase): from `tabHoliday` t1, tabEmployee t2 where t1.parent = t2.holiday_list and t2.name = %s and t1.holiday_date between %s and %s""", - (self.doc.employee, m['month_start_date'], m['month_end_date'])) + (self.employee, m['month_start_date'], m['month_end_date'])) if not holidays: holidays = frappe.db.sql("""select t1.holiday_date from `tabHoliday` t1, `tabHoliday List` t2 where t1.parent = t2.name and ifnull(t2.is_default, 0) = 1 and t2.fiscal_year = %s - and t1.holiday_date between %s and %s""", (self.doc.fiscal_year, + and t1.holiday_date between %s and %s""", (self.fiscal_year, m['month_start_date'], m['month_end_date'])) holidays = [cstr(i[0]) for i in holidays] return holidays @@ -122,7 +122,7 @@ class SalarySlip(TransactionBase): and t1.docstatus = 1 and t1.employee = %s and %s between from_date and to_date - """, (self.doc.employee, dt)) + """, (self.employee, dt)) if leave: lwp = cint(leave[0][1]) and (lwp + 0.5) or (lwp + 1) return lwp @@ -131,11 +131,11 @@ class SalarySlip(TransactionBase): ret_exist = frappe.db.sql("""select name from `tabSalary Slip` where month = %s and fiscal_year = %s and docstatus != 2 and employee = %s and name != %s""", - (self.doc.month, self.doc.fiscal_year, self.doc.employee, self.doc.name)) + (self.month, self.fiscal_year, self.employee, self.name)) if ret_exist: - self.doc.employee = '' + self.employee = '' msgprint("Salary Slip of employee '%s' already created for this month" - % self.doc.employee, raise_exception=1) + % self.employee, raise_exception=1) def validate(self): @@ -146,59 +146,59 @@ class SalarySlip(TransactionBase): len(self.get("deduction_details"))): self.get_emp_and_leave_details() else: - self.get_leave_details(self.doc.leave_without_pay) + self.get_leave_details(self.leave_without_pay) - if not self.doc.net_pay: + if not self.net_pay: self.calculate_net_pay() - company_currency = get_company_currency(self.doc.company) - self.doc.total_in_words = money_in_words(self.doc.rounded_total, company_currency) + company_currency = get_company_currency(self.company) + self.total_in_words = money_in_words(self.rounded_total, company_currency) def calculate_earning_total(self): - self.doc.gross_pay = flt(self.doc.arrear_amount) + flt(self.doc.leave_encashment_amount) + self.gross_pay = flt(self.arrear_amount) + flt(self.leave_encashment_amount) for d in self.get("earning_details"): if cint(d.e_depends_on_lwp) == 1: - d.e_modified_amount = _round(flt(d.e_amount) * flt(self.doc.payment_days) - / cint(self.doc.total_days_in_month), 2) - elif not self.doc.payment_days: + d.e_modified_amount = _round(flt(d.e_amount) * flt(self.payment_days) + / cint(self.total_days_in_month), 2) + elif not self.payment_days: d.e_modified_amount = 0 else: d.e_modified_amount = d.e_amount - self.doc.gross_pay += flt(d.e_modified_amount) + self.gross_pay += flt(d.e_modified_amount) def calculate_ded_total(self): - self.doc.total_deduction = 0 + self.total_deduction = 0 for d in self.get('deduction_details'): if cint(d.d_depends_on_lwp) == 1: - d.d_modified_amount = _round(flt(d.d_amount) * flt(self.doc.payment_days) - / cint(self.doc.total_days_in_month), 2) - elif not self.doc.payment_days: + d.d_modified_amount = _round(flt(d.d_amount) * flt(self.payment_days) + / cint(self.total_days_in_month), 2) + elif not self.payment_days: d.d_modified_amount = 0 else: d.d_modified_amount = d.d_amount - self.doc.total_deduction += flt(d.d_modified_amount) + self.total_deduction += flt(d.d_modified_amount) def calculate_net_pay(self): self.calculate_earning_total() self.calculate_ded_total() - self.doc.net_pay = flt(self.doc.gross_pay) - flt(self.doc.total_deduction) - self.doc.rounded_total = _round(self.doc.net_pay) + self.net_pay = flt(self.gross_pay) - flt(self.total_deduction) + self.rounded_total = _round(self.net_pay) def on_submit(self): - if(self.doc.email_check == 1): + if(self.email_check == 1): self.send_mail_funct() def send_mail_funct(self): from frappe.utils.email_lib import sendmail - receiver = frappe.db.get_value("Employee", self.doc.employee, "company_email") + receiver = frappe.db.get_value("Employee", self.employee, "company_email") if receiver: - subj = 'Salary Slip - ' + cstr(self.doc.month) +'/'+cstr(self.doc.fiscal_year) + subj = 'Salary Slip - ' + cstr(self.month) +'/'+cstr(self.fiscal_year) earn_ret=frappe.db.sql("""select e_type, e_modified_amount from `tabSalary Slip Earning` - where parent = %s""", self.doc.name) + where parent = %s""", self.name) ded_ret=frappe.db.sql("""select d_type, d_modified_amount from `tabSalary Slip Deduction` - where parent = %s""", self.doc.name) + where parent = %s""", self.name) earn_table = '' ded_table = '' @@ -288,13 +288,13 @@ class SalarySlip(TransactionBase): Net Pay(in words) : %s -
''' % (cstr(letter_head), cstr(self.doc.employee), - cstr(self.doc.employee_name), cstr(self.doc.month), cstr(self.doc.fiscal_year), - cstr(self.doc.department), cstr(self.doc.branch), cstr(self.doc.designation), - cstr(self.doc.grade), cstr(self.doc.bank_account_no), cstr(self.doc.bank_name), - cstr(self.doc.arrear_amount), cstr(self.doc.payment_days), earn_table, ded_table, - cstr(flt(self.doc.gross_pay)), cstr(flt(self.doc.total_deduction)), - cstr(flt(self.doc.net_pay)), cstr(self.doc.total_in_words)) + ''' % (cstr(letter_head), cstr(self.employee), + cstr(self.employee_name), cstr(self.month), cstr(self.fiscal_year), + cstr(self.department), cstr(self.branch), cstr(self.designation), + cstr(self.grade), cstr(self.bank_account_no), cstr(self.bank_name), + cstr(self.arrear_amount), cstr(self.payment_days), earn_table, ded_table, + cstr(flt(self.gross_pay)), cstr(flt(self.total_deduction)), + cstr(flt(self.net_pay)), cstr(self.total_in_words)) sendmail([receiver], subject=subj, msg = msg) else: diff --git a/erpnext/hr/doctype/salary_slip/test_salary_slip.py b/erpnext/hr/doctype/salary_slip/test_salary_slip.py index b667f9cd95..e991a8a4ed 100644 --- a/erpnext/hr/doctype/salary_slip/test_salary_slip.py +++ b/erpnext/hr/doctype/salary_slip/test_salary_slip.py @@ -11,7 +11,7 @@ class TestSalarySlip(unittest.TestCase): from erpnext.hr.doctype.leave_application.test_leave_application import test_records as leave_applications la = frappe.bean(copy=leave_applications[4]) la.insert() - la.doc.status = "Approved" + la.status = "Approved" la.submit() def tearDown(self): @@ -21,26 +21,26 @@ class TestSalarySlip(unittest.TestCase): frappe.db.set_value("HR Settings", "HR Settings", "include_holidays_in_total_working_days", 1) ss = frappe.bean(copy=test_records[0]) ss.insert() - self.assertEquals(ss.doc.total_days_in_month, 31) - self.assertEquals(ss.doc.payment_days, 30) + self.assertEquals(ss.total_days_in_month, 31) + self.assertEquals(ss.payment_days, 30) self.assertEquals(ss.doclist[1].e_modified_amount, 14516.13) self.assertEquals(ss.doclist[2].e_modified_amount, 500) self.assertEquals(ss.doclist[3].d_modified_amount, 100) self.assertEquals(ss.doclist[4].d_modified_amount, 48.39) - self.assertEquals(ss.doc.gross_pay, 15016.13) - self.assertEquals(ss.doc.net_pay, 14867.74) + self.assertEquals(ss.gross_pay, 15016.13) + self.assertEquals(ss.net_pay, 14867.74) def test_salary_slip_with_holidays_excluded(self): ss = frappe.bean(copy=test_records[0]) ss.insert() - self.assertEquals(ss.doc.total_days_in_month, 30) - self.assertEquals(ss.doc.payment_days, 29) + self.assertEquals(ss.total_days_in_month, 30) + self.assertEquals(ss.payment_days, 29) self.assertEquals(ss.doclist[1].e_modified_amount, 14500) self.assertEquals(ss.doclist[2].e_modified_amount, 500) self.assertEquals(ss.doclist[3].d_modified_amount, 100) self.assertEquals(ss.doclist[4].d_modified_amount, 48.33) - self.assertEquals(ss.doc.gross_pay, 15000) - self.assertEquals(ss.doc.net_pay, 14851.67) + self.assertEquals(ss.gross_pay, 15000) + self.assertEquals(ss.net_pay, 14851.67) test_dependencies = ["Leave Application"] diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.py b/erpnext/hr/doctype/salary_structure/salary_structure.py index ab73a09510..340ffe9dd1 100644 --- a/erpnext/hr/doctype/salary_structure/salary_structure.py +++ b/erpnext/hr/doctype/salary_structure/salary_structure.py @@ -13,12 +13,12 @@ from frappe.model.document import Document class SalaryStructure(Document): def autoname(self): - self.doc.name = make_autoname(self.doc.employee + '/.SST' + '/.#####') + self.name = make_autoname(self.employee + '/.SST' + '/.#####') def get_employee_details(self): ret = {} det = frappe.db.sql("""select employee_name, branch, designation, department, grade - from `tabEmployee` where name = %s""", self.doc.employee) + from `tabEmployee` where name = %s""", self.employee) if det: ret = { 'employee_name': cstr(det[0][0]), @@ -26,7 +26,7 @@ class SalaryStructure(Document): 'designation': cstr(det[0][2]), 'department': cstr(det[0][3]), 'grade': cstr(det[0][4]), - 'backup_employee': cstr(self.doc.employee) + 'backup_employee': cstr(self.employee) } return ret @@ -42,7 +42,7 @@ class SalaryStructure(Document): def make_table(self, doct_name, tab_fname, tab_name): list1 = frappe.db.sql("select name from `tab%s` where docstatus != 2" % doct_name) for li in list1: - child = self.doc.append(tab_fname, {}) + child = self.append(tab_fname, {}) if(tab_fname == 'earning_details'): child.e_type = cstr(li[0]) child.modified_value = 0 @@ -56,13 +56,13 @@ class SalaryStructure(Document): def check_existing(self): ret = frappe.db.sql("""select name from `tabSalary Structure` where is_active = 'Yes' - and employee = %s and name!=%s""", (self.doc.employee,self.doc.name)) - if ret and self.doc.is_active=='Yes': + and employee = %s and name!=%s""", (self.employee,self.name)) + if ret and self.is_active=='Yes': msgprint(_("""Another Salary Structure '%s' is active for employee '%s'. Please make its status 'Inactive' to proceed.""") % - (cstr(ret), self.doc.employee), raise_exception=1) + (cstr(ret), self.employee), raise_exception=1) def validate_amount(self): - if flt(self.doc.net_pay) < 0: + if flt(self.net_pay) < 0: msgprint(_("Net pay can not be negative"), raise_exception=1) def validate(self): diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index bd5642ee6b..d3b822b50c 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -16,13 +16,13 @@ class Bom(Document): def autoname(self): last_name = frappe.db.sql("""select max(name) from `tabBOM` - where name like "BOM/%s/%%" """ % cstr(self.doc.item).replace('"', '\\"')) + where name like "BOM/%s/%%" """ % cstr(self.item).replace('"', '\\"')) if last_name: idx = cint(cstr(last_name[0][0]).split('/')[-1].split('-')[0]) + 1 else: idx = 1 - self.doc.name = 'BOM/' + self.doc.item + ('/%.3i' % idx) + self.name = 'BOM/' + self.item + ('/%.3i' % idx) def validate(self): self.clear_operations() @@ -39,7 +39,7 @@ class Bom(Document): def on_update(self): self.check_recursion() self.update_exploded_items() - self.doc.save() + self.save() def on_submit(self): self.manage_default_bom() @@ -65,7 +65,7 @@ class Bom(Document): return item def validate_rm_item(self, item): - if item[0]['name'] == self.doc.item: + if item[0]['name'] == self.item: msgprint("Item_code: %s in materials tab cannot be same as FG Item", item[0]['name'], raise_exception=1) @@ -78,8 +78,8 @@ class Bom(Document): "qty": item.qty}) for r in ret: - if not item.fields.get(r): - item.fields[r] = ret[r] + if not item.get(r): + item.set(r, ret[r]) def get_bom_material_detail(self, args=None): """ Get raw material details like uom, desc and rate""" @@ -111,16 +111,16 @@ class Bom(Document): if arg['bom_no']: rate = self.get_bom_unitcost(arg['bom_no']) elif arg and (arg['is_purchase_item'] == 'Yes' or arg['is_sub_contracted_item'] == 'Yes'): - if self.doc.rm_cost_as_per == 'Valuation Rate': + if self.rm_cost_as_per == 'Valuation Rate': rate = self.get_valuation_rate(arg) - elif self.doc.rm_cost_as_per == 'Last Purchase Rate': + elif self.rm_cost_as_per == 'Last Purchase Rate': rate = arg['last_purchase_rate'] - elif self.doc.rm_cost_as_per == "Price List": - if not self.doc.buying_price_list: + elif self.rm_cost_as_per == "Price List": + if not self.buying_price_list: frappe.throw(_("Please select Price List")) - rate = frappe.db.get_value("Item Price", {"price_list": self.doc.buying_price_list, + rate = frappe.db.get_value("Item Price", {"price_list": self.buying_price_list, "item_code": arg["item_code"]}, "price_list_rate") or 0 - elif self.doc.rm_cost_as_per == 'Standard Rate': + elif self.rm_cost_as_per == 'Standard Rate': rate = arg['standard_rate'] return rate @@ -133,9 +133,9 @@ class Bom(Document): 'qty': d.qty })["rate"] - if self.doc.docstatus == 0: + if self.docstatus == 0: frappe.bean(self.doclist).save() - elif self.doc.docstatus == 1: + elif self.docstatus == 1: self.calculate_cost() self.update_exploded_items() frappe.bean(self.doclist).update_after_submit() @@ -151,8 +151,8 @@ class Bom(Document): as on costing date """ from erpnext.stock.utils import get_incoming_rate - dt = self.doc.costing_date or nowdate() - time = self.doc.costing_date == nowdate() and now().split()[1] or '23:59' + dt = self.costing_date or nowdate() + time = self.costing_date == nowdate() and now().split()[1] or '23:59' warehouse = frappe.db.sql("select warehouse from `tabBin` where item_code = %s", args['item_code']) rate = [] for wh in warehouse: @@ -172,38 +172,38 @@ class Bom(Document): """ Uncheck others if current one is selected as default, update default bom in item master """ - if self.doc.is_default and self.doc.is_active: + if self.is_default and self.is_active: from frappe.model.utils import set_default set_default(self.doc, "item") - frappe.db.set_value("Item", self.doc.item, "default_bom", self.doc.name) + frappe.db.set_value("Item", self.item, "default_bom", self.name) else: - if not self.doc.is_active: + if not self.is_active: frappe.db.set(self.doc, "is_default", 0) frappe.db.sql("update `tabItem` set default_bom = null where name = %s and default_bom = %s", - (self.doc.item, self.doc.name)) + (self.item, self.name)) def clear_operations(self): - if not self.doc.with_operations: + if not self.with_operations: self.set('bom_operations', []) for d in self.get("bom_materials"): d.operation_no = None def validate_main_item(self): """ Validate main FG item""" - item = self.get_item_det(self.doc.item) + item = self.get_item_det(self.item) if not item: msgprint("Item %s does not exists in the system or expired." % - self.doc.item, raise_exception = 1) + self.item, raise_exception = 1) elif item[0]['is_manufactured_item'] != 'Yes' \ and item[0]['is_sub_contracted_item'] != 'Yes': msgprint("""As Item: %s is not a manufactured / sub-contracted item, \ - you can not make BOM for it""" % self.doc.item, raise_exception = 1) + you can not make BOM for it""" % self.item, raise_exception = 1) else: - ret = frappe.db.get_value("Item", self.doc.item, ["description", "stock_uom"]) - self.doc.description = ret[0] - self.doc.uom = ret[1] + ret = frappe.db.get_value("Item", self.item, ["description", "stock_uom"]) + self.description = ret[0] + self.uom = ret[1] def validate_operations(self): """ Check duplicate operation no""" @@ -221,7 +221,7 @@ class Bom(Document): check_list = [] for m in self.get('bom_materials'): # check if operation no not in op table - if self.doc.with_operations and cstr(m.operation_no) not in self.op: + if self.with_operations and cstr(m.operation_no) not in self.op: msgprint("""Operation no: %s against item: %s at row no: %s \ is not present at Operations table""" % (m.operation_no, m.item_code, m.idx), raise_exception = 1) @@ -267,15 +267,15 @@ class Bom(Document): check_list = [['parent', 'bom_no', 'parent'], ['bom_no', 'parent', 'child']] for d in check_list: - bom_list, count = [self.doc.name], 0 + bom_list, count = [self.name], 0 while (len(bom_list) > count ): boms = frappe.db.sql(" select %s from `tabBOM Item` where %s = %s " % (d[0], d[1], '%s'), cstr(bom_list[count])) count = count + 1 for b in boms: - if b[0] == self.doc.name: + if b[0] == self.name: msgprint("""Recursion Occured => '%s' cannot be '%s' of '%s'. - """ % (cstr(b[0]), cstr(d[2]), self.doc.name), raise_exception = 1) + """ % (cstr(b[0]), cstr(d[2]), self.name), raise_exception = 1) if b[0]: bom_list.append(b[0]) @@ -293,8 +293,8 @@ class Bom(Document): where parent = %s and ifnull(bom_no, '') != ''""", bom_no)] count = 0 - if self.doc.name not in bom_list: - bom_list.append(self.doc.name) + if self.name not in bom_list: + bom_list.append(self.name) while(count < len(bom_list)): for child_bom in _get_children(bom_list[count]): @@ -308,7 +308,7 @@ class Bom(Document): """Calculate bom totals""" self.calculate_op_cost() self.calculate_rm_cost() - self.doc.total_cost = self.doc.raw_material_cost + self.doc.operating_cost + self.total_cost = self.raw_material_cost + self.operating_cost def calculate_op_cost(self): """Update workstation rate and calculates totals""" @@ -319,7 +319,7 @@ class Bom(Document): if d.hour_rate and d.time_in_mins: d.operating_cost = flt(d.hour_rate) * flt(d.time_in_mins) / 60.0 total_op_cost += flt(d.operating_cost) - self.doc.operating_cost = total_op_cost + self.operating_cost = total_op_cost def calculate_rm_cost(self): """Fetch RM rate as per today's valuation rate and calculate totals""" @@ -328,10 +328,10 @@ class Bom(Document): if d.bom_no: d.rate = self.get_bom_unitcost(d.bom_no) d.amount = flt(d.rate) * flt(d.qty) - d.qty_consumed_per_unit = flt(d.qty) / flt(self.doc.quantity) + d.qty_consumed_per_unit = flt(d.qty) / flt(self.quantity) total_rm_cost += d.amount - self.doc.raw_material_cost = total_rm_cost + self.raw_material_cost = total_rm_cost def update_exploded_items(self): """ Update Flat BOM, following will be correct data""" @@ -379,23 +379,23 @@ class Bom(Document): "Add items to Flat BOM table" self.set('flat_bom_details', []) for d in self.cur_exploded_items: - ch = self.doc.append('flat_bom_details', {}) + ch = self.append('flat_bom_details', {}) for i in self.cur_exploded_items[d].keys(): - ch.fields[i] = self.cur_exploded_items[d][i] + ch.set(i, self.cur_exploded_items[d][i]) ch.amount = flt(ch.qty) * flt(ch.rate) - ch.qty_consumed_per_unit = flt(ch.qty) / flt(self.doc.quantity) - ch.docstatus = self.doc.docstatus + ch.qty_consumed_per_unit = flt(ch.qty) / flt(self.quantity) + ch.docstatus = self.docstatus ch.save(1) def validate_bom_links(self): - if not self.doc.is_active: + if not self.is_active: act_pbom = frappe.db.sql("""select distinct bom_item.parent from `tabBOM Item` bom_item where bom_item.bom_no = %s and bom_item.docstatus = 1 and exists (select * from `tabBOM` where name = bom_item.parent - and docstatus = 1 and is_active = 1)""", self.doc.name) + and docstatus = 1 and is_active = 1)""", self.name) if act_pbom and act_pbom[0][0]: - action = self.doc.docstatus < 2 and _("deactivate") or _("cancel") + action = self.docstatus < 2 and _("deactivate") or _("cancel") msgprint(_("Cannot ") + action + _(": It is linked to other active BOM(s)"), raise_exception=1) diff --git a/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.py b/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.py index c406777a84..96696c70e6 100644 --- a/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.py +++ b/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.py @@ -26,18 +26,18 @@ class BomReplaceTool(Document): frappe.msgprint(_("BOM replaced")) def validate_bom(self): - if cstr(self.doc.current_bom) == cstr(self.doc.new_bom): + if cstr(self.current_bom) == cstr(self.new_bom): msgprint("Current BOM and New BOM can not be same", raise_exception=1) def update_new_bom(self): current_bom_unitcost = frappe.db.sql("""select total_cost/quantity - from `tabBOM` where name = %s""", self.doc.current_bom) + from `tabBOM` where name = %s""", self.current_bom) current_bom_unitcost = current_bom_unitcost and flt(current_bom_unitcost[0][0]) or 0 frappe.db.sql("""update `tabBOM Item` set bom_no=%s, rate=%s, amount=qty*%s where bom_no = %s and docstatus < 2""", - (self.doc.new_bom, current_bom_unitcost, current_bom_unitcost, self.doc.current_bom)) + (self.new_bom, current_bom_unitcost, current_bom_unitcost, self.current_bom)) def get_parent_boms(self): return [d[0] for d in frappe.db.sql("""select distinct parent from `tabBOM Item` where ifnull(bom_no, '') = %s and docstatus < 2""", - self.doc.new_bom)] \ No newline at end of file + self.new_bom)] \ No newline at end of file diff --git a/erpnext/manufacturing/doctype/production_order/production_order.py b/erpnext/manufacturing/doctype/production_order/production_order.py index aeea1c0762..4921d0631d 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.py +++ b/erpnext/manufacturing/doctype/production_order/production_order.py @@ -15,11 +15,11 @@ from frappe.model.document import Document class ProductionOrder(Document): def validate(self): - if self.doc.docstatus == 0: - self.doc.status = "Draft" + if self.docstatus == 0: + self.status = "Draft" from erpnext.utilities import validate_status - validate_status(self.doc.status, ["Draft", "Submitted", "Stopped", + validate_status(self.status, ["Draft", "Submitted", "Stopped", "In Process", "Completed", "Cancelled"]) self.validate_bom_no() @@ -30,64 +30,64 @@ class ProductionOrder(Document): validate_uom_is_integer(self.doclist, "stock_uom", ["qty", "produced_qty"]) def validate_bom_no(self): - if self.doc.bom_no: + if self.bom_no: bom = frappe.db.sql("""select name from `tabBOM` where name=%s and docstatus=1 and is_active=1 and item=%s""" - , (self.doc.bom_no, self.doc.production_item), as_dict =1) + , (self.bom_no, self.production_item), as_dict =1) if not bom: frappe.throw("""Incorrect BOM: %s entered. May be BOM not exists or inactive or not submitted - or for some other item.""" % cstr(self.doc.bom_no)) + or for some other item.""" % cstr(self.bom_no)) def validate_sales_order(self): - if self.doc.sales_order: + if self.sales_order: so = frappe.db.sql("""select name, delivery_date from `tabSales Order` - where name=%s and docstatus = 1""", self.doc.sales_order, as_dict=1)[0] + where name=%s and docstatus = 1""", self.sales_order, as_dict=1)[0] if not so.name: - frappe.throw("Sales Order: %s is not valid" % self.doc.sales_order) + frappe.throw("Sales Order: %s is not valid" % self.sales_order) - if not self.doc.expected_delivery_date: - self.doc.expected_delivery_date = so.delivery_date + if not self.expected_delivery_date: + self.expected_delivery_date = so.delivery_date self.validate_production_order_against_so() def validate_warehouse(self): from erpnext.stock.utils import validate_warehouse_company - for w in [self.doc.fg_warehouse, self.doc.wip_warehouse]: - validate_warehouse_company(w, self.doc.company) + for w in [self.fg_warehouse, self.wip_warehouse]: + validate_warehouse_company(w, self.company) def validate_production_order_against_so(self): # already ordered qty ordered_qty_against_so = frappe.db.sql("""select sum(qty) from `tabProduction Order` where production_item = %s and sales_order = %s and docstatus < 2 and name != %s""", - (self.doc.production_item, self.doc.sales_order, self.doc.name))[0][0] + (self.production_item, self.sales_order, self.name))[0][0] - total_qty = flt(ordered_qty_against_so) + flt(self.doc.qty) + total_qty = flt(ordered_qty_against_so) + flt(self.qty) # get qty from Sales Order Item table so_item_qty = frappe.db.sql("""select sum(qty) from `tabSales Order Item` where parent = %s and item_code = %s""", - (self.doc.sales_order, self.doc.production_item))[0][0] + (self.sales_order, self.production_item))[0][0] # get qty from Packing Item table dnpi_qty = frappe.db.sql("""select sum(qty) from `tabPacked Item` where parent = %s and parenttype = 'Sales Order' and item_code = %s""", - (self.doc.sales_order, self.doc.production_item))[0][0] + (self.sales_order, self.production_item))[0][0] # total qty in SO so_qty = flt(so_item_qty) + flt(dnpi_qty) if total_qty > so_qty: frappe.throw(_("Total production order qty for item") + ": " + - cstr(self.doc.production_item) + _(" against sales order") + ": " + - cstr(self.doc.sales_order) + _(" will be ") + cstr(total_qty) + ", " + + cstr(self.production_item) + _(" against sales order") + ": " + + cstr(self.sales_order) + _(" will be ") + cstr(total_qty) + ", " + _("which is greater than sales order qty ") + "(" + cstr(so_qty) + ")" + _("Please reduce qty."), exc=OverProductionError) def stop_unstop(self, status): """ Called from client side on Stop/Unstop event""" self.update_status(status) - qty = (flt(self.doc.qty)-flt(self.doc.produced_qty)) * ((status == 'Stopped') and -1 or 1) + qty = (flt(self.qty)-flt(self.produced_qty)) * ((status == 'Stopped') and -1 or 1) self.update_planned_qty(qty) msgprint("Production Order has been %s" % status) @@ -96,37 +96,37 @@ class ProductionOrder(Document): if status == 'Stopped': frappe.db.set(self.doc, 'status', cstr(status)) else: - if flt(self.doc.qty) == flt(self.doc.produced_qty): + if flt(self.qty) == flt(self.produced_qty): frappe.db.set(self.doc, 'status', 'Completed') - if flt(self.doc.qty) > flt(self.doc.produced_qty): + if flt(self.qty) > flt(self.produced_qty): frappe.db.set(self.doc, 'status', 'In Process') - if flt(self.doc.produced_qty) == 0: + if flt(self.produced_qty) == 0: frappe.db.set(self.doc, 'status', 'Submitted') def on_submit(self): - if not self.doc.wip_warehouse: + if not self.wip_warehouse: frappe.throw(_("WIP Warehouse required before Submit")) frappe.db.set(self.doc,'status', 'Submitted') - self.update_planned_qty(self.doc.qty) + self.update_planned_qty(self.qty) def on_cancel(self): # Check whether any stock entry exists against this Production Order stock_entry = frappe.db.sql("""select name from `tabStock Entry` - where production_order = %s and docstatus = 1""", self.doc.name) + where production_order = %s and docstatus = 1""", self.name) if stock_entry: frappe.throw("""Submitted Stock Entry %s exists against this production order. Hence can not be cancelled.""" % stock_entry[0][0]) frappe.db.set(self.doc,'status', 'Cancelled') - self.update_planned_qty(-self.doc.qty) + self.update_planned_qty(-self.qty) def update_planned_qty(self, qty): """update planned qty in bin""" args = { - "item_code": self.doc.production_item, - "warehouse": self.doc.fg_warehouse, + "item_code": self.production_item, + "warehouse": self.fg_warehouse, "posting_date": nowdate(), "planned_qty": flt(qty) } @@ -155,18 +155,18 @@ def make_stock_entry(production_order_id, purpose): production_order = frappe.bean("Production Order", production_order_id) stock_entry = frappe.new_bean("Stock Entry") - stock_entry.doc.purpose = purpose - stock_entry.doc.production_order = production_order_id - stock_entry.doc.company = production_order.doc.company - stock_entry.doc.bom_no = production_order.doc.bom_no - stock_entry.doc.use_multi_level_bom = production_order.doc.use_multi_level_bom - stock_entry.doc.fg_completed_qty = flt(production_order.doc.qty) - flt(production_order.doc.produced_qty) + stock_entry.purpose = purpose + stock_entry.production_order = production_order_id + stock_entry.company = production_order.company + stock_entry.bom_no = production_order.bom_no + stock_entry.use_multi_level_bom = production_order.use_multi_level_bom + stock_entry.fg_completed_qty = flt(production_order.qty) - flt(production_order.produced_qty) if purpose=="Material Transfer": - stock_entry.doc.to_warehouse = production_order.doc.wip_warehouse + stock_entry.to_warehouse = production_order.wip_warehouse else: - stock_entry.doc.from_warehouse = production_order.doc.wip_warehouse - stock_entry.doc.to_warehouse = production_order.doc.fg_warehouse + stock_entry.from_warehouse = production_order.wip_warehouse + stock_entry.to_warehouse = production_order.fg_warehouse stock_entry.run_method("get_items") return [d.fields for d in stock_entry.doclist] diff --git a/erpnext/manufacturing/doctype/production_order/test_production_order.py b/erpnext/manufacturing/doctype/production_order/test_production_order.py index 928abaea32..73b7bcffa3 100644 --- a/erpnext/manufacturing/doctype/production_order/test_production_order.py +++ b/erpnext/manufacturing/doctype/production_order/test_production_order.py @@ -31,21 +31,21 @@ class TestProductionOrder(unittest.TestCase): mr2.insert() mr2.submit() - stock_entry = make_stock_entry(pro_bean.doc.name, "Manufacture/Repack") + stock_entry = make_stock_entry(pro_bean.name, "Manufacture/Repack") stock_entry = frappe.bean(stock_entry) - stock_entry.doc.fiscal_year = "_Test Fiscal Year 2013" - stock_entry.doc.fg_completed_qty = 4 - stock_entry.doc.posting_date = "2013-05-12" - stock_entry.doc.fiscal_year = "_Test Fiscal Year 2013" + stock_entry.fiscal_year = "_Test Fiscal Year 2013" + stock_entry.fg_completed_qty = 4 + stock_entry.posting_date = "2013-05-12" + stock_entry.fiscal_year = "_Test Fiscal Year 2013" stock_entry.run_method("get_items") stock_entry.submit() - self.assertEqual(frappe.db.get_value("Production Order", pro_bean.doc.name, + self.assertEqual(frappe.db.get_value("Production Order", pro_bean.name, "produced_qty"), 4) self.assertEqual(frappe.db.get_value("Bin", {"item_code": "_Test FG Item", "warehouse": "_Test Warehouse 1 - _TC"}, "planned_qty"), 6) - return pro_bean.doc.name + return pro_bean.name def test_over_production(self): from erpnext.stock.doctype.stock_entry.stock_entry import StockOverProductionError @@ -53,9 +53,9 @@ class TestProductionOrder(unittest.TestCase): stock_entry = make_stock_entry(pro_order, "Manufacture/Repack") stock_entry = frappe.bean(stock_entry) - stock_entry.doc.posting_date = "2013-05-12" - stock_entry.doc.fiscal_year = "_Test Fiscal Year 2013" - stock_entry.doc.fg_completed_qty = 15 + stock_entry.posting_date = "2013-05-12" + stock_entry.fiscal_year = "_Test Fiscal Year 2013" + stock_entry.fg_completed_qty = 15 stock_entry.run_method("get_items") stock_entry.insert() diff --git a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py index 9f14b2cc4e..cdda05ed26 100644 --- a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py +++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py @@ -43,21 +43,21 @@ class ProductionPlanningTool(Document): self.set('pp_details', []) def validate_company(self): - if not self.doc.company: + if not self.company: frappe.throw(_("Please enter Company")) def get_open_sales_orders(self): """ Pull sales orders which are pending to deliver based on criteria selected""" so_filter = item_filter = "" - if self.doc.from_date: - so_filter += ' and so.transaction_date >= "' + self.doc.from_date + '"' - if self.doc.to_date: - so_filter += ' and so.transaction_date <= "' + self.doc.to_date + '"' - if self.doc.customer: - so_filter += ' and so.customer = "' + self.doc.customer + '"' + if self.from_date: + so_filter += ' and so.transaction_date >= "' + self.from_date + '"' + if self.to_date: + so_filter += ' and so.transaction_date <= "' + self.to_date + '"' + if self.customer: + so_filter += ' and so.customer = "' + self.customer + '"' - if self.doc.fg_item: - item_filter += ' and item.name = "' + self.doc.fg_item + '"' + if self.fg_item: + item_filter += ' and item.name = "' + self.fg_item + '"' open_so = frappe.db.sql(""" select distinct so.name, so.transaction_date, so.customer, so.grand_total @@ -74,7 +74,7 @@ class ProductionPlanningTool(Document): and exists (select name from `tabItem` item where item.name=pi.item_code and (ifnull(item.is_pro_applicable, 'No') = 'Yes' or ifnull(item.is_sub_contracted_item, 'No') = 'Yes') %s))) - """ % ('%s', so_filter, item_filter, item_filter), self.doc.company, as_dict=1) + """ % ('%s', so_filter, item_filter, item_filter), self.company, as_dict=1) self.add_so_in_table(open_so) @@ -85,7 +85,7 @@ class ProductionPlanningTool(Document): so_list = [d.sales_order for d in self.get('pp_so_details')] for r in open_so: if cstr(r['name']) not in so_list: - pp_so = self.doc.append('pp_so_details', {}) + pp_so = self.append('pp_so_details', {}) pp_so.sales_order = r['name'] pp_so.sales_order_date = cstr(r['transaction_date']) pp_so.customer = cstr(r['customer']) @@ -135,7 +135,7 @@ class ProductionPlanningTool(Document): for p in items: item_details = frappe.db.sql("""select description, stock_uom, default_bom from tabItem where name=%s""", p['item_code']) - pi = self.doc.append('pp_details', {}) + pi = self.append('pp_details', {}) pi.sales_order = p['parent'] pi.warehouse = p['warehouse'] pi.item_code = p['item_code'] @@ -200,7 +200,7 @@ class ProductionPlanningTool(Document): "bom_no" : d.bom_no, "description" : d.description, "stock_uom" : d.stock_uom, - "company" : self.doc.company, + "company" : self.company, "wip_warehouse" : "", "fg_warehouse" : d.warehouse, "status" : "Draft", @@ -214,12 +214,12 @@ class ProductionPlanningTool(Document): pro_list = [] for key in items: pro = frappe.new_bean("Production Order") - pro.doc.fields.update(items[key]) + pro.update(items[key]) frappe.flags.mute_messages = True try: pro.insert() - pro_list.append(pro.doc.name) + pro_list.append(pro.name) except OverProductionError, e: pass @@ -244,7 +244,7 @@ class ProductionPlanningTool(Document): for bom, so_wise_qty in bom_dict.items(): bom_wise_item_details = {} - if self.doc.use_multi_level_bom: + if self.use_multi_level_bom: # get all raw materials with sub assembly childs for d in frappe.db.sql("""select fb.item_code, ifnull(sum(fb.qty_consumed_per_unit), 0) as qty, @@ -303,7 +303,7 @@ class ProductionPlanningTool(Document): Requested qty should be shortage qty considering minimum order qty """ self.validate_data() - if not self.doc.purchase_request_for_warehouse: + if not self.purchase_request_for_warehouse: frappe.throw(_("Please enter Warehouse for which Material Request will be raised")) bom_dict = self.get_distinct_items_and_boms()[0] @@ -372,7 +372,7 @@ class ProductionPlanningTool(Document): "naming_series": "IDT", "transaction_date": nowdate(), "status": "Draft", - "company": self.doc.company, + "company": self.company, "fiscal_year": fiscal_year, "requested_by": frappe.session.user, "material_request_type": "Purchase" @@ -382,14 +382,14 @@ class ProductionPlanningTool(Document): "doctype": "Material Request Item", "__islocal": 1, "item_code": item, - "item_name": item_wrapper.doc.item_name, - "description": item_wrapper.doc.description, - "uom": item_wrapper.doc.stock_uom, - "item_group": item_wrapper.doc.item_group, - "brand": item_wrapper.doc.brand, + "item_name": item_wrapper.item_name, + "description": item_wrapper.description, + "uom": item_wrapper.stock_uom, + "item_group": item_wrapper.item_group, + "brand": item_wrapper.brand, "qty": requested_qty, - "schedule_date": add_days(nowdate(), cint(item_wrapper.doc.lead_time_days)), - "warehouse": self.doc.purchase_request_for_warehouse, + "schedule_date": add_days(nowdate(), cint(item_wrapper.lead_time_days)), + "warehouse": self.purchase_request_for_warehouse, "sales_order_no": sales_order if sales_order!="No Sales Order" else None }) diff --git a/erpnext/manufacturing/doctype/workstation/workstation.py b/erpnext/manufacturing/doctype/workstation/workstation.py index dd53c56429..c2c492eb72 100644 --- a/erpnext/manufacturing/doctype/workstation/workstation.py +++ b/erpnext/manufacturing/doctype/workstation/workstation.py @@ -14,14 +14,14 @@ class Workstation(Document): def update_bom_operation(self): bom_list = frappe.db.sql("""select DISTINCT parent from `tabBOM Operation` - where workstation = %s""", self.doc.name) + where workstation = %s""", self.name) for bom_no in bom_list: frappe.db.sql("""update `tabBOM Operation` set hour_rate = %s where parent = %s and workstation = %s""", - (self.doc.hour_rate, bom_no[0], self.doc.name)) + (self.hour_rate, bom_no[0], self.name)) def on_update(self): - frappe.db.set(self.doc, 'overhead', flt(self.doc.hour_rate_electricity) + - flt(self.doc.hour_rate_consumable) + flt(self.doc.hour_rate_rent)) - frappe.db.set(self.doc, 'hour_rate', flt(self.doc.hour_rate_labour) + flt(self.doc.overhead)) + frappe.db.set(self.doc, 'overhead', flt(self.hour_rate_electricity) + + flt(self.hour_rate_consumable) + flt(self.hour_rate_rent)) + frappe.db.set(self.doc, 'hour_rate', flt(self.hour_rate_labour) + flt(self.overhead)) self.update_bom_operation() \ No newline at end of file diff --git a/erpnext/patches/4_0/fix_contact_address.py b/erpnext/patches/4_0/fix_contact_address.py index 4bf81b3ad8..fe33230611 100644 --- a/erpnext/patches/4_0/fix_contact_address.py +++ b/erpnext/patches/4_0/fix_contact_address.py @@ -7,6 +7,6 @@ def execute(): address = frappe.doc("Address", address) contact = frappe.bean("Contact Us Settings", "Contact Us Settings") for f in ("address_title", "address_line1", "address_line2", "city", "state", "country", "pincode"): - contact.doc.fields[f] = address.get(f) + contact.set(f, address.get(f)) contact.save() \ No newline at end of file diff --git a/erpnext/patches/4_0/split_email_settings.py b/erpnext/patches/4_0/split_email_settings.py index e73095e793..6f4395b89d 100644 --- a/erpnext/patches/4_0/split_email_settings.py +++ b/erpnext/patches/4_0/split_email_settings.py @@ -25,7 +25,7 @@ def map_outgoing_email_settings(email_settings): else: from_fieldname = to_fieldname = fieldname - outgoing_email_settings.doc.fields[to_fieldname] = email_settings.doc.fields.get(from_fieldname) + outgoing_email_settings.set(to_fieldname, email_settings.get(from_fieldname)) outgoing_email_settings.save() @@ -44,7 +44,7 @@ def map_support_email_settings(email_settings): else: from_fieldname = to_fieldname = fieldname - support_email_settings.doc.fields[to_fieldname] = email_settings.doc.fields.get(from_fieldname) + support_email_settings.set(to_fieldname, email_settings.get(from_fieldname)) support_email_settings.save() diff --git a/erpnext/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py index 99a9d3a394..f9c561e8aa 100644 --- a/erpnext/projects/doctype/project/project.py +++ b/erpnext/projects/doctype/project/project.py @@ -14,16 +14,16 @@ class Project(Document): def get_gross_profit(self): pft, per_pft =0, 0 - pft = flt(self.doc.project_value) - flt(self.doc.est_material_cost) + pft = flt(self.project_value) - flt(self.est_material_cost) #if pft > 0: - per_pft = (flt(pft) / flt(self.doc.project_value)) * 100 + per_pft = (flt(pft) / flt(self.project_value)) * 100 ret = {'gross_margin_value': pft, 'per_gross_margin': per_pft} return ret def validate(self): """validate start date before end date""" - if self.doc.project_start_date and self.doc.completion_date: - if getdate(self.doc.completion_date) < getdate(self.doc.project_start_date): + if self.project_start_date and self.completion_date: + if getdate(self.completion_date) < getdate(self.project_start_date): msgprint("Expected Completion Date can not be less than Project Start Date") raise Exception @@ -32,31 +32,31 @@ class Project(Document): def update_percent_complete(self): total = frappe.db.sql("""select count(*) from tabTask where project=%s""", - self.doc.name)[0][0] + self.name)[0][0] if total: completed = frappe.db.sql("""select count(*) from tabTask where - project=%s and status in ('Closed', 'Cancelled')""", self.doc.name)[0][0] - frappe.db.set_value("Project", self.doc.name, "percent_complete", + project=%s and status in ('Closed', 'Cancelled')""", self.name)[0][0] + frappe.db.set_value("Project", self.name, "percent_complete", int(float(completed) / total * 100)) def add_calendar_event(self): # delete any earlier event for this project - delete_events(self.doc.doctype, self.doc.name) + delete_events(self.doctype, self.name) # add events for milestone in self.get("project_milestones"): if milestone.milestone_date: - description = (milestone.milestone or "Milestone") + " for " + self.doc.name + description = (milestone.milestone or "Milestone") + " for " + self.name frappe.bean({ "doctype": "Event", - "owner": self.doc.owner, + "owner": self.owner, "subject": description, "description": description, "starts_on": milestone.milestone_date + " 10:00:00", "event_type": "Private", - "ref_type": self.doc.doctype, - "ref_name": self.doc.name + "ref_type": self.doctype, + "ref_name": self.name }).insert() def on_trash(self): - delete_events(self.doc.doctype, self.doc.name) + delete_events(self.doctype, self.name) diff --git a/erpnext/projects/doctype/task/task.py b/erpnext/projects/doctype/task/task.py index 289903d2c9..9de6b1b37f 100644 --- a/erpnext/projects/doctype/task/task.py +++ b/erpnext/projects/doctype/task/task.py @@ -13,38 +13,38 @@ from frappe.model.document import Document class Task(Document): def get_project_details(self): return { - "project": self.doc.project + "project": self.project } def get_customer_details(self): - cust = frappe.db.sql("select customer_name from `tabCustomer` where name=%s", self.doc.customer) + cust = frappe.db.sql("select customer_name from `tabCustomer` where name=%s", self.customer) if cust: ret = {'customer_name': cust and cust[0][0] or ''} return ret def validate(self): - if self.doc.exp_start_date and self.doc.exp_end_date and getdate(self.doc.exp_start_date) > getdate(self.doc.exp_end_date): + if self.exp_start_date and self.exp_end_date and getdate(self.exp_start_date) > getdate(self.exp_end_date): msgprint("'Expected Start Date' can not be greater than 'Expected End Date'") raise Exception - if self.doc.act_start_date and self.doc.act_end_date and getdate(self.doc.act_start_date) > getdate(self.doc.act_end_date): + if self.act_start_date and self.act_end_date and getdate(self.act_start_date) > getdate(self.act_end_date): msgprint("'Actual Start Date' can not be greater than 'Actual End Date'") raise Exception self.update_status() def update_status(self): - status = frappe.db.get_value("Task", self.doc.name, "status") - if self.doc.status=="Working" and status !="Working" and not self.doc.act_start_date: - self.doc.act_start_date = today() + status = frappe.db.get_value("Task", self.name, "status") + if self.status=="Working" and status !="Working" and not self.act_start_date: + self.act_start_date = today() - if self.doc.status=="Closed" and status != "Closed" and not self.doc.act_end_date: - self.doc.act_end_date = today() + if self.status=="Closed" and status != "Closed" and not self.act_end_date: + self.act_end_date = today() def on_update(self): """update percent complete in project""" - if self.doc.project: - project = frappe.bean("Project", self.doc.project) + if self.project: + project = frappe.bean("Project", self.project) project.run_method("update_percent_complete") @frappe.whitelist() diff --git a/erpnext/projects/doctype/time_log/time_log.py b/erpnext/projects/doctype/time_log/time_log.py index 3dedef14c2..f184db37f4 100644 --- a/erpnext/projects/doctype/time_log/time_log.py +++ b/erpnext/projects/doctype/time_log/time_log.py @@ -22,20 +22,20 @@ class TimeLog(Document): def calculate_total_hours(self): from frappe.utils import time_diff_in_hours - self.doc.hours = time_diff_in_hours(self.doc.to_time, self.doc.from_time) + self.hours = time_diff_in_hours(self.to_time, self.from_time) def set_status(self): - self.doc.status = { + self.status = { 0: "Draft", 1: "Submitted", 2: "Cancelled" - }[self.doc.docstatus or 0] + }[self.docstatus or 0] - if self.doc.time_log_batch: - self.doc.status="Batched for Billing" + if self.time_log_batch: + self.status="Batched for Billing" - if self.doc.sales_invoice: - self.doc.status="Billed" + if self.sales_invoice: + self.status="Billed" def validate_overlap(self): existing = frappe.db.sql_list("""select name from `tabTime Log` where owner=%s and @@ -46,9 +46,9 @@ class TimeLog(Document): and name!=%s and ifnull(task, "")=%s and docstatus < 2""", - (self.doc.owner, self.doc.from_time, self.doc.to_time, self.doc.from_time, - self.doc.to_time, self.doc.from_time, self.doc.name or "No Name", - cstr(self.doc.task))) + (self.owner, self.from_time, self.to_time, self.from_time, + self.to_time, self.from_time, self.name or "No Name", + cstr(self.task))) if existing: frappe.msgprint(_("This Time Log conflicts with") + ":" + ', '.join(existing), diff --git a/erpnext/projects/doctype/time_log_batch/test_time_log_batch.py b/erpnext/projects/doctype/time_log_batch/test_time_log_batch.py index 5649687ce7..f974d709aa 100644 --- a/erpnext/projects/doctype/time_log_batch/test_time_log_batch.py +++ b/erpnext/projects/doctype/time_log_batch/test_time_log_batch.py @@ -7,7 +7,7 @@ class TimeLogBatchTest(unittest.TestCase): def test_time_log_status(self): from erpnext.projects.doctype.time_log.test_time_log import test_records as time_log_records time_log = frappe.bean(copy=time_log_records[0]) - time_log.doc.fields.update({ + time_log.update({ "from_time": "2013-01-02 10:00:00.000000", "to_time": "2013-01-02 11:00:00.000000", "docstatus": 0 @@ -15,15 +15,15 @@ class TimeLogBatchTest(unittest.TestCase): time_log.insert() time_log.submit() - self.assertEquals(frappe.db.get_value("Time Log", time_log.doc.name, "status"), "Submitted") + self.assertEquals(frappe.db.get_value("Time Log", time_log.name, "status"), "Submitted") tlb = frappe.bean(copy=test_records[0]) - tlb.doclist[1].time_log = time_log.doc.name + tlb.doclist[1].time_log = time_log.name tlb.insert() tlb.submit() - self.assertEquals(frappe.db.get_value("Time Log", time_log.doc.name, "status"), "Batched for Billing") + self.assertEquals(frappe.db.get_value("Time Log", time_log.name, "status"), "Batched for Billing") tlb.cancel() - self.assertEquals(frappe.db.get_value("Time Log", time_log.doc.name, "status"), "Submitted") + self.assertEquals(frappe.db.get_value("Time Log", time_log.name, "status"), "Submitted") test_records = [[ { diff --git a/erpnext/projects/doctype/time_log_batch/time_log_batch.py b/erpnext/projects/doctype/time_log_batch/time_log_batch.py index 89beb9d2b1..103eb114a6 100644 --- a/erpnext/projects/doctype/time_log_batch/time_log_batch.py +++ b/erpnext/projects/doctype/time_log_batch/time_log_batch.py @@ -13,12 +13,12 @@ class TimeLogBatch(Document): def validate(self): self.set_status() - self.doc.total_hours = 0.0 + self.total_hours = 0.0 for d in self.doclist.get({"doctype":"Time Log Batch Detail"}): tl = frappe.doc("Time Log", d.time_log) self.update_time_log_values(d, tl) self.validate_time_log_is_submitted(tl) - self.doc.total_hours += float(tl.hours or 0.0) + self.total_hours += float(tl.hours or 0.0) def update_time_log_values(self, d, tl): d.fields.update({ @@ -28,33 +28,33 @@ class TimeLogBatch(Document): }) def validate_time_log_is_submitted(self, tl): - if tl.status != "Submitted" and self.doc.docstatus == 0: + if tl.status != "Submitted" and self.docstatus == 0: frappe.msgprint(_("Time Log must have status 'Submitted'") + \ " :" + tl.name + " (" + _(tl.status) + ")", raise_exception=True) def set_status(self): - self.doc.status = { + self.status = { "0": "Draft", "1": "Submitted", "2": "Cancelled" - }[str(self.doc.docstatus or 0)] + }[str(self.docstatus or 0)] - if self.doc.sales_invoice: - self.doc.status = "Billed" + if self.sales_invoice: + self.status = "Billed" def on_submit(self): - self.update_status(self.doc.name) + self.update_status(self.name) def before_cancel(self): self.update_status(None) def before_update_after_submit(self): - self.update_status(self.doc.name) + self.update_status(self.name) def update_status(self, time_log_batch): self.set_status() for d in self.doclist.get({"doctype":"Time Log Batch Detail"}): tl = frappe.bean("Time Log", d.time_log) - tl.doc.time_log_batch = time_log_batch - tl.doc.sales_invoice = self.doc.sales_invoice + tl.time_log_batch = time_log_batch + tl.sales_invoice = self.sales_invoice tl.update_after_submit() \ No newline at end of file diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py index 1ab827d0e2..c9e79929c0 100644 --- a/erpnext/selling/doctype/customer/customer.py +++ b/erpnext/selling/doctype/customer/customer.py @@ -16,54 +16,54 @@ class Customer(TransactionBase): def autoname(self): cust_master_name = frappe.defaults.get_global_default('cust_master_name') if cust_master_name == 'Customer Name': - if frappe.db.exists("Supplier", self.doc.customer_name): + if frappe.db.exists("Supplier", self.customer_name): msgprint(_("A Supplier exists with same name"), raise_exception=1) - self.doc.name = self.doc.customer_name + self.name = self.customer_name else: - self.doc.name = make_autoname(self.doc.naming_series+'.#####') + self.name = make_autoname(self.naming_series+'.#####') def get_company_abbr(self): - return frappe.db.get_value('Company', self.doc.company, 'abbr') + return frappe.db.get_value('Company', self.company, 'abbr') def validate_values(self): - if frappe.defaults.get_global_default('cust_master_name') == 'Naming Series' and not self.doc.naming_series: + if frappe.defaults.get_global_default('cust_master_name') == 'Naming Series' and not self.naming_series: frappe.throw("Series is Mandatory.", frappe.MandatoryError) def validate(self): self.validate_values() def update_lead_status(self): - if self.doc.lead_name: - frappe.db.sql("update `tabLead` set status='Converted' where name = %s", self.doc.lead_name) + if self.lead_name: + frappe.db.sql("update `tabLead` set status='Converted' where name = %s", self.lead_name) def update_address(self): frappe.db.sql("""update `tabAddress` set customer_name=%s, modified=NOW() - where customer=%s""", (self.doc.customer_name, self.doc.name)) + where customer=%s""", (self.customer_name, self.name)) def update_contact(self): frappe.db.sql("""update `tabContact` set customer_name=%s, modified=NOW() - where customer=%s""", (self.doc.customer_name, self.doc.name)) + where customer=%s""", (self.customer_name, self.name)) def update_credit_days_limit(self): frappe.db.sql("""update tabAccount set credit_days = %s, credit_limit = %s where master_type='Customer' and master_name = %s""", - (self.doc.credit_days or 0, self.doc.credit_limit or 0, self.doc.name)) + (self.credit_days or 0, self.credit_limit or 0, self.name)) def create_lead_address_contact(self): - if self.doc.lead_name: - if not frappe.db.get_value("Address", {"lead": self.doc.lead_name, "customer": self.doc.customer}): + if self.lead_name: + if not frappe.db.get_value("Address", {"lead": self.lead_name, "customer": self.customer}): frappe.db.sql("""update `tabAddress` set customer=%s, customer_name=%s where lead=%s""", - (self.doc.name, self.doc.customer_name, self.doc.lead_name)) + (self.name, self.customer_name, self.lead_name)) - lead = frappe.db.get_value("Lead", self.doc.lead_name, ["lead_name", "email_id", "phone", "mobile_no"], as_dict=True) + lead = frappe.db.get_value("Lead", self.lead_name, ["lead_name", "email_id", "phone", "mobile_no"], as_dict=True) c = frappe.get_doc('Contact') c.set("__islocal", 1) c.first_name = lead.lead_name c.email_id = lead.email_id c.phone = lead.phone c.mobile_no = lead.mobile_no - c.customer = self.doc.name - c.customer_name = self.doc.customer_name + c.customer = self.name + c.customer_name = self.customer_name c.is_primary_contact = 1 try: c.save() @@ -78,7 +78,7 @@ class Customer(TransactionBase): self.update_contact() # create account head - create_party_account(self.doc.name, "Customer", self.doc.company) + create_party_account(self.name, "Customer", self.company) # update credit days and limit in account self.update_credit_days_limit() @@ -86,14 +86,14 @@ class Customer(TransactionBase): self.create_lead_address_contact() def validate_name_with_customer_group(self): - if frappe.db.exists("Customer Group", self.doc.name): + if frappe.db.exists("Customer Group", self.name): frappe.msgprint("An Customer Group exists with same name (%s), \ please change the Customer name or rename the Customer Group" % - self.doc.name, raise_exception=1) + self.name, raise_exception=1) def delete_customer_address(self): addresses = frappe.db.sql("""select name, lead from `tabAddress` - where customer=%s""", (self.doc.name,)) + where customer=%s""", (self.name,)) for name, lead in addresses: if lead: @@ -104,13 +104,13 @@ class Customer(TransactionBase): def delete_customer_contact(self): for contact in frappe.db.sql_list("""select name from `tabContact` - where customer=%s""", self.doc.name): + where customer=%s""", self.name): frappe.delete_doc("Contact", contact) def delete_customer_account(self): """delete customer's ledger if exist and check balance before deletion""" acc = frappe.db.sql("select name from `tabAccount` where master_type = 'Customer' \ - and master_name = %s and docstatus < 2", self.doc.name) + and master_name = %s and docstatus < 2", self.name) if acc: frappe.delete_doc('Account', acc[0][0]) @@ -118,12 +118,12 @@ class Customer(TransactionBase): self.delete_customer_address() self.delete_customer_contact() self.delete_customer_account() - if self.doc.lead_name: - frappe.db.sql("update `tabLead` set status='Interested' where name=%s",self.doc.lead_name) + if self.lead_name: + frappe.db.sql("update `tabLead` set status='Interested' where name=%s",self.lead_name) def before_rename(self, olddn, newdn, merge=False): from erpnext.accounts.utils import rename_account_for - rename_account_for("Customer", olddn, newdn, merge, self.doc.company) + rename_account_for("Customer", olddn, newdn, merge, self.company) def after_rename(self, olddn, newdn, merge=False): set_field = '' diff --git a/erpnext/selling/doctype/installation_note/installation_note.py b/erpnext/selling/doctype/installation_note/installation_note.py index 404ad33ae9..3b1ea40ea7 100644 --- a/erpnext/selling/doctype/installation_note/installation_note.py +++ b/erpnext/selling/doctype/installation_note/installation_note.py @@ -38,7 +38,7 @@ class InstallationNote(TransactionBase): def validate_fiscal_year(self): from erpnext.accounts.utils import validate_fiscal_year - validate_fiscal_year(self.doc.inst_date, self.doc.fiscal_year, "Installation Date") + validate_fiscal_year(self.inst_date, self.fiscal_year, "Installation Date") def is_serial_no_added(self, item_code, serial_no): ar_required = frappe.db.get_value("Item", item_code, "has_serial_no") @@ -91,7 +91,7 @@ class InstallationNote(TransactionBase): for d in self.get('installed_item_details'): if d.prevdoc_docname: d_date = frappe.db.get_value("Delivery Note", d.prevdoc_docname, "posting_date") - if d_date > getdate(self.doc.inst_date): + if d_date > getdate(self.inst_date): msgprint("Installation Date can not be before Delivery Date " + cstr(d_date) + " for item "+d.item_code, raise_exception=1) diff --git a/erpnext/selling/doctype/lead/get_leads.py b/erpnext/selling/doctype/lead/get_leads.py index 77a94f7269..1fe490756f 100644 --- a/erpnext/selling/doctype/lead/get_leads.py +++ b/erpnext/selling/doctype/lead/get_leads.py @@ -24,7 +24,7 @@ def add_sales_communication(subject, content, sender, real_name, mail=None, lead.ignore_permissions = True lead.ignore_mandatory = True lead.insert() - lead_name = lead.doc.name + lead_name = lead.name parent_doctype = "Contact" if contact_name else "Lead" parent_name = contact_name or lead_name diff --git a/erpnext/selling/doctype/lead/lead.py b/erpnext/selling/doctype/lead/lead.py index 1472ff26f3..908ab48a71 100644 --- a/erpnext/selling/doctype/lead/lead.py +++ b/erpnext/selling/doctype/lead/lead.py @@ -13,25 +13,25 @@ from erpnext.controllers.selling_controller import SellingController class Lead(SellingController): self._prev = frappe._dict({ - "contact_date": frappe.db.get_value("Lead", self.doc.name, "contact_date") if \ - (not cint(self.doc.fields.get("__islocal"))) else None, - "contact_by": frappe.db.get_value("Lead", self.doc.name, "contact_by") if \ - (not cint(self.doc.fields.get("__islocal"))) else None, + "contact_date": frappe.db.get_value("Lead", self.name, "contact_date") if \ + (not cint(self.get("__islocal"))) else None, + "contact_by": frappe.db.get_value("Lead", self.name, "contact_by") if \ + (not cint(self.get("__islocal"))) else None, }) def onload(self): - customer = frappe.db.get_value("Customer", {"lead_name": self.doc.name}) + customer = frappe.db.get_value("Customer", {"lead_name": self.name}) if customer: - self.doc.fields["__is_customer"] = customer + self.set("__is_customer", customer) def validate(self): self.set_status() - if self.doc.source == 'Campaign' and not self.doc.campaign_name and session['user'] != 'Guest': + if self.source == 'Campaign' and not self.campaign_name and session['user'] != 'Guest': frappe.throw("Please specify campaign name") - if self.doc.email_id: - if not validate_email_add(self.doc.email_id): + if self.email_id: + if not validate_email_add(self.email_id): frappe.throw('Please enter valid email id.') def on_update(self): @@ -40,34 +40,34 @@ class Lead(SellingController): def add_calendar_event(self, opts=None, force=False): super(DocType, self).add_calendar_event({ - "owner": self.doc.lead_owner, - "subject": ('Contact ' + cstr(self.doc.lead_name)), - "description": ('Contact ' + cstr(self.doc.lead_name)) + \ - (self.doc.contact_by and ('. By : ' + cstr(self.doc.contact_by)) or '') + \ - (self.doc.remark and ('.To Discuss : ' + cstr(self.doc.remark)) or '') + "owner": self.lead_owner, + "subject": ('Contact ' + cstr(self.lead_name)), + "description": ('Contact ' + cstr(self.lead_name)) + \ + (self.contact_by and ('. By : ' + cstr(self.contact_by)) or '') + \ + (self.remark and ('.To Discuss : ' + cstr(self.remark)) or '') }, force) def check_email_id_is_unique(self): - if self.doc.email_id: + if self.email_id: # validate email is unique email_list = frappe.db.sql("""select name from tabLead where email_id=%s""", - self.doc.email_id) + self.email_id) if len(email_list) > 1: - items = [e[0] for e in email_list if e[0]!=self.doc.name] + items = [e[0] for e in email_list if e[0]!=self.name] frappe.msgprint(_("""Email Id must be unique, already exists for: """) + \ ", ".join(items), raise_exception=True) def on_trash(self): frappe.db.sql("""update `tabSupport Ticket` set lead='' where lead=%s""", - self.doc.name) + self.name) self.delete_events() def has_customer(self): - return frappe.db.get_value("Customer", {"lead_name": self.doc.name}) + return frappe.db.get_value("Customer", {"lead_name": self.name}) def has_opportunity(self): - return frappe.db.get_value("Opportunity", {"lead": self.doc.name, "docstatus": 1, + return frappe.db.get_value("Opportunity", {"lead": self.name, "docstatus": 1, "status": ["!=", "Lost"]}) @frappe.whitelist() @@ -78,12 +78,12 @@ def _make_customer(source_name, target_doclist=None, ignore_permissions=False): from frappe.model.mapper import get_mapped_doclist def set_missing_values(source, target): - if source.doc.company_name: + if source.company_name: target[0].customer_type = "Company" - target[0].customer_name = source.doc.company_name + target[0].customer_name = source.company_name else: target[0].customer_type = "Individual" - target[0].customer_name = source.doc.lead_name + target[0].customer_name = source.lead_name target[0].customer_group = frappe.db.get_default("customer_group") diff --git a/erpnext/selling/doctype/opportunity/opportunity.py b/erpnext/selling/doctype/opportunity/opportunity.py index bbe9a60bb9..4c6863ccd8 100644 --- a/erpnext/selling/doctype/opportunity/opportunity.py +++ b/erpnext/selling/doctype/opportunity/opportunity.py @@ -61,22 +61,22 @@ class Opportunity(TransactionBase): opts.description = "" - if self.doc.customer: - if self.doc.contact_person: - opts.description = 'Contact '+cstr(self.doc.contact_person) + if self.customer: + if self.contact_person: + opts.description = 'Contact '+cstr(self.contact_person) else: - opts.description = 'Contact customer '+cstr(self.doc.customer) - elif self.doc.lead: - if self.doc.contact_display: - opts.description = 'Contact '+cstr(self.doc.contact_display) + opts.description = 'Contact customer '+cstr(self.customer) + elif self.lead: + if self.contact_display: + opts.description = 'Contact '+cstr(self.contact_display) else: - opts.description = 'Contact lead '+cstr(self.doc.lead) + opts.description = 'Contact lead '+cstr(self.lead) opts.subject = opts.description - opts.description += '. By : ' + cstr(self.doc.contact_by) + opts.description += '. By : ' + cstr(self.contact_by) - if self.doc.to_discuss: - opts.description += ' To Discuss : ' + cstr(self.doc.to_discuss) + if self.to_discuss: + opts.description += ' To Discuss : ' + cstr(self.to_discuss) super(DocType, self).add_calendar_event(opts, force) @@ -86,17 +86,17 @@ class Opportunity(TransactionBase): raise Exception def validate_lead_cust(self): - if self.doc.enquiry_from == 'Lead' and not self.doc.lead: + if self.enquiry_from == 'Lead' and not self.lead: msgprint("Lead Id is mandatory if 'Opportunity From' is selected as Lead", raise_exception=1) - elif self.doc.enquiry_from == 'Customer' and not self.doc.customer: + elif self.enquiry_from == 'Customer' and not self.customer: msgprint("Customer is mandatory if 'Opportunity From' is selected as Customer", raise_exception=1) def validate(self): self._prev = frappe._dict({ - "contact_date": frappe.db.get_value("Opportunity", self.doc.name, "contact_date") if \ - (not cint(self.doc.fields.get("__islocal"))) else None, - "contact_by": frappe.db.get_value("Opportunity", self.doc.name, "contact_by") if \ - (not cint(self.doc.fields.get("__islocal"))) else None, + "contact_date": frappe.db.get_value("Opportunity", self.name, "contact_date") if \ + (not cint(self.get("__islocal"))) else None, + "contact_by": frappe.db.get_value("Opportunity", self.name, "contact_by") if \ + (not cint(self.get("__islocal"))) else None, }) self.set_status() @@ -105,11 +105,11 @@ class Opportunity(TransactionBase): self.validate_lead_cust() from erpnext.accounts.utils import validate_fiscal_year - validate_fiscal_year(self.doc.transaction_date, self.doc.fiscal_year, "Opportunity Date") + validate_fiscal_year(self.transaction_date, self.fiscal_year, "Opportunity Date") def on_submit(self): - if self.doc.lead: - frappe.bean("Lead", self.doc.lead).get_controller().set_status(update=True) + if self.lead: + frappe.bean("Lead", self.lead).get_controller().set_status(update=True) def on_cancel(self): if self.has_quotation(): @@ -127,7 +127,7 @@ class Opportunity(TransactionBase): self.delete_events() def has_quotation(self): - return frappe.db.get_value("Quotation Item", {"prevdoc_docname": self.doc.name, "docstatus": 1}) + return frappe.db.get_value("Quotation Item", {"prevdoc_docname": self.name, "docstatus": 1}) @frappe.whitelist() def make_quotation(source_name, target_doclist=None): diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py index 530ad240f5..8f816c858e 100644 --- a/erpnext/selling/doctype/quotation/quotation.py +++ b/erpnext/selling/doctype/quotation/quotation.py @@ -15,7 +15,7 @@ class Quotation(SellingController): self.fname = 'quotation_details' def has_sales_order(self): - return frappe.db.get_value("Sales Order Item", {"prevdoc_docname": self.doc.name, "docstatus": 1}) + return frappe.db.get_value("Sales Order Item", {"prevdoc_docname": self.name, "docstatus": 1}) def validate_for_items(self): chk_dupl_itm = [] @@ -29,7 +29,7 @@ class Quotation(SellingController): def validate_order_type(self): super(DocType, self).validate_order_type() - if self.doc.order_type in ['Maintenance', 'Service']: + if self.order_type in ['Maintenance', 'Service']: for d in self.get('quotation_details'): is_service_item = frappe.db.sql("select is_service_item from `tabItem` where name=%s", d.item_code) is_service_item = is_service_item and is_service_item[0][0] or 'No' @@ -74,7 +74,7 @@ class Quotation(SellingController): self.check_item_table() # Check for Approving Authority - get_obj('Authorization Control').validate_approving_authority(self.doc.doctype, self.doc.company, self.doc.grand_total, self) + get_obj('Authorization Control').validate_approving_authority(self.doctype, self.company, self.grand_total, self) #update enquiry status self.update_opportunity() @@ -105,8 +105,8 @@ def _make_sales_order(source_name, target_doclist=None, ignore_permissions=False def set_missing_values(source, target): if customer: - target[0].customer = customer.doc.name - target[0].customer_name = customer.doc.customer_name + target[0].customer = customer.name + target[0].customer_name = customer.customer_name si = frappe.bean(target) si.ignore_permissions = ignore_permissions @@ -150,7 +150,7 @@ def _make_customer(source_name, ignore_permissions=False): customer = frappe.bean(customer_doclist) customer.ignore_permissions = ignore_permissions if quotation[1] == "Shopping Cart": - customer.doc.customer_group = frappe.db.get_value("Shopping Cart Settings", None, + customer.customer_group = frappe.db.get_value("Shopping Cart Settings", None, "default_customer_group") try: @@ -159,7 +159,7 @@ def _make_customer(source_name, ignore_permissions=False): except NameError: if frappe.defaults.get_global_default('cust_master_name') == "Customer Name": customer.run_method("autoname") - customer.doc.name += "-" + lead_name + customer.name += "-" + lead_name customer.insert() return customer else: diff --git a/erpnext/selling/doctype/quotation/test_quotation.py b/erpnext/selling/doctype/quotation/test_quotation.py index 9bc75d6ca5..b3c6d619ef 100644 --- a/erpnext/selling/doctype/quotation/test_quotation.py +++ b/erpnext/selling/doctype/quotation/test_quotation.py @@ -14,16 +14,16 @@ class TestQuotation(unittest.TestCase): quotation = frappe.bean(copy=test_records[0]) quotation.insert() - self.assertRaises(frappe.ValidationError, make_sales_order, quotation.doc.name) + self.assertRaises(frappe.ValidationError, make_sales_order, quotation.name) quotation.submit() - sales_order = make_sales_order(quotation.doc.name) + sales_order = make_sales_order(quotation.name) self.assertEquals(sales_order[0]["doctype"], "Sales Order") self.assertEquals(len(sales_order), 2) self.assertEquals(sales_order[1]["doctype"], "Sales Order Item") - self.assertEquals(sales_order[1]["prevdoc_docname"], quotation.doc.name) + self.assertEquals(sales_order[1]["prevdoc_docname"], quotation.name) self.assertEquals(sales_order[0]["customer"], "_Test Customer") sales_order[0]["delivery_date"] = "2014-01-01" diff --git a/erpnext/selling/doctype/sales_bom/sales_bom.py b/erpnext/selling/doctype/sales_bom/sales_bom.py index 3e97ed9f92..207bdcbe6e 100644 --- a/erpnext/selling/doctype/sales_bom/sales_bom.py +++ b/erpnext/selling/doctype/sales_bom/sales_bom.py @@ -10,7 +10,7 @@ class SalesBom(Document): def autoname(self): - self.doc.name = self.doc.new_item_code + self.name = self.new_item_code def validate(self): self.validate_main_item() @@ -21,7 +21,7 @@ class SalesBom(Document): def validate_main_item(self): """main item must have Is Stock Item as No and Is Sales Item as Yes""" if not frappe.db.sql("""select name from tabItem where name=%s and - ifnull(is_stock_item,'')='No' and ifnull(is_sales_item,'')='Yes'""", self.doc.new_item_code): + ifnull(is_stock_item,'')='No' and ifnull(is_sales_item,'')='Yes'""", self.new_item_code): frappe.msgprint("""Parent Item %s is either a Stock Item or a not a Sales Item""", raise_exception=1) diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index 25eda9ab3a..98ccf111af 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -26,21 +26,21 @@ class SalesOrder(SellingController): def validate_mandatory(self): # validate transaction date v/s delivery date - if self.doc.delivery_date: - if getdate(self.doc.transaction_date) > getdate(self.doc.delivery_date): + if self.delivery_date: + if getdate(self.transaction_date) > getdate(self.delivery_date): msgprint("Expected Delivery Date cannot be before Sales Order Date") raise Exception def validate_po(self): # validate p.o date v/s delivery date - if self.doc.po_date and self.doc.delivery_date and getdate(self.doc.po_date) > getdate(self.doc.delivery_date): + if self.po_date and self.delivery_date and getdate(self.po_date) > getdate(self.delivery_date): msgprint("Expected Delivery Date cannot be before Purchase Order Date") raise Exception - if self.doc.po_no and self.doc.customer: + if self.po_no and self.customer: so = frappe.db.sql("select name from `tabSales Order` \ where ifnull(po_no, '') = %s and name != %s and docstatus < 2\ - and customer = %s", (self.doc.po_no, self.doc.name, self.doc.customer)) + and customer = %s", (self.po_no, self.name, self.customer)) if so and so[0][0]: msgprint("""Another Sales Order (%s) exists against same PO No and Customer. Please be sure, you are not making duplicate entry.""" % so[0][0]) @@ -68,7 +68,7 @@ class SalesOrder(SellingController): chk_dupl_itm.append(f) # used for production plan - d.transaction_date = self.doc.transaction_date + d.transaction_date = self.transaction_date tot_avail_qty = frappe.db.sql("select projected_qty from `tabBin` \ where item_code = %s and warehouse = %s", (d.item_code,d.warehouse)) @@ -77,28 +77,28 @@ class SalesOrder(SellingController): def validate_sales_mntc_quotation(self): for d in self.get('sales_order_details'): if d.prevdoc_docname: - res = frappe.db.sql("select name from `tabQuotation` where name=%s and order_type = %s", (d.prevdoc_docname, self.doc.order_type)) + res = frappe.db.sql("select name from `tabQuotation` where name=%s and order_type = %s", (d.prevdoc_docname, self.order_type)) if not res: msgprint("""Order Type (%s) should be same in Quotation: %s \ - and current Sales Order""" % (self.doc.order_type, d.prevdoc_docname)) + and current Sales Order""" % (self.order_type, d.prevdoc_docname)) def validate_order_type(self): super(DocType, self).validate_order_type() def validate_delivery_date(self): - if self.doc.order_type == 'Sales' and not self.doc.delivery_date: + if self.order_type == 'Sales' and not self.delivery_date: msgprint("Please enter 'Expected Delivery Date'") raise Exception self.validate_sales_mntc_quotation() def validate_proj_cust(self): - if self.doc.project_name and self.doc.customer_name: + if self.project_name and self.customer_name: res = frappe.db.sql("""select name from `tabProject` where name = %s and (customer = %s or ifnull(customer,'')='')""", - (self.doc.project_name, self.doc.customer)) + (self.project_name, self.customer)) if not res: - msgprint("Customer - %s does not belong to project - %s. \n\nIf you want to use project for multiple customers then please make customer details blank in project - %s."%(self.doc.customer,self.doc.project_name,self.doc.project_name)) + msgprint("Customer - %s does not belong to project - %s. \n\nIf you want to use project for multiple customers then please make customer details blank in project - %s."%(self.customer,self.project_name,self.project_name)) raise Exception def validate(self): @@ -119,15 +119,15 @@ class SalesOrder(SellingController): self.validate_with_previous_doc() - if not self.doc.status: - self.doc.status = "Draft" + if not self.status: + self.status = "Draft" from erpnext.utilities import validate_status - validate_status(self.doc.status, ["Draft", "Submitted", "Stopped", + validate_status(self.status, ["Draft", "Submitted", "Stopped", "Cancelled"]) - if not self.doc.billing_status: self.doc.billing_status = 'Not Billed' - if not self.doc.delivery_status: self.doc.delivery_status = 'Not Delivered' + if not self.billing_status: self.billing_status = 'Not Billed' + if not self.delivery_status: self.delivery_status = 'Not Delivered' def validate_warehouse(self): from erpnext.stock.utils import validate_warehouse_company @@ -136,7 +136,7 @@ class SalesOrder(SellingController): self.doclist.get({"doctype": self.tname}) if d.warehouse])) for w in warehouses: - validate_warehouse_company(w, self.doc.company) + validate_warehouse_company(w, self.company) def validate_with_previous_doc(self): super(DocType, self).validate_with_previous_doc(self.tname, { @@ -155,7 +155,7 @@ class SalesOrder(SellingController): def update_prevdoc_status(self, flag): for quotation in self.doclist.get_distinct_values("prevdoc_docname"): bean = frappe.bean("Quotation", quotation) - if bean.doc.docstatus==2: + if bean.docstatus==2: frappe.throw(quotation + ": " + frappe._("Quotation is cancelled.")) bean.get_controller().set_status(update=True) @@ -163,17 +163,17 @@ class SalesOrder(SellingController): def on_submit(self): self.update_stock_ledger(update_stock = 1) - self.check_credit(self.doc.grand_total) + self.check_credit(self.grand_total) - get_obj('Authorization Control').validate_approving_authority(self.doc.doctype, self.doc.grand_total, self) + get_obj('Authorization Control').validate_approving_authority(self.doctype, self.grand_total, self) self.update_prevdoc_status('submit') frappe.db.set(self.doc, 'status', 'Submitted') def on_cancel(self): # Cannot cancel stopped SO - if self.doc.status == 'Stopped': - msgprint("Sales Order : '%s' cannot be cancelled as it is Stopped. Unstop it for any further transactions" %(self.doc.name)) + if self.status == 'Stopped': + msgprint("Sales Order : '%s' cannot be cancelled as it is Stopped. Unstop it for any further transactions" %(self.name)) raise Exception self.check_nextdoc_docstatus() self.update_stock_ledger(update_stock = -1) @@ -184,55 +184,55 @@ class SalesOrder(SellingController): def check_nextdoc_docstatus(self): # Checks Delivery Note - submit_dn = frappe.db.sql("select t1.name from `tabDelivery Note` t1,`tabDelivery Note Item` t2 where t1.name = t2.parent and t2.against_sales_order = %s and t1.docstatus = 1", self.doc.name) + submit_dn = frappe.db.sql("select t1.name from `tabDelivery Note` t1,`tabDelivery Note Item` t2 where t1.name = t2.parent and t2.against_sales_order = %s and t1.docstatus = 1", self.name) if submit_dn: - msgprint("Delivery Note : " + cstr(submit_dn[0][0]) + " has been submitted against " + cstr(self.doc.doctype) + ". Please cancel Delivery Note : " + cstr(submit_dn[0][0]) + " first and then cancel "+ cstr(self.doc.doctype), raise_exception = 1) + msgprint("Delivery Note : " + cstr(submit_dn[0][0]) + " has been submitted against " + cstr(self.doctype) + ". Please cancel Delivery Note : " + cstr(submit_dn[0][0]) + " first and then cancel "+ cstr(self.doctype), raise_exception = 1) # Checks Sales Invoice submit_rv = frappe.db.sql("""select t1.name from `tabSales Invoice` t1,`tabSales Invoice Item` t2 where t1.name = t2.parent and t2.sales_order = %s and t1.docstatus = 1""", - self.doc.name) + self.name) if submit_rv: - msgprint("Sales Invoice : " + cstr(submit_rv[0][0]) + " has already been submitted against " +cstr(self.doc.doctype)+ ". Please cancel Sales Invoice : "+ cstr(submit_rv[0][0]) + " first and then cancel "+ cstr(self.doc.doctype), raise_exception = 1) + msgprint("Sales Invoice : " + cstr(submit_rv[0][0]) + " has already been submitted against " +cstr(self.doctype)+ ". Please cancel Sales Invoice : "+ cstr(submit_rv[0][0]) + " first and then cancel "+ cstr(self.doctype), raise_exception = 1) #check maintenance schedule - submit_ms = frappe.db.sql("select t1.name from `tabMaintenance Schedule` t1, `tabMaintenance Schedule Item` t2 where t2.parent=t1.name and t2.prevdoc_docname = %s and t1.docstatus = 1",self.doc.name) + submit_ms = frappe.db.sql("select t1.name from `tabMaintenance Schedule` t1, `tabMaintenance Schedule Item` t2 where t2.parent=t1.name and t2.prevdoc_docname = %s and t1.docstatus = 1",self.name) if submit_ms: - msgprint("Maintenance Schedule : " + cstr(submit_ms[0][0]) + " has already been submitted against " +cstr(self.doc.doctype)+ ". Please cancel Maintenance Schedule : "+ cstr(submit_ms[0][0]) + " first and then cancel "+ cstr(self.doc.doctype), raise_exception = 1) + msgprint("Maintenance Schedule : " + cstr(submit_ms[0][0]) + " has already been submitted against " +cstr(self.doctype)+ ". Please cancel Maintenance Schedule : "+ cstr(submit_ms[0][0]) + " first and then cancel "+ cstr(self.doctype), raise_exception = 1) # check maintenance visit - submit_mv = frappe.db.sql("select t1.name from `tabMaintenance Visit` t1, `tabMaintenance Visit Purpose` t2 where t2.parent=t1.name and t2.prevdoc_docname = %s and t1.docstatus = 1",self.doc.name) + submit_mv = frappe.db.sql("select t1.name from `tabMaintenance Visit` t1, `tabMaintenance Visit Purpose` t2 where t2.parent=t1.name and t2.prevdoc_docname = %s and t1.docstatus = 1",self.name) if submit_mv: - msgprint("Maintenance Visit : " + cstr(submit_mv[0][0]) + " has already been submitted against " +cstr(self.doc.doctype)+ ". Please cancel Maintenance Visit : " + cstr(submit_mv[0][0]) + " first and then cancel "+ cstr(self.doc.doctype), raise_exception = 1) + msgprint("Maintenance Visit : " + cstr(submit_mv[0][0]) + " has already been submitted against " +cstr(self.doctype)+ ". Please cancel Maintenance Visit : " + cstr(submit_mv[0][0]) + " first and then cancel "+ cstr(self.doctype), raise_exception = 1) # check production order - pro_order = frappe.db.sql("""select name from `tabProduction Order` where sales_order = %s and docstatus = 1""", self.doc.name) + pro_order = frappe.db.sql("""select name from `tabProduction Order` where sales_order = %s and docstatus = 1""", self.name) if pro_order: msgprint("""Production Order: %s exists against this sales order. Please cancel production order first and then cancel this sales order""" % pro_order[0][0], raise_exception=1) def check_modified_date(self): - mod_db = frappe.db.get_value("Sales Order", self.doc.name, "modified") + mod_db = frappe.db.get_value("Sales Order", self.name, "modified") date_diff = frappe.db.sql("select TIMEDIFF('%s', '%s')" % - ( mod_db, cstr(self.doc.modified))) + ( mod_db, cstr(self.modified))) if date_diff and date_diff[0][0]: msgprint("%s: %s has been modified after you have opened. Please Refresh" - % (self.doc.doctype, self.doc.name), raise_exception=1) + % (self.doctype, self.name), raise_exception=1) def stop_sales_order(self): self.check_modified_date() self.update_stock_ledger(-1) frappe.db.set(self.doc, 'status', 'Stopped') msgprint("""%s: %s has been Stopped. To make transactions against this Sales Order - you need to Unstop it.""" % (self.doc.doctype, self.doc.name)) + you need to Unstop it.""" % (self.doctype, self.name)) def unstop_sales_order(self): self.check_modified_date() self.update_stock_ledger(1) frappe.db.set(self.doc, 'status', 'Submitted') - msgprint("%s: %s has been Unstopped" % (self.doc.doctype, self.doc.name)) + msgprint("%s: %s has been Unstopped" % (self.doctype, self.name)) def update_stock_ledger(self, update_stock): @@ -243,10 +243,10 @@ class SalesOrder(SellingController): "item_code": d['item_code'], "warehouse": d['reserved_warehouse'], "reserved_qty": flt(update_stock) * flt(d['reserved_qty']), - "posting_date": self.doc.transaction_date, - "voucher_type": self.doc.doctype, - "voucher_no": self.doc.name, - "is_amended": self.doc.amended_from and 'Yes' or 'No' + "posting_date": self.transaction_date, + "voucher_type": self.doctype, + "voucher_no": self.name, + "is_amended": self.amended_from and 'Yes' or 'No' } update_bin(args) @@ -254,7 +254,7 @@ class SalesOrder(SellingController): pass def get_portal_page(self): - return "order" if self.doc.docstatus==1 else None + return "order" if self.docstatus==1 else None def set_missing_values(source, target): bean = frappe.bean(target) @@ -327,7 +327,7 @@ def make_delivery_note(source_name, target_doclist=None): def make_sales_invoice(source_name, target_doclist=None): def set_missing_values(source, target): bean = frappe.bean(target) - bean.doc.is_pos = 0 + bean.is_pos = 0 bean.run_method("onload_post_render") def update_item(obj, target, source_parent): diff --git a/erpnext/selling/doctype/sales_order/test_sales_order.py b/erpnext/selling/doctype/sales_order/test_sales_order.py index 869350cd5c..6171a2b083 100644 --- a/erpnext/selling/doctype/sales_order/test_sales_order.py +++ b/erpnext/selling/doctype/sales_order/test_sales_order.py @@ -15,11 +15,11 @@ class TestSalesOrder(unittest.TestCase): so = frappe.bean(copy=test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_material_request, - so.doc.name) + so.name) - sales_order = frappe.bean("Sales Order", so.doc.name) + sales_order = frappe.bean("Sales Order", so.name) sales_order.submit() - mr = make_material_request(so.doc.name) + mr = make_material_request(so.name) self.assertEquals(mr[0]["material_request_type"], "Purchase") self.assertEquals(len(mr), len(sales_order.doclist)) @@ -30,11 +30,11 @@ class TestSalesOrder(unittest.TestCase): so = frappe.bean(copy=test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_delivery_note, - so.doc.name) + so.name) - sales_order = frappe.bean("Sales Order", so.doc.name) + sales_order = frappe.bean("Sales Order", so.name) sales_order.submit() - dn = make_delivery_note(so.doc.name) + dn = make_delivery_note(so.name) self.assertEquals(dn[0]["doctype"], "Delivery Note") self.assertEquals(len(dn), len(sales_order.doclist)) @@ -45,22 +45,22 @@ class TestSalesOrder(unittest.TestCase): so = frappe.bean(copy=test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_sales_invoice, - so.doc.name) + so.name) - sales_order = frappe.bean("Sales Order", so.doc.name) + sales_order = frappe.bean("Sales Order", so.name) sales_order.submit() - si = make_sales_invoice(so.doc.name) + si = make_sales_invoice(so.name) self.assertEquals(si[0]["doctype"], "Sales Invoice") self.assertEquals(len(si), len(sales_order.doclist)) self.assertEquals(len([d for d in si if d["doctype"]=="Sales Invoice Item"]), 1) si = frappe.bean(si) - si.doc.posting_date = "2013-10-10" + si.posting_date = "2013-10-10" si.insert() si.submit() - si1 = make_sales_invoice(so.doc.name) + si1 = make_sales_invoice(so.name) self.assertEquals(len([d for d in si1 if d["doctype"]=="Sales Invoice Item"]), 0) @@ -82,7 +82,7 @@ class TestSalesOrder(unittest.TestCase): dn = frappe.bean(frappe.copy_doc(dn_test_records[0])) dn.doclist[1].item_code = so.doclist[1].item_code - dn.doclist[1].against_sales_order = so.doc.name + dn.doclist[1].against_sales_order = so.name dn.doclist[1].prevdoc_detail_docname = so.doclist[1].name if delivered_qty: dn.doclist[1].qty = delivered_qty @@ -291,9 +291,9 @@ class TestSalesOrder(unittest.TestCase): from frappe.model.bean import BeanPermissionError so = frappe.bean(copy = test_records[0]) - so.doc.company = "_Test Company 1" - so.doc.conversion_rate = 0.02 - so.doc.plc_conversion_rate = 0.02 + so.company = "_Test Company 1" + so.conversion_rate = 0.02 + so.plc_conversion_rate = 0.02 so.doclist[1].warehouse = "_Test Warehouse 2 - _TC1" self.assertRaises(BeanPermissionError, so.insert) diff --git a/erpnext/selling/doctype/selling_settings/selling_settings.py b/erpnext/selling/doctype/selling_settings/selling_settings.py index 6823fa1b86..69273e0877 100644 --- a/erpnext/selling/doctype/selling_settings/selling_settings.py +++ b/erpnext/selling/doctype/selling_settings/selling_settings.py @@ -13,8 +13,8 @@ class SellingSettings(Document): def validate(self): for key in ["cust_master_name", "customer_group", "territory", "maintain_same_sales_rate", "editable_price_list_rate", "selling_price_list"]: - frappe.db.set_default(key, self.doc.fields.get(key, "")) + frappe.db.set_default(key, self.get(key, "")) from erpnext.setup.doctype.naming_series.naming_series import set_by_naming_series set_by_naming_series("Customer", "customer_name", - self.doc.get("cust_master_name")=="Naming Series", hide_name_field=False) + self.get("cust_master_name")=="Naming Series", hide_name_field=False) diff --git a/erpnext/selling/doctype/sms_center/sms_center.py b/erpnext/selling/doctype/sms_center/sms_center.py index 9aeb5eefef..51f9d77061 100644 --- a/erpnext/selling/doctype/sms_center/sms_center.py +++ b/erpnext/selling/doctype/sms_center/sms_center.py @@ -14,50 +14,50 @@ class SmsCenter(Document): def create_receiver_list(self): rec, where_clause = '', '' - if self.doc.send_to == 'All Customer Contact': - where_clause = self.doc.customer and " and customer = '%s'" % \ - self.doc.customer.replace("'", "\'") or " and ifnull(customer, '') != ''" - if self.doc.send_to == 'All Supplier Contact': - where_clause = self.doc.supplier and \ + if self.send_to == 'All Customer Contact': + where_clause = self.customer and " and customer = '%s'" % \ + self.customer.replace("'", "\'") or " and ifnull(customer, '') != ''" + if self.send_to == 'All Supplier Contact': + where_clause = self.supplier and \ " and ifnull(is_supplier, 0) = 1 and supplier = '%s'" % \ - self.doc.supplier.replace("'", "\'") or " and ifnull(supplier, '') != ''" - if self.doc.send_to == 'All Sales Partner Contact': - where_clause = self.doc.sales_partner and \ + self.supplier.replace("'", "\'") or " and ifnull(supplier, '') != ''" + if self.send_to == 'All Sales Partner Contact': + where_clause = self.sales_partner and \ " and ifnull(is_sales_partner, 0) = 1 and sales_partner = '%s'" % \ - self.doc.sales_partner.replace("'", "\'") or " and ifnull(sales_partner, '') != ''" + self.sales_partner.replace("'", "\'") or " and ifnull(sales_partner, '') != ''" - if self.doc.send_to in ['All Contact', 'All Customer Contact', 'All Supplier Contact', 'All Sales Partner Contact']: + if self.send_to in ['All Contact', 'All Customer Contact', 'All Supplier Contact', 'All Sales Partner Contact']: rec = frappe.db.sql("""select CONCAT(ifnull(first_name,''), '', ifnull(last_name,'')), mobile_no from `tabContact` where ifnull(mobile_no,'')!='' and docstatus != 2 %s""", where_clause) - elif self.doc.send_to == 'All Lead (Open)': + elif self.send_to == 'All Lead (Open)': rec = frappe.db.sql("""select lead_name, mobile_no from `tabLead` where ifnull(mobile_no,'')!='' and docstatus != 2 and status='Open'""") - elif self.doc.send_to == 'All Employee (Active)': - where_clause = self.doc.department and " and department = '%s'" % \ - self.doc.department.replace("'", "\'") or "" - where_clause += self.doc.branch and " and branch = '%s'" % \ - self.doc.branch.replace("'", "\'") or "" + elif self.send_to == 'All Employee (Active)': + where_clause = self.department and " and department = '%s'" % \ + self.department.replace("'", "\'") or "" + where_clause += self.branch and " and branch = '%s'" % \ + self.branch.replace("'", "\'") or "" rec = frappe.db.sql("""select employee_name, cell_number from `tabEmployee` where status = 'Active' and docstatus < 2 and ifnull(cell_number,'')!='' %s""", where_clause) - elif self.doc.send_to == 'All Sales Person': + elif self.send_to == 'All Sales Person': rec = frappe.db.sql("""select sales_person_name, mobile_no from `tabSales Person` where docstatus!=2 and ifnull(mobile_no,'')!=''""") rec_list = '' for d in rec: rec_list += d[0] + ' - ' + d[1] + '\n' - self.doc.receiver_list = rec_list + self.receiver_list = rec_list def get_receiver_nos(self): receiver_nos = [] - if self.doc.receiver_list: - for d in self.doc.receiver_list.split('\n'): + if self.receiver_list: + for d in self.receiver_list.split('\n'): receiver_no = d if '-' in d: receiver_no = receiver_no.split('-')[1] @@ -69,9 +69,9 @@ class SmsCenter(Document): return receiver_nos def send_sms(self): - if not self.doc.message: + if not self.message: msgprint(_("Please enter message before sending")) else: receiver_list = self.get_receiver_nos() if receiver_list: - msgprint(get_obj('SMS Control', 'SMS Control').send_sms(receiver_list, cstr(self.doc.message))) \ No newline at end of file + msgprint(get_obj('SMS Control', 'SMS Control').send_sms(receiver_list, cstr(self.message))) \ No newline at end of file diff --git a/erpnext/setup/doctype/authorization_control/authorization_control.py b/erpnext/setup/doctype/authorization_control/authorization_control.py index 9b8980cd3c..6e2485996a 100644 --- a/erpnext/setup/doctype/authorization_control/authorization_control.py +++ b/erpnext/setup/doctype/authorization_control/authorization_control.py @@ -36,7 +36,7 @@ class AuthorizationControl(TransactionBase): if not has_common(appr_roles, frappe.user.get_roles()) and not has_common(appr_users, [session['user']]): msg, add_msg = '','' if max_amount: - dcc = get_company_currency(self.doc.company) + dcc = get_company_currency(self.company) if based_on == 'Grand Total': msg = "since Grand Total exceeds %s. %s" % (dcc, flt(max_amount)) elif based_on == 'Itemwise Discount': msg = "since Discount exceeds %s for Item Code : %s" % (cstr(max_amount)+'%', item) elif based_on == 'Average Discount' or based_on == 'Customerwise Discount': msg = "since Discount exceeds %s" % (cstr(max_amount)+'%') @@ -81,8 +81,8 @@ class AuthorizationControl(TransactionBase): if based_on == 'Grand Total': auth_value = total elif based_on == 'Customerwise Discount': if doc_obj: - if doc_obj.doc.doctype == 'Sales Invoice': customer = doc_obj.doc.customer - else: customer = doc_obj.doc.customer_name + if doc_obj.doctype == 'Sales Invoice': customer = doc_obj.customer + else: customer = doc_obj.customer_name add_cond = " and master_name = '"+make_esc("'")(cstr(customer))+"'" if based_on == 'Itemwise Discount': if doc_obj: @@ -170,11 +170,11 @@ class AuthorizationControl(TransactionBase): if doc_obj: if doctype_name == 'Expense Claim': - rule = self.get_value_based_rule(doctype_name,doc_obj.doc.employee,doc_obj.doc.total_claimed_amount, doc_obj.doc.company) + rule = self.get_value_based_rule(doctype_name,doc_obj.employee,doc_obj.total_claimed_amount, doc_obj.company) elif doctype_name == 'Appraisal': - rule = frappe.db.sql("select name, to_emp, to_designation, approving_role, approving_user from `tabAuthorization Rule` where transaction=%s and (to_emp=%s or to_designation IN (select designation from `tabEmployee` where name=%s)) and company = %s and docstatus!=2",(doctype_name,doc_obj.doc.employee, doc_obj.doc.employee, doc_obj.doc.company),as_dict=1) + rule = frappe.db.sql("select name, to_emp, to_designation, approving_role, approving_user from `tabAuthorization Rule` where transaction=%s and (to_emp=%s or to_designation IN (select designation from `tabEmployee` where name=%s)) and company = %s and docstatus!=2",(doctype_name,doc_obj.employee, doc_obj.employee, doc_obj.company),as_dict=1) if not rule: - rule = frappe.db.sql("select name, to_emp, to_designation, approving_role, approving_user from `tabAuthorization Rule` where transaction=%s and (to_emp=%s or to_designation IN (select designation from `tabEmployee` where name=%s)) and ifnull(company,'') = '' and docstatus!=2",(doctype_name,doc_obj.doc.employee, doc_obj.doc.employee),as_dict=1) + rule = frappe.db.sql("select name, to_emp, to_designation, approving_role, approving_user from `tabAuthorization Rule` where transaction=%s and (to_emp=%s or to_designation IN (select designation from `tabEmployee` where name=%s)) and ifnull(company,'') = '' and docstatus!=2",(doctype_name,doc_obj.employee, doc_obj.employee),as_dict=1) if rule: for m in rule: diff --git a/erpnext/setup/doctype/authorization_rule/authorization_rule.py b/erpnext/setup/doctype/authorization_rule/authorization_rule.py index 5255e4cd17..1c6daf26b2 100644 --- a/erpnext/setup/doctype/authorization_rule/authorization_rule.py +++ b/erpnext/setup/doctype/authorization_rule/authorization_rule.py @@ -17,10 +17,10 @@ class AuthorizationRule(Document): where transaction = %s and based_on = %s and system_user = %s and system_role = %s and approving_user = %s and approving_role = %s and to_emp =%s and to_designation=%s and name != %s""", - (self.doc.transaction, self.doc.based_on, cstr(self.doc.system_user), - cstr(self.doc.system_role), cstr(self.doc.approving_user), - cstr(self.doc.approving_role), cstr(self.doc.to_emp), - cstr(self.doc.to_designation), self.doc.name)) + (self.transaction, self.based_on, cstr(self.system_user), + cstr(self.system_role), cstr(self.approving_user), + cstr(self.approving_role), cstr(self.to_emp), + cstr(self.to_designation), self.name)) auth_exists = exists and exists[0][0] or '' if auth_exists: if cint(exists[0][1]) == 2: @@ -32,49 +32,49 @@ class AuthorizationRule(Document): def validate_master_name(self): - if self.doc.based_on == 'Customerwise Discount' and \ + if self.based_on == 'Customerwise Discount' and \ not frappe.db.sql("""select name from tabCustomer - where name = %s and docstatus != 2""", (self.doc.master_name)): + where name = %s and docstatus != 2""", (self.master_name)): msgprint("Please select valid Customer Name for Customerwise Discount", raise_exception=1) - elif self.doc.based_on == 'Itemwise Discount' and \ + elif self.based_on == 'Itemwise Discount' and \ not frappe.db.sql("select name from tabItem where name = %s and docstatus != 2", - (self.doc.master_name)): + (self.master_name)): msgprint("Please select valid Item Name for Itemwise Discount", raise_exception=1) - elif (self.doc.based_on == 'Grand Total' or \ - self.doc.based_on == 'Average Discount') and self.doc.master_name: + elif (self.based_on == 'Grand Total' or \ + self.based_on == 'Average Discount') and self.master_name: msgprint("Please remove Customer/Item Name for %s." % - self.doc.based_on, raise_exception=1) + self.based_on, raise_exception=1) def validate_rule(self): - if self.doc.transaction != 'Appraisal': - if not self.doc.approving_role and not self.doc.approving_user: + if self.transaction != 'Appraisal': + if not self.approving_role and not self.approving_user: msgprint("Please enter Approving Role or Approving User", raise_exception=1) - elif self.doc.system_user and self.doc.system_user == self.doc.approving_user: + elif self.system_user and self.system_user == self.approving_user: msgprint("Approving User cannot be same as user the rule is Applicable To (User)", raise_exception=1) - elif self.doc.system_role and self.doc.system_role == self.doc.approving_role: + elif self.system_role and self.system_role == self.approving_role: msgprint("Approving Role cannot be same as user the rule is \ Applicable To (Role).", raise_exception=1) - elif self.doc.system_user and self.doc.approving_role and \ - has_common([self.doc.approving_role], [x[0] for x in \ + elif self.system_user and self.approving_role and \ + has_common([self.approving_role], [x[0] for x in \ frappe.db.sql("select role from `tabUserRole` where parent = %s", \ - (self.doc.system_user))]): + (self.system_user))]): msgprint("System User : %s is assigned role : %s. So rule does not make sense" % - (self.doc.system_user,self.doc.approving_role), raise_exception=1) - elif self.doc.transaction in ['Purchase Order', 'Purchase Receipt', \ - 'Purchase Invoice', 'Stock Entry'] and self.doc.based_on \ + (self.system_user,self.approving_role), raise_exception=1) + elif self.transaction in ['Purchase Order', 'Purchase Receipt', \ + 'Purchase Invoice', 'Stock Entry'] and self.based_on \ in ['Average Discount', 'Customerwise Discount', 'Itemwise Discount']: msgprint("You cannot set authorization on basis of Discount for %s" % - self.doc.transaction, raise_exception=1) - elif self.doc.based_on == 'Average Discount' and flt(self.doc.value) > 100.00: + self.transaction, raise_exception=1) + elif self.based_on == 'Average Discount' and flt(self.value) > 100.00: msgprint("Discount cannot given for more than 100%", raise_exception=1) - elif self.doc.based_on == 'Customerwise Discount' and not self.doc.master_name: + elif self.based_on == 'Customerwise Discount' and not self.master_name: msgprint("Please enter Customer Name for 'Customerwise Discount'", raise_exception=1) else: - if self.doc.transaction == 'Appraisal' and self.doc.based_on != 'Not Applicable': + if self.transaction == 'Appraisal' and self.based_on != 'Not Applicable': msgprint("Based on should be 'Not Applicable' while setting authorization rule\ for 'Appraisal'", raise_exception=1) @@ -84,4 +84,4 @@ class AuthorizationRule(Document): self.check_duplicate_entry() self.validate_rule() self.validate_master_name() - if not self.doc.value: self.doc.value = 0.0 \ No newline at end of file + if not self.value: self.value = 0.0 \ No newline at end of file diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py index a7e884eb58..b6b23054aa 100644 --- a/erpnext/setup/doctype/company/company.py +++ b/erpnext/setup/doctype/company/company.py @@ -15,77 +15,77 @@ class Company(Document): def onload(self): - self.doc.fields["__transactions_exist"] = self.check_if_transactions_exist() + self.set("__transactions_exist", self.check_if_transactions_exist()) def check_if_transactions_exist(self): exists = False for doctype in ["Sales Invoice", "Delivery Note", "Sales Order", "Quotation", "Purchase Invoice", "Purchase Receipt", "Purchase Order", "Supplier Quotation"]: if frappe.db.sql("""select name from `tab%s` where company=%s and docstatus=1 - limit 1""" % (doctype, "%s"), self.doc.name): + limit 1""" % (doctype, "%s"), self.name): exists = True break return exists def validate(self): - if self.doc.fields.get('__islocal') and len(self.doc.abbr) > 5: + if self.get('__islocal') and len(self.abbr) > 5: frappe.msgprint("Abbreviation cannot have more than 5 characters", raise_exception=1) - self.previous_default_currency = frappe.db.get_value("Company", self.doc.name, "default_currency") - if self.doc.default_currency and self.previous_default_currency and \ - self.doc.default_currency != self.previous_default_currency and \ + self.previous_default_currency = frappe.db.get_value("Company", self.name, "default_currency") + if self.default_currency and self.previous_default_currency and \ + self.default_currency != self.previous_default_currency and \ self.check_if_transactions_exist(): msgprint(_("Sorry! You cannot change company's default currency, because there are existing transactions against it. You will need to cancel those transactions if you want to change the default currency."), raise_exception=True) def on_update(self): if not frappe.db.sql("""select name from tabAccount - where company=%s and docstatus<2 limit 1""", self.doc.name): + where company=%s and docstatus<2 limit 1""", self.name): self.create_default_accounts() self.create_default_warehouses() self.create_default_web_page() if not frappe.db.get_value("Cost Center", {"group_or_ledger": "Ledger", - "company": self.doc.name}): + "company": self.name}): self.create_default_cost_center() self.set_default_accounts() - if self.doc.default_currency: - frappe.db.set_value("Currency", self.doc.default_currency, "enabled", 1) + if self.default_currency: + frappe.db.set_value("Currency", self.default_currency, "enabled", 1) def create_default_warehouses(self): for whname in ("Stores", "Work In Progress", "Finished Goods"): - if not frappe.db.exists("Warehouse", whname + " - " + self.doc.abbr): + if not frappe.db.exists("Warehouse", whname + " - " + self.abbr): stock_group = frappe.db.get_value("Account", {"account_type": "Stock", "group_or_ledger": "Group"}) if stock_group: frappe.bean({ "doctype":"Warehouse", "warehouse_name": whname, - "company": self.doc.name, + "company": self.name, "create_account_under": stock_group }).insert() def create_default_web_page(self): if not frappe.db.get_value("Website Settings", None, "home_page") and \ - not frappe.db.sql("select name from tabCompany where name!=%s", self.doc.name): + not frappe.db.sql("select name from tabCompany where name!=%s", self.name): import os with open(os.path.join(os.path.dirname(__file__), "sample_home_page.html"), "r") as webfile: webpage = frappe.bean({ "doctype": "Web Page", - "title": self.doc.name + " Home", + "title": self.name + " Home", "published": 1, - "description": "Standard Home Page for " + self.doc.name, - "main_section": webfile.read() % self.doc.fields + "description": "Standard Home Page for " + self.name, + "main_section": webfile.read() % self.fields }).insert() # update in home page in settings website_settings = frappe.bean("Website Settings", "Website Settings") - website_settings.doc.home_page = webpage.doc.name - website_settings.doc.brand_html = self.doc.name - website_settings.doc.copyright = self.doc.name + website_settings.home_page = webpage.name + website_settings.brand_html = self.name + website_settings.copyright = self.name website_settings.append("top_bar_items", { "doctype": "Top Bar Item", "label":"Contact", @@ -98,21 +98,21 @@ class Company(Document): }) website_settings.save() style_settings = frappe.bean("Style Settings", "Style Settings") - style_settings.doc.top_bar_background = "F2F2F2" - style_settings.doc.font_size = "15px" + style_settings.top_bar_background = "F2F2F2" + style_settings.font_size = "15px" style_settings.save() def create_default_accounts(self): - if self.doc.chart_of_accounts: + if self.chart_of_accounts: self.import_chart_of_account() else: self.create_standard_accounts() - frappe.db.set(self.doc, "receivables_group", "Accounts Receivable - " + self.doc.abbr) - frappe.db.set(self.doc, "payables_group", "Accounts Payable - " + self.doc.abbr) + frappe.db.set(self.doc, "receivables_group", "Accounts Receivable - " + self.abbr) + frappe.db.set(self.doc, "payables_group", "Accounts Payable - " + self.abbr) def import_chart_of_account(self): - chart = frappe.bean("Chart of Accounts", self.doc.chart_of_accounts) - chart.make_controller().create_accounts(self.doc.name) + chart = frappe.bean("Chart of Accounts", self.chart_of_accounts) + chart.make_controller().create_accounts(self.name) def add_acc(self,lst): account = frappe.bean({ @@ -122,16 +122,16 @@ class Company(Document): }) for d in self.fld_dict.keys(): - account.doc.fields[d] = (d == 'parent_account' and lst[self.fld_dict[d]]) and lst[self.fld_dict[d]] +' - '+ self.doc.abbr or lst[self.fld_dict[d]] + account.set(d, (d == 'parent_account' and lst[self.fld_dict[d]]) and lst[self.fld_dict[d]] +' - '+ self.abbr or lst[self.fld_dict[d]]) account.insert() def set_default_accounts(self): def _set_default_accounts(accounts): for field, account_type in accounts.items(): account = frappe.db.get_value("Account", {"account_type": account_type, - "group_or_ledger": "Ledger", "company": self.doc.name}) + "group_or_ledger": "Ledger", "company": self.name}) - if account and not self.doc.fields.get(field): + if account and not self.get(field): frappe.db.set(self.doc, field, account) _set_default_accounts({ @@ -149,16 +149,16 @@ class Company(Document): def create_default_cost_center(self): cc_list = [ { - 'cost_center_name': self.doc.name, - 'company':self.doc.name, + 'cost_center_name': self.name, + 'company':self.name, 'group_or_ledger':'Group', 'parent_cost_center':'' }, { 'cost_center_name':'Main', - 'company':self.doc.name, + 'company':self.name, 'group_or_ledger':'Ledger', - 'parent_cost_center':self.doc.name + ' - ' + self.doc.abbr + 'parent_cost_center':self.name + ' - ' + self.abbr }, ] for cc in cc_list: @@ -166,34 +166,34 @@ class Company(Document): cc_bean = frappe.bean(cc) cc_bean.ignore_permissions = True - if cc.get("cost_center_name") == self.doc.name: + if cc.get("cost_center_name") == self.name: cc_bean.ignore_mandatory = True cc_bean.insert() - frappe.db.set(self.doc, "cost_center", "Main - " + self.doc.abbr) + frappe.db.set(self.doc, "cost_center", "Main - " + self.abbr) def on_trash(self): """ Trash accounts and cost centers for this company if no gl entry exists """ - rec = frappe.db.sql("SELECT name from `tabGL Entry` where company = %s", self.doc.name) + rec = frappe.db.sql("SELECT name from `tabGL Entry` where company = %s", self.name) if not rec: #delete tabAccount - frappe.db.sql("delete from `tabAccount` where company = %s order by lft desc, rgt desc", self.doc.name) + frappe.db.sql("delete from `tabAccount` where company = %s order by lft desc, rgt desc", self.name) #delete cost center child table - budget detail - frappe.db.sql("delete bd.* from `tabBudget Detail` bd, `tabCost Center` cc where bd.parent = cc.name and cc.company = %s", self.doc.name) + frappe.db.sql("delete bd.* from `tabBudget Detail` bd, `tabCost Center` cc where bd.parent = cc.name and cc.company = %s", self.name) #delete cost center - frappe.db.sql("delete from `tabCost Center` WHERE company = %s order by lft desc, rgt desc", self.doc.name) + frappe.db.sql("delete from `tabCost Center` WHERE company = %s order by lft desc, rgt desc", self.name) - if not frappe.db.get_value("Stock Ledger Entry", {"company": self.doc.name}): - frappe.db.sql("""delete from `tabWarehouse` where company=%s""", self.doc.name) + if not frappe.db.get_value("Stock Ledger Entry", {"company": self.name}): + frappe.db.sql("""delete from `tabWarehouse` where company=%s""", self.name) - frappe.defaults.clear_default("company", value=self.doc.name) + frappe.defaults.clear_default("company", value=self.name) frappe.db.sql("""update `tabSingles` set value="" where doctype='Global Defaults' and field='default_company' - and value=%s""", self.doc.name) + and value=%s""", self.name) def before_rename(self, olddn, newdn, merge=False): if merge: @@ -219,114 +219,114 @@ class Company(Document): } acc_list_common = [ - ['Application of Funds (Assets)','','Group','','Balance Sheet',self.doc.name,''], - ['Current Assets','Application of Funds (Assets)','Group','','Balance Sheet',self.doc.name,''], - ['Accounts Receivable','Current Assets','Group','','Balance Sheet',self.doc.name,''], - ['Bank Accounts','Current Assets','Group','Bank','Balance Sheet',self.doc.name,''], - ['Cash In Hand','Current Assets','Group','Cash','Balance Sheet',self.doc.name,''], - ['Cash','Cash In Hand','Ledger','Cash','Balance Sheet',self.doc.name,''], - ['Loans and Advances (Assets)','Current Assets','Group','','Balance Sheet',self.doc.name,''], - ['Securities and Deposits','Current Assets','Group','','Balance Sheet',self.doc.name,''], - ['Earnest Money','Securities and Deposits','Ledger','','Balance Sheet',self.doc.name,''], - ['Stock Assets','Current Assets','Group','Stock','Balance Sheet',self.doc.name,''], - ['Tax Assets','Current Assets','Group','','Balance Sheet',self.doc.name,''], - ['Fixed Assets','Application of Funds (Assets)','Group','','Balance Sheet',self.doc.name,''], - ['Capital Equipments','Fixed Assets','Ledger','Fixed Asset','Balance Sheet',self.doc.name,''], - ['Computers','Fixed Assets','Ledger','Fixed Asset','Balance Sheet',self.doc.name,''], - ['Furniture and Fixture','Fixed Assets','Ledger','Fixed Asset','Balance Sheet',self.doc.name,''], - ['Office Equipments','Fixed Assets','Ledger','Fixed Asset','Balance Sheet',self.doc.name,''], - ['Plant and Machinery','Fixed Assets','Ledger','Fixed Asset','Balance Sheet',self.doc.name,''], - ['Investments','Application of Funds (Assets)','Group','','Balance Sheet',self.doc.name,''], - ['Temporary Accounts (Assets)','Application of Funds (Assets)','Group','','Balance Sheet',self.doc.name,''], - ['Temporary Account (Assets)','Temporary Accounts (Assets)','Ledger','','Balance Sheet',self.doc.name,''], - ['Expenses','','Group','Expense Account','Profit and Loss',self.doc.name,''], - ['Direct Expenses','Expenses','Group','Expense Account','Profit and Loss',self.doc.name,''], - ['Stock Expenses','Direct Expenses','Group','Expense Account','Profit and Loss',self.doc.name,''], - ['Cost of Goods Sold','Stock Expenses','Ledger','Expense Account','Profit and Loss',self.doc.name,''], - ['Stock Adjustment','Stock Expenses','Ledger','Stock Adjustment','Profit and Loss',self.doc.name,''], - ['Expenses Included In Valuation', "Stock Expenses", 'Ledger', 'Expenses Included In Valuation', 'Profit and Loss', self.doc.name, ''], - ['Indirect Expenses','Expenses','Group','Expense Account','Profit and Loss',self.doc.name,''], - ['Advertising and Publicity','Indirect Expenses','Ledger','Chargeable','Profit and Loss',self.doc.name,''], - ['Bad Debts Written Off','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.doc.name,''], - ['Bank Charges','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.doc.name,''], - ['Books and Periodicals','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.doc.name,''], - ['Charity and Donations','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.doc.name,''], - ['Commission on Sales','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.doc.name,''], - ['Conveyance Expenses','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.doc.name,''], - ['Customer Entertainment Expenses','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.doc.name,''], - ['Depreciation Account','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.doc.name,''], - ['Freight and Forwarding Charges','Indirect Expenses','Ledger','Chargeable','Profit and Loss',self.doc.name,''], - ['Legal Expenses','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.doc.name,''], - ['Miscellaneous Expenses','Indirect Expenses','Ledger','Chargeable','Profit and Loss',self.doc.name,''], - ['Office Maintenance Expenses','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.doc.name,''], - ['Office Rent','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.doc.name,''], - ['Postal Expenses','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.doc.name,''], - ['Print and Stationary','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.doc.name,''], - ['Rounded Off','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.doc.name,''], - ['Salary','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.doc.name,''], - ['Sales Promotion Expenses','Indirect Expenses','Ledger','Chargeable','Profit and Loss',self.doc.name,''], - ['Service Charges Paid','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.doc.name,''], - ['Staff Welfare Expenses','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.doc.name,''], - ['Telephone Expenses','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.doc.name,''], - ['Travelling Expenses','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.doc.name,''], - ['Water and Electricity Expenses','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.doc.name,''], - ['Income','','Group','','Profit and Loss',self.doc.name,''], - ['Direct Income','Income','Group','Income Account','Profit and Loss',self.doc.name,''], - ['Sales','Direct Income','Ledger','Income Account','Profit and Loss',self.doc.name,''], - ['Service','Direct Income','Ledger','Income Account','Profit and Loss',self.doc.name,''], - ['Indirect Income','Income','Group','Income Account','Profit and Loss',self.doc.name,''], - ['Source of Funds (Liabilities)','','Group','','Balance Sheet',self.doc.name,''], - ['Capital Account','Source of Funds (Liabilities)','Group','','Balance Sheet',self.doc.name,''], - ['Reserves and Surplus','Capital Account','Ledger','','Balance Sheet',self.doc.name,''], - ['Shareholders Funds','Capital Account','Ledger','','Balance Sheet',self.doc.name,''], - ['Current Liabilities','Source of Funds (Liabilities)','Group','','Balance Sheet',self.doc.name,''], - ['Accounts Payable','Current Liabilities','Group','','Balance Sheet',self.doc.name,''], - ['Stock Liabilities','Current Liabilities','Group','','Balance Sheet',self.doc.name,''], - ['Stock Received But Not Billed', 'Stock Liabilities', 'Ledger', 'Stock Received But Not Billed', 'Balance Sheet', self.doc.name, ''], - ['Duties and Taxes','Current Liabilities','Group','','Balance Sheet',self.doc.name,''], - ['Loans (Liabilities)','Current Liabilities','Group','','Balance Sheet',self.doc.name,''], - ['Secured Loans','Loans (Liabilities)','Group','','Balance Sheet',self.doc.name,''], - ['Unsecured Loans','Loans (Liabilities)','Group','','Balance Sheet',self.doc.name,''], - ['Bank Overdraft Account','Loans (Liabilities)','Group','','Balance Sheet',self.doc.name,''], - ['Temporary Accounts (Liabilities)','Source of Funds (Liabilities)','Group','','Balance Sheet',self.doc.name,''], - ['Temporary Account (Liabilities)','Temporary Accounts (Liabilities)','Ledger','','Balance Sheet',self.doc.name,''] + ['Application of Funds (Assets)','','Group','','Balance Sheet',self.name,''], + ['Current Assets','Application of Funds (Assets)','Group','','Balance Sheet',self.name,''], + ['Accounts Receivable','Current Assets','Group','','Balance Sheet',self.name,''], + ['Bank Accounts','Current Assets','Group','Bank','Balance Sheet',self.name,''], + ['Cash In Hand','Current Assets','Group','Cash','Balance Sheet',self.name,''], + ['Cash','Cash In Hand','Ledger','Cash','Balance Sheet',self.name,''], + ['Loans and Advances (Assets)','Current Assets','Group','','Balance Sheet',self.name,''], + ['Securities and Deposits','Current Assets','Group','','Balance Sheet',self.name,''], + ['Earnest Money','Securities and Deposits','Ledger','','Balance Sheet',self.name,''], + ['Stock Assets','Current Assets','Group','Stock','Balance Sheet',self.name,''], + ['Tax Assets','Current Assets','Group','','Balance Sheet',self.name,''], + ['Fixed Assets','Application of Funds (Assets)','Group','','Balance Sheet',self.name,''], + ['Capital Equipments','Fixed Assets','Ledger','Fixed Asset','Balance Sheet',self.name,''], + ['Computers','Fixed Assets','Ledger','Fixed Asset','Balance Sheet',self.name,''], + ['Furniture and Fixture','Fixed Assets','Ledger','Fixed Asset','Balance Sheet',self.name,''], + ['Office Equipments','Fixed Assets','Ledger','Fixed Asset','Balance Sheet',self.name,''], + ['Plant and Machinery','Fixed Assets','Ledger','Fixed Asset','Balance Sheet',self.name,''], + ['Investments','Application of Funds (Assets)','Group','','Balance Sheet',self.name,''], + ['Temporary Accounts (Assets)','Application of Funds (Assets)','Group','','Balance Sheet',self.name,''], + ['Temporary Account (Assets)','Temporary Accounts (Assets)','Ledger','','Balance Sheet',self.name,''], + ['Expenses','','Group','Expense Account','Profit and Loss',self.name,''], + ['Direct Expenses','Expenses','Group','Expense Account','Profit and Loss',self.name,''], + ['Stock Expenses','Direct Expenses','Group','Expense Account','Profit and Loss',self.name,''], + ['Cost of Goods Sold','Stock Expenses','Ledger','Expense Account','Profit and Loss',self.name,''], + ['Stock Adjustment','Stock Expenses','Ledger','Stock Adjustment','Profit and Loss',self.name,''], + ['Expenses Included In Valuation', "Stock Expenses", 'Ledger', 'Expenses Included In Valuation', 'Profit and Loss', self.name, ''], + ['Indirect Expenses','Expenses','Group','Expense Account','Profit and Loss',self.name,''], + ['Advertising and Publicity','Indirect Expenses','Ledger','Chargeable','Profit and Loss',self.name,''], + ['Bad Debts Written Off','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''], + ['Bank Charges','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''], + ['Books and Periodicals','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''], + ['Charity and Donations','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''], + ['Commission on Sales','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''], + ['Conveyance Expenses','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''], + ['Customer Entertainment Expenses','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''], + ['Depreciation Account','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''], + ['Freight and Forwarding Charges','Indirect Expenses','Ledger','Chargeable','Profit and Loss',self.name,''], + ['Legal Expenses','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''], + ['Miscellaneous Expenses','Indirect Expenses','Ledger','Chargeable','Profit and Loss',self.name,''], + ['Office Maintenance Expenses','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''], + ['Office Rent','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''], + ['Postal Expenses','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''], + ['Print and Stationary','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''], + ['Rounded Off','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''], + ['Salary','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''], + ['Sales Promotion Expenses','Indirect Expenses','Ledger','Chargeable','Profit and Loss',self.name,''], + ['Service Charges Paid','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''], + ['Staff Welfare Expenses','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''], + ['Telephone Expenses','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''], + ['Travelling Expenses','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''], + ['Water and Electricity Expenses','Indirect Expenses','Ledger','Expense Account','Profit and Loss',self.name,''], + ['Income','','Group','','Profit and Loss',self.name,''], + ['Direct Income','Income','Group','Income Account','Profit and Loss',self.name,''], + ['Sales','Direct Income','Ledger','Income Account','Profit and Loss',self.name,''], + ['Service','Direct Income','Ledger','Income Account','Profit and Loss',self.name,''], + ['Indirect Income','Income','Group','Income Account','Profit and Loss',self.name,''], + ['Source of Funds (Liabilities)','','Group','','Balance Sheet',self.name,''], + ['Capital Account','Source of Funds (Liabilities)','Group','','Balance Sheet',self.name,''], + ['Reserves and Surplus','Capital Account','Ledger','','Balance Sheet',self.name,''], + ['Shareholders Funds','Capital Account','Ledger','','Balance Sheet',self.name,''], + ['Current Liabilities','Source of Funds (Liabilities)','Group','','Balance Sheet',self.name,''], + ['Accounts Payable','Current Liabilities','Group','','Balance Sheet',self.name,''], + ['Stock Liabilities','Current Liabilities','Group','','Balance Sheet',self.name,''], + ['Stock Received But Not Billed', 'Stock Liabilities', 'Ledger', 'Stock Received But Not Billed', 'Balance Sheet', self.name, ''], + ['Duties and Taxes','Current Liabilities','Group','','Balance Sheet',self.name,''], + ['Loans (Liabilities)','Current Liabilities','Group','','Balance Sheet',self.name,''], + ['Secured Loans','Loans (Liabilities)','Group','','Balance Sheet',self.name,''], + ['Unsecured Loans','Loans (Liabilities)','Group','','Balance Sheet',self.name,''], + ['Bank Overdraft Account','Loans (Liabilities)','Group','','Balance Sheet',self.name,''], + ['Temporary Accounts (Liabilities)','Source of Funds (Liabilities)','Group','','Balance Sheet',self.name,''], + ['Temporary Account (Liabilities)','Temporary Accounts (Liabilities)','Ledger','','Balance Sheet',self.name,''] ] acc_list_india = [ - ['CENVAT Capital Goods','Tax Assets','Ledger','Chargeable','Balance Sheet',self.doc.name,''], - ['CENVAT','Tax Assets','Ledger','Chargeable','Balance Sheet',self.doc.name,''], - ['CENVAT Service Tax','Tax Assets','Ledger','Chargeable','Balance Sheet',self.doc.name,''], - ['CENVAT Service Tax Cess 1','Tax Assets','Ledger','Chargeable','Balance Sheet',self.doc.name,''], - ['CENVAT Service Tax Cess 2','Tax Assets','Ledger','Chargeable','Balance Sheet',self.doc.name,''], - ['CENVAT Edu Cess','Tax Assets','Ledger','Chargeable','Balance Sheet',self.doc.name,''], - ['CENVAT SHE Cess','Tax Assets','Ledger','Chargeable','Balance Sheet',self.doc.name,''], - ['Excise Duty 4','Tax Assets','Ledger','Tax','Balance Sheet',self.doc.name,'4.00'], - ['Excise Duty 8','Tax Assets','Ledger','Tax','Balance Sheet',self.doc.name,'8.00'], - ['Excise Duty 10','Tax Assets','Ledger','Tax','Balance Sheet',self.doc.name,'10.00'], - ['Excise Duty 14','Tax Assets','Ledger','Tax','Balance Sheet',self.doc.name,'14.00'], - ['Excise Duty Edu Cess 2','Tax Assets','Ledger','Tax','Balance Sheet',self.doc.name,'2.00'], - ['Excise Duty SHE Cess 1','Tax Assets','Ledger','Tax','Balance Sheet',self.doc.name,'1.00'], - ['P L A','Tax Assets','Ledger','Chargeable','Balance Sheet',self.doc.name,''], - ['P L A - Cess Portion','Tax Assets','Ledger','Chargeable','Balance Sheet',self.doc.name,''], - ['Edu. Cess on Excise','Duties and Taxes','Ledger','Tax','Balance Sheet',self.doc.name,'2.00'], - ['Edu. Cess on Service Tax','Duties and Taxes','Ledger','Tax','Balance Sheet',self.doc.name,'2.00'], - ['Edu. Cess on TDS','Duties and Taxes','Ledger','Tax','Balance Sheet',self.doc.name,'2.00'], - ['Excise Duty @ 4','Duties and Taxes','Ledger','Tax','Balance Sheet',self.doc.name,'4.00'], - ['Excise Duty @ 8','Duties and Taxes','Ledger','Tax','Balance Sheet',self.doc.name,'8.00'], - ['Excise Duty @ 10','Duties and Taxes','Ledger','Tax','Balance Sheet',self.doc.name,'10.00'], - ['Excise Duty @ 14','Duties and Taxes','Ledger','Tax','Balance Sheet',self.doc.name,'14.00'], - ['Service Tax','Duties and Taxes','Ledger','Tax','Balance Sheet',self.doc.name,'10.3'], - ['SHE Cess on Excise','Duties and Taxes','Ledger','Tax','Balance Sheet',self.doc.name,'1.00'], - ['SHE Cess on Service Tax','Duties and Taxes','Ledger','Tax','Balance Sheet',self.doc.name,'1.00'], - ['SHE Cess on TDS','Duties and Taxes','Ledger','Tax','Balance Sheet',self.doc.name,'1.00'], - ['Professional Tax','Duties and Taxes','Ledger','Chargeable','Balance Sheet',self.doc.name,''], - ['VAT','Duties and Taxes','Ledger','Chargeable','Balance Sheet',self.doc.name,''], - ['TDS (Advertisement)','Duties and Taxes','Ledger','Chargeable','Balance Sheet',self.doc.name,''], - ['TDS (Commission)','Duties and Taxes','Ledger','Chargeable','Balance Sheet',self.doc.name,''], - ['TDS (Contractor)','Duties and Taxes','Ledger','Chargeable','Balance Sheet',self.doc.name,''], - ['TDS (Interest)','Duties and Taxes','Ledger','Chargeable','Balance Sheet',self.doc.name,''], - ['TDS (Rent)','Duties and Taxes','Ledger','Chargeable','Balance Sheet',self.doc.name,''], - ['TDS (Salary)','Duties and Taxes','Ledger','Chargeable','Balance Sheet',self.doc.name,''] + ['CENVAT Capital Goods','Tax Assets','Ledger','Chargeable','Balance Sheet',self.name,''], + ['CENVAT','Tax Assets','Ledger','Chargeable','Balance Sheet',self.name,''], + ['CENVAT Service Tax','Tax Assets','Ledger','Chargeable','Balance Sheet',self.name,''], + ['CENVAT Service Tax Cess 1','Tax Assets','Ledger','Chargeable','Balance Sheet',self.name,''], + ['CENVAT Service Tax Cess 2','Tax Assets','Ledger','Chargeable','Balance Sheet',self.name,''], + ['CENVAT Edu Cess','Tax Assets','Ledger','Chargeable','Balance Sheet',self.name,''], + ['CENVAT SHE Cess','Tax Assets','Ledger','Chargeable','Balance Sheet',self.name,''], + ['Excise Duty 4','Tax Assets','Ledger','Tax','Balance Sheet',self.name,'4.00'], + ['Excise Duty 8','Tax Assets','Ledger','Tax','Balance Sheet',self.name,'8.00'], + ['Excise Duty 10','Tax Assets','Ledger','Tax','Balance Sheet',self.name,'10.00'], + ['Excise Duty 14','Tax Assets','Ledger','Tax','Balance Sheet',self.name,'14.00'], + ['Excise Duty Edu Cess 2','Tax Assets','Ledger','Tax','Balance Sheet',self.name,'2.00'], + ['Excise Duty SHE Cess 1','Tax Assets','Ledger','Tax','Balance Sheet',self.name,'1.00'], + ['P L A','Tax Assets','Ledger','Chargeable','Balance Sheet',self.name,''], + ['P L A - Cess Portion','Tax Assets','Ledger','Chargeable','Balance Sheet',self.name,''], + ['Edu. Cess on Excise','Duties and Taxes','Ledger','Tax','Balance Sheet',self.name,'2.00'], + ['Edu. Cess on Service Tax','Duties and Taxes','Ledger','Tax','Balance Sheet',self.name,'2.00'], + ['Edu. Cess on TDS','Duties and Taxes','Ledger','Tax','Balance Sheet',self.name,'2.00'], + ['Excise Duty @ 4','Duties and Taxes','Ledger','Tax','Balance Sheet',self.name,'4.00'], + ['Excise Duty @ 8','Duties and Taxes','Ledger','Tax','Balance Sheet',self.name,'8.00'], + ['Excise Duty @ 10','Duties and Taxes','Ledger','Tax','Balance Sheet',self.name,'10.00'], + ['Excise Duty @ 14','Duties and Taxes','Ledger','Tax','Balance Sheet',self.name,'14.00'], + ['Service Tax','Duties and Taxes','Ledger','Tax','Balance Sheet',self.name,'10.3'], + ['SHE Cess on Excise','Duties and Taxes','Ledger','Tax','Balance Sheet',self.name,'1.00'], + ['SHE Cess on Service Tax','Duties and Taxes','Ledger','Tax','Balance Sheet',self.name,'1.00'], + ['SHE Cess on TDS','Duties and Taxes','Ledger','Tax','Balance Sheet',self.name,'1.00'], + ['Professional Tax','Duties and Taxes','Ledger','Chargeable','Balance Sheet',self.name,''], + ['VAT','Duties and Taxes','Ledger','Chargeable','Balance Sheet',self.name,''], + ['TDS (Advertisement)','Duties and Taxes','Ledger','Chargeable','Balance Sheet',self.name,''], + ['TDS (Commission)','Duties and Taxes','Ledger','Chargeable','Balance Sheet',self.name,''], + ['TDS (Contractor)','Duties and Taxes','Ledger','Chargeable','Balance Sheet',self.name,''], + ['TDS (Interest)','Duties and Taxes','Ledger','Chargeable','Balance Sheet',self.name,''], + ['TDS (Rent)','Duties and Taxes','Ledger','Chargeable','Balance Sheet',self.name,''], + ['TDS (Salary)','Duties and Taxes','Ledger','Chargeable','Balance Sheet',self.name,''] ] # load common account heads for d in acc_list_common: diff --git a/erpnext/setup/doctype/currency_exchange/currency_exchange.py b/erpnext/setup/doctype/currency_exchange/currency_exchange.py index a0624de888..e22f035b92 100644 --- a/erpnext/setup/doctype/currency_exchange/currency_exchange.py +++ b/erpnext/setup/doctype/currency_exchange/currency_exchange.py @@ -11,10 +11,10 @@ from frappe.model.controller import DocListController class CurrencyExchange(DocListController): def autoname(self): - self.doc.name = self.doc.from_currency + "-" + self.doc.to_currency + self.name = self.from_currency + "-" + self.to_currency def validate(self): self.validate_value("exchange_rate", ">", 0) - if self.doc.from_currency == self.doc.to_currency: + if self.from_currency == self.to_currency: msgprint(_("From Currency and To Currency cannot be same"), raise_exception=True) \ No newline at end of file diff --git a/erpnext/setup/doctype/customer_group/customer_group.py b/erpnext/setup/doctype/customer_group/customer_group.py index 214e20c0e5..425741b169 100644 --- a/erpnext/setup/doctype/customer_group/customer_group.py +++ b/erpnext/setup/doctype/customer_group/customer_group.py @@ -12,10 +12,10 @@ class CustomerGroup(DocTypeNestedSet): def validate(self): if frappe.db.sql("select name from `tabCustomer Group` where name = %s and docstatus = 2", - (self.doc.customer_group_name)): + (self.customer_group_name)): msgprint("""Another %s record is trashed. To untrash please go to Setup -> Recycle Bin.""" % - (self.doc.customer_group_name), raise_exception = 1) + (self.customer_group_name), raise_exception = 1) def on_update(self): self.validate_name_with_customer() @@ -23,23 +23,23 @@ class CustomerGroup(DocTypeNestedSet): self.validate_one_root() def validate_name_with_customer(self): - if frappe.db.exists("Customer", self.doc.name): + if frappe.db.exists("Customer", self.name): frappe.msgprint("An Customer exists with same name (%s), \ please change the Customer Group name or rename the Customer" % - self.doc.name, raise_exception=1) + self.name, raise_exception=1) def on_trash(self): cust = frappe.db.sql("select name from `tabCustomer` where ifnull(customer_group, '') = %s", - self.doc.name) + self.name) cust = [d[0] for d in cust] if cust: msgprint("""Customer Group: %s can not be trashed/deleted \ because it is used in customer: %s. To trash/delete this, remove/change customer group in customer master""" % - (self.doc.name, cust or ''), raise_exception=1) + (self.name, cust or ''), raise_exception=1) if frappe.db.sql("select name from `tabCustomer Group` where parent_customer_group = %s \ - and docstatus != 2", self.doc.name): + and docstatus != 2", self.name): msgprint("Child customer group exists for this customer group. \ You can not trash/cancel/delete this customer group.", raise_exception=1) diff --git a/erpnext/setup/doctype/email_digest/email_digest.py b/erpnext/setup/doctype/email_digest/email_digest.py index 1344686da6..5d3efcd7a5 100644 --- a/erpnext/setup/doctype/email_digest/email_digest.py +++ b/erpnext/setup/doctype/email_digest/email_digest.py @@ -50,7 +50,7 @@ class EmailDigest(DocListController): super(EmailDigest, self).__init__(arg1, arg2) self.from_date, self.to_date = self.get_from_to_date() self.future_from_date, self.future_to_date = self.get_future_from_to_date() - self.currency = frappe.db.get_value("Company", self.doc.company, + self.currency = frappe.db.get_value("Company", self.company, "default_currency") def get_users(self): @@ -61,8 +61,8 @@ class EmailDigest(DocListController): and user_type != "Website User" order by enabled desc, name asc""".format(", ".join(["%s"]*len(STANDARD_USERS))), STANDARD_USERS, as_dict=1) - if self.doc.recipient_list: - recipient_list = self.doc.recipient_list.split("\n") + if self.recipient_list: + recipient_list = self.recipient_list.split("\n") else: recipient_list = [] for p in user_list: @@ -75,7 +75,7 @@ class EmailDigest(DocListController): valid_users = [p[0] for p in frappe.db.sql("""select name from `tabUser` where enabled=1""")] recipients = filter(lambda r: r in valid_users, - self.doc.recipient_list.split("\n")) + self.recipient_list.split("\n")) common_msg = self.get_common_content() if recipients: @@ -85,7 +85,7 @@ class EmailDigest(DocListController): if msg_for_this_receipient: sendmail(recipients=user_id, subject="[ERPNext] [{frequency} Digest] {name}".format( - frequency=self.doc.frequency, name=self.doc.name), + frequency=self.frequency, name=self.name), msg=msg_for_this_receipient) def get_digest_msg(self): @@ -97,7 +97,7 @@ class EmailDigest(DocListController): for module, content in content_sequence: module_out = [] for ctype in content: - if self.doc.fields.get(ctype) and hasattr(self, "get_"+ctype): + if self.get(ctype) and hasattr(self, "get_"+ctype): module_out.append(getattr(self, "get_"+ctype)()) if any([m[0] for m in module_out]): out += [[1, "

" + _(module) + "

"]] + module_out + [[1, "
"]] @@ -114,7 +114,7 @@ class EmailDigest(DocListController): out = [] for ctype in user_specific_content: - if self.doc.fields.get(ctype) and hasattr(self, "get_"+ctype): + if self.get(ctype) and hasattr(self, "get_"+ctype): out.append(getattr(self, "get_"+ctype)(user_id)) frappe.session.user = original_session_user @@ -139,16 +139,16 @@ class EmailDigest(DocListController): if no_value: no_value = """

No Updates For:

""" + "\n".join(no_value) - date = self.doc.frequency == "Daily" and formatdate(self.from_date) or \ + date = self.frequency == "Daily" and formatdate(self.from_date) or \ "%s to %s" % (formatdate(self.from_date), formatdate(self.to_date)) msg = digest_template % { - "digest": self.doc.frequency + " Digest", + "digest": self.frequency + " Digest", "date": date, - "company": self.doc.company, + "company": self.company, "with_value": with_value, "no_value": no_value or "", - "name": self.doc.name + "name": self.name } return msg @@ -337,7 +337,7 @@ class EmailDigest(DocListController): def get_new_count(self, doctype, label, docstatus=0, filter_by_company=True): if filter_by_company: - company = """and company="%s" """ % self.doc.company.replace('"', '\"') + company = """and company="%s" """ % self.company.replace('"', '\"') else: company = "" count = frappe.db.sql("""select count(*) from `tab%s` @@ -352,7 +352,7 @@ class EmailDigest(DocListController): count_sum = frappe.db.sql("""select count(*), sum(ifnull(`%s`, 0)) from `tab%s` where docstatus=1 and company = %s and date(creation)>=%s and date(creation)<=%s""" % (sum_field, doctype, "%s", - "%s", "%s"), (self.doc.company, self.from_date, self.to_date)) + "%s", "%s"), (self.company, self.from_date, self.to_date)) count, total = count_sum and count_sum[0] or (0, 0) return count, self.get_html(label, self.currency, @@ -379,7 +379,7 @@ class EmailDigest(DocListController): where company=%s and posting_date <= %s %s""" % ("%s", "%s", from_date and "and posting_date>='%s'" % from_date or ""), - (self.doc.company, to_date or self.to_date), as_dict=1) + (self.company, to_date or self.to_date), as_dict=1) # cache if it is the normal cases if from_date==self.from_date and to_date==self.to_date: @@ -393,17 +393,17 @@ class EmailDigest(DocListController): root_type, account_type, account_name, master_type from `tabAccount` where company=%s and docstatus < 2 and group_or_ledger = "Ledger" order by lft""", - (self.doc.company,), as_dict=1) + (self.company,), as_dict=1) return self.accounts def get_from_to_date(self): today = now_datetime().date() # decide from date based on email digest frequency - if self.doc.frequency == "Daily": + if self.frequency == "Daily": # from date, to_date is yesterday from_date = to_date = today - timedelta(days=1) - elif self.doc.frequency == "Weekly": + elif self.frequency == "Weekly": # from date is the previous week's monday from_date = today - timedelta(days=today.weekday(), weeks=1) # to date is sunday i.e. the previous day @@ -420,10 +420,10 @@ class EmailDigest(DocListController): today = now_datetime().date() # decide from date based on email digest frequency - if self.doc.frequency == "Daily": + if self.frequency == "Daily": # from date, to_date is today from_date = to_date = today - elif self.doc.frequency == "Weekly": + elif self.frequency == "Weekly": # from date is the current week's monday from_date = today - timedelta(days=today.weekday()) # to date is the current week's sunday @@ -441,13 +441,13 @@ class EmailDigest(DocListController): send_date = to_date + timedelta(days=1) - if self.doc.frequency == "Daily": + if self.frequency == "Daily": next_send_date = send_date + timedelta(days=1) - elif self.doc.frequency == "Weekly": + elif self.frequency == "Weekly": next_send_date = send_date + timedelta(weeks=1) else: next_send_date = send_date + relativedelta(months=1) - self.doc.next_send = formatdate(next_send_date) + " at midnight" + self.next_send = formatdate(next_send_date) + " at midnight" return send_date diff --git a/erpnext/setup/doctype/features_setup/features_setup.py b/erpnext/setup/doctype/features_setup/features_setup.py index 825163df9a..55c155238b 100644 --- a/erpnext/setup/doctype/features_setup/features_setup.py +++ b/erpnext/setup/doctype/features_setup/features_setup.py @@ -12,6 +12,6 @@ class FeaturesSetup(Document): """ from frappe.model import default_fields from frappe.utils import set_default - for key in self.doc.fields: + for key in self.fields: if key not in default_fields: - set_default(key, self.doc.fields[key]) + set_default(key, self.fields[key]) diff --git a/erpnext/setup/doctype/global_defaults/global_defaults.py b/erpnext/setup/doctype/global_defaults/global_defaults.py index bfe3265b9d..26b44979f9 100644 --- a/erpnext/setup/doctype/global_defaults/global_defaults.py +++ b/erpnext/setup/doctype/global_defaults/global_defaults.py @@ -32,11 +32,11 @@ class GlobalDefaults(Document): self.update_control_panel() for key in keydict: - frappe.db.set_default(key, self.doc.fields.get(keydict[key], '')) + frappe.db.set_default(key, self.get(keydict[key], '')) # update year start date and year end date from fiscal_year year_start_end_date = frappe.db.sql("""select year_start_date, year_end_date - from `tabFiscal Year` where name=%s""", self.doc.current_fiscal_year) + from `tabFiscal Year` where name=%s""", self.current_fiscal_year) ysd = year_start_end_date[0][0] or '' yed = year_start_end_date[0][1] or '' @@ -46,25 +46,25 @@ class GlobalDefaults(Document): frappe.db.set_default('year_end_date', yed.strftime('%Y-%m-%d')) # enable default currency - if self.doc.default_currency: - frappe.db.set_value("Currency", self.doc.default_currency, "enabled", 1) + if self.default_currency: + frappe.db.set_value("Currency", self.default_currency, "enabled", 1) # clear cache frappe.clear_cache() def validate_session_expiry(self): - if self.doc.session_expiry: - parts = self.doc.session_expiry.split(":") + if self.session_expiry: + parts = self.session_expiry.split(":") if len(parts)!=2 or not (cint(parts[0]) or cint(parts[1])): frappe.msgprint("""Session Expiry must be in format hh:mm""", raise_exception=1) def update_control_panel(self): cp_bean = frappe.bean("Control Panel") - if self.doc.country: - cp_bean.doc.country = self.doc.country - if self.doc.time_zone: - cp_bean.doc.time_zone = self.doc.time_zone + if self.country: + cp_bean.country = self.country + if self.time_zone: + cp_bean.time_zone = self.time_zone cp_bean.ignore_permissions = True cp_bean.save() diff --git a/erpnext/setup/doctype/item_group/item_group.py b/erpnext/setup/doctype/item_group/item_group.py index 455d752452..52880fc8d5 100644 --- a/erpnext/setup/doctype/item_group/item_group.py +++ b/erpnext/setup/doctype/item_group/item_group.py @@ -10,9 +10,9 @@ class ItemGroup(DocTypeNestedSet): self.nsm_parent_field = 'parent_item_group' def validate(self): - if not self.doc.parent_website_route: - self.doc.parent_website_route = frappe.get_website_route("Item Group", - self.doc.parent_item_group) + if not self.parent_website_route: + self.parent_website_route = frappe.get_website_route("Item Group", + self.parent_item_group) def on_update(self): DocTypeNestedSet.on_update(self) @@ -22,6 +22,6 @@ class ItemGroup(DocTypeNestedSet): self.validate_one_root() def validate_name_with_item(self): - if frappe.db.exists("Item", self.doc.name): + if frappe.db.exists("Item", self.name): frappe.msgprint("An item exists with same name (%s), please change the \ - item group name or rename the item" % self.doc.name, raise_exception=1) + item group name or rename the item" % self.name, raise_exception=1) diff --git a/erpnext/setup/doctype/item_group/test_item_group.py b/erpnext/setup/doctype/item_group/test_item_group.py index 0f174ed599..27160952ee 100644 --- a/erpnext/setup/doctype/item_group/test_item_group.py +++ b/erpnext/setup/doctype/item_group/test_item_group.py @@ -128,11 +128,11 @@ class TestItem(unittest.TestCase): def test_recursion(self): group_b = frappe.bean("Item Group", "_Test Item Group B") - group_b.doc.parent_item_group = "_Test Item Group B - 3" + group_b.parent_item_group = "_Test Item Group B - 3" self.assertRaises(NestedSetRecursionError, group_b.save) # cleanup - group_b.doc.parent_item_group = "All Item Groups" + group_b.parent_item_group = "All Item Groups" group_b.save() def test_rebuild_tree(self): @@ -141,7 +141,7 @@ class TestItem(unittest.TestCase): def move_it_back(self): group_b = frappe.bean("Item Group", "_Test Item Group B") - group_b.doc.parent_item_group = "All Item Groups" + group_b.parent_item_group = "All Item Groups" group_b.save() self.test_basic_tree() @@ -151,9 +151,9 @@ class TestItem(unittest.TestCase): # put B under C group_b = frappe.bean("Item Group", "_Test Item Group B") - lft, rgt = group_b.doc.lft, group_b.doc.rgt + lft, rgt = group_b.lft, group_b.rgt - group_b.doc.parent_item_group = "_Test Item Group C" + group_b.parent_item_group = "_Test Item Group C" group_b.save() self.test_basic_tree() @@ -170,7 +170,7 @@ class TestItem(unittest.TestCase): def test_move_group_into_root(self): group_b = frappe.bean("Item Group", "_Test Item Group B") - group_b.doc.parent_item_group = "" + group_b.parent_item_group = "" self.assertRaises(NestedSetMultipleRootsError, group_b.save) # trick! works because it hasn't been rolled back :D @@ -187,10 +187,10 @@ class TestItem(unittest.TestCase): old_lft, old_rgt = frappe.db.get_value("Item Group", "_Test Item Group C", ["lft", "rgt"]) group_b_3 = frappe.bean("Item Group", "_Test Item Group B - 3") - lft, rgt = group_b_3.doc.lft, group_b_3.doc.rgt + lft, rgt = group_b_3.lft, group_b_3.rgt # child of right sibling is moved into it - group_b_3.doc.parent_item_group = "_Test Item Group C" + group_b_3.parent_item_group = "_Test Item Group C" group_b_3.save() self.test_basic_tree() @@ -204,7 +204,7 @@ class TestItem(unittest.TestCase): # move it back group_b_3 = frappe.bean("Item Group", "_Test Item Group B - 3") - group_b_3.doc.parent_item_group = "_Test Item Group B" + group_b_3.parent_item_group = "_Test Item Group B" group_b_3.save() self.test_basic_tree() @@ -251,7 +251,7 @@ class TestItem(unittest.TestCase): where parent_item_group='_Test Item Group C'"""): bean = frappe.bean("Item Group", name) - bean.doc.parent_item_group = "_Test Item Group B" + bean.parent_item_group = "_Test Item Group B" bean.save() self.test_basic_tree() diff --git a/erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.py b/erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.py index 2c928aaa7f..94874f2233 100644 --- a/erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.py +++ b/erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.py @@ -13,8 +13,8 @@ from frappe.model.document import Document class JobsEmailSettings(Document): def validate(self): - if cint(self.doc.extract_emails) and not (self.doc.email_id and self.doc.host and \ - self.doc.username and self.doc.password): + if cint(self.extract_emails) and not (self.email_id and self.host and \ + self.username and self.password): frappe.msgprint(_("""Host, Email and Password required if emails are to be pulled"""), raise_exception=True) \ No newline at end of file diff --git a/erpnext/setup/doctype/naming_series/naming_series.py b/erpnext/setup/doctype/naming_series/naming_series.py index d1608fc581..7338de0189 100644 --- a/erpnext/setup/doctype/naming_series/naming_series.py +++ b/erpnext/setup/doctype/naming_series/naming_series.py @@ -31,10 +31,10 @@ class NamingSeries(Document): def update_series(self, arg=None): """update series list""" self.check_duplicate() - series_list = self.doc.set_options.split("\n") + series_list = self.set_options.split("\n") # set in doctype - self.set_series_for(self.doc.select_doc_for_series, series_list) + self.set_series_for(self.select_doc_for_series, series_list) # create series map(self.insert_series, [d.split('.')[0] for d in series_list]) @@ -49,7 +49,7 @@ class NamingSeries(Document): # validate names for i in options: self.validate_series_name(i) - if self.doc.user_must_always_select: + if self.user_must_always_select: options = [''] + options default = '' else: @@ -78,7 +78,7 @@ class NamingSeries(Document): }) ps.save() - self.doc.set_options = "\n".join(options) + self.set_options = "\n".join(options) frappe.clear_cache(doctype=doctype) @@ -90,17 +90,17 @@ class NamingSeries(Document): frappe.db.sql_list("""select dt.name from `tabDocField` df, `tabDocType` dt where dt.name = df.parent and df.fieldname='naming_series' and dt.name != %s""", - self.doc.select_doc_for_series) + self.select_doc_for_series) + frappe.db.sql_list("""select dt.name from `tabCustom Field` df, `tabDocType` dt where dt.name = df.dt and df.fieldname='naming_series' and dt.name != %s""", - self.doc.select_doc_for_series) + self.select_doc_for_series) )) sr = [[frappe.model.doctype.get_property(p, 'options', 'naming_series'), p] for p in parent] - options = self.scrub_options_list(self.doc.set_options.split("\n")) + options = self.scrub_options_list(self.set_options.split("\n")) for series in options: - dt.validate_series(series, self.doc.select_doc_for_series) + dt.validate_series(series, self.select_doc_for_series) for i in sr: if i[0]: existing_series = [d.split('.')[0] for d in i[0].split("\n")] @@ -120,15 +120,15 @@ class NamingSeries(Document): throw('Special Characters except "-" and "/" not allowed in naming series') def get_options(self, arg=''): - sr = frappe.model.doctype.get_property(self.doc.select_doc_for_series, + sr = frappe.model.doctype.get_property(self.select_doc_for_series, 'options', 'naming_series') return sr def get_current(self, arg=None): """get series current""" - if self.doc.prefix: - self.doc.current_value = frappe.db.get_value("Series", - self.doc.prefix.split('.')[0], "current") + if self.prefix: + self.current_value = frappe.db.get_value("Series", + self.prefix.split('.')[0], "current") def insert_series(self, series): """insert series if missing""" @@ -136,11 +136,11 @@ class NamingSeries(Document): frappe.db.sql("insert into tabSeries (name, current) values (%s, 0)", (series)) def update_series_start(self): - if self.doc.prefix: - prefix = self.doc.prefix.split('.')[0] + if self.prefix: + prefix = self.prefix.split('.')[0] self.insert_series(prefix) frappe.db.sql("update `tabSeries` set current = %s where name = %s", - (self.doc.current_value, prefix)) + (self.current_value, prefix)) msgprint(_("Series Updated Successfully")) else: msgprint(_("Please select prefix first")) diff --git a/erpnext/setup/doctype/notification_control/notification_control.py b/erpnext/setup/doctype/notification_control/notification_control.py index 21bdcced93..9557171f76 100644 --- a/erpnext/setup/doctype/notification_control/notification_control.py +++ b/erpnext/setup/doctype/notification_control/notification_control.py @@ -18,7 +18,7 @@ class NotificationControl(Document): return v and v[0][0] or '' def set_message(self, arg = ''): - fn = self.doc.select_transaction.lower().replace(' ', '_') + '_message' - frappe.db.set(self.doc, fn, self.doc.custom_message) - msgprint("Custom Message for %s updated!" % self.doc.select_transaction) + fn = self.select_transaction.lower().replace(' ', '_') + '_message' + frappe.db.set(self.doc, fn, self.custom_message) + msgprint("Custom Message for %s updated!" % self.select_transaction) diff --git a/erpnext/setup/doctype/sales_email_settings/sales_email_settings.py b/erpnext/setup/doctype/sales_email_settings/sales_email_settings.py index 01e9be41fc..88dc411a7c 100644 --- a/erpnext/setup/doctype/sales_email_settings/sales_email_settings.py +++ b/erpnext/setup/doctype/sales_email_settings/sales_email_settings.py @@ -13,8 +13,8 @@ from frappe.model.document import Document class SalesEmailSettings(Document): def validate(self): - if cint(self.doc.extract_emails) and not (self.doc.email_id and self.doc.host and \ - self.doc.username and self.doc.password): + if cint(self.extract_emails) and not (self.email_id and self.host and \ + self.username and self.password): frappe.msgprint(_("""Host, Email and Password required if emails are to be pulled"""), raise_exception=True) \ No newline at end of file diff --git a/erpnext/setup/doctype/sales_partner/sales_partner.py b/erpnext/setup/doctype/sales_partner/sales_partner.py index 5e3e569968..a7449abaab 100644 --- a/erpnext/setup/doctype/sales_partner/sales_partner.py +++ b/erpnext/setup/doctype/sales_partner/sales_partner.py @@ -8,8 +8,8 @@ from frappe.model.document import Document class SalesPartner(Document): def validate(self): - if self.doc.partner_website and not self.doc.partner_website.startswith("http"): - self.doc.partner_website = "http://" + self.doc.partner_website + if self.partner_website and not self.partner_website.startswith("http"): + self.partner_website = "http://" + self.partner_website def get_contacts(self, nm): if nm: @@ -21,4 +21,4 @@ class SalesPartner(Document): return '' def get_page_title(self): - return self.doc.partner_name + return self.partner_name diff --git a/erpnext/setup/doctype/sales_person/sales_person.py b/erpnext/setup/doctype/sales_person/sales_person.py index b128d2c430..9139bab259 100644 --- a/erpnext/setup/doctype/sales_person/sales_person.py +++ b/erpnext/setup/doctype/sales_person/sales_person.py @@ -20,9 +20,9 @@ class SalesPerson(DocTypeNestedSet): self.validate_one_root() def get_email_id(self): - if self.doc.employee: - user = frappe.db.get_value("Employee", self.doc.employee, "user_id") + if self.employee: + user = frappe.db.get_value("Employee", self.employee, "user_id") if not user: - frappe.throw("User ID not set for Employee %s" % self.doc.employee) + frappe.throw("User ID not set for Employee %s" % self.employee) else: return frappe.db.get_value("User", user, "email") or user \ No newline at end of file diff --git a/erpnext/setup/install.py b/erpnext/setup/install.py index ae81fbd3e4..9fe243d966 100644 --- a/erpnext/setup/install.py +++ b/erpnext/setup/install.py @@ -114,8 +114,8 @@ def import_defaults(): bean = frappe.bean(r) # ignore mandatory for root - parent_link_field = ("parent_" + scrub(bean.doc.doctype)) - if parent_link_field in bean.doc.fields and not bean.doc.fields.get(parent_link_field): + parent_link_field = ("parent_" + scrub(bean.doctype)) + if parent_link_field in bean.fields and not bean.get(parent_link_field): bean.ignore_mandatory = True bean.insert() @@ -133,7 +133,7 @@ def feature_setup(): 'fs_recurring_invoice', 'fs_pos', 'fs_manufacturing', 'fs_quality', 'fs_page_break', 'fs_more_info', 'fs_pos_view' ] - bean.doc.fields.update(dict(zip(flds, [1]*len(flds)))) + bean.update(dict(zip(flds, [1]*len(flds)))) bean.save() def set_single_defaults(): @@ -144,7 +144,7 @@ def set_single_defaults(): try: b = frappe.bean(dt, dt) for fieldname, value in default_values: - b.doc.fields[fieldname] = value + b.set(fieldname, value) b.save() except frappe.MandatoryError: pass diff --git a/erpnext/setup/page/setup_wizard/setup_wizard.py b/erpnext/setup/page/setup_wizard/setup_wizard.py index b03eeaec07..917cfd14b1 100644 --- a/erpnext/setup/page/setup_wizard/setup_wizard.py +++ b/erpnext/setup/page/setup_wizard/setup_wizard.py @@ -117,7 +117,7 @@ def set_defaults(args): frappe.db.set_value("Currency", args.get("currency"), "enabled", 1) global_defaults = frappe.bean("Global Defaults", "Global Defaults") - global_defaults.doc.fields.update({ + global_defaults.update({ 'current_fiscal_year': args.curr_fiscal_year, 'default_currency': args.get('currency'), 'default_company':args.get('company_name'), @@ -129,41 +129,41 @@ def set_defaults(args): global_defaults.save() accounts_settings = frappe.bean("Accounts Settings") - accounts_settings.doc.auto_accounting_for_stock = 1 + accounts_settings.auto_accounting_for_stock = 1 accounts_settings.save() stock_settings = frappe.bean("Stock Settings") - stock_settings.doc.item_naming_by = "Item Code" - stock_settings.doc.valuation_method = "FIFO" - stock_settings.doc.stock_uom = "Nos" - stock_settings.doc.auto_indent = 1 + stock_settings.item_naming_by = "Item Code" + stock_settings.valuation_method = "FIFO" + stock_settings.stock_uom = "Nos" + stock_settings.auto_indent = 1 stock_settings.save() selling_settings = frappe.bean("Selling Settings") - selling_settings.doc.cust_master_name = "Customer Name" - selling_settings.doc.so_required = "No" - selling_settings.doc.dn_required = "No" + selling_settings.cust_master_name = "Customer Name" + selling_settings.so_required = "No" + selling_settings.dn_required = "No" selling_settings.save() buying_settings = frappe.bean("Buying Settings") - buying_settings.doc.supp_master_name = "Supplier Name" - buying_settings.doc.po_required = "No" - buying_settings.doc.pr_required = "No" - buying_settings.doc.maintain_same_rate = 1 + buying_settings.supp_master_name = "Supplier Name" + buying_settings.po_required = "No" + buying_settings.pr_required = "No" + buying_settings.maintain_same_rate = 1 buying_settings.save() notification_control = frappe.bean("Notification Control") - notification_control.doc.quotation = 1 - notification_control.doc.sales_invoice = 1 - notification_control.doc.purchase_order = 1 + notification_control.quotation = 1 + notification_control.sales_invoice = 1 + notification_control.purchase_order = 1 notification_control.save() hr_settings = frappe.bean("HR Settings") - hr_settings.doc.emp_created_by = "Naming Series" + hr_settings.emp_created_by = "Naming Series" hr_settings.save() email_settings = frappe.bean("Outgoing Email Settings") - email_settings.doc.send_print_in_body_and_attachment = 1 + email_settings.send_print_in_body_and_attachment = 1 email_settings.save() # control panel @@ -196,14 +196,14 @@ def create_email_digest(): for fieldname in edigest.meta.get_fieldnames({"fieldtype": "Check"}): if fieldname != "scheduler_errors": - edigest.doc.fields[fieldname] = 1 + edigest.set(fieldname, 1) edigest.insert() # scheduler errors digest if companies: edigest = frappe.new_bean("Email Digest") - edigest.doc.fields.update({ + edigest.update({ "name": "Scheduler Errors", "company": companies[0], "frequency": "Daily", diff --git a/erpnext/startup/boot.py b/erpnext/startup/boot.py index 4b47398fb5..fdc20fabdf 100644 --- a/erpnext/startup/boot.py +++ b/erpnext/startup/boot.py @@ -11,7 +11,7 @@ def boot_session(bootinfo): import frappe.model.doc bootinfo['custom_css'] = frappe.db.get_value('Style Settings', None, 'custom_css') or '' - bootinfo['website_settings'] = frappe.model.doc.getsingle('Website Settings') + bootinfo['website_settings'] = frappe.model.getsingle('Website Settings') if frappe.session['user']!='Guest': bootinfo['letter_heads'] = get_letter_heads() diff --git a/erpnext/stock/doctype/bin/bin.py b/erpnext/stock/doctype/bin/bin.py index 0587f47160..4cc02ab853 100644 --- a/erpnext/stock/doctype/bin/bin.py +++ b/erpnext/stock/doctype/bin/bin.py @@ -14,19 +14,19 @@ from frappe.model.document import Document class Bin(Document): def validate(self): - if self.doc.fields.get("__islocal") or not self.doc.stock_uom: - self.doc.stock_uom = frappe.db.get_value('Item', self.doc.item_code, 'stock_uom') + if self.get("__islocal") or not self.stock_uom: + self.stock_uom = frappe.db.get_value('Item', self.item_code, 'stock_uom') self.validate_mandatory() - self.doc.projected_qty = flt(self.doc.actual_qty) + flt(self.doc.ordered_qty) + \ - flt(self.doc.indented_qty) + flt(self.doc.planned_qty) - flt(self.doc.reserved_qty) + self.projected_qty = flt(self.actual_qty) + flt(self.ordered_qty) + \ + flt(self.indented_qty) + flt(self.planned_qty) - flt(self.reserved_qty) def validate_mandatory(self): qf = ['actual_qty', 'reserved_qty', 'ordered_qty', 'indented_qty'] for f in qf: - if (not self.doc.fields.has_key(f)) or (not self.doc.fields[f]): - self.doc.fields[f] = 0.0 + if (not self.has_key(f)) or (not self.fields[f]): + self.set(f, 0.0) def update_stock(self, args): self.update_qty(args) @@ -39,24 +39,24 @@ class Bin(Document): # update valuation and qty after transaction for post dated entry update_entries_after({ - "item_code": self.doc.item_code, - "warehouse": self.doc.warehouse, + "item_code": self.item_code, + "warehouse": self.warehouse, "posting_date": args.get("posting_date"), "posting_time": args.get("posting_time") }) def update_qty(self, args): # update the stock values (for current quantities) - self.doc.actual_qty = flt(self.doc.actual_qty) + flt(args.get("actual_qty")) - self.doc.ordered_qty = flt(self.doc.ordered_qty) + flt(args.get("ordered_qty")) - self.doc.reserved_qty = flt(self.doc.reserved_qty) + flt(args.get("reserved_qty")) - self.doc.indented_qty = flt(self.doc.indented_qty) + flt(args.get("indented_qty")) - self.doc.planned_qty = flt(self.doc.planned_qty) + flt(args.get("planned_qty")) + self.actual_qty = flt(self.actual_qty) + flt(args.get("actual_qty")) + self.ordered_qty = flt(self.ordered_qty) + flt(args.get("ordered_qty")) + self.reserved_qty = flt(self.reserved_qty) + flt(args.get("reserved_qty")) + self.indented_qty = flt(self.indented_qty) + flt(args.get("indented_qty")) + self.planned_qty = flt(self.planned_qty) + flt(args.get("planned_qty")) - self.doc.projected_qty = flt(self.doc.actual_qty) + flt(self.doc.ordered_qty) + \ - flt(self.doc.indented_qty) + flt(self.doc.planned_qty) - flt(self.doc.reserved_qty) + self.projected_qty = flt(self.actual_qty) + flt(self.ordered_qty) + \ + flt(self.indented_qty) + flt(self.planned_qty) - flt(self.reserved_qty) - self.doc.save() + self.save() def get_first_sle(self): sle = frappe.db.sql(""" @@ -65,5 +65,5 @@ class Bin(Document): and warehouse = %s order by timestamp(posting_date, posting_time) asc, name asc limit 1 - """, (self.doc.item_code, self.doc.warehouse), as_dict=1) + """, (self.item_code, self.warehouse), as_dict=1) return sle and sle[0] or None \ No newline at end of file diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index 8d91e490db..617a883594 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -32,13 +32,13 @@ class DeliveryNote(SellingController): def onload(self): billed_qty = frappe.db.sql("""select sum(ifnull(qty, 0)) from `tabSales Invoice Item` - where docstatus=1 and delivery_note=%s""", self.doc.name) + where docstatus=1 and delivery_note=%s""", self.name) if billed_qty: total_qty = sum((item.qty for item in self.get("delivery_note_details"))) - self.doc.fields["__billing_complete"] = billed_qty[0][0] == total_qty + self.set("__billing_complete", billed_qty[0][0] == total_qty) def get_portal_page(self): - return "shipment" if self.doc.docstatus==1 else None + return "shipment" if self.docstatus==1 else None def set_actual_qty(self): for d in self.get('delivery_note_details'): @@ -60,7 +60,7 @@ class DeliveryNote(SellingController): super(DocType, self).validate() from erpnext.utilities import validate_status - validate_status(self.doc.status, ["Draft", "Submitted", "Cancelled"]) + validate_status(self.status, ["Draft", "Submitted", "Cancelled"]) self.so_required() self.validate_proj_cust() @@ -74,8 +74,8 @@ class DeliveryNote(SellingController): from erpnext.stock.doctype.packed_item.packed_item import make_packing_list self.doclist = make_packing_list(self, 'delivery_note_details') - self.doc.status = 'Draft' - if not self.doc.installation_status: self.doc.installation_status = 'Not Installed' + self.status = 'Draft' + if not self.installation_status: self.installation_status = 'Not Installed' def validate_with_previous_doc(self): items = self.get("delivery_note_details") @@ -101,12 +101,12 @@ class DeliveryNote(SellingController): def validate_proj_cust(self): """check for does customer belong to same project as entered..""" - if self.doc.project_name and self.doc.customer: + if self.project_name and self.customer: res = frappe.db.sql("""select name from `tabProject` where name = %s and (customer = %s or - ifnull(customer,'')='')""", (self.doc.project_name, self.doc.customer)) + ifnull(customer,'')='')""", (self.project_name, self.customer)) if not res: - msgprint("Customer - %s does not belong to project - %s. \n\nIf you want to use project for multiple customers then please make customer details blank in project - %s."%(self.doc.customer,self.doc.project_name,self.doc.project_name)) + msgprint("Customer - %s does not belong to project - %s. \n\nIf you want to use project for multiple customers then please make customer details blank in project - %s."%(self.customer,self.project_name,self.project_name)) raise Exception def validate_for_items(self): @@ -150,7 +150,7 @@ class DeliveryNote(SellingController): self.validate_packed_qty() # Check for Approving Authority - get_obj('Authorization Control').validate_approving_authority(self.doc.doctype, self.doc.company, self.doc.grand_total, self) + get_obj('Authorization Control').validate_approving_authority(self.doctype, self.company, self.grand_total, self) # update delivered qty in sales order self.update_prevdoc_status() @@ -183,17 +183,17 @@ class DeliveryNote(SellingController): """ Validate that if packed qty exists, it should be equal to qty """ - if not any([flt(d.fields.get('packed_qty')) for d in self.doclist if + if not any([flt(d.get('packed_qty')) for d in self.doclist if d.doctype=='Delivery Note Item']): return packing_error_list = [] for d in self.doclist: if d.doctype != 'Delivery Note Item': continue - if flt(d.fields.get('qty')) != flt(d.fields.get('packed_qty')): + if flt(d.get('qty')) != flt(d.get('packed_qty')): packing_error_list.append([ - d.fields.get('item_code', ''), - d.fields.get('qty', 0), - d.fields.get('packed_qty', 0) + d.get('item_code', ''), + d.get('qty', 0), + d.get('packed_qty', 0) ]) if packing_error_list: err_msg = "\n".join([("Item: " + d[0] + ", Qty: " + cstr(d[1]) \ @@ -204,7 +204,7 @@ class DeliveryNote(SellingController): submit_rv = frappe.db.sql("""select t1.name from `tabSales Invoice` t1,`tabSales Invoice Item` t2 where t1.name = t2.parent and t2.delivery_note = %s and t1.docstatus = 1""", - (self.doc.name)) + (self.name)) if submit_rv: msgprint("Sales Invoice : " + cstr(submit_rv[0][0]) + " has already been submitted !") raise Exception , "Validation Error." @@ -212,7 +212,7 @@ class DeliveryNote(SellingController): submit_in = frappe.db.sql("""select t1.name from `tabInstallation Note` t1, `tabInstallation Note Item` t2 where t1.name = t2.parent and t2.prevdoc_docname = %s and t1.docstatus = 1""", - (self.doc.name)) + (self.name)) if submit_in: msgprint("Installation Note : "+cstr(submit_in[0][0]) +" has already been submitted !") raise Exception , "Validation Error." @@ -222,7 +222,7 @@ class DeliveryNote(SellingController): Cancel submitted packing slips related to this delivery note """ res = frappe.db.sql("""SELECT name FROM `tabPacking Slip` WHERE delivery_note = %s - AND docstatus = 1""", self.doc.name) + AND docstatus = 1""", self.name) if res: from frappe.model.bean import Bean @@ -254,11 +254,11 @@ class DeliveryNote(SellingController): args = { "item_code": d['item_code'], "warehouse": d["reserved_warehouse"], - "voucher_type": self.doc.doctype, - "voucher_no": self.doc.name, - "reserved_qty": (self.doc.docstatus==1 and 1 or -1)*flt(d['reserved_qty']), - "posting_date": self.doc.posting_date, - "is_amended": self.doc.amended_from and 'Yes' or 'No' + "voucher_type": self.doctype, + "voucher_no": self.name, + "reserved_qty": (self.docstatus==1 and 1 or -1)*flt(d['reserved_qty']), + "posting_date": self.posting_date, + "is_amended": self.amended_from and 'Yes' or 'No' } update_bin(args) @@ -269,7 +269,7 @@ class DeliveryNote(SellingController): if not (d.against_sales_order or d.against_sales_invoice): amount += d.base_amount if amount != 0: - total = (amount/self.doc.net_total)*self.doc.grand_total + total = (amount/self.net_total)*self.grand_total self.check_credit(total) def get_invoiced_qty_map(delivery_note): @@ -290,7 +290,7 @@ def make_sales_invoice(source_name, target_doclist=None): def update_accounts(source, target): si = frappe.bean(target) - si.doc.is_pos = 0 + si.is_pos = 0 si.run_method("onload_post_render") si.set_doclist(si.doclist.get({"parentfield": ["!=", "entries"]}) + diff --git a/erpnext/stock/doctype/delivery_note/test_delivery_note.py b/erpnext/stock/doctype/delivery_note/test_delivery_note.py index 1ad65070a8..4c6af1b1f1 100644 --- a/erpnext/stock/doctype/delivery_note/test_delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/test_delivery_note.py @@ -28,11 +28,11 @@ class TestDeliveryNote(unittest.TestCase): dn = frappe.bean(copy=test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_sales_invoice, - dn.doc.name) + dn.name) - dn = frappe.bean("Delivery Note", dn.doc.name) + dn = frappe.bean("Delivery Note", dn.name) dn.submit() - si = make_sales_invoice(dn.doc.name) + si = make_sales_invoice(dn.name) self.assertEquals(len(si), len(dn.doclist)) @@ -53,12 +53,12 @@ class TestDeliveryNote(unittest.TestCase): dn.submit() stock_value, stock_value_difference = frappe.db.get_value("Stock Ledger Entry", - {"voucher_type": "Delivery Note", "voucher_no": dn.doc.name, + {"voucher_type": "Delivery Note", "voucher_no": dn.name, "item_code": "_Test Item"}, ["stock_value", "stock_value_difference"]) self.assertEqual(stock_value, 0) self.assertEqual(stock_value_difference, -375) - self.assertFalse(get_gl_entries("Delivery Note", dn.doc.name)) + self.assertFalse(get_gl_entries("Delivery Note", dn.name)) def test_delivery_note_gl_entry(self): self.clear_stock_account_balance() @@ -76,12 +76,12 @@ class TestDeliveryNote(unittest.TestCase): {"master_name": dn.doclist[1].warehouse}) from erpnext.accounts.utils import get_balance_on - prev_bal = get_balance_on(stock_in_hand_account, dn.doc.posting_date) + prev_bal = get_balance_on(stock_in_hand_account, dn.posting_date) dn.insert() dn.submit() - gl_entries = get_gl_entries("Delivery Note", dn.doc.name) + gl_entries = get_gl_entries("Delivery Note", dn.name) self.assertTrue(gl_entries) expected_values = { stock_in_hand_account: [0.0, 375.0], @@ -91,19 +91,19 @@ class TestDeliveryNote(unittest.TestCase): self.assertEquals([gle.debit, gle.credit], expected_values.get(gle.account)) # check stock in hand balance - bal = get_balance_on(stock_in_hand_account, dn.doc.posting_date) + bal = get_balance_on(stock_in_hand_account, dn.posting_date) self.assertEquals(bal, prev_bal - 375.0) # back dated purchase receipt pr = frappe.bean(copy=pr_test_records[0]) - pr.doc.posting_date = "2013-01-01" + pr.posting_date = "2013-01-01" pr.doclist[1].rate = 100 pr.doclist[1].base_amount = 100 pr.insert() pr.submit() - gl_entries = get_gl_entries("Delivery Note", dn.doc.name) + gl_entries = get_gl_entries("Delivery Note", dn.name) self.assertTrue(gl_entries) expected_values = { stock_in_hand_account: [0.0, 666.67], @@ -113,7 +113,7 @@ class TestDeliveryNote(unittest.TestCase): self.assertEquals([gle.debit, gle.credit], expected_values.get(gle.account)) dn.cancel() - self.assertFalse(get_gl_entries("Delivery Note", dn.doc.name)) + self.assertFalse(get_gl_entries("Delivery Note", dn.name)) set_perpetual_inventory(0) def test_delivery_note_gl_entry_packing_item(self): @@ -131,12 +131,12 @@ class TestDeliveryNote(unittest.TestCase): {"master_name": dn.doclist[1].warehouse}) from erpnext.accounts.utils import get_balance_on - prev_bal = get_balance_on(stock_in_hand_account, dn.doc.posting_date) + prev_bal = get_balance_on(stock_in_hand_account, dn.posting_date) dn.insert() dn.submit() - gl_entries = get_gl_entries("Delivery Note", dn.doc.name) + gl_entries = get_gl_entries("Delivery Note", dn.name) self.assertTrue(gl_entries) expected_values = { @@ -147,11 +147,11 @@ class TestDeliveryNote(unittest.TestCase): self.assertEquals([gle.debit, gle.credit], expected_values.get(gle.account)) # check stock in hand balance - bal = get_balance_on(stock_in_hand_account, dn.doc.posting_date) + bal = get_balance_on(stock_in_hand_account, dn.posting_date) self.assertEquals(bal, prev_bal - 525.0) dn.cancel() - self.assertFalse(get_gl_entries("Delivery Note", dn.doc.name)) + self.assertFalse(get_gl_entries("Delivery Note", dn.name)) set_perpetual_inventory(0) @@ -172,7 +172,7 @@ class TestDeliveryNote(unittest.TestCase): self.assertEquals(frappe.db.get_value("Serial No", serial_nos[0], "status"), "Delivered") self.assertFalse(frappe.db.get_value("Serial No", serial_nos[0], "warehouse")) self.assertEquals(frappe.db.get_value("Serial No", serial_nos[0], - "delivery_document_no"), dn.doc.name) + "delivery_document_no"), dn.name) return dn @@ -196,7 +196,7 @@ class TestDeliveryNote(unittest.TestCase): serial_nos = get_serial_nos(se.doclist[1].serial_no) sr = frappe.bean("Serial No", serial_nos[0]) - sr.doc.status = "Not Available" + sr.status = "Not Available" sr.save() dn = frappe.bean(copy=test_records[0]) diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index 2074925e8c..9f556db2a1 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -14,19 +14,19 @@ class WarehouseNotSet(Exception): pass class Item(DocListController): def onload(self): - self.doc.fields["__sle_exists"] = self.check_if_sle_exists() + self.set("__sle_exists", self.check_if_sle_exists()) def autoname(self): if frappe.db.get_default("item_naming_by")=="Naming Series": from frappe.model.naming import make_autoname - self.doc.item_code = make_autoname(self.doc.naming_series+'.#####') - elif not self.doc.item_code: + self.item_code = make_autoname(self.naming_series+'.#####') + elif not self.item_code: msgprint(_("Item Code (item_code) is mandatory because Item naming is not sequential."), raise_exception=1) - self.doc.name = self.doc.item_code + self.name = self.item_code def validate(self): - if not self.doc.stock_uom: + if not self.stock_uom: msgprint(_("Please enter Default Unit of Measure"), raise_exception=1) self.check_warehouse_is_set_for_stock_item() @@ -41,53 +41,53 @@ class Item(DocListController): self.cant_change() self.validate_item_type_for_reorder() - if not self.doc.parent_website_route: - self.doc.parent_website_route = frappe.get_website_route("Item Group", self.doc.item_group) + if not self.parent_website_route: + self.parent_website_route = frappe.get_website_route("Item Group", self.item_group) - if self.doc.name: - self.old_page_name = frappe.db.get_value('Item', self.doc.name, 'page_name') + if self.name: + self.old_page_name = frappe.db.get_value('Item', self.name, 'page_name') def on_update(self): self.validate_name_with_item_group() self.update_item_price() def check_warehouse_is_set_for_stock_item(self): - if self.doc.is_stock_item=="Yes" and not self.doc.default_warehouse: + if self.is_stock_item=="Yes" and not self.default_warehouse: frappe.msgprint(_("Default Warehouse is mandatory for Stock Item."), raise_exception=WarehouseNotSet) def add_default_uom_in_conversion_factor_table(self): uom_conv_list = [d.uom for d in self.get("uom_conversion_details")] - if self.doc.stock_uom not in uom_conv_list: - ch = self.doc.append('uom_conversion_details', {}) - ch.uom = self.doc.stock_uom + if self.stock_uom not in uom_conv_list: + ch = self.append('uom_conversion_details', {}) + ch.uom = self.stock_uom ch.conversion_factor = 1 for d in self.get("uom_conversion_details"): - if d.conversion_factor == 1 and d.uom != self.doc.stock_uom: + if d.conversion_factor == 1 and d.uom != self.stock_uom: self.doclist.remove(d) def check_stock_uom_with_bin(self): - if not self.doc.fields.get("__islocal"): + if not self.get("__islocal"): matched=True ref_uom = frappe.db.get_value("Stock Ledger Entry", - {"item_code": self.doc.name}, "stock_uom") + {"item_code": self.name}, "stock_uom") if ref_uom: - if cstr(ref_uom) != cstr(self.doc.stock_uom): + if cstr(ref_uom) != cstr(self.stock_uom): matched = False else: bin_list = frappe.db.sql("select * from tabBin where item_code=%s", - self.doc.item_code, as_dict=1) + self.item_code, as_dict=1) for bin in bin_list: if (bin.reserved_qty > 0 or bin.ordered_qty > 0 or bin.indented_qty > 0 \ - or bin.planned_qty > 0) and cstr(bin.stock_uom) != cstr(self.doc.stock_uom): + or bin.planned_qty > 0) and cstr(bin.stock_uom) != cstr(self.stock_uom): matched = False break if matched and bin_list: frappe.db.sql("""update tabBin set stock_uom=%s where item_code=%s""", - (self.doc.stock_uom, self.doc.name)) + (self.stock_uom, self.name)) if not matched: frappe.throw(_("Default Unit of Measure can not be changed directly because you have already made some transaction(s) with another UOM. To change default UOM, use 'UOM Replace Utility' tool under Stock module.")) @@ -101,38 +101,38 @@ class Item(DocListController): else: check_list.append(cstr(d.uom)) - if d.uom and cstr(d.uom) == cstr(self.doc.stock_uom) and flt(d.conversion_factor) != 1: + if d.uom and cstr(d.uom) == cstr(self.stock_uom) and flt(d.conversion_factor) != 1: msgprint(_("""Conversion Factor of UOM: %s should be equal to 1. As UOM: %s is Stock UOM of Item: %s.""" % - (d.uom, d.uom, self.doc.name)), raise_exception=1) - elif d.uom and cstr(d.uom)!= self.doc.stock_uom and flt(d.conversion_factor) == 1: + (d.uom, d.uom, self.name)), raise_exception=1) + elif d.uom and cstr(d.uom)!= self.stock_uom and flt(d.conversion_factor) == 1: msgprint(_("""Conversion Factor of UOM: %s should not be equal to 1. As UOM: %s is not Stock UOM of Item: %s""" % - (d.uom, d.uom, self.doc.name)), raise_exception=1) + (d.uom, d.uom, self.name)), raise_exception=1) def validate_item_type(self): - if cstr(self.doc.is_manufactured_item) == "No": - self.doc.is_pro_applicable = "No" + if cstr(self.is_manufactured_item) == "No": + self.is_pro_applicable = "No" - if self.doc.is_pro_applicable == 'Yes' and self.doc.is_stock_item == 'No': + if self.is_pro_applicable == 'Yes' and self.is_stock_item == 'No': frappe.throw(_("As Production Order can be made for this item, \ it must be a stock item.")) - if self.doc.has_serial_no == 'Yes' and self.doc.is_stock_item == 'No': + if self.has_serial_no == 'Yes' and self.is_stock_item == 'No': msgprint("'Has Serial No' can not be 'Yes' for non-stock item", raise_exception=1) def check_for_active_boms(self): - if self.doc.is_purchase_item != "Yes": + if self.is_purchase_item != "Yes": bom_mat = frappe.db.sql("""select distinct t1.parent from `tabBOM Item` t1, `tabBOM` t2 where t2.name = t1.parent and t1.item_code =%s and ifnull(t1.bom_no, '') = '' and t2.is_active = 1 - and t2.docstatus = 1 and t1.docstatus =1 """, self.doc.name) + and t2.docstatus = 1 and t1.docstatus =1 """, self.name) if bom_mat and bom_mat[0][0]: frappe.throw(_("Item must be a purchase item, \ as it is present in one or many Active BOMs")) - if self.doc.is_manufactured_item != "Yes": + if self.is_manufactured_item != "Yes": bom = frappe.db.sql("""select name from `tabBOM` where item = %s - and is_active = 1""", (self.doc.name,)) + and is_active = 1""", (self.name,)) if bom and bom[0][0]: frappe.throw(_("""Allow Bill of Materials should be 'Yes'. Because one or many \ active BOMs present for this item""")) @@ -142,7 +142,7 @@ class Item(DocListController): cust_code=[] for d in self.get('item_customer_details'): cust_code.append(d.ref_code) - self.doc.customer_code=','.join(cust_code) + self.customer_code=','.join(cust_code) def check_item_tax(self): """Check whether Tax Rate is not entered twice for same Tax Type""" @@ -160,53 +160,53 @@ class Item(DocListController): check_list.append(d.tax_type) def validate_barcode(self): - if self.doc.barcode: + if self.barcode: duplicate = frappe.db.sql("""select name from tabItem where barcode = %s - and name != %s""", (self.doc.barcode, self.doc.name)) + and name != %s""", (self.barcode, self.name)) if duplicate: msgprint("Barcode: %s already used in item: %s" % - (self.doc.barcode, cstr(duplicate[0][0])), raise_exception = 1) + (self.barcode, cstr(duplicate[0][0])), raise_exception = 1) def cant_change(self): - if not self.doc.fields.get("__islocal"): - vals = frappe.db.get_value("Item", self.doc.name, + if not self.get("__islocal"): + vals = frappe.db.get_value("Item", self.name, ["has_serial_no", "is_stock_item", "valuation_method"], as_dict=True) - if vals and ((self.doc.is_stock_item == "No" and vals.is_stock_item == "Yes") or - vals.has_serial_no != self.doc.has_serial_no or - cstr(vals.valuation_method) != cstr(self.doc.valuation_method)): + if vals and ((self.is_stock_item == "No" and vals.is_stock_item == "Yes") or + vals.has_serial_no != self.has_serial_no or + cstr(vals.valuation_method) != cstr(self.valuation_method)): if self.check_if_sle_exists() == "exists": frappe.throw(_("As there are existing stock transactions for this item, you can not change the values of 'Has Serial No', 'Is Stock Item' and 'Valuation Method'")) def validate_item_type_for_reorder(self): - if self.doc.re_order_level or len(self.doclist.get({"parentfield": "item_reorder", + if self.re_order_level or len(self.doclist.get({"parentfield": "item_reorder", "material_request_type": "Purchase"})): - if not self.doc.is_purchase_item: + if not self.is_purchase_item: frappe.msgprint(_("""To set reorder level, item must be Purchase Item"""), raise_exception=1) def check_if_sle_exists(self): sle = frappe.db.sql("""select name from `tabStock Ledger Entry` - where item_code = %s""", self.doc.name) + where item_code = %s""", self.name) return sle and 'exists' or 'not exists' def validate_name_with_item_group(self): # causes problem with tree build - if frappe.db.exists("Item Group", self.doc.name): + if frappe.db.exists("Item Group", self.name): frappe.msgprint("An item group exists with same name (%s), \ please change the item name or rename the item group" % - self.doc.name, raise_exception=1) + self.name, raise_exception=1) def update_item_price(self): frappe.db.sql("""update `tabItem Price` set item_name=%s, item_description=%s, modified=NOW() where item_code=%s""", - (self.doc.item_name, self.doc.description, self.doc.name)) + (self.item_name, self.description, self.name)) def get_page_title(self): - if self.doc.name==self.doc.item_name: - page_name_from = self.doc.name + if self.name==self.item_name: + page_name_from = self.name else: - page_name_from = self.doc.name + " " + self.doc.item_name + page_name_from = self.name + " " + self.item_name return page_name_from @@ -223,7 +223,7 @@ class Item(DocListController): return ret def on_trash(self): - frappe.db.sql("""delete from tabBin where item_code=%s""", self.doc.item_code) + frappe.db.sql("""delete from tabBin where item_code=%s""", self.item_code) def before_rename(self, olddn, newdn, merge=False): if merge: @@ -233,7 +233,7 @@ class Item(DocListController): field_list = ["stock_uom", "is_stock_item", "has_serial_no", "has_batch_no"] new_properties = [cstr(d) for d in frappe.db.get_value("Item", newdn, field_list)] - if new_properties != [cstr(self.doc.fields[fld]) for fld in field_list]: + if new_properties != [cstr(self.fields[fld]) for fld in field_list]: frappe.throw(_("To merge, following properties must be same for both items") + ": \n" + ", ".join([self.meta.get_label(fld) for fld in field_list])) diff --git a/erpnext/stock/doctype/item/test_item.py b/erpnext/stock/doctype/item/test_item.py index e86b113212..8d99b2f952 100644 --- a/erpnext/stock/doctype/item/test_item.py +++ b/erpnext/stock/doctype/item/test_item.py @@ -14,8 +14,8 @@ class TestItem(unittest.TestCase): def test_default_warehouse(self): from erpnext.stock.doctype.item.item import WarehouseNotSet item = frappe.bean(copy=test_records[0]) - item.doc.is_stock_item = "Yes" - item.doc.default_warehouse = None + item.is_stock_item = "Yes" + item.default_warehouse = None self.assertRaises(WarehouseNotSet, item.insert) def test_get_item_details(self): diff --git a/erpnext/stock/doctype/item_price/item_price.py b/erpnext/stock/doctype/item_price/item_price.py index 3c3972bc78..8916628855 100644 --- a/erpnext/stock/doctype/item_price/item_price.py +++ b/erpnext/stock/doctype/item_price/item_price.py @@ -19,39 +19,39 @@ class ItemPrice(Document): self.update_item_details() def validate_item(self): - if not frappe.db.exists("Item", self.doc.item_code): + if not frappe.db.exists("Item", self.item_code): throw("{doctype}: {item} {not_found}".format(**{ "doctype": _("Item"), - "item": self.doc.item_code, + "item": self.item_code, "not_found": _(" not found") })) def validate_price_list(self): - enabled = frappe.db.get_value("Price List", self.doc.price_list, "enabled") + enabled = frappe.db.get_value("Price List", self.price_list, "enabled") if not enabled: throw("{message}: {price_list} {disabled}".format(**{ "message": _("Price List"), - "price_list": self.doc.price_list, + "price_list": self.price_list, "disabled": _("is disabled.") })) def check_duplicate_item(self): if frappe.db.sql("""select name from `tabItem Price` where item_code=%s and price_list=%s and name!=%s""", - (self.doc.item_code, self.doc.price_list, self.doc.name)): + (self.item_code, self.price_list, self.name)): throw("{duplicate_item}: {item_code}, {already}: {price_list}".format(**{ "duplicate_item": _("Duplicate Item"), - "item_code": self.doc.item_code, + "item_code": self.item_code, "already": _("already available in Price List"), - "price_list": self.doc.price_list + "price_list": self.price_list }), ItemPriceDuplicateItem) def update_price_list_details(self): - self.doc.buying, self.doc.selling, self.doc.currency = \ - frappe.db.get_value("Price List", {"name": self.doc.price_list, "enabled": 1}, + self.buying, self.selling, self.currency = \ + frappe.db.get_value("Price List", {"name": self.price_list, "enabled": 1}, ["buying", "selling", "currency"]) def update_item_details(self): - self.doc.item_name, self.doc.item_description = frappe.db.get_value("Item", - self.doc.item_code, ["item_name", "description"]) + self.item_name, self.item_description = frappe.db.get_value("Item", + self.item_code, ["item_name", "description"]) \ No newline at end of file diff --git a/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.py b/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.py index 34cbe3e2ea..2a80a4d571 100644 --- a/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.py +++ b/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.py @@ -38,7 +38,7 @@ class LandedCostWizard(Document): pr_items = pr_bean.get("purchase_tax_details") for lc in self.get("landed_cost_details"): - amt = flt(lc.amount) * flt(pr_bean.doc.net_total)/ flt(total_amt) + amt = flt(lc.amount) * flt(pr_bean.net_total)/ flt(total_amt) matched_row = pr_bean.doclist.get({ "parentfield": "other_charges", diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py index fda6849e21..76e6aa236b 100644 --- a/erpnext/stock/doctype/material_request/material_request.py +++ b/erpnext/stock/doctype/material_request/material_request.py @@ -37,7 +37,7 @@ class MaterialRequest(BuyingController): already_indented = frappe.db.sql("""select sum(ifnull(qty, 0)) from `tabMaterial Request Item` where item_code = %s and sales_order_no = %s and - docstatus = 1 and parent != %s""", (item, so_no, self.doc.name)) + docstatus = 1 and parent != %s""", (item, so_no, self.name)) already_indented = already_indented and flt(already_indented[0][0]) or 0 actual_so_qty = frappe.db.sql("""select sum(ifnull(qty, 0)) from `tabSales Order Item` @@ -51,7 +51,7 @@ class MaterialRequest(BuyingController): def validate_schedule_date(self): for d in self.get('indent_details'): - if d.schedule_date < self.doc.transaction_date: + if d.schedule_date < self.transaction_date: frappe.throw(_("Expected Date cannot be before Material Request Date")) # Validate @@ -62,11 +62,11 @@ class MaterialRequest(BuyingController): self.validate_schedule_date() self.validate_uom_is_integer("uom", "qty") - if not self.doc.status: - self.doc.status = "Draft" + if not self.status: + self.status = "Draft" from erpnext.utilities import validate_status - validate_status(self.doc.status, ["Draft", "Submitted", "Stopped", "Cancelled"]) + validate_status(self.status, ["Draft", "Submitted", "Stopped", "Cancelled"]) self.validate_value("material_request_type", "in", ["Purchase", "Transfer"]) @@ -95,7 +95,7 @@ class MaterialRequest(BuyingController): "item_code": d.item_code, "warehouse": d.warehouse, "indented_qty": (is_submit and 1 or -1) * flt(qty), - "posting_date": self.doc.transaction_date + "posting_date": self.transaction_date } update_bin(args) @@ -105,12 +105,12 @@ class MaterialRequest(BuyingController): def check_modified_date(self): mod_db = frappe.db.sql("""select modified from `tabMaterial Request` where name = %s""", - self.doc.name) + self.name) date_diff = frappe.db.sql("""select TIMEDIFF('%s', '%s')""" - % (mod_db[0][0], cstr(self.doc.modified))) + % (mod_db[0][0], cstr(self.modified))) if date_diff and date_diff[0][0]: - frappe.throw(cstr(self.doc.doctype) + " => " + cstr(self.doc.name) + " has been modified. Please Refresh.") + frappe.throw(cstr(self.doctype) + " => " + cstr(self.name) + " has been modified. Please Refresh.") def update_status(self, status): self.check_modified_date() @@ -121,7 +121,7 @@ class MaterialRequest(BuyingController): frappe.db.set(self.doc, 'status', cstr(status)) # Step 3:=> Acknowledge User - msgprint(self.doc.doctype + ": " + self.doc.name + " has been %s." % ((status == 'Submitted') and 'Unstopped' or cstr(status))) + msgprint(self.doctype + ": " + self.name + " has been %s." % ((status == 'Submitted') and 'Unstopped' or cstr(status))) def on_cancel(self): @@ -129,18 +129,18 @@ class MaterialRequest(BuyingController): pc_obj = get_obj(dt='Purchase Common') # Step 2:=> Check for stopped status - pc_obj.check_for_stopped_status(self.doc.doctype, self.doc.name) + pc_obj.check_for_stopped_status(self.doctype, self.name) # Step 3:=> Check if Purchase Order has been submitted against current Material Request - pc_obj.check_docstatus(check = 'Next', doctype = 'Purchase Order', docname = self.doc.name, detail_doctype = 'Purchase Order Item') + pc_obj.check_docstatus(check = 'Next', doctype = 'Purchase Order', docname = self.name, detail_doctype = 'Purchase Order Item') # Step 4:=> Update Bin - self.update_bin(is_submit = 0, is_stopped = (cstr(self.doc.status) == 'Stopped') and 1 or 0) + self.update_bin(is_submit = 0, is_stopped = (cstr(self.status) == 'Stopped') and 1 or 0) # Step 5:=> Set Status frappe.db.set(self.doc,'status','Cancelled') def update_completed_qty(self, mr_items=None): - if self.doc.material_request_type != "Transfer": + if self.material_request_type != "Transfer": return item_doclist = self.get("indent_details") @@ -154,7 +154,7 @@ class MaterialRequest(BuyingController): d.ordered_qty = flt(frappe.db.sql("""select sum(transfer_qty) from `tabStock Entry Detail` where material_request = %s and material_request_item = %s and docstatus = 1""", - (self.doc.name, d.name))[0][0]) + (self.name, d.name))[0][0]) frappe.db.set_value(d.doctype, d.name, "ordered_qty", d.ordered_qty) # note: if qty is 0, its row is still counted in len(item_doclist) @@ -164,11 +164,11 @@ class MaterialRequest(BuyingController): elif d.qty > 0: per_ordered += flt(d.ordered_qty / flt(d.qty)) - self.doc.per_ordered = flt((per_ordered / flt(len(item_doclist))) * 100.0, 2) - frappe.db.set_value(self.doc.doctype, self.doc.name, "per_ordered", self.doc.per_ordered) + self.per_ordered = flt((per_ordered / flt(len(item_doclist))) * 100.0, 2) + frappe.db.set_value(self.doctype, self.name, "per_ordered", self.per_ordered) def update_completed_qty(bean, method): - if bean.doc.doctype == "Stock Entry": + if bean.doctype == "Stock Entry": material_request_map = {} for d in bean.get("mtn_details"): @@ -179,9 +179,9 @@ def update_completed_qty(bean, method): mr_obj = frappe.get_obj("Material Request", mr_name, with_children=1) mr_doctype = frappe.get_meta("Material Request") - if mr_obj.doc.status in ["Stopped", "Cancelled"]: - frappe.throw(_("Material Request") + ": %s, " % mr_obj.doc.name - + _(mr_doctype.get_label("status")) + " = %s. " % _(mr_obj.doc.status) + if mr_obj.status in ["Stopped", "Cancelled"]: + frappe.throw(_("Material Request") + ": %s, " % mr_obj.name + + _(mr_doctype.get_label("status")) + " = %s. " % _(mr_obj.status) + _("Cannot continue."), exc=frappe.InvalidStatusError) _update_requested_qty(bean, mr_obj, mr_items) @@ -195,7 +195,7 @@ def _update_requested_qty(bean, mr_obj, mr_items): for mr_item_name in mr_items: mr_item = mr_obj.doclist.getone({"parentfield": "indent_details", "name": mr_item_name}) se_detail = bean.doclist.getone({"parentfield": "mtn_details", - "material_request": mr_obj.doc.name, "material_request_item": mr_item_name}) + "material_request": mr_obj.name, "material_request_item": mr_item_name}) mr_item.ordered_qty = flt(mr_item.ordered_qty) mr_item.qty = flt(mr_item.qty) @@ -214,7 +214,7 @@ def _update_requested_qty(bean, mr_obj, mr_items): "item_code": se_detail.item_code, "warehouse": se_detail.t_warehouse, "indented_qty": (se_detail.docstatus==2 and 1 or -1) * add_indented_qty, - "posting_date": bean.doc.posting_date, + "posting_date": bean.posting_date, }) def set_missing_values(source, target_doclist): @@ -270,7 +270,7 @@ def make_purchase_order_based_on_supplier(source_name, target_doclist=None): po_items = target_doclist.get({"parentfield": "po_details"}) target_doclist = target_doclist.get({"parentfield": ["!=", "po_details"]}) + \ [d for d in po_items - if d.fields.get("item_code") in supplier_items and d.fields.get("qty") > 0] + if d.get("item_code") in supplier_items and d.get("qty") > 0] return target_doclist diff --git a/erpnext/stock/doctype/material_request/test_material_request.py b/erpnext/stock/doctype/material_request/test_material_request.py index a41425bf85..f70f14c733 100644 --- a/erpnext/stock/doctype/material_request/test_material_request.py +++ b/erpnext/stock/doctype/material_request/test_material_request.py @@ -18,11 +18,11 @@ class TestMaterialRequest(unittest.TestCase): mr = frappe.bean(copy=test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_purchase_order, - mr.doc.name) + mr.name) - mr = frappe.bean("Material Request", mr.doc.name) + mr = frappe.bean("Material Request", mr.name) mr.submit() - po = make_purchase_order(mr.doc.name) + po = make_purchase_order(mr.name) self.assertEquals(po[0]["doctype"], "Purchase Order") self.assertEquals(len(po), len(mr.doclist)) @@ -33,11 +33,11 @@ class TestMaterialRequest(unittest.TestCase): mr = frappe.bean(copy=test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_supplier_quotation, - mr.doc.name) + mr.name) - mr = frappe.bean("Material Request", mr.doc.name) + mr = frappe.bean("Material Request", mr.name) mr.submit() - sq = make_supplier_quotation(mr.doc.name) + sq = make_supplier_quotation(mr.name) self.assertEquals(sq[0]["doctype"], "Supplier Quotation") self.assertEquals(len(sq), len(mr.doclist)) @@ -49,12 +49,12 @@ class TestMaterialRequest(unittest.TestCase): mr = frappe.bean(copy=test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_stock_entry, - mr.doc.name) + mr.name) - mr = frappe.bean("Material Request", mr.doc.name) - mr.doc.material_request_type = "Transfer" + mr = frappe.bean("Material Request", mr.name) + mr.material_request_type = "Transfer" mr.submit() - se = make_stock_entry(mr.doc.name) + se = make_stock_entry(mr.name) self.assertEquals(se[0]["doctype"], "Stock Entry") self.assertEquals(len(se), len(mr.doclist)) @@ -62,7 +62,7 @@ class TestMaterialRequest(unittest.TestCase): def _test_expected(self, doclist, expected_values): for i, expected in enumerate(expected_values): for fieldname, val in expected.items(): - self.assertEquals(val, doclist[i].fields.get(fieldname)) + self.assertEquals(val, doclist[i].get(fieldname)) def _test_requested_qty(self, qty1, qty2): self.assertEqual(flt(frappe.db.get_value("Bin", {"item_code": "_Test Item Home Desktop 100", @@ -123,7 +123,7 @@ class TestMaterialRequest(unittest.TestCase): # map a purchase order from erpnext.stock.doctype.material_request.material_request import make_purchase_order - po_doclist = make_purchase_order(mr.doc.name) + po_doclist = make_purchase_order(mr.name) po_doclist[0]["supplier"] = "_Test Supplier" po_doclist[0]["transaction_date"] = "2013-07-07" po_doclist[1]["qty"] = 27.0 @@ -161,7 +161,7 @@ class TestMaterialRequest(unittest.TestCase): # submit material request of type Purchase mr = frappe.bean(copy=test_records[0]) - mr.doc.material_request_type = "Transfer" + mr.material_request_type = "Transfer" mr.insert() mr.submit() @@ -173,7 +173,7 @@ class TestMaterialRequest(unittest.TestCase): from erpnext.stock.doctype.material_request.material_request import make_stock_entry # map a stock entry - se_doclist = make_stock_entry(mr.doc.name) + se_doclist = make_stock_entry(mr.name) se_doclist[0].update({ "posting_date": "2013-03-01", "posting_time": "01:00", @@ -224,7 +224,7 @@ class TestMaterialRequest(unittest.TestCase): # submit material request of type Purchase mr = frappe.bean(copy=test_records[0]) - mr.doc.material_request_type = "Transfer" + mr.material_request_type = "Transfer" mr.insert() mr.submit() @@ -236,7 +236,7 @@ class TestMaterialRequest(unittest.TestCase): # map a stock entry from erpnext.stock.doctype.material_request.material_request import make_stock_entry - se_doclist = make_stock_entry(mr.doc.name) + se_doclist = make_stock_entry(mr.name) se_doclist[0].update({ "posting_date": "2013-03-01", "posting_time": "00:00", @@ -284,14 +284,14 @@ class TestMaterialRequest(unittest.TestCase): def test_incorrect_mapping_of_stock_entry(self): # submit material request of type Purchase mr = frappe.bean(copy=test_records[0]) - mr.doc.material_request_type = "Transfer" + mr.material_request_type = "Transfer" mr.insert() mr.submit() # map a stock entry from erpnext.stock.doctype.material_request.material_request import make_stock_entry - se_doclist = make_stock_entry(mr.doc.name) + se_doclist = make_stock_entry(mr.name) se_doclist[0].update({ "posting_date": "2013-03-01", "posting_time": "00:00", @@ -318,7 +318,7 @@ class TestMaterialRequest(unittest.TestCase): def test_warehouse_company_validation(self): from erpnext.stock.utils import InvalidWarehouseCompany mr = frappe.bean(copy=test_records[0]) - mr.doc.company = "_Test Company 1" + mr.company = "_Test Company 1" self.assertRaises(InvalidWarehouseCompany, mr.insert) test_dependencies = ["Currency Exchange"] diff --git a/erpnext/stock/doctype/packed_item/packed_item.py b/erpnext/stock/doctype/packed_item/packed_item.py index b7a15b7c89..6c7ee517bb 100644 --- a/erpnext/stock/doctype/packed_item/packed_item.py +++ b/erpnext/stock/doctype/packed_item/packed_item.py @@ -38,7 +38,7 @@ def update_packing_list_item(obj, packing_item_code, qty, warehouse, line, packi break if not exists: - pi = obj.doc.append('packing_details', {}) + pi = obj.append('packing_details', {}) pi.parent_item = line.item_code pi.item_code = packing_item_code diff --git a/erpnext/stock/doctype/packing_slip/packing_slip.py b/erpnext/stock/doctype/packing_slip/packing_slip.py index 99a6ee3ee6..c4f69acc41 100644 --- a/erpnext/stock/doctype/packing_slip/packing_slip.py +++ b/erpnext/stock/doctype/packing_slip/packing_slip.py @@ -31,7 +31,7 @@ class PackingSlip(Document): """ Validates if delivery note has status as draft """ - if cint(frappe.db.get_value("Delivery Note", self.doc.delivery_note, "docstatus")) != 0: + if cint(frappe.db.get_value("Delivery Note", self.delivery_note, "docstatus")) != 0: msgprint(_("""Invalid Delivery Note. Delivery Note should exist and should be in draft state. Please rectify and try again."""), raise_exception=1) def validate_items_mandatory(self): @@ -43,11 +43,11 @@ class PackingSlip(Document): """ Validate if case nos overlap. If they do, recommend next case no. """ - if not cint(self.doc.from_case_no): + if not cint(self.from_case_no): frappe.msgprint(_("Please specify a valid 'From Case No.'"), raise_exception=1) - elif not self.doc.to_case_no: - self.doc.to_case_no = self.doc.from_case_no - elif self.doc.from_case_no > self.doc.to_case_no: + elif not self.to_case_no: + self.to_case_no = self.from_case_no + elif self.from_case_no > self.to_case_no: frappe.msgprint(_("'To Case No.' cannot be less than 'From Case No.'"), raise_exception=1) @@ -57,7 +57,7 @@ class PackingSlip(Document): (from_case_no BETWEEN %(from_case_no)s AND %(to_case_no)s OR to_case_no BETWEEN %(from_case_no)s AND %(to_case_no)s OR %(from_case_no)s BETWEEN from_case_no AND to_case_no) - """, self.doc.fields) + """, self.fields) if res: frappe.msgprint(_("""Case No(s) already in use. Please rectify and try again. @@ -102,10 +102,10 @@ class PackingSlip(Document): from `tabDelivery Note Item` dni where parent=%s %s group by item_code""" % ("%s", condition), - tuple([self.doc.delivery_note] + rows), as_dict=1) + tuple([self.delivery_note] + rows), as_dict=1) ps_item_qty = dict([[d.item_code, d.qty] for d in self.doclist]) - no_of_cases = cint(self.doc.to_case_no) - cint(self.doc.from_case_no) + 1 + no_of_cases = cint(self.to_case_no) - cint(self.from_case_no) + 1 return res, ps_item_qty, no_of_cases @@ -128,8 +128,8 @@ class PackingSlip(Document): """ Fill empty columns in Packing Slip Item """ - if not self.doc.from_case_no: - self.doc.from_case_no = self.get_recommended_case_no() + if not self.from_case_no: + self.from_case_no = self.get_recommended_case_no() for d in self.get("item_details"): res = frappe.db.get_value("Item", d.item_code, @@ -145,7 +145,7 @@ class PackingSlip(Document): note """ recommended_case_no = frappe.db.sql("""SELECT MAX(to_case_no) FROM `tabPacking Slip` - WHERE delivery_note = %(delivery_note)s AND docstatus=1""", self.doc.fields) + WHERE delivery_note = %(delivery_note)s AND docstatus=1""", self.fields) return cint(recommended_case_no[0][0]) + 1 @@ -155,7 +155,7 @@ class PackingSlip(Document): dn_details = self.get_details_for_packing()[0] for item in dn_details: if flt(item.qty) > flt(item.packed_qty): - ch = self.doc.append('item_details', {}) + ch = self.append('item_details', {}) ch.item_code = item.item_code ch.item_name = item.item_name ch.stock_uom = item.stock_uom diff --git a/erpnext/stock/doctype/price_list/price_list.py b/erpnext/stock/doctype/price_list/price_list.py index bf49a51994..bfb3ea7298 100644 --- a/erpnext/stock/doctype/price_list/price_list.py +++ b/erpnext/stock/doctype/price_list/price_list.py @@ -10,7 +10,7 @@ import frappe.defaults class PriceList(DocListController): def validate(self): - if not cint(self.doc.buying) and not cint(self.doc.selling): + if not cint(self.buying) and not cint(self.selling): throw(_("Price List must be applicable for Buying or Selling")) if not self.get("valid_for_territories"): @@ -29,26 +29,26 @@ class PriceList(DocListController): self.update_item_price() def set_default_if_missing(self): - if cint(self.doc.selling): + if cint(self.selling): if not frappe.db.get_value("Selling Settings", None, "selling_price_list"): - frappe.set_value("Selling Settings", "Selling Settings", "selling_price_list", self.doc.name) + frappe.set_value("Selling Settings", "Selling Settings", "selling_price_list", self.name) - elif cint(self.doc.buying): + elif cint(self.buying): if not frappe.db.get_value("Buying Settings", None, "buying_price_list"): - frappe.set_value("Buying Settings", "Buying Settings", "buying_price_list", self.doc.name) + frappe.set_value("Buying Settings", "Buying Settings", "buying_price_list", self.name) def update_item_price(self): frappe.db.sql("""update `tabItem Price` set currency=%s, buying=%s, selling=%s, modified=NOW() where price_list=%s""", - (self.doc.currency, cint(self.doc.buying), cint(self.doc.selling), self.doc.name)) + (self.currency, cint(self.buying), cint(self.selling), self.name)) def on_trash(self): def _update_default_price_list(module): b = frappe.bean(module + " Settings") price_list_fieldname = module.lower() + "_price_list" - if self.doc.name == b.doc.fields[price_list_fieldname]: - b.doc.fields[price_list_fieldname] = None + if self.name == b.fields[price_list_fieldname]: + b.set(price_list_fieldname, None) b.save() for module in ["Selling", "Buying"]: diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py index bad59a6d86..b6e05399ff 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py @@ -30,21 +30,21 @@ class PurchaseReceipt(BuyingController): def onload(self): billed_qty = frappe.db.sql("""select sum(ifnull(qty, 0)) from `tabPurchase Invoice Item` - where purchase_receipt=%s""", self.doc.name) + where purchase_receipt=%s""", self.name) if billed_qty: total_qty = sum((item.qty for item in self.get("purchase_receipt_details"))) - self.doc.fields["__billing_complete"] = billed_qty[0][0] == total_qty + self.set("__billing_complete", billed_qty[0][0] == total_qty) def validate(self): super(DocType, self).validate() self.po_required() - if not self.doc.status: - self.doc.status = "Draft" + if not self.status: + self.status = "Draft" from erpnext.utilities import validate_status - validate_status(self.doc.status, ["Draft", "Submitted", "Cancelled"]) + validate_status(self.status, ["Draft", "Submitted", "Cancelled"]) self.validate_with_previous_doc() self.validate_rejected_warehouse() @@ -67,7 +67,7 @@ class PurchaseReceipt(BuyingController): def validate_rejected_warehouse(self): for d in self.get("purchase_receipt_details"): if flt(d.rejected_qty) and not d.rejected_warehouse: - d.rejected_warehouse = self.doc.rejected_warehouse + d.rejected_warehouse = self.rejected_warehouse if not d.rejected_warehouse: frappe.throw(_("Rejected Warehouse is mandatory against regected item")) @@ -92,11 +92,11 @@ class PurchaseReceipt(BuyingController): def validate_challan_no(self): "Validate if same challan no exists for same supplier in a submitted purchase receipt" - if self.doc.challan_no: + if self.challan_no: exists = frappe.db.sql(""" SELECT name FROM `tabPurchase Receipt` WHERE name!=%s AND supplier=%s AND challan_no=%s - AND docstatus=1""", (self.doc.name, self.doc.supplier, self.doc.challan_no)) + AND docstatus=1""", (self.name, self.supplier, self.challan_no)) if exists: frappe.msgprint("Another Purchase Receipt using the same Challan No. already exists.\ Please enter a valid Challan No.", raise_exception=1) @@ -178,15 +178,15 @@ class PurchaseReceipt(BuyingController): update_bin({ "item_code": d.item_code, "warehouse": ordered_warehouse, - "posting_date": self.doc.posting_date, - "ordered_qty": flt(ordered_qty) if self.doc.docstatus==1 else -flt(ordered_qty) + "posting_date": self.posting_date, + "ordered_qty": flt(ordered_qty) if self.docstatus==1 else -flt(ordered_qty) }) def get_already_received_qty(self, po, po_detail): qty = frappe.db.sql("""select sum(qty) from `tabPurchase Receipt Item` where prevdoc_detail_docname = %s and docstatus = 1 and prevdoc_doctype='Purchase Order' and prevdoc_docname=%s - and parent != %s""", (po_detail, po, self.doc.name)) + and parent != %s""", (po_detail, po, self.name)) return qty and flt(qty[0][0]) or 0.0 def get_po_qty_and_warehouse(self, po_detail): @@ -200,7 +200,7 @@ class PurchaseReceipt(BuyingController): # when PR is submitted and it has to be increased when PR is cancelled sl_entries.append(self.get_sl_entries(d, { "item_code": d.rm_item_code, - "warehouse": self.doc.supplier_warehouse, + "warehouse": self.supplier_warehouse, "actual_qty": -1*flt(d.consumed_qty), "incoming_rate": 0 })) @@ -226,7 +226,7 @@ class PurchaseReceipt(BuyingController): purchase_controller = frappe.get_obj("Purchase Common") # Check for Approving Authority - get_obj('Authorization Control').validate_approving_authority(self.doc.doctype, self.doc.company, self.doc.grand_total) + get_obj('Authorization Control').validate_approving_authority(self.doctype, self.company, self.grand_total) # Set status as Submitted frappe.db.set(self.doc, 'status', 'Submitted') @@ -248,7 +248,7 @@ class PurchaseReceipt(BuyingController): submit_rv = frappe.db.sql("""select t1.name from `tabPurchase Invoice` t1,`tabPurchase Invoice Item` t2 where t1.name = t2.parent and t2.purchase_receipt = %s and t1.docstatus = 1""", - (self.doc.name)) + (self.name)) if submit_rv: msgprint("Purchase Invoice : " + cstr(self.submit_rv[0][0]) + " has already been submitted !") raise Exception , "Validation Error." @@ -262,7 +262,7 @@ class PurchaseReceipt(BuyingController): submitted = frappe.db.sql("""select t1.name from `tabPurchase Invoice` t1,`tabPurchase Invoice Item` t2 where t1.name = t2.parent and t2.purchase_receipt = %s and t1.docstatus = 1""", - self.doc.name) + self.name) if submitted: frappe.throw("Purchase Invoice : " + cstr(submitted[0][0]) + " has already been submitted !") @@ -280,8 +280,8 @@ class PurchaseReceipt(BuyingController): def get_current_stock(self): for d in self.get('pr_raw_material_details'): - if self.doc.supplier_warehouse: - bin = frappe.db.sql("select actual_qty from `tabBin` where item_code = %s and warehouse = %s", (d.rm_item_code, self.doc.supplier_warehouse), as_dict = 1) + if self.supplier_warehouse: + bin = frappe.db.sql("select actual_qty from `tabBin` where item_code = %s and warehouse = %s", (d.rm_item_code, self.supplier_warehouse), as_dict = 1) d.current_stock = bin and flt(bin[0]['actual_qty']) or 0 def get_rate(self,arg): diff --git a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py index 2a2e821745..58b8d7dc14 100644 --- a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py @@ -17,11 +17,11 @@ class TestPurchaseReceipt(unittest.TestCase): pr = frappe.bean(copy=test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_purchase_invoice, - pr.doc.name) + pr.name) - pr = frappe.bean("Purchase Receipt", pr.doc.name) + pr = frappe.bean("Purchase Receipt", pr.name) pr.submit() - pi = make_purchase_invoice(pr.doc.name) + pi = make_purchase_invoice(pr.name) self.assertEquals(pi[0]["doctype"], "Purchase Invoice") self.assertEquals(len(pi), len(pr.doclist)) @@ -38,7 +38,7 @@ class TestPurchaseReceipt(unittest.TestCase): pr.submit() stock_value, stock_value_difference = frappe.db.get_value("Stock Ledger Entry", - {"voucher_type": "Purchase Receipt", "voucher_no": pr.doc.name, + {"voucher_type": "Purchase Receipt", "voucher_no": pr.name, "item_code": "_Test Item", "warehouse": "_Test Warehouse - _TC"}, ["stock_value", "stock_value_difference"]) self.assertEqual(stock_value, 375) @@ -48,7 +48,7 @@ class TestPurchaseReceipt(unittest.TestCase): "warehouse": "_Test Warehouse - _TC"}, "stock_value") self.assertEqual(bin_stock_value, 375) - self.assertFalse(get_gl_entries("Purchase Receipt", pr.doc.name)) + self.assertFalse(get_gl_entries("Purchase Receipt", pr.name)) def test_purchase_receipt_gl_entry(self): self._clear_stock_account_balance() @@ -60,7 +60,7 @@ class TestPurchaseReceipt(unittest.TestCase): pr.insert() pr.submit() - gl_entries = get_gl_entries("Purchase Receipt", pr.doc.name) + gl_entries = get_gl_entries("Purchase Receipt", pr.name) self.assertTrue(gl_entries) @@ -80,7 +80,7 @@ class TestPurchaseReceipt(unittest.TestCase): self.assertEquals(expected_values[gle.account][1], gle.credit) pr.cancel() - self.assertFalse(get_gl_entries("Purchase Receipt", pr.doc.name)) + self.assertFalse(get_gl_entries("Purchase Receipt", pr.name)) set_perpetual_inventory(0) @@ -106,7 +106,7 @@ class TestPurchaseReceipt(unittest.TestCase): pr.submit() self.assertEquals(frappe.db.get_value("Serial No", pr.doclist[1].serial_no, - "supplier"), pr.doc.supplier) + "supplier"), pr.supplier) return pr @@ -124,7 +124,7 @@ def get_gl_entries(voucher_type, voucher_no): def set_perpetual_inventory(enable=1): accounts_settings = frappe.bean("Accounts Settings") - accounts_settings.doc.auto_accounting_for_stock = enable + accounts_settings.auto_accounting_for_stock = enable accounts_settings.save() diff --git a/erpnext/stock/doctype/serial_no/serial_no.py b/erpnext/stock/doctype/serial_no/serial_no.py index 50b1d00406..88b26026a6 100644 --- a/erpnext/stock/doctype/serial_no/serial_no.py +++ b/erpnext/stock/doctype/serial_no/serial_no.py @@ -27,7 +27,7 @@ class SerialNo(StockController): self.via_stock_ledger = False def validate(self): - if self.doc.fields.get("__islocal") and self.doc.warehouse: + if self.get("__islocal") and self.warehouse: frappe.throw(_("New Serial No cannot have Warehouse. Warehouse must be \ set by Stock Entry or Purchase Receipt"), SerialNoCannotCreateDirectError) @@ -37,29 +37,29 @@ class SerialNo(StockController): self.on_stock_ledger_entry() def set_maintenance_status(self): - if not self.doc.warranty_expiry_date and not self.doc.amc_expiry_date: - self.doc.maintenance_status = None + if not self.warranty_expiry_date and not self.amc_expiry_date: + self.maintenance_status = None - if self.doc.warranty_expiry_date and self.doc.warranty_expiry_date < nowdate(): - self.doc.maintenance_status = "Out of Warranty" + if self.warranty_expiry_date and self.warranty_expiry_date < nowdate(): + self.maintenance_status = "Out of Warranty" - if self.doc.amc_expiry_date and self.doc.amc_expiry_date < nowdate(): - self.doc.maintenance_status = "Out of AMC" + if self.amc_expiry_date and self.amc_expiry_date < nowdate(): + self.maintenance_status = "Out of AMC" - if self.doc.amc_expiry_date and self.doc.amc_expiry_date >= nowdate(): - self.doc.maintenance_status = "Under AMC" + if self.amc_expiry_date and self.amc_expiry_date >= nowdate(): + self.maintenance_status = "Under AMC" - if self.doc.warranty_expiry_date and self.doc.warranty_expiry_date >= nowdate(): - self.doc.maintenance_status = "Under Warranty" + if self.warranty_expiry_date and self.warranty_expiry_date >= nowdate(): + self.maintenance_status = "Under Warranty" def validate_warehouse(self): - if not self.doc.fields.get("__islocal"): + if not self.get("__islocal"): item_code, warehouse = frappe.db.get_value("Serial No", - self.doc.name, ["item_code", "warehouse"]) - if item_code != self.doc.item_code: + self.name, ["item_code", "warehouse"]) + if item_code != self.item_code: frappe.throw(_("Item Code cannot be changed for Serial No."), SerialNoCannotCannotChangeError) - if not self.via_stock_ledger and warehouse != self.doc.warehouse: + if not self.via_stock_ledger and warehouse != self.warehouse: frappe.throw(_("Warehouse cannot be changed for Serial No."), SerialNoCannotCannotChangeError) @@ -67,15 +67,15 @@ class SerialNo(StockController): """ Validate whether serial no is required for this item """ - item = frappe.doc("Item", self.doc.item_code) + item = frappe.doc("Item", self.item_code) if item.has_serial_no!="Yes": - frappe.throw(_("Item must have 'Has Serial No' as 'Yes'") + ": " + self.doc.item_code) + frappe.throw(_("Item must have 'Has Serial No' as 'Yes'") + ": " + self.item_code) - self.doc.item_group = item.item_group - self.doc.description = item.description - self.doc.item_name = item.item_name - self.doc.brand = item.brand - self.doc.warranty_period = item.warranty_period + self.item_group = item.item_group + self.description = item.description + self.item_name = item.item_name + self.brand = item.brand + self.warranty_period = item.warranty_period def set_status(self, last_sle): if last_sle: @@ -87,52 +87,52 @@ class SerialNo(StockController): if last_sle.actual_qty > 0: if document_type == "Sales Return": - self.doc.status = "Sales Returned" + self.status = "Sales Returned" else: - self.doc.status = "Available" + self.status = "Available" else: if document_type == "Purchase Return": - self.doc.status = "Purchase Returned" + self.status = "Purchase Returned" elif last_sle.voucher_type in ("Delivery Note", "Sales Invoice"): - self.doc.status = "Delivered" + self.status = "Delivered" else: - self.doc.status = "Not Available" + self.status = "Not Available" else: - self.doc.status = "Not Available" + self.status = "Not Available" def set_purchase_details(self, purchase_sle): if purchase_sle: - self.doc.purchase_document_type = purchase_sle.voucher_type - self.doc.purchase_document_no = purchase_sle.voucher_no - self.doc.purchase_date = purchase_sle.posting_date - self.doc.purchase_time = purchase_sle.posting_time - self.doc.purchase_rate = purchase_sle.incoming_rate + self.purchase_document_type = purchase_sle.voucher_type + self.purchase_document_no = purchase_sle.voucher_no + self.purchase_date = purchase_sle.posting_date + self.purchase_time = purchase_sle.posting_time + self.purchase_rate = purchase_sle.incoming_rate if purchase_sle.voucher_type == "Purchase Receipt": - self.doc.supplier, self.doc.supplier_name = \ + self.supplier, self.supplier_name = \ frappe.db.get_value("Purchase Receipt", purchase_sle.voucher_no, ["supplier", "supplier_name"]) else: for fieldname in ("purchase_document_type", "purchase_document_no", "purchase_date", "purchase_time", "purchase_rate", "supplier", "supplier_name"): - self.doc.fields[fieldname] = None + self.set(fieldname, None) def set_sales_details(self, delivery_sle): if delivery_sle: - self.doc.delivery_document_type = delivery_sle.voucher_type - self.doc.delivery_document_no = delivery_sle.voucher_no - self.doc.delivery_date = delivery_sle.posting_date - self.doc.delivery_time = delivery_sle.posting_time - self.doc.customer, self.doc.customer_name = \ + self.delivery_document_type = delivery_sle.voucher_type + self.delivery_document_no = delivery_sle.voucher_no + self.delivery_date = delivery_sle.posting_date + self.delivery_time = delivery_sle.posting_time + self.customer, self.customer_name = \ frappe.db.get_value(delivery_sle.voucher_type, delivery_sle.voucher_no, ["customer", "customer_name"]) - if self.doc.warranty_period: - self.doc.warranty_expiry_date = add_days(cstr(delivery_sle.posting_date), - cint(self.doc.warranty_period)) + if self.warranty_period: + self.warranty_expiry_date = add_days(cstr(delivery_sle.posting_date), + cint(self.warranty_period)) else: for fieldname in ("delivery_document_type", "delivery_document_no", "delivery_date", "delivery_time", "customer", "customer_name", "warranty_expiry_date"): - self.doc.fields[fieldname] = None + self.set(fieldname, None) def get_last_sle(self): entries = {} @@ -154,8 +154,8 @@ class SerialNo(StockController): for sle in frappe.db.sql("""select * from `tabStock Ledger Entry` where serial_no like %s and item_code=%s and ifnull(is_cancelled, 'No')='No' order by posting_date desc, posting_time desc, name desc""", - ("%%%s%%" % self.doc.name, self.doc.item_code), as_dict=1): - if self.doc.name.upper() in get_serial_nos(sle.serial_no): + ("%%%s%%" % self.name, self.item_code), as_dict=1): + if self.name.upper() in get_serial_nos(sle.serial_no): if sle.actual_qty > 0: sle_dict.setdefault("incoming", []).append(sle) else: @@ -164,11 +164,11 @@ class SerialNo(StockController): return sle_dict def on_trash(self): - if self.doc.status == 'Delivered': - frappe.throw(_("Delivered Serial No ") + self.doc.name + _(" can not be deleted")) - if self.doc.warehouse: + if self.status == 'Delivered': + frappe.throw(_("Delivered Serial No ") + self.name + _(" can not be deleted")) + if self.warehouse: frappe.throw(_("Cannot delete Serial No in warehouse. \ - First remove from warehouse, then delete.") + ": " + self.doc.name) + First remove from warehouse, then delete.") + ": " + self.name) def before_rename(self, old, new, merge=False): if merge: @@ -188,7 +188,7 @@ class SerialNo(StockController): ('\n'.join(serial_nos), item[0])) def on_stock_ledger_entry(self): - if self.via_stock_ledger and not self.doc.fields.get("__islocal"): + if self.via_stock_ledger and not self.get("__islocal"): last_sle = self.get_last_sle() self.set_status(last_sle.get("last_sle")) self.set_purchase_details(last_sle.get("purchase_sle")) @@ -226,22 +226,22 @@ def validate_serial_no(sle, item_det): if frappe.db.exists("Serial No", serial_no): sr = frappe.bean("Serial No", serial_no) - if sr.doc.item_code!=sle.item_code: + if sr.item_code!=sle.item_code: frappe.throw(_("Serial No does not belong to Item") + (": %s (%s)" % (sle.item_code, serial_no)), SerialNoItemError) - if sr.doc.warehouse and sle.actual_qty > 0: - frappe.throw(_("Same Serial No") + ": " + sr.doc.name + + if sr.warehouse and sle.actual_qty > 0: + frappe.throw(_("Same Serial No") + ": " + sr.name + _(" can not be received twice"), SerialNoDuplicateError) if sle.actual_qty < 0: - if sr.doc.warehouse!=sle.warehouse: + if sr.warehouse!=sle.warehouse: frappe.throw(_("Serial No") + ": " + serial_no + _(" does not belong to Warehouse") + ": " + sle.warehouse, SerialNoWarehouseError) if sle.voucher_type in ("Delivery Note", "Sales Invoice") \ - and sr.doc.status != "Available": + and sr.status != "Available": frappe.throw(_("Serial No status must be 'Available' to Deliver") + ": " + serial_no, SerialNoStatusError) elif sle.actual_qty < 0: @@ -266,7 +266,7 @@ def update_serial_nos(sle, item_det): if frappe.db.exists("Serial No", serial_no): sr = frappe.bean("Serial No", serial_no) sr.make_controller().via_stock_ledger = True - sr.doc.warehouse = sle.warehouse if sle.actual_qty > 0 else None + sr.warehouse = sle.warehouse if sle.actual_qty > 0 else None sr.save() elif sle.actual_qty > 0: make_serial_no(serial_no, sle) @@ -282,21 +282,21 @@ def get_serial_nos(serial_no): def make_serial_no(serial_no, sle): sr = frappe.new_bean("Serial No") - sr.doc.serial_no = serial_no - sr.doc.item_code = sle.item_code - sr.doc.warehouse = None + sr.serial_no = serial_no + sr.item_code = sle.item_code + sr.warehouse = None sr.make_controller().via_stock_ledger = True sr.insert() - sr.doc.warehouse = sle.warehouse - sr.doc.status = "Available" + sr.warehouse = sle.warehouse + sr.status = "Available" sr.save() - frappe.msgprint(_("Serial No created") + ": " + sr.doc.name) - return sr.doc.name + frappe.msgprint(_("Serial No created") + ": " + sr.name) + return sr.name def update_serial_nos_after_submit(controller, parentfield): stock_ledger_entries = frappe.db.sql("""select voucher_detail_no, serial_no from `tabStock Ledger Entry` where voucher_type=%s and voucher_no=%s""", - (controller.doc.doctype, controller.doc.name), as_dict=True) + (controller.doctype, controller.name), as_dict=True) if not stock_ledger_entries: return diff --git a/erpnext/stock/doctype/serial_no/test_serial_no.py b/erpnext/stock/doctype/serial_no/test_serial_no.py index 8b295b4ef6..dc9c155bd9 100644 --- a/erpnext/stock/doctype/serial_no/test_serial_no.py +++ b/erpnext/stock/doctype/serial_no/test_serial_no.py @@ -15,15 +15,15 @@ from erpnext.stock.doctype.serial_no.serial_no import * class TestSerialNo(unittest.TestCase): def test_cannot_create_direct(self): sr = frappe.new_bean("Serial No") - sr.doc.item_code = "_Test Serialized Item" - sr.doc.warehouse = "_Test Warehouse - _TC" - sr.doc.serial_no = "_TCSER0001" - sr.doc.purchase_rate = 10 + sr.item_code = "_Test Serialized Item" + sr.warehouse = "_Test Warehouse - _TC" + sr.serial_no = "_TCSER0001" + sr.purchase_rate = 10 self.assertRaises(SerialNoCannotCreateDirectError, sr.insert) - sr.doc.warehouse = None + sr.warehouse = None sr.insert() - self.assertTrue(sr.doc.name) + self.assertTrue(sr.name) - sr.doc.warehouse = "_Test Warehouse - _TC" - self.assertTrue(SerialNoCannotCannotChangeError, sr.doc.save) \ No newline at end of file + sr.warehouse = "_Test Warehouse - _TC" + self.assertTrue(SerialNoCannotCannotChangeError, sr.save) \ No newline at end of file diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index 785ad9787b..eeb8d82bd6 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -29,8 +29,8 @@ class StockEntry(StockController): def validate(self): self.validate_posting_time() self.validate_purpose() - pro_obj = self.doc.production_order and \ - get_obj('Production Order', self.doc.production_order) or None + pro_obj = self.production_order and \ + get_obj('Production Order', self.production_order) or None self.validate_item() self.validate_uom_is_integer("uom", "qty") @@ -61,13 +61,13 @@ class StockEntry(StockController): def validate_fiscal_year(self): from erpnext.accounts.utils import validate_fiscal_year - validate_fiscal_year(self.doc.posting_date, self.doc.fiscal_year, + validate_fiscal_year(self.posting_date, self.fiscal_year, self.meta.get_label("posting_date")) def validate_purpose(self): valid_purposes = ["Material Issue", "Material Receipt", "Material Transfer", "Manufacture/Repack", "Subcontract", "Sales Return", "Purchase Return"] - if self.doc.purpose not in valid_purposes: + if self.purpose not in valid_purposes: msgprint(_("Purpose must be one of ") + comma_or(valid_purposes), raise_exception=True) @@ -87,32 +87,32 @@ class StockEntry(StockController): validate_for_manufacture_repack = any([d.bom_no for d in self.doclist.get( {"parentfield": "mtn_details"})]) - if self.doc.purpose in source_mandatory and self.doc.purpose not in target_mandatory: - self.doc.to_warehouse = None + if self.purpose in source_mandatory and self.purpose not in target_mandatory: + self.to_warehouse = None for d in self.get('mtn_details'): d.t_warehouse = None - elif self.doc.purpose in target_mandatory and self.doc.purpose not in source_mandatory: - self.doc.from_warehouse = None + elif self.purpose in target_mandatory and self.purpose not in source_mandatory: + self.from_warehouse = None for d in self.get('mtn_details'): d.s_warehouse = None for d in self.get('mtn_details'): if not d.s_warehouse and not d.t_warehouse: - d.s_warehouse = self.doc.from_warehouse - d.t_warehouse = self.doc.to_warehouse + d.s_warehouse = self.from_warehouse + d.t_warehouse = self.to_warehouse if not (d.s_warehouse or d.t_warehouse): msgprint(_("Atleast one warehouse is mandatory"), raise_exception=1) - if self.doc.purpose in source_mandatory and not d.s_warehouse: + if self.purpose in source_mandatory and not d.s_warehouse: msgprint(_("Row # ") + "%s: " % cint(d.idx) + _("Source Warehouse") + _(" is mandatory"), raise_exception=1) - if self.doc.purpose in target_mandatory and not d.t_warehouse: + if self.purpose in target_mandatory and not d.t_warehouse: msgprint(_("Row # ") + "%s: " % cint(d.idx) + _("Target Warehouse") + _(" is mandatory"), raise_exception=1) - if self.doc.purpose == "Manufacture/Repack": + if self.purpose == "Manufacture/Repack": if validate_for_manufacture_repack: if d.bom_no: d.s_warehouse = None @@ -121,7 +121,7 @@ class StockEntry(StockController): msgprint(_("Row # ") + "%s: " % cint(d.idx) + _("Target Warehouse") + _(" is mandatory"), raise_exception=1) - elif pro_obj and cstr(d.t_warehouse) != pro_obj.doc.fg_warehouse: + elif pro_obj and cstr(d.t_warehouse) != pro_obj.fg_warehouse: msgprint(_("Row # ") + "%s: " % cint(d.idx) + _("Target Warehouse") + _(" should be same as that in ") + _("Production Order"), raise_exception=1) @@ -138,28 +138,28 @@ class StockEntry(StockController): def validate_production_order(self, pro_obj=None): if not pro_obj: - if self.doc.production_order: - pro_obj = get_obj('Production Order', self.doc.production_order) + if self.production_order: + pro_obj = get_obj('Production Order', self.production_order) else: return - if self.doc.purpose == "Manufacture/Repack": + if self.purpose == "Manufacture/Repack": # check for double entry self.check_duplicate_entry_for_production_order() - elif self.doc.purpose != "Material Transfer": - self.doc.production_order = None + elif self.purpose != "Material Transfer": + self.production_order = None def check_duplicate_entry_for_production_order(self): other_ste = [t[0] for t in frappe.db.get_values("Stock Entry", { - "production_order": self.doc.production_order, - "purpose": self.doc.purpose, + "production_order": self.production_order, + "purpose": self.purpose, "docstatus": ["!=", 2], - "name": ["!=", self.doc.name] + "name": ["!=", self.name] }, "name")] if other_ste: production_item, qty = frappe.db.get_value("Production Order", - self.doc.production_order, ["production_item", "qty"]) + self.production_order, ["production_item", "qty"]) args = other_ste + [production_item] fg_qty_already_entered = frappe.db.sql("""select sum(actual_qty) from `tabStock Entry Detail` @@ -169,10 +169,10 @@ class StockEntry(StockController): if fg_qty_already_entered >= qty: frappe.throw(_("Stock Entries already created for Production Order ") - + self.doc.production_order + ":" + ", ".join(other_ste), DuplicateEntryForProductionOrderError) + + self.production_order + ":" + ", ".join(other_ste), DuplicateEntryForProductionOrderError) def set_total_amount(self): - self.doc.total_amount = sum([flt(item.amount) for item in self.get("mtn_details")]) + self.total_amount = sum([flt(item.amount) for item in self.get("mtn_details")]) def get_stock_and_rate(self): """get stock and incoming rate on posting date""" @@ -180,8 +180,8 @@ class StockEntry(StockController): args = frappe._dict({ "item_code": d.item_code, "warehouse": d.s_warehouse or d.t_warehouse, - "posting_date": self.doc.posting_date, - "posting_time": self.doc.posting_time, + "posting_date": self.posting_date, + "posting_time": self.posting_time, "qty": d.s_warehouse and -1*d.transfer_qty or d.transfer_qty, "serial_no": d.serial_no, "bom_no": d.bom_no, @@ -197,14 +197,14 @@ class StockEntry(StockController): def get_incoming_rate(self, args): incoming_rate = 0 - if self.doc.purpose == "Sales Return" and \ - (self.doc.delivery_note_no or self.doc.sales_invoice_no): + if self.purpose == "Sales Return" and \ + (self.delivery_note_no or self.sales_invoice_no): sle = frappe.db.sql("""select name, posting_date, posting_time, actual_qty, stock_value, warehouse from `tabStock Ledger Entry` where voucher_type = %s and voucher_no = %s and item_code = %s limit 1""", - ((self.doc.delivery_note_no and "Delivery Note" or "Sales Invoice"), - self.doc.delivery_note_no or self.doc.sales_invoice_no, args.item_code), as_dict=1) + ((self.delivery_note_no and "Delivery Note" or "Sales Invoice"), + self.delivery_note_no or self.sales_invoice_no, args.item_code), as_dict=1) if sle: args.update({ "posting_date": sle[0].posting_date, @@ -237,13 +237,13 @@ class StockEntry(StockController): def validate_finished_goods(self): """validation: finished good quantity should be same as manufacturing quantity""" for d in self.get('mtn_details'): - if d.bom_no and flt(d.transfer_qty) != flt(self.doc.fg_completed_qty): + if d.bom_no and flt(d.transfer_qty) != flt(self.fg_completed_qty): msgprint(_("Row #") + " %s: " % d.idx + _("Quantity should be equal to Manufacturing Quantity. To fetch items again, click on 'Get Items' button or update the Quantity manually."), raise_exception=1) def validate_return_reference_doc(self): """validate item with reference doc""" - ref = get_return_doclist_and_details(self.doc.fields) + ref = get_return_doclist_and_details(self.fields) if ref.doclist: # validate docstatus @@ -260,8 +260,8 @@ class StockEntry(StockController): # posting date check ref_posting_datetime = "%s %s" % (cstr(ref.doclist[0].posting_date), cstr(ref.doclist[0].posting_time) or "00:00:00") - this_posting_datetime = "%s %s" % (cstr(self.doc.posting_date), - cstr(self.doc.posting_time)) + this_posting_datetime = "%s %s" % (cstr(self.posting_date), + cstr(self.posting_time)) if this_posting_datetime < ref_posting_datetime: from frappe.utils.dateutils import datetime_in_user_format frappe.msgprint(_("Posting Date Time cannot be before") @@ -295,12 +295,12 @@ class StockEntry(StockController): return dict(frappe.db.sql("""select item_code, sum(transfer_qty) as qty from `tabStock Entry Detail` where parent in ( select name from `tabStock Entry` where `%s`=%s and docstatus=1) - group by item_code""" % (ref_fieldname, "%s"), (self.doc.fields.get(ref_fieldname),))) + group by item_code""" % (ref_fieldname, "%s"), (self.get(ref_fieldname),))) def update_stock_ledger(self): sl_entries = [] for d in self.get('mtn_details'): - if cstr(d.s_warehouse) and self.doc.docstatus == 1: + if cstr(d.s_warehouse) and self.docstatus == 1: sl_entries.append(self.get_sl_entries(d, { "warehouse": cstr(d.s_warehouse), "actual_qty": -flt(d.transfer_qty), @@ -317,53 +317,53 @@ class StockEntry(StockController): # On cancellation, make stock ledger entry for # target warehouse first, to update serial no values properly - if cstr(d.s_warehouse) and self.doc.docstatus == 2: + if cstr(d.s_warehouse) and self.docstatus == 2: sl_entries.append(self.get_sl_entries(d, { "warehouse": cstr(d.s_warehouse), "actual_qty": -flt(d.transfer_qty), "incoming_rate": 0 })) - self.make_sl_entries(sl_entries, self.doc.amended_from and 'Yes' or 'No') + self.make_sl_entries(sl_entries, self.amended_from and 'Yes' or 'No') def update_production_order(self): def _validate_production_order(pro_bean): - if flt(pro_bean.doc.docstatus) != 1: + if flt(pro_bean.docstatus) != 1: frappe.throw(_("Production Order must be submitted") + ": " + - self.doc.production_order) + self.production_order) - if pro_bean.doc.status == 'Stopped': + if pro_bean.status == 'Stopped': msgprint(_("Transaction not allowed against stopped Production Order") + ": " + - self.doc.production_order) + self.production_order) - if self.doc.production_order: - pro_bean = frappe.bean("Production Order", self.doc.production_order) + if self.production_order: + pro_bean = frappe.bean("Production Order", self.production_order) _validate_production_order(pro_bean) self.update_produced_qty(pro_bean) - if self.doc.purpose == "Manufacture/Repack": + if self.purpose == "Manufacture/Repack": self.update_planned_qty(pro_bean) def update_produced_qty(self, pro_bean): - if self.doc.purpose == "Manufacture/Repack": - produced_qty = flt(pro_bean.doc.produced_qty) + \ - (self.doc.docstatus==1 and 1 or -1 ) * flt(self.doc.fg_completed_qty) + if self.purpose == "Manufacture/Repack": + produced_qty = flt(pro_bean.produced_qty) + \ + (self.docstatus==1 and 1 or -1 ) * flt(self.fg_completed_qty) - if produced_qty > flt(pro_bean.doc.qty): - frappe.throw(_("Production Order") + ": " + self.doc.production_order + "\n" + + if produced_qty > flt(pro_bean.qty): + frappe.throw(_("Production Order") + ": " + self.production_order + "\n" + _("Total Manufactured Qty can not be greater than Planned qty to manufacture") - + "(%s/%s)" % (produced_qty, flt(pro_bean.doc.qty)), StockOverProductionError) + + "(%s/%s)" % (produced_qty, flt(pro_bean.qty)), StockOverProductionError) - status = 'Completed' if flt(produced_qty) >= flt(pro_bean.doc.qty) else 'In Process' + status = 'Completed' if flt(produced_qty) >= flt(pro_bean.qty) else 'In Process' frappe.db.sql("""update `tabProduction Order` set status=%s, produced_qty=%s - where name=%s""", (status, produced_qty, self.doc.production_order)) + where name=%s""", (status, produced_qty, self.production_order)) def update_planned_qty(self, pro_bean): from erpnext.stock.utils import update_bin update_bin({ - "item_code": pro_bean.doc.production_item, - "warehouse": pro_bean.doc.fg_warehouse, - "posting_date": self.doc.posting_date, - "planned_qty": (self.doc.docstatus==1 and -1 or 1 ) * flt(self.doc.fg_completed_qty) + "item_code": pro_bean.production_item, + "warehouse": pro_bean.fg_warehouse, + "posting_date": self.posting_date, + "planned_qty": (self.docstatus==1 and -1 or 1 ) * flt(self.fg_completed_qty) }) def get_item_details(self, arg): @@ -414,8 +414,8 @@ class StockEntry(StockController): ret = {} if args.get('warehouse') and args.get('item_code'): args.update({ - "posting_date": self.doc.posting_date, - "posting_time": self.doc.posting_time, + "posting_date": self.posting_date, + "posting_time": self.posting_time, }) args = frappe._dict(args) @@ -430,61 +430,61 @@ class StockEntry(StockController): # self.set('mtn_details', []) pro_obj = None - if self.doc.production_order: + if self.production_order: # common validations - pro_obj = get_obj('Production Order', self.doc.production_order) + pro_obj = get_obj('Production Order', self.production_order) if pro_obj: self.validate_production_order(pro_obj) - self.doc.bom_no = pro_obj.doc.bom_no + self.bom_no = pro_obj.bom_no else: # invalid production order - self.doc.production_order = None + self.production_order = None - if self.doc.bom_no: - if self.doc.purpose in ["Material Issue", "Material Transfer", "Manufacture/Repack", + if self.bom_no: + if self.purpose in ["Material Issue", "Material Transfer", "Manufacture/Repack", "Subcontract"]: - if self.doc.production_order and self.doc.purpose == "Material Transfer": + if self.production_order and self.purpose == "Material Transfer": item_dict = self.get_pending_raw_materials(pro_obj) else: - if not self.doc.fg_completed_qty: + if not self.fg_completed_qty: frappe.throw(_("Manufacturing Quantity is mandatory")) - item_dict = self.get_bom_raw_materials(self.doc.fg_completed_qty) + item_dict = self.get_bom_raw_materials(self.fg_completed_qty) for item in item_dict.values(): if pro_obj: - item["from_warehouse"] = pro_obj.doc.wip_warehouse + item["from_warehouse"] = pro_obj.wip_warehouse item["to_warehouse"] = "" # add raw materials to Stock Entry Detail table idx = self.add_to_stock_entry_detail(item_dict) # add finished good item to Stock Entry Detail table -- along with bom_no - if self.doc.production_order and self.doc.purpose == "Manufacture/Repack": - item = frappe.db.get_value("Item", pro_obj.doc.production_item, ["item_name", + if self.production_order and self.purpose == "Manufacture/Repack": + item = frappe.db.get_value("Item", pro_obj.production_item, ["item_name", "description", "stock_uom", "expense_account", "buying_cost_center"], as_dict=1) self.add_to_stock_entry_detail({ - cstr(pro_obj.doc.production_item): { - "to_warehouse": pro_obj.doc.fg_warehouse, + cstr(pro_obj.production_item): { + "to_warehouse": pro_obj.fg_warehouse, "from_warehouse": "", - "qty": self.doc.fg_completed_qty, + "qty": self.fg_completed_qty, "item_name": item.item_name, "description": item.description, "stock_uom": item.stock_uom, "expense_account": item.expense_account, "cost_center": item.buying_cost_center, } - }, bom_no=pro_obj.doc.bom_no, idx=idx) + }, bom_no=pro_obj.bom_no, idx=idx) - elif self.doc.purpose in ["Material Receipt", "Manufacture/Repack"]: - if self.doc.purpose=="Material Receipt": - self.doc.from_warehouse = "" + elif self.purpose in ["Material Receipt", "Manufacture/Repack"]: + if self.purpose=="Material Receipt": + self.from_warehouse = "" item = frappe.db.sql("""select name, item_name, description, stock_uom, expense_account, buying_cost_center from `tabItem` where name=(select item from tabBOM where name=%s)""", - self.doc.bom_no, as_dict=1) + self.bom_no, as_dict=1) self.add_to_stock_entry_detail({ item[0]["name"] : { - "qty": self.doc.fg_completed_qty, + "qty": self.fg_completed_qty, "item_name": item[0].item_name, "description": item[0]["description"], "stock_uom": item[0]["stock_uom"], @@ -492,7 +492,7 @@ class StockEntry(StockController): "expense_account": item[0].expense_account, "cost_center": item[0].buying_cost_center, } - }, bom_no=self.doc.bom_no, idx=idx) + }, bom_no=self.bom_no, idx=idx) self.get_stock_and_rate() @@ -500,7 +500,7 @@ class StockEntry(StockController): from erpnext.manufacturing.doctype.bom.bom import get_bom_items_as_dict # item dict = { item_code: {qty, description, stock_uom} } - item_dict = get_bom_items_as_dict(self.doc.bom_no, qty=qty, fetch_exploded = self.doc.use_multi_level_bom) + item_dict = get_bom_items_as_dict(self.bom_no, qty=qty, fetch_exploded = self.use_multi_level_bom) for item in item_dict.values(): item.from_warehouse = item.default_warehouse @@ -515,12 +515,12 @@ class StockEntry(StockController): item_dict = self.get_bom_raw_materials(1) issued_item_qty = self.get_issued_qty() - max_qty = flt(pro_obj.doc.qty) + max_qty = flt(pro_obj.qty) only_pending_fetched = [] for item in item_dict: pending_to_issue = (max_qty * item_dict[item]["qty"]) - issued_item_qty.get(item, 0) - desire_to_transfer = flt(self.doc.fg_completed_qty) * item_dict[item]["qty"] + desire_to_transfer = flt(self.fg_completed_qty) * item_dict[item]["qty"] if desire_to_transfer <= pending_to_issue: item_dict[item]["qty"] = desire_to_transfer else: @@ -550,7 +550,7 @@ class StockEntry(StockController): from `tabStock Entry Detail` t1, `tabStock Entry` t2 where t1.parent = t2.name and t2.production_order = %s and t2.docstatus = 1 and t2.purpose = 'Material Transfer' - group by t1.item_code""", self.doc.production_order) + group by t1.item_code""", self.production_order) for t in result: issued_item_qty[t[0]] = flt(t[1]) @@ -558,14 +558,14 @@ class StockEntry(StockController): def add_to_stock_entry_detail(self, item_dict, bom_no=None, idx=None): if not idx: idx = 1 - expense_account, cost_center = frappe.db.get_values("Company", self.doc.company, \ + expense_account, cost_center = frappe.db.get_values("Company", self.company, \ ["default_expense_account", "cost_center"])[0] for d in item_dict: - se_child = self.doc.append('mtn_details', {}) + se_child = self.append('mtn_details', {}) se_child.idx = idx - se_child.s_warehouse = item_dict[d].get("from_warehouse", self.doc.from_warehouse) - se_child.t_warehouse = item_dict[d].get("to_warehouse", self.doc.to_warehouse) + se_child.s_warehouse = item_dict[d].get("from_warehouse", self.from_warehouse) + se_child.t_warehouse = item_dict[d].get("to_warehouse", self.to_warehouse) se_child.item_code = cstr(d) se_child.item_name = item_dict[d]["item_name"] se_child.description = item_dict[d]["description"] @@ -750,10 +750,10 @@ return_map = { @frappe.whitelist() def make_return_jv(stock_entry): se = frappe.bean("Stock Entry", stock_entry) - if not se.doc.purpose in ["Sales Return", "Purchase Return"]: + if not se.purpose in ["Sales Return", "Purchase Return"]: return - ref = get_return_doclist_and_details(se.doc.fields) + ref = get_return_doclist_and_details(se.fields) if ref.doclist[0].doctype == "Delivery Note": result = make_return_jv_from_delivery_note(se, ref) @@ -766,10 +766,10 @@ def make_return_jv(stock_entry): jv_list = [{ "__islocal": 1, "doctype": "Journal Voucher", - "posting_date": se.doc.posting_date, - "voucher_type": se.doc.purpose == "Sales Return" and "Credit Note" or "Debit Note", - "fiscal_year": se.doc.fiscal_year, - "company": se.doc.company + "posting_date": se.posting_date, + "voucher_type": se.purpose == "Sales Return" and "Credit Note" or "Debit Note", + "fiscal_year": se.fiscal_year, + "company": se.company }] from erpnext.accounts.utils import get_balance_on @@ -781,7 +781,7 @@ def make_return_jv(stock_entry): "account": r.get("account"), "against_invoice": r.get("against_invoice"), "against_voucher": r.get("against_voucher"), - "balance": get_balance_on(r.get("account"), se.doc.posting_date) \ + "balance": get_balance_on(r.get("account"), se.posting_date) \ if r.get("account") else 0 }) @@ -858,7 +858,7 @@ def make_return_jv_from_delivery_note(se, ref): children.append(account) if not parent: - parent = {"account": si.doc.debit_to} + parent = {"account": si.debit_to} break @@ -911,7 +911,7 @@ def make_return_jv_from_purchase_receipt(se, ref): children.append(account) if not parent: - parent = {"account": pi.doc.credit_to} + parent = {"account": pi.credit_to} break diff --git a/erpnext/stock/doctype/stock_entry/test_stock_entry.py b/erpnext/stock/doctype/stock_entry/test_stock_entry.py index dc27cc9fcc..bcdc0feaed 100644 --- a/erpnext/stock/doctype/stock_entry/test_stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/test_stock_entry.py @@ -52,10 +52,10 @@ class TestStockEntry(unittest.TestCase): stock_in_hand_account = frappe.db.get_value("Account", {"account_type": "Warehouse", "master_name": mr.doclist[1].t_warehouse}) - self.check_stock_ledger_entries("Stock Entry", mr.doc.name, + self.check_stock_ledger_entries("Stock Entry", mr.name, [["_Test Item", "_Test Warehouse - _TC", 50.0]]) - self.check_gl_entries("Stock Entry", mr.doc.name, + self.check_gl_entries("Stock Entry", mr.name, sorted([ [stock_in_hand_account, 5000.0, 0.0], ["Stock Adjustment - _TC", 0.0, 5000.0] @@ -65,10 +65,10 @@ class TestStockEntry(unittest.TestCase): mr.cancel() self.assertFalse(frappe.db.sql("""select * from `tabStock Ledger Entry` - where voucher_type='Stock Entry' and voucher_no=%s""", mr.doc.name)) + where voucher_type='Stock Entry' and voucher_no=%s""", mr.name)) self.assertFalse(frappe.db.sql("""select * from `tabGL Entry` - where voucher_type='Stock Entry' and voucher_no=%s""", mr.doc.name)) + where voucher_type='Stock Entry' and voucher_no=%s""", mr.name)) def test_material_issue_gl_entry(self): @@ -81,13 +81,13 @@ class TestStockEntry(unittest.TestCase): mi.insert() mi.submit() - self.check_stock_ledger_entries("Stock Entry", mi.doc.name, + self.check_stock_ledger_entries("Stock Entry", mi.name, [["_Test Item", "_Test Warehouse - _TC", -40.0]]) stock_in_hand_account = frappe.db.get_value("Account", {"account_type": "Warehouse", "master_name": mi.doclist[1].s_warehouse}) - self.check_gl_entries("Stock Entry", mi.doc.name, + self.check_gl_entries("Stock Entry", mi.name, sorted([ [stock_in_hand_account, 0.0, 4000.0], ["Stock Adjustment - _TC", 4000.0, 0.0] @@ -96,10 +96,10 @@ class TestStockEntry(unittest.TestCase): mi.cancel() self.assertFalse(frappe.db.sql("""select * from `tabStock Ledger Entry` - where voucher_type='Stock Entry' and voucher_no=%s""", mi.doc.name)) + where voucher_type='Stock Entry' and voucher_no=%s""", mi.name)) self.assertFalse(frappe.db.sql("""select * from `tabGL Entry` - where voucher_type='Stock Entry' and voucher_no=%s""", mi.doc.name)) + where voucher_type='Stock Entry' and voucher_no=%s""", mi.name)) self.assertEquals(frappe.db.get_value("Bin", {"warehouse": mi.doclist[1].s_warehouse, "item_code": mi.doclist[1].item_code}, "actual_qty"), 50) @@ -117,7 +117,7 @@ class TestStockEntry(unittest.TestCase): mtn.insert() mtn.submit() - self.check_stock_ledger_entries("Stock Entry", mtn.doc.name, + self.check_stock_ledger_entries("Stock Entry", mtn.name, [["_Test Item", "_Test Warehouse - _TC", -45.0], ["_Test Item", "_Test Warehouse 1 - _TC", 45.0]]) stock_in_hand_account = frappe.db.get_value("Account", {"account_type": "Warehouse", @@ -127,7 +127,7 @@ class TestStockEntry(unittest.TestCase): "master_name": mtn.doclist[1].t_warehouse}) - self.check_gl_entries("Stock Entry", mtn.doc.name, + self.check_gl_entries("Stock Entry", mtn.name, sorted([ [stock_in_hand_account, 0.0, 4500.0], [fixed_asset_account, 4500.0, 0.0], @@ -137,10 +137,10 @@ class TestStockEntry(unittest.TestCase): mtn.cancel() self.assertFalse(frappe.db.sql("""select * from `tabStock Ledger Entry` - where voucher_type='Stock Entry' and voucher_no=%s""", mtn.doc.name)) + where voucher_type='Stock Entry' and voucher_no=%s""", mtn.name)) self.assertFalse(frappe.db.sql("""select * from `tabGL Entry` - where voucher_type='Stock Entry' and voucher_no=%s""", mtn.doc.name)) + where voucher_type='Stock Entry' and voucher_no=%s""", mtn.name)) def test_repack_no_change_in_valuation(self): @@ -153,13 +153,13 @@ class TestStockEntry(unittest.TestCase): repack.insert() repack.submit() - self.check_stock_ledger_entries("Stock Entry", repack.doc.name, + self.check_stock_ledger_entries("Stock Entry", repack.name, [["_Test Item", "_Test Warehouse - _TC", -50.0], ["_Test Item Home Desktop 100", "_Test Warehouse - _TC", 1]]) gl_entries = frappe.db.sql("""select account, debit, credit from `tabGL Entry` where voucher_type='Stock Entry' and voucher_no=%s - order by account desc""", repack.doc.name, as_dict=1) + order by account desc""", repack.name, as_dict=1) self.assertFalse(gl_entries) set_perpetual_inventory(0) @@ -178,7 +178,7 @@ class TestStockEntry(unittest.TestCase): stock_in_hand_account = frappe.db.get_value("Account", {"account_type": "Warehouse", "master_name": repack.doclist[2].t_warehouse}) - self.check_gl_entries("Stock Entry", repack.doc.name, + self.check_gl_entries("Stock Entry", repack.name, sorted([ [stock_in_hand_account, 1000.0, 0.0], ["Stock Adjustment - _TC", 0.0, 1000.0], @@ -245,8 +245,8 @@ class TestStockEntry(unittest.TestCase): si.submit() se = frappe.bean(copy=test_records[0]) - se.doc.purpose = "Sales Return" - se.doc.sales_invoice_no = si.doc.name + se.purpose = "Sales Return" + se.sales_invoice_no = si.name se.doclist[1].qty = returned_qty se.doclist[1].transfer_qty = returned_qty self.assertRaises(NotUpdateStockError, se.insert) @@ -258,7 +258,7 @@ class TestStockEntry(unittest.TestCase): # insert a pos invoice with update stock si = frappe.bean(copy=sales_invoice_test_records[1]) - si.doc.is_pos = si.doc.update_stock = 1 + si.is_pos = si.update_stock = 1 si.doclist[1].warehouse = "_Test Warehouse - _TC" si.doclist[1].item_code = item_code si.doclist[1].qty = 5.0 @@ -272,10 +272,10 @@ class TestStockEntry(unittest.TestCase): # check if item is validated se = frappe.bean(copy=test_records[0]) - se.doc.purpose = "Sales Return" - se.doc.sales_invoice_no = si.doc.name - se.doc.posting_date = "2013-03-10" - se.doc.fiscal_year = "_Test Fiscal Year 2013" + se.purpose = "Sales Return" + se.sales_invoice_no = si.name + se.posting_date = "2013-03-10" + se.fiscal_year = "_Test Fiscal Year 2013" se.doclist[1].item_code = "_Test Item Home Desktop 200" se.doclist[1].qty = returned_qty se.doclist[1].transfer_qty = returned_qty @@ -285,10 +285,10 @@ class TestStockEntry(unittest.TestCase): # try again se = frappe.bean(copy=test_records[0]) - se.doc.purpose = "Sales Return" - se.doc.posting_date = "2013-03-10" - se.doc.fiscal_year = "_Test Fiscal Year 2013" - se.doc.sales_invoice_no = si.doc.name + se.purpose = "Sales Return" + se.posting_date = "2013-03-10" + se.fiscal_year = "_Test Fiscal Year 2013" + se.sales_invoice_no = si.name se.doclist[1].qty = returned_qty se.doclist[1].transfer_qty = returned_qty # in both cases item code remains _Test Item when returning @@ -330,11 +330,11 @@ class TestStockEntry(unittest.TestCase): self.assertEquals(actual_qty_0 - delivered_qty, actual_qty_1) - si_doclist = make_sales_invoice(dn.doc.name) + si_doclist = make_sales_invoice(dn.name) si = frappe.bean(si_doclist) - si.doc.posting_date = dn.doc.posting_date - si.doc.debit_to = "_Test Customer - _TC" + si.posting_date = dn.posting_date + si.debit_to = "_Test Customer - _TC" for d in si.get("entries"): d.income_account = "Sales - _TC" d.cost_center = "_Test Cost Center - _TC" @@ -343,10 +343,10 @@ class TestStockEntry(unittest.TestCase): # insert and submit stock entry for sales return se = frappe.bean(copy=test_records[0]) - se.doc.purpose = "Sales Return" - se.doc.delivery_note_no = dn.doc.name - se.doc.posting_date = "2013-03-10" - se.doc.fiscal_year = "_Test Fiscal Year 2013" + se.purpose = "Sales Return" + se.delivery_note_no = dn.name + se.posting_date = "2013-03-10" + se.fiscal_year = "_Test Fiscal Year 2013" se.doclist[1].qty = se.doclist[1].transfer_qty = returned_qty se.insert() @@ -367,11 +367,11 @@ class TestStockEntry(unittest.TestCase): def _test_sales_return_jv(self, se): from erpnext.stock.doctype.stock_entry.stock_entry import make_return_jv - jv_list = make_return_jv(se.doc.name) + jv_list = make_return_jv(se.name) self.assertEqual(len(jv_list), 3) self.assertEqual(jv_list[0].get("voucher_type"), "Credit Note") - self.assertEqual(jv_list[0].get("posting_date"), se.doc.posting_date) + self.assertEqual(jv_list[0].get("posting_date"), se.posting_date) self.assertEqual(jv_list[1].get("account"), "_Test Customer - _TC") self.assertEqual(jv_list[2].get("account"), "Sales - _TC") self.assertTrue(jv_list[1].get("against_invoice")) @@ -416,11 +416,11 @@ class TestStockEntry(unittest.TestCase): so.insert() so.submit() - dn_doclist = make_delivery_note(so.doc.name) + dn_doclist = make_delivery_note(so.name) dn = frappe.bean(dn_doclist) - dn.doc.status = "Draft" - dn.doc.posting_date = so.doc.delivery_date + dn.status = "Draft" + dn.posting_date = so.delivery_date dn.insert() dn.submit() @@ -428,11 +428,11 @@ class TestStockEntry(unittest.TestCase): self.assertEquals(actual_qty_0 - delivered_qty, actual_qty_1) - si_doclist = make_sales_invoice(so.doc.name) + si_doclist = make_sales_invoice(so.name) si = frappe.bean(si_doclist) - si.doc.posting_date = dn.doc.posting_date - si.doc.debit_to = "_Test Customer - _TC" + si.posting_date = dn.posting_date + si.debit_to = "_Test Customer - _TC" for d in si.get("entries"): d.income_account = "Sales - _TC" d.cost_center = "_Test Cost Center - _TC" @@ -441,10 +441,10 @@ class TestStockEntry(unittest.TestCase): # insert and submit stock entry for sales return se = frappe.bean(copy=test_records[0]) - se.doc.purpose = "Sales Return" - se.doc.delivery_note_no = dn.doc.name - se.doc.posting_date = "2013-03-10" - se.doc.fiscal_year = "_Test Fiscal Year 2013" + se.purpose = "Sales Return" + se.delivery_note_no = dn.name + se.posting_date = "2013-03-10" + se.fiscal_year = "_Test Fiscal Year 2013" se.doclist[1].qty = se.doclist[1].transfer_qty = returned_qty se.insert() @@ -474,11 +474,11 @@ class TestStockEntry(unittest.TestCase): self.assertEquals(actual_qty_0 + 5, actual_qty_1) - pi_doclist = make_purchase_invoice(pr.doc.name) + pi_doclist = make_purchase_invoice(pr.name) pi = frappe.bean(pi_doclist) - pi.doc.posting_date = pr.doc.posting_date - pi.doc.credit_to = "_Test Supplier - _TC" + pi.posting_date = pr.posting_date + pi.credit_to = "_Test Supplier - _TC" for d in pi.get("entries"): d.expense_account = "_Test Account Cost for Goods Sold - _TC" d.cost_center = "_Test Cost Center - _TC" @@ -487,16 +487,16 @@ class TestStockEntry(unittest.TestCase): d.cost_center = "_Test Cost Center - _TC" pi.run_method("calculate_taxes_and_totals") - pi.doc.bill_no = "NA" + pi.bill_no = "NA" pi.insert() pi.submit() # submit purchase return se = frappe.bean(copy=test_records[0]) - se.doc.purpose = "Purchase Return" - se.doc.purchase_receipt_no = pr.doc.name - se.doc.posting_date = "2013-03-01" - se.doc.fiscal_year = "_Test Fiscal Year 2013" + se.purpose = "Purchase Return" + se.purchase_receipt_no = pr.name + se.posting_date = "2013-03-01" + se.fiscal_year = "_Test Fiscal Year 2013" se.doclist[1].qty = se.doclist[1].transfer_qty = 5 se.doclist[1].s_warehouse = "_Test Warehouse - _TC" se.insert() @@ -508,7 +508,7 @@ class TestStockEntry(unittest.TestCase): frappe.db.set_default("company", self.old_default_company) - return se, pr.doc.name + return se, pr.name def test_over_stock_return(self): from erpnext.stock.doctype.stock_entry.stock_entry import StockOverReturnError @@ -519,10 +519,10 @@ class TestStockEntry(unittest.TestCase): # submit purchase return - return another 6 qtys so that exception is raised se = frappe.bean(copy=test_records[0]) - se.doc.purpose = "Purchase Return" - se.doc.purchase_receipt_no = pr_docname - se.doc.posting_date = "2013-03-01" - se.doc.fiscal_year = "_Test Fiscal Year 2013" + se.purpose = "Purchase Return" + se.purchase_receipt_no = pr_docname + se.posting_date = "2013-03-01" + se.fiscal_year = "_Test Fiscal Year 2013" se.doclist[1].qty = se.doclist[1].transfer_qty = 6 se.doclist[1].s_warehouse = "_Test Warehouse - _TC" @@ -530,11 +530,11 @@ class TestStockEntry(unittest.TestCase): def _test_purchase_return_jv(self, se): from erpnext.stock.doctype.stock_entry.stock_entry import make_return_jv - jv_list = make_return_jv(se.doc.name) + jv_list = make_return_jv(se.name) self.assertEqual(len(jv_list), 3) self.assertEqual(jv_list[0].get("voucher_type"), "Debit Note") - self.assertEqual(jv_list[0].get("posting_date"), se.doc.posting_date) + self.assertEqual(jv_list[0].get("posting_date"), se.posting_date) self.assertEqual(jv_list[1].get("account"), "_Test Supplier - _TC") self.assertEqual(jv_list[2].get("account"), "_Test Account Cost for Goods Sold - _TC") self.assertTrue(jv_list[1].get("against_voucher")) @@ -560,16 +560,16 @@ class TestStockEntry(unittest.TestCase): # submit purchase receipt po = frappe.bean(copy=purchase_order_test_records[0]) - po.doc.is_subcontracted = None + po.is_subcontracted = None po.doclist[1].item_code = "_Test Item" po.doclist[1].rate = 50 po.insert() po.submit() - pr_doclist = make_purchase_receipt(po.doc.name) + pr_doclist = make_purchase_receipt(po.name) pr = frappe.bean(pr_doclist) - pr.doc.posting_date = po.doc.transaction_date + pr.posting_date = po.transaction_date pr.insert() pr.submit() @@ -577,11 +577,11 @@ class TestStockEntry(unittest.TestCase): self.assertEquals(actual_qty_0 + 10, actual_qty_1) - pi_doclist = make_purchase_invoice(po.doc.name) + pi_doclist = make_purchase_invoice(po.name) pi = frappe.bean(pi_doclist) - pi.doc.posting_date = pr.doc.posting_date - pi.doc.credit_to = "_Test Supplier - _TC" + pi.posting_date = pr.posting_date + pi.credit_to = "_Test Supplier - _TC" for d in pi.get("entries"): d.expense_account = "_Test Account Cost for Goods Sold - _TC" d.cost_center = "_Test Cost Center - _TC" @@ -589,16 +589,16 @@ class TestStockEntry(unittest.TestCase): d.cost_center = "_Test Cost Center - _TC" pi.run_method("calculate_taxes_and_totals") - pi.doc.bill_no = "NA" + pi.bill_no = "NA" pi.insert() pi.submit() # submit purchase return se = frappe.bean(copy=test_records[0]) - se.doc.purpose = "Purchase Return" - se.doc.purchase_receipt_no = pr.doc.name - se.doc.posting_date = "2013-03-01" - se.doc.fiscal_year = "_Test Fiscal Year 2013" + se.purpose = "Purchase Return" + se.purchase_receipt_no = pr.name + se.posting_date = "2013-03-01" + se.fiscal_year = "_Test Fiscal Year 2013" se.doclist[1].qty = se.doclist[1].transfer_qty = 5 se.doclist[1].s_warehouse = "_Test Warehouse - _TC" se.insert() @@ -610,7 +610,7 @@ class TestStockEntry(unittest.TestCase): frappe.db.set_default("company", self.old_default_company) - return se, pr.doc.name + return se, pr.name def _clear_stock_account_balance(self): frappe.db.sql("delete from `tabStock Ledger Entry`") @@ -671,7 +671,7 @@ class TestStockEntry(unittest.TestCase): def test_serial_no_not_exists(self): self._clear_stock_account_balance() se = frappe.bean(copy=test_records[0]) - se.doc.purpose = "Material Issue" + se.purpose = "Material Issue" se.doclist[1].item_code = "_Test Serialized Item" se.doclist[1].qty = 2 se.doclist[1].s_warehouse = "_Test Warehouse 1 - _TC" @@ -709,7 +709,7 @@ class TestStockEntry(unittest.TestCase): self.test_serial_by_series() se = frappe.bean(copy=test_records[0]) - se.doc.purpose = "Material Transfer" + se.purpose = "Material Transfer" se.doclist[1].item_code = "_Test Serialized Item" se.doclist[1].qty = 1 se.doclist[1].transfer_qty = 1 @@ -725,7 +725,7 @@ class TestStockEntry(unittest.TestCase): serial_no = get_serial_nos(se.doclist[1].serial_no)[0] se = frappe.bean(copy=test_records[0]) - se.doc.purpose = "Material Transfer" + se.purpose = "Material Transfer" se.doclist[1].item_code = "_Test Serialized Item With Series" se.doclist[1].qty = 1 se.doclist[1].transfer_qty = 1 @@ -744,7 +744,7 @@ class TestStockEntry(unittest.TestCase): make_serialized_item() se = frappe.bean(copy=test_records[0]) - se.doc.purpose = "Material Transfer" + se.purpose = "Material Transfer" se.doclist[1].item_code = "_Test Serialized Item With Series" se.doclist[1].qty = 1 se.doclist[1].transfer_qty = 1 @@ -790,13 +790,13 @@ class TestStockEntry(unittest.TestCase): frappe.set_user("test@example.com") st1 = frappe.bean(copy=test_records[0]) - st1.doc.company = "_Test Company 1" + st1.company = "_Test Company 1" st1.doclist[1].t_warehouse="_Test Warehouse 2 - _TC1" self.assertRaises(BeanPermissionError, st1.insert) frappe.set_user("test2@example.com") st1 = frappe.bean(copy=test_records[0]) - st1.doc.company = "_Test Company 1" + st1.company = "_Test Company 1" st1.doclist[1].t_warehouse="_Test Warehouse 2 - _TC1" st1.insert() st1.submit() diff --git a/erpnext/stock/doctype/stock_ledger/stock_ledger.py b/erpnext/stock/doctype/stock_ledger/stock_ledger.py index 966e7ab656..d0fe60a7eb 100644 --- a/erpnext/stock/doctype/stock_ledger/stock_ledger.py +++ b/erpnext/stock/doctype/stock_ledger/stock_ledger.py @@ -45,7 +45,7 @@ class StockLedger(Document): sle = frappe.bean([args]) sle.ignore_permissions = 1 sle.insert() - return sle.doc.name + return sle.name def repost(self): """ diff --git a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py index dfc75d5b1a..69217b87a5 100644 --- a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py +++ b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py @@ -17,11 +17,11 @@ class StockLedgerEntry(DocListController): from erpnext.stock.utils import validate_warehouse_company self.validate_mandatory() self.validate_item() - validate_warehouse_company(self.doc.warehouse, self.doc.company) + validate_warehouse_company(self.warehouse, self.company) self.scrub_posting_time() from erpnext.accounts.utils import validate_fiscal_year - validate_fiscal_year(self.doc.posting_date, self.doc.fiscal_year, + validate_fiscal_year(self.posting_date, self.fiscal_year, self.meta.get_label("posting_date")) def on_submit(self): @@ -33,75 +33,75 @@ class StockLedgerEntry(DocListController): #check for item quantity available in stock def actual_amt_check(self): - if self.doc.batch_no: + if self.batch_no: batch_bal_after_transaction = flt(frappe.db.sql("""select sum(actual_qty) from `tabStock Ledger Entry` where warehouse=%s and item_code=%s and batch_no=%s""", - (self.doc.warehouse, self.doc.item_code, self.doc.batch_no))[0][0]) + (self.warehouse, self.item_code, self.batch_no))[0][0]) if batch_bal_after_transaction < 0: - self.doc.fields.update({ - 'batch_bal': batch_bal_after_transaction - self.doc.actual_qty + self.update({ + 'batch_bal': batch_bal_after_transaction - self.actual_qty }) frappe.throw("""Not enough quantity (requested: %(actual_qty)s, \ current: %(batch_bal)s in Batch %(batch_no)s for Item \ %(item_code)s at Warehouse %(warehouse)s \ - as on %(posting_date)s %(posting_time)s""" % self.doc.fields) + as on %(posting_date)s %(posting_time)s""" % self.fields) - self.doc.fields.pop('batch_bal') + self.pop('batch_bal') def validate_mandatory(self): mandatory = ['warehouse','posting_date','voucher_type','voucher_no','actual_qty','company'] for k in mandatory: - if not self.doc.fields.get(k): + if not self.get(k): msgprint("Stock Ledger Entry: '%s' is mandatory" % k, raise_exception = 1) elif k == 'warehouse': - if not frappe.db.exists("Warehouse", self.doc.fields.get(k)): + if not frappe.db.exists("Warehouse", self.get(k)): msgprint("Warehouse: '%s' does not exist in the system. Please check." % - self.doc.fields.get(k), raise_exception = 1) + self.get(k), raise_exception = 1) def validate_item(self): item_det = frappe.db.sql("""select name, has_batch_no, docstatus, is_stock_item, has_serial_no, serial_no_series from tabItem where name=%s""", - self.doc.item_code, as_dict=True)[0] + self.item_code, as_dict=True)[0] if item_det.is_stock_item != 'Yes': - frappe.throw("""Item: "%s" is not a Stock Item.""" % self.doc.item_code) + frappe.throw("""Item: "%s" is not a Stock Item.""" % self.item_code) # check if batch number is required - if item_det.has_batch_no =='Yes' and self.doc.voucher_type != 'Stock Reconciliation': - if not self.doc.batch_no: - frappe.throw("Batch number is mandatory for Item '%s'" % self.doc.item_code) + if item_det.has_batch_no =='Yes' and self.voucher_type != 'Stock Reconciliation': + if not self.batch_no: + frappe.throw("Batch number is mandatory for Item '%s'" % self.item_code) # check if batch belongs to item if not frappe.db.get_value("Batch", - {"item": self.doc.item_code, "name": self.doc.batch_no}): + {"item": self.item_code, "name": self.batch_no}): frappe.throw("'%s' is not a valid Batch Number for Item '%s'" % - (self.doc.batch_no, self.doc.item_code)) + (self.batch_no, self.item_code)) - if not self.doc.stock_uom: - self.doc.stock_uom = item_det.stock_uom + if not self.stock_uom: + self.stock_uom = item_det.stock_uom def check_stock_frozen_date(self): stock_frozen_upto = frappe.db.get_value('Stock Settings', None, 'stock_frozen_upto') or '' if stock_frozen_upto: stock_auth_role = frappe.db.get_value('Stock Settings', None,'stock_auth_role') - if getdate(self.doc.posting_date) <= getdate(stock_frozen_upto) and not stock_auth_role in frappe.user.get_roles(): + if getdate(self.posting_date) <= getdate(stock_frozen_upto) and not stock_auth_role in frappe.user.get_roles(): msgprint("You are not authorized to do / modify back dated stock entries before %s" % getdate(stock_frozen_upto).strftime('%d-%m-%Y'), raise_exception=StockFreezeError) stock_frozen_upto_days = int(frappe.db.get_value('Stock Settings', None, 'stock_frozen_upto_days') or 0) if stock_frozen_upto_days: stock_auth_role = frappe.db.get_value('Stock Settings', None,'stock_auth_role') - older_than_x_days_ago = (add_days(getdate(self.doc.posting_date), stock_frozen_upto_days) <= date.today()) + older_than_x_days_ago = (add_days(getdate(self.posting_date), stock_frozen_upto_days) <= date.today()) if older_than_x_days_ago and not stock_auth_role in frappe.user.get_roles(): msgprint("You are not authorized to do / modify back dated stock entries older than %d days ago" %stock_frozen_upto_days, raise_exception=StockFreezeError) def scrub_posting_time(self): - if not self.doc.posting_time or self.doc.posting_time == '00:0': - self.doc.posting_time = '00:00' + if not self.posting_time or self.posting_time == '00:0': + self.posting_time = '00:00' def on_doctype_update(): if not frappe.db.sql("""show index from `tabStock Ledger Entry` diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py index c4195c61d5..60f37e12f7 100644 --- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py @@ -28,10 +28,10 @@ class StockReconciliation(StockController): self.make_cancel_gl_entries() def validate_data(self): - if not self.doc.reconciliation_json: + if not self.reconciliation_json: return - data = json.loads(self.doc.reconciliation_json) + data = json.loads(self.reconciliation_json) # strip out extra columns (if any) data = [row[:4] for row in data] @@ -45,7 +45,7 @@ class StockReconciliation(StockController): if data.index(self.head_row) != 0: head_row_no = data.index(self.head_row) data = data[head_row_no:] - self.doc.reconciliation_json = json.dumps(data) + self.reconciliation_json = json.dumps(data) def _get_msg(row_num, msg): return _("Row # ") + ("%d: " % (row_num+head_row_no+2)) + _(msg) @@ -124,18 +124,18 @@ class StockReconciliation(StockController): row_template = ["item_code", "warehouse", "qty", "valuation_rate"] - if not self.doc.reconciliation_json: + if not self.reconciliation_json: msgprint(_("""Stock Reconciliation file not uploaded"""), raise_exception=1) - data = json.loads(self.doc.reconciliation_json) + data = json.loads(self.reconciliation_json) for row_num, row in enumerate(data[data.index(self.head_row)+1:]): row = frappe._dict(zip(row_template, row)) row["row_num"] = row_num previous_sle = get_previous_sle({ "item_code": row.item_code, "warehouse": row.warehouse, - "posting_date": self.doc.posting_date, - "posting_time": self.doc.posting_time + "posting_date": self.posting_date, + "posting_time": self.posting_time }) # check valuation rate mandatory @@ -238,14 +238,14 @@ class StockReconciliation(StockController): "doctype": "Stock Ledger Entry", "item_code": row.item_code, "warehouse": row.warehouse, - "posting_date": self.doc.posting_date, - "posting_time": self.doc.posting_time, - "voucher_type": self.doc.doctype, - "voucher_no": self.doc.name, - "company": self.doc.company, + "posting_date": self.posting_date, + "posting_time": self.posting_time, + "voucher_type": self.doctype, + "voucher_no": self.name, + "company": self.company, "stock_uom": frappe.db.get_value("Item", row.item_code, "stock_uom"), "voucher_detail_no": row.voucher_detail_no, - "fiscal_year": self.doc.fiscal_year, + "fiscal_year": self.fiscal_year, "is_cancelled": "No" }) args.update(opts) @@ -260,37 +260,37 @@ class StockReconciliation(StockController): existing_entries = frappe.db.sql("""select distinct item_code, warehouse from `tabStock Ledger Entry` where voucher_type=%s and voucher_no=%s""", - (self.doc.doctype, self.doc.name), as_dict=1) + (self.doctype, self.name), as_dict=1) # delete entries frappe.db.sql("""delete from `tabStock Ledger Entry` - where voucher_type=%s and voucher_no=%s""", (self.doc.doctype, self.doc.name)) + where voucher_type=%s and voucher_no=%s""", (self.doctype, self.name)) # repost future entries for selected item_code, warehouse for entries in existing_entries: update_entries_after({ "item_code": entries.item_code, "warehouse": entries.warehouse, - "posting_date": self.doc.posting_date, - "posting_time": self.doc.posting_time + "posting_date": self.posting_date, + "posting_time": self.posting_time }) def get_gl_entries(self, warehouse_account=None): - if not self.doc.cost_center: + if not self.cost_center: msgprint(_("Please enter Cost Center"), raise_exception=1) return super(DocType, self).get_gl_entries(warehouse_account, - self.doc.expense_account, self.doc.cost_center) + self.expense_account, self.cost_center) def validate_expense_account(self): if not cint(frappe.defaults.get_global_default("auto_accounting_for_stock")): return - if not self.doc.expense_account: + if not self.expense_account: msgprint(_("Please enter Expense Account"), raise_exception=1) elif not frappe.db.sql("""select * from `tabStock Ledger Entry`"""): - if frappe.db.get_value("Account", self.doc.expense_account, + if frappe.db.get_value("Account", self.expense_account, "report_type") == "Profit and Loss": msgprint(_("""Expense Account can not be a PL Account, as this stock \ reconciliation is an opening entry. \ diff --git a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py index 558e1f1458..ca1519cce6 100644 --- a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py @@ -52,7 +52,7 @@ class TestStockReconciliation(unittest.TestCase): # no gl entries gl_entries = frappe.db.sql("""select name from `tabGL Entry` where voucher_type = 'Stock Reconciliation' and voucher_no = %s""", - stock_reco.doc.name) + stock_reco.name) self.assertFalse(gl_entries) @@ -99,7 +99,7 @@ class TestStockReconciliation(unittest.TestCase): # no gl entries gl_entries = frappe.db.sql("""select name from `tabGL Entry` where voucher_type = 'Stock Reconciliation' and voucher_no = %s""", - stock_reco.doc.name) + stock_reco.name) self.assertFalse(gl_entries) def test_reco_fifo_gl_entries(self): @@ -226,8 +226,8 @@ class TestStockReconciliation(unittest.TestCase): pr.submit() pr1 = frappe.bean(copy=stock_entry) - pr1.doc.posting_date = "2012-12-15" - pr1.doc.posting_time = "02:00" + pr1.posting_date = "2012-12-15" + pr1.posting_time = "02:00" pr1.doclist[1].qty = 10 pr1.doclist[1].transfer_qty = 10 pr1.doclist[1].incoming_rate = 700 @@ -235,9 +235,9 @@ class TestStockReconciliation(unittest.TestCase): pr1.submit() pr2 = frappe.bean(copy=stock_entry) - pr2.doc.posting_date = "2012-12-25" - pr2.doc.posting_time = "03:00" - pr2.doc.purpose = "Material Issue" + pr2.posting_date = "2012-12-25" + pr2.posting_time = "03:00" + pr2.purpose = "Material Issue" pr2.doclist[1].s_warehouse = "_Test Warehouse - _TC" pr2.doclist[1].t_warehouse = None pr2.doclist[1].qty = 15 @@ -247,9 +247,9 @@ class TestStockReconciliation(unittest.TestCase): pr2.submit() pr3 = frappe.bean(copy=stock_entry) - pr3.doc.posting_date = "2012-12-31" - pr3.doc.posting_time = "08:00" - pr3.doc.purpose = "Material Issue" + pr3.posting_date = "2012-12-31" + pr3.posting_time = "08:00" + pr3.purpose = "Material Issue" pr3.doclist[1].s_warehouse = "_Test Warehouse - _TC" pr3.doclist[1].t_warehouse = None pr3.doclist[1].qty = 20 @@ -260,9 +260,9 @@ class TestStockReconciliation(unittest.TestCase): pr4 = frappe.bean(copy=stock_entry) - pr4.doc.posting_date = "2013-01-05" - pr4.doc.fiscal_year = "_Test Fiscal Year 2013" - pr4.doc.posting_time = "07:00" + pr4.posting_date = "2013-01-05" + pr4.fiscal_year = "_Test Fiscal Year 2013" + pr4.posting_time = "07:00" pr4.doclist[1].qty = 15 pr4.doclist[1].transfer_qty = 15 pr4.doclist[1].incoming_rate = 1200 diff --git a/erpnext/stock/doctype/stock_settings/stock_settings.py b/erpnext/stock/doctype/stock_settings/stock_settings.py index cb266ed434..b505394f1b 100644 --- a/erpnext/stock/doctype/stock_settings/stock_settings.py +++ b/erpnext/stock/doctype/stock_settings/stock_settings.py @@ -14,14 +14,14 @@ class StockSettings(Document): def validate(self): for key in ["item_naming_by", "item_group", "stock_uom", "allow_negative_stock"]: - frappe.db.set_default(key, self.doc.fields.get(key, "")) + frappe.db.set_default(key, self.get(key, "")) from erpnext.setup.doctype.naming_series.naming_series import set_by_naming_series set_by_naming_series("Item", "item_code", - self.doc.get("item_naming_by")=="Naming Series", hide_name_field=True) + self.get("item_naming_by")=="Naming Series", hide_name_field=True) stock_frozen_limit = 356 - submitted_stock_frozen = self.doc.stock_frozen_upto_days + submitted_stock_frozen = self.stock_frozen_upto_days if submitted_stock_frozen > stock_frozen_limit: - self.doc.stock_frozen_upto_days = stock_frozen_limit + self.stock_frozen_upto_days = stock_frozen_limit frappe.msgprint (_("`Freeze Stocks Older Than` should be smaller than %d days.") %stock_frozen_limit) diff --git a/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.py b/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.py index 62c80d2e60..6c49ed973a 100644 --- a/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.py +++ b/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.py @@ -14,38 +14,38 @@ class StockUomReplaceUtility(Document): self.doc, self.doclist = d,dl def validate_mandatory(self): - if not cstr(self.doc.item_code): + if not cstr(self.item_code): msgprint("Please Enter an Item.") raise Exception - if not cstr(self.doc.new_stock_uom): + if not cstr(self.new_stock_uom): msgprint("Please Enter New Stock UOM.") raise Exception - if cstr(self.doc.current_stock_uom) == cstr(self.doc.new_stock_uom): + if cstr(self.current_stock_uom) == cstr(self.new_stock_uom): msgprint("Current Stock UOM and Stock UOM are same.") raise Exception # check conversion factor - if not flt(self.doc.conversion_factor): + if not flt(self.conversion_factor): msgprint("Please Enter Conversion Factor.") raise Exception - stock_uom = frappe.db.get_value("Item", self.doc.item_code, "stock_uom") - if cstr(self.doc.new_stock_uom) == cstr(stock_uom): - msgprint("Item Master is already updated with New Stock UOM " + cstr(self.doc.new_stock_uom)) + stock_uom = frappe.db.get_value("Item", self.item_code, "stock_uom") + if cstr(self.new_stock_uom) == cstr(stock_uom): + msgprint("Item Master is already updated with New Stock UOM " + cstr(self.new_stock_uom)) raise Exception def update_item_master(self): - item_bean = frappe.bean("Item", self.doc.item_code) - item_bean.doc.stock_uom = self.doc.new_stock_uom + item_bean = frappe.bean("Item", self.item_code) + item_bean.stock_uom = self.new_stock_uom item_bean.save() - msgprint(_("Default UOM updated in item ") + self.doc.item_code) + msgprint(_("Default UOM updated in item ") + self.item_code) def update_bin(self): # update bin - if flt(self.doc.conversion_factor) != flt(1): + if flt(self.conversion_factor) != flt(1): frappe.db.sql("""update `tabBin` set stock_uom = %s, indented_qty = ifnull(indented_qty,0) * %s, @@ -54,12 +54,12 @@ class StockUomReplaceUtility(Document): planned_qty = ifnull(planned_qty,0) * %s, projected_qty = actual_qty + ordered_qty + indented_qty + planned_qty - reserved_qty - where item_code = %s""", (self.doc.new_stock_uom, self.doc.conversion_factor, - self.doc.conversion_factor, self.doc.conversion_factor, - self.doc.conversion_factor, self.doc.item_code)) + where item_code = %s""", (self.new_stock_uom, self.conversion_factor, + self.conversion_factor, self.conversion_factor, + self.conversion_factor, self.item_code)) else: frappe.db.sql("update `tabBin` set stock_uom = %s where item_code = %s", - (self.doc.new_stock_uom, self.doc.item_code) ) + (self.new_stock_uom, self.item_code) ) # acknowledge user msgprint(" All Bins Updated Successfully.") @@ -68,23 +68,23 @@ class StockUomReplaceUtility(Document): # update stock ledger entry from erpnext.stock.stock_ledger import update_entries_after - if flt(self.doc.conversion_factor) != flt(1): + if flt(self.conversion_factor) != flt(1): frappe.db.sql("""update `tabStock Ledger Entry` set stock_uom = %s, actual_qty = ifnull(actual_qty,0) * %s where item_code = %s""", - (self.doc.new_stock_uom, self.doc.conversion_factor, self.doc.item_code)) + (self.new_stock_uom, self.conversion_factor, self.item_code)) else: frappe.db.sql("""update `tabStock Ledger Entry` set stock_uom=%s - where item_code=%s""", (self.doc.new_stock_uom, self.doc.item_code)) + where item_code=%s""", (self.new_stock_uom, self.item_code)) # acknowledge user msgprint("Stock Ledger Entries Updated Successfully.") # update item valuation - if flt(self.doc.conversion_factor) != flt(1): + if flt(self.conversion_factor) != flt(1): wh = frappe.db.sql("select name from `tabWarehouse`") for w in wh: - update_entries_after({"item_code": self.doc.item_code, "warehouse": w[0]}) + update_entries_after({"item_code": self.item_code, "warehouse": w[0]}) # acknowledge user msgprint("Item Valuation Updated Successfully.") @@ -102,8 +102,8 @@ class StockUomReplaceUtility(Document): def validate_uom_integer_type(self): - current_is_integer = frappe.db.get_value("UOM", self.doc.current_stock_uom, "must_be_whole_number") - new_is_integer = frappe.db.get_value("UOM", self.doc.new_stock_uom, "must_be_whole_number") + current_is_integer = frappe.db.get_value("UOM", self.current_stock_uom, "must_be_whole_number") + new_is_integer = frappe.db.get_value("UOM", self.new_stock_uom, "must_be_whole_number") if current_is_integer and not new_is_integer: frappe.msgprint("New UOM must be of type Whole Number", raise_exception=True) @@ -111,7 +111,7 @@ class StockUomReplaceUtility(Document): if not current_is_integer and new_is_integer: frappe.msgprint("New UOM must NOT be of type Whole Number", raise_exception=True) - if current_is_integer and new_is_integer and cint(self.doc.conversion_factor)!=self.doc.conversion_factor: + if current_is_integer and new_is_integer and cint(self.conversion_factor)!=self.conversion_factor: frappe.msgprint("Conversion Factor cannot be fraction", raise_exception=True) @frappe.whitelist() diff --git a/erpnext/stock/doctype/warehouse/warehouse.py b/erpnext/stock/doctype/warehouse/warehouse.py index d098cfe576..d621985ff5 100644 --- a/erpnext/stock/doctype/warehouse/warehouse.py +++ b/erpnext/stock/doctype/warehouse/warehouse.py @@ -11,25 +11,25 @@ from frappe.model.document import Document class Warehouse(Document): def autoname(self): - suffix = " - " + frappe.db.get_value("Company", self.doc.company, "abbr") - if not self.doc.warehouse_name.endswith(suffix): - self.doc.name = self.doc.warehouse_name + suffix + suffix = " - " + frappe.db.get_value("Company", self.company, "abbr") + if not self.warehouse_name.endswith(suffix): + self.name = self.warehouse_name + suffix def validate(self): - if self.doc.email_id and not validate_email_add(self.doc.email_id): + if self.email_id and not validate_email_add(self.email_id): throw(_("Please enter valid Email Id")) self.update_parent_account() def update_parent_account(self): - if not self.doc.__islocal and (self.doc.create_account_under != - frappe.db.get_value("Warehouse", self.doc.name, "create_account_under")): + if not self.__islocal and (self.create_account_under != + frappe.db.get_value("Warehouse", self.name, "create_account_under")): warehouse_account = frappe.db.get_value("Account", - {"account_type": "Warehouse", "company": self.doc.company, - "master_name": self.doc.name}, ["name", "parent_account"]) - if warehouse_account and warehouse_account[1] != self.doc.create_account_under: + {"account_type": "Warehouse", "company": self.company, + "master_name": self.name}, ["name", "parent_account"]) + if warehouse_account and warehouse_account[1] != self.create_account_under: acc_bean = frappe.bean("Account", warehouse_account[0]) - acc_bean.doc.parent_account = self.doc.create_account_under + acc_bean.parent_account = self.create_account_under acc_bean.save() def on_update(self): @@ -38,74 +38,74 @@ class Warehouse(Document): def create_account_head(self): if cint(frappe.defaults.get_global_default("auto_accounting_for_stock")): if not frappe.db.get_value("Account", {"account_type": "Warehouse", - "master_name": self.doc.name}) and not frappe.db.get_value("Account", - {"account_name": self.doc.warehouse_name}): - if self.doc.fields.get("__islocal") or not frappe.db.get_value( - "Stock Ledger Entry", {"warehouse": self.doc.name}): + "master_name": self.name}) and not frappe.db.get_value("Account", + {"account_name": self.warehouse_name}): + if self.get("__islocal") or not frappe.db.get_value( + "Stock Ledger Entry", {"warehouse": self.name}): self.validate_parent_account() ac_bean = frappe.bean({ "doctype": "Account", - 'account_name': self.doc.warehouse_name, - 'parent_account': self.doc.create_account_under, + 'account_name': self.warehouse_name, + 'parent_account': self.create_account_under, 'group_or_ledger':'Ledger', - 'company':self.doc.company, + 'company':self.company, "account_type": "Warehouse", - "master_name": self.doc.name, + "master_name": self.name, "freeze_account": "No" }) ac_bean.ignore_permissions = True ac_bean.insert() - msgprint(_("Account Head") + ": " + ac_bean.doc.name + _(" created")) + msgprint(_("Account Head") + ": " + ac_bean.name + _(" created")) def validate_parent_account(self): - if not self.doc.create_account_under: + if not self.create_account_under: parent_account = frappe.db.get_value("Account", - {"account_name": "Stock Assets", "company": self.doc.company}) + {"account_name": "Stock Assets", "company": self.company}) if parent_account: - self.doc.create_account_under = parent_account + self.create_account_under = parent_account else: frappe.throw(_("Please enter account group under which account \ - for warehouse ") + self.doc.name +_(" will be created")) + for warehouse ") + self.name +_(" will be created")) def on_trash(self): # delete bin bins = frappe.db.sql("select * from `tabBin` where warehouse = %s", - self.doc.name, as_dict=1) + self.name, as_dict=1) for d in bins: if d['actual_qty'] or d['reserved_qty'] or d['ordered_qty'] or \ d['indented_qty'] or d['projected_qty'] or d['planned_qty']: throw("""Warehouse: %s can not be deleted as qty exists for item: %s""" - % (self.doc.name, d['item_code'])) + % (self.name, d['item_code'])) else: frappe.db.sql("delete from `tabBin` where name = %s", d['name']) warehouse_account = frappe.db.get_value("Account", - {"account_type": "Warehouse", "master_name": self.doc.name}) + {"account_type": "Warehouse", "master_name": self.name}) if warehouse_account: frappe.delete_doc("Account", warehouse_account) if frappe.db.sql("""select name from `tabStock Ledger Entry` - where warehouse = %s""", self.doc.name): + where warehouse = %s""", self.name): throw(_("""Warehouse can not be deleted as stock ledger entry exists for this warehouse.""")) def before_rename(self, olddn, newdn, merge=False): # Add company abbr if not provided from erpnext.setup.doctype.company.company import get_name_with_abbr - new_warehouse = get_name_with_abbr(newdn, self.doc.company) + new_warehouse = get_name_with_abbr(newdn, self.company) if merge: if not frappe.db.exists("Warehouse", new_warehouse): frappe.throw(_("Warehouse ") + new_warehouse +_(" does not exists")) - if self.doc.company != frappe.db.get_value("Warehouse", new_warehouse, "company"): + if self.company != frappe.db.get_value("Warehouse", new_warehouse, "company"): frappe.throw(_("Both Warehouse must belong to same Company")) frappe.db.sql("delete from `tabBin` where warehouse=%s", olddn) from erpnext.accounts.utils import rename_account_for - rename_account_for("Warehouse", olddn, newdn, merge, self.doc.company) + rename_account_for("Warehouse", olddn, newdn, merge, self.company) return new_warehouse diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index 3cd49d94b3..1bf431ad29 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -68,7 +68,7 @@ def get_item_details(args): apply_pricing_rule(out, args) if args.get("doctype") in ("Sales Invoice", "Delivery Note"): - if item_bean.doc.has_serial_no == "Yes" and not args.serial_no: + if item_bean.has_serial_no == "Yes" and not args.serial_no: out.serial_no = get_serial_nos_by_fifo(args, item_bean) if args.transaction_date and item.lead_time_days: @@ -153,7 +153,7 @@ def get_basic_details(args, item_bean): }) for fieldname in ("item_name", "item_group", "barcode", "brand", "stock_uom"): - out[fieldname] = item.fields.get(fieldname) + out[fieldname] = item.get(fieldname) return out @@ -174,7 +174,7 @@ def get_price_list_rate(args, item_bean, out): if not out.price_list_rate and args.transaction_type == "buying": from erpnext.stock.doctype.item.item import get_last_purchase_details - out.update(get_last_purchase_details(item_bean.doc.name, + out.update(get_last_purchase_details(item_bean.name, args.docname, args.conversion_rate)) def validate_price_list(args): diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index 4628b5b221..e812285e1a 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -53,7 +53,7 @@ def make_entry(args): sle.ignore_permissions = 1 sle.insert() sle.submit() - return sle.doc.name + return sle.name def delete_cancelled_entry(voucher_type, voucher_no): frappe.db.sql("""delete from `tabStock Ledger Entry` diff --git a/erpnext/stock/utils.py b/erpnext/stock/utils.py index e5099c46e2..981f674acf 100644 --- a/erpnext/stock/utils.py +++ b/erpnext/stock/utils.py @@ -297,7 +297,7 @@ def send_email_notification(mr_list): msg="""

Following Material Requests has been raised automatically \ based on item reorder level:

""" for mr in mr_list: - msg += "

" + mr.doc.name + """

+ msg += "

" + mr.name + """

""" for item in mr.get("indent_details"): msg += " - {%- for row in doclist.get({"doctype":"Sales Invoice Item"}) %} + {%- for row in doc.get({"doctype":"Sales Invoice Item"}) %} @@ -106,7 +106,7 @@ utils.fmt_money(doc.net_total_export, currency=doc.currency) }} - {%- for charge in doclist.get({"doctype":"Sales Taxes and Charges"}) -%} + {%- for charge in doc.get({"doctype":"Sales Taxes and Charges"}) -%} {%- if not charge.included_in_print_rate -%} diff --git a/erpnext/accounts/doctype/account/account.py b/erpnext/accounts/doctype/account/account.py index 094edd0d2c..59637a5979 100644 --- a/erpnext/accounts/doctype/account/account.py +++ b/erpnext/accounts/doctype/account/account.py @@ -40,13 +40,13 @@ class Account(Document): ["name", "group_or_ledger", "report_type"], as_dict=1) if not par: throw(_("Parent account does not exists")) - elif par[0]["name"] == self.name: + elif par["name"] == self.name: throw(_("You can not assign itself as parent account")) - elif par[0]["group_or_ledger"] != 'Group': + elif par["group_or_ledger"] != 'Group': throw(_("Parent account can not be a ledger")) - if par[0]["report_type"]: - self.report_type = par[0]["report_type"] + if par["report_type"]: + self.report_type = par["report_type"] def validate_duplicate_account(self): if self.get('__islocal') or not self.name: diff --git a/erpnext/accounts/doctype/accounts_settings/accounts_settings.py b/erpnext/accounts/doctype/accounts_settings/accounts_settings.py index bc950d59af..b7288e0469 100644 --- a/erpnext/accounts/doctype/accounts_settings/accounts_settings.py +++ b/erpnext/accounts/doctype/accounts_settings/accounts_settings.py @@ -25,5 +25,5 @@ class AccountsSettings(Document): frappe.throw(_("Company is missing in following warehouses") + ": \n" + "\n".join(warehouse_with_no_company)) for wh in warehouse_list: - wh_bean = frappe.get_doc("Warehouse", wh.name) - wh_bean.save() \ No newline at end of file + wh_doc = frappe.get_doc("Warehouse", wh.name) + wh_doc.save() \ No newline at end of file diff --git a/erpnext/accounts/doctype/budget_distribution/test_records.json b/erpnext/accounts/doctype/budget_distribution/test_records.json index 0637a088a0..7e8c640dd7 100644 --- a/erpnext/accounts/doctype/budget_distribution/test_records.json +++ b/erpnext/accounts/doctype/budget_distribution/test_records.json @@ -1 +1,44 @@ -[] \ No newline at end of file +[{ + "doctype": "Budget Distribution", + "distribution_id": "_Test Distribution", + "fiscal_year": "_Test Fiscal Year 2013", + "budget_distribution_details": [ + { + "month": "January", + "percentage_allocation": "8" + }, { + "month": "February", + "percentage_allocation": "8" + }, { + "month": "March", + "percentage_allocation": "8" + }, { + "month": "April", + "percentage_allocation": "8" + }, { + "month": "May", + "percentage_allocation": "8" + }, { + "month": "June", + "percentage_allocation": "8" + }, { + "month": "July", + "percentage_allocation": "8" + }, { + "month": "August", + "percentage_allocation": "8" + }, { + "month": "September", + "percentage_allocation": "8" + }, { + "month": "October", + "percentage_allocation": "8" + }, { + "month": "November", + "percentage_allocation": "10" + }, { + "month": "December", + "percentage_allocation": "10" + } + ] +}] diff --git a/erpnext/accounts/doctype/chart_of_accounts/import_charts.py b/erpnext/accounts/doctype/chart_of_accounts/import_charts.py index fd36bf8a86..9e60551665 100644 --- a/erpnext/accounts/doctype/chart_of_accounts/import_charts.py +++ b/erpnext/accounts/doctype/chart_of_accounts/import_charts.py @@ -13,13 +13,13 @@ def import_charts(): chart = json.loads(f.read()) country = frappe.db.get_value("Country", {"code": fname.split("_", 1)[0]}) if country: - bean = frappe.get_doc({ + doc = frappe.get_doc({ "doctype":"Chart of Accounts", "chart_name": chart.get("name"), "source_file": fname, "country": country }).insert() - print bean.name.encode("utf-8") + print doc.name.encode("utf-8") else: print "No chart for: " + chart.get("name").encode("utf-8") diff --git a/erpnext/accounts/doctype/cost_center/cost_center.py b/erpnext/accounts/doctype/cost_center/cost_center.py index ac69e75f13..7013ffb30d 100644 --- a/erpnext/accounts/doctype/cost_center/cost_center.py +++ b/erpnext/accounts/doctype/cost_center/cost_center.py @@ -13,7 +13,7 @@ class CostCenter(DocTypeNestedSet): def autoname(self): self.name = self.cost_center_name.strip() + ' - ' + \ - frappe.get_value("Company", self.company, "abbr") + frappe.db.get_value("Company", self.company, "abbr") def validate_mandatory(self): if not self.group_or_ledger: diff --git a/erpnext/accounts/doctype/fiscal_year/test_fiscal_year.py b/erpnext/accounts/doctype/fiscal_year/test_fiscal_year.py index d0e6c6cd0f..edceddb5f1 100644 --- a/erpnext/accounts/doctype/fiscal_year/test_fiscal_year.py +++ b/erpnext/accounts/doctype/fiscal_year/test_fiscal_year.py @@ -3,4 +3,6 @@ from __future__ import unicode_literals +import frappe + test_records = frappe.get_test_records('Fiscal Year') \ No newline at end of file diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher.py b/erpnext/accounts/doctype/journal_voucher/journal_voucher.py index 3af9a03766..9829a17954 100644 --- a/erpnext/accounts/doctype/journal_voucher/journal_voucher.py +++ b/erpnext/accounts/doctype/journal_voucher/journal_voucher.py @@ -349,8 +349,8 @@ def get_default_bank_cash_account(company, voucher_type): def get_payment_entry_from_sales_invoice(sales_invoice): from erpnext.accounts.utils import get_balance_on si = frappe.get_doc("Sales Invoice", sales_invoice) - jv = get_payment_entry(si.doc) - jv.remark = 'Payment received against Sales Invoice %(name)s. %(remarks)s' % si.fields + jv = get_payment_entry(si) + jv.remark = 'Payment received against Sales Invoice {0}. {1}'.format(si.name, si.remarks) # credit customer jv.doclist[1].account = si.debit_to @@ -367,8 +367,8 @@ def get_payment_entry_from_sales_invoice(sales_invoice): def get_payment_entry_from_purchase_invoice(purchase_invoice): from erpnext.accounts.utils import get_balance_on pi = frappe.get_doc("Purchase Invoice", purchase_invoice) - jv = get_payment_entry(pi.doc) - jv.remark = 'Payment against Purchase Invoice %(name)s. %(remarks)s' % pi.fields + jv = get_payment_entry(pi) + jv.remark = 'Payment against Purchase Invoice {0}. {1}'.format(pi.name, pi.remarks) # credit supplier jv.doclist[1].account = pi.credit_to @@ -384,7 +384,7 @@ def get_payment_entry_from_purchase_invoice(purchase_invoice): def get_payment_entry(doc): bank_account = get_default_bank_cash_account(doc.company, "Bank Voucher") - jv = frappe.new_bean('Journal Voucher') + jv = frappe.new_doc('Journal Voucher') jv.voucher_type = 'Bank Voucher' jv.company = doc.company diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.py b/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.py index 910e380dcf..25dbf9569c 100644 --- a/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.py +++ b/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.py @@ -6,5 +6,5 @@ import frappe from frappe.model.document import Document -class PurchaseTaxesAndCharges(Document): +class PurchaseTaxesandCharges(Document): pass \ No newline at end of file diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.py b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.py index fb9a0ab674..e93c57263f 100644 --- a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.py +++ b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.py @@ -5,5 +5,5 @@ from __future__ import unicode_literals import frappe from frappe.model.document import Document -class PurchaseTaxesAndChargesMaster(Document): +class PurchaseTaxesandChargesMaster(Document): pass diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index e9e9869864..ba34b49154 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -192,7 +192,7 @@ class SalesInvoice(SellingController): for item in self.get("entries"): if item.get('item_code'): for fname, val in get_pos_settings_item_details(pos, - frappe._dict(item.fields), pos).items(): + frappe._dict(item.as_dict()), pos).items(): if (not for_validate) or (for_validate and not item.get(fname)): item.set(fname, val) @@ -696,7 +696,7 @@ def manage_recurring_invoices(next_date=None, commit=True): raise Exception, exception_message def make_new_invoice(ref_wrapper, posting_date): - from frappe.model.bean import clone + from frappe.model.doc import clone from erpnext.accounts.utils import get_fiscal_year new_invoice = clone(ref_wrapper) @@ -736,7 +736,7 @@ def send_notification(new_rv): from frappe.core.doctype.print_format.print_format import get_html frappe.sendmail(new_rv.notification_email_address, subject="New Invoice : " + new_rv.name, - message = get_html(new_rv.doc, new_rv, "SalesInvoice")) + message = get_html(new_rv, new_rv, "SalesInvoice")) def notify_errors(inv, customer, owner): from frappe.utils.user import get_system_managers @@ -797,8 +797,8 @@ def make_delivery_note(source_name, target_doc=None): from frappe.model.mapper import get_mapped_doc def set_missing_values(source, target): - bean = frappe.get_doc(target) - bean.run_method("onload_post_render") + doc = frappe.get_doc(target) + doc.run_method("onload_post_render") def update_item(source_doc, target_doc, source_parent): target_doc.base_amount = (flt(source_doc.qty) - flt(source_doc.delivered_qty)) * \ diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index 7879dcb93d..109d0e505f 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -4,7 +4,7 @@ import frappe import unittest, json from frappe.utils import flt -from frappe.model.bean import DocstatusTransitionError, TimestampMismatchError +from frappe.model.doc import DocstatusTransitionError, TimestampMismatchError from erpnext.accounts.utils import get_stock_and_account_difference from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.py b/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.py index 8f621de86d..f4a9448534 100644 --- a/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.py +++ b/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.py @@ -6,5 +6,5 @@ import frappe from frappe.model.document import Document -class SalesTaxesAndCharges(Document): +class SalesTaxesandCharges(Document): pass \ No newline at end of file diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.py b/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.py index 76417e369e..f63a767ba5 100644 --- a/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.py +++ b/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.py @@ -6,7 +6,7 @@ import frappe from frappe.utils import cint from frappe.model.controller import DocListController -class SalesTaxesAndChargesMaster(DocListController): +class SalesTaxesandChargesMaster(DocListController): def validate(self): if self.is_default == 1: frappe.db.sql("""update `tabSales Taxes and Charges Master` set is_default = 0 diff --git a/erpnext/accounts/doctype/shipping_rule/shipping_rule.py b/erpnext/accounts/doctype/shipping_rule/shipping_rule.py index d27565e89a..9e88f222fe 100644 --- a/erpnext/accounts/doctype/shipping_rule/shipping_rule.py +++ b/erpnext/accounts/doctype/shipping_rule/shipping_rule.py @@ -66,7 +66,7 @@ class ShippingRule(DocListController): for i in xrange(0, len(self.shipping_rule_conditions)): for j in xrange(i+1, len(self.shipping_rule_conditions)): d1, d2 = self.shipping_rule_conditions[i], self.shipping_rule_conditions[j] - if d1.fields != d2.fields: + if d1.as_dict() != d2.as_dict(): # in our case, to_value can be zero, hence pass the from_value if so range_a = (d1.from_value, d1.to_value or d1.from_value) range_b = (d2.from_value, d2.to_value or d2.from_value) diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py index e86d6a9edb..a159a7383b 100644 --- a/erpnext/accounts/party.py +++ b/erpnext/accounts/party.py @@ -25,8 +25,8 @@ def _get_party_details(party=None, account=None, party_type="Customer", company= if not ignore_permissions and not frappe.has_permission(party_type, "read", party): frappe.throw("Not Permitted", frappe.PermissionError) - party_bean = frappe.get_doc(party_type, party) - party = party_bean.doc + party_doc = frappe.get_doc(party_type, party) + party = party_doc set_address_details(out, party, party_type) set_contact_details(out, party, party_type) @@ -41,7 +41,7 @@ def _get_party_details(party=None, account=None, party_type="Customer", company= out["sales_team"] = [{ "sales_person": d.sales_person, "sales_designation": d.sales_designation - } for d in party_bean.get("sales_team")] + } for d in party_doc.get("sales_team")] return out diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index 9458ecc9ce..afa9748add 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -184,8 +184,8 @@ def make_purchase_receipt(source_name, target_doc=None): from frappe.model.mapper import get_mapped_doc def set_missing_values(source, target): - bean = frappe.get_doc(target) - bean.run_method("set_missing_values") + doc = frappe.get_doc(target) + doc.run_method("set_missing_values") def update_item(obj, target, source_parent): target.qty = flt(obj.qty) - flt(obj.received_qty) @@ -223,8 +223,8 @@ def make_purchase_invoice(source_name, target_doc=None): from frappe.model.mapper import get_mapped_doc def set_missing_values(source, target): - bean = frappe.get_doc(target) - bean.run_method("set_missing_values") + doc = frappe.get_doc(target) + doc.run_method("set_missing_values") def update_item(obj, target, source_parent): target.amount = flt(obj.amount) - flt(obj.billed_amt) diff --git a/erpnext/buying/doctype/purchase_order/test_purchase_order.py b/erpnext/buying/doctype/purchase_order/test_purchase_order.py index 0acb83688f..358023383d 100644 --- a/erpnext/buying/doctype/purchase_order/test_purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/test_purchase_order.py @@ -26,8 +26,8 @@ class TestPurchaseOrder(unittest.TestCase): self.assertEquals(len(pr), len(test_records[0])) pr[0]["naming_series"] = "_T-Purchase Receipt-" - pr_bean = frappe.get_doc(pr) - pr_bean.insert() + pr_doc = frappe.get_doc(pr) + pr_doc.insert() def test_ordered_qty(self): frappe.db.sql("delete from tabBin") @@ -54,9 +54,9 @@ class TestPurchaseOrder(unittest.TestCase): pr[0]["posting_date"] = "2013-05-12" pr[0]["naming_series"] = "_T-Purchase Receipt-" pr[1]["qty"] = 4.0 - pr_bean = frappe.get_doc(pr) - pr_bean.insert() - pr_bean.submit() + pr_doc = frappe.get_doc(pr) + pr_doc.insert() + pr_doc.submit() self.assertEquals(flt(frappe.db.get_value("Bin", {"item_code": "_Test Item", "warehouse": "_Test Warehouse - _TC"}, "ordered_qty")), 6.0) @@ -67,9 +67,9 @@ class TestPurchaseOrder(unittest.TestCase): pr1[0]["naming_series"] = "_T-Purchase Receipt-" pr1[0]["posting_date"] = "2013-05-12" pr1[1]["qty"] = 8 - pr1_bean = frappe.get_doc(pr1) - pr1_bean.insert() - pr1_bean.submit() + pr1_doc = frappe.get_doc(pr1) + pr1_doc.insert() + pr1_doc.submit() self.assertEquals(flt(frappe.db.get_value("Bin", {"item_code": "_Test Item", "warehouse": "_Test Warehouse - _TC"}, "ordered_qty")), 0.0) diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py index ff7e6df6ec..e937735111 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py @@ -55,9 +55,9 @@ def make_purchase_order(source_name, target_doc=None): from frappe.model.mapper import get_mapped_doc def set_missing_values(source, target): - bean = frappe.get_doc(target) - bean.run_method("set_missing_values") - bean.run_method("get_schedule_dates") + doc = frappe.get_doc(target) + doc.run_method("set_missing_values") + doc.run_method("get_schedule_dates") def update_item(obj, target, source_parent): target.conversion_factor = 1 diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 083f0a6aaa..1b050d7fe5 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -86,15 +86,16 @@ class AccountsController(TransactionBase): def set_missing_item_details(self): """set missing item values""" from erpnext.stock.get_item_details import get_item_details - for item in self.get(self.fname): - if item.get("item_code"): - args = item.fields.copy() - args.update(self.fields) - ret = get_item_details(args) - for fieldname, value in ret.items(): - if self.meta.get_field(fieldname, parentfield=self.fname) and \ - item.get(fieldname) is None and value is not None: - item.set(fieldname, value) + if hasattr(self, "fname"): + for item in self.get(self.fname): + if item.get("item_code"): + args = item.as_dict() + args.update(self.as_dict()) + ret = get_item_details(args) + for fieldname, value in ret.items(): + if self.meta.get_field(fieldname, parentfield=self.fname) and \ + item.get(fieldname) is None and value is not None: + item.set(fieldname, value) def set_taxes(self, tax_parentfield, tax_master_field): if not self.meta.get_field(tax_parentfield): diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index 77b62caf8a..bcc46bbc20 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -32,12 +32,12 @@ class SellingController(StockController): self.set_taxes("other_charges", "taxes_and_charges") def set_missing_lead_customer_details(self): - if self.customer: + if getattr(self, "customer", None): from erpnext.accounts.party import _get_party_details self.update_if_missing(_get_party_details(self.customer, ignore_permissions=self.ignore_permissions)) - elif self.lead: + elif getattr(self, "lead", None): from erpnext.selling.doctype.lead.lead import get_lead_details self.update_if_missing(get_lead_details(self.lead)) diff --git a/erpnext/home/__init__.py b/erpnext/home/__init__.py index 25e92aa5f9..ea8997a814 100644 --- a/erpnext/home/__init__.py +++ b/erpnext/home/__init__.py @@ -86,7 +86,7 @@ def update_feed(doc, method=None): if method in ['on_update', 'on_submit']: subject, color = feed_dict.get(doc.doctype, [None, None]) if subject: - make_feed('', doc.doctype, doc.name, doc.owner, subject % doc.fields, color) + make_feed('', doc.doctype, doc.name, doc.owner, subject % doc.as_dict(), color) def make_comment_feed(doc, method): """add comment to feed""" diff --git a/erpnext/hr/doctype/department/test_records.json b/erpnext/hr/doctype/department/test_records.json index 0637a088a0..5bb5871d4c 100644 --- a/erpnext/hr/doctype/department/test_records.json +++ b/erpnext/hr/doctype/department/test_records.json @@ -1 +1,4 @@ -[] \ No newline at end of file +[ + {"doctype":"Department", "department_name":"_Test Department"}, + {"doctype":"Department", "department_name":"_Test Department 1"} +] \ No newline at end of file diff --git a/erpnext/hr/doctype/hr_settings/hr_settings.json b/erpnext/hr/doctype/hr_settings/hr_settings.json index 15443db685..227a3b3513 100644 --- a/erpnext/hr/doctype/hr_settings/hr_settings.json +++ b/erpnext/hr/doctype/hr_settings/hr_settings.json @@ -43,7 +43,7 @@ "icon": "icon-cog", "idx": 1, "issingle": 1, - "modified": "2014-02-19 17:40:18.000000", + "modified": "2014-02-19 17:40:18.000001", "modified_by": "Administrator", "module": "HR", "name": "HR Settings", diff --git a/erpnext/hr/doctype/job_applicant/get_job_applications.py b/erpnext/hr/doctype/job_applicant/get_job_applications.py index a94325d562..e4a8d70cf5 100644 --- a/erpnext/hr/doctype/job_applicant/get_job_applications.py +++ b/erpnext/hr/doctype/job_applicant/get_job_applications.py @@ -37,7 +37,7 @@ class JobsMailbox(POP3Mailbox): applicant.ignore_mandatory = True applicant.insert() - mail.save_attachments_in_doc(applicant.doc) + mail.save_attachments_in_doc(applicant) _make(content=mail.content, sender=mail.from_email, subject=mail.subject or "No Subject", doctype="Job Applicant", name=applicant.name, sent_or_received="Received") diff --git a/erpnext/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py index f2f95bfa36..e1bc1f9ae4 100755 --- a/erpnext/hr/doctype/leave_application/leave_application.py +++ b/erpnext/hr/doctype/leave_application/leave_application.py @@ -136,7 +136,7 @@ class LeaveApplication(DocListController): and (from_date between %(from_date)s and %(to_date)s or to_date between %(from_date)s and %(to_date)s or %(from_date)s between from_date and to_date) - and name != %(name)s""", self.fields, as_dict = 1): + and name != %(name)s""", self.as_dict(), as_dict = 1): msgprint("Employee : %s has already applied for %s between %s and %s on %s. Please refer Leave Application : %s" % (self.employee, cstr(d['leave_type']), formatdate(d['from_date']), formatdate(d['to_date']), formatdate(d['posting_date']), d['name'], d['name']), raise_exception = OverlapError) diff --git a/erpnext/hr/doctype/salary_manager/salary_manager.py b/erpnext/hr/doctype/salary_manager/salary_manager.py index 5bb0be56da..05d73c7f49 100644 --- a/erpnext/hr/doctype/salary_manager/salary_manager.py +++ b/erpnext/hr/doctype/salary_manager/salary_manager.py @@ -129,11 +129,11 @@ class SalaryManager(Document): for ss in ss_list: ss_obj = frappe.get_doc("Salary Slip",ss[0]) try: - frappe.db.set(ss_obj.doc, 'email_check', cint(self.send_mail)) + frappe.db.set(ss_obj, 'email_check', cint(self.send_mail)) if cint(self.send_email) == 1: ss_obj.send_mail_funct() - frappe.db.set(ss_obj.doc, 'docstatus', 1) + frappe.db.set(ss_obj, 'docstatus', 1) except Exception,e: not_submitted_ss.append(ss[0]) msgprint(e) diff --git a/erpnext/manufacturing/doctype/production_order/production_order.py b/erpnext/manufacturing/doctype/production_order/production_order.py index 75f40fa1ef..af92413be6 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.py +++ b/erpnext/manufacturing/doctype/production_order/production_order.py @@ -153,7 +153,7 @@ def get_item_details(item): def make_stock_entry(production_order_id, purpose): production_order = frappe.get_doc("Production Order", production_order_id) - stock_entry = frappe.new_bean("Stock Entry") + stock_entry = frappe.new_doc("Stock Entry") stock_entry.purpose = purpose stock_entry.production_order = production_order_id stock_entry.company = production_order.company diff --git a/erpnext/manufacturing/doctype/production_order/test_production_order.py b/erpnext/manufacturing/doctype/production_order/test_production_order.py index 1af4815aa1..d7d41988bb 100644 --- a/erpnext/manufacturing/doctype/production_order/test_production_order.py +++ b/erpnext/manufacturing/doctype/production_order/test_production_order.py @@ -17,9 +17,9 @@ class TestProductionOrder(unittest.TestCase): frappe.db.sql("""delete from `tabBin`""") frappe.db.sql("""delete from `tabGL Entry`""") - pro_bean = frappe.copy_doc(test_records[0]) - pro_bean.insert() - pro_bean.submit() + pro_doc = frappe.copy_doc(test_records[0]) + pro_doc.insert() + pro_doc.submit() from erpnext.stock.doctype.stock_entry.test_stock_entry import test_records as se_test_records mr1 = frappe.copy_doc(se_test_records[0]) @@ -31,7 +31,7 @@ class TestProductionOrder(unittest.TestCase): mr2.insert() mr2.submit() - stock_entry = make_stock_entry(pro_bean.name, "Manufacture/Repack") + stock_entry = make_stock_entry(pro_doc.name, "Manufacture/Repack") stock_entry = frappe.get_doc(stock_entry) stock_entry.fiscal_year = "_Test Fiscal Year 2013" stock_entry.fg_completed_qty = 4 @@ -40,12 +40,12 @@ class TestProductionOrder(unittest.TestCase): stock_entry.run_method("get_items") stock_entry.submit() - self.assertEqual(frappe.db.get_value("Production Order", pro_bean.name, + self.assertEqual(frappe.db.get_value("Production Order", pro_doc.name, "produced_qty"), 4) self.assertEqual(frappe.db.get_value("Bin", {"item_code": "_Test FG Item", "warehouse": "_Test Warehouse 1 - _TC"}, "planned_qty"), 6) - return pro_bean.name + return pro_doc.name def test_over_production(self): from erpnext.stock.doctype.stock_entry.stock_entry import StockOverProductionError diff --git a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py index c94a72ca43..e3fe7c3d9a 100644 --- a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py +++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py @@ -214,7 +214,7 @@ class ProductionPlanningTool(Document): pro_list = [] for key in items: - pro = frappe.new_bean("Production Order") + pro = frappe.new_doc("Production Order") pro.update(items[key]) frappe.flags.mute_messages = True diff --git a/erpnext/selling/doctype/lead/get_leads.py b/erpnext/selling/doctype/lead/get_leads.py index 661021ef0a..b765db6237 100644 --- a/erpnext/selling/doctype/lead/get_leads.py +++ b/erpnext/selling/doctype/lead/get_leads.py @@ -34,8 +34,8 @@ def add_sales_communication(subject, content, sender, real_name, mail=None, if mail: # save attachments to parent if from mail - bean = frappe.get_doc(parent_doctype, parent_name) - mail.save_attachments_in_doc(bean.doc) + doc = frappe.get_doc(parent_doctype, parent_name) + mail.save_attachments_in_doc(doc) class SalesMailbox(POP3Mailbox): def setup(self, args=None): diff --git a/erpnext/selling/doctype/lead/lead.py b/erpnext/selling/doctype/lead/lead.py index df57cf5bc1..2c16a1d7e0 100644 --- a/erpnext/selling/doctype/lead/lead.py +++ b/erpnext/selling/doctype/lead/lead.py @@ -42,8 +42,7 @@ class Lead(SellingController): "owner": self.lead_owner, "subject": ('Contact ' + cstr(self.lead_name)), "description": ('Contact ' + cstr(self.lead_name)) + \ - (self.contact_by and ('. By : ' + cstr(self.contact_by)) or '') + \ - (self.remark and ('.To Discuss : ' + cstr(self.remark)) or '') + (self.contact_by and ('. By : ' + cstr(self.contact_by)) or '') }, force) def check_email_id_is_unique(self): @@ -117,7 +116,7 @@ def make_opportunity(source_name, target_doc=None): } }}, target_doc) - return [d if isinstance(d, dict) else d.fields for d in doclist] + return doclist @frappe.whitelist() def get_lead_details(lead): @@ -126,8 +125,8 @@ def get_lead_details(lead): from erpnext.accounts.party import set_address_details out = frappe._dict() - lead_bean = frappe.get_doc("Lead", lead) - lead = lead_bean.doc + lead_doc = frappe.get_doc("Lead", lead) + lead = lead_doc out.update({ "territory": lead.territory, diff --git a/erpnext/selling/doctype/lead/test_lead.py b/erpnext/selling/doctype/lead/test_lead.py index 697f2e156f..b2533e0819 100644 --- a/erpnext/selling/doctype/lead/test_lead.py +++ b/erpnext/selling/doctype/lead/test_lead.py @@ -3,11 +3,11 @@ from __future__ import unicode_literals -test_records = frappe.get_test_records('Lead') - import frappe import unittest +test_records = frappe.get_test_records('Lead') + class TestLead(unittest.TestCase): def test_make_customer(self): print "test_make_customer" diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index 42b3596f3e..d420e967b2 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -253,8 +253,8 @@ class SalesOrder(SellingController): return "order" if self.docstatus==1 else None def set_missing_values(source, target): - bean = frappe.get_doc(target) - bean.run_method("onload_post_render") + doc = frappe.get_doc(target) + doc.run_method("onload_post_render") @frappe.whitelist() def make_material_request(source_name, target_doc=None): @@ -277,7 +277,7 @@ def make_material_request(source_name, target_doc=None): } }, target_doc, postprocess) - return [(d if isinstance(d, dict) else d.fields) for d in doclist] + return doclist @frappe.whitelist() def make_delivery_note(source_name, target_doc=None): @@ -322,9 +322,9 @@ def make_delivery_note(source_name, target_doc=None): @frappe.whitelist() def make_sales_invoice(source_name, target_doc=None): def set_missing_values(source, target): - bean = frappe.get_doc(target) - bean.is_pos = 0 - bean.run_method("onload_post_render") + doc = frappe.get_doc(target) + doc.is_pos = 0 + doc.run_method("onload_post_render") def update_item(obj, target, source_parent): target.amount = flt(obj.amount) - flt(obj.billed_amt) diff --git a/erpnext/selling/doctype/sales_order/test_sales_order.py b/erpnext/selling/doctype/sales_order/test_sales_order.py index e56de33db5..435ad65757 100644 --- a/erpnext/selling/doctype/sales_order/test_sales_order.py +++ b/erpnext/selling/doctype/sales_order/test_sales_order.py @@ -281,21 +281,20 @@ class TestSalesOrder(unittest.TestCase): def test_warehouse_user(self): frappe.defaults.add_default("Warehouse", "_Test Warehouse 1 - _TC1", "test@example.com", "Restriction") - frappe.get_doc("User", "test@example.com").get_controller()\ + frappe.get_doc("User", "test@example.com")\ .add_roles("Sales User", "Sales Manager", "Material User", "Material Manager") - frappe.get_doc("User", "test2@example.com").get_controller()\ + frappe.get_doc("User", "test2@example.com")\ .add_roles("Sales User", "Sales Manager", "Material User", "Material Manager") frappe.set_user("test@example.com") - from frappe.model.bean import BeanPermissionError so = frappe.copy_doc(test_records[0]) so.company = "_Test Company 1" so.conversion_rate = 0.02 so.plc_conversion_rate = 0.02 so.doclist[1].warehouse = "_Test Warehouse 2 - _TC1" - self.assertRaises(BeanPermissionError, so.insert) + self.assertRaises(frappe.PermissionError, so.insert) frappe.set_user("test2@example.com") so.insert() diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py index 1880ffd3cd..111a180257 100644 --- a/erpnext/setup/doctype/company/company.py +++ b/erpnext/setup/doctype/company/company.py @@ -78,7 +78,7 @@ class Company(Document): "title": self.name + " Home", "published": 1, "description": "Standard Home Page for " + self.name, - "main_section": webfile.read() % self.fields + "main_section": webfile.read() % self.as_dict() }).insert() # update in home page in settings @@ -163,12 +163,12 @@ class Company(Document): ] for cc in cc_list: cc.update({"doctype": "Cost Center"}) - cc_bean = frappe.get_doc(cc) - cc_bean.ignore_permissions = True + cc_doc = frappe.get_doc(cc) + cc_doc.ignore_permissions = True if cc.get("cost_center_name") == self.name: - cc_bean.ignore_mandatory = True - cc_bean.insert() + cc_doc.ignore_mandatory = True + cc_doc.insert() frappe.db.set(self, "cost_center", "Main - " + self.abbr) diff --git a/erpnext/setup/doctype/company/test_company.py b/erpnext/setup/doctype/company/test_company.py index 570cd23aa9..06db121531 100644 --- a/erpnext/setup/doctype/company/test_company.py +++ b/erpnext/setup/doctype/company/test_company.py @@ -13,7 +13,7 @@ class TestCompany(unittest.TestCase): print "Country: ", country print "Chart Name: ", chart_name - company_bean = frappe.get_doc({ + company_doc = frappe.get_doc({ "doctype": "Company", "company_name": "_Test Company 2", "abbr": "_TC2", @@ -22,7 +22,7 @@ class TestCompany(unittest.TestCase): "chart_of_accounts": chart_name }) - company_bean.insert() + company_doc.insert() self.assertTrue(frappe.db.sql("""select count(*) from tabAccount where company='_Test Company 2'""")[0][0] > 10) diff --git a/erpnext/setup/doctype/global_defaults/global_defaults.py b/erpnext/setup/doctype/global_defaults/global_defaults.py index a9896dcd16..dce4f60587 100644 --- a/erpnext/setup/doctype/global_defaults/global_defaults.py +++ b/erpnext/setup/doctype/global_defaults/global_defaults.py @@ -60,13 +60,13 @@ class GlobalDefaults(Document): raise_exception=1) def update_control_panel(self): - cp_bean = frappe.get_doc("Control Panel") + cp_doc = frappe.get_doc("Control Panel") if self.country: - cp_bean.country = self.country + cp_doc.country = self.country if self.time_zone: - cp_bean.time_zone = self.time_zone - cp_bean.ignore_permissions = True - cp_bean.save() + cp_doc.time_zone = self.time_zone + cp_doc.ignore_permissions = True + cp_doc.save() def get_defaults(self): return frappe.defaults.get_defaults() diff --git a/erpnext/setup/doctype/item_group/test_item_group.py b/erpnext/setup/doctype/item_group/test_item_group.py index ae23499620..6f1d4dbd71 100644 --- a/erpnext/setup/doctype/item_group/test_item_group.py +++ b/erpnext/setup/doctype/item_group/test_item_group.py @@ -183,9 +183,9 @@ class TestItem(unittest.TestCase): for name in frappe.db.sql_list("""select name from `tabItem Group` where parent_item_group='_Test Item Group C'"""): - bean = frappe.get_doc("Item Group", name) - bean.parent_item_group = "_Test Item Group B" - bean.save() + doc = frappe.get_doc("Item Group", name) + doc.parent_item_group = "_Test Item Group B" + doc.save() self.test_basic_tree() diff --git a/erpnext/setup/doctype/naming_series/naming_series.py b/erpnext/setup/doctype/naming_series/naming_series.py index cf2c29fe1f..e93af3c387 100644 --- a/erpnext/setup/doctype/naming_series/naming_series.py +++ b/erpnext/setup/doctype/naming_series/naming_series.py @@ -169,6 +169,6 @@ def set_by_naming_series(doctype, fieldname, naming_series, hide_name_field=True ifnull({fieldname}, '')=''""".format(doctype=doctype, fieldname=fieldname)) def get_default_naming_series(doctype): - naming_series = frappe.model.get_meta(doctype).get_field("naming_series").options or "" + naming_series = frappe.get_meta(doctype).get_field("naming_series").options or "" naming_series = naming_series.split("\n") return naming_series[0] or naming_series[1] \ No newline at end of file diff --git a/erpnext/setup/install.py b/erpnext/setup/install.py index a7e91d1605..6f4669eeae 100644 --- a/erpnext/setup/install.py +++ b/erpnext/setup/install.py @@ -139,7 +139,7 @@ def feature_setup(): def set_single_defaults(): for dt in frappe.db.sql_list("""select name from `tabDocType` where issingle=1"""): default_values = frappe.db.sql("""select fieldname, `default` from `tabDocField` - where parent=%s""", dt, as_dict=True) + where parent=%s""", dt) if default_values: try: b = frappe.get_doc(dt, dt) diff --git a/erpnext/setup/page/setup_wizard/setup_wizard.py b/erpnext/setup/page/setup_wizard/setup_wizard.py index d635e08e28..61a3c71ac3 100644 --- a/erpnext/setup/page/setup_wizard/setup_wizard.py +++ b/erpnext/setup/page/setup_wizard/setup_wizard.py @@ -202,7 +202,7 @@ def create_email_digest(): # scheduler errors digest if companies: - edigest = frappe.new_bean("Email Digest") + edigest = frappe.new_doc("Email Digest") edigest.update({ "name": "Scheduler Errors", "company": companies[0], diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index 9b3095dd1d..8dcdde1a06 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -222,9 +222,8 @@ class DeliveryNote(SellingController): AND docstatus = 1""", self.name) if res: - from frappe.model.bean import Bean for r in res: - ps = Bean(dt='Packing Slip', dn=r[0]) + ps = frappe.get_doc('Packing Slip', r[0]) ps.cancel() frappe.msgprint(_("Packing Slip(s) Cancelled")) diff --git a/erpnext/stock/doctype/item_price/test_item_price.py b/erpnext/stock/doctype/item_price/test_item_price.py index a1a10bae55..1a430bf9f0 100644 --- a/erpnext/stock/doctype/item_price/test_item_price.py +++ b/erpnext/stock/doctype/item_price/test_item_price.py @@ -8,7 +8,7 @@ import frappe class TestItem(unittest.TestCase): def test_duplicate_item(self): from erpnext.stock.doctype.item_price.item_price import ItemPriceDuplicateItem - bean = frappe.copy_doc(test_records[0]) - self.assertRaises(ItemPriceDuplicateItem, bean.insert) + doc = frappe.copy_doc(test_records[0]) + self.assertRaises(ItemPriceDuplicateItem, doc.insert) test_records = frappe.get_test_records('Item Price') \ No newline at end of file diff --git a/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.py b/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.py index 968969d267..e7cb41035b 100644 --- a/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.py +++ b/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.py @@ -34,13 +34,13 @@ class LandedCostWizard(Document): total_amt = self.get_total_pr_amt(purchase_receipts) for pr in purchase_receipts: - pr_bean = frappe.get_doc('Purchase Receipt', pr) - pr_items = pr_bean.get("purchase_tax_details") + pr_doc = frappe.get_doc('Purchase Receipt', pr) + pr_items = pr_doc.get("purchase_tax_details") for lc in self.get("landed_cost_details"): - amt = flt(lc.amount) * flt(pr_bean.net_total)/ flt(total_amt) + amt = flt(lc.amount) * flt(pr_doc.net_total)/ flt(total_amt) - matched_row = pr_bean.get("other_charges", { + matched_row = pr_doc.get("other_charges", { "category": "Valuation", "add_deduct_tax": "Add", "charge_type": "Actual", @@ -48,7 +48,7 @@ class LandedCostWizard(Document): }) if not matched_row: # add if not exists - ch = pr_bean.append("other_charges") + ch = pr_doc.append("other_charges") ch.category = 'Valuation' ch.add_deduct_tax = 'Add' ch.charge_type = 'Actual' @@ -64,8 +64,8 @@ class LandedCostWizard(Document): matched_row[0].tax_amount = amt matched_row[0].cost_center = lc.cost_center - pr_bean.run_method("validate") - for d in pr_bean.get_all_children(): + pr_doc.run_method("validate") + for d in pr_doc.get_all_children(): d.db_update() def get_total_pr_amt(self, purchase_receipts): @@ -75,9 +75,9 @@ class LandedCostWizard(Document): def cancel_pr(self, purchase_receipts): for pr in purchase_receipts: - pr_bean = frappe.get_doc("Purchase Receipt", pr) + pr_doc = frappe.get_doc("Purchase Receipt", pr) - pr_bean.run_method("update_ordered_qty") + pr_doc.run_method("update_ordered_qty") frappe.db.sql("""delete from `tabStock Ledger Entry` where voucher_type='Purchase Receipt' and voucher_no=%s""", pr) @@ -86,7 +86,7 @@ class LandedCostWizard(Document): def submit_pr(self, purchase_receipts): for pr in purchase_receipts: - pr_bean = frappe.get_doc("Purchase Receipt", pr) - pr_bean.run_method("update_ordered_qty") - pr_bean.run_method("update_stock") - pr_bean.run_method("make_gl_entries") \ No newline at end of file + pr_doc = frappe.get_doc("Purchase Receipt", pr) + pr_doc.run_method("update_ordered_qty") + pr_doc.run_method("update_stock") + pr_doc.run_method("make_gl_entries") \ No newline at end of file diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py index 296dda9714..1cabce73c8 100644 --- a/erpnext/stock/doctype/material_request/material_request.py +++ b/erpnext/stock/doctype/material_request/material_request.py @@ -165,11 +165,11 @@ class MaterialRequest(BuyingController): self.per_ordered = flt((per_ordered / flt(len(item_doclist))) * 100.0, 2) frappe.db.set_value(self.doctype, self.name, "per_ordered", self.per_ordered) -def update_completed_qty(bean, method): - if bean.doctype == "Stock Entry": +def update_completed_qty(doc, method): + if doc.doctype == "Stock Entry": material_request_map = {} - for d in bean.get("mtn_details"): + for d in doc.get("mtn_details"): if d.material_request: material_request_map.setdefault(d.material_request, []).append(d.material_request_item) @@ -182,17 +182,17 @@ def update_completed_qty(bean, method): + _(mr_doctype.get_label("status")) + " = %s. " % _(mr_obj.status) + _("Cannot continue."), exc=frappe.InvalidStatusError) - _update_requested_qty(bean, mr_obj, mr_items) + _update_requested_qty(doc, mr_obj, mr_items) # update ordered percentage and qty mr_obj.update_completed_qty(mr_items) -def _update_requested_qty(bean, mr_obj, mr_items): +def _update_requested_qty(doc, mr_obj, mr_items): """update requested qty (before ordered_qty is updated)""" from erpnext.stock.utils import update_bin for mr_item_name in mr_items: mr_item = mr_obj.get("indent_details", {"name": mr_item_name}) - se_detail = bean.get("mtn_details", {"material_request": mr_obj.name, + se_detail = doc.get("mtn_details", {"material_request": mr_obj.name, "material_request_item": mr_item_name}) if mr_item and se_detail: @@ -215,7 +215,7 @@ def _update_requested_qty(bean, mr_obj, mr_items): "item_code": se_detail.item_code, "warehouse": se_detail.t_warehouse, "indented_qty": (se_detail.docstatus==2 and 1 or -1) * add_indented_qty, - "posting_date": bean.posting_date, + "posting_date": doc.posting_date, }) def set_missing_values(source, target_doc): diff --git a/erpnext/stock/doctype/packing_slip/packing_slip.py b/erpnext/stock/doctype/packing_slip/packing_slip.py index 18609831fe..b4b64cd648 100644 --- a/erpnext/stock/doctype/packing_slip/packing_slip.py +++ b/erpnext/stock/doctype/packing_slip/packing_slip.py @@ -57,7 +57,7 @@ class PackingSlip(Document): (from_case_no BETWEEN %(from_case_no)s AND %(to_case_no)s OR to_case_no BETWEEN %(from_case_no)s AND %(to_case_no)s OR %(from_case_no)s BETWEEN from_case_no AND to_case_no) - """, self.fields) + """, self.as_dict()) if res: frappe.msgprint(_("""Case No(s) already in use. Please rectify and try again. @@ -145,7 +145,7 @@ class PackingSlip(Document): note """ recommended_case_no = frappe.db.sql("""SELECT MAX(to_case_no) FROM `tabPacking Slip` - WHERE delivery_note = %(delivery_note)s AND docstatus=1""", self.fields) + WHERE delivery_note = %(delivery_note)s AND docstatus=1""", self.as_dict()) return cint(recommended_case_no[0][0]) + 1 diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py index 8dde16b32c..59b9c981e7 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py @@ -298,8 +298,8 @@ def make_purchase_invoice(source_name, target_doc=None): from frappe.model.mapper import get_mapped_doc def set_missing_values(source, target): - bean = frappe.get_doc(target) - bean.run_method("set_missing_values") + doc = frappe.get_doc(target) + doc.run_method("set_missing_values") doclist = get_mapped_doc("Purchase Receipt", source_name, { "Purchase Receipt": { diff --git a/erpnext/stock/doctype/serial_no/serial_no.py b/erpnext/stock/doctype/serial_no/serial_no.py index cab1424cba..d6b1ef26e7 100644 --- a/erpnext/stock/doctype/serial_no/serial_no.py +++ b/erpnext/stock/doctype/serial_no/serial_no.py @@ -280,7 +280,7 @@ def get_serial_nos(serial_no): if s.strip()] def make_serial_no(serial_no, sle): - sr = frappe.new_bean("Serial No") + sr = frappe.new_doc("Serial No") sr.serial_no = serial_no sr.item_code = sle.item_code sr.warehouse = None diff --git a/erpnext/stock/doctype/serial_no/test_serial_no.py b/erpnext/stock/doctype/serial_no/test_serial_no.py index 30368b6393..9518e78c86 100644 --- a/erpnext/stock/doctype/serial_no/test_serial_no.py +++ b/erpnext/stock/doctype/serial_no/test_serial_no.py @@ -14,7 +14,7 @@ from erpnext.stock.doctype.serial_no.serial_no import * class TestSerialNo(unittest.TestCase): def test_cannot_create_direct(self): - sr = frappe.new_bean("Serial No") + sr = frappe.new_doc("Serial No") sr.item_code = "_Test Serialized Item" sr.warehouse = "_Test Warehouse - _TC" sr.serial_no = "_TCSER0001" diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index 8841b96e88..56ba780e96 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -325,41 +325,41 @@ class StockEntry(StockController): self.make_sl_entries(sl_entries, self.amended_from and 'Yes' or 'No') def update_production_order(self): - def _validate_production_order(pro_bean): - if flt(pro_bean.docstatus) != 1: + def _validate_production_order(pro_doc): + if flt(pro_doc.docstatus) != 1: frappe.throw(_("Production Order must be submitted") + ": " + self.production_order) - if pro_bean.status == 'Stopped': + if pro_doc.status == 'Stopped': msgprint(_("Transaction not allowed against stopped Production Order") + ": " + self.production_order) if self.production_order: - pro_bean = frappe.get_doc("Production Order", self.production_order) - _validate_production_order(pro_bean) - self.update_produced_qty(pro_bean) + pro_doc = frappe.get_doc("Production Order", self.production_order) + _validate_production_order(pro_doc) + self.update_produced_qty(pro_doc) if self.purpose == "Manufacture/Repack": - self.update_planned_qty(pro_bean) + self.update_planned_qty(pro_doc) - def update_produced_qty(self, pro_bean): + def update_produced_qty(self, pro_doc): if self.purpose == "Manufacture/Repack": - produced_qty = flt(pro_bean.produced_qty) + \ + produced_qty = flt(pro_doc.produced_qty) + \ (self.docstatus==1 and 1 or -1 ) * flt(self.fg_completed_qty) - if produced_qty > flt(pro_bean.qty): + if produced_qty > flt(pro_doc.qty): frappe.throw(_("Production Order") + ": " + self.production_order + "\n" + _("Total Manufactured Qty can not be greater than Planned qty to manufacture") - + "(%s/%s)" % (produced_qty, flt(pro_bean.qty)), StockOverProductionError) + + "(%s/%s)" % (produced_qty, flt(pro_doc.qty)), StockOverProductionError) - status = 'Completed' if flt(produced_qty) >= flt(pro_bean.qty) else 'In Process' + status = 'Completed' if flt(produced_qty) >= flt(pro_doc.qty) else 'In Process' frappe.db.sql("""update `tabProduction Order` set status=%s, produced_qty=%s where name=%s""", (status, produced_qty, self.production_order)) - def update_planned_qty(self, pro_bean): + def update_planned_qty(self, pro_doc): from erpnext.stock.utils import update_bin update_bin({ - "item_code": pro_bean.production_item, - "warehouse": pro_bean.fg_warehouse, + "item_code": pro_doc.production_item, + "warehouse": pro_doc.fg_warehouse, "posting_date": self.posting_date, "planned_qty": (self.docstatus==1 and -1 or 1 ) * flt(self.fg_completed_qty) }) @@ -725,7 +725,7 @@ def get_return_doc_and_details(args): for fieldname, val in return_map[args["purpose"]].items(): if args.get(fieldname): ref.fieldname = fieldname - ref.doc = frappe.get_doc(val[0], args[fieldname]) + ref.doc = frappe.get_doc(val[0], args.get(fieldname)) ref.parentfields = val[1] break @@ -748,7 +748,7 @@ def make_return_jv(stock_entry): if not se.purpose in ["Sales Return", "Purchase Return"]: return - ref = get_return_doc_and_details(se.fields) + ref = get_return_doc_and_details(se) if ref.doc.doctype == "Delivery Note": result = make_return_jv_from_delivery_note(se, ref) diff --git a/erpnext/stock/doctype/stock_entry/test_stock_entry.py b/erpnext/stock/doctype/stock_entry/test_stock_entry.py index 98e1b00811..38e99c155b 100644 --- a/erpnext/stock/doctype/stock_entry/test_stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/test_stock_entry.py @@ -765,7 +765,7 @@ class TestStockEntry(unittest.TestCase): def test_warehouse_company_validation(self): set_perpetual_inventory(0) self._clear_stock_account_balance() - frappe.get_doc("User", "test2@example.com").get_controller()\ + frappe.get_doc("User", "test2@example.com")\ .add_roles("Sales User", "Sales Manager", "Material User", "Material Manager") frappe.set_user("test2@example.com") @@ -778,21 +778,20 @@ class TestStockEntry(unittest.TestCase): # permission tests def test_warehouse_user(self): import frappe.defaults - from frappe.model.bean import BeanPermissionError set_perpetual_inventory(0) 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.get_doc("User", "test@example.com").get_controller()\ + frappe.get_doc("User", "test@example.com")\ .add_roles("Sales User", "Sales Manager", "Material User", "Material Manager") - frappe.get_doc("User", "test2@example.com").get_controller()\ + frappe.get_doc("User", "test2@example.com")\ .add_roles("Sales User", "Sales Manager", "Material User", "Material Manager") frappe.set_user("test@example.com") st1 = frappe.copy_doc(test_records[0]) st1.company = "_Test Company 1" st1.doclist[1].t_warehouse="_Test Warehouse 2 - _TC1" - self.assertRaises(BeanPermissionError, st1.insert) + self.assertRaises(frappe.PermissionError, st1.insert) frappe.set_user("test2@example.com") st1 = frappe.copy_doc(test_records[0]) diff --git a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py index 0482dd33b0..17d4282f49 100644 --- a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py +++ b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py @@ -47,7 +47,7 @@ class StockLedgerEntry(DocListController): frappe.throw("""Not enough quantity (requested: %(actual_qty)s, \ current: %(batch_bal)s in Batch %(batch_no)s for Item \ %(item_code)s at Warehouse %(warehouse)s \ - as on %(posting_date)s %(posting_time)s""" % self.fields) + as on %(posting_date)s %(posting_time)s""" % self.as_dict()) self.pop('batch_bal') diff --git a/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.py b/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.py index 770c6df2ad..80354ec9fa 100644 --- a/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.py +++ b/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.py @@ -34,9 +34,9 @@ class StockUOMReplaceUtility(Document): raise Exception def update_item_master(self): - item_bean = frappe.get_doc("Item", self.item_code) - item_bean.stock_uom = self.new_stock_uom - item_bean.save() + item_doc = frappe.get_doc("Item", self.item_code) + item_doc.stock_uom = self.new_stock_uom + item_doc.save() msgprint(_("Default UOM updated in item ") + self.item_code) diff --git a/erpnext/stock/doctype/warehouse/warehouse.py b/erpnext/stock/doctype/warehouse/warehouse.py index 0bb70a5a7a..3b159fc710 100644 --- a/erpnext/stock/doctype/warehouse/warehouse.py +++ b/erpnext/stock/doctype/warehouse/warehouse.py @@ -22,15 +22,15 @@ class Warehouse(Document): self.update_parent_account() def update_parent_account(self): - if not self.__islocal and (self.create_account_under != + if not getattr(self, "__islocal", None) and (self.create_account_under != frappe.db.get_value("Warehouse", self.name, "create_account_under")): warehouse_account = frappe.db.get_value("Account", {"account_type": "Warehouse", "company": self.company, "master_name": self.name}, ["name", "parent_account"]) if warehouse_account and warehouse_account[1] != self.create_account_under: - acc_bean = frappe.get_doc("Account", warehouse_account[0]) - acc_bean.parent_account = self.create_account_under - acc_bean.save() + acc_doc = frappe.get_doc("Account", warehouse_account[0]) + acc_doc.parent_account = self.create_account_under + acc_doc.save() def on_update(self): self.create_account_head() @@ -43,7 +43,7 @@ class Warehouse(Document): if self.get("__islocal") or not frappe.db.get_value( "Stock Ledger Entry", {"warehouse": self.name}): self.validate_parent_account() - ac_bean = frappe.get_doc({ + ac_doc = frappe.get_doc({ "doctype": "Account", 'account_name': self.warehouse_name, 'parent_account': self.create_account_under, @@ -53,10 +53,10 @@ class Warehouse(Document): "master_name": self.name, "freeze_account": "No" }) - ac_bean.ignore_permissions = True - ac_bean.insert() + ac_doc.ignore_permissions = True + ac_doc.insert() - msgprint(_("Account Head") + ": " + ac_bean.name + _(" created")) + msgprint(_("Account Head") + ": " + ac_doc.name + _(" created")) def validate_parent_account(self): if not self.create_account_under: diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index ed23cf7595..eeff2750ef 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -46,20 +46,20 @@ def get_item_details(args): elif not args.item_code and args.serial_no: args.item_code = get_item_code(serial_no=args.serial_no) - item_bean = frappe.get_doc("Item", args.item_code) - item = item_bean.doc + item_doc = frappe.get_doc("Item", args.item_code) + item = item_doc validate_item_details(args, item) - out = get_basic_details(args, item_bean) + out = get_basic_details(args, item_doc) - get_party_item_code(args, item_bean, out) + get_party_item_code(args, item_doc, out) if out.get("warehouse"): out.update(get_available_qty(args.item_code, out.warehouse)) out.update(get_projected_qty(item.name, out.warehouse)) - get_price_list_rate(args, item_bean, out) + get_price_list_rate(args, item_doc, out) if args.transaction_type == "selling" and cint(args.is_pos): out.update(get_pos_settings_item_details(args.company, args)) @@ -67,8 +67,8 @@ def get_item_details(args): apply_pricing_rule(out, args) if args.get("doctype") in ("Sales Invoice", "Delivery Note"): - if item_bean.has_serial_no == "Yes" and not args.serial_no: - out.serial_no = get_serial_nos_by_fifo(args, item_bean) + if item_doc.has_serial_no == "Yes" and not args.serial_no: + out.serial_no = get_serial_nos_by_fifo(args, item_doc) if args.transaction_date and item.lead_time_days: out.schedule_date = out.lead_time_date = add_days(args.transaction_date, @@ -116,8 +116,8 @@ def validate_item_details(args, item): _("not a sub-contracted item.") + _("Please select a sub-contracted item or do not sub-contract the transaction.")) -def get_basic_details(args, item_bean): - item = item_bean.doc +def get_basic_details(args, item_doc): + item = item_doc from frappe.defaults import get_user_default_as_list user_default_warehouse_list = get_user_default_as_list('warehouse') @@ -137,7 +137,7 @@ def get_basic_details(args, item_bean): if args.transaction_type == "selling" else item.buying_cost_center, "batch_no": None, "item_tax_rate": json.dumps(dict(([d.tax_type, d.tax_rate] for d in - item_bean.get("item_tax")))), + item_doc.get("item_tax")))), "uom": item.stock_uom, "min_order_qty": flt(item.min_order_qty) if args.doctype == "Material Request" else "", "conversion_factor": 1.0, @@ -156,7 +156,7 @@ def get_basic_details(args, item_bean): return out -def get_price_list_rate(args, item_bean, out): +def get_price_list_rate(args, item_doc, out): meta = frappe.get_meta(args.doctype) if meta.get_field("currency"): @@ -173,7 +173,7 @@ def get_price_list_rate(args, item_bean, out): if not out.price_list_rate and args.transaction_type == "buying": from erpnext.stock.doctype.item.item import get_last_purchase_details - out.update(get_last_purchase_details(item_bean.name, + out.update(get_last_purchase_details(item_doc.name, args.docname, args.conversion_rate)) def validate_price_list(args): @@ -207,12 +207,12 @@ def validate_conversion_rate(args, meta): get_field_precision(meta.get_field("plc_conversion_rate"), frappe._dict({"fields": args}))) -def get_party_item_code(args, item_bean, out): +def get_party_item_code(args, item_doc, out): if args.transaction_type == "selling": - customer_item_code = item_bean.get("item_customer_details", {"customer_name": args.customer}) + customer_item_code = item_doc.get("item_customer_details", {"customer_name": args.customer}) out.customer_item_code = customer_item_code[0].ref_code if customer_item_code else None else: - item_supplier = item_bean.get({"item_supplier_details", {"supplier": args.supplier}) + item_supplier = item_doc.get("item_supplier_details", {"supplier": args.supplier}) out.supplier_part_no = item_supplier[0].supplier_part_no if item_supplier else None @@ -351,7 +351,7 @@ def apply_internal_priority(pricing_rules, field_set, args_dict): return filtered_rules or pricing_rules -def get_serial_nos_by_fifo(args, item_bean): +def get_serial_nos_by_fifo(args, item_doc): return "\n".join(frappe.db.sql_list("""select name from `tabSerial No` where item_code=%(item_code)s and warehouse=%(warehouse)s and status='Available' order by timestamp(purchase_date, purchase_time) asc limit %(qty)s""", { diff --git a/erpnext/stock/utils.py b/erpnext/stock/utils.py index 69d27ba277..343f6c96ef 100644 --- a/erpnext/stock/utils.py +++ b/erpnext/stock/utils.py @@ -261,10 +261,10 @@ def create_material_request(material_requests): "brand": item.brand, }) - mr_bean = frappe.get_doc(mr) - mr_bean.insert() - mr_bean.submit() - mr_list.append(mr_bean) + mr_doc = frappe.get_doc(mr) + mr_doc.insert() + mr_doc.submit() + mr_list.append(mr_doc) except: if frappe.local.message_log: diff --git a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py index 1002aba52a..b9cc0bcbd3 100644 --- a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py +++ b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py @@ -203,9 +203,9 @@ class MaintenanceSchedule(TransactionBase): def update_amc_date(self, serial_nos, amc_expiry_date=None): for serial_no in serial_nos: - serial_no_bean = frappe.get_doc("Serial No", serial_no) - serial_no_bean.amc_expiry_date = amc_expiry_date - serial_no_bean.save() + serial_no_doc = frappe.get_doc("Serial No", serial_no) + serial_no_doc.amc_expiry_date = amc_expiry_date + serial_no_doc.save() def validate_serial_no(self, serial_nos, amc_start_date): for serial_no in serial_nos: diff --git a/erpnext/support/doctype/support_ticket/get_support_mails.py b/erpnext/support/doctype/support_ticket/get_support_mails.py index fa3b283e3a..b36437e92b 100644 --- a/erpnext/support/doctype/support_ticket/get_support_mails.py +++ b/erpnext/support/doctype/support_ticket/get_support_mails.py @@ -32,7 +32,7 @@ class SupportMailbox(POP3Mailbox): if new_ticket and cint(self.email_settings.send_autoreply) and \ "mailer-daemon" not in mail.from_email.lower(): - self.send_auto_reply(ticket.doc) + self.send_auto_reply(ticket) def send_auto_reply(self, d): signature = self.email_settings.get('support_signature') or '' @@ -80,6 +80,6 @@ def add_support_communication(subject, content, sender, docname=None, mail=None) date=mail.date if mail else today(), sent_or_received="Received") if mail: - mail.save_attachments_in_doc(ticket.doc) + mail.save_attachments_in_doc(ticket) return ticket \ No newline at end of file From 2fbb00fd8de26b2ccf3c55b48bca4a2e6b31cf12 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 3 Apr 2014 14:38:22 +0530 Subject: [PATCH 23/42] frappe/frappe#478, more changes, removed bean --- erpnext/selling/doctype/customer/test_customer.py | 6 +++--- erpnext/stock/doctype/stock_entry/test_stock_entry.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/erpnext/selling/doctype/customer/test_customer.py b/erpnext/selling/doctype/customer/test_customer.py index be60795ccc..19bcce8ee5 100644 --- a/erpnext/selling/doctype/customer/test_customer.py +++ b/erpnext/selling/doctype/customer/test_customer.py @@ -8,6 +8,9 @@ import unittest from frappe.test_runner import make_test_records +test_ignore = ["Price List"] + +test_records = frappe.get_test_records('Customer') class TestCustomer(unittest.TestCase): def test_party_details(self): @@ -47,6 +50,3 @@ class TestCustomer(unittest.TestCase): frappe.rename_doc("Customer", "_Test Customer 1 Renamed", "_Test Customer 1") -test_ignore = ["Price List"] - -test_records = frappe.get_test_records('Customer') \ No newline at end of file diff --git a/erpnext/stock/doctype/stock_entry/test_stock_entry.py b/erpnext/stock/doctype/stock_entry/test_stock_entry.py index 38e99c155b..8c764ee892 100644 --- a/erpnext/stock/doctype/stock_entry/test_stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/test_stock_entry.py @@ -791,7 +791,7 @@ class TestStockEntry(unittest.TestCase): st1 = frappe.copy_doc(test_records[0]) st1.company = "_Test Company 1" st1.doclist[1].t_warehouse="_Test Warehouse 2 - _TC1" - self.assertRaises(frappe.PermissionError, st1.insert) + self.assertRaises(frappe.PermissionErrorp, st1.insert) frappe.set_user("test2@example.com") st1 = frappe.copy_doc(test_records[0]) From 99f914b78252ff05d889d22fb0f0350d9c0ac485 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 3 Apr 2014 14:47:03 +0530 Subject: [PATCH 24/42] frappe/frappe#478, fixes --- .../doctype/uom_conversion_detail/uom_conversion_detail.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.py b/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.py index 00cd84765a..aa6db6d86e 100644 --- a/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.py +++ b/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.py @@ -6,5 +6,5 @@ import frappe from frappe.model.document import Document -class UomConversionDetail(Document): +class UOMConversionDetail(Document): pass \ No newline at end of file From 7db7112d3f929d16c0439017293580c34248284d Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 3 Apr 2014 15:04:18 +0530 Subject: [PATCH 25/42] frappe/frappe#478 fix and added print heading --- erpnext/config/setup.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/erpnext/config/setup.py b/erpnext/config/setup.py index e5393906cf..5be7e8cdd7 100644 --- a/erpnext/config/setup.py +++ b/erpnext/config/setup.py @@ -15,6 +15,27 @@ data = [ } ] }, + { + "label": _("Printing and Branding"), + "icon": "icon-print", + "items": [ + { + "type": "doctype", + "name": "Letter Head", + "description": _("Letter Heads for print templates.") + }, + { + "type": "doctype", + "name": "Print Heading", + "description": _("Titles for print templates e.g. Proforma Invoice.") + }, + { + "type": "doctype", + "name": "Terms and Conditions", + "description": _("Standard contract terms for Sales or Purchase.") + }, + ] + }, { "label": _("Customize"), "icon": "icon-glass", From 365ae27acf2b3be3037410a956de0ed6d4191631 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 3 Apr 2014 17:38:54 +0530 Subject: [PATCH 26/42] frappe/frappe#478 fixes --- .../accounts/doctype/account/test_account.py | 37 ++++++++++--------- .../doctype/shipping_rule/shipping_rule.py | 4 +- .../shipping_rule/test_shipping_rule.py | 6 +-- erpnext/accounts/party.py | 11 +++--- .../purchase_common/purchase_common.py | 12 +++--- .../doctype/purchase_order/purchase_order.py | 2 +- erpnext/controllers/accounts_controller.py | 2 +- erpnext/controllers/buying_controller.py | 4 +- erpnext/controllers/selling_controller.py | 4 +- erpnext/controllers/stock_controller.py | 4 +- erpnext/manufacturing/doctype/bom/bom.py | 2 +- .../bom_explosion_item/bom_explosion_item.py | 2 +- .../doctype/sales_bom_item/sales_bom_item.py | 2 +- .../terms_and_conditions.py | 2 +- .../doctype/delivery_note/delivery_note.py | 2 +- .../material_request/material_request.py | 2 +- .../purchase_receipt/purchase_receipt.py | 2 +- 17 files changed, 50 insertions(+), 50 deletions(-) diff --git a/erpnext/accounts/doctype/account/test_account.py b/erpnext/accounts/doctype/account/test_account.py index 5cecab42bf..37746299e6 100644 --- a/erpnext/accounts/doctype/account/test_account.py +++ b/erpnext/accounts/doctype/account/test_account.py @@ -9,29 +9,29 @@ def _make_test_records(verbose): accounts = [ # [account_name, parent_account, group_or_ledger] - ["_Test Account Bank Account", "Bank Accounts", "Ledger"], + ["_Test Account Bank Account", "Bank Accounts", "Ledger", "Bank"], - ["_Test Account Stock Expenses", "Direct Expenses", "Group"], - ["_Test Account Shipping Charges", "_Test Account Stock Expenses", "Ledger"], - ["_Test Account Customs Duty", "_Test Account Stock Expenses", "Ledger"], + ["_Test Account Stock Expenses", "Direct Expenses", "Group", None], + ["_Test Account Shipping Charges", "_Test Account Stock Expenses", "Ledger", "Chargeable"], + ["_Test Account Customs Duty", "_Test Account Stock Expenses", "Ledger", "Tax"], - ["_Test Account Tax Assets", "Current Assets", "Group"], - ["_Test Account VAT", "_Test Account Tax Assets", "Ledger"], - ["_Test Account Service Tax", "_Test Account Tax Assets", "Ledger"], + ["_Test Account Tax Assets", "Current Assets", "Group", None], + ["_Test Account VAT", "_Test Account Tax Assets", "Ledger", "Tax"], + ["_Test Account Service Tax", "_Test Account Tax Assets", "Ledger", "Tax"], - ["_Test Account Reserves and Surplus", "Current Liabilities", "Ledger"], + ["_Test Account Reserves and Surplus", "Current Liabilities", "Ledger", None], - ["_Test Account Cost for Goods Sold", "Expenses", "Ledger"], - ["_Test Account Excise Duty", "_Test Account Tax Assets", "Ledger"], - ["_Test Account Education Cess", "_Test Account Tax Assets", "Ledger"], - ["_Test Account S&H Education Cess", "_Test Account Tax Assets", "Ledger"], - ["_Test Account CST", "Direct Expenses", "Ledger"], - ["_Test Account Discount", "Direct Expenses", "Ledger"], + ["_Test Account Cost for Goods Sold", "Expenses", "Ledger", None], + ["_Test Account Excise Duty", "_Test Account Tax Assets", "Ledger", "Tax"], + ["_Test Account Education Cess", "_Test Account Tax Assets", "Ledger", "Tax"], + ["_Test Account S&H Education Cess", "_Test Account Tax Assets", "Ledger", "Tax"], + ["_Test Account CST", "Direct Expenses", "Ledger", "Tax"], + ["_Test Account Discount", "Direct Expenses", "Ledger", None], # related to Account Inventory Integration - ["_Test Account Stock In Hand", "Current Assets", "Ledger"], - ["_Test Account Fixed Assets", "Current Assets", "Ledger"], + ["_Test Account Stock In Hand", "Current Assets", "Ledger", None], + ["_Test Account Fixed Assets", "Current Assets", "Ledger", None], ] for company, abbr in [["_Test Company", "_TC"], ["_Test Company 1", "_TC1"]]: @@ -40,7 +40,8 @@ def _make_test_records(verbose): "account_name": account_name, "parent_account": parent_account + " - " + abbr, "company": company, - "group_or_ledger": group_or_ledger - } for account_name, parent_account, group_or_ledger in accounts]) + "group_or_ledger": group_or_ledger, + "account_type": account_type + } for account_name, parent_account, group_or_ledger, account_type in accounts]) return test_objects \ No newline at end of file diff --git a/erpnext/accounts/doctype/shipping_rule/shipping_rule.py b/erpnext/accounts/doctype/shipping_rule/shipping_rule.py index 9e88f222fe..3cef9920b1 100644 --- a/erpnext/accounts/doctype/shipping_rule/shipping_rule.py +++ b/erpnext/accounts/doctype/shipping_rule/shipping_rule.py @@ -26,14 +26,14 @@ class ShippingRule(DocListController): def validate_from_to_values(self): zero_to_values = [] - for d in self.shipping_rule_conditions: + for d in self.get("shipping_rule_conditions"): self.round_floats_in(d) # values cannot be negative self.validate_value("from_value", ">=", 0.0, d) self.validate_value("to_value", ">=", 0.0, d) - if d.to_value == 0: + if not d.to_value: zero_to_values.append(d) elif d.from_value >= d.to_value: msgprint(_("Error") + ": " + _("Row") + " # %d: " % d.idx + diff --git a/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py b/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py index 0f41a567cd..9fee555213 100644 --- a/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py +++ b/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py @@ -5,6 +5,8 @@ import frappe import unittest from erpnext.accounts.doctype.shipping_rule.shipping_rule import FromGreaterThanToError, ManyBlankToValuesError, OverlappingConditionError +test_records = frappe.get_test_records('Shipping Rule') + class TestShippingRule(unittest.TestCase): def test_from_greater_than_to(self): shipping_rule = frappe.copy_doc(test_records[0]) @@ -29,6 +31,4 @@ class TestShippingRule(unittest.TestCase): shipping_rule.doclist[1].to_value = range_a[1] shipping_rule.doclist[2].from_value = range_b[0] shipping_rule.doclist[2].to_value = range_b[1] - self.assertRaises(OverlappingConditionError, shipping_rule.insert) - -test_records = frappe.get_test_records('Shipping Rule') \ No newline at end of file + self.assertRaises(OverlappingConditionError, shipping_rule.insert) \ No newline at end of file diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py index a159a7383b..601fcd11ee 100644 --- a/erpnext/accounts/party.py +++ b/erpnext/accounts/party.py @@ -25,13 +25,12 @@ def _get_party_details(party=None, account=None, party_type="Customer", company= if not ignore_permissions and not frappe.has_permission(party_type, "read", party): frappe.throw("Not Permitted", frappe.PermissionError) - party_doc = frappe.get_doc(party_type, party) - party = party_doc + party = frappe.get_doc(party_type, party) set_address_details(out, party, party_type) set_contact_details(out, party, party_type) set_other_values(out, party, party_type) - set_price_list(out, party, price_list) + set_price_list(out, party, party_type, price_list) if not out.get("currency"): out["currency"] = currency @@ -41,7 +40,7 @@ def _get_party_details(party=None, account=None, party_type="Customer", company= out["sales_team"] = [{ "sales_person": d.sales_person, "sales_designation": d.sales_designation - } for d in party_doc.get("sales_team")] + } for d in party.get("sales_team")] return out @@ -81,7 +80,7 @@ def set_other_values(out, party, party_type): if party.get("default_" + f): out[f] = party.get("default_" + f) -def set_price_list(out, party, given_price_list): +def set_price_list(out, party, party_type, given_price_list): # price list price_list = get_restrictions().get("Price List") if isinstance(price_list, list): @@ -90,7 +89,7 @@ def set_price_list(out, party, given_price_list): if not price_list: price_list = party.default_price_list - if not price_list and party.party_type=="Customer": + if not price_list and party_type=="Customer": price_list = frappe.db.get_value("Customer Group", party.customer_group, "default_price_list") diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.py b/erpnext/buying/doctype/purchase_common/purchase_common.py index 80af450654..ffbbb45940 100644 --- a/erpnext/buying/doctype/purchase_common/purchase_common.py +++ b/erpnext/buying/doctype/purchase_common/purchase_common.py @@ -81,7 +81,7 @@ class PurchaseCommon(BuyingController): if d.doctype == 'Purchase Receipt Item': f_lst.pop('received_qty') for x in f_lst : - if d.meta.has_field(x): + if d.meta.get_field(x): d.set(x, f_lst[x]) item = frappe.db.sql("""select is_stock_item, is_purchase_item, @@ -101,13 +101,13 @@ class PurchaseCommon(BuyingController): frappe.throw("Item %s is not a purchase item or sub-contracted item. Please check" % (d.item_code)) # list criteria that should not repeat if item is stock item - e = [d.schedule_date, d.item_code, d.description, d.warehouse, d.uom, - d.meta.has_field('prevdoc_docname') and d.prevdoc_docname or d.meta.has_field('sales_order_no') and d.sales_order_no or '', - d.meta.has_field('prevdoc_detail_docname') and d.prevdoc_detail_docname or '', - d.meta.has_field('batch_no') and d.batch_no or ''] + e = [getattr(d, "schedule_date", None), d.item_code, d.description, d.warehouse, d.uom, + d.meta.get_field('prevdoc_docname') and d.prevdoc_docname or d.meta.get_field('sales_order_no') and d.sales_order_no or '', + d.meta.get_field('prevdoc_detail_docname') and d.prevdoc_detail_docname or '', + d.meta.get_field('batch_no') and d.batch_no or ''] # if is not stock item - f = [d.schedule_date, d.item_code, d.description] + f = [getattr(d, "schedule_date", None), d.item_code, d.description] ch = frappe.db.sql("""select is_stock_item from `tabItem` where name = %s""", d.item_code) diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index afa9748add..e7bb7c9895 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -73,7 +73,7 @@ class PurchaseOrder(BuyingController): def check_for_stopped_status(self, pc_obj): check_list =[] for d in self.get('po_details'): - if d.meta.has_field('prevdoc_docname') and d.prevdoc_docname and d.prevdoc_docname not in check_list: + if d.meta.get_field('prevdoc_docname') and d.prevdoc_docname and d.prevdoc_docname not in check_list: check_list.append(d.prevdoc_docname) pc_obj.check_for_stopped_status( d.prevdoc_doctype, d.prevdoc_docname) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 1b050d7fe5..0b1c001c0e 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -93,7 +93,7 @@ class AccountsController(TransactionBase): args.update(self.as_dict()) ret = get_item_details(args) for fieldname, value in ret.items(): - if self.meta.get_field(fieldname, parentfield=self.fname) and \ + if item.meta.get_field(fieldname) and \ item.get(fieldname) is None and value is not None: item.set(fieldname, value) diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index 24dce4b876..6e03d47f02 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -17,7 +17,7 @@ class BuyingController(StockController): def validate(self): super(BuyingController, self).validate() - if self.supplier and not self.supplier_name: + if getattr(self, "supplier", None) and not self.supplier_name: self.supplier_name = frappe.db.get_value("Supplier", self.supplier, "supplier_name") self.is_item_table_empty() @@ -31,7 +31,7 @@ class BuyingController(StockController): self.set_price_list_currency("Buying") # set contact and address details for supplier, if they are not mentioned - if self.supplier: + if getattr(self, "supplier", None): self.update_if_missing(get_party_details(self.supplier, party_type="Supplier")) self.set_missing_item_details() diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index bcc46bbc20..da37adbfe4 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -35,7 +35,7 @@ class SellingController(StockController): if getattr(self, "customer", None): from erpnext.accounts.party import _get_party_details self.update_if_missing(_get_party_details(self.customer, - ignore_permissions=self.ignore_permissions)) + ignore_permissions=getattr(self, "ignore_permissions", None))) elif getattr(self, "lead", None): from erpnext.selling.doctype.lead.lead import get_lead_details @@ -377,6 +377,6 @@ def check_active_sales_items(obj): d.item_code, as_dict=True)[0] if item.is_sales_item == 'No' and item.is_service_item == 'No': frappe.throw(_("Item is neither Sales nor Service Item") + ": " + d.item_code) - if d.income_account and not item.income_account: + if getattr(d, "income_account", None) and not item.income_account: frappe.db.set_value("Item", d.item_code, "income_account", d.income_account) diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py index e00449dad8..62262ee5c8 100644 --- a/erpnext/controllers/stock_controller.py +++ b/erpnext/controllers/stock_controller.py @@ -223,11 +223,11 @@ class StockController(AccountsController): make_gl_entries(gl_entries) def check_expense_account(self, item): - if item.meta.has_field("expense_account") and not item.expense_account: + if item.meta.get_field("expense_account") and not item.expense_account: msgprint(_("""Expense/Difference account is mandatory for item: """) + item.item_code, raise_exception=1) - if item.meta.has_field("expense_account") and not item.cost_center: + if item.meta.get_field("expense_account") and not item.cost_center: msgprint(_("""Cost Center is mandatory for item: """) + item.item_code, raise_exception=1) diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index b5072267d4..7dcc96eac9 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -384,7 +384,7 @@ class BOM(Document): ch.amount = flt(ch.qty) * flt(ch.rate) ch.qty_consumed_per_unit = flt(ch.qty) / flt(self.quantity) ch.docstatus = self.docstatus - ch.save(1) + ch.db_update() def validate_bom_links(self): if not self.is_active: diff --git a/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.py b/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.py index bd1b1af43f..48ea3c0830 100644 --- a/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.py +++ b/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.py @@ -6,5 +6,5 @@ import frappe from frappe.model.document import Document -class BomExplosionItem(Document): +class BOMExplosionItem(Document): pass \ No newline at end of file diff --git a/erpnext/selling/doctype/sales_bom_item/sales_bom_item.py b/erpnext/selling/doctype/sales_bom_item/sales_bom_item.py index e1124d97cc..9a98c397f8 100644 --- a/erpnext/selling/doctype/sales_bom_item/sales_bom_item.py +++ b/erpnext/selling/doctype/sales_bom_item/sales_bom_item.py @@ -6,5 +6,5 @@ import frappe from frappe.model.document import Document -class SalesBomItem(Document): +class SalesBOMItem(Document): pass \ No newline at end of file diff --git a/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.py b/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.py index 73ac3947b8..be538a7ea9 100644 --- a/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.py +++ b/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.py @@ -6,5 +6,5 @@ import frappe from frappe.model.document import Document -class TermsAndConditions(Document): +class TermsandConditions(Document): pass \ No newline at end of file diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index 8dcdde1a06..b9900632c7 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -80,7 +80,7 @@ class DeliveryNote(SellingController): items = self.get("delivery_note_details") for fn in (("Sales Order", "against_sales_order"), ("Sales Invoice", "against_sales_invoice")): - if filter(None, [(d[fn[1]] or None) for d in self.get(self.fname)]): + if filter(None, [getattr(d, fn[1], None) for d in items]): super(DeliveryNote, self).validate_with_previous_doc(self.tname, { fn[0]: { "ref_dn_field": fn[1], diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py index 1cabce73c8..5a5bb031ef 100644 --- a/erpnext/stock/doctype/material_request/material_request.py +++ b/erpnext/stock/doctype/material_request/material_request.py @@ -68,7 +68,7 @@ class MaterialRequest(BuyingController): self.validate_value("material_request_type", "in", ["Purchase", "Transfer"]) - pc_obj = frappe.get_doc(dt='Purchase Common') + pc_obj = frappe.get_doc('Purchase Common') pc_obj.validate_for_items(self) # self.validate_qty_against_so() diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py index 59b9c981e7..1ac5826873 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py @@ -216,7 +216,7 @@ class PurchaseReceipt(BuyingController): def check_for_stopped_status(self, pc_obj): check_list =[] for d in self.get('purchase_receipt_details'): - if d.meta.has_field('prevdoc_docname') and d.prevdoc_docname and d.prevdoc_docname not in check_list: + if d.meta.get_field('prevdoc_docname') and d.prevdoc_docname and d.prevdoc_docname not in check_list: check_list.append(d.prevdoc_docname) pc_obj.check_for_stopped_status( d.prevdoc_doctype, d.prevdoc_docname) From 0cf531c8a6ce33c9a5faaa60b690c73bd9b65019 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 3 Apr 2014 17:43:06 +0530 Subject: [PATCH 27/42] frappe/frappe#478 fixes --- .../hr/doctype/deduction_type/test_records.json | 11 ++++++++++- .../hr/doctype/earning_type/test_records.json | 13 ++++++++++++- .../leave_application/leave_application.py | 4 ++-- .../hr/doctype/salary_slip/test_salary_slip.py | 16 ++++++++-------- 4 files changed, 32 insertions(+), 12 deletions(-) diff --git a/erpnext/hr/doctype/deduction_type/test_records.json b/erpnext/hr/doctype/deduction_type/test_records.json index 0637a088a0..25dab0fe16 100644 --- a/erpnext/hr/doctype/deduction_type/test_records.json +++ b/erpnext/hr/doctype/deduction_type/test_records.json @@ -1 +1,10 @@ -[] \ No newline at end of file +[ + { + "doctype": "Deduction Type", + "deduction_name": "_Test Professional Tax" + }, + { + "doctype": "Deduction Type", + "deduction_name": "_Test TDS" + } +] \ No newline at end of file diff --git a/erpnext/hr/doctype/earning_type/test_records.json b/erpnext/hr/doctype/earning_type/test_records.json index 0637a088a0..659ab52040 100644 --- a/erpnext/hr/doctype/earning_type/test_records.json +++ b/erpnext/hr/doctype/earning_type/test_records.json @@ -1 +1,12 @@ -[] \ No newline at end of file +[ + { + "doctype": "Earning Type", + "earning_name": "_Test Basic Salary", + "taxable": "Yes" + }, + { + "doctype": "Earning Type", + "earning_name": "_Test Allowance", + "taxable": "Yes" + } +] \ No newline at end of file diff --git a/erpnext/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py index e1bc1f9ae4..5de3495ff3 100755 --- a/erpnext/hr/doctype/leave_application/leave_application.py +++ b/erpnext/hr/doctype/leave_application/leave_application.py @@ -17,8 +17,8 @@ class LeaveApproverIdentityError(frappe.ValidationError): pass from frappe.model.controller import DocListController class LeaveApplication(DocListController): def setup(self): - if frappe.db.exists(self.doctype, self.name): - self.previous_doc = frappe.get_doc(self.doctype, self.name) + if not getattr(self, "__islocal", None) and frappe.db.exists(self.doctype, self.name): + self.previous_doc = frappe.db.get_value(self.doctype, self.name, "*", as_dict=True) else: self.previous_doc = None diff --git a/erpnext/hr/doctype/salary_slip/test_salary_slip.py b/erpnext/hr/doctype/salary_slip/test_salary_slip.py index ab590444b4..e8c978e639 100644 --- a/erpnext/hr/doctype/salary_slip/test_salary_slip.py +++ b/erpnext/hr/doctype/salary_slip/test_salary_slip.py @@ -23,10 +23,10 @@ class TestSalarySlip(unittest.TestCase): ss.insert() self.assertEquals(ss.total_days_in_month, 31) self.assertEquals(ss.payment_days, 30) - self.assertEquals(ss.doclist[1].e_modified_amount, 14516.13) - self.assertEquals(ss.doclist[2].e_modified_amount, 500) - self.assertEquals(ss.doclist[3].d_modified_amount, 100) - self.assertEquals(ss.doclist[4].d_modified_amount, 48.39) + self.assertEquals(ss.earning_details[0].e_modified_amount, 14516.13) + self.assertEquals(ss.earning_details[1].e_modified_amount, 500) + self.assertEquals(ss.deduction_details[0].d_modified_amount, 100) + self.assertEquals(ss.deduction_details[1].d_modified_amount, 48.39) self.assertEquals(ss.gross_pay, 15016.13) self.assertEquals(ss.net_pay, 14867.74) @@ -35,10 +35,10 @@ class TestSalarySlip(unittest.TestCase): ss.insert() self.assertEquals(ss.total_days_in_month, 30) self.assertEquals(ss.payment_days, 29) - self.assertEquals(ss.doclist[1].e_modified_amount, 14500) - self.assertEquals(ss.doclist[2].e_modified_amount, 500) - self.assertEquals(ss.doclist[3].d_modified_amount, 100) - self.assertEquals(ss.doclist[4].d_modified_amount, 48.33) + self.assertEquals(ss.earning_details[0].e_modified_amount, 14500) + self.assertEquals(ss.earning_details[1].e_modified_amount, 500) + self.assertEquals(ss.deduction_details[0].d_modified_amount, 100) + self.assertEquals(ss.deduction_details[1].d_modified_amount, 48.33) self.assertEquals(ss.gross_pay, 15000) self.assertEquals(ss.net_pay, 14851.67) From 312ba99e717cc1d968616749ca5d31948ef7ea76 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 4 Apr 2014 11:06:10 +0530 Subject: [PATCH 28/42] frappe/frappe#478 fixes --- erpnext/accounts/doctype/pos_setting/pos_setting.py | 2 +- erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py | 5 ++--- erpnext/buying/doctype/purchase_order/purchase_order.py | 2 +- erpnext/buying/doctype/supplier/supplier.py | 1 - erpnext/controllers/accounts_controller.py | 4 ++-- erpnext/controllers/buying_controller.py | 2 +- erpnext/manufacturing/doctype/bom/bom.py | 2 +- erpnext/setup/install.py | 3 ++- erpnext/stock/doctype/material_request/material_request.py | 2 +- erpnext/stock/doctype/purchase_receipt/purchase_receipt.py | 2 +- erpnext/stock/doctype/stock_entry/stock_entry.py | 2 +- 11 files changed, 13 insertions(+), 14 deletions(-) diff --git a/erpnext/accounts/doctype/pos_setting/pos_setting.py b/erpnext/accounts/doctype/pos_setting/pos_setting.py index 65761c93a5..f7fdd319fe 100755 --- a/erpnext/accounts/doctype/pos_setting/pos_setting.py +++ b/erpnext/accounts/doctype/pos_setting/pos_setting.py @@ -8,7 +8,7 @@ from frappe.utils import cint from frappe.model.document import Document -class PosSetting(Document): +class POSSetting(Document): def get_series(self): frappe.get_meta("Sales Invoice").get_field("naming_series").options or "" diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index 109d0e505f..75a9ab53e6 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -4,7 +4,6 @@ import frappe import unittest, json from frappe.utils import flt -from frappe.model.doc import DocstatusTransitionError, TimestampMismatchError from erpnext.accounts.utils import get_stock_and_account_difference from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory @@ -25,7 +24,7 @@ class TestSalesInvoice(unittest.TestCase): w.submit() w = frappe.get_doc(w2) - self.assertRaises(DocstatusTransitionError, w.submit) + self.assertRaises(frappe.DocstatusTransitionError, w.submit) def test_timestamp_change(self): w = frappe.copy_doc(test_records[0]) @@ -40,7 +39,7 @@ class TestSalesInvoice(unittest.TestCase): import time time.sleep(1) - self.assertRaises(TimestampMismatchError, w2.save) + self.assertRaises(frappe.TimestampMismatchError, w2.save) def test_sales_invoice_calculation_base_currency(self): si = frappe.copy_doc(test_records[2]) diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index e7bb7c9895..25bdfa97a5 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -35,7 +35,7 @@ class PurchaseOrder(BuyingController): validate_status(self.status, ["Draft", "Submitted", "Stopped", "Cancelled"]) - pc_obj = frappe.get_doc(dt='Purchase Common') + pc_obj = frappe.get_doc('Purchase Common') pc_obj.validate_for_items(self) self.check_for_stopped_status(pc_obj) diff --git a/erpnext/buying/doctype/supplier/supplier.py b/erpnext/buying/doctype/supplier/supplier.py index 9179bc2c70..e48c0bfc3d 100644 --- a/erpnext/buying/doctype/supplier/supplier.py +++ b/erpnext/buying/doctype/supplier/supplier.py @@ -16,7 +16,6 @@ class Supplier(TransactionBase): def autoname(self): supp_master_name = frappe.defaults.get_global_default('supp_master_name') - if supp_master_name == 'Supplier Name': if frappe.db.exists("Customer", self.supplier_name): frappe.msgprint(_("A Customer exists with same name"), raise_exception=1) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 0b1c001c0e..24af1e35fa 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -210,7 +210,7 @@ class AccountsController(TransactionBase): "row_range": row_range }) - if cint(tax.included_in_print_rate): + if cint(getattr(tax, "included_in_print_rate", None)): if tax.charge_type == "Actual": # inclusive tax cannot be of type Actual throw((_("Row") @@ -259,7 +259,7 @@ class AccountsController(TransactionBase): tax.tax_amount_after_discount_amount += current_tax_amount - if tax.category: + if getattr(tax, "category", None): # if just for valuation, do not add the tax amount in total # hence, setting it as 0 for further steps current_tax_amount = 0.0 if (tax.category == "Valuation") \ diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index 6e03d47f02..3bde28b379 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -50,7 +50,7 @@ class BuyingController(StockController): from erpnext.stock.utils import validate_warehouse_company warehouses = list(set([d.warehouse for d in - self.get(self.fname) if d.warehouse])) + self.get(self.fname) if getattr(d, "warehouse", None)])) for w in warehouses: validate_warehouse_company(w, self.company) diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index 7dcc96eac9..aa96b7c399 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -38,7 +38,7 @@ class BOM(Document): def on_update(self): self.check_recursion() self.update_exploded_items() - self.save() + self.db_update() def on_submit(self): self.manage_default_bom() diff --git a/erpnext/setup/install.py b/erpnext/setup/install.py index 6f4669eeae..68bc6cddfe 100644 --- a/erpnext/setup/install.py +++ b/erpnext/setup/install.py @@ -137,7 +137,8 @@ def feature_setup(): doc.save() def set_single_defaults(): - for dt in frappe.db.sql_list("""select name from `tabDocType` where issingle=1"""): + for dt in frappe.db.sql_list("""select name from `tabDocType` + where issingle=1 and paent != 'Control Panel'"""): default_values = frappe.db.sql("""select fieldname, `default` from `tabDocField` where parent=%s""", dt) if default_values: diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py index 5a5bb031ef..756f540db3 100644 --- a/erpnext/stock/doctype/material_request/material_request.py +++ b/erpnext/stock/doctype/material_request/material_request.py @@ -124,7 +124,7 @@ class MaterialRequest(BuyingController): def on_cancel(self): # Step 1:=> Get Purchase Common Obj - pc_obj = frappe.get_doc(dt='Purchase Common') + pc_obj = frappe.get_doc('Purchase Common') # Step 2:=> Check for stopped status pc_obj.check_for_stopped_status(self.doctype, self.name) diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py index 1ac5826873..9a137a1bfd 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py @@ -53,7 +53,7 @@ class PurchaseReceipt(BuyingController): self.validate_uom_is_integer("stock_uom", "stock_qty") self.validate_challan_no() - pc_obj = frappe.get_doc(dt='Purchase Common') + pc_obj = frappe.get_doc('Purchase Common') pc_obj.validate_for_items(self) self.check_for_stopped_status(pc_obj) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index 56ba780e96..cdfff04430 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -721,7 +721,7 @@ def get_return_doc_and_details(args): ref = frappe._dict() # get ref_doc - if args["purpose"] in return_map: + if args.get("purpose") in return_map: for fieldname, val in return_map[args["purpose"]].items(): if args.get(fieldname): ref.fieldname = fieldname From 558a9aabfb60fcbef952d13f364f74397bb2dd2b Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 4 Apr 2014 12:00:36 +0530 Subject: [PATCH 29/42] removed control panel --- .../accounts/doctype/sales_invoice/sales_invoice.js | 3 +-- erpnext/hr/doctype/employee/employee.js | 2 +- erpnext/patches/4_0/update_user_properties.py | 6 +++--- erpnext/setup/doctype/company/company.py | 3 +-- .../doctype/global_defaults/global_defaults.py | 13 ++++--------- erpnext/setup/install.py | 4 ++-- erpnext/setup/page/setup_wizard/setup_wizard.js | 2 +- erpnext/setup/page/setup_wizard/setup_wizard.py | 10 ++++------ .../doctype/purchase_receipt/purchase_receipt.js | 2 +- erpnext/stock/doctype/stock_entry/stock_entry.js | 2 +- .../utilities/doctype/sms_control/sms_control.py | 2 +- 11 files changed, 20 insertions(+), 29 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index 077c9136ac..a87677604e 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -245,8 +245,7 @@ cur_frm.cscript.hide_fields = function(doc) { (cint(doc.update_stock)==1 ? true : false)); // India related fields - var cp = frappe.control_panel; - if (cp.country == 'India') unhide_field(['c_form_applicable', 'c_form_no']); + if (frappe.boot.sysdefaults.country == 'India') unhide_field(['c_form_applicable', 'c_form_no']); else hide_field(['c_form_applicable', 'c_form_no']); cur_frm.refresh_fields(); diff --git a/erpnext/hr/doctype/employee/employee.js b/erpnext/hr/doctype/employee/employee.js index 88cf7cad68..72f540437f 100644 --- a/erpnext/hr/doctype/employee/employee.js +++ b/erpnext/hr/doctype/employee/employee.js @@ -13,7 +13,7 @@ erpnext.hr.EmployeeController = frappe.ui.form.Controller.extend({ onload: function() { this.setup_leave_approver_select(); this.frm.toggle_display(["esic_card_no", "gratuity_lic_id", "pan_number", "pf_number"], - frappe.control_panel.country==="India"); + frappe.boot.sysdefaults.country==="India"); if(this.frm.doc.__islocal) this.frm.set_value("employee_name", ""); }, diff --git a/erpnext/patches/4_0/update_user_properties.py b/erpnext/patches/4_0/update_user_properties.py index 0c3aa4ab2e..2e224ce91b 100644 --- a/erpnext/patches/4_0/update_user_properties.py +++ b/erpnext/patches/4_0/update_user_properties.py @@ -20,7 +20,7 @@ def update_user_properties(): frappe.reload_doc("core", "doctype", "docfield") for d in frappe.db.sql("""select parent, defkey, defvalue from tabDefaultValue - where parent not in ('__global', 'Control Panel')""", as_dict=True): + where parent not in ('__global', '__default')""", as_dict=True): df = frappe.db.sql("""select options from tabDocField where fieldname=%s and fieldtype='Link'""", d.defkey, as_dict=True) @@ -28,7 +28,7 @@ def update_user_properties(): frappe.db.sql("""update tabDefaultValue set defkey=%s, parenttype='Restriction' where defkey=%s and - parent not in ('__global', 'Control Panel')""", (df[0].options, d.defkey)) + parent not in ('__global', '__default')""", (df[0].options, d.defkey)) def update_user_match(): import frappe.defaults @@ -97,7 +97,7 @@ def remove_duplicate_restrictions(): # remove duplicate restrictions (if they exist) for d in frappe.db.sql("""select parent, defkey, defvalue, count(*) as cnt from tabDefaultValue - where parent not in ('__global', 'Control Panel') + where parent not in ('__global', '__default') group by parent, defkey, defvalue""", as_dict=1): if d.cnt > 1: # order by parenttype so that restriction does not get removed! diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py index 111a180257..77bfca43e6 100644 --- a/erpnext/setup/doctype/company/company.py +++ b/erpnext/setup/doctype/company/company.py @@ -332,8 +332,7 @@ class Company(Document): for d in acc_list_common: self.add_acc(d) - country = frappe.db.sql("select value from tabSingles where field = 'country' and doctype = 'Control Panel'") - country = country and cstr(country[0][0]) or '' + country = frappe.db.get_default("country") # load taxes (only for India) if country == 'India': diff --git a/erpnext/setup/doctype/global_defaults/global_defaults.py b/erpnext/setup/doctype/global_defaults/global_defaults.py index dce4f60587..93d75a1d2e 100644 --- a/erpnext/setup/doctype/global_defaults/global_defaults.py +++ b/erpnext/setup/doctype/global_defaults/global_defaults.py @@ -29,7 +29,7 @@ class GlobalDefaults(Document): def on_update(self): """update defaults""" self.validate_session_expiry() - self.update_control_panel() + self.set_country_and_timezone() for key in keydict: frappe.db.set_default(key, self.get(keydict[key], '')) @@ -59,14 +59,9 @@ class GlobalDefaults(Document): frappe.msgprint("""Session Expiry must be in format hh:mm""", raise_exception=1) - def update_control_panel(self): - cp_doc = frappe.get_doc("Control Panel") - if self.country: - cp_doc.country = self.country - if self.time_zone: - cp_doc.time_zone = self.time_zone - cp_doc.ignore_permissions = True - cp_doc.save() + def set_country_and_timezone(self): + frappe.db.set_default("country", self.country) + frappe.db.set_default("time_zone", self.time_zone) def get_defaults(self): return frappe.defaults.get_defaults() diff --git a/erpnext/setup/install.py b/erpnext/setup/install.py index 68bc6cddfe..94d435ecc6 100644 --- a/erpnext/setup/install.py +++ b/erpnext/setup/install.py @@ -10,7 +10,7 @@ def after_install(): import_country_and_currency() from erpnext.accounts.doctype.chart_of_accounts.import_charts import import_charts import_charts() - frappe.db.set_value('Control Panel', None, 'home_page', 'setup-wizard') + frappe.db.set_default('desktop:home_page', 'setup-wizard') feature_setup() from erpnext.setup.page.setup_wizard.setup_wizard import add_all_roles_to add_all_roles_to("Administrator") @@ -138,7 +138,7 @@ def feature_setup(): def set_single_defaults(): for dt in frappe.db.sql_list("""select name from `tabDocType` - where issingle=1 and paent != 'Control Panel'"""): + where issingle=1 and parent != '__default'"""): default_values = frappe.db.sql("""select fieldname, `default` from `tabDocField` where parent=%s""", dt) if default_values: diff --git a/erpnext/setup/page/setup_wizard/setup_wizard.js b/erpnext/setup/page/setup_wizard/setup_wizard.js index a8e6380276..8fb8e11d4f 100644 --- a/erpnext/setup/page/setup_wizard/setup_wizard.js +++ b/erpnext/setup/page/setup_wizard/setup_wizard.js @@ -106,7 +106,7 @@ frappe.pages['setup-wizard'].onload = function(wrapper) { var parts = slide.get_input("company_name").val().split(" "); var abbr = $.map(parts, function(p) { return p ? p.substr(0,1) : null }).join(""); slide.get_input("company_abbr").val(abbr.toUpperCase()); - }).val(frappe.boot.control_panel.company_name || "").trigger("change"); + }).val(frappe.boot.sysdefaults.company_name || "").trigger("change"); slide.get_input("fy_start_date").on("change", function() { var year_end_date = diff --git a/erpnext/setup/page/setup_wizard/setup_wizard.py b/erpnext/setup/page/setup_wizard/setup_wizard.py index 61a3c71ac3..2a69e10879 100644 --- a/erpnext/setup/page/setup_wizard/setup_wizard.py +++ b/erpnext/setup/page/setup_wizard/setup_wizard.py @@ -31,7 +31,7 @@ def setup_account(args=None): create_items(args) create_customers(args) create_suppliers(args) - frappe.db.set_value('Control Panel', None, 'home_page', 'desktop') + frappe.db.set_default('desktop:home_page', 'desktop') frappe.clear_cache() frappe.db.commit() @@ -166,10 +166,8 @@ def set_defaults(args): email_settings.send_print_in_body_and_attachment = 1 email_settings.save() - # control panel - cp = frappe.get_doc("Control Panel", "Control Panel") - cp.company_name = args["company_name"] - cp.save() + # default + frappe.db.set_default("company_name", args["company_name"]) def create_feed_and_todo(): """update activty feed and create todo for creation of item, customer, vendor""" @@ -345,7 +343,7 @@ def add_all_roles_to(name): def create_territories(): """create two default territories, one for home country and one named Rest of the World""" from frappe.utils.nestedset import get_root_of - country = frappe.db.get_value("Control Panel", None, "country") + country = frappe.db.get_default("country") root_territory = get_root_of("Territory") for name in (country, "Rest Of The World"): if name and not frappe.db.exists("Territory", name): diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js index 88dff1a3d3..2359700809 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js @@ -41,7 +41,7 @@ erpnext.stock.PurchaseReceiptController = erpnext.buying.BuyingController.extend }); } - if(frappe.boot.control_panel.country == 'India') { + if(frappe.boot.sysdefaults.country == 'India') { unhide_field(['challan_no', 'challan_date']); } }, diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js index 0ae7e18387..07456debf7 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry.js @@ -192,7 +192,7 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({ }, add_excise_button: function() { - if(frappe.boot.control_panel.country === "India") + if(frappe.boot.sysdefaults.country === "India") this.frm.add_custom_button(frappe._("Make Excise Invoice"), function() { var excise = frappe.model.make_new_doc_and_get_name('Journal Voucher'); excise = locals['Journal Voucher'][excise]; diff --git a/erpnext/utilities/doctype/sms_control/sms_control.py b/erpnext/utilities/doctype/sms_control/sms_control.py index 4408212bde..ba858c6dd3 100644 --- a/erpnext/utilities/doctype/sms_control/sms_control.py +++ b/erpnext/utilities/doctype/sms_control/sms_control.py @@ -33,7 +33,7 @@ class SMSControl(Document): sender_name = frappe.db.get_value('Global Defaults', None, 'sms_sender_name') or \ 'ERPNXT' if len(sender_name) > 6 and \ - frappe.db.get_value("Control Panel", None, "country") == "India": + frappe.db.get_default("country") == "India": throw(_(""" As per TRAI rule, sender name must be exactly 6 characters. Kindly change sender name in Setup --> Global Defaults. From a504f0638bdb4d13ef301bc290cd2fca1af9e959 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 4 Apr 2014 12:16:26 +0530 Subject: [PATCH 30/42] frappe/frappe#478, fixed list passed in --- erpnext/accounts/general_ledger.py | 2 +- .../4_0/customer_discount_to_pricing_rule.py | 4 +- erpnext/setup/doctype/company/company.py | 2 +- .../setup/page/setup_wizard/setup_wizard.js | 2 +- .../setup/page/setup_wizard/setup_wizard.py | 24 ++++----- erpnext/startup/boot.py | 6 +-- .../material_request/test_material_request.py | 53 ++++++++++--------- erpnext/stock/doctype/serial_no/serial_no.py | 4 +- .../doctype/stock_ledger/stock_ledger.py | 2 +- .../test_stock_reconciliation.py | 4 +- erpnext/stock/stock_ledger.py | 6 +-- erpnext/stock/utils.py | 11 ++-- .../maintenance_schedule.py | 2 +- .../support_ticket/get_support_mails.py | 4 +- 14 files changed, 61 insertions(+), 65 deletions(-) diff --git a/erpnext/accounts/general_ledger.py b/erpnext/accounts/general_ledger.py index 2531e17f27..d321d00e1a 100644 --- a/erpnext/accounts/general_ledger.py +++ b/erpnext/accounts/general_ledger.py @@ -77,7 +77,7 @@ def save_entries(gl_map, adv_adj, update_outstanding): def make_entry(args, adv_adj, update_outstanding): args.update({"doctype": "GL Entry"}) - gle = frappe.get_doc([args]) + gle = frappe.get_doc(args) gle.ignore_permissions = 1 gle.insert() gle.run_method("on_update_with_args", adv_adj, update_outstanding) 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 51719c5b50..a92568e8d4 100644 --- a/erpnext/patches/4_0/customer_discount_to_pricing_rule.py +++ b/erpnext/patches/4_0/customer_discount_to_pricing_rule.py @@ -17,7 +17,7 @@ def execute(): else: item_group = d.item_group - frappe.get_doc([{ + frappe.get_doc({ "doctype": "Pricing Rule", "apply_on": "Item Group", "item_group": item_group, @@ -25,7 +25,7 @@ def execute(): "customer": d.parent, "price_or_discount": "Discount", "discount_percentage": d.discount - }]).insert() + }).insert() frappe.db.auto_commit_on_many_writes = False diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py index 77bfca43e6..7355bd2b28 100644 --- a/erpnext/setup/doctype/company/company.py +++ b/erpnext/setup/doctype/company/company.py @@ -112,7 +112,7 @@ class Company(Document): def import_chart_of_account(self): chart = frappe.get_doc("Chart of Accounts", self.chart_of_accounts) - chart.make_controller().create_accounts(self.name) + chart.create_accounts(self.name) def add_acc(self,lst): account = frappe.get_doc({ diff --git a/erpnext/setup/page/setup_wizard/setup_wizard.js b/erpnext/setup/page/setup_wizard/setup_wizard.js index 8fb8e11d4f..fe2ceb88d3 100644 --- a/erpnext/setup/page/setup_wizard/setup_wizard.js +++ b/erpnext/setup/page/setup_wizard/setup_wizard.js @@ -40,7 +40,7 @@ frappe.pages['setup-wizard'].onload = function(wrapper) { title: frappe._("ERPNext Setup Guide"), welcome_html: '

\

'+frappe._('ERPNext Setup')+'

\ -

' + +

' + frappe._('Welcome to ERPNext. Over the next few minutes we will help you setup your ERPNext account. Try and fill in as much information as you have even if it takes a bit longer. It will save you a lot of time later. Good Luck!') + '

', working_html: '

\ diff --git a/erpnext/setup/page/setup_wizard/setup_wizard.py b/erpnext/setup/page/setup_wizard/setup_wizard.py index 2a69e10879..3f52463610 100644 --- a/erpnext/setup/page/setup_wizard/setup_wizard.py +++ b/erpnext/setup/page/setup_wizard/setup_wizard.py @@ -73,16 +73,16 @@ def update_user_name(args): def create_fiscal_year_and_company(args): curr_fiscal_year = get_fy_details(args.get('fy_start_date'), args.get('fy_end_date')) - frappe.get_doc([{ + frappe.get_doc({ "doctype":"Fiscal Year", 'year': curr_fiscal_year, 'year_start_date': args.get('fy_start_date'), 'year_end_date': args.get('fy_end_date'), - }]).insert() + }).insert() print args # Company - frappe.get_doc([{ + frappe.get_doc({ "doctype":"Company", 'domain': args.get("industry"), 'company_name':args.get('company_name'), @@ -90,27 +90,23 @@ def create_fiscal_year_and_company(args): 'default_currency':args.get('currency'), 'country': args.get('country'), 'chart_of_accounts': args.get(('chart_of_accounts')), - }]).insert() + }).insert() args["curr_fiscal_year"] = curr_fiscal_year def create_price_lists(args): for pl_type in ["Selling", "Buying"]: - frappe.get_doc([ - { + frappe.get_doc({ "doctype": "Price List", "price_list_name": "Standard " + pl_type, "enabled": 1, "buying": 1 if pl_type == "Buying" else 0, "selling": 1 if pl_type == "Selling" else 0, - "currency": args["currency"] - }, - { - "doctype": "Applicable Territory", - "parentfield": "valid_for_territories", - "territory": "All Territories" - } - ]).insert() + "currency": args["currency"], + "valid_for_territories": { + "territory": "All Territories" + } + }).insert() def set_defaults(args): # enable default currency diff --git a/erpnext/startup/boot.py b/erpnext/startup/boot.py index 9cf2020909..1d5a6d207b 100644 --- a/erpnext/startup/boot.py +++ b/erpnext/startup/boot.py @@ -31,9 +31,9 @@ def boot_session(bootinfo): from `tabCompany`""", as_dict=1, update={"doctype":":Company"}) def load_country_and_currency(bootinfo): - if bootinfo.control_panel.country and \ - frappe.db.exists("Country", bootinfo.control_panel.country): - bootinfo["docs"] += [frappe.get_doc("Country", bootinfo.control_panel.country)] + country = frappe.db.get_default("country") + if country and frappe.db.exists("Country", country): + bootinfo["docs"] += [frappe.get_doc("Country", country)] bootinfo["docs"] += frappe.db.sql("""select * from tabCurrency where ifnull(enabled,0)=1""", as_dict=1, update={"doctype":":Currency"}) diff --git a/erpnext/stock/doctype/material_request/test_material_request.py b/erpnext/stock/doctype/material_request/test_material_request.py index ecdc9c0efd..14b9f2821f 100644 --- a/erpnext/stock/doctype/material_request/test_material_request.py +++ b/erpnext/stock/doctype/material_request/test_material_request.py @@ -71,39 +71,40 @@ class TestMaterialRequest(unittest.TestCase): "warehouse": "_Test Warehouse - _TC"}, "indented_qty")), qty2) def _insert_stock_entry(self, qty1, qty2): - se = frappe.get_doc([ - { + se = frappe.get_doc({ "company": "_Test Company", "doctype": "Stock Entry", "posting_date": "2013-03-01", "posting_time": "00:00:00", "purpose": "Material Receipt", "fiscal_year": "_Test Fiscal Year 2013", + "mtn_details": [ + { + "conversion_factor": 1.0, + "doctype": "Stock Entry Detail", + "item_code": "_Test Item Home Desktop 100", + "parentfield": "mtn_details", + "incoming_rate": 100, + "qty": qty1, + "stock_uom": "_Test UOM 1", + "transfer_qty": qty1, + "uom": "_Test UOM 1", + "t_warehouse": "_Test Warehouse 1 - _TC", + }, + { + "conversion_factor": 1.0, + "doctype": "Stock Entry Detail", + "item_code": "_Test Item Home Desktop 200", + "parentfield": "mtn_details", + "incoming_rate": 100, + "qty": qty2, + "stock_uom": "_Test UOM 1", + "transfer_qty": qty2, + "uom": "_Test UOM 1", + "t_warehouse": "_Test Warehouse 1 - _TC", + } + ] }, - { - "conversion_factor": 1.0, - "doctype": "Stock Entry Detail", - "item_code": "_Test Item Home Desktop 100", - "parentfield": "mtn_details", - "incoming_rate": 100, - "qty": qty1, - "stock_uom": "_Test UOM 1", - "transfer_qty": qty1, - "uom": "_Test UOM 1", - "t_warehouse": "_Test Warehouse 1 - _TC", - }, - { - "conversion_factor": 1.0, - "doctype": "Stock Entry Detail", - "item_code": "_Test Item Home Desktop 200", - "parentfield": "mtn_details", - "incoming_rate": 100, - "qty": qty2, - "stock_uom": "_Test UOM 1", - "transfer_qty": qty2, - "uom": "_Test UOM 1", - "t_warehouse": "_Test Warehouse 1 - _TC", - }, ]) se.insert() se.submit() diff --git a/erpnext/stock/doctype/serial_no/serial_no.py b/erpnext/stock/doctype/serial_no/serial_no.py index d6b1ef26e7..7a259f8e1f 100644 --- a/erpnext/stock/doctype/serial_no/serial_no.py +++ b/erpnext/stock/doctype/serial_no/serial_no.py @@ -264,7 +264,7 @@ def update_serial_nos(sle, item_det): for serial_no in serial_nos: if frappe.db.exists("Serial No", serial_no): sr = frappe.get_doc("Serial No", serial_no) - sr.make_controller().via_stock_ledger = True + sr.via_stock_ledger = True sr.warehouse = sle.warehouse if sle.actual_qty > 0 else None sr.save() elif sle.actual_qty > 0: @@ -284,7 +284,7 @@ def make_serial_no(serial_no, sle): sr.serial_no = serial_no sr.item_code = sle.item_code sr.warehouse = None - sr.make_controller().via_stock_ledger = True + sr.via_stock_ledger = True sr.insert() sr.warehouse = sle.warehouse sr.status = "Available" diff --git a/erpnext/stock/doctype/stock_ledger/stock_ledger.py b/erpnext/stock/doctype/stock_ledger/stock_ledger.py index a20da19123..fca9cb0b70 100644 --- a/erpnext/stock/doctype/stock_ledger/stock_ledger.py +++ b/erpnext/stock/doctype/stock_ledger/stock_ledger.py @@ -41,7 +41,7 @@ class StockLedger(Document): def make_entry(self, args): args.update({"doctype": "Stock Ledger Entry"}) - sle = frappe.get_doc([args]) + sle = frappe.get_doc(args) sle.ignore_permissions = 1 sle.insert() return sle.name diff --git a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py index 2f88c5674a..083879de53 100644 --- a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py @@ -175,7 +175,7 @@ class TestStockReconciliation(unittest.TestCase): frappe.db.sql("delete from `tabGL Entry`") def submit_stock_reconciliation(self, qty, rate, posting_date, posting_time): - stock_reco = frappe.get_doc([{ + stock_reco = frappe.get_doc({ "doctype": "Stock Reconciliation", "posting_date": posting_date, "posting_time": posting_time, @@ -187,7 +187,7 @@ class TestStockReconciliation(unittest.TestCase): ["Item Code", "Warehouse", "Quantity", "Valuation Rate"], ["_Test Item", "_Test Warehouse - _TC", qty, rate] ]), - }]) + }) stock_reco.insert() stock_reco.submit() return stock_reco diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index c8921d614c..cf95845cc8 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -49,7 +49,7 @@ def set_as_cancel(voucher_type, voucher_no): def make_entry(args): args.update({"doctype": "Stock Ledger Entry"}) - sle = frappe.get_doc([args]) + sle = frappe.get_doc(args) sle.ignore_permissions = 1 sle.insert() sle.submit() @@ -137,11 +137,11 @@ def update_entries_after(args, verbose=1): # update bin if not frappe.db.exists({"doctype": "Bin", "item_code": args["item_code"], "warehouse": args["warehouse"]}): - bin_wrapper = frappe.get_doc([{ + bin_wrapper = frappe.get_doc({ "doctype": "Bin", "item_code": args["item_code"], "warehouse": args["warehouse"], - }]) + }) bin_wrapper.ignore_permissions = 1 bin_wrapper.insert() diff --git a/erpnext/stock/utils.py b/erpnext/stock/utils.py index 343f6c96ef..0345a7edf9 100644 --- a/erpnext/stock/utils.py +++ b/erpnext/stock/utils.py @@ -40,16 +40,15 @@ def get_latest_stock_balance(): def get_bin(item_code, warehouse): bin = frappe.db.get_value("Bin", {"item_code": item_code, "warehouse": warehouse}) if not bin: - bin_wrapper = frappe.get_doc([{ + bin_obj = frappe.get_doc({ "doctype": "Bin", "item_code": item_code, "warehouse": warehouse, - }]) - bin_wrapper.ignore_permissions = 1 - bin_wrapper.insert() - bin_obj = bin_wrapper.make_controller() + }) + bin_obj.ignore_permissions = 1 + bin_obj.insert() else: - bin_obj = frappe.get_doc('Bin', bin) + bin_obj = frappe.get_doc('Bin', bin) return bin_obj def update_bin(args): diff --git a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py index b9cc0bcbd3..7178fa21c3 100644 --- a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py +++ b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py @@ -58,7 +58,7 @@ class MaintenanceSchedule(TransactionBase): self.update_amc_date(serial_nos, d.end_date) if d.sales_person not in email_map: - sp = frappe.get_doc("Sales Person", d.sales_person).make_controller() + sp = frappe.get_doc("Sales Person", d.sales_person) email_map[d.sales_person] = sp.get_email_id() scheduled_date = frappe.db.sql("""select scheduled_date from diff --git a/erpnext/support/doctype/support_ticket/get_support_mails.py b/erpnext/support/doctype/support_ticket/get_support_mails.py index b36437e92b..92e90312b9 100644 --- a/erpnext/support/doctype/support_ticket/get_support_mails.py +++ b/erpnext/support/doctype/support_ticket/get_support_mails.py @@ -63,14 +63,14 @@ def add_support_communication(subject, content, sender, docname=None, mail=None) ticket.ignore_permissions = True ticket.save() else: - ticket = frappe.get_doc([decode_dict({ + ticket = frappe.get_doc(decode_dict({ "doctype":"Support Ticket", "description": content, "subject": subject, "raised_by": sender, "content_type": mail.content_type if mail else None, "status": "Open", - })]) + })) ticket.ignore_permissions = True ticket.ignore_mandatory = True ticket.insert() From e7885e3ee0ff354eafd30a36c867c4b6a74cd94c Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 4 Apr 2014 13:26:50 +0530 Subject: [PATCH 31/42] frappe/frappe#478 replaced doclist in testcases --- .../journal_voucher/journal_voucher.py | 20 +- .../journal_voucher/test_journal_voucher.py | 46 ++--- .../test_period_closing_voucher.py | 6 +- .../purchase_invoice/test_purchase_invoice.py | 8 +- .../sales_invoice/test_sales_invoice.py | 46 ++--- .../shipping_rule/test_shipping_rule.py | 12 +- .../purchase_order/test_purchase_order.py | 4 +- .../production_order/test_production_order.py | 2 +- .../time_log_batch/test_time_log_batch.py | 2 +- .../doctype/sales_order/test_sales_order.py | 64 +++---- erpnext/setup/install.py | 3 +- .../delivery_note/test_delivery_note.py | 36 ++-- .../material_request/test_material_request.py | 3 +- .../purchase_receipt/test_purchase_receipt.py | 16 +- .../doctype/stock_entry/test_stock_entry.py | 174 +++++++++--------- .../test_stock_reconciliation.py | 32 ++-- 16 files changed, 236 insertions(+), 238 deletions(-) diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher.py b/erpnext/accounts/doctype/journal_voucher/journal_voucher.py index 9829a17954..ff50dcde60 100644 --- a/erpnext/accounts/doctype/journal_voucher/journal_voucher.py +++ b/erpnext/accounts/doctype/journal_voucher/journal_voucher.py @@ -353,13 +353,13 @@ def get_payment_entry_from_sales_invoice(sales_invoice): jv.remark = 'Payment received against Sales Invoice {0}. {1}'.format(si.name, si.remarks) # credit customer - jv.doclist[1].account = si.debit_to - jv.doclist[1].balance = get_balance_on(si.debit_to) - jv.doclist[1].credit = si.outstanding_amount - jv.doclist[1].against_invoice = si.name + jv["entries"][0].account = si.debit_to + jv["entries"][0].balance = get_balance_on(si.debit_to) + jv["entries"][0].credit = si.outstanding_amount + jv["entries"][0].against_invoice = si.name # debit bank - jv.doclist[2].debit = si.outstanding_amount + jv["entries"][1].debit = si.outstanding_amount return jv.as_dict() @@ -371,13 +371,13 @@ def get_payment_entry_from_purchase_invoice(purchase_invoice): jv.remark = 'Payment against Purchase Invoice {0}. {1}'.format(pi.name, pi.remarks) # credit supplier - jv.doclist[1].account = pi.credit_to - jv.doclist[1].balance = get_balance_on(pi.credit_to) - jv.doclist[1].debit = pi.outstanding_amount - jv.doclist[1].against_voucher = pi.name + jv["entries"][0].account = pi.credit_to + jv["entries"][0].balance = get_balance_on(pi.credit_to) + jv["entries"][0].debit = pi.outstanding_amount + jv["entries"][0].against_voucher = pi.name # credit bank - jv.doclist[2].credit = pi.outstanding_amount + jv["entries"][1].credit = pi.outstanding_amount return jv.as_dict() diff --git a/erpnext/accounts/doctype/journal_voucher/test_journal_voucher.py b/erpnext/accounts/doctype/journal_voucher/test_journal_voucher.py index c3a3d85ae9..19c3cefec1 100644 --- a/erpnext/accounts/doctype/journal_voucher/test_journal_voucher.py +++ b/erpnext/accounts/doctype/journal_voucher/test_journal_voucher.py @@ -9,7 +9,7 @@ import frappe class TestJournalVoucher(unittest.TestCase): def test_journal_voucher_with_against_jv(self): self.clear_account_balance() - jv_invoice = frappe.copy_doc(test_records[2]) + jv_invoice = frappe.copy_doc(test_records[1]) jv_invoice.insert() jv_invoice.submit() @@ -17,7 +17,7 @@ class TestJournalVoucher(unittest.TestCase): where against_jv=%s""", jv_invoice.name)) jv_payment = frappe.copy_doc(test_records[0]) - jv_payment.doclist[1].against_jv = jv_invoice.name + jv_payment["entries"][0].against_jv = jv_invoice.name jv_payment.insert() jv_payment.submit() @@ -38,7 +38,7 @@ class TestJournalVoucher(unittest.TestCase): set_perpetual_inventory() jv = frappe.copy_doc(test_records[0]) - jv.doclist[1].account = "_Test Warehouse - _TC" + jv["entries"][0].account = "_Test Warehouse - _TC" jv.insert() from erpnext.accounts.general_ledger import StockAccountInvalidTransaction @@ -51,10 +51,10 @@ class TestJournalVoucher(unittest.TestCase): self.clear_account_balance() jv = frappe.copy_doc(test_records[0]) - jv.doclist[2].account = "_Test Account Cost for Goods Sold - _TC" - jv.doclist[2].cost_center = "_Test Cost Center - _TC" - jv.doclist[2].debit = 20000.0 - jv.doclist[1].credit = 20000.0 + jv["entries"][1].account = "_Test Account Cost for Goods Sold - _TC" + jv["entries"][1].cost_center = "_Test Cost Center - _TC" + jv["entries"][1].debit = 20000.0 + jv["entries"][0].credit = 20000.0 jv.insert() jv.submit() self.assertTrue(frappe.db.get_value("GL Entry", @@ -66,10 +66,10 @@ class TestJournalVoucher(unittest.TestCase): self.clear_account_balance() jv = frappe.copy_doc(test_records[0]) - jv.doclist[2].account = "_Test Account Cost for Goods Sold - _TC" - jv.doclist[2].cost_center = "_Test Cost Center - _TC" - jv.doclist[2].debit = 20000.0 - jv.doclist[1].credit = 20000.0 + jv["entries"][1].account = "_Test Account Cost for Goods Sold - _TC" + jv["entries"][1].cost_center = "_Test Cost Center - _TC" + jv["entries"][1].debit = 20000.0 + jv["entries"][0].credit = 20000.0 jv.insert() self.assertRaises(BudgetError, jv.submit) @@ -85,10 +85,10 @@ class TestJournalVoucher(unittest.TestCase): jv = frappe.copy_doc(test_records[0]) jv.posting_date = "2013-08-12" - jv.doclist[2].account = "_Test Account Cost for Goods Sold - _TC" - jv.doclist[2].cost_center = "_Test Cost Center - _TC" - jv.doclist[2].debit = 150000.0 - jv.doclist[1].credit = 150000.0 + jv["entries"][1].account = "_Test Account Cost for Goods Sold - _TC" + jv["entries"][1].cost_center = "_Test Cost Center - _TC" + jv["entries"][1].debit = 150000.0 + jv["entries"][0].credit = 150000.0 jv.insert() self.assertRaises(BudgetError, jv.submit) @@ -101,20 +101,20 @@ class TestJournalVoucher(unittest.TestCase): self.clear_account_balance() jv = frappe.copy_doc(test_records[0]) - jv.doclist[1].account = "_Test Account Cost for Goods Sold - _TC" - jv.doclist[1].cost_center = "_Test Cost Center - _TC" - jv.doclist[1].credit = 30000.0 - jv.doclist[2].debit = 30000.0 + jv["entries"][0].account = "_Test Account Cost for Goods Sold - _TC" + jv["entries"][0].cost_center = "_Test Cost Center - _TC" + jv["entries"][0].credit = 30000.0 + jv["entries"][1].debit = 30000.0 jv.submit() self.assertTrue(frappe.db.get_value("GL Entry", {"voucher_type": "Journal Voucher", "voucher_no": jv.name})) jv1 = frappe.copy_doc(test_records[0]) - jv1.doclist[2].account = "_Test Account Cost for Goods Sold - _TC" - jv1.doclist[2].cost_center = "_Test Cost Center - _TC" - jv1.doclist[2].debit = 40000.0 - jv1.doclist[1].credit = 40000.0 + jv1["entries"][1].account = "_Test Account Cost for Goods Sold - _TC" + jv1["entries"][1].cost_center = "_Test Cost Center - _TC" + jv1["entries"][1].debit = 40000.0 + jv1["entries"][0].credit = 40000.0 jv1.submit() self.assertTrue(frappe.db.get_value("GL Entry", diff --git a/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py b/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py index 12facd8aa3..1a31989f03 100644 --- a/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py +++ b/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py @@ -17,9 +17,9 @@ class TestPeriodClosingVoucher(unittest.TestCase): jv.submit() jv1 = frappe.copy_doc(jv_records[0]) - jv1.doclist[2].account = "_Test Account Cost for Goods Sold - _TC" - jv1.doclist[2].debit = 600.0 - jv1.doclist[1].credit = 600.0 + jv1["entries"][1].account = "_Test Account Cost for Goods Sold - _TC" + jv1["entries"][1].debit = 600.0 + jv1["entries"][0].credit = 600.0 jv1.insert() jv1.submit() diff --git a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py index cb5cd31c5d..30425fe23f 100644 --- a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py @@ -74,8 +74,8 @@ class TestPurchaseInvoice(unittest.TestCase): self.assertEqual(cint(frappe.defaults.get_global_default("auto_accounting_for_stock")), 1) pi = frappe.copy_doc(test_records[1]) - pi.doclist[1].item_code = "_Test Non Stock Item" - pi.doclist[1].expense_account = "_Test Account Cost for Goods Sold - _TC" + pi["entries"][0].item_code = "_Test Non Stock Item" + pi["entries"][0].expense_account = "_Test Account Cost for Goods Sold - _TC" pi.doclist.pop(2) pi.doclist.pop(3) pi.insert() @@ -133,7 +133,7 @@ class TestPurchaseInvoice(unittest.TestCase): def test_purchase_invoice_with_subcontracted_item(self): wrapper = frappe.copy_doc(test_records[0]) - wrapper.doclist[1].item_code = "_Test FG Item" + wrapper["entries"][0].item_code = "_Test FG Item" wrapper.insert() wrapper.load_from_db() @@ -176,7 +176,7 @@ class TestPurchaseInvoice(unittest.TestCase): pi = frappe.copy_doc(test_records[0]) pi.append("advance_allocation_details", { "journal_voucher": jv.name, - "jv_detail_no": jv.doclist[1].name, + "jv_detail_no": jv["entries"][0].name, "advance_amount": 400, "allocated_amount": 300, "remarks": jv.remark diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index 75a9ab53e6..fdeb075e6d 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -89,10 +89,10 @@ class TestSalesInvoice(unittest.TestCase): si = frappe.copy_doc(test_records[2]) si.currency = "USD" si.conversion_rate = 50 - si.doclist[1].rate = 1 - si.doclist[1].price_list_rate = 1 - si.doclist[2].rate = 3 - si.doclist[2].price_list_rate = 3 + si["entries"][0].rate = 1 + si["entries"][0].price_list_rate = 1 + si["entries"][1].rate = 3 + si["entries"][1].price_list_rate = 3 si.insert() expected_values = { @@ -243,8 +243,8 @@ class TestSalesInvoice(unittest.TestCase): for i, tax in enumerate(si.get("other_charges")): tax.idx = i+1 - si.doclist[1].price_list_rate = 62.5 - si.doclist[1].price_list_rate = 191 + si["entries"][0].price_list_rate = 62.5 + si["entries"][0].price_list_rate = 191 for i in [3, 5, 6, 7, 8, 9]: si.doclist[i].included_in_print_rate = 1 @@ -305,10 +305,10 @@ class TestSalesInvoice(unittest.TestCase): si = frappe.copy_doc(test_records[3]) si.currency = "USD" si.conversion_rate = 50 - si.doclist[1].price_list_rate = 55.56 - si.doclist[1].discount_percentage = 10 - si.doclist[2].price_list_rate = 187.5 - si.doclist[2].discount_percentage = 20 + si["entries"][0].price_list_rate = 55.56 + si["entries"][0].discount_percentage = 10 + si["entries"][1].price_list_rate = 187.5 + si["entries"][1].discount_percentage = 20 si.doclist[9].rate = 5000 si.insert() @@ -365,7 +365,7 @@ class TestSalesInvoice(unittest.TestCase): import test_records as jv_test_records jv = frappe.get_doc(frappe.copy_doc(jv_test_records[0])) - jv.doclist[1].against_invoice = w.name + jv["entries"][0].against_invoice = w.name jv.insert() jv.submit() @@ -381,7 +381,7 @@ class TestSalesInvoice(unittest.TestCase): tlb.submit() si = frappe.get_doc(frappe.copy_doc(test_records[0])) - si.doclist[1].time_log_batch = "_T-Time Log Batch-00001" + si["entries"][0].time_log_batch = "_T-Time Log Batch-00001" si.insert() si.submit() @@ -501,7 +501,7 @@ class TestSalesInvoice(unittest.TestCase): as pr_test_records pr = frappe.copy_doc(pr_test_records[0]) pr.naming_series = "_T-Purchase Receipt-" - pr.doclist[1].warehouse = "_Test Warehouse No Account - _TC" + pr["entries"][0].warehouse = "_Test Warehouse No Account - _TC" pr.insert() pr.submit() @@ -638,7 +638,7 @@ class TestSalesInvoice(unittest.TestCase): si.append("advance_adjustment_details", { "doctype": "Sales Invoice Advance", "journal_voucher": jv.name, - "jv_detail_no": jv.doclist[1].name, + "jv_detail_no": jv["entries"][0].name, "advance_amount": 400, "allocated_amount": 300, "remarks": jv.remark @@ -808,13 +808,13 @@ class TestSalesInvoice(unittest.TestCase): from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos se = make_serialized_item() - serial_nos = get_serial_nos(se.doclist[1].serial_no) + serial_nos = get_serial_nos(se["entries"][0].serial_no) si = frappe.copy_doc(test_records[0]) si.update_stock = 1 - si.doclist[1].item_code = "_Test Serialized Item With Series" - si.doclist[1].qty = 1 - si.doclist[1].serial_no = serial_nos[0] + si["entries"][0].item_code = "_Test Serialized Item With Series" + si["entries"][0].qty = 1 + si["entries"][0].serial_no = serial_nos[0] si.insert() si.submit() @@ -830,7 +830,7 @@ class TestSalesInvoice(unittest.TestCase): si = self.test_serialized() si.cancel() - serial_nos = get_serial_nos(si.doclist[1].serial_no) + serial_nos = get_serial_nos(si["entries"][0].serial_no) self.assertEquals(frappe.db.get_value("Serial No", serial_nos[0], "status"), "Available") self.assertEquals(frappe.db.get_value("Serial No", serial_nos[0], "warehouse"), "_Test Warehouse - _TC") @@ -842,7 +842,7 @@ class TestSalesInvoice(unittest.TestCase): from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item se = make_serialized_item() - serial_nos = get_serial_nos(se.doclist[1].serial_no) + serial_nos = get_serial_nos(se["entries"][0].serial_no) sr = frappe.get_doc("Serial No", serial_nos[0]) sr.status = "Not Available" @@ -850,9 +850,9 @@ class TestSalesInvoice(unittest.TestCase): si = frappe.copy_doc(test_records[0]) si.update_stock = 1 - si.doclist[1].item_code = "_Test Serialized Item With Series" - si.doclist[1].qty = 1 - si.doclist[1].serial_no = serial_nos[0] + si["entries"][0].item_code = "_Test Serialized Item With Series" + si["entries"][0].qty = 1 + si["entries"][0].serial_no = serial_nos[0] si.insert() self.assertRaises(SerialNoStatusError, si.submit) diff --git a/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py b/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py index 9fee555213..ce07f146b1 100644 --- a/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py +++ b/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py @@ -10,12 +10,12 @@ test_records = frappe.get_test_records('Shipping Rule') class TestShippingRule(unittest.TestCase): def test_from_greater_than_to(self): shipping_rule = frappe.copy_doc(test_records[0]) - shipping_rule.doclist[1].from_value = 101 + shipping_rule["shipping_rule_conditions"][0].from_value = 101 self.assertRaises(FromGreaterThanToError, shipping_rule.insert) def test_many_zero_to_values(self): shipping_rule = frappe.copy_doc(test_records[0]) - shipping_rule.doclist[1].to_value = 0 + shipping_rule["shipping_rule_conditions"][0].to_value = 0 self.assertRaises(ManyBlankToValuesError, shipping_rule.insert) def test_overlapping_conditions(self): @@ -27,8 +27,8 @@ class TestShippingRule(unittest.TestCase): ((50, 150), (50, 150)), ]: shipping_rule = frappe.copy_doc(test_records[0]) - shipping_rule.doclist[1].from_value = range_a[0] - shipping_rule.doclist[1].to_value = range_a[1] - shipping_rule.doclist[2].from_value = range_b[0] - shipping_rule.doclist[2].to_value = range_b[1] + shipping_rule["shipping_rule_conditions"][0].from_value = range_a[0] + shipping_rule["shipping_rule_conditions"][0].to_value = range_a[1] + shipping_rule["shipping_rule_conditions"][1].from_value = range_b[0] + shipping_rule["shipping_rule_conditions"][1].to_value = range_b[1] self.assertRaises(OverlappingConditionError, shipping_rule.insert) \ No newline at end of file diff --git a/erpnext/buying/doctype/purchase_order/test_purchase_order.py b/erpnext/buying/doctype/purchase_order/test_purchase_order.py index 358023383d..104baf9e4b 100644 --- a/erpnext/buying/doctype/purchase_order/test_purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/test_purchase_order.py @@ -41,7 +41,7 @@ class TestPurchaseOrder(unittest.TestCase): po = frappe.get_doc("Purchase Order", po.name) po.is_subcontracted = "No" - po.doclist[1].item_code = "_Test Item" + po["po_details"][0].item_code = "_Test Item" po.submit() self.assertEquals(frappe.db.get_value("Bin", {"item_code": "_Test Item", @@ -107,7 +107,7 @@ class TestPurchaseOrder(unittest.TestCase): def test_uom_integer_validation(self): from erpnext.utilities.transaction_base import UOMMustBeIntegerError po = frappe.copy_doc(test_records[0]) - po.doclist[1].qty = 3.4 + po["po_details"][0].qty = 3.4 self.assertRaises(UOMMustBeIntegerError, po.insert) diff --git a/erpnext/manufacturing/doctype/production_order/test_production_order.py b/erpnext/manufacturing/doctype/production_order/test_production_order.py index d7d41988bb..31889b51f8 100644 --- a/erpnext/manufacturing/doctype/production_order/test_production_order.py +++ b/erpnext/manufacturing/doctype/production_order/test_production_order.py @@ -27,7 +27,7 @@ class TestProductionOrder(unittest.TestCase): mr1.submit() mr2 = frappe.copy_doc(se_test_records[0]) - mr2.doclist[1].item_code = "_Test Item Home Desktop 100" + mr2["mtn_details"][0].item_code = "_Test Item Home Desktop 100" mr2.insert() mr2.submit() diff --git a/erpnext/projects/doctype/time_log_batch/test_time_log_batch.py b/erpnext/projects/doctype/time_log_batch/test_time_log_batch.py index eaf498c2d6..004c3643ac 100644 --- a/erpnext/projects/doctype/time_log_batch/test_time_log_batch.py +++ b/erpnext/projects/doctype/time_log_batch/test_time_log_batch.py @@ -17,7 +17,7 @@ class TimeLogBatchTest(unittest.TestCase): self.assertEquals(frappe.db.get_value("Time Log", time_log.name, "status"), "Submitted") tlb = frappe.copy_doc(test_records[0]) - tlb.doclist[1].time_log = time_log.name + tlb["time_log_batch_details"][0].time_log = time_log.name tlb.insert() tlb.submit() diff --git a/erpnext/selling/doctype/sales_order/test_sales_order.py b/erpnext/selling/doctype/sales_order/test_sales_order.py index 435ad65757..1e71f5cee8 100644 --- a/erpnext/selling/doctype/sales_order/test_sales_order.py +++ b/erpnext/selling/doctype/sales_order/test_sales_order.py @@ -78,14 +78,14 @@ class TestSalesOrder(unittest.TestCase): from erpnext.stock.doctype.delivery_note.test_delivery_note import test_records as dn_test_records from erpnext.stock.doctype.delivery_note.test_delivery_note import _insert_purchase_receipt - _insert_purchase_receipt(so.doclist[1].item_code) + _insert_purchase_receipt(so["sales_order_details"][0].item_code) dn = frappe.get_doc(frappe.copy_doc(dn_test_records[0])) - dn.doclist[1].item_code = so.doclist[1].item_code - dn.doclist[1].against_sales_order = so.name - dn.doclist[1].prevdoc_detail_docname = so.doclist[1].name + dn["delivery_note_details"][0].item_code = so["sales_order_details"][0].item_code + dn["delivery_note_details"][0].against_sales_order = so.name + dn["delivery_note_details"][0].prevdoc_detail_docname = so["sales_order_details"][0].name if delivered_qty: - dn.doclist[1].qty = delivered_qty + dn["delivery_note_details"][0].qty = delivered_qty dn.insert() dn.submit() return dn @@ -110,11 +110,11 @@ class TestSalesOrder(unittest.TestCase): # submit so = self.create_so() - self.check_reserved_qty(so.doclist[1].item_code, so.doclist[1].warehouse, 10.0) + self.check_reserved_qty(so["sales_order_details"][0].item_code, so["sales_order_details"][0].warehouse, 10.0) # cancel so.cancel() - self.check_reserved_qty(so.doclist[1].item_code, so.doclist[1].warehouse, 0.0) + self.check_reserved_qty(so["sales_order_details"][0].item_code, so["sales_order_details"][0].warehouse, 0.0) def test_reserved_qty_for_partial_delivery(self): @@ -130,21 +130,21 @@ class TestSalesOrder(unittest.TestCase): # submit dn dn = self.create_dn_against_so(so) - self.check_reserved_qty(so.doclist[1].item_code, so.doclist[1].warehouse, 5.0) + self.check_reserved_qty(so["sales_order_details"][0].item_code, so["sales_order_details"][0].warehouse, 5.0) # stop so so.load_from_db() so.obj.stop_sales_order() - self.check_reserved_qty(so.doclist[1].item_code, so.doclist[1].warehouse, 0.0) + self.check_reserved_qty(so["sales_order_details"][0].item_code, so["sales_order_details"][0].warehouse, 0.0) # unstop so so.load_from_db() so.obj.unstop_sales_order() - self.check_reserved_qty(so.doclist[1].item_code, so.doclist[1].warehouse, 5.0) + self.check_reserved_qty(so["sales_order_details"][0].item_code, so["sales_order_details"][0].warehouse, 5.0) # cancel dn dn.cancel() - self.check_reserved_qty(so.doclist[1].item_code, so.doclist[1].warehouse, 10.0) + self.check_reserved_qty(so["sales_order_details"][0].item_code, so["sales_order_details"][0].warehouse, 10.0) def test_reserved_qty_for_over_delivery(self): # reset bin @@ -157,15 +157,15 @@ class TestSalesOrder(unittest.TestCase): frappe.db.set_default("allow_negative_stock", 1) # set over-delivery tolerance - frappe.db.set_value('Item', so.doclist[1].item_code, 'tolerance', 50) + frappe.db.set_value('Item', so["sales_order_details"][0].item_code, 'tolerance', 50) # submit dn dn = self.create_dn_against_so(so, 15) - self.check_reserved_qty(so.doclist[1].item_code, so.doclist[1].warehouse, 0.0) + self.check_reserved_qty(so["sales_order_details"][0].item_code, so["sales_order_details"][0].warehouse, 0.0) # cancel dn dn.cancel() - self.check_reserved_qty(so.doclist[1].item_code, so.doclist[1].warehouse, 10.0) + self.check_reserved_qty(so["sales_order_details"][0].item_code, so["sales_order_details"][0].warehouse, 10.0) def test_reserved_qty_for_so_with_packing_list(self): from erpnext.selling.doctype.sales_bom.test_sales_bom import test_records as sbom_test_records @@ -183,16 +183,16 @@ class TestSalesOrder(unittest.TestCase): self.check_reserved_qty(sbom_test_records[0][1]["item_code"], - so.doclist[1].warehouse, 50.0) + so["sales_order_details"][0].warehouse, 50.0) self.check_reserved_qty(sbom_test_records[0][2]["item_code"], - so.doclist[1].warehouse, 20.0) + so["sales_order_details"][0].warehouse, 20.0) # cancel so.cancel() self.check_reserved_qty(sbom_test_records[0][1]["item_code"], - so.doclist[1].warehouse, 0.0) + so["sales_order_details"][0].warehouse, 0.0) self.check_reserved_qty(sbom_test_records[0][2]["item_code"], - so.doclist[1].warehouse, 0.0) + so["sales_order_details"][0].warehouse, 0.0) def test_reserved_qty_for_partial_delivery_with_packing_list(self): from erpnext.selling.doctype.sales_bom.test_sales_bom import test_records as sbom_test_records @@ -216,33 +216,33 @@ class TestSalesOrder(unittest.TestCase): dn = self.create_dn_against_so(so) self.check_reserved_qty(sbom_test_records[0][1]["item_code"], - so.doclist[1].warehouse, 25.0) + so["sales_order_details"][0].warehouse, 25.0) self.check_reserved_qty(sbom_test_records[0][2]["item_code"], - so.doclist[1].warehouse, 10.0) + so["sales_order_details"][0].warehouse, 10.0) # stop so so.load_from_db() so.obj.stop_sales_order() self.check_reserved_qty(sbom_test_records[0][1]["item_code"], - so.doclist[1].warehouse, 0.0) + so["sales_order_details"][0].warehouse, 0.0) self.check_reserved_qty(sbom_test_records[0][2]["item_code"], - so.doclist[1].warehouse, 0.0) + so["sales_order_details"][0].warehouse, 0.0) # unstop so so.load_from_db() so.obj.unstop_sales_order() self.check_reserved_qty(sbom_test_records[0][1]["item_code"], - so.doclist[1].warehouse, 25.0) + so["sales_order_details"][0].warehouse, 25.0) self.check_reserved_qty(sbom_test_records[0][2]["item_code"], - so.doclist[1].warehouse, 10.0) + so["sales_order_details"][0].warehouse, 10.0) # cancel dn dn.cancel() self.check_reserved_qty(sbom_test_records[0][1]["item_code"], - so.doclist[1].warehouse, 50.0) + so["sales_order_details"][0].warehouse, 50.0) self.check_reserved_qty(sbom_test_records[0][2]["item_code"], - so.doclist[1].warehouse, 20.0) + so["sales_order_details"][0].warehouse, 20.0) def test_reserved_qty_for_over_delivery_with_packing_list(self): from erpnext.selling.doctype.sales_bom.test_sales_bom import test_records as sbom_test_records @@ -262,22 +262,22 @@ class TestSalesOrder(unittest.TestCase): frappe.db.set_default("allow_negative_stock", 1) # set over-delivery tolerance - frappe.db.set_value('Item', so.doclist[1].item_code, 'tolerance', 50) + frappe.db.set_value('Item', so["sales_order_details"][0].item_code, 'tolerance', 50) # submit dn dn = self.create_dn_against_so(so, 15) self.check_reserved_qty(sbom_test_records[0][1]["item_code"], - so.doclist[1].warehouse, 0.0) + so["sales_order_details"][0].warehouse, 0.0) self.check_reserved_qty(sbom_test_records[0][2]["item_code"], - so.doclist[1].warehouse, 0.0) + so["sales_order_details"][0].warehouse, 0.0) # cancel dn dn.cancel() self.check_reserved_qty(sbom_test_records[0][1]["item_code"], - so.doclist[1].warehouse, 50.0) + so["sales_order_details"][0].warehouse, 50.0) self.check_reserved_qty(sbom_test_records[0][2]["item_code"], - so.doclist[1].warehouse, 20.0) + so["sales_order_details"][0].warehouse, 20.0) def test_warehouse_user(self): frappe.defaults.add_default("Warehouse", "_Test Warehouse 1 - _TC1", "test@example.com", "Restriction") @@ -293,7 +293,7 @@ class TestSalesOrder(unittest.TestCase): so.company = "_Test Company 1" so.conversion_rate = 0.02 so.plc_conversion_rate = 0.02 - so.doclist[1].warehouse = "_Test Warehouse 2 - _TC1" + so["sales_order_details"][0].warehouse = "_Test Warehouse 2 - _TC1" self.assertRaises(frappe.PermissionError, so.insert) frappe.set_user("test2@example.com") diff --git a/erpnext/setup/install.py b/erpnext/setup/install.py index 94d435ecc6..5128e36e8c 100644 --- a/erpnext/setup/install.py +++ b/erpnext/setup/install.py @@ -137,8 +137,7 @@ def feature_setup(): doc.save() def set_single_defaults(): - for dt in frappe.db.sql_list("""select name from `tabDocType` - where issingle=1 and parent != '__default'"""): + for dt in frappe.db.sql_list("""select name from `tabDocType` where issingle=1"""): default_values = frappe.db.sql("""select fieldname, `default` from `tabDocField` where parent=%s""", dt) if default_values: diff --git a/erpnext/stock/doctype/delivery_note/test_delivery_note.py b/erpnext/stock/doctype/delivery_note/test_delivery_note.py index 1ee4993cec..e54b5c02dd 100644 --- a/erpnext/stock/doctype/delivery_note/test_delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/test_delivery_note.py @@ -14,7 +14,7 @@ def _insert_purchase_receipt(item_code=None): item_code = pr_test_records[0][1]["item_code"] pr = frappe.copy_doc(pr_test_records[0]) - pr.doclist[1].item_code = item_code + pr["purchase_receipt_details"][0].item_code = item_code pr.insert() pr.submit() @@ -69,11 +69,11 @@ class TestDeliveryNote(unittest.TestCase): _insert_purchase_receipt() dn = frappe.copy_doc(test_records[0]) - dn.doclist[1].expense_account = "Cost of Goods Sold - _TC" - dn.doclist[1].cost_center = "Main - _TC" + dn["delivery_note_details"][0].expense_account = "Cost of Goods Sold - _TC" + dn["delivery_note_details"][0].cost_center = "Main - _TC" stock_in_hand_account = frappe.db.get_value("Account", - {"master_name": dn.doclist[1].warehouse}) + {"master_name": dn["delivery_note_details"][0].warehouse}) from erpnext.accounts.utils import get_balance_on prev_bal = get_balance_on(stock_in_hand_account, dn.posting_date) @@ -97,8 +97,8 @@ class TestDeliveryNote(unittest.TestCase): # back dated purchase receipt pr = frappe.copy_doc(pr_test_records[0]) pr.posting_date = "2013-01-01" - pr.doclist[1].rate = 100 - pr.doclist[1].base_amount = 100 + pr["purchase_receipt_details"][0].rate = 100 + pr["purchase_receipt_details"][0].base_amount = 100 pr.insert() pr.submit() @@ -124,11 +124,11 @@ class TestDeliveryNote(unittest.TestCase): _insert_purchase_receipt("_Test Item Home Desktop 100") dn = frappe.copy_doc(test_records[0]) - dn.doclist[1].item_code = "_Test Sales BOM Item" - dn.doclist[1].qty = 1 + dn["delivery_note_details"][0].item_code = "_Test Sales BOM Item" + dn["delivery_note_details"][0].qty = 1 stock_in_hand_account = frappe.db.get_value("Account", - {"master_name": dn.doclist[1].warehouse}) + {"master_name": dn["delivery_note_details"][0].warehouse}) from erpnext.accounts.utils import get_balance_on prev_bal = get_balance_on(stock_in_hand_account, dn.posting_date) @@ -160,12 +160,12 @@ class TestDeliveryNote(unittest.TestCase): from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos se = make_serialized_item() - serial_nos = get_serial_nos(se.doclist[1].serial_no) + serial_nos = get_serial_nos(se["mtn_details"][0].serial_no) dn = frappe.copy_doc(test_records[0]) - dn.doclist[1].item_code = "_Test Serialized Item With Series" - dn.doclist[1].qty = 1 - dn.doclist[1].serial_no = serial_nos[0] + dn["delivery_note_details"][0].item_code = "_Test Serialized Item With Series" + dn["delivery_note_details"][0].qty = 1 + dn["delivery_note_details"][0].serial_no = serial_nos[0] dn.insert() dn.submit() @@ -181,7 +181,7 @@ class TestDeliveryNote(unittest.TestCase): dn = self.test_serialized() dn.cancel() - serial_nos = get_serial_nos(dn.doclist[1].serial_no) + serial_nos = get_serial_nos(dn["delivery_note_details"][0].serial_no) self.assertEquals(frappe.db.get_value("Serial No", serial_nos[0], "status"), "Available") self.assertEquals(frappe.db.get_value("Serial No", serial_nos[0], "warehouse"), "_Test Warehouse - _TC") @@ -193,16 +193,16 @@ class TestDeliveryNote(unittest.TestCase): from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item se = make_serialized_item() - serial_nos = get_serial_nos(se.doclist[1].serial_no) + serial_nos = get_serial_nos(se["mtn_details"][0].serial_no) sr = frappe.get_doc("Serial No", serial_nos[0]) sr.status = "Not Available" sr.save() dn = frappe.copy_doc(test_records[0]) - dn.doclist[1].item_code = "_Test Serialized Item With Series" - dn.doclist[1].qty = 1 - dn.doclist[1].serial_no = serial_nos[0] + dn["delivery_note_details"][0].item_code = "_Test Serialized Item With Series" + dn["delivery_note_details"][0].qty = 1 + dn["delivery_note_details"][0].serial_no = serial_nos[0] dn.insert() self.assertRaises(SerialNoStatusError, dn.submit) diff --git a/erpnext/stock/doctype/material_request/test_material_request.py b/erpnext/stock/doctype/material_request/test_material_request.py index 14b9f2821f..9c51f7baa9 100644 --- a/erpnext/stock/doctype/material_request/test_material_request.py +++ b/erpnext/stock/doctype/material_request/test_material_request.py @@ -104,8 +104,7 @@ class TestMaterialRequest(unittest.TestCase): "t_warehouse": "_Test Warehouse 1 - _TC", } ] - }, - ]) + }) se.insert() se.submit() diff --git a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py index 4c2b3a001c..74939b6996 100644 --- a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py @@ -65,9 +65,9 @@ class TestPurchaseReceipt(unittest.TestCase): self.assertTrue(gl_entries) stock_in_hand_account = frappe.db.get_value("Account", - {"master_name": pr.doclist[1].warehouse}) + {"master_name": pr["purchase_receipt_details"][0].warehouse}) fixed_asset_account = frappe.db.get_value("Account", - {"master_name": pr.doclist[2].warehouse}) + {"master_name": pr["purchase_receipt_details"][1].warehouse}) expected_values = { stock_in_hand_account: [375.0, 0.0], @@ -94,18 +94,18 @@ class TestPurchaseReceipt(unittest.TestCase): pr.run_method("calculate_taxes_and_totals") pr.insert() - self.assertEquals(pr.doclist[1].rm_supp_cost, 70000.0) + self.assertEquals(pr["purchase_receipt_details"][0].rm_supp_cost, 70000.0) self.assertEquals(len(pr.get("pr_raw_material_details")), 2) def test_serial_no_supplier(self): pr = frappe.copy_doc(test_records[0]) - pr.doclist[1].item_code = "_Test Serialized Item With Series" - pr.doclist[1].qty = 1 - pr.doclist[1].received_qty = 1 + pr["purchase_receipt_details"][0].item_code = "_Test Serialized Item With Series" + pr["purchase_receipt_details"][0].qty = 1 + pr["purchase_receipt_details"][0].received_qty = 1 pr.insert() pr.submit() - self.assertEquals(frappe.db.get_value("Serial No", pr.doclist[1].serial_no, + self.assertEquals(frappe.db.get_value("Serial No", pr["purchase_receipt_details"][0].serial_no, "supplier"), pr.supplier) return pr @@ -114,7 +114,7 @@ class TestPurchaseReceipt(unittest.TestCase): pr = self.test_serial_no_supplier() pr.cancel() - self.assertFalse(frappe.db.get_value("Serial No", pr.doclist[1].serial_no, + self.assertFalse(frappe.db.get_value("Serial No", pr["purchase_receipt_details"][0].serial_no, "warehouse")) def get_gl_entries(voucher_type, voucher_no): diff --git a/erpnext/stock/doctype/stock_entry/test_stock_entry.py b/erpnext/stock/doctype/stock_entry/test_stock_entry.py index 8c764ee892..00718f14a8 100644 --- a/erpnext/stock/doctype/stock_entry/test_stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/test_stock_entry.py @@ -50,7 +50,7 @@ class TestStockEntry(unittest.TestCase): mr.submit() stock_in_hand_account = frappe.db.get_value("Account", {"account_type": "Warehouse", - "master_name": mr.doclist[1].t_warehouse}) + "master_name": mr["mtn_details"][0].t_warehouse}) self.check_stock_ledger_entries("Stock Entry", mr.name, [["_Test Item", "_Test Warehouse - _TC", 50.0]]) @@ -85,7 +85,7 @@ class TestStockEntry(unittest.TestCase): [["_Test Item", "_Test Warehouse - _TC", -40.0]]) stock_in_hand_account = frappe.db.get_value("Account", {"account_type": "Warehouse", - "master_name": mi.doclist[1].s_warehouse}) + "master_name": mi["mtn_details"][0].s_warehouse}) self.check_gl_entries("Stock Entry", mi.name, sorted([ @@ -101,11 +101,11 @@ class TestStockEntry(unittest.TestCase): self.assertFalse(frappe.db.sql("""select * from `tabGL Entry` where voucher_type='Stock Entry' and voucher_no=%s""", mi.name)) - self.assertEquals(frappe.db.get_value("Bin", {"warehouse": mi.doclist[1].s_warehouse, - "item_code": mi.doclist[1].item_code}, "actual_qty"), 50) + self.assertEquals(frappe.db.get_value("Bin", {"warehouse": mi["mtn_details"][0].s_warehouse, + "item_code": mi["mtn_details"][0].item_code}, "actual_qty"), 50) - self.assertEquals(frappe.db.get_value("Bin", {"warehouse": mi.doclist[1].s_warehouse, - "item_code": mi.doclist[1].item_code}, "stock_value"), 5000) + self.assertEquals(frappe.db.get_value("Bin", {"warehouse": mi["mtn_details"][0].s_warehouse, + "item_code": mi["mtn_details"][0].item_code}, "stock_value"), 5000) def test_material_transfer_gl_entry(self): self._clear_stock_account_balance() @@ -121,10 +121,10 @@ class TestStockEntry(unittest.TestCase): [["_Test Item", "_Test Warehouse - _TC", -45.0], ["_Test Item", "_Test Warehouse 1 - _TC", 45.0]]) stock_in_hand_account = frappe.db.get_value("Account", {"account_type": "Warehouse", - "master_name": mtn.doclist[1].s_warehouse}) + "master_name": mtn["mtn_details"][0].s_warehouse}) fixed_asset_account = frappe.db.get_value("Account", {"account_type": "Warehouse", - "master_name": mtn.doclist[1].t_warehouse}) + "master_name": mtn["mtn_details"][0].t_warehouse}) self.check_gl_entries("Stock Entry", mtn.name, @@ -171,12 +171,12 @@ class TestStockEntry(unittest.TestCase): self._insert_material_receipt() repack = frappe.copy_doc(test_records[3]) - repack.doclist[2].incoming_rate = 6000 + repack["mtn_details"][1].incoming_rate = 6000 repack.insert() repack.submit() stock_in_hand_account = frappe.db.get_value("Account", {"account_type": "Warehouse", - "master_name": repack.doclist[2].t_warehouse}) + "master_name": repack["mtn_details"][1].t_warehouse}) self.check_gl_entries("Stock Entry", repack.name, sorted([ @@ -223,7 +223,7 @@ class TestStockEntry(unittest.TestCase): se1.submit() se2 = frappe.copy_doc(test_records[0]) - se2.doclist[1].item_code = "_Test Item Home Desktop 100" + se2["mtn_details"][0].item_code = "_Test Item Home Desktop 100" se2.insert() se2.submit() @@ -247,8 +247,8 @@ class TestStockEntry(unittest.TestCase): se = frappe.copy_doc(test_records[0]) se.purpose = "Sales Return" se.sales_invoice_no = si.name - se.doclist[1].qty = returned_qty - se.doclist[1].transfer_qty = returned_qty + se["mtn_details"][0].qty = returned_qty + se["mtn_details"][0].transfer_qty = returned_qty self.assertRaises(NotUpdateStockError, se.insert) self._insert_material_receipt() @@ -259,9 +259,9 @@ class TestStockEntry(unittest.TestCase): # insert a pos invoice with update stock si = frappe.copy_doc(sales_invoice_test_records[1]) si.is_pos = si.update_stock = 1 - si.doclist[1].warehouse = "_Test Warehouse - _TC" - si.doclist[1].item_code = item_code - si.doclist[1].qty = 5.0 + si["mtn_details"][0].warehouse = "_Test Warehouse - _TC" + si["mtn_details"][0].item_code = item_code + si["mtn_details"][0].qty = 5.0 si.insert() si.submit() @@ -276,9 +276,9 @@ class TestStockEntry(unittest.TestCase): se.sales_invoice_no = si.name se.posting_date = "2013-03-10" se.fiscal_year = "_Test Fiscal Year 2013" - se.doclist[1].item_code = "_Test Item Home Desktop 200" - se.doclist[1].qty = returned_qty - se.doclist[1].transfer_qty = returned_qty + se["mtn_details"][0].item_code = "_Test Item Home Desktop 200" + se["mtn_details"][0].qty = returned_qty + se["mtn_details"][0].transfer_qty = returned_qty # check if stock entry gets submitted self.assertRaises(frappe.DoesNotExistError, se.insert) @@ -289,8 +289,8 @@ class TestStockEntry(unittest.TestCase): se.posting_date = "2013-03-10" se.fiscal_year = "_Test Fiscal Year 2013" se.sales_invoice_no = si.name - se.doclist[1].qty = returned_qty - se.doclist[1].transfer_qty = returned_qty + se["mtn_details"][0].qty = returned_qty + se["mtn_details"][0].transfer_qty = returned_qty # in both cases item code remains _Test Item when returning se.insert() @@ -322,7 +322,7 @@ class TestStockEntry(unittest.TestCase): actual_qty_0 = self._get_actual_qty() # make a delivery note based on this invoice dn = frappe.copy_doc(delivery_note_test_records[0]) - dn.doclist[1].item_code = item_code + dn["delivery_note_details"][0].item_code = item_code dn.insert() dn.submit() @@ -347,7 +347,7 @@ class TestStockEntry(unittest.TestCase): se.delivery_note_no = dn.name se.posting_date = "2013-03-10" se.fiscal_year = "_Test Fiscal Year 2013" - se.doclist[1].qty = se.doclist[1].transfer_qty = returned_qty + se["mtn_details"][0].qty = se["mtn_details"][0].transfer_qty = returned_qty se.insert() se.submit() @@ -411,8 +411,8 @@ class TestStockEntry(unittest.TestCase): actual_qty_0 = self._get_actual_qty() so = frappe.copy_doc(sales_order_test_records[0]) - so.doclist[1].item_code = item_code - so.doclist[1].qty = 5.0 + so["sales_order_details"][0].item_code = item_code + so["sales_order_details"][0].qty = 5.0 so.insert() so.submit() @@ -445,7 +445,7 @@ class TestStockEntry(unittest.TestCase): se.delivery_note_no = dn.name se.posting_date = "2013-03-10" se.fiscal_year = "_Test Fiscal Year 2013" - se.doclist[1].qty = se.doclist[1].transfer_qty = returned_qty + se["mtn_details"][0].qty = se["mtn_details"][0].transfer_qty = returned_qty se.insert() se.submit() @@ -497,8 +497,8 @@ class TestStockEntry(unittest.TestCase): se.purchase_receipt_no = pr.name se.posting_date = "2013-03-01" se.fiscal_year = "_Test Fiscal Year 2013" - se.doclist[1].qty = se.doclist[1].transfer_qty = 5 - se.doclist[1].s_warehouse = "_Test Warehouse - _TC" + se["mtn_details"][0].qty = se["mtn_details"][0].transfer_qty = 5 + se["mtn_details"][0].s_warehouse = "_Test Warehouse - _TC" se.insert() se.submit() @@ -523,8 +523,8 @@ class TestStockEntry(unittest.TestCase): se.purchase_receipt_no = pr_docname se.posting_date = "2013-03-01" se.fiscal_year = "_Test Fiscal Year 2013" - se.doclist[1].qty = se.doclist[1].transfer_qty = 6 - se.doclist[1].s_warehouse = "_Test Warehouse - _TC" + se["mtn_details"][0].qty = se["mtn_details"][0].transfer_qty = 6 + se["mtn_details"][0].s_warehouse = "_Test Warehouse - _TC" self.assertRaises(StockOverReturnError, se.insert) @@ -561,8 +561,8 @@ class TestStockEntry(unittest.TestCase): # submit purchase receipt po = frappe.copy_doc(purchase_order_test_records[0]) po.is_subcontracted = None - po.doclist[1].item_code = "_Test Item" - po.doclist[1].rate = 50 + po["po_details"][0].item_code = "_Test Item" + po["po_details"][0].rate = 50 po.insert() po.submit() @@ -599,8 +599,8 @@ class TestStockEntry(unittest.TestCase): se.purchase_receipt_no = pr.name se.posting_date = "2013-03-01" se.fiscal_year = "_Test Fiscal Year 2013" - se.doclist[1].qty = se.doclist[1].transfer_qty = 5 - se.doclist[1].s_warehouse = "_Test Warehouse - _TC" + se["mtn_details"][0].qty = se["mtn_details"][0].transfer_qty = 5 + se["mtn_details"][0].s_warehouse = "_Test Warehouse - _TC" se.insert() se.submit() @@ -622,43 +622,43 @@ class TestStockEntry(unittest.TestCase): def test_serial_no_not_reqd(self): se = frappe.copy_doc(test_records[0]) - se.doclist[1].serial_no = "ABCD" + se["mtn_details"][0].serial_no = "ABCD" se.insert() self.assertRaises(SerialNoNotRequiredError, se.submit) def test_serial_no_reqd(self): se = frappe.copy_doc(test_records[0]) - se.doclist[1].item_code = "_Test Serialized Item" - se.doclist[1].qty = 2 - se.doclist[1].transfer_qty = 2 + se["mtn_details"][0].item_code = "_Test Serialized Item" + se["mtn_details"][0].qty = 2 + se["mtn_details"][0].transfer_qty = 2 se.insert() self.assertRaises(SerialNoRequiredError, se.submit) def test_serial_no_qty_more(self): se = frappe.copy_doc(test_records[0]) - se.doclist[1].item_code = "_Test Serialized Item" - se.doclist[1].qty = 2 - se.doclist[1].serial_no = "ABCD\nEFGH\nXYZ" - se.doclist[1].transfer_qty = 2 + se["mtn_details"][0].item_code = "_Test Serialized Item" + se["mtn_details"][0].qty = 2 + se["mtn_details"][0].serial_no = "ABCD\nEFGH\nXYZ" + se["mtn_details"][0].transfer_qty = 2 se.insert() self.assertRaises(SerialNoQtyError, se.submit) def test_serial_no_qty_less(self): se = frappe.copy_doc(test_records[0]) - se.doclist[1].item_code = "_Test Serialized Item" - se.doclist[1].qty = 2 - se.doclist[1].serial_no = "ABCD" - se.doclist[1].transfer_qty = 2 + se["mtn_details"][0].item_code = "_Test Serialized Item" + se["mtn_details"][0].qty = 2 + se["mtn_details"][0].serial_no = "ABCD" + se["mtn_details"][0].transfer_qty = 2 se.insert() self.assertRaises(SerialNoQtyError, se.submit) def test_serial_no_transfer_in(self): self._clear_stock_account_balance() se = frappe.copy_doc(test_records[0]) - se.doclist[1].item_code = "_Test Serialized Item" - se.doclist[1].qty = 2 - se.doclist[1].serial_no = "ABCD\nEFGH" - se.doclist[1].transfer_qty = 2 + se["mtn_details"][0].item_code = "_Test Serialized Item" + se["mtn_details"][0].qty = 2 + se["mtn_details"][0].serial_no = "ABCD\nEFGH" + se["mtn_details"][0].transfer_qty = 2 se.insert() se.submit() @@ -672,12 +672,12 @@ class TestStockEntry(unittest.TestCase): self._clear_stock_account_balance() se = frappe.copy_doc(test_records[0]) se.purpose = "Material Issue" - se.doclist[1].item_code = "_Test Serialized Item" - se.doclist[1].qty = 2 - se.doclist[1].s_warehouse = "_Test Warehouse 1 - _TC" - se.doclist[1].t_warehouse = None - se.doclist[1].serial_no = "ABCD\nEFGH" - se.doclist[1].transfer_qty = 2 + se["mtn_details"][0].item_code = "_Test Serialized Item" + se["mtn_details"][0].qty = 2 + se["mtn_details"][0].s_warehouse = "_Test Warehouse 1 - _TC" + se["mtn_details"][0].t_warehouse = None + se["mtn_details"][0].serial_no = "ABCD\nEFGH" + se["mtn_details"][0].transfer_qty = 2 se.insert() self.assertRaises(SerialNoNotExistsError, se.submit) @@ -686,10 +686,10 @@ class TestStockEntry(unittest.TestCase): self.test_serial_by_series() se = frappe.copy_doc(test_records[0]) - se.doclist[1].item_code = "_Test Serialized Item With Series" - se.doclist[1].qty = 1 - se.doclist[1].serial_no = "ABCD00001" - se.doclist[1].transfer_qty = 1 + se["mtn_details"][0].item_code = "_Test Serialized Item With Series" + se["mtn_details"][0].qty = 1 + se["mtn_details"][0].serial_no = "ABCD00001" + se["mtn_details"][0].transfer_qty = 1 se.insert() self.assertRaises(SerialNoDuplicateError, se.submit) @@ -697,7 +697,7 @@ class TestStockEntry(unittest.TestCase): self._clear_stock_account_balance() se = make_serialized_item() - serial_nos = get_serial_nos(se.doclist[1].serial_no) + serial_nos = get_serial_nos(se["mtn_details"][0].serial_no) self.assertTrue(frappe.db.exists("Serial No", serial_nos[0])) self.assertTrue(frappe.db.exists("Serial No", serial_nos[1])) @@ -710,28 +710,28 @@ class TestStockEntry(unittest.TestCase): se = frappe.copy_doc(test_records[0]) se.purpose = "Material Transfer" - se.doclist[1].item_code = "_Test Serialized Item" - se.doclist[1].qty = 1 - se.doclist[1].transfer_qty = 1 - se.doclist[1].serial_no = "ABCD00001" - se.doclist[1].s_warehouse = "_Test Warehouse - _TC" - se.doclist[1].t_warehouse = "_Test Warehouse 1 - _TC" + se["mtn_details"][0].item_code = "_Test Serialized Item" + se["mtn_details"][0].qty = 1 + se["mtn_details"][0].transfer_qty = 1 + se["mtn_details"][0].serial_no = "ABCD00001" + se["mtn_details"][0].s_warehouse = "_Test Warehouse - _TC" + se["mtn_details"][0].t_warehouse = "_Test Warehouse 1 - _TC" se.insert() self.assertRaises(SerialNoItemError, se.submit) def test_serial_move(self): self._clear_stock_account_balance() se = make_serialized_item() - serial_no = get_serial_nos(se.doclist[1].serial_no)[0] + serial_no = get_serial_nos(se["mtn_details"][0].serial_no)[0] se = frappe.copy_doc(test_records[0]) se.purpose = "Material Transfer" - se.doclist[1].item_code = "_Test Serialized Item With Series" - se.doclist[1].qty = 1 - se.doclist[1].transfer_qty = 1 - se.doclist[1].serial_no = serial_no - se.doclist[1].s_warehouse = "_Test Warehouse - _TC" - se.doclist[1].t_warehouse = "_Test Warehouse 1 - _TC" + se["mtn_details"][0].item_code = "_Test Serialized Item With Series" + se["mtn_details"][0].qty = 1 + se["mtn_details"][0].transfer_qty = 1 + se["mtn_details"][0].serial_no = serial_no + se["mtn_details"][0].s_warehouse = "_Test Warehouse - _TC" + se["mtn_details"][0].t_warehouse = "_Test Warehouse 1 - _TC" se.insert() se.submit() self.assertTrue(frappe.db.get_value("Serial No", serial_no, "warehouse"), "_Test Warehouse 1 - _TC") @@ -745,12 +745,12 @@ class TestStockEntry(unittest.TestCase): se = frappe.copy_doc(test_records[0]) se.purpose = "Material Transfer" - se.doclist[1].item_code = "_Test Serialized Item With Series" - se.doclist[1].qty = 1 - se.doclist[1].transfer_qty = 1 - se.doclist[1].serial_no = "ABCD00001" - se.doclist[1].s_warehouse = "_Test Warehouse 1 - _TC" - se.doclist[1].t_warehouse = "_Test Warehouse - _TC" + se["mtn_details"][0].item_code = "_Test Serialized Item With Series" + se["mtn_details"][0].qty = 1 + se["mtn_details"][0].transfer_qty = 1 + se["mtn_details"][0].serial_no = "ABCD00001" + se["mtn_details"][0].s_warehouse = "_Test Warehouse 1 - _TC" + se["mtn_details"][0].t_warehouse = "_Test Warehouse - _TC" se.insert() self.assertRaises(SerialNoWarehouseError, se.submit) @@ -759,7 +759,7 @@ class TestStockEntry(unittest.TestCase): se = self.test_serial_by_series() se.cancel() - serial_no = get_serial_nos(se.doclist[1].serial_no)[0] + serial_no = get_serial_nos(se["mtn_details"][0].serial_no)[0] self.assertFalse(frappe.db.get_value("Serial No", serial_no, "warehouse")) def test_warehouse_company_validation(self): @@ -771,7 +771,7 @@ class TestStockEntry(unittest.TestCase): from erpnext.stock.utils import InvalidWarehouseCompany st1 = frappe.copy_doc(test_records[0]) - st1.doclist[1].t_warehouse="_Test Warehouse 2 - _TC1" + st1["mtn_details"][0].t_warehouse="_Test Warehouse 2 - _TC1" st1.insert() self.assertRaises(InvalidWarehouseCompany, st1.submit) @@ -790,13 +790,13 @@ class TestStockEntry(unittest.TestCase): frappe.set_user("test@example.com") st1 = frappe.copy_doc(test_records[0]) st1.company = "_Test Company 1" - st1.doclist[1].t_warehouse="_Test Warehouse 2 - _TC1" + st1["mtn_details"][0].t_warehouse="_Test Warehouse 2 - _TC1" self.assertRaises(frappe.PermissionErrorp, st1.insert) frappe.set_user("test2@example.com") st1 = frappe.copy_doc(test_records[0]) st1.company = "_Test Company 1" - st1.doclist[1].t_warehouse="_Test Warehouse 2 - _TC1" + st1["mtn_details"][0].t_warehouse="_Test Warehouse 2 - _TC1" st1.insert() st1.submit() @@ -822,9 +822,9 @@ class TestStockEntry(unittest.TestCase): def make_serialized_item(): se = frappe.copy_doc(test_records[0]) - se.doclist[1].item_code = "_Test Serialized Item With Series" - se.doclist[1].qty = 2 - se.doclist[1].transfer_qty = 2 + se["mtn_details"][0].item_code = "_Test Serialized Item With Series" + se["mtn_details"][0].qty = 2 + se["mtn_details"][0].transfer_qty = 2 se.insert() se.submit() return se diff --git a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py index 083879de53..0553830755 100644 --- a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py @@ -228,9 +228,9 @@ class TestStockReconciliation(unittest.TestCase): pr1 = frappe.copy_doc(stock_entry) pr1.posting_date = "2012-12-15" pr1.posting_time = "02:00" - pr1.doclist[1].qty = 10 - pr1.doclist[1].transfer_qty = 10 - pr1.doclist[1].incoming_rate = 700 + pr1["mtn_details"][0].qty = 10 + pr1["mtn_details"][0].transfer_qty = 10 + pr1["mtn_details"][0].incoming_rate = 700 pr1.insert() pr1.submit() @@ -238,11 +238,11 @@ class TestStockReconciliation(unittest.TestCase): pr2.posting_date = "2012-12-25" pr2.posting_time = "03:00" pr2.purpose = "Material Issue" - pr2.doclist[1].s_warehouse = "_Test Warehouse - _TC" - pr2.doclist[1].t_warehouse = None - pr2.doclist[1].qty = 15 - pr2.doclist[1].transfer_qty = 15 - pr2.doclist[1].incoming_rate = 0 + pr2["mtn_details"][0].s_warehouse = "_Test Warehouse - _TC" + pr2["mtn_details"][0].t_warehouse = None + pr2["mtn_details"][0].qty = 15 + pr2["mtn_details"][0].transfer_qty = 15 + pr2["mtn_details"][0].incoming_rate = 0 pr2.insert() pr2.submit() @@ -250,11 +250,11 @@ class TestStockReconciliation(unittest.TestCase): pr3.posting_date = "2012-12-31" pr3.posting_time = "08:00" pr3.purpose = "Material Issue" - pr3.doclist[1].s_warehouse = "_Test Warehouse - _TC" - pr3.doclist[1].t_warehouse = None - pr3.doclist[1].qty = 20 - pr3.doclist[1].transfer_qty = 20 - pr3.doclist[1].incoming_rate = 0 + pr3["mtn_details"][0].s_warehouse = "_Test Warehouse - _TC" + pr3["mtn_details"][0].t_warehouse = None + pr3["mtn_details"][0].qty = 20 + pr3["mtn_details"][0].transfer_qty = 20 + pr3["mtn_details"][0].incoming_rate = 0 pr3.insert() pr3.submit() @@ -263,9 +263,9 @@ class TestStockReconciliation(unittest.TestCase): pr4.posting_date = "2013-01-05" pr4.fiscal_year = "_Test Fiscal Year 2013" pr4.posting_time = "07:00" - pr4.doclist[1].qty = 15 - pr4.doclist[1].transfer_qty = 15 - pr4.doclist[1].incoming_rate = 1200 + pr4["mtn_details"][0].qty = 15 + pr4["mtn_details"][0].transfer_qty = 15 + pr4["mtn_details"][0].incoming_rate = 1200 pr4.insert() pr4.submit() From bedc62f0908c72b0cad5c1797559b0fc3cdde5c3 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 4 Apr 2014 16:26:45 +0530 Subject: [PATCH 32/42] Fixed Feed --- erpnext/home/doctype/feed/feed.json | 82 +++++++++++++------------- erpnext/home/page/activity/activity.py | 9 +-- 2 files changed, 46 insertions(+), 45 deletions(-) diff --git a/erpnext/home/doctype/feed/feed.json b/erpnext/home/doctype/feed/feed.json index 6578d48e24..755b8b83c7 100644 --- a/erpnext/home/doctype/feed/feed.json +++ b/erpnext/home/doctype/feed/feed.json @@ -1,61 +1,61 @@ { - "autoname": "_FEED.#####", - "creation": "2012-07-03 13:29:42.000000", - "docstatus": 0, - "doctype": "DocType", + "autoname": "hash", + "creation": "2012-07-03 13:29:42.000000", + "docstatus": 0, + "doctype": "DocType", "fields": [ { - "fieldname": "feed_type", - "fieldtype": "Select", - "label": "Feed Type", + "fieldname": "feed_type", + "fieldtype": "Select", + "label": "Feed Type", "permlevel": 0 - }, + }, { - "fieldname": "doc_type", - "fieldtype": "Data", - "label": "Doc Type", + "fieldname": "doc_type", + "fieldtype": "Data", + "label": "Doc Type", "permlevel": 0 - }, + }, { - "fieldname": "doc_name", - "fieldtype": "Data", - "label": "Doc Name", + "fieldname": "doc_name", + "fieldtype": "Data", + "label": "Doc Name", "permlevel": 0 - }, + }, { - "fieldname": "subject", - "fieldtype": "Data", - "label": "Subject", + "fieldname": "subject", + "fieldtype": "Data", + "label": "Subject", "permlevel": 0 - }, + }, { - "fieldname": "color", - "fieldtype": "Data", - "label": "Color", + "fieldname": "color", + "fieldtype": "Data", + "label": "Color", "permlevel": 0 - }, + }, { - "fieldname": "full_name", - "fieldtype": "Data", - "label": "Full Name", + "fieldname": "full_name", + "fieldtype": "Data", + "label": "Full Name", "permlevel": 0 } - ], - "icon": "icon-rss", - "idx": 1, - "modified": "2013-12-20 19:24:07.000000", - "modified_by": "Administrator", - "module": "Home", - "name": "Feed", - "owner": "Administrator", + ], + "icon": "icon-rss", + "idx": 1, + "modified": "2013-12-20 19:24:05.000000", + "modified_by": "Administrator", + "module": "Home", + "name": "Feed", + "owner": "Administrator", "permissions": [ { - "email": 1, - "permlevel": 0, - "print": 1, - "read": 1, - "report": 1, + "email": 1, + "permlevel": 0, + "print": 1, + "read": 1, + "report": 1, "role": "System Manager" } ] -} \ No newline at end of file +} diff --git a/erpnext/home/page/activity/activity.py b/erpnext/home/page/activity/activity.py index 8fab54a4b9..aeb7389490 100644 --- a/erpnext/home/page/activity/activity.py +++ b/erpnext/home/page/activity/activity.py @@ -3,10 +3,11 @@ from __future__ import unicode_literals import frappe +from frappe.utils import cint @frappe.whitelist() def get_feed(arg=None): - """get feed""" + """get feed""" roles = frappe.get_roles() return frappe.db.sql("""select distinct t1.name, t1.feed_type, t1.doc_type, t1.doc_name, t1.subject, t1.owner, @@ -17,6 +18,6 @@ def get_feed(arg=None): and t2.permlevel = 0 and ifnull(t2.`read`,0) = 1 order by t1.modified desc - limit %s, %s""" % (','.join(['%s']*len(roles)), '%s', '%s'), - tuple(roles + [frappe.form_dict['limit_start'], frappe.form_dict['limit_page_length']]), - as_dict=1) \ No newline at end of file + limit %s, %s""" % (','.join(['%s']*len(roles)), '%s', '%s'), + tuple(roles + [cint(frappe.form_dict['limit_start']), cint(frappe.form_dict['limit_page_length'])]), + as_dict=1) From dc82d4f0cd567e27392244703909a5a436f6959f Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 7 Apr 2014 12:02:57 +0530 Subject: [PATCH 33/42] frappe/frappe#478 fixes --- erpnext/accounts/doctype/gl_entry/gl_entry.py | 2 +- .../journal_voucher/journal_voucher.py | 20 +- .../journal_voucher/test_journal_voucher.py | 44 ++-- .../test_period_closing_voucher.py | 6 +- .../purchase_invoice/test_purchase_invoice.py | 20 +- .../doctype/sales_invoice/sales_invoice.py | 2 +- .../sales_invoice/test_sales_invoice.py | 86 +++---- .../shipping_rule/test_shipping_rule.py | 12 +- .../purchase_order/test_purchase_order.py | 4 +- .../test_supplier_quotation.py | 2 +- erpnext/controllers/accounts_controller.py | 2 +- erpnext/controllers/selling_controller.py | 4 +- erpnext/controllers/stock_controller.py | 19 +- .../production_order/test_production_order.py | 2 +- .../doctype/sales_order/test_sales_order.py | 78 +++--- erpnext/stock/doctype/bin/bin.py | 12 +- .../doctype/delivery_note/delivery_note.py | 2 +- .../delivery_note/test_delivery_note.py | 38 +-- .../material_request/test_material_request.py | 80 +++--- .../stock/doctype/packed_item/packed_item.py | 2 +- .../purchase_receipt/test_purchase_receipt.py | 22 +- erpnext/stock/doctype/serial_no/serial_no.py | 1 + .../stock/doctype/stock_entry/stock_entry.py | 8 +- .../doctype/stock_entry/test_stock_entry.py | 227 +++++++++--------- .../test_stock_reconciliation.py | 32 +-- erpnext/stock/stock_ledger.py | 119 +++++---- 26 files changed, 423 insertions(+), 423 deletions(-) diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.py b/erpnext/accounts/doctype/gl_entry/gl_entry.py index b7266825d0..bbdf17ebdf 100644 --- a/erpnext/accounts/doctype/gl_entry/gl_entry.py +++ b/erpnext/accounts/doctype/gl_entry/gl_entry.py @@ -9,7 +9,7 @@ from frappe import _ from frappe.model.document import Document -class GlEntry(Document): +class GLEntry(Document): def validate(self): self.check_mandatory() diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher.py b/erpnext/accounts/doctype/journal_voucher/journal_voucher.py index ff50dcde60..0ba0208ecf 100644 --- a/erpnext/accounts/doctype/journal_voucher/journal_voucher.py +++ b/erpnext/accounts/doctype/journal_voucher/journal_voucher.py @@ -353,13 +353,13 @@ def get_payment_entry_from_sales_invoice(sales_invoice): jv.remark = 'Payment received against Sales Invoice {0}. {1}'.format(si.name, si.remarks) # credit customer - jv["entries"][0].account = si.debit_to - jv["entries"][0].balance = get_balance_on(si.debit_to) - jv["entries"][0].credit = si.outstanding_amount - jv["entries"][0].against_invoice = si.name + jv.get("entries")[0].account = si.debit_to + jv.get("entries")[0].balance = get_balance_on(si.debit_to) + jv.get("entries")[0].credit = si.outstanding_amount + jv.get("entries")[0].against_invoice = si.name # debit bank - jv["entries"][1].debit = si.outstanding_amount + jv.get("entries")[1].debit = si.outstanding_amount return jv.as_dict() @@ -371,13 +371,13 @@ def get_payment_entry_from_purchase_invoice(purchase_invoice): jv.remark = 'Payment against Purchase Invoice {0}. {1}'.format(pi.name, pi.remarks) # credit supplier - jv["entries"][0].account = pi.credit_to - jv["entries"][0].balance = get_balance_on(pi.credit_to) - jv["entries"][0].debit = pi.outstanding_amount - jv["entries"][0].against_voucher = pi.name + jv.get("entries")[0].account = pi.credit_to + jv.get("entries")[0].balance = get_balance_on(pi.credit_to) + jv.get("entries")[0].debit = pi.outstanding_amount + jv.get("entries")[0].against_voucher = pi.name # credit bank - jv["entries"][1].credit = pi.outstanding_amount + jv.get("entries")[1].credit = pi.outstanding_amount return jv.as_dict() diff --git a/erpnext/accounts/doctype/journal_voucher/test_journal_voucher.py b/erpnext/accounts/doctype/journal_voucher/test_journal_voucher.py index 19c3cefec1..962d9a09db 100644 --- a/erpnext/accounts/doctype/journal_voucher/test_journal_voucher.py +++ b/erpnext/accounts/doctype/journal_voucher/test_journal_voucher.py @@ -17,7 +17,7 @@ class TestJournalVoucher(unittest.TestCase): where against_jv=%s""", jv_invoice.name)) jv_payment = frappe.copy_doc(test_records[0]) - jv_payment["entries"][0].against_jv = jv_invoice.name + jv_payment.get("entries")[0].against_jv = jv_invoice.name jv_payment.insert() jv_payment.submit() @@ -38,7 +38,7 @@ class TestJournalVoucher(unittest.TestCase): set_perpetual_inventory() jv = frappe.copy_doc(test_records[0]) - jv["entries"][0].account = "_Test Warehouse - _TC" + jv.get("entries")[0].account = "_Test Warehouse - _TC" jv.insert() from erpnext.accounts.general_ledger import StockAccountInvalidTransaction @@ -51,10 +51,10 @@ class TestJournalVoucher(unittest.TestCase): self.clear_account_balance() jv = frappe.copy_doc(test_records[0]) - jv["entries"][1].account = "_Test Account Cost for Goods Sold - _TC" - jv["entries"][1].cost_center = "_Test Cost Center - _TC" - jv["entries"][1].debit = 20000.0 - jv["entries"][0].credit = 20000.0 + jv.get("entries")[1].account = "_Test Account Cost for Goods Sold - _TC" + jv.get("entries")[1].cost_center = "_Test Cost Center - _TC" + jv.get("entries")[1].debit = 20000.0 + jv.get("entries")[0].credit = 20000.0 jv.insert() jv.submit() self.assertTrue(frappe.db.get_value("GL Entry", @@ -66,10 +66,10 @@ class TestJournalVoucher(unittest.TestCase): self.clear_account_balance() jv = frappe.copy_doc(test_records[0]) - jv["entries"][1].account = "_Test Account Cost for Goods Sold - _TC" - jv["entries"][1].cost_center = "_Test Cost Center - _TC" - jv["entries"][1].debit = 20000.0 - jv["entries"][0].credit = 20000.0 + jv.get("entries")[1].account = "_Test Account Cost for Goods Sold - _TC" + jv.get("entries")[1].cost_center = "_Test Cost Center - _TC" + jv.get("entries")[1].debit = 20000.0 + jv.get("entries")[0].credit = 20000.0 jv.insert() self.assertRaises(BudgetError, jv.submit) @@ -85,10 +85,10 @@ class TestJournalVoucher(unittest.TestCase): jv = frappe.copy_doc(test_records[0]) jv.posting_date = "2013-08-12" - jv["entries"][1].account = "_Test Account Cost for Goods Sold - _TC" - jv["entries"][1].cost_center = "_Test Cost Center - _TC" - jv["entries"][1].debit = 150000.0 - jv["entries"][0].credit = 150000.0 + jv.get("entries")[1].account = "_Test Account Cost for Goods Sold - _TC" + jv.get("entries")[1].cost_center = "_Test Cost Center - _TC" + jv.get("entries")[1].debit = 150000.0 + jv.get("entries")[0].credit = 150000.0 jv.insert() self.assertRaises(BudgetError, jv.submit) @@ -101,20 +101,20 @@ class TestJournalVoucher(unittest.TestCase): self.clear_account_balance() jv = frappe.copy_doc(test_records[0]) - jv["entries"][0].account = "_Test Account Cost for Goods Sold - _TC" - jv["entries"][0].cost_center = "_Test Cost Center - _TC" - jv["entries"][0].credit = 30000.0 - jv["entries"][1].debit = 30000.0 + jv.get("entries")[0].account = "_Test Account Cost for Goods Sold - _TC" + jv.get("entries")[0].cost_center = "_Test Cost Center - _TC" + jv.get("entries")[0].credit = 30000.0 + jv.get("entries")[1].debit = 30000.0 jv.submit() self.assertTrue(frappe.db.get_value("GL Entry", {"voucher_type": "Journal Voucher", "voucher_no": jv.name})) jv1 = frappe.copy_doc(test_records[0]) - jv1["entries"][1].account = "_Test Account Cost for Goods Sold - _TC" - jv1["entries"][1].cost_center = "_Test Cost Center - _TC" - jv1["entries"][1].debit = 40000.0 - jv1["entries"][0].credit = 40000.0 + jv1.get("entries")[1].account = "_Test Account Cost for Goods Sold - _TC" + jv1.get("entries")[1].cost_center = "_Test Cost Center - _TC" + jv1.get("entries")[1].debit = 40000.0 + jv1.get("entries")[0].credit = 40000.0 jv1.submit() self.assertTrue(frappe.db.get_value("GL Entry", diff --git a/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py b/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py index 1a31989f03..ad58efc869 100644 --- a/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py +++ b/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py @@ -17,9 +17,9 @@ class TestPeriodClosingVoucher(unittest.TestCase): jv.submit() jv1 = frappe.copy_doc(jv_records[0]) - jv1["entries"][1].account = "_Test Account Cost for Goods Sold - _TC" - jv1["entries"][1].debit = 600.0 - jv1["entries"][0].credit = 600.0 + jv1.get("entries")[1].account = "_Test Account Cost for Goods Sold - _TC" + jv1.get("entries")[1].debit = 600.0 + jv1.get("entries")[0].credit = 600.0 jv1.insert() jv1.submit() diff --git a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py index 30425fe23f..885ef4690a 100644 --- a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py @@ -23,7 +23,7 @@ class TestPurchaseInvoice(unittest.TestCase): wrapper.insert() wrapper.submit() wrapper.load_from_db() - dl = wrapper.doclist + dl = wrapper expected_gl_entries = { "_Test Supplier - _TC": [0, 1512.30], @@ -37,7 +37,7 @@ class TestPurchaseInvoice(unittest.TestCase): "_Test Account Discount - _TC": [0, 168.03], } gl_entries = frappe.db.sql("""select account, debit, credit from `tabGL Entry` - where voucher_type = 'Purchase Invoice' and voucher_no = %s""", dl[0].name, as_dict=1) + where voucher_type = 'Purchase Invoice' and voucher_no = %s""", dl.name, as_dict=1) for d in gl_entries: self.assertEqual([d.debit, d.credit], expected_gl_entries.get(d.account)) @@ -74,10 +74,10 @@ class TestPurchaseInvoice(unittest.TestCase): self.assertEqual(cint(frappe.defaults.get_global_default("auto_accounting_for_stock")), 1) pi = frappe.copy_doc(test_records[1]) - pi["entries"][0].item_code = "_Test Non Stock Item" - pi["entries"][0].expense_account = "_Test Account Cost for Goods Sold - _TC" - pi.doclist.pop(2) - pi.doclist.pop(3) + pi.get("entries")[0].item_code = "_Test Non Stock Item" + pi.get("entries")[0].expense_account = "_Test Account Cost for Goods Sold - _TC" + pi.get("entries").pop(2) + pi.get("entries").pop(1) pi.insert() pi.submit() @@ -112,7 +112,7 @@ class TestPurchaseInvoice(unittest.TestCase): self.assertEqual(item.item_tax_amount, expected_values[i][1]) self.assertEqual(item.valuation_rate, expected_values[i][2]) - self.assertEqual(wrapper.doclist[0].net_total, 1250) + self.assertEqual(wrapper.net_total, 1250) # tax amounts expected_values = [ @@ -133,7 +133,7 @@ class TestPurchaseInvoice(unittest.TestCase): def test_purchase_invoice_with_subcontracted_item(self): wrapper = frappe.copy_doc(test_records[0]) - wrapper["entries"][0].item_code = "_Test FG Item" + wrapper.get("entries")[0].item_code = "_Test FG Item" wrapper.insert() wrapper.load_from_db() @@ -146,7 +146,7 @@ class TestPurchaseInvoice(unittest.TestCase): self.assertEqual(item.item_tax_amount, expected_values[i][1]) self.assertEqual(item.valuation_rate, expected_values[i][2]) - self.assertEqual(wrapper.doclist[0].net_total, 1250) + self.assertEqual(wrapper.net_total, 1250) # tax amounts expected_values = [ @@ -176,7 +176,7 @@ class TestPurchaseInvoice(unittest.TestCase): pi = frappe.copy_doc(test_records[0]) pi.append("advance_allocation_details", { "journal_voucher": jv.name, - "jv_detail_no": jv["entries"][0].name, + "jv_detail_no": jv.get("entries")[0].name, "advance_amount": 400, "allocated_amount": 300, "remarks": jv.remark diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index ba34b49154..41be553710 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -202,7 +202,7 @@ class SalesInvoice(SellingController): self.terms = frappe.db.get_value("Terms and Conditions", self.tc_name, "terms") # fetch charges - if self.charge and not len(self.get("other_charges")): + if self.taxes_and_charges and not len(self.get("other_charges")): self.set_taxes("other_charges", "taxes_and_charges") def get_advances(self): diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index fdeb075e6d..8baeb76d99 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -20,7 +20,7 @@ class TestSalesInvoice(unittest.TestCase): w.docstatus = '0' w.insert() - w2 = [d for d in w.doclist] + w2 = frappe.copy_doc(test_records[0]) w.submit() w = frappe.get_doc(w2) @@ -89,10 +89,10 @@ class TestSalesInvoice(unittest.TestCase): si = frappe.copy_doc(test_records[2]) si.currency = "USD" si.conversion_rate = 50 - si["entries"][0].rate = 1 - si["entries"][0].price_list_rate = 1 - si["entries"][1].rate = 3 - si["entries"][1].price_list_rate = 3 + si.get("entries")[0].rate = 1 + si.get("entries")[0].price_list_rate = 1 + si.get("entries")[1].rate = 3 + si.get("entries")[1].price_list_rate = 3 si.insert() expected_values = { @@ -243,16 +243,16 @@ class TestSalesInvoice(unittest.TestCase): for i, tax in enumerate(si.get("other_charges")): tax.idx = i+1 - si["entries"][0].price_list_rate = 62.5 - si["entries"][0].price_list_rate = 191 - for i in [3, 5, 6, 7, 8, 9]: - si.doclist[i].included_in_print_rate = 1 + si.get("entries")[0].price_list_rate = 62.5 + si.get("entries")[0].price_list_rate = 191 + for i in [2, 4, 5, 6, 7, 8]: + si.get("other_charges")[i].included_in_print_rate = 1 # tax type "Actual" cannot be inclusive self.assertRaises(frappe.ValidationError, si.insert) # taxes above included type 'On Previous Row Total' should also be included - si.doclist[3].included_in_print_rate = 0 + si.get("other_charges")[0].included_in_print_rate = 0 self.assertRaises(frappe.ValidationError, si.insert) def test_sales_invoice_calculation_base_currency_with_tax_inclusive_price(self): @@ -305,11 +305,11 @@ class TestSalesInvoice(unittest.TestCase): si = frappe.copy_doc(test_records[3]) si.currency = "USD" si.conversion_rate = 50 - si["entries"][0].price_list_rate = 55.56 - si["entries"][0].discount_percentage = 10 - si["entries"][1].price_list_rate = 187.5 - si["entries"][1].discount_percentage = 20 - si.doclist[9].rate = 5000 + si.get("entries")[0].price_list_rate = 55.56 + si.get("entries")[0].discount_percentage = 10 + si.get("entries")[1].price_list_rate = 187.5 + si.get("entries")[1].discount_percentage = 20 + si.get("other_charges")[5].rate = 5000 si.insert() @@ -365,7 +365,7 @@ class TestSalesInvoice(unittest.TestCase): import test_records as jv_test_records jv = frappe.get_doc(frappe.copy_doc(jv_test_records[0])) - jv["entries"][0].against_invoice = w.name + jv.get("entries")[0].against_invoice = w.name jv.insert() jv.submit() @@ -381,7 +381,7 @@ class TestSalesInvoice(unittest.TestCase): tlb.submit() si = frappe.get_doc(frappe.copy_doc(test_records[0])) - si["entries"][0].time_log_batch = "_T-Time Log Batch-00001" + si.get("entries")[0].time_log_batch = "_T-Time Log Batch-00001" si.insert() si.submit() @@ -501,16 +501,16 @@ class TestSalesInvoice(unittest.TestCase): as pr_test_records pr = frappe.copy_doc(pr_test_records[0]) pr.naming_series = "_T-Purchase Receipt-" - pr["entries"][0].warehouse = "_Test Warehouse No Account - _TC" + pr.get("entries")[0].warehouse = "_Test Warehouse No Account - _TC" pr.insert() pr.submit() - si_doclist = frappe.copy_doc(test_records[1]) - si_doclist[0]["update_stock"] = 1 - si_doclist[0]["posting_time"] = "12:05" - si_doclist[1]["warehouse"] = "_Test Warehouse No Account - _TC" + si_doc = frappe.copy_doc(test_records[1]) + si_doc["update_stock"] = 1 + si_doc["posting_time"] = "12:05" + si_doc.get("entries")["warehouse"] = "_Test Warehouse No Account - _TC" - si = frappe.copy_doc(si_doclist) + si = frappe.copy_doc(si_doc) si.insert() si.submit() @@ -530,9 +530,9 @@ class TestSalesInvoice(unittest.TestCase): expected_gl_entries = sorted([ [si.debit_to, 630.0, 0.0], - [si_doclist[1]["income_account"], 0.0, 500.0], - [si_doclist[2]["account_head"], 0.0, 80.0], - [si_doclist[3]["account_head"], 0.0, 50.0], + [si_doc.get("entries")["income_account"], 0.0, 500.0], + [si_doc.get("other_charges")[0]["account_head"], 0.0, 80.0], + [si_doc.get("other_charges")[1]["account_head"], 0.0, 50.0], ]) for i, gle in enumerate(gl_entries): self.assertEquals(expected_gl_entries[i][0], gle.account) @@ -638,7 +638,7 @@ class TestSalesInvoice(unittest.TestCase): si.append("advance_adjustment_details", { "doctype": "Sales Invoice Advance", "journal_voucher": jv.name, - "jv_detail_no": jv["entries"][0].name, + "jv_detail_no": jv.get("entries")[0].name, "advance_amount": 400, "allocated_amount": 300, "remarks": jv.remark @@ -677,13 +677,13 @@ class TestSalesInvoice(unittest.TestCase): }) # monthly - si1 = frappe.copy_doc(base_si.doclist) + si1 = frappe.copy_doc(base_si) si1.insert() si1.submit() self._test_recurring_invoice(si1, True) # monthly without a first and last day period - si2 = frappe.copy_doc(base_si.doclist) + si2 = frappe.copy_doc(base_si) si2.update({ "invoice_period_from_date": today, "invoice_period_to_date": add_to_date(today, days=30) @@ -693,7 +693,7 @@ class TestSalesInvoice(unittest.TestCase): self._test_recurring_invoice(si2, False) # quarterly - si3 = frappe.copy_doc(base_si.doclist) + si3 = frappe.copy_doc(base_si) si3.update({ "recurring_type": "Quarterly", "invoice_period_from_date": get_first_day(today), @@ -704,7 +704,7 @@ class TestSalesInvoice(unittest.TestCase): self._test_recurring_invoice(si3, True) # quarterly without a first and last day period - si4 = frappe.copy_doc(base_si.doclist) + si4 = frappe.copy_doc(base_si) si4.update({ "recurring_type": "Quarterly", "invoice_period_from_date": today, @@ -715,7 +715,7 @@ class TestSalesInvoice(unittest.TestCase): self._test_recurring_invoice(si4, False) # yearly - si5 = frappe.copy_doc(base_si.doclist) + si5 = frappe.copy_doc(base_si) si5.update({ "recurring_type": "Yearly", "invoice_period_from_date": get_first_day(today), @@ -726,7 +726,7 @@ class TestSalesInvoice(unittest.TestCase): self._test_recurring_invoice(si5, True) # yearly without a first and last day period - si6 = frappe.copy_doc(base_si.doclist) + si6 = frappe.copy_doc(base_si) si6.update({ "recurring_type": "Yearly", "invoice_period_from_date": today, @@ -737,7 +737,7 @@ class TestSalesInvoice(unittest.TestCase): self._test_recurring_invoice(si6, False) # change posting date but keep recuring day to be today - si7 = frappe.copy_doc(base_si.doclist) + si7 = frappe.copy_doc(base_si) si7.update({ "posting_date": add_to_date(today, days=-1) }) @@ -808,13 +808,13 @@ class TestSalesInvoice(unittest.TestCase): from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos se = make_serialized_item() - serial_nos = get_serial_nos(se["entries"][0].serial_no) + serial_nos = get_serial_nos(se.get("entries")[0].serial_no) si = frappe.copy_doc(test_records[0]) si.update_stock = 1 - si["entries"][0].item_code = "_Test Serialized Item With Series" - si["entries"][0].qty = 1 - si["entries"][0].serial_no = serial_nos[0] + si.get("entries")[0].item_code = "_Test Serialized Item With Series" + si.get("entries")[0].qty = 1 + si.get("entries")[0].serial_no = serial_nos[0] si.insert() si.submit() @@ -830,7 +830,7 @@ class TestSalesInvoice(unittest.TestCase): si = self.test_serialized() si.cancel() - serial_nos = get_serial_nos(si["entries"][0].serial_no) + serial_nos = get_serial_nos(si.get("entries")[0].serial_no) self.assertEquals(frappe.db.get_value("Serial No", serial_nos[0], "status"), "Available") self.assertEquals(frappe.db.get_value("Serial No", serial_nos[0], "warehouse"), "_Test Warehouse - _TC") @@ -842,7 +842,7 @@ class TestSalesInvoice(unittest.TestCase): from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item se = make_serialized_item() - serial_nos = get_serial_nos(se["entries"][0].serial_no) + serial_nos = get_serial_nos(se.get("entries")[0].serial_no) sr = frappe.get_doc("Serial No", serial_nos[0]) sr.status = "Not Available" @@ -850,9 +850,9 @@ class TestSalesInvoice(unittest.TestCase): si = frappe.copy_doc(test_records[0]) si.update_stock = 1 - si["entries"][0].item_code = "_Test Serialized Item With Series" - si["entries"][0].qty = 1 - si["entries"][0].serial_no = serial_nos[0] + si.get("entries")[0].item_code = "_Test Serialized Item With Series" + si.get("entries")[0].qty = 1 + si.get("entries")[0].serial_no = serial_nos[0] si.insert() self.assertRaises(SerialNoStatusError, si.submit) diff --git a/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py b/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py index ce07f146b1..c53689e453 100644 --- a/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py +++ b/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py @@ -10,12 +10,12 @@ test_records = frappe.get_test_records('Shipping Rule') class TestShippingRule(unittest.TestCase): def test_from_greater_than_to(self): shipping_rule = frappe.copy_doc(test_records[0]) - shipping_rule["shipping_rule_conditions"][0].from_value = 101 + shipping_rule.get("shipping_rule_conditions")[0].from_value = 101 self.assertRaises(FromGreaterThanToError, shipping_rule.insert) def test_many_zero_to_values(self): shipping_rule = frappe.copy_doc(test_records[0]) - shipping_rule["shipping_rule_conditions"][0].to_value = 0 + shipping_rule.get("shipping_rule_conditions")[0].to_value = 0 self.assertRaises(ManyBlankToValuesError, shipping_rule.insert) def test_overlapping_conditions(self): @@ -27,8 +27,8 @@ class TestShippingRule(unittest.TestCase): ((50, 150), (50, 150)), ]: shipping_rule = frappe.copy_doc(test_records[0]) - shipping_rule["shipping_rule_conditions"][0].from_value = range_a[0] - shipping_rule["shipping_rule_conditions"][0].to_value = range_a[1] - shipping_rule["shipping_rule_conditions"][1].from_value = range_b[0] - shipping_rule["shipping_rule_conditions"][1].to_value = range_b[1] + shipping_rule.get("shipping_rule_conditions")[0].from_value = range_a[0] + shipping_rule.get("shipping_rule_conditions")[0].to_value = range_a[1] + shipping_rule.get("shipping_rule_conditions")[1].from_value = range_b[0] + shipping_rule.get("shipping_rule_conditions")[1].to_value = range_b[1] self.assertRaises(OverlappingConditionError, shipping_rule.insert) \ No newline at end of file diff --git a/erpnext/buying/doctype/purchase_order/test_purchase_order.py b/erpnext/buying/doctype/purchase_order/test_purchase_order.py index 104baf9e4b..f8b03f040b 100644 --- a/erpnext/buying/doctype/purchase_order/test_purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/test_purchase_order.py @@ -41,7 +41,7 @@ class TestPurchaseOrder(unittest.TestCase): po = frappe.get_doc("Purchase Order", po.name) po.is_subcontracted = "No" - po["po_details"][0].item_code = "_Test Item" + po.get("po_details")[0].item_code = "_Test Item" po.submit() self.assertEquals(frappe.db.get_value("Bin", {"item_code": "_Test Item", @@ -107,7 +107,7 @@ class TestPurchaseOrder(unittest.TestCase): def test_uom_integer_validation(self): from erpnext.utilities.transaction_base import UOMMustBeIntegerError po = frappe.copy_doc(test_records[0]) - po["po_details"][0].qty = 3.4 + po.get("po_details")[0].qty = 3.4 self.assertRaises(UOMMustBeIntegerError, po.insert) diff --git a/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py b/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py index d526fd15f6..708b5e7f7a 100644 --- a/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py +++ b/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py @@ -21,7 +21,7 @@ class TestPurchaseOrder(unittest.TestCase): po = make_purchase_order(sq.name) self.assertEquals(po[0]["doctype"], "Purchase Order") - self.assertEquals(len(po), len(sq.doclist)) + self.assertEquals(len(po), len(sq)) po[0]["naming_series"] = "_T-Purchase Order-" diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 24af1e35fa..ffe6a6a43b 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -369,7 +369,7 @@ class AccountsController(TransactionBase): 'voucher_type': self.doctype, 'voucher_no': self.name, 'aging_date': self.get("aging_date") or self.posting_date, - 'remarks': self.remarks, + 'remarks': self.get("remarks"), 'fiscal_year': self.fiscal_year, 'debit': 0, 'credit': 0, diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index da37adbfe4..027bfd2ad8 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -336,8 +336,8 @@ class SellingController(StockController): 'qty': d.qty, 'reserved_qty': reserved_qty_for_main_item, 'uom': d.stock_uom, - 'batch_no': cstr(d.batch_no).strip(), - 'serial_no': cstr(d.serial_no).strip(), + 'batch_no': cstr(d.get("batch_no")).strip(), + 'serial_no': cstr(d.get("serial_no")).strip(), 'name': d.name })) return il diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py index 62262ee5c8..e5ad8c69d1 100644 --- a/erpnext/controllers/stock_controller.py +++ b/erpnext/controllers/stock_controller.py @@ -49,7 +49,7 @@ class StockController(AccountsController): "account": warehouse_account[sle.warehouse], "against": detail.expense_account, "cost_center": detail.cost_center, - "remarks": self.remarks or "Accounting Entry for Stock", + "remarks": self.get("remarks") or "Accounting Entry for Stock", "debit": flt(sle.stock_value_difference, 2) })) @@ -58,7 +58,7 @@ class StockController(AccountsController): "account": detail.expense_account, "against": warehouse_account[sle.warehouse], "cost_center": detail.cost_center, - "remarks": self.remarks or "Accounting Entry for Stock", + "remarks": self.get("remarks") or "Accounting Entry for Stock", "credit": flt(sle.stock_value_difference, 2) })) elif sle.warehouse not in warehouse_with_no_account: @@ -103,8 +103,15 @@ class StockController(AccountsController): for d in item_doclist: if d.item_code and d.item_code not in items: items.append(d.item_code) - if d.warehouse and d.warehouse not in warehouses: + + if d.get("warehouse") and d.warehouse not in warehouses: warehouses.append(d.warehouse) + + if self.doctype == "Stock Entry": + if d.get("s_warehouse") and d.s_warehouse not in warehouses: + warehouses.append(d.s_warehouse) + if d.get("t_warehouse") and d.t_warehouse not in warehouses: + warehouses.append(d.t_warehouse) warehouse_account = {wh: warehouse_account[wh] for wh in warehouses if warehouse_account.get(wh)} @@ -234,20 +241,20 @@ class StockController(AccountsController): def get_sl_entries(self, d, args): sl_dict = { "item_code": d.item_code, - "warehouse": d.warehouse, + "warehouse": d.get("warehouse", None), "posting_date": self.posting_date, "posting_time": self.posting_time, "voucher_type": self.doctype, "voucher_no": self.name, "voucher_detail_no": d.name, - "actual_qty": (self.docstatus==1 and 1 or -1)*flt(d.stock_qty), + "actual_qty": (self.docstatus==1 and 1 or -1)*flt(d.get("stock_qty")), "stock_uom": d.stock_uom, "incoming_rate": 0, "company": self.company, "fiscal_year": self.fiscal_year, "batch_no": cstr(d.batch_no).strip(), "serial_no": d.serial_no, - "project": d.project_name, + "project": d.get("project_name"), "is_cancelled": self.docstatus==2 and "Yes" or "No" } diff --git a/erpnext/manufacturing/doctype/production_order/test_production_order.py b/erpnext/manufacturing/doctype/production_order/test_production_order.py index 31889b51f8..81fc61661f 100644 --- a/erpnext/manufacturing/doctype/production_order/test_production_order.py +++ b/erpnext/manufacturing/doctype/production_order/test_production_order.py @@ -27,7 +27,7 @@ class TestProductionOrder(unittest.TestCase): mr1.submit() mr2 = frappe.copy_doc(se_test_records[0]) - mr2["mtn_details"][0].item_code = "_Test Item Home Desktop 100" + mr2.get("mtn_details")[0].item_code = "_Test Item Home Desktop 100" mr2.insert() mr2.submit() diff --git a/erpnext/selling/doctype/sales_order/test_sales_order.py b/erpnext/selling/doctype/sales_order/test_sales_order.py index 1e71f5cee8..af52028461 100644 --- a/erpnext/selling/doctype/sales_order/test_sales_order.py +++ b/erpnext/selling/doctype/sales_order/test_sales_order.py @@ -22,7 +22,7 @@ class TestSalesOrder(unittest.TestCase): mr = make_material_request(so.name) self.assertEquals(mr[0]["material_request_type"], "Purchase") - self.assertEquals(len(mr), len(sales_order.doclist)) + self.assertEquals(len(mr), len(sales_order)) def test_make_delivery_note(self): from erpnext.selling.doctype.sales_order.sales_order import make_delivery_note @@ -37,7 +37,7 @@ class TestSalesOrder(unittest.TestCase): dn = make_delivery_note(so.name) self.assertEquals(dn[0]["doctype"], "Delivery Note") - self.assertEquals(len(dn), len(sales_order.doclist)) + self.assertEquals(len(dn), len(sales_order)) def test_make_sales_invoice(self): from erpnext.selling.doctype.sales_order.sales_order import make_sales_invoice @@ -52,7 +52,7 @@ class TestSalesOrder(unittest.TestCase): si = make_sales_invoice(so.name) self.assertEquals(si[0]["doctype"], "Sales Invoice") - self.assertEquals(len(si), len(sales_order.doclist)) + self.assertEquals(len(si), len(sales_order)) self.assertEquals(len([d for d in si if d["doctype"]=="Sales Invoice Item"]), 1) si = frappe.get_doc(si) @@ -64,11 +64,11 @@ class TestSalesOrder(unittest.TestCase): self.assertEquals(len([d for d in si1 if d["doctype"]=="Sales Invoice Item"]), 0) - def create_so(self, so_doclist = None): - if not so_doclist: - so_doclist = test_records[0] + def create_so(self, so_doc = None): + if not so_doc: + so_doc = test_records[0] - w = frappe.copy_doc(so_doclist) + w = frappe.copy_doc(so_doc) w.insert() w.submit() @@ -78,14 +78,14 @@ class TestSalesOrder(unittest.TestCase): from erpnext.stock.doctype.delivery_note.test_delivery_note import test_records as dn_test_records from erpnext.stock.doctype.delivery_note.test_delivery_note import _insert_purchase_receipt - _insert_purchase_receipt(so["sales_order_details"][0].item_code) + _insert_purchase_receipt(so.get("sales_order_details")[0].item_code) dn = frappe.get_doc(frappe.copy_doc(dn_test_records[0])) - dn["delivery_note_details"][0].item_code = so["sales_order_details"][0].item_code - dn["delivery_note_details"][0].against_sales_order = so.name - dn["delivery_note_details"][0].prevdoc_detail_docname = so["sales_order_details"][0].name + dn.get("delivery_note_details")[0].item_code = so.get("sales_order_details")[0].item_code + dn.get("delivery_note_details")[0].against_sales_order = so.name + dn.get("delivery_note_details")[0].prevdoc_detail_docname = so.get("sales_order_details")[0].name if delivered_qty: - dn["delivery_note_details"][0].qty = delivered_qty + dn.get("delivery_note_details")[0].qty = delivered_qty dn.insert() dn.submit() return dn @@ -110,11 +110,11 @@ class TestSalesOrder(unittest.TestCase): # submit so = self.create_so() - self.check_reserved_qty(so["sales_order_details"][0].item_code, so["sales_order_details"][0].warehouse, 10.0) + self.check_reserved_qty(so.get("sales_order_details")[0].item_code, so.get("sales_order_details")[0].warehouse, 10.0) # cancel so.cancel() - self.check_reserved_qty(so["sales_order_details"][0].item_code, so["sales_order_details"][0].warehouse, 0.0) + self.check_reserved_qty(so.get("sales_order_details")[0].item_code, so.get("sales_order_details")[0].warehouse, 0.0) def test_reserved_qty_for_partial_delivery(self): @@ -130,21 +130,21 @@ class TestSalesOrder(unittest.TestCase): # submit dn dn = self.create_dn_against_so(so) - self.check_reserved_qty(so["sales_order_details"][0].item_code, so["sales_order_details"][0].warehouse, 5.0) + self.check_reserved_qty(so.get("sales_order_details")[0].item_code, so.get("sales_order_details")[0].warehouse, 5.0) # stop so so.load_from_db() so.obj.stop_sales_order() - self.check_reserved_qty(so["sales_order_details"][0].item_code, so["sales_order_details"][0].warehouse, 0.0) + self.check_reserved_qty(so.get("sales_order_details")[0].item_code, so.get("sales_order_details")[0].warehouse, 0.0) # unstop so so.load_from_db() so.obj.unstop_sales_order() - self.check_reserved_qty(so["sales_order_details"][0].item_code, so["sales_order_details"][0].warehouse, 5.0) + self.check_reserved_qty(so.get("sales_order_details")[0].item_code, so.get("sales_order_details")[0].warehouse, 5.0) # cancel dn dn.cancel() - self.check_reserved_qty(so["sales_order_details"][0].item_code, so["sales_order_details"][0].warehouse, 10.0) + self.check_reserved_qty(so.get("sales_order_details")[0].item_code, so.get("sales_order_details")[0].warehouse, 10.0) def test_reserved_qty_for_over_delivery(self): # reset bin @@ -157,15 +157,15 @@ class TestSalesOrder(unittest.TestCase): frappe.db.set_default("allow_negative_stock", 1) # set over-delivery tolerance - frappe.db.set_value('Item', so["sales_order_details"][0].item_code, 'tolerance', 50) + frappe.db.set_value('Item', so.get("sales_order_details")[0].item_code, 'tolerance', 50) # submit dn dn = self.create_dn_against_so(so, 15) - self.check_reserved_qty(so["sales_order_details"][0].item_code, so["sales_order_details"][0].warehouse, 0.0) + self.check_reserved_qty(so.get("sales_order_details")[0].item_code, so.get("sales_order_details")[0].warehouse, 0.0) # cancel dn dn.cancel() - self.check_reserved_qty(so["sales_order_details"][0].item_code, so["sales_order_details"][0].warehouse, 10.0) + self.check_reserved_qty(so.get("sales_order_details")[0].item_code, so.get("sales_order_details")[0].warehouse, 10.0) def test_reserved_qty_for_so_with_packing_list(self): from erpnext.selling.doctype.sales_bom.test_sales_bom import test_records as sbom_test_records @@ -183,16 +183,16 @@ class TestSalesOrder(unittest.TestCase): self.check_reserved_qty(sbom_test_records[0][1]["item_code"], - so["sales_order_details"][0].warehouse, 50.0) + so.get("sales_order_details")[0].warehouse, 50.0) self.check_reserved_qty(sbom_test_records[0][2]["item_code"], - so["sales_order_details"][0].warehouse, 20.0) + so.get("sales_order_details")[0].warehouse, 20.0) # cancel so.cancel() self.check_reserved_qty(sbom_test_records[0][1]["item_code"], - so["sales_order_details"][0].warehouse, 0.0) + so.get("sales_order_details")[0].warehouse, 0.0) self.check_reserved_qty(sbom_test_records[0][2]["item_code"], - so["sales_order_details"][0].warehouse, 0.0) + so.get("sales_order_details")[0].warehouse, 0.0) def test_reserved_qty_for_partial_delivery_with_packing_list(self): from erpnext.selling.doctype.sales_bom.test_sales_bom import test_records as sbom_test_records @@ -216,33 +216,33 @@ class TestSalesOrder(unittest.TestCase): dn = self.create_dn_against_so(so) self.check_reserved_qty(sbom_test_records[0][1]["item_code"], - so["sales_order_details"][0].warehouse, 25.0) + so.get("sales_order_details")[0].warehouse, 25.0) self.check_reserved_qty(sbom_test_records[0][2]["item_code"], - so["sales_order_details"][0].warehouse, 10.0) + so.get("sales_order_details")[0].warehouse, 10.0) # stop so so.load_from_db() so.obj.stop_sales_order() self.check_reserved_qty(sbom_test_records[0][1]["item_code"], - so["sales_order_details"][0].warehouse, 0.0) + so.get("sales_order_details")[0].warehouse, 0.0) self.check_reserved_qty(sbom_test_records[0][2]["item_code"], - so["sales_order_details"][0].warehouse, 0.0) + so.get("sales_order_details")[0].warehouse, 0.0) # unstop so so.load_from_db() so.obj.unstop_sales_order() self.check_reserved_qty(sbom_test_records[0][1]["item_code"], - so["sales_order_details"][0].warehouse, 25.0) + so.get("sales_order_details")[0].warehouse, 25.0) self.check_reserved_qty(sbom_test_records[0][2]["item_code"], - so["sales_order_details"][0].warehouse, 10.0) + so.get("sales_order_details")[0].warehouse, 10.0) # cancel dn dn.cancel() self.check_reserved_qty(sbom_test_records[0][1]["item_code"], - so["sales_order_details"][0].warehouse, 50.0) + so.get("sales_order_details")[0].warehouse, 50.0) self.check_reserved_qty(sbom_test_records[0][2]["item_code"], - so["sales_order_details"][0].warehouse, 20.0) + so.get("sales_order_details")[0].warehouse, 20.0) def test_reserved_qty_for_over_delivery_with_packing_list(self): from erpnext.selling.doctype.sales_bom.test_sales_bom import test_records as sbom_test_records @@ -262,22 +262,22 @@ class TestSalesOrder(unittest.TestCase): frappe.db.set_default("allow_negative_stock", 1) # set over-delivery tolerance - frappe.db.set_value('Item', so["sales_order_details"][0].item_code, 'tolerance', 50) + frappe.db.set_value('Item', so.get("sales_order_details")[0].item_code, 'tolerance', 50) # submit dn dn = self.create_dn_against_so(so, 15) self.check_reserved_qty(sbom_test_records[0][1]["item_code"], - so["sales_order_details"][0].warehouse, 0.0) + so.get("sales_order_details")[0].warehouse, 0.0) self.check_reserved_qty(sbom_test_records[0][2]["item_code"], - so["sales_order_details"][0].warehouse, 0.0) + so.get("sales_order_details")[0].warehouse, 0.0) # cancel dn dn.cancel() self.check_reserved_qty(sbom_test_records[0][1]["item_code"], - so["sales_order_details"][0].warehouse, 50.0) + so.get("sales_order_details")[0].warehouse, 50.0) self.check_reserved_qty(sbom_test_records[0][2]["item_code"], - so["sales_order_details"][0].warehouse, 20.0) + so.get("sales_order_details")[0].warehouse, 20.0) def test_warehouse_user(self): frappe.defaults.add_default("Warehouse", "_Test Warehouse 1 - _TC1", "test@example.com", "Restriction") @@ -293,7 +293,7 @@ class TestSalesOrder(unittest.TestCase): so.company = "_Test Company 1" so.conversion_rate = 0.02 so.plc_conversion_rate = 0.02 - so["sales_order_details"][0].warehouse = "_Test Warehouse 2 - _TC1" + so.get("sales_order_details")[0].warehouse = "_Test Warehouse 2 - _TC1" self.assertRaises(frappe.PermissionError, so.insert) frappe.set_user("test2@example.com") diff --git a/erpnext/stock/doctype/bin/bin.py b/erpnext/stock/doctype/bin/bin.py index a5fd8ecfe6..3f74c5c7d3 100644 --- a/erpnext/stock/doctype/bin/bin.py +++ b/erpnext/stock/doctype/bin/bin.py @@ -3,16 +3,11 @@ from __future__ import unicode_literals import frappe -from frappe.utils import add_days, cint,flt, nowdate, get_url_to_form, formatdate -from frappe import msgprint, _ - +from frappe.utils import flt, nowdate import frappe.defaults - - from frappe.model.document import Document -class Bin(Document): - +class Bin(Document): def validate(self): if self.get("__islocal") or not self.stock_uom: self.stock_uom = frappe.db.get_value('Item', self.item_code, 'stock_uom') @@ -25,7 +20,7 @@ class Bin(Document): def validate_mandatory(self): qf = ['actual_qty', 'reserved_qty', 'ordered_qty', 'indented_qty'] for f in qf: - if (not self.has_key(f)) or (not self.get(f)): + if (not getattr(self, f, None)) or (not self.get(f)): self.set(f, 0.0) def update_stock(self, args): @@ -47,6 +42,7 @@ class Bin(Document): def update_qty(self, args): # update the stock values (for current quantities) + self.actual_qty = flt(self.actual_qty) + flt(args.get("actual_qty")) self.ordered_qty = flt(self.ordered_qty) + flt(args.get("ordered_qty")) self.reserved_qty = flt(self.reserved_qty) + flt(args.get("reserved_qty")) diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index b9900632c7..347b1f4d81 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -313,7 +313,7 @@ def make_sales_invoice(source_name, target_doc=None): "serial_no": "serial_no" }, "postprocess": update_item, - "filter": lambda d: d.qty - invoiced_qty_map.get(d.name, 0)==0 + "filter": lambda d: d.qty - invoiced_qty_map.get(d.name, 0)<=0 }, "Sales Taxes and Charges": { "doctype": "Sales Taxes and Charges", diff --git a/erpnext/stock/doctype/delivery_note/test_delivery_note.py b/erpnext/stock/doctype/delivery_note/test_delivery_note.py index e54b5c02dd..0260232c4c 100644 --- a/erpnext/stock/doctype/delivery_note/test_delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/test_delivery_note.py @@ -14,7 +14,7 @@ def _insert_purchase_receipt(item_code=None): item_code = pr_test_records[0][1]["item_code"] pr = frappe.copy_doc(pr_test_records[0]) - pr["purchase_receipt_details"][0].item_code = item_code + pr.get("purchase_receipt_details")[0].item_code = item_code pr.insert() pr.submit() @@ -34,7 +34,7 @@ class TestDeliveryNote(unittest.TestCase): dn.submit() si = make_sales_invoice(dn.name) - self.assertEquals(len(si), len(dn.doclist)) + self.assertEquals(len(si), len(dn)) # modify amount si[1]["rate"] = 200 @@ -69,11 +69,11 @@ class TestDeliveryNote(unittest.TestCase): _insert_purchase_receipt() dn = frappe.copy_doc(test_records[0]) - dn["delivery_note_details"][0].expense_account = "Cost of Goods Sold - _TC" - dn["delivery_note_details"][0].cost_center = "Main - _TC" + dn.get("delivery_note_details")[0].expense_account = "Cost of Goods Sold - _TC" + dn.get("delivery_note_details")[0].cost_center = "Main - _TC" stock_in_hand_account = frappe.db.get_value("Account", - {"master_name": dn["delivery_note_details"][0].warehouse}) + {"master_name": dn.get("delivery_note_details")[0].warehouse}) from erpnext.accounts.utils import get_balance_on prev_bal = get_balance_on(stock_in_hand_account, dn.posting_date) @@ -97,8 +97,8 @@ class TestDeliveryNote(unittest.TestCase): # back dated purchase receipt pr = frappe.copy_doc(pr_test_records[0]) pr.posting_date = "2013-01-01" - pr["purchase_receipt_details"][0].rate = 100 - pr["purchase_receipt_details"][0].base_amount = 100 + pr.get("purchase_receipt_details")[0].rate = 100 + pr.get("purchase_receipt_details")[0].base_amount = 100 pr.insert() pr.submit() @@ -124,11 +124,11 @@ class TestDeliveryNote(unittest.TestCase): _insert_purchase_receipt("_Test Item Home Desktop 100") dn = frappe.copy_doc(test_records[0]) - dn["delivery_note_details"][0].item_code = "_Test Sales BOM Item" - dn["delivery_note_details"][0].qty = 1 + dn.get("delivery_note_details")[0].item_code = "_Test Sales BOM Item" + dn.get("delivery_note_details")[0].qty = 1 stock_in_hand_account = frappe.db.get_value("Account", - {"master_name": dn["delivery_note_details"][0].warehouse}) + {"master_name": dn.get("delivery_note_details")[0].warehouse}) from erpnext.accounts.utils import get_balance_on prev_bal = get_balance_on(stock_in_hand_account, dn.posting_date) @@ -160,12 +160,12 @@ class TestDeliveryNote(unittest.TestCase): from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos se = make_serialized_item() - serial_nos = get_serial_nos(se["mtn_details"][0].serial_no) + serial_nos = get_serial_nos(se.get("mtn_details")[0].serial_no) dn = frappe.copy_doc(test_records[0]) - dn["delivery_note_details"][0].item_code = "_Test Serialized Item With Series" - dn["delivery_note_details"][0].qty = 1 - dn["delivery_note_details"][0].serial_no = serial_nos[0] + dn.get("delivery_note_details")[0].item_code = "_Test Serialized Item With Series" + dn.get("delivery_note_details")[0].qty = 1 + dn.get("delivery_note_details")[0].serial_no = serial_nos[0] dn.insert() dn.submit() @@ -181,7 +181,7 @@ class TestDeliveryNote(unittest.TestCase): dn = self.test_serialized() dn.cancel() - serial_nos = get_serial_nos(dn["delivery_note_details"][0].serial_no) + serial_nos = get_serial_nos(dn.get("delivery_note_details")[0].serial_no) self.assertEquals(frappe.db.get_value("Serial No", serial_nos[0], "status"), "Available") self.assertEquals(frappe.db.get_value("Serial No", serial_nos[0], "warehouse"), "_Test Warehouse - _TC") @@ -193,16 +193,16 @@ class TestDeliveryNote(unittest.TestCase): from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item se = make_serialized_item() - serial_nos = get_serial_nos(se["mtn_details"][0].serial_no) + serial_nos = get_serial_nos(se.get("mtn_details")[0].serial_no) sr = frappe.get_doc("Serial No", serial_nos[0]) sr.status = "Not Available" sr.save() dn = frappe.copy_doc(test_records[0]) - dn["delivery_note_details"][0].item_code = "_Test Serialized Item With Series" - dn["delivery_note_details"][0].qty = 1 - dn["delivery_note_details"][0].serial_no = serial_nos[0] + dn.get("delivery_note_details")[0].item_code = "_Test Serialized Item With Series" + dn.get("delivery_note_details")[0].qty = 1 + dn.get("delivery_note_details")[0].serial_no = serial_nos[0] dn.insert() self.assertRaises(SerialNoStatusError, dn.submit) diff --git a/erpnext/stock/doctype/material_request/test_material_request.py b/erpnext/stock/doctype/material_request/test_material_request.py index 9c51f7baa9..6d10d40059 100644 --- a/erpnext/stock/doctype/material_request/test_material_request.py +++ b/erpnext/stock/doctype/material_request/test_material_request.py @@ -25,7 +25,7 @@ class TestMaterialRequest(unittest.TestCase): po = make_purchase_order(mr.name) self.assertEquals(po[0]["doctype"], "Purchase Order") - self.assertEquals(len(po), len(mr.doclist)) + self.assertEquals(len(po), len(mr)) def test_make_supplier_quotation(self): from erpnext.stock.doctype.material_request.material_request import make_supplier_quotation @@ -40,7 +40,7 @@ class TestMaterialRequest(unittest.TestCase): sq = make_supplier_quotation(mr.name) self.assertEquals(sq[0]["doctype"], "Supplier Quotation") - self.assertEquals(len(sq), len(mr.doclist)) + self.assertEquals(len(sq), len(mr)) def test_make_stock_entry(self): @@ -57,12 +57,12 @@ class TestMaterialRequest(unittest.TestCase): se = make_stock_entry(mr.name) self.assertEquals(se[0]["doctype"], "Stock Entry") - self.assertEquals(len(se), len(mr.doclist)) + self.assertEquals(len(se), len(mr)) - def _test_expected(self, doclist, expected_values): + def _test_expected(self, doc, expected_values): for i, expected in enumerate(expected_values): for fieldname, val in expected.items(): - self.assertEquals(val, doclist[i].get(fieldname)) + self.assertEquals(val, doc[i].get(fieldname)) def _test_requested_qty(self, qty1, qty2): self.assertEqual(flt(frappe.db.get_value("Bin", {"item_code": "_Test Item Home Desktop 100", @@ -117,42 +117,42 @@ class TestMaterialRequest(unittest.TestCase): mr.submit() # check if per complete is None - self._test_expected(mr.doclist, [{"per_ordered": None}, {"ordered_qty": None}, {"ordered_qty": None}]) + self._test_expected(mr, [{"per_ordered": None}, {"ordered_qty": None}, {"ordered_qty": None}]) self._test_requested_qty(54.0, 3.0) # map a purchase order from erpnext.stock.doctype.material_request.material_request import make_purchase_order - po_doclist = make_purchase_order(mr.name) - po_doclist[0]["supplier"] = "_Test Supplier" - po_doclist[0]["transaction_date"] = "2013-07-07" - po_doclist[1]["qty"] = 27.0 - po_doclist[2]["qty"] = 1.5 - po_doclist[1]["schedule_date"] = "2013-07-09" - po_doclist[2]["schedule_date"] = "2013-07-09" + po_doc = make_purchase_order(mr.name) + po_doc["supplier"] = "_Test Supplier" + po_doc["transaction_date"] = "2013-07-07" + po_doc.get("po_details")[0]["qty"] = 27.0 + po_doc.get("po_details")[1]["qty"] = 1.5 + po_doc.get("po_details")[0]["schedule_date"] = "2013-07-09" + po_doc.get("po_details")[1]["schedule_date"] = "2013-07-09" # check for stopped status of Material Request - po = frappe.copy_doc(po_doclist) + po = frappe.copy_doc(po_doc) po.insert() mr.obj.update_status('Stopped') self.assertRaises(frappe.ValidationError, po.submit) self.assertRaises(frappe.ValidationError, po.cancel) mr.obj.update_status('Submitted') - po = frappe.copy_doc(po_doclist) + po = frappe.copy_doc(po_doc) po.insert() po.submit() # check if per complete is as expected mr.load_from_db() - self._test_expected(mr.doclist, [{"per_ordered": 50}, {"ordered_qty": 27.0}, {"ordered_qty": 1.5}]) + self._test_expected(mr, [{"per_ordered": 50}, {"ordered_qty": 27.0}, {"ordered_qty": 1.5}]) self._test_requested_qty(27.0, 1.5) po.cancel() # check if per complete is as expected mr.load_from_db() - self._test_expected(mr.doclist, [{"per_ordered": None}, {"ordered_qty": None}, {"ordered_qty": None}]) + self._test_expected(mr, [{"per_ordered": None}, {"ordered_qty": None}, {"ordered_qty": None}]) self._test_requested_qty(54.0, 3.0) def test_completed_qty_for_transfer(self): @@ -166,26 +166,26 @@ class TestMaterialRequest(unittest.TestCase): mr.submit() # check if per complete is None - self._test_expected(mr.doclist, [{"per_ordered": None}, {"ordered_qty": None}, {"ordered_qty": None}]) + self._test_expected(mr, [{"per_ordered": None}, {"ordered_qty": None}, {"ordered_qty": None}]) self._test_requested_qty(54.0, 3.0) from erpnext.stock.doctype.material_request.material_request import make_stock_entry # map a stock entry - se_doclist = make_stock_entry(mr.name) - se_doclist[0].update({ + se_doc = make_stock_entry(mr.name) + se_doc.update({ "posting_date": "2013-03-01", "posting_time": "01:00", "fiscal_year": "_Test Fiscal Year 2013", }) - se_doclist[1].update({ + se_doc.get("mtn_details")[0].update({ "qty": 27.0, "transfer_qty": 27.0, "s_warehouse": "_Test Warehouse 1 - _TC", "incoming_rate": 1.0 }) - se_doclist[2].update({ + se_doc.get("mtn_details")[1].update({ "qty": 1.5, "transfer_qty": 1.5, "s_warehouse": "_Test Warehouse 1 - _TC", @@ -196,26 +196,26 @@ class TestMaterialRequest(unittest.TestCase): self._insert_stock_entry(27.0, 1.5) # check for stopped status of Material Request - se = frappe.copy_doc(se_doclist) + se = frappe.copy_doc(se_doc) se.insert() mr.obj.update_status('Stopped') self.assertRaises(frappe.ValidationError, se.submit) self.assertRaises(frappe.ValidationError, se.cancel) mr.obj.update_status('Submitted') - se = frappe.copy_doc(se_doclist) + se = frappe.copy_doc(se_doc) se.insert() se.submit() # check if per complete is as expected mr.load_from_db() - self._test_expected(mr.doclist, [{"per_ordered": 50}, {"ordered_qty": 27.0}, {"ordered_qty": 1.5}]) + self._test_expected(mr, [{"per_ordered": 50}, {"ordered_qty": 27.0}, {"ordered_qty": 1.5}]) self._test_requested_qty(27.0, 1.5) # check if per complete is as expected for Stock Entry cancelled se.cancel() mr.load_from_db() - self._test_expected(mr.doclist, [{"per_ordered": 0}, {"ordered_qty": 0}, {"ordered_qty": 0}]) + self._test_expected(mr, [{"per_ordered": 0}, {"ordered_qty": 0}, {"ordered_qty": 0}]) self._test_requested_qty(54.0, 3.0) def test_completed_qty_for_over_transfer(self): @@ -229,26 +229,26 @@ class TestMaterialRequest(unittest.TestCase): mr.submit() # check if per complete is None - self._test_expected(mr.doclist, [{"per_ordered": None}, {"ordered_qty": None}, {"ordered_qty": None}]) + self._test_expected(mr, [{"per_ordered": None}, {"ordered_qty": None}, {"ordered_qty": None}]) self._test_requested_qty(54.0, 3.0) # map a stock entry from erpnext.stock.doctype.material_request.material_request import make_stock_entry - se_doclist = make_stock_entry(mr.name) - se_doclist[0].update({ + se_doc = make_stock_entry(mr.name) + se_doc.update({ "posting_date": "2013-03-01", "posting_time": "00:00", "fiscal_year": "_Test Fiscal Year 2013", }) - se_doclist[1].update({ + se_doc.get("mtn_details")[0].update({ "qty": 60.0, "transfer_qty": 60.0, "s_warehouse": "_Test Warehouse 1 - _TC", "incoming_rate": 1.0 }) - se_doclist[2].update({ + se_doc.get("mtn_details")[1].update({ "qty": 3.0, "transfer_qty": 3.0, "s_warehouse": "_Test Warehouse 1 - _TC", @@ -259,26 +259,26 @@ class TestMaterialRequest(unittest.TestCase): self._insert_stock_entry(60.0, 3.0) # check for stopped status of Material Request - se = frappe.copy_doc(se_doclist) + se = frappe.copy_doc(se_doc) se.insert() mr.obj.update_status('Stopped') self.assertRaises(frappe.ValidationError, se.submit) self.assertRaises(frappe.ValidationError, se.cancel) mr.obj.update_status('Submitted') - se = frappe.copy_doc(se_doclist) + se = frappe.copy_doc(se_doc) se.insert() se.submit() # check if per complete is as expected mr.load_from_db() - self._test_expected(mr.doclist, [{"per_ordered": 100}, {"ordered_qty": 60.0}, {"ordered_qty": 3.0}]) + self._test_expected(mr, [{"per_ordered": 100}, {"ordered_qty": 60.0}, {"ordered_qty": 3.0}]) self._test_requested_qty(0.0, 0.0) # check if per complete is as expected for Stock Entry cancelled se.cancel() mr.load_from_db() - self._test_expected(mr.doclist, [{"per_ordered": 0}, {"ordered_qty": 0}, {"ordered_qty": 0}]) + self._test_expected(mr, [{"per_ordered": 0}, {"ordered_qty": 0}, {"ordered_qty": 0}]) self._test_requested_qty(54.0, 3.0) def test_incorrect_mapping_of_stock_entry(self): @@ -291,20 +291,20 @@ class TestMaterialRequest(unittest.TestCase): # map a stock entry from erpnext.stock.doctype.material_request.material_request import make_stock_entry - se_doclist = make_stock_entry(mr.name) - se_doclist[0].update({ + se_doc = make_stock_entry(mr.name) + se_doc.update({ "posting_date": "2013-03-01", "posting_time": "00:00", "fiscal_year": "_Test Fiscal Year 2013", }) - se_doclist[1].update({ + se_doc.get("mtn_details")[0].update({ "qty": 60.0, "transfer_qty": 60.0, "s_warehouse": "_Test Warehouse - _TC", "t_warehouse": "_Test Warehouse 1 - _TC", "incoming_rate": 1.0 }) - se_doclist[2].update({ + se_doc.get("mtn_details")[1].update({ "qty": 3.0, "transfer_qty": 3.0, "s_warehouse": "_Test Warehouse 1 - _TC", @@ -312,7 +312,7 @@ class TestMaterialRequest(unittest.TestCase): }) # check for stopped status of Material Request - se = frappe.copy_doc(se_doclist) + se = frappe.copy_doc(se_doc) self.assertRaises(frappe.MappingMismatchError, se.insert) def test_warehouse_company_validation(self): diff --git a/erpnext/stock/doctype/packed_item/packed_item.py b/erpnext/stock/doctype/packed_item/packed_item.py index 5a09121b4f..cf208ee87d 100644 --- a/erpnext/stock/doctype/packed_item/packed_item.py +++ b/erpnext/stock/doctype/packed_item/packed_item.py @@ -53,7 +53,7 @@ def update_packing_list_item(obj, packing_item_code, qty, warehouse, line, packi if not pi.warehouse: pi.warehouse = warehouse if not pi.batch_no: - pi.batch_no = cstr(line.batch_no) + pi.batch_no = cstr(line.get("batch_no")) pi.idx = packing_list_idx packing_list_idx += 1 diff --git a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py index 74939b6996..f0de633ca6 100644 --- a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py @@ -23,11 +23,11 @@ class TestPurchaseReceipt(unittest.TestCase): pr.submit() pi = make_purchase_invoice(pr.name) - self.assertEquals(pi[0]["doctype"], "Purchase Invoice") - self.assertEquals(len(pi), len(pr.doclist)) + self.assertEquals(pi["doctype"], "Purchase Invoice") + self.assertEquals(len(pi.get("entries")), len(pr.get("purchase_receipt_details"))) # modify rate - pi[1]["rate"] = 200 + pi.get("entries")[0]["rate"] = 200 self.assertRaises(frappe.ValidationError, frappe.get_doc(pi).submit) def test_purchase_receipt_no_gl_entry(self): @@ -65,9 +65,9 @@ class TestPurchaseReceipt(unittest.TestCase): self.assertTrue(gl_entries) stock_in_hand_account = frappe.db.get_value("Account", - {"master_name": pr["purchase_receipt_details"][0].warehouse}) + {"master_name": pr.get("purchase_receipt_details")[0].warehouse}) fixed_asset_account = frappe.db.get_value("Account", - {"master_name": pr["purchase_receipt_details"][1].warehouse}) + {"master_name": pr.get("purchase_receipt_details")[1].warehouse}) expected_values = { stock_in_hand_account: [375.0, 0.0], @@ -94,18 +94,18 @@ class TestPurchaseReceipt(unittest.TestCase): pr.run_method("calculate_taxes_and_totals") pr.insert() - self.assertEquals(pr["purchase_receipt_details"][0].rm_supp_cost, 70000.0) + self.assertEquals(pr.get("purchase_receipt_details")[0].rm_supp_cost, 70000.0) self.assertEquals(len(pr.get("pr_raw_material_details")), 2) def test_serial_no_supplier(self): pr = frappe.copy_doc(test_records[0]) - pr["purchase_receipt_details"][0].item_code = "_Test Serialized Item With Series" - pr["purchase_receipt_details"][0].qty = 1 - pr["purchase_receipt_details"][0].received_qty = 1 + pr.get("purchase_receipt_details")[0].item_code = "_Test Serialized Item With Series" + pr.get("purchase_receipt_details")[0].qty = 1 + pr.get("purchase_receipt_details")[0].received_qty = 1 pr.insert() pr.submit() - self.assertEquals(frappe.db.get_value("Serial No", pr["purchase_receipt_details"][0].serial_no, + self.assertEquals(frappe.db.get_value("Serial No", pr.get("purchase_receipt_details")[0].serial_no, "supplier"), pr.supplier) return pr @@ -114,7 +114,7 @@ class TestPurchaseReceipt(unittest.TestCase): pr = self.test_serial_no_supplier() pr.cancel() - self.assertFalse(frappe.db.get_value("Serial No", pr["purchase_receipt_details"][0].serial_no, + self.assertFalse(frappe.db.get_value("Serial No", pr.get("purchase_receipt_details")[0].serial_no, "warehouse")) def get_gl_entries(voucher_type, voucher_no): diff --git a/erpnext/stock/doctype/serial_no/serial_no.py b/erpnext/stock/doctype/serial_no/serial_no.py index 7a259f8e1f..90786550a4 100644 --- a/erpnext/stock/doctype/serial_no/serial_no.py +++ b/erpnext/stock/doctype/serial_no/serial_no.py @@ -284,6 +284,7 @@ def make_serial_no(serial_no, sle): sr.serial_no = serial_no sr.item_code = sle.item_code sr.warehouse = None + sr.company = sle.company sr.via_stock_ledger = True sr.insert() sr.warehouse = sle.warehouse diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index cdfff04430..b5d46a2c0f 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -277,7 +277,7 @@ class StockEntry(StockController): raise_exception=frappe.DoesNotExistError) # validate quantity <= ref item's qty - qty already returned - ref_item = ref.getone({"item_code": item.item_code}) + ref_item = ref.doc.getone({"item_code": item.item_code}) returnable_qty = ref_item.qty - flt(already_returned_item_qty.get(item.item_code)) if not returnable_qty: frappe.throw("{item}: {item_code} {returned}".format( @@ -710,7 +710,7 @@ def get_stock_items_for_return(ref_doc, parentfields): parentfields = [parentfields] all_items = list(set([d.item_code for d in - ref_doc.get_all_children() if d.item_code])) + ref_doc.get_all_children() if d.get("item_code")])) stock_items = frappe.db.sql_list("""select name from `tabItem` where is_stock_item='Yes' and name in (%s)""" % (", ".join(["%s"] * len(all_items))), tuple(all_items)) @@ -720,9 +720,9 @@ def get_stock_items_for_return(ref_doc, parentfields): def get_return_doc_and_details(args): ref = frappe._dict() - # get ref_doc + # get ref_doc if args.get("purpose") in return_map: - for fieldname, val in return_map[args["purpose"]].items(): + for fieldname, val in return_map[args.get("purpose")].items(): if args.get(fieldname): ref.fieldname = fieldname ref.doc = frappe.get_doc(val[0], args.get(fieldname)) diff --git a/erpnext/stock/doctype/stock_entry/test_stock_entry.py b/erpnext/stock/doctype/stock_entry/test_stock_entry.py index 00718f14a8..0aa043333e 100644 --- a/erpnext/stock/doctype/stock_entry/test_stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/test_stock_entry.py @@ -3,7 +3,7 @@ from __future__ import unicode_literals import frappe, unittest -from frappe.utils import flt +from frappe.utils import flt, getdate from erpnext.stock.doctype.serial_no.serial_no import * from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory from erpnext.stock.doctype.stock_ledger_entry.stock_ledger_entry import StockFreezeError @@ -29,7 +29,7 @@ class TestStockEntry(unittest.TestCase): st2 = frappe.copy_doc(test_records[1]) st2.insert() st2.submit() - + from erpnext.stock.utils import reorder_item reorder_item() @@ -50,7 +50,7 @@ class TestStockEntry(unittest.TestCase): mr.submit() stock_in_hand_account = frappe.db.get_value("Account", {"account_type": "Warehouse", - "master_name": mr["mtn_details"][0].t_warehouse}) + "master_name": mr.get("mtn_details")[0].t_warehouse}) self.check_stock_ledger_entries("Stock Entry", mr.name, [["_Test Item", "_Test Warehouse - _TC", 50.0]]) @@ -85,7 +85,7 @@ class TestStockEntry(unittest.TestCase): [["_Test Item", "_Test Warehouse - _TC", -40.0]]) stock_in_hand_account = frappe.db.get_value("Account", {"account_type": "Warehouse", - "master_name": mi["mtn_details"][0].s_warehouse}) + "master_name": mi.get("mtn_details")[0].s_warehouse}) self.check_gl_entries("Stock Entry", mi.name, sorted([ @@ -101,11 +101,11 @@ class TestStockEntry(unittest.TestCase): self.assertFalse(frappe.db.sql("""select * from `tabGL Entry` where voucher_type='Stock Entry' and voucher_no=%s""", mi.name)) - self.assertEquals(frappe.db.get_value("Bin", {"warehouse": mi["mtn_details"][0].s_warehouse, - "item_code": mi["mtn_details"][0].item_code}, "actual_qty"), 50) + self.assertEquals(frappe.db.get_value("Bin", {"warehouse": mi.get("mtn_details")[0].s_warehouse, + "item_code": mi.get("mtn_details")[0].item_code}, "actual_qty"), 50) - self.assertEquals(frappe.db.get_value("Bin", {"warehouse": mi["mtn_details"][0].s_warehouse, - "item_code": mi["mtn_details"][0].item_code}, "stock_value"), 5000) + self.assertEquals(frappe.db.get_value("Bin", {"warehouse": mi.get("mtn_details")[0].s_warehouse, + "item_code": mi.get("mtn_details")[0].item_code}, "stock_value"), 5000) def test_material_transfer_gl_entry(self): self._clear_stock_account_balance() @@ -121,10 +121,10 @@ class TestStockEntry(unittest.TestCase): [["_Test Item", "_Test Warehouse - _TC", -45.0], ["_Test Item", "_Test Warehouse 1 - _TC", 45.0]]) stock_in_hand_account = frappe.db.get_value("Account", {"account_type": "Warehouse", - "master_name": mtn["mtn_details"][0].s_warehouse}) + "master_name": mtn.get("mtn_details")[0].s_warehouse}) fixed_asset_account = frappe.db.get_value("Account", {"account_type": "Warehouse", - "master_name": mtn["mtn_details"][0].t_warehouse}) + "master_name": mtn.get("mtn_details")[0].t_warehouse}) self.check_gl_entries("Stock Entry", mtn.name, @@ -171,12 +171,12 @@ class TestStockEntry(unittest.TestCase): self._insert_material_receipt() repack = frappe.copy_doc(test_records[3]) - repack["mtn_details"][1].incoming_rate = 6000 + repack.get("mtn_details")[1].incoming_rate = 6000 repack.insert() repack.submit() stock_in_hand_account = frappe.db.get_value("Account", {"account_type": "Warehouse", - "master_name": repack["mtn_details"][1].t_warehouse}) + "master_name": repack.get("mtn_details")[1].t_warehouse}) self.check_gl_entries("Stock Entry", repack.name, sorted([ @@ -223,7 +223,7 @@ class TestStockEntry(unittest.TestCase): se1.submit() se2 = frappe.copy_doc(test_records[0]) - se2["mtn_details"][0].item_code = "_Test Item Home Desktop 100" + se2.get("mtn_details")[0].item_code = "_Test Item Home Desktop 100" se2.insert() se2.submit() @@ -235,7 +235,7 @@ class TestStockEntry(unittest.TestCase): def _test_sales_invoice_return(self, item_code, delivered_qty, returned_qty): from erpnext.stock.doctype.stock_entry.stock_entry import NotUpdateStockError - + from erpnext.accounts.doctype.sales_invoice.test_sales_invoice \ import test_records as sales_invoice_test_records @@ -247,8 +247,8 @@ class TestStockEntry(unittest.TestCase): se = frappe.copy_doc(test_records[0]) se.purpose = "Sales Return" se.sales_invoice_no = si.name - se["mtn_details"][0].qty = returned_qty - se["mtn_details"][0].transfer_qty = returned_qty + se.get("mtn_details")[0].qty = returned_qty + se.get("mtn_details")[0].transfer_qty = returned_qty self.assertRaises(NotUpdateStockError, se.insert) self._insert_material_receipt() @@ -259,9 +259,9 @@ class TestStockEntry(unittest.TestCase): # insert a pos invoice with update stock si = frappe.copy_doc(sales_invoice_test_records[1]) si.is_pos = si.update_stock = 1 - si["mtn_details"][0].warehouse = "_Test Warehouse - _TC" - si["mtn_details"][0].item_code = item_code - si["mtn_details"][0].qty = 5.0 + si.get("entries")[0].warehouse = "_Test Warehouse - _TC" + si.get("entries")[0].item_code = item_code + si.get("entries")[0].qty = 5.0 si.insert() si.submit() @@ -276,9 +276,9 @@ class TestStockEntry(unittest.TestCase): se.sales_invoice_no = si.name se.posting_date = "2013-03-10" se.fiscal_year = "_Test Fiscal Year 2013" - se["mtn_details"][0].item_code = "_Test Item Home Desktop 200" - se["mtn_details"][0].qty = returned_qty - se["mtn_details"][0].transfer_qty = returned_qty + se.get("mtn_details")[0].item_code = "_Test Item Home Desktop 200" + se.get("mtn_details")[0].qty = returned_qty + se.get("mtn_details")[0].transfer_qty = returned_qty # check if stock entry gets submitted self.assertRaises(frappe.DoesNotExistError, se.insert) @@ -289,8 +289,8 @@ class TestStockEntry(unittest.TestCase): se.posting_date = "2013-03-10" se.fiscal_year = "_Test Fiscal Year 2013" se.sales_invoice_no = si.name - se["mtn_details"][0].qty = returned_qty - se["mtn_details"][0].transfer_qty = returned_qty + se.get("mtn_details")[0].qty = returned_qty + se.get("mtn_details")[0].transfer_qty = returned_qty # in both cases item code remains _Test Item when returning se.insert() @@ -322,7 +322,7 @@ class TestStockEntry(unittest.TestCase): actual_qty_0 = self._get_actual_qty() # make a delivery note based on this invoice dn = frappe.copy_doc(delivery_note_test_records[0]) - dn["delivery_note_details"][0].item_code = item_code + dn.get("delivery_note_details")[0].item_code = item_code dn.insert() dn.submit() @@ -330,9 +330,9 @@ class TestStockEntry(unittest.TestCase): self.assertEquals(actual_qty_0 - delivered_qty, actual_qty_1) - si_doclist = make_sales_invoice(dn.name) + si_doc = make_sales_invoice(dn.name) - si = frappe.get_doc(si_doclist) + si = frappe.get_doc(si_doc) si.posting_date = dn.posting_date si.debit_to = "_Test Customer - _TC" for d in si.get("entries"): @@ -347,7 +347,7 @@ class TestStockEntry(unittest.TestCase): se.delivery_note_no = dn.name se.posting_date = "2013-03-10" se.fiscal_year = "_Test Fiscal Year 2013" - se["mtn_details"][0].qty = se["mtn_details"][0].transfer_qty = returned_qty + se.get("mtn_details")[0].qty = se.get("mtn_details")[0].transfer_qty = returned_qty se.insert() se.submit() @@ -409,28 +409,25 @@ class TestStockEntry(unittest.TestCase): from erpnext.selling.doctype.sales_order.sales_order import make_sales_invoice, make_delivery_note actual_qty_0 = self._get_actual_qty() - so = frappe.copy_doc(sales_order_test_records[0]) - so["sales_order_details"][0].item_code = item_code - so["sales_order_details"][0].qty = 5.0 + so.get("sales_order_details")[0].item_code = item_code + so.get("sales_order_details")[0].qty = 5.0 so.insert() so.submit() + dn_doc = make_delivery_note(so.name) - dn_doclist = make_delivery_note(so.name) - - dn = frappe.get_doc(dn_doclist) + dn = frappe.get_doc(dn_doc) dn.status = "Draft" dn.posting_date = so.delivery_date dn.insert() dn.submit() actual_qty_1 = self._get_actual_qty() - self.assertEquals(actual_qty_0 - delivered_qty, actual_qty_1) - si_doclist = make_sales_invoice(so.name) + si_doc = make_sales_invoice(so.name) - si = frappe.get_doc(si_doclist) + si = frappe.get_doc(si_doc) si.posting_date = dn.posting_date si.debit_to = "_Test Customer - _TC" for d in si.get("entries"): @@ -445,7 +442,7 @@ class TestStockEntry(unittest.TestCase): se.delivery_note_no = dn.name se.posting_date = "2013-03-10" se.fiscal_year = "_Test Fiscal Year 2013" - se["mtn_details"][0].qty = se["mtn_details"][0].transfer_qty = returned_qty + se.get("mtn_details")[0].qty = se.get("mtn_details")[0].transfer_qty = returned_qty se.insert() se.submit() @@ -464,7 +461,7 @@ class TestStockEntry(unittest.TestCase): import test_records as purchase_receipt_test_records from erpnext.stock.doctype.purchase_receipt.purchase_receipt import make_purchase_invoice - + # submit purchase receipt pr = frappe.copy_doc(purchase_receipt_test_records[0]) pr.insert() @@ -474,9 +471,9 @@ class TestStockEntry(unittest.TestCase): self.assertEquals(actual_qty_0 + 5, actual_qty_1) - pi_doclist = make_purchase_invoice(pr.name) + pi_doc = make_purchase_invoice(pr.name) - pi = frappe.get_doc(pi_doclist) + pi = frappe.get_doc(pi_doc) pi.posting_date = pr.posting_date pi.credit_to = "_Test Supplier - _TC" for d in pi.get("entries"): @@ -497,8 +494,8 @@ class TestStockEntry(unittest.TestCase): se.purchase_receipt_no = pr.name se.posting_date = "2013-03-01" se.fiscal_year = "_Test Fiscal Year 2013" - se["mtn_details"][0].qty = se["mtn_details"][0].transfer_qty = 5 - se["mtn_details"][0].s_warehouse = "_Test Warehouse - _TC" + se.get("mtn_details")[0].qty = se.get("mtn_details")[0].transfer_qty = 5 + se.get("mtn_details")[0].s_warehouse = "_Test Warehouse - _TC" se.insert() se.submit() @@ -523,8 +520,8 @@ class TestStockEntry(unittest.TestCase): se.purchase_receipt_no = pr_docname se.posting_date = "2013-03-01" se.fiscal_year = "_Test Fiscal Year 2013" - se["mtn_details"][0].qty = se["mtn_details"][0].transfer_qty = 6 - se["mtn_details"][0].s_warehouse = "_Test Warehouse - _TC" + se.get("mtn_details")[0].qty = se.get("mtn_details")[0].transfer_qty = 6 + se.get("mtn_details")[0].s_warehouse = "_Test Warehouse - _TC" self.assertRaises(StockOverReturnError, se.insert) @@ -551,24 +548,24 @@ class TestStockEntry(unittest.TestCase): self._clear_stock_account_balance() actual_qty_0 = self._get_actual_qty() - + from erpnext.buying.doctype.purchase_order.test_purchase_order \ import test_records as purchase_order_test_records - + from erpnext.buying.doctype.purchase_order.purchase_order import \ make_purchase_receipt, make_purchase_invoice # submit purchase receipt po = frappe.copy_doc(purchase_order_test_records[0]) po.is_subcontracted = None - po["po_details"][0].item_code = "_Test Item" - po["po_details"][0].rate = 50 + po.get("po_details")[0].item_code = "_Test Item" + po.get("po_details")[0].rate = 50 po.insert() po.submit() - pr_doclist = make_purchase_receipt(po.name) + pr_doc = make_purchase_receipt(po.name) - pr = frappe.get_doc(pr_doclist) + pr = frappe.get_doc(pr_doc) pr.posting_date = po.transaction_date pr.insert() pr.submit() @@ -577,9 +574,9 @@ class TestStockEntry(unittest.TestCase): self.assertEquals(actual_qty_0 + 10, actual_qty_1) - pi_doclist = make_purchase_invoice(po.name) + pi_doc = make_purchase_invoice(po.name) - pi = frappe.get_doc(pi_doclist) + pi = frappe.get_doc(pi_doc) pi.posting_date = pr.posting_date pi.credit_to = "_Test Supplier - _TC" for d in pi.get("entries"): @@ -599,8 +596,8 @@ class TestStockEntry(unittest.TestCase): se.purchase_receipt_no = pr.name se.posting_date = "2013-03-01" se.fiscal_year = "_Test Fiscal Year 2013" - se["mtn_details"][0].qty = se["mtn_details"][0].transfer_qty = 5 - se["mtn_details"][0].s_warehouse = "_Test Warehouse - _TC" + se.get("mtn_details")[0].qty = se.get("mtn_details")[0].transfer_qty = 5 + se.get("mtn_details")[0].s_warehouse = "_Test Warehouse - _TC" se.insert() se.submit() @@ -622,43 +619,43 @@ class TestStockEntry(unittest.TestCase): def test_serial_no_not_reqd(self): se = frappe.copy_doc(test_records[0]) - se["mtn_details"][0].serial_no = "ABCD" + se.get("mtn_details")[0].serial_no = "ABCD" se.insert() self.assertRaises(SerialNoNotRequiredError, se.submit) def test_serial_no_reqd(self): se = frappe.copy_doc(test_records[0]) - se["mtn_details"][0].item_code = "_Test Serialized Item" - se["mtn_details"][0].qty = 2 - se["mtn_details"][0].transfer_qty = 2 + se.get("mtn_details")[0].item_code = "_Test Serialized Item" + se.get("mtn_details")[0].qty = 2 + se.get("mtn_details")[0].transfer_qty = 2 se.insert() self.assertRaises(SerialNoRequiredError, se.submit) def test_serial_no_qty_more(self): se = frappe.copy_doc(test_records[0]) - se["mtn_details"][0].item_code = "_Test Serialized Item" - se["mtn_details"][0].qty = 2 - se["mtn_details"][0].serial_no = "ABCD\nEFGH\nXYZ" - se["mtn_details"][0].transfer_qty = 2 + se.get("mtn_details")[0].item_code = "_Test Serialized Item" + se.get("mtn_details")[0].qty = 2 + se.get("mtn_details")[0].serial_no = "ABCD\nEFGH\nXYZ" + se.get("mtn_details")[0].transfer_qty = 2 se.insert() self.assertRaises(SerialNoQtyError, se.submit) def test_serial_no_qty_less(self): se = frappe.copy_doc(test_records[0]) - se["mtn_details"][0].item_code = "_Test Serialized Item" - se["mtn_details"][0].qty = 2 - se["mtn_details"][0].serial_no = "ABCD" - se["mtn_details"][0].transfer_qty = 2 + se.get("mtn_details")[0].item_code = "_Test Serialized Item" + se.get("mtn_details")[0].qty = 2 + se.get("mtn_details")[0].serial_no = "ABCD" + se.get("mtn_details")[0].transfer_qty = 2 se.insert() self.assertRaises(SerialNoQtyError, se.submit) def test_serial_no_transfer_in(self): self._clear_stock_account_balance() se = frappe.copy_doc(test_records[0]) - se["mtn_details"][0].item_code = "_Test Serialized Item" - se["mtn_details"][0].qty = 2 - se["mtn_details"][0].serial_no = "ABCD\nEFGH" - se["mtn_details"][0].transfer_qty = 2 + se.get("mtn_details")[0].item_code = "_Test Serialized Item" + se.get("mtn_details")[0].qty = 2 + se.get("mtn_details")[0].serial_no = "ABCD\nEFGH" + se.get("mtn_details")[0].transfer_qty = 2 se.insert() se.submit() @@ -672,12 +669,12 @@ class TestStockEntry(unittest.TestCase): self._clear_stock_account_balance() se = frappe.copy_doc(test_records[0]) se.purpose = "Material Issue" - se["mtn_details"][0].item_code = "_Test Serialized Item" - se["mtn_details"][0].qty = 2 - se["mtn_details"][0].s_warehouse = "_Test Warehouse 1 - _TC" - se["mtn_details"][0].t_warehouse = None - se["mtn_details"][0].serial_no = "ABCD\nEFGH" - se["mtn_details"][0].transfer_qty = 2 + se.get("mtn_details")[0].item_code = "_Test Serialized Item" + se.get("mtn_details")[0].qty = 2 + se.get("mtn_details")[0].s_warehouse = "_Test Warehouse 1 - _TC" + se.get("mtn_details")[0].t_warehouse = None + se.get("mtn_details")[0].serial_no = "ABCD\nEFGH" + se.get("mtn_details")[0].transfer_qty = 2 se.insert() self.assertRaises(SerialNoNotExistsError, se.submit) @@ -686,10 +683,10 @@ class TestStockEntry(unittest.TestCase): self.test_serial_by_series() se = frappe.copy_doc(test_records[0]) - se["mtn_details"][0].item_code = "_Test Serialized Item With Series" - se["mtn_details"][0].qty = 1 - se["mtn_details"][0].serial_no = "ABCD00001" - se["mtn_details"][0].transfer_qty = 1 + se.get("mtn_details")[0].item_code = "_Test Serialized Item With Series" + se.get("mtn_details")[0].qty = 1 + se.get("mtn_details")[0].serial_no = "ABCD00001" + se.get("mtn_details")[0].transfer_qty = 1 se.insert() self.assertRaises(SerialNoDuplicateError, se.submit) @@ -697,7 +694,7 @@ class TestStockEntry(unittest.TestCase): self._clear_stock_account_balance() se = make_serialized_item() - serial_nos = get_serial_nos(se["mtn_details"][0].serial_no) + serial_nos = get_serial_nos(se.get("mtn_details")[0].serial_no) self.assertTrue(frappe.db.exists("Serial No", serial_nos[0])) self.assertTrue(frappe.db.exists("Serial No", serial_nos[1])) @@ -710,28 +707,28 @@ class TestStockEntry(unittest.TestCase): se = frappe.copy_doc(test_records[0]) se.purpose = "Material Transfer" - se["mtn_details"][0].item_code = "_Test Serialized Item" - se["mtn_details"][0].qty = 1 - se["mtn_details"][0].transfer_qty = 1 - se["mtn_details"][0].serial_no = "ABCD00001" - se["mtn_details"][0].s_warehouse = "_Test Warehouse - _TC" - se["mtn_details"][0].t_warehouse = "_Test Warehouse 1 - _TC" + se.get("mtn_details")[0].item_code = "_Test Serialized Item" + se.get("mtn_details")[0].qty = 1 + se.get("mtn_details")[0].transfer_qty = 1 + se.get("mtn_details")[0].serial_no = "ABCD00001" + se.get("mtn_details")[0].s_warehouse = "_Test Warehouse - _TC" + se.get("mtn_details")[0].t_warehouse = "_Test Warehouse 1 - _TC" se.insert() self.assertRaises(SerialNoItemError, se.submit) def test_serial_move(self): self._clear_stock_account_balance() se = make_serialized_item() - serial_no = get_serial_nos(se["mtn_details"][0].serial_no)[0] + serial_no = get_serial_nos(se.get("mtn_details")[0].serial_no)[0] se = frappe.copy_doc(test_records[0]) se.purpose = "Material Transfer" - se["mtn_details"][0].item_code = "_Test Serialized Item With Series" - se["mtn_details"][0].qty = 1 - se["mtn_details"][0].transfer_qty = 1 - se["mtn_details"][0].serial_no = serial_no - se["mtn_details"][0].s_warehouse = "_Test Warehouse - _TC" - se["mtn_details"][0].t_warehouse = "_Test Warehouse 1 - _TC" + se.get("mtn_details")[0].item_code = "_Test Serialized Item With Series" + se.get("mtn_details")[0].qty = 1 + se.get("mtn_details")[0].transfer_qty = 1 + se.get("mtn_details")[0].serial_no = serial_no + se.get("mtn_details")[0].s_warehouse = "_Test Warehouse - _TC" + se.get("mtn_details")[0].t_warehouse = "_Test Warehouse 1 - _TC" se.insert() se.submit() self.assertTrue(frappe.db.get_value("Serial No", serial_no, "warehouse"), "_Test Warehouse 1 - _TC") @@ -745,12 +742,12 @@ class TestStockEntry(unittest.TestCase): se = frappe.copy_doc(test_records[0]) se.purpose = "Material Transfer" - se["mtn_details"][0].item_code = "_Test Serialized Item With Series" - se["mtn_details"][0].qty = 1 - se["mtn_details"][0].transfer_qty = 1 - se["mtn_details"][0].serial_no = "ABCD00001" - se["mtn_details"][0].s_warehouse = "_Test Warehouse 1 - _TC" - se["mtn_details"][0].t_warehouse = "_Test Warehouse - _TC" + se.get("mtn_details")[0].item_code = "_Test Serialized Item With Series" + se.get("mtn_details")[0].qty = 1 + se.get("mtn_details")[0].transfer_qty = 1 + se.get("mtn_details")[0].serial_no = "ABCD00001" + se.get("mtn_details")[0].s_warehouse = "_Test Warehouse 1 - _TC" + se.get("mtn_details")[0].t_warehouse = "_Test Warehouse - _TC" se.insert() self.assertRaises(SerialNoWarehouseError, se.submit) @@ -759,9 +756,9 @@ class TestStockEntry(unittest.TestCase): se = self.test_serial_by_series() se.cancel() - serial_no = get_serial_nos(se["mtn_details"][0].serial_no)[0] + serial_no = get_serial_nos(se.get("mtn_details")[0].serial_no)[0] self.assertFalse(frappe.db.get_value("Serial No", serial_no, "warehouse")) - + def test_warehouse_company_validation(self): set_perpetual_inventory(0) self._clear_stock_account_balance() @@ -771,15 +768,15 @@ class TestStockEntry(unittest.TestCase): from erpnext.stock.utils import InvalidWarehouseCompany st1 = frappe.copy_doc(test_records[0]) - st1["mtn_details"][0].t_warehouse="_Test Warehouse 2 - _TC1" + st1.get("mtn_details")[0].t_warehouse="_Test Warehouse 2 - _TC1" st1.insert() self.assertRaises(InvalidWarehouseCompany, st1.submit) - + # permission tests def test_warehouse_user(self): import frappe.defaults set_perpetual_inventory(0) - + 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.get_doc("User", "test@example.com")\ @@ -790,19 +787,19 @@ class TestStockEntry(unittest.TestCase): frappe.set_user("test@example.com") st1 = frappe.copy_doc(test_records[0]) st1.company = "_Test Company 1" - st1["mtn_details"][0].t_warehouse="_Test Warehouse 2 - _TC1" - self.assertRaises(frappe.PermissionErrorp, st1.insert) + st1.get("mtn_details")[0].t_warehouse="_Test Warehouse 2 - _TC1" + self.assertRaises(frappe.PermissionError, st1.insert) frappe.set_user("test2@example.com") st1 = frappe.copy_doc(test_records[0]) st1.company = "_Test Company 1" - st1["mtn_details"][0].t_warehouse="_Test Warehouse 2 - _TC1" + st1.get("mtn_details")[0].t_warehouse="_Test Warehouse 2 - _TC1" st1.insert() st1.submit() - + frappe.defaults.clear_default("Warehouse", "_Test Warehouse 1 - _TC1", "test@example.com", parenttype="Restriction") frappe.defaults.clear_default("Warehouse", "_Test Warehouse 2 - _TC1", "test2@example.com", parenttype="Restriction") - + def test_freeze_stocks (self): self._clear_stock_account_balance() frappe.db.set_value('Stock Settings', None,'stock_auth_role', '') @@ -822,11 +819,11 @@ class TestStockEntry(unittest.TestCase): def make_serialized_item(): se = frappe.copy_doc(test_records[0]) - se["mtn_details"][0].item_code = "_Test Serialized Item With Series" - se["mtn_details"][0].qty = 2 - se["mtn_details"][0].transfer_qty = 2 + se.get("mtn_details")[0].item_code = "_Test Serialized Item With Series" + se.get("mtn_details")[0].qty = 2 + se.get("mtn_details")[0].transfer_qty = 2 se.insert() se.submit() return se -test_records = frappe.get_test_records('Stock Entry') \ No newline at end of file +test_records = frappe.get_test_records('Stock Entry') diff --git a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py index 0553830755..c1ffd02b51 100644 --- a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py @@ -228,9 +228,9 @@ class TestStockReconciliation(unittest.TestCase): pr1 = frappe.copy_doc(stock_entry) pr1.posting_date = "2012-12-15" pr1.posting_time = "02:00" - pr1["mtn_details"][0].qty = 10 - pr1["mtn_details"][0].transfer_qty = 10 - pr1["mtn_details"][0].incoming_rate = 700 + pr1.get("mtn_details")[0].qty = 10 + pr1.get("mtn_details")[0].transfer_qty = 10 + pr1.get("mtn_details")[0].incoming_rate = 700 pr1.insert() pr1.submit() @@ -238,11 +238,11 @@ class TestStockReconciliation(unittest.TestCase): pr2.posting_date = "2012-12-25" pr2.posting_time = "03:00" pr2.purpose = "Material Issue" - pr2["mtn_details"][0].s_warehouse = "_Test Warehouse - _TC" - pr2["mtn_details"][0].t_warehouse = None - pr2["mtn_details"][0].qty = 15 - pr2["mtn_details"][0].transfer_qty = 15 - pr2["mtn_details"][0].incoming_rate = 0 + pr2.get("mtn_details")[0].s_warehouse = "_Test Warehouse - _TC" + pr2.get("mtn_details")[0].t_warehouse = None + pr2.get("mtn_details")[0].qty = 15 + pr2.get("mtn_details")[0].transfer_qty = 15 + pr2.get("mtn_details")[0].incoming_rate = 0 pr2.insert() pr2.submit() @@ -250,11 +250,11 @@ class TestStockReconciliation(unittest.TestCase): pr3.posting_date = "2012-12-31" pr3.posting_time = "08:00" pr3.purpose = "Material Issue" - pr3["mtn_details"][0].s_warehouse = "_Test Warehouse - _TC" - pr3["mtn_details"][0].t_warehouse = None - pr3["mtn_details"][0].qty = 20 - pr3["mtn_details"][0].transfer_qty = 20 - pr3["mtn_details"][0].incoming_rate = 0 + pr3.get("mtn_details")[0].s_warehouse = "_Test Warehouse - _TC" + pr3.get("mtn_details")[0].t_warehouse = None + pr3.get("mtn_details")[0].qty = 20 + pr3.get("mtn_details")[0].transfer_qty = 20 + pr3.get("mtn_details")[0].incoming_rate = 0 pr3.insert() pr3.submit() @@ -263,9 +263,9 @@ class TestStockReconciliation(unittest.TestCase): pr4.posting_date = "2013-01-05" pr4.fiscal_year = "_Test Fiscal Year 2013" pr4.posting_time = "07:00" - pr4["mtn_details"][0].qty = 15 - pr4["mtn_details"][0].transfer_qty = 15 - pr4["mtn_details"][0].incoming_rate = 1200 + pr4.get("mtn_details")[0].qty = 15 + pr4.get("mtn_details")[0].transfer_qty = 15 + pr4.get("mtn_details")[0].incoming_rate = 1200 pr4.insert() pr4.submit() diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index cf95845cc8..8a19bb19a7 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -17,36 +17,35 @@ _exceptions = frappe.local('stockledger_exceptions') def make_sl_entries(sl_entries, is_amended=None): if sl_entries: from erpnext.stock.utils import update_bin - + cancel = True if sl_entries[0].get("is_cancelled") == "Yes" else False if cancel: set_as_cancel(sl_entries[0].get('voucher_no'), sl_entries[0].get('voucher_type')) - + for sle in sl_entries: sle_id = None if sle.get('is_cancelled') == 'Yes': sle['actual_qty'] = -flt(sle['actual_qty']) - + if sle.get("actual_qty"): sle_id = make_entry(sle) - + args = sle.copy() args.update({ "sle_id": sle_id, "is_amended": is_amended }) update_bin(args) - if cancel: - delete_cancelled_entry(sl_entries[0].get('voucher_type'), + delete_cancelled_entry(sl_entries[0].get('voucher_type'), sl_entries[0].get('voucher_no')) - + def set_as_cancel(voucher_type, voucher_no): frappe.db.sql("""update `tabStock Ledger Entry` set is_cancelled='Yes', modified=%s, modified_by=%s - where voucher_no=%s and voucher_type=%s""", + where voucher_no=%s and voucher_type=%s""", (now(), frappe.session.user, voucher_type, voucher_no)) - + def make_entry(args): args.update({"doctype": "Stock Ledger Entry"}) sle = frappe.get_doc(args) @@ -54,16 +53,16 @@ def make_entry(args): sle.insert() sle.submit() return sle.name - + def delete_cancelled_entry(voucher_type, voucher_no): - frappe.db.sql("""delete from `tabStock Ledger Entry` + frappe.db.sql("""delete from `tabStock Ledger Entry` where voucher_type=%s and voucher_no=%s""", (voucher_type, voucher_no)) def update_entries_after(args, verbose=1): """ - update valution rate and qty after transaction + update valution rate and qty after transaction from the current time-bucket onwards - + args = { "item_code": "ABC", "warehouse": "XYZ", @@ -73,15 +72,15 @@ def update_entries_after(args, verbose=1): """ if not _exceptions: frappe.local.stockledger_exceptions = [] - + previous_sle = get_sle_before_datetime(args) - + qty_after_transaction = flt(previous_sle.get("qty_after_transaction")) valuation_rate = flt(previous_sle.get("valuation_rate")) stock_queue = json.loads(previous_sle.get("stock_queue") or "[]") stock_value = flt(previous_sle.get("stock_value")) prev_stock_value = flt(previous_sle.get("stock_value")) - + entries_to_fix = get_sle_after_datetime(previous_sle or \ {"item_code": args["item_code"], "warehouse": args["warehouse"]}, for_update=True) @@ -90,7 +89,7 @@ def update_entries_after(args, verbose=1): for sle in entries_to_fix: if sle.serial_no or not cint(frappe.db.get_default("allow_negative_stock")): - # validate negative stock for serialized items, fifo valuation + # validate negative stock for serialized items, fifo valuation # or when negative stock is not allowed for moving average if not validate_negative_stock(qty_after_transaction, sle): qty_after_transaction += flt(sle.actual_qty) @@ -102,9 +101,9 @@ def update_entries_after(args, verbose=1): valuation_rate = get_moving_average_values(qty_after_transaction, sle, valuation_rate) else: valuation_rate = get_fifo_values(qty_after_transaction, sle, stock_queue) - + qty_after_transaction += flt(sle.actual_qty) - + # get stock value if sle.serial_no: stock_value = qty_after_transaction * valuation_rate @@ -113,29 +112,29 @@ def update_entries_after(args, verbose=1): (qty_after_transaction * valuation_rate) or 0 else: stock_value = sum((flt(batch[0]) * flt(batch[1]) for batch in stock_queue)) - + # rounding as per precision from frappe.model.meta import get_field_precision meta = frappe.get_meta("Stock Ledger Entry") - - stock_value = flt(stock_value, get_field_precision(meta.get_field("stock_value"), + + stock_value = flt(stock_value, get_field_precision(meta.get_field("stock_value"), frappe._dict({"fields": sle}))) - + stock_value_difference = stock_value - prev_stock_value prev_stock_value = stock_value - + # update current sle frappe.db.sql("""update `tabStock Ledger Entry` set qty_after_transaction=%s, valuation_rate=%s, stock_queue=%s, - stock_value=%s, stock_value_difference=%s where name=%s""", + stock_value=%s, stock_value_difference=%s where name=%s""", (qty_after_transaction, valuation_rate, json.dumps(stock_queue), stock_value, stock_value_difference, sle.name)) - + if _exceptions: _raise_exceptions(args, verbose) - + # update bin - if not frappe.db.exists({"doctype": "Bin", "item_code": args["item_code"], + if not frappe.db.exists({"doctype": "Bin", "item_code": args["item_code"], "warehouse": args["warehouse"]}): bin_wrapper = frappe.get_doc({ "doctype": "Bin", @@ -144,13 +143,13 @@ def update_entries_after(args, verbose=1): }) bin_wrapper.ignore_permissions = 1 bin_wrapper.insert() - + frappe.db.sql("""update `tabBin` set valuation_rate=%s, actual_qty=%s, - stock_value=%s, + stock_value=%s, projected_qty = (actual_qty + indented_qty + ordered_qty + planned_qty - reserved_qty) where item_code=%s and warehouse=%s""", (valuation_rate, qty_after_transaction, stock_value, args["item_code"], args["warehouse"])) - + def get_sle_before_datetime(args, for_update=False): """ get previous stock ledger entry before current time-bucket @@ -164,23 +163,23 @@ def get_sle_before_datetime(args, for_update=False): sle = get_stock_ledger_entries(args, ["timestamp(posting_date, posting_time) < timestamp(%(posting_date)s, %(posting_time)s)"], "desc", "limit 1", for_update=for_update) - + return sle and sle[0] or frappe._dict() - + def get_sle_after_datetime(args, for_update=False): """get Stock Ledger Entries after a particular datetime, for reposting""" - # NOTE: using for update of + # NOTE: using for update of return get_stock_ledger_entries(args, ["timestamp(posting_date, posting_time) > timestamp(%(posting_date)s, %(posting_time)s)"], "asc", for_update=for_update) - + def get_stock_ledger_entries(args, conditions=None, order="desc", limit=None, for_update=False): """get stock ledger entries filtered by specific posting datetime conditions""" if not args.get("posting_date"): args["posting_date"] = "1900-01-01" if not args.get("posting_time"): args["posting_time"] = "00:00" - + return frappe.db.sql("""select * from `tabStock Ledger Entry` where item_code = %%(item_code)s and warehouse = %%(warehouse)s @@ -193,7 +192,7 @@ def get_stock_ledger_entries(args, conditions=None, order="desc", limit=None, fo "for_update": for_update and "for update" or "", "order": order }, args, as_dict=1) - + def validate_negative_stock(qty_after_transaction, sle): """ validate negative stock for entries current datetime onwards @@ -203,7 +202,7 @@ def validate_negative_stock(qty_after_transaction, sle): if not _exceptions: frappe.local.stockledger_exceptions = [] - + if diff < 0 and abs(diff) > 0.0001: # negative stock! exc = sle.copy().update({"diff": diff}) @@ -211,12 +210,12 @@ def validate_negative_stock(qty_after_transaction, sle): return False else: return True - + def get_serialized_values(qty_after_transaction, sle, valuation_rate): incoming_rate = flt(sle.incoming_rate) actual_qty = flt(sle.actual_qty) serial_no = cstr(sle.serial_no).split("\n") - + if incoming_rate < 0: # wrong incoming rate incoming_rate = valuation_rate @@ -226,7 +225,7 @@ def get_serialized_values(qty_after_transaction, sle, valuation_rate): incoming_rate = flt(frappe.db.sql("""select avg(ifnull(purchase_rate, 0)) from `tabSerial No` where name in (%s)""" % (", ".join(["%s"]*len(serial_no))), tuple(serial_no))[0][0]) - + if incoming_rate and not valuation_rate: valuation_rate = incoming_rate else: @@ -237,33 +236,33 @@ def get_serialized_values(qty_after_transaction, sle, valuation_rate): # calculate new valuation rate only if stock value is positive # else it remains the same as that of previous entry valuation_rate = new_stock_value / new_stock_qty - + return valuation_rate - + def get_moving_average_values(qty_after_transaction, sle, valuation_rate): incoming_rate = flt(sle.incoming_rate) - actual_qty = flt(sle.actual_qty) - + actual_qty = flt(sle.actual_qty) + if not incoming_rate: # In case of delivery/stock issue in_rate = 0 or wrong incoming rate incoming_rate = valuation_rate - + elif qty_after_transaction < 0: # if negative stock, take current valuation rate as incoming rate valuation_rate = incoming_rate - + new_stock_qty = qty_after_transaction + actual_qty new_stock_value = qty_after_transaction * valuation_rate + actual_qty * incoming_rate - + if new_stock_qty > 0 and new_stock_value > 0: valuation_rate = new_stock_value / flt(new_stock_qty) elif new_stock_qty <= 0: valuation_rate = 0.0 - + # NOTE: val_rate is same as previous entry if new stock value is negative - + return valuation_rate - + def get_fifo_values(qty_after_transaction, sle, stock_queue): incoming_rate = flt(sle.incoming_rate) actual_qty = flt(sle.actual_qty) @@ -282,9 +281,9 @@ def get_fifo_values(qty_after_transaction, sle, stock_queue): while qty_to_pop: if not stock_queue: stock_queue.append([0, 0]) - + batch = stock_queue[0] - + if 0 < batch[0] <= qty_to_pop: # if batch qty > 0 # not enough or exactly same qty in current batch, clear batch @@ -296,7 +295,7 @@ def get_fifo_values(qty_after_transaction, sle, stock_queue): incoming_cost += flt(qty_to_pop) * flt(batch[1]) batch[0] -= qty_to_pop qty_to_pop = 0 - + stock_value = sum((flt(batch[0]) * flt(batch[1]) for batch in stock_queue)) stock_qty = sum((flt(batch[0]) for batch in stock_queue)) @@ -306,9 +305,9 @@ def get_fifo_values(qty_after_transaction, sle, stock_queue): def _raise_exceptions(args, verbose=1): deficiency = min(e["diff"] for e in _exceptions) - msg = """Negative stock error: + msg = """Negative stock error: Cannot complete this transaction because stock will start - becoming negative (%s) for Item %s in Warehouse + becoming negative (%s) for Item %s in Warehouse %s on %s %s in Transaction %s %s. Total Quantity Deficiency: %s""" % \ (_exceptions[0]["diff"], args.get("item_code"), args.get("warehouse"), @@ -319,13 +318,13 @@ def _raise_exceptions(args, verbose=1): msgprint(msg, raise_exception=NegativeStockError) else: raise NegativeStockError, msg - + def get_previous_sle(args, for_update=False): """ - get the last sle on or before the current time-bucket, + get the last sle on or before the current time-bucket, to get actual qty before transaction, this function is called from various transaction like stock entry, reco etc - + args = { "item_code": "ABC", "warehouse": "XYZ", @@ -335,7 +334,7 @@ def get_previous_sle(args, for_update=False): } """ if not args.get("sle"): args["sle"] = "" - + sle = get_stock_ledger_entries(args, ["name != %(sle)s", "timestamp(posting_date, posting_time) <= timestamp(%(posting_date)s, %(posting_time)s)"], "desc", "limit 1", for_update=for_update) From 49f49ea603fb7ae5a45810c98b9775281620ca01 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 7 Apr 2014 15:09:09 +0530 Subject: [PATCH 34/42] started party frappe/erpnext#1503 --- .../doctype/cost_center/cost_center.py | 4 +- .../journal_voucher/journal_voucher.js | 48 +-- erpnext/contacts/__init__.py | 0 erpnext/contacts/doctype/__init__.py | 0 .../contacts/doctype/party_type/__init__.py | 0 .../doctype/party_type/party_type.json | 302 ++++++++++++++++++ .../contacts/doctype/party_type/party_type.py | 9 + erpnext/modules.txt | 3 +- .../doctype/customer_group/customer_group.py | 4 +- .../setup/doctype/item_group/item_group.py | 6 +- .../doctype/sales_person/sales_person.py | 4 +- erpnext/setup/doctype/territory/territory.py | 4 +- .../setup/page/setup_wizard/setup_wizard.py | 58 ++-- 13 files changed, 377 insertions(+), 65 deletions(-) create mode 100644 erpnext/contacts/__init__.py create mode 100644 erpnext/contacts/doctype/__init__.py create mode 100644 erpnext/contacts/doctype/party_type/__init__.py create mode 100644 erpnext/contacts/doctype/party_type/party_type.json create mode 100644 erpnext/contacts/doctype/party_type/party_type.py diff --git a/erpnext/accounts/doctype/cost_center/cost_center.py b/erpnext/accounts/doctype/cost_center/cost_center.py index 7013ffb30d..d79bbcc5cd 100644 --- a/erpnext/accounts/doctype/cost_center/cost_center.py +++ b/erpnext/accounts/doctype/cost_center/cost_center.py @@ -6,9 +6,9 @@ import frappe from frappe import msgprint, _ -from frappe.utils.nestedset import DocTypeNestedSet +from frappe.utils.nestedset import NestedSet -class CostCenter(DocTypeNestedSet): +class CostCenter(NestedSet): nsm_parent_field = 'parent_cost_center' def autoname(self): diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher.js b/erpnext/accounts/doctype/journal_voucher/journal_voucher.js index e8e513d0a2..b1aa70bcee 100644 --- a/erpnext/accounts/doctype/journal_voucher/journal_voucher.js +++ b/erpnext/accounts/doctype/journal_voucher/journal_voucher.js @@ -8,22 +8,22 @@ erpnext.accounts.JournalVoucher = frappe.ui.form.Controller.extend({ this.load_defaults(); this.setup_queries(); }, - + load_defaults: function() { if(this.frm.doc.__islocal && this.frm.doc.company) { frappe.model.set_default_values(this.frm.doc); - $.each(this.frm.doc.entries, function(i, jvd) { + $.each(this.frm.doc.entries || [], function(i, jvd) { frappe.model.set_default_values(jvd); } ); - + if(!this.frm.doc.amended_from) this.frm.doc.posting_date = get_today(); } }, - + setup_queries: function() { var me = this; - + $.each(["account", "cost_center"], function(i, fieldname) { me.frm.set_query(fieldname, "entries", function() { frappe.model.validate_missing(me.frm.doc, "company"); @@ -35,8 +35,8 @@ erpnext.accounts.JournalVoucher = frappe.ui.form.Controller.extend({ }; }); }); - - $.each([["against_voucher", "Purchase Invoice", "credit_to"], + + $.each([["against_voucher", "Purchase Invoice", "credit_to"], ["against_invoice", "Sales Invoice", "debit_to"]], function(i, opts) { me.frm.set_query(opts[0], "entries", function(doc, cdt, cdn) { var jvd = frappe.get_doc(cdt, cdn); @@ -50,49 +50,49 @@ erpnext.accounts.JournalVoucher = frappe.ui.form.Controller.extend({ }; }); }); - + this.frm.set_query("against_jv", "entries", function(doc, cdt, cdn) { var jvd = frappe.get_doc(cdt, cdn); frappe.model.validate_missing(jvd, "account"); - + return { query: "accounts.doctype.journal_voucher.journal_voucher.get_against_jv", filters: { account: jvd.account } }; }); }, - + against_voucher: function(doc, cdt, cdn) { var d = frappe.get_doc(cdt, cdn); if (d.against_voucher && !flt(d.debit)) { this.get_outstanding({ - 'doctype': 'Purchase Invoice', + 'doctype': 'Purchase Invoice', 'docname': d.against_voucher }, d) } }, - + against_invoice: function(doc, cdt, cdn) { var d = frappe.get_doc(cdt, cdn); if (d.against_invoice && !flt(d.credit)) { this.get_outstanding({ - 'doctype': 'Sales Invoice', + 'doctype': 'Sales Invoice', 'docname': d.against_invoice }, d) } }, - + against_jv: function(doc, cdt, cdn) { var d = frappe.get_doc(cdt, cdn); if (d.against_jv && !flt(d.credit) && !flt(d.debit)) { this.get_outstanding({ - 'doctype': 'Journal Voucher', + 'doctype': 'Journal Voucher', 'docname': d.against_jv, 'account': d.account }, d) } }, - + get_outstanding: function(args, child) { var me = this; return this.frm.call({ @@ -104,7 +104,7 @@ erpnext.accounts.JournalVoucher = frappe.ui.form.Controller.extend({ } }); } - + }); cur_frm.script_manager.make(erpnext.accounts.JournalVoucher); @@ -113,7 +113,7 @@ cur_frm.cscript.refresh = function(doc) { cur_frm.cscript.is_opening(doc) erpnext.hide_naming_series(); cur_frm.cscript.voucher_type(doc); - if(doc.docstatus==1) { + if(doc.docstatus==1) { cur_frm.appframe.add_button(frappe._('View Ledger'), function() { frappe.route_options = { "voucher_no": doc.name, @@ -154,7 +154,7 @@ cur_frm.cscript.debit = function(doc,dt,dn) { cur_frm.cscript.update_totals(doc) cur_frm.cscript.credit = function(doc,dt,dn) { cur_frm.cscript.update_totals(doc); } cur_frm.cscript.get_balance = function(doc,dt,dn) { - cur_frm.cscript.update_totals(doc); + cur_frm.cscript.update_totals(doc); return $c_obj(cur_frm.doc, 'get_balance', '', function(r, rt){ cur_frm.refresh(); }); @@ -174,7 +174,7 @@ cur_frm.cscript.account = function(doc,dt,dn) { } }); } -} +} cur_frm.cscript.validate = function(doc,cdt,cdn) { cur_frm.cscript.update_totals(doc); @@ -195,7 +195,7 @@ cur_frm.cscript.voucher_type = function(doc, cdt, cdn) { if((doc.entries || []).length!==0 || !doc.company) // too early return; - + var update_jv_details = function(doc, r) { $.each(r.message, function(i, d) { var jvdetail = frappe.model.add_child(doc, "Journal Voucher Detail", "entries"); @@ -204,7 +204,7 @@ cur_frm.cscript.voucher_type = function(doc, cdt, cdn) { }); refresh_field("entries"); } - + if(in_list(["Bank Voucher", "Cash Voucher"], doc.voucher_type)) { return frappe.call({ type: "GET", @@ -227,7 +227,7 @@ cur_frm.cscript.voucher_type = function(doc, cdt, cdn) { "company": doc.company }, callback: function(r) { - frappe.model.clear_table("Journal Voucher Detail", "Journal Voucher", + frappe.model.clear_table("Journal Voucher Detail", "Journal Voucher", doc.name, "entries"); if(r.message) { update_jv_details(doc, r); @@ -236,4 +236,4 @@ cur_frm.cscript.voucher_type = function(doc, cdt, cdn) { } }) } -} \ No newline at end of file +} diff --git a/erpnext/contacts/__init__.py b/erpnext/contacts/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/contacts/doctype/__init__.py b/erpnext/contacts/doctype/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/contacts/doctype/party_type/__init__.py b/erpnext/contacts/doctype/party_type/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/contacts/doctype/party_type/party_type.json b/erpnext/contacts/doctype/party_type/party_type.json new file mode 100644 index 0000000000..b667b6e053 --- /dev/null +++ b/erpnext/contacts/doctype/party_type/party_type.json @@ -0,0 +1,302 @@ +{ + "_last_update": null, + "_user_tags": null, + "allow_attach": null, + "allow_copy": null, + "allow_email": null, + "allow_import": null, + "allow_print": null, + "allow_rename": null, + "allow_trash": null, + "autoname": "field:party_type_name", + "change_log": null, + "client_script": null, + "client_script_core": null, + "client_string": null, + "colour": null, + "creation": "2014-04-07 12:32:18.010384", + "custom": null, + "default_print_format": null, + "description": null, + "docstatus": 0, + "doctype": "DocType", + "document_type": "Master", + "dt_template": null, + "fields": [ + { + "allow_on_submit": null, + "default": null, + "depends_on": null, + "description": null, + "fieldname": "party_type_name", + "fieldtype": "Data", + "hidden": null, + "ignore_restrictions": null, + "in_filter": null, + "in_list_view": 1, + "label": "Party Type Name", + "no_column": null, + "no_copy": null, + "oldfieldname": null, + "oldfieldtype": null, + "options": null, + "permlevel": 0, + "print_hide": null, + "print_width": null, + "read_only": null, + "report_hide": null, + "reqd": 1, + "search_index": null, + "set_only_once": null, + "trigger": null, + "width": null + }, + { + "allow_on_submit": null, + "default": null, + "depends_on": null, + "description": null, + "fieldname": "parent_party_type", + "fieldtype": "Link", + "hidden": null, + "ignore_restrictions": null, + "in_filter": null, + "in_list_view": null, + "label": "Parent Party Type", + "no_column": null, + "no_copy": null, + "oldfieldname": null, + "oldfieldtype": null, + "options": "Party Type", + "permlevel": 0, + "print_hide": null, + "print_width": null, + "read_only": null, + "report_hide": null, + "reqd": null, + "search_index": null, + "set_only_once": null, + "trigger": null, + "width": null + }, + { + "allow_on_submit": null, + "default": "Yes", + "depends_on": null, + "description": null, + "fieldname": "allow_children", + "fieldtype": "Select", + "hidden": null, + "ignore_restrictions": null, + "in_filter": null, + "in_list_view": null, + "label": "Allow Children", + "no_column": null, + "no_copy": null, + "oldfieldname": null, + "oldfieldtype": null, + "options": "Yes\nNo", + "permlevel": 0, + "print_hide": null, + "print_width": null, + "read_only": null, + "report_hide": null, + "reqd": null, + "search_index": null, + "set_only_once": null, + "trigger": null, + "width": null + }, + { + "allow_on_submit": null, + "default": null, + "depends_on": null, + "description": null, + "fieldname": "default_price_list", + "fieldtype": "Link", + "hidden": null, + "ignore_restrictions": null, + "in_filter": null, + "in_list_view": null, + "label": "Default Price List", + "no_column": null, + "no_copy": null, + "oldfieldname": null, + "oldfieldtype": null, + "options": "Price List", + "permlevel": 0, + "print_hide": null, + "print_width": null, + "read_only": null, + "report_hide": null, + "reqd": null, + "search_index": null, + "set_only_once": null, + "trigger": null, + "width": null + }, + { + "allow_on_submit": null, + "default": null, + "depends_on": null, + "description": null, + "fieldname": "lft", + "fieldtype": "Int", + "hidden": 1, + "ignore_restrictions": null, + "in_filter": null, + "in_list_view": null, + "label": "LFT", + "no_column": null, + "no_copy": null, + "oldfieldname": null, + "oldfieldtype": null, + "options": null, + "permlevel": 0, + "print_hide": null, + "print_width": null, + "read_only": 1, + "report_hide": null, + "reqd": null, + "search_index": 1, + "set_only_once": null, + "trigger": null, + "width": null + }, + { + "allow_on_submit": null, + "default": null, + "depends_on": null, + "description": null, + "fieldname": "rgt", + "fieldtype": "Int", + "hidden": 1, + "ignore_restrictions": null, + "in_filter": null, + "in_list_view": null, + "label": "RGT", + "no_column": null, + "no_copy": null, + "oldfieldname": null, + "oldfieldtype": null, + "options": null, + "permlevel": 0, + "print_hide": null, + "print_width": null, + "read_only": 1, + "report_hide": null, + "reqd": null, + "search_index": 1, + "set_only_once": null, + "trigger": null, + "width": null + }, + { + "allow_on_submit": null, + "default": null, + "depends_on": null, + "description": null, + "fieldname": "old_parent", + "fieldtype": "Data", + "hidden": 1, + "ignore_restrictions": null, + "in_filter": null, + "in_list_view": null, + "label": "Old Parent", + "no_column": null, + "no_copy": null, + "oldfieldname": null, + "oldfieldtype": null, + "options": null, + "permlevel": 0, + "print_hide": null, + "print_width": null, + "read_only": 1, + "report_hide": null, + "reqd": null, + "search_index": null, + "set_only_once": null, + "trigger": null, + "width": null + } + ], + "hide_heading": null, + "hide_toolbar": null, + "icon": null, + "idx": null, + "in_create": null, + "in_dialog": null, + "is_submittable": null, + "is_transaction_doc": null, + "issingle": null, + "istable": null, + "max_attachments": null, + "menu_index": null, + "modified": "2014-04-07 12:54:46.254776", + "modified_by": "Administrator", + "module": "Contacts", + "name": "Party Type", + "name_case": null, + "owner": "Administrator", + "parent": null, + "parent_node": null, + "parentfield": null, + "parenttype": null, + "permissions": [ + { + "amend": null, + "cancel": null, + "create": 1, + "delete": null, + "email": null, + "export": null, + "import": null, + "match": null, + "permlevel": 0, + "print": null, + "read": 1, + "report": null, + "restrict": null, + "restricted": null, + "role": "Sales User", + "submit": null, + "write": 1 + }, + { + "amend": null, + "cancel": null, + "create": 1, + "delete": null, + "email": null, + "export": null, + "import": null, + "match": null, + "permlevel": 0, + "print": null, + "read": 1, + "report": null, + "restrict": null, + "restricted": null, + "role": "Purchase User", + "submit": null, + "write": 1 + } + ], + "plugin": null, + "print_outline": null, + "read_only": null, + "read_only_onload": null, + "search_fields": null, + "section_style": null, + "server_code": null, + "server_code_compiled": null, + "server_code_core": null, + "server_code_error": null, + "show_in_menu": null, + "smallicon": null, + "subject": null, + "tag_fields": null, + "title_field": null, + "use_template": null, + "version": null +} \ No newline at end of file diff --git a/erpnext/contacts/doctype/party_type/party_type.py b/erpnext/contacts/doctype/party_type/party_type.py new file mode 100644 index 0000000000..3f752edc5b --- /dev/null +++ b/erpnext/contacts/doctype/party_type/party_type.py @@ -0,0 +1,9 @@ +# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors +# For license information, please see license.txt + +from __future__ import unicode_literals +import frappe +from frappe.utils.nestedset import NestedSet + +class PartyType(NestedSet): + nsm_parent_field = 'parent_party_type'; diff --git a/erpnext/modules.txt b/erpnext/modules.txt index f7857e4334..92614d87e5 100644 --- a/erpnext/modules.txt +++ b/erpnext/modules.txt @@ -8,4 +8,5 @@ selling setup stock support -utilities \ No newline at end of file +utilities +contacts diff --git a/erpnext/setup/doctype/customer_group/customer_group.py b/erpnext/setup/doctype/customer_group/customer_group.py index 444356752d..11a15faae3 100644 --- a/erpnext/setup/doctype/customer_group/customer_group.py +++ b/erpnext/setup/doctype/customer_group/customer_group.py @@ -6,8 +6,8 @@ import frappe from frappe import msgprint -from frappe.utils.nestedset import DocTypeNestedSet -class CustomerGroup(DocTypeNestedSet): +from frappe.utils.nestedset import NestedSet +class CustomerGroup(NestedSet): nsm_parent_field = 'parent_customer_group'; def validate(self): diff --git a/erpnext/setup/doctype/item_group/item_group.py b/erpnext/setup/doctype/item_group/item_group.py index e1f79a570b..e744ae2418 100644 --- a/erpnext/setup/doctype/item_group/item_group.py +++ b/erpnext/setup/doctype/item_group/item_group.py @@ -4,9 +4,9 @@ from __future__ import unicode_literals import frappe -from frappe.utils.nestedset import DocTypeNestedSet +from frappe.utils.nestedset import NestedSet -class ItemGroup(DocTypeNestedSet): +class ItemGroup(NestedSet): nsm_parent_field = 'parent_item_group' def validate(self): @@ -15,7 +15,7 @@ class ItemGroup(DocTypeNestedSet): self.parent_item_group) def on_update(self): - DocTypeNestedSet.on_update(self) + NestedSet.on_update(self) self.validate_name_with_item() diff --git a/erpnext/setup/doctype/sales_person/sales_person.py b/erpnext/setup/doctype/sales_person/sales_person.py index 7f87210651..6389722349 100644 --- a/erpnext/setup/doctype/sales_person/sales_person.py +++ b/erpnext/setup/doctype/sales_person/sales_person.py @@ -5,9 +5,9 @@ from __future__ import unicode_literals import frappe from frappe.utils import flt -from frappe.utils.nestedset import DocTypeNestedSet +from frappe.utils.nestedset import NestedSet -class SalesPerson(DocTypeNestedSet): +class SalesPerson(NestedSet): nsm_parent_field = 'parent_sales_person'; def validate(self): diff --git a/erpnext/setup/doctype/territory/territory.py b/erpnext/setup/doctype/territory/territory.py index a015644e64..83eae91c37 100644 --- a/erpnext/setup/doctype/territory/territory.py +++ b/erpnext/setup/doctype/territory/territory.py @@ -7,9 +7,9 @@ import frappe from frappe.utils import flt -from frappe.utils.nestedset import DocTypeNestedSet +from frappe.utils.nestedset import NestedSet -class Territory(DocTypeNestedSet): +class Territory(NestedSet): nsm_parent_field = 'parent_territory' def validate(self): diff --git a/erpnext/setup/page/setup_wizard/setup_wizard.py b/erpnext/setup/page/setup_wizard/setup_wizard.py index 3f52463610..2bd906f1c2 100644 --- a/erpnext/setup/page/setup_wizard/setup_wizard.py +++ b/erpnext/setup/page/setup_wizard/setup_wizard.py @@ -12,13 +12,13 @@ from frappe.utils.file_manager import save_file def setup_account(args=None): # if frappe.db.sql("select name from tabCompany"): # frappe.throw(_("Setup Already Complete!!")) - + if not args: args = frappe.local.form_dict if isinstance(args, basestring): args = json.loads(args) args = frappe._dict(args) - + update_user_name(args) create_fiscal_year_and_company(args) set_defaults(args) @@ -35,12 +35,12 @@ def setup_account(args=None): frappe.clear_cache() frappe.db.commit() - + # suppress msgprints frappe.local.message_log = [] return "okay" - + def update_user_name(args): if args.get("email"): args['name'] = args.get("email") @@ -59,18 +59,18 @@ def update_user_name(args): args['name'] = frappe.session.user # Update User - if not args.get('last_name') or args.get('last_name')=='None': + if not args.get('last_name') or args.get('last_name')=='None': args['last_name'] = None frappe.db.sql("""update `tabUser` SET first_name=%(first_name)s, last_name=%(last_name)s WHERE name=%(name)s""", args) - + if args.get("attach_user"): filename, filetype, content = args.get("attach_user").split(",") fileurl = save_file(filename, content, "User", args.get("name"), decode=True).file_name frappe.db.set_value("User", args.get("name"), "user_image", fileurl) - + add_all_roles_to(args.get("name")) - + def create_fiscal_year_and_company(args): curr_fiscal_year = get_fy_details(args.get('fy_start_date'), args.get('fy_end_date')) frappe.get_doc({ @@ -91,9 +91,9 @@ def create_fiscal_year_and_company(args): 'country': args.get('country'), 'chart_of_accounts': args.get(('chart_of_accounts')), }).insert() - + args["curr_fiscal_year"] = curr_fiscal_year - + def create_price_lists(args): for pl_type in ["Selling", "Buying"]: frappe.get_doc({ @@ -107,11 +107,11 @@ def create_price_lists(args): "territory": "All Territories" } }).insert() - + def set_defaults(args): # enable default currency frappe.db.set_value("Currency", args.get("currency"), "enabled", 1) - + global_defaults = frappe.get_doc("Global Defaults", "Global Defaults") global_defaults.update({ 'current_fiscal_year': args.curr_fiscal_year, @@ -123,7 +123,7 @@ def set_defaults(args): "time_zone": args.get("time_zone") }) global_defaults.save() - + accounts_settings = frappe.get_doc("Accounts Settings") accounts_settings.auto_accounting_for_stock = 1 accounts_settings.save() @@ -134,7 +134,7 @@ def set_defaults(args): stock_settings.stock_uom = "Nos" stock_settings.auto_indent = 1 stock_settings.save() - + selling_settings = frappe.get_doc("Selling Settings") selling_settings.cust_master_name = "Customer Name" selling_settings.so_required = "No" @@ -164,7 +164,7 @@ def set_defaults(args): # default frappe.db.set_default("company_name", args["company_name"]) - + def create_feed_and_todo(): """update activty feed and create todo for creation of item, customer, vendor""" from erpnext.home import make_feed @@ -174,9 +174,9 @@ def create_feed_and_todo(): def create_email_digest(): from frappe.utils.user import get_system_managers system_managers = get_system_managers(only_name=True) - if not system_managers: + if not system_managers: return - + companies = frappe.db.sql_list("select name FROM `tabCompany`") for company in companies: if not frappe.db.exists("Email Digest", "Default Weekly Digest - " + company): @@ -188,12 +188,12 @@ def create_email_digest(): "recipient_list": "\n".join(system_managers) }) - for fieldname in edigest.meta.get_fieldnames({"fieldtype": "Check"}): + for fieldname in edigest.meta.get("fields", {"fieldtype": "Check"}): if fieldname != "scheduler_errors": edigest.set(fieldname, 1) - + edigest.insert() - + # scheduler errors digest if companies: edigest = frappe.new_doc("Email Digest") @@ -206,7 +206,7 @@ def create_email_digest(): "enabled": 1 }) edigest.insert() - + def get_fy_details(fy_start_date, fy_end_date): start_year = getdate(fy_start_date).year if start_year == getdate(fy_end_date).year: @@ -245,12 +245,12 @@ def create_items(args): "stock_uom": args.get("item_uom_" + str(i)), "default_warehouse": item_group!="Service" and ("Finished Goods - " + args.get("company_abbr")) or "" }).insert() - + if args.get("item_img_" + str(i)): filename, filetype, content = args.get("item_img_" + str(i)).split(",") fileurl = save_file(filename, content, "Item", item, decode=True).file_name frappe.db.set_value("Item", item, "image", fileurl) - + for i in xrange(1,6): item = args.get("item_buy_" + str(i)) if item: @@ -266,7 +266,7 @@ def create_items(args): "stock_uom": args.get("item_buy_uom_" + str(i)), "default_warehouse": item_group!="Service" and ("Stores - " + args.get("company_abbr")) or "" }).insert() - + if args.get("item_img_" + str(i)): filename, filetype, content = args.get("item_img_" + str(i)).split(",") fileurl = save_file(filename, content, "Item", item, decode=True).file_name @@ -285,7 +285,7 @@ def create_customers(args): "territory": args.get("country"), "company": args.get("company_name") }).insert() - + if args.get("customer_contact_" + str(i)): contact = args.get("customer_contact_" + str(i)).split(" ") frappe.get_doc({ @@ -294,7 +294,7 @@ def create_customers(args): "first_name":contact[0], "last_name": len(contact) > 1 and contact[1] or "" }).insert() - + def create_suppliers(args): for i in xrange(1,6): supplier = args.get("supplier_" + str(i)) @@ -323,11 +323,11 @@ def create_letter_head(args): "letter_head_name": "Standard", "is_default": 1 }).insert() - + filename, filetype, content = args.get("attach_letterhead").split(",") fileurl = save_file(filename, content, "Letter Head", "Standard", decode=True).file_name frappe.db.set_value("Letter Head", "Standard", "content", "" % fileurl) - + def add_all_roles_to(name): user = frappe.get_doc("User", name) for role in frappe.db.sql("""select name from tabRole"""): @@ -348,4 +348,4 @@ def create_territories(): "territory_name": name.replace("'", ""), "parent_territory": root_territory, "is_group": "No" - }).insert() \ No newline at end of file + }).insert() From 088dec6c0967eb5a0b3d171c31702a45206b3714 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 7 Apr 2014 16:00:28 +0530 Subject: [PATCH 35/42] testcase fixes #478 --- erpnext/selling/doctype/lead/lead.py | 10 +- .../selling/doctype/quotation/quotation.py | 4 +- .../material_request/material_request.py | 180 +++++++++--------- .../material_request/test_material_request.py | 130 ++++++------- 4 files changed, 162 insertions(+), 162 deletions(-) diff --git a/erpnext/selling/doctype/lead/lead.py b/erpnext/selling/doctype/lead/lead.py index 2c16a1d7e0..57e73d09b4 100644 --- a/erpnext/selling/doctype/lead/lead.py +++ b/erpnext/selling/doctype/lead/lead.py @@ -77,13 +77,13 @@ def _make_customer(source_name, target_doc=None, ignore_permissions=False): def set_missing_values(source, target): if source.company_name: - target[0].customer_type = "Company" - target[0].customer_name = source.company_name + target.customer_type = "Company" + target.customer_name = source.company_name else: - target[0].customer_type = "Individual" - target[0].customer_name = source.lead_name + target.customer_type = "Individual" + target.customer_name = source.lead_name - target[0].customer_group = frappe.db.get_default("customer_group") + target.customer_group = frappe.db.get_default("customer_group") doclist = get_mapped_doc("Lead", source_name, {"Lead": { diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py index 45a9d0bf32..f5c2050e64 100644 --- a/erpnext/selling/doctype/quotation/quotation.py +++ b/erpnext/selling/doctype/quotation/quotation.py @@ -105,8 +105,8 @@ def _make_sales_order(source_name, target_doc=None, ignore_permissions=False): def set_missing_values(source, target): if customer: - target[0].customer = customer.name - target[0].customer_name = customer.customer_name + target.customer = customer.name + target.customer_name = customer.customer_name si = frappe.get_doc(target) si.ignore_permissions = ignore_permissions diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py index 756f540db3..2b3a5fa116 100644 --- a/erpnext/stock/doctype/material_request/material_request.py +++ b/erpnext/stock/doctype/material_request/material_request.py @@ -29,84 +29,84 @@ class MaterialRequest(BuyingController): so_items[d.sales_order_no][d.item_code] = flt(d.qty) else: so_items[d.sales_order_no][d.item_code] += flt(d.qty) - + for so_no in so_items.keys(): for item in so_items[so_no].keys(): - already_indented = frappe.db.sql("""select sum(ifnull(qty, 0)) - from `tabMaterial Request Item` - where item_code = %s and sales_order_no = %s and + already_indented = frappe.db.sql("""select sum(ifnull(qty, 0)) + from `tabMaterial Request Item` + where item_code = %s and sales_order_no = %s and docstatus = 1 and parent != %s""", (item, so_no, self.name)) already_indented = already_indented and flt(already_indented[0][0]) or 0 - - actual_so_qty = frappe.db.sql("""select sum(ifnull(qty, 0)) from `tabSales Order Item` + + actual_so_qty = frappe.db.sql("""select sum(ifnull(qty, 0)) from `tabSales Order Item` where parent = %s and item_code = %s and docstatus = 1""", (so_no, item)) actual_so_qty = actual_so_qty and flt(actual_so_qty[0][0]) or 0 - + if actual_so_qty and (flt(so_items[so_no][item]) + already_indented > actual_so_qty): frappe.throw("You can raise indent of maximum qty: %s for item: %s against sales order: %s\ \n Anyway, you can add more qty in new row for the same item." % (actual_so_qty - already_indented, item, so_no)) - + def validate_schedule_date(self): for d in self.get('indent_details'): if d.schedule_date < self.transaction_date: frappe.throw(_("Expected Date cannot be before Material Request Date")) - + # Validate # --------------------- def validate(self): super(MaterialRequest, self).validate() - + self.validate_schedule_date() self.validate_uom_is_integer("uom", "qty") - + if not self.status: self.status = "Draft" from erpnext.utilities import validate_status validate_status(self.status, ["Draft", "Submitted", "Stopped", "Cancelled"]) - + self.validate_value("material_request_type", "in", ["Purchase", "Transfer"]) pc_obj = frappe.get_doc('Purchase Common') pc_obj.validate_for_items(self) - + # self.validate_qty_against_so() # NOTE: Since Item BOM and FG quantities are combined, using current data, it cannot be validated # Though the creation of Material Request from a Production Plan can be rethought to fix this - + def update_bin(self, is_submit, is_stopped): """ Update Quantity Requested for Purchase in Bin for Material Request of type 'Purchase'""" - + from erpnext.stock.utils import update_bin for d in self.get('indent_details'): if frappe.db.get_value("Item", d.item_code, "is_stock_item") == "Yes": if not d.warehouse: - frappe.throw("Please Enter Warehouse for Item %s as it is stock item" + frappe.throw("Please Enter Warehouse for Item %s as it is stock item" % cstr(d.item_code)) - + qty =flt(d.qty) if is_stopped: qty = (d.qty > d.ordered_qty) and flt(flt(d.qty) - flt(d.ordered_qty)) or 0 - + args = { "item_code": d.item_code, "warehouse": d.warehouse, "indented_qty": (is_submit and 1 or -1) * flt(qty), "posting_date": self.transaction_date } - update_bin(args) - + update_bin(args) + def on_submit(self): frappe.db.set(self, 'status', 'Submitted') self.update_bin(is_submit = 1, is_stopped = 0) - + def check_modified_date(self): - mod_db = frappe.db.sql("""select modified from `tabMaterial Request` where name = %s""", + mod_db = frappe.db.sql("""select modified from `tabMaterial Request` where name = %s""", self.name) date_diff = frappe.db.sql("""select TIMEDIFF('%s', '%s')""" % (mod_db[0][0], cstr(self.modified))) - + if date_diff and date_diff[0][0]: frappe.throw(cstr(self.doctype) + " => " + cstr(self.name) + " has been modified. Please Refresh.") @@ -115,93 +115,93 @@ class MaterialRequest(BuyingController): # Step 1:=> Update Bin self.update_bin(is_submit = (status == 'Submitted') and 1 or 0, is_stopped = 1) - # Step 2:=> Set status + # Step 2:=> Set status frappe.db.set(self, 'status', cstr(status)) - + # Step 3:=> Acknowledge User msgprint(self.doctype + ": " + self.name + " has been %s." % ((status == 'Submitted') and 'Unstopped' or cstr(status))) - + def on_cancel(self): # Step 1:=> Get Purchase Common Obj pc_obj = frappe.get_doc('Purchase Common') - + # Step 2:=> Check for stopped status pc_obj.check_for_stopped_status(self.doctype, self.name) - + # Step 3:=> Check if Purchase Order has been submitted against current Material Request pc_obj.check_docstatus(check = 'Next', doctype = 'Purchase Order', docname = self.name, detail_doctype = 'Purchase Order Item') # Step 4:=> Update Bin self.update_bin(is_submit = 0, is_stopped = (cstr(self.status) == 'Stopped') and 1 or 0) - + # Step 5:=> Set Status frappe.db.set(self,'status','Cancelled') - + def update_completed_qty(self, mr_items=None): if self.material_request_type != "Transfer": return - + item_doclist = self.get("indent_details") - + if not mr_items: mr_items = [d.name for d in item_doclist] - + per_ordered = 0.0 for d in item_doclist: if d.name in mr_items: - d.ordered_qty = flt(frappe.db.sql("""select sum(transfer_qty) - from `tabStock Entry Detail` where material_request = %s - and material_request_item = %s and docstatus = 1""", + d.ordered_qty = flt(frappe.db.sql("""select sum(transfer_qty) + from `tabStock Entry Detail` where material_request = %s + and material_request_item = %s and docstatus = 1""", (self.name, d.name))[0][0]) frappe.db.set_value(d.doctype, d.name, "ordered_qty", d.ordered_qty) - + # note: if qty is 0, its row is still counted in len(item_doclist) # hence adding 1 to per_ordered if (d.ordered_qty > d.qty) or not d.qty: per_ordered += 1.0 elif d.qty > 0: per_ordered += flt(d.ordered_qty / flt(d.qty)) - + self.per_ordered = flt((per_ordered / flt(len(item_doclist))) * 100.0, 2) frappe.db.set_value(self.doctype, self.name, "per_ordered", self.per_ordered) - + def update_completed_qty(doc, method): if doc.doctype == "Stock Entry": material_request_map = {} - + for d in doc.get("mtn_details"): if d.material_request: material_request_map.setdefault(d.material_request, []).append(d.material_request_item) - + for mr_name, mr_items in material_request_map.items(): mr_obj = frappe.get_doc("Material Request", mr_name) mr_doctype = frappe.get_meta("Material Request") - + if mr_obj.status in ["Stopped", "Cancelled"]: - frappe.throw(_("Material Request") + ": %s, " % mr_obj.name + frappe.throw(_("Material Request") + ": %s, " % mr_obj.name + _(mr_doctype.get_label("status")) + " = %s. " % _(mr_obj.status) + _("Cannot continue."), exc=frappe.InvalidStatusError) - + _update_requested_qty(doc, mr_obj, mr_items) - + # update ordered percentage and qty mr_obj.update_completed_qty(mr_items) - + def _update_requested_qty(doc, mr_obj, mr_items): """update requested qty (before ordered_qty is updated)""" from erpnext.stock.utils import update_bin for mr_item_name in mr_items: mr_item = mr_obj.get("indent_details", {"name": mr_item_name}) - se_detail = doc.get("mtn_details", {"material_request": mr_obj.name, + se_detail = doc.get("mtn_details", {"material_request": mr_obj.name, "material_request_item": mr_item_name}) - + if mr_item and se_detail: mr_item = mr_item[0] se_detail = se_detail[0] mr_item.ordered_qty = flt(mr_item.ordered_qty) mr_item.qty = flt(mr_item.qty) se_detail.transfer_qty = flt(se_detail.transfer_qty) - + if se_detail.docstatus == 2 and mr_item.ordered_qty > mr_item.qty \ and se_detail.transfer_qty == mr_item.ordered_qty: add_indented_qty = mr_item.qty @@ -210,7 +210,7 @@ def _update_requested_qty(doc, mr_obj, mr_items): add_indented_qty = mr_item.qty - mr_item.ordered_qty else: add_indented_qty = se_detail.transfer_qty - + update_bin({ "item_code": se_detail.item_code, "warehouse": se_detail.t_warehouse, @@ -221,7 +221,7 @@ def _update_requested_qty(doc, mr_obj, mr_items): def set_missing_values(source, target_doc): po = frappe.get_doc(target_doc) po.run_method("set_missing_values") - + def update_item(obj, target, source_parent): target.conversion_factor = 1 target.qty = flt(obj.qty) - flt(obj.ordered_qty) @@ -232,18 +232,18 @@ def make_purchase_order(source_name, target_doc=None): doclist = get_mapped_doc("Material Request", source_name, { "Material Request": { - "doctype": "Purchase Order", + "doctype": "Purchase Order", "validation": { "docstatus": ["=", 1], "material_request_type": ["=", "Purchase"] } - }, + }, "Material Request Item": { - "doctype": "Purchase Order Item", + "doctype": "Purchase Order Item", "field_map": [ - ["name", "prevdoc_detail_docname"], - ["parent", "prevdoc_docname"], - ["parenttype", "prevdoc_doctype"], + ["name", "prevdoc_detail_docname"], + ["parent", "prevdoc_docname"], + ["parenttype", "prevdoc_doctype"], ["uom", "stock_uom"], ["uom", "uom"] ], @@ -252,7 +252,7 @@ def make_purchase_order(source_name, target_doc=None): }, target_doc, set_missing_values) return doclist.as_dict() - + @frappe.whitelist() def make_purchase_order_based_on_supplier(source_name, target_doc=None): from frappe.model.mapper import get_mapped_doc @@ -261,44 +261,44 @@ def make_purchase_order_based_on_supplier(source_name, target_doc=None): import json target_doc = frappe.get_doc(json.loads(target_doc)) target_doc = target_doc.get({"parentfield": ["!=", "po_details"]}) - + material_requests, supplier_items = get_material_requests_based_on_supplier(source_name) - + def postprocess(source, target_doc): target_doc[0].supplier = source_name set_missing_values(source, target_doc) - + po_items = target_doc.get({"parentfield": "po_details"}) target_doc = target_doc.get({"parentfield": ["!=", "po_details"]}) + \ - [d for d in po_items + [d for d in po_items if d.get("item_code") in supplier_items and d.get("qty") > 0] - + return target_doc - + for mr in material_requests: target_doc = get_mapped_doc("Material Request", mr, { "Material Request": { - "doctype": "Purchase Order", - }, + "doctype": "Purchase Order", + }, "Material Request Item": { - "doctype": "Purchase Order Item", + "doctype": "Purchase Order Item", "field_map": [ - ["name", "prevdoc_detail_docname"], - ["parent", "prevdoc_docname"], - ["parenttype", "prevdoc_doctype"], + ["name", "prevdoc_detail_docname"], + ["parent", "prevdoc_docname"], + ["parenttype", "prevdoc_doctype"], ["uom", "stock_uom"], ["uom", "uom"] ], "postprocess": update_item } }, target_doc, postprocess) - + return target_doc.as_dict() - + def get_material_requests_based_on_supplier(supplier): - supplier_items = [d[0] for d in frappe.db.get_values("Item", + supplier_items = [d[0] for d in frappe.db.get_values("Item", {"default_supplier": supplier})] - material_requests = frappe.db.sql_list("""select distinct mr.name + material_requests = frappe.db.sql_list("""select distinct mr.name from `tabMaterial Request` mr, `tabMaterial Request Item` mr_item where mr.name = mr_item.parent and mr_item.item_code in (%s) @@ -308,59 +308,59 @@ def get_material_requests_based_on_supplier(supplier): and mr.status != 'Stopped'""" % ', '.join(['%s']*len(supplier_items)), tuple(supplier_items)) return material_requests, supplier_items - + @frappe.whitelist() def make_supplier_quotation(source_name, target_doc=None): from frappe.model.mapper import get_mapped_doc doclist = get_mapped_doc("Material Request", source_name, { "Material Request": { - "doctype": "Supplier Quotation", + "doctype": "Supplier Quotation", "validation": { "docstatus": ["=", 1], "material_request_type": ["=", "Purchase"] } - }, + }, "Material Request Item": { - "doctype": "Supplier Quotation Item", + "doctype": "Supplier Quotation Item", "field_map": { - "name": "prevdoc_detail_docname", - "parent": "prevdoc_docname", + "name": "prevdoc_detail_docname", + "parent": "prevdoc_docname", "parenttype": "prevdoc_doctype" } } }, target_doc, set_missing_values) return doclist.as_dict() - + @frappe.whitelist() def make_stock_entry(source_name, target_doc=None): from frappe.model.mapper import get_mapped_doc - + def update_item(obj, target, source_parent): target.conversion_factor = 1 target.qty = flt(obj.qty) - flt(obj.ordered_qty) target.transfer_qty = flt(obj.qty) - flt(obj.ordered_qty) - + def set_missing_values(source, target): - target[0].purpose = "Material Transfer" + target.purpose = "Material Transfer" se = frappe.get_doc(target) se.run_method("get_stock_and_rate") doclist = get_mapped_doc("Material Request", source_name, { "Material Request": { - "doctype": "Stock Entry", + "doctype": "Stock Entry", "validation": { "docstatus": ["=", 1], "material_request_type": ["=", "Transfer"] } - }, + }, "Material Request Item": { - "doctype": "Stock Entry Detail", + "doctype": "Stock Entry Detail", "field_map": { - "name": "material_request_item", - "parent": "material_request", - "uom": "stock_uom", + "name": "material_request_item", + "parent": "material_request", + "uom": "stock_uom", "warehouse": "t_warehouse" }, "postprocess": update_item diff --git a/erpnext/stock/doctype/material_request/test_material_request.py b/erpnext/stock/doctype/material_request/test_material_request.py index 6d10d40059..f27fadbc65 100644 --- a/erpnext/stock/doctype/material_request/test_material_request.py +++ b/erpnext/stock/doctype/material_request/test_material_request.py @@ -17,89 +17,89 @@ class TestMaterialRequest(unittest.TestCase): mr = frappe.copy_doc(test_records[0]).insert() - self.assertRaises(frappe.ValidationError, make_purchase_order, + self.assertRaises(frappe.ValidationError, make_purchase_order, mr.name) mr = frappe.get_doc("Material Request", mr.name) mr.submit() po = make_purchase_order(mr.name) - + self.assertEquals(po[0]["doctype"], "Purchase Order") self.assertEquals(len(po), len(mr)) - + def test_make_supplier_quotation(self): from erpnext.stock.doctype.material_request.material_request import make_supplier_quotation mr = frappe.copy_doc(test_records[0]).insert() - self.assertRaises(frappe.ValidationError, make_supplier_quotation, + self.assertRaises(frappe.ValidationError, make_supplier_quotation, mr.name) mr = frappe.get_doc("Material Request", mr.name) mr.submit() sq = make_supplier_quotation(mr.name) - + self.assertEquals(sq[0]["doctype"], "Supplier Quotation") self.assertEquals(len(sq), len(mr)) - - + + def test_make_stock_entry(self): from erpnext.stock.doctype.material_request.material_request import make_stock_entry mr = frappe.copy_doc(test_records[0]).insert() - self.assertRaises(frappe.ValidationError, make_stock_entry, + self.assertRaises(frappe.ValidationError, make_stock_entry, mr.name) mr = frappe.get_doc("Material Request", mr.name) mr.material_request_type = "Transfer" mr.submit() se = make_stock_entry(mr.name) - + self.assertEquals(se[0]["doctype"], "Stock Entry") self.assertEquals(len(se), len(mr)) - + def _test_expected(self, doc, expected_values): for i, expected in enumerate(expected_values): for fieldname, val in expected.items(): - self.assertEquals(val, doc[i].get(fieldname)) - + self.assertEquals(val, doc.get(fieldname)) + def _test_requested_qty(self, qty1, qty2): self.assertEqual(flt(frappe.db.get_value("Bin", {"item_code": "_Test Item Home Desktop 100", "warehouse": "_Test Warehouse - _TC"}, "indented_qty")), qty1) self.assertEqual(flt(frappe.db.get_value("Bin", {"item_code": "_Test Item Home Desktop 200", "warehouse": "_Test Warehouse - _TC"}, "indented_qty")), qty2) - + def _insert_stock_entry(self, qty1, qty2): se = frappe.get_doc({ - "company": "_Test Company", - "doctype": "Stock Entry", - "posting_date": "2013-03-01", - "posting_time": "00:00:00", + "company": "_Test Company", + "doctype": "Stock Entry", + "posting_date": "2013-03-01", + "posting_time": "00:00:00", "purpose": "Material Receipt", "fiscal_year": "_Test Fiscal Year 2013", "mtn_details": [ { - "conversion_factor": 1.0, - "doctype": "Stock Entry Detail", + "conversion_factor": 1.0, + "doctype": "Stock Entry Detail", "item_code": "_Test Item Home Desktop 100", - "parentfield": "mtn_details", + "parentfield": "mtn_details", "incoming_rate": 100, - "qty": qty1, - "stock_uom": "_Test UOM 1", - "transfer_qty": qty1, + "qty": qty1, + "stock_uom": "_Test UOM 1", + "transfer_qty": qty1, "uom": "_Test UOM 1", "t_warehouse": "_Test Warehouse 1 - _TC", }, { - "conversion_factor": 1.0, - "doctype": "Stock Entry Detail", + "conversion_factor": 1.0, + "doctype": "Stock Entry Detail", "item_code": "_Test Item Home Desktop 200", - "parentfield": "mtn_details", + "parentfield": "mtn_details", "incoming_rate": 100, - "qty": qty2, - "stock_uom": "_Test UOM 1", - "transfer_qty": qty2, + "qty": qty2, + "stock_uom": "_Test UOM 1", + "transfer_qty": qty2, "uom": "_Test UOM 1", "t_warehouse": "_Test Warehouse 1 - _TC", } @@ -107,20 +107,20 @@ class TestMaterialRequest(unittest.TestCase): }) se.insert() se.submit() - + def test_completed_qty_for_purchase(self): frappe.db.sql("""delete from `tabBin`""") - + # submit material request of type Purchase mr = frappe.copy_doc(test_records[0]) mr.insert() mr.submit() - + # check if per complete is None self._test_expected(mr, [{"per_ordered": None}, {"ordered_qty": None}, {"ordered_qty": None}]) - + self._test_requested_qty(54.0, 3.0) - + # map a purchase order from erpnext.stock.doctype.material_request.material_request import make_purchase_order po_doc = make_purchase_order(mr.name) @@ -131,34 +131,34 @@ class TestMaterialRequest(unittest.TestCase): po_doc.get("po_details")[0]["schedule_date"] = "2013-07-09" po_doc.get("po_details")[1]["schedule_date"] = "2013-07-09" - + # check for stopped status of Material Request po = frappe.copy_doc(po_doc) po.insert() - mr.obj.update_status('Stopped') + mr.update_status('Stopped') self.assertRaises(frappe.ValidationError, po.submit) self.assertRaises(frappe.ValidationError, po.cancel) - mr.obj.update_status('Submitted') + mr.update_status('Submitted') po = frappe.copy_doc(po_doc) po.insert() po.submit() - + # check if per complete is as expected mr.load_from_db() self._test_expected(mr, [{"per_ordered": 50}, {"ordered_qty": 27.0}, {"ordered_qty": 1.5}]) self._test_requested_qty(27.0, 1.5) - + po.cancel() # check if per complete is as expected mr.load_from_db() self._test_expected(mr, [{"per_ordered": None}, {"ordered_qty": None}, {"ordered_qty": None}]) self._test_requested_qty(54.0, 3.0) - + def test_completed_qty_for_transfer(self): frappe.db.sql("""delete from `tabBin`""") frappe.db.sql("""delete from `tabStock Ledger Entry`""") - + # submit material request of type Purchase mr = frappe.copy_doc(test_records[0]) mr.material_request_type = "Transfer" @@ -167,11 +167,11 @@ class TestMaterialRequest(unittest.TestCase): # check if per complete is None self._test_expected(mr, [{"per_ordered": None}, {"ordered_qty": None}, {"ordered_qty": None}]) - + self._test_requested_qty(54.0, 3.0) from erpnext.stock.doctype.material_request.material_request import make_stock_entry - + # map a stock entry se_doc = make_stock_entry(mr.name) se_doc.update({ @@ -191,37 +191,37 @@ class TestMaterialRequest(unittest.TestCase): "s_warehouse": "_Test Warehouse 1 - _TC", "incoming_rate": 1.0 }) - + # make available the qty in _Test Warehouse 1 before transfer self._insert_stock_entry(27.0, 1.5) - + # check for stopped status of Material Request se = frappe.copy_doc(se_doc) se.insert() - mr.obj.update_status('Stopped') + mr.update_status('Stopped') self.assertRaises(frappe.ValidationError, se.submit) self.assertRaises(frappe.ValidationError, se.cancel) - - mr.obj.update_status('Submitted') + + mr.update_status('Submitted') se = frappe.copy_doc(se_doc) se.insert() se.submit() - + # check if per complete is as expected mr.load_from_db() self._test_expected(mr, [{"per_ordered": 50}, {"ordered_qty": 27.0}, {"ordered_qty": 1.5}]) self._test_requested_qty(27.0, 1.5) - + # check if per complete is as expected for Stock Entry cancelled se.cancel() mr.load_from_db() self._test_expected(mr, [{"per_ordered": 0}, {"ordered_qty": 0}, {"ordered_qty": 0}]) self._test_requested_qty(54.0, 3.0) - + def test_completed_qty_for_over_transfer(self): frappe.db.sql("""delete from `tabBin`""") frappe.db.sql("""delete from `tabStock Ledger Entry`""") - + # submit material request of type Purchase mr = frappe.copy_doc(test_records[0]) mr.material_request_type = "Transfer" @@ -230,9 +230,9 @@ class TestMaterialRequest(unittest.TestCase): # check if per complete is None self._test_expected(mr, [{"per_ordered": None}, {"ordered_qty": None}, {"ordered_qty": None}]) - + self._test_requested_qty(54.0, 3.0) - + # map a stock entry from erpnext.stock.doctype.material_request.material_request import make_stock_entry @@ -257,30 +257,30 @@ class TestMaterialRequest(unittest.TestCase): # make available the qty in _Test Warehouse 1 before transfer self._insert_stock_entry(60.0, 3.0) - + # check for stopped status of Material Request se = frappe.copy_doc(se_doc) se.insert() - mr.obj.update_status('Stopped') + mr.update_status('Stopped') self.assertRaises(frappe.ValidationError, se.submit) self.assertRaises(frappe.ValidationError, se.cancel) - - mr.obj.update_status('Submitted') + + mr.update_status('Submitted') se = frappe.copy_doc(se_doc) se.insert() se.submit() - + # check if per complete is as expected mr.load_from_db() self._test_expected(mr, [{"per_ordered": 100}, {"ordered_qty": 60.0}, {"ordered_qty": 3.0}]) self._test_requested_qty(0.0, 0.0) - + # check if per complete is as expected for Stock Entry cancelled se.cancel() mr.load_from_db() self._test_expected(mr, [{"per_ordered": 0}, {"ordered_qty": 0}, {"ordered_qty": 0}]) self._test_requested_qty(54.0, 3.0) - + def test_incorrect_mapping_of_stock_entry(self): # submit material request of type Purchase mr = frappe.copy_doc(test_records[0]) @@ -290,7 +290,7 @@ class TestMaterialRequest(unittest.TestCase): # map a stock entry from erpnext.stock.doctype.material_request.material_request import make_stock_entry - + se_doc = make_stock_entry(mr.name) se_doc.update({ "posting_date": "2013-03-01", @@ -310,11 +310,11 @@ class TestMaterialRequest(unittest.TestCase): "s_warehouse": "_Test Warehouse 1 - _TC", "incoming_rate": 1.0 }) - + # check for stopped status of Material Request se = frappe.copy_doc(se_doc) self.assertRaises(frappe.MappingMismatchError, se.insert) - + def test_warehouse_company_validation(self): from erpnext.stock.utils import InvalidWarehouseCompany mr = frappe.copy_doc(test_records[0]) @@ -322,4 +322,4 @@ class TestMaterialRequest(unittest.TestCase): self.assertRaises(InvalidWarehouseCompany, mr.insert) test_dependencies = ["Currency Exchange"] -test_records = frappe.get_test_records('Material Request') \ No newline at end of file +test_records = frappe.get_test_records('Material Request') From 103cc58cb6f665a3ad75add800637cf382b431f4 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Mon, 7 Apr 2014 16:40:43 +0530 Subject: [PATCH 36/42] material request testcase #478 --- .../doctype/material_request/material_request.py | 6 ------ .../material_request/test_material_request.py | 15 +++++++-------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py index 2b3a5fa116..bd14784076 100644 --- a/erpnext/stock/doctype/material_request/material_request.py +++ b/erpnext/stock/doctype/material_request/material_request.py @@ -112,16 +112,10 @@ class MaterialRequest(BuyingController): def update_status(self, status): self.check_modified_date() - # Step 1:=> Update Bin self.update_bin(is_submit = (status == 'Submitted') and 1 or 0, is_stopped = 1) - - # Step 2:=> Set status frappe.db.set(self, 'status', cstr(status)) - - # Step 3:=> Acknowledge User msgprint(self.doctype + ": " + self.name + " has been %s." % ((status == 'Submitted') and 'Unstopped' or cstr(status))) - def on_cancel(self): # Step 1:=> Get Purchase Common Obj pc_obj = frappe.get_doc('Purchase Common') diff --git a/erpnext/stock/doctype/material_request/test_material_request.py b/erpnext/stock/doctype/material_request/test_material_request.py index f27fadbc65..a799c3b6dd 100644 --- a/erpnext/stock/doctype/material_request/test_material_request.py +++ b/erpnext/stock/doctype/material_request/test_material_request.py @@ -24,23 +24,22 @@ class TestMaterialRequest(unittest.TestCase): mr.submit() po = make_purchase_order(mr.name) - self.assertEquals(po[0]["doctype"], "Purchase Order") - self.assertEquals(len(po), len(mr)) + self.assertEquals(po["doctype"], "Purchase Order") + self.assertEquals(len(po.get("po_details")), len(mr.get("indent_details"))) def test_make_supplier_quotation(self): from erpnext.stock.doctype.material_request.material_request import make_supplier_quotation mr = frappe.copy_doc(test_records[0]).insert() - self.assertRaises(frappe.ValidationError, make_supplier_quotation, - mr.name) + self.assertRaises(frappe.ValidationError, make_supplier_quotation, mr.name) mr = frappe.get_doc("Material Request", mr.name) mr.submit() sq = make_supplier_quotation(mr.name) - self.assertEquals(sq[0]["doctype"], "Supplier Quotation") - self.assertEquals(len(sq), len(mr)) + self.assertEquals(sq["doctype"], "Supplier Quotation") + self.assertEquals(len(sq.get("quotation_items")), len(mr.get("indent_details"))) def test_make_stock_entry(self): @@ -56,8 +55,8 @@ class TestMaterialRequest(unittest.TestCase): mr.submit() se = make_stock_entry(mr.name) - self.assertEquals(se[0]["doctype"], "Stock Entry") - self.assertEquals(len(se), len(mr)) + self.assertEquals(se["doctype"], "Stock Entry") + self.assertEquals(len(se.get("mtn_details")), len(mr.get("indent_details"))) def _test_expected(self, doc, expected_values): for i, expected in enumerate(expected_values): From 2ce39cf7705e2f7840ec666793d89220d3a4011b Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Mon, 7 Apr 2014 18:51:58 +0530 Subject: [PATCH 37/42] Fixed Stock Entry Test Cases frappe/frappe#478 --- .../journal_voucher/journal_voucher.py | 182 ++++---- .../purchase_invoice/purchase_invoice.py | 160 +++---- erpnext/controllers/stock_controller.py | 150 +++--- .../stock/doctype/stock_entry/stock_entry.py | 436 +++++++++--------- .../doctype/stock_entry/test_stock_entry.py | 43 +- .../stock_ledger_entry/stock_ledger_entry.py | 14 +- .../stock/doctype/warehouse/test_records.json | 30 +- erpnext/stock/stock_ledger.py | 12 +- erpnext/stock/utils.py | 119 +++-- 9 files changed, 573 insertions(+), 573 deletions(-) diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher.py b/erpnext/accounts/doctype/journal_voucher/journal_voucher.py index 0ba0208ecf..f11589bdf1 100644 --- a/erpnext/accounts/doctype/journal_voucher/journal_voucher.py +++ b/erpnext/accounts/doctype/journal_voucher/journal_voucher.py @@ -21,22 +21,22 @@ class JournalVoucher(AccountsController): def validate(self): if not self.is_opening: self.is_opening='No' - + self.clearance_date = None - + super(JournalVoucher, self).validate_date_with_fiscal_year() - + self.validate_debit_credit() self.validate_cheque_info() self.validate_entries_for_advance() self.validate_against_jv() - + self.set_against_account() self.create_remarks() self.set_aging_date() self.set_print_format_fields() - + def on_submit(self): if self.voucher_type in ['Bank Voucher', 'Contra Voucher', 'Journal Entry']: self.check_credit_days() @@ -46,9 +46,9 @@ class JournalVoucher(AccountsController): def on_cancel(self): from erpnext.accounts.utils import remove_against_link_from_jv remove_against_link_from_jv(self.doctype, self.name, "against_jv") - + self.make_gl_entries(1) - + def on_trash(self): pass #if self.amended_from: @@ -57,7 +57,7 @@ class JournalVoucher(AccountsController): def validate_debit_credit(self): for d in self.get('entries'): if d.debit and d.credit: - msgprint("You cannot credit and debit same account at the same time.", + msgprint("You cannot credit and debit same account at the same time.", raise_exception=1) def validate_cheque_info(self): @@ -65,7 +65,7 @@ class JournalVoucher(AccountsController): if not self.cheque_no or not self.cheque_date: msgprint("Reference No & Reference Date is required for %s" % self.voucher_type, raise_exception=1) - + if self.cheque_date and not self.cheque_no: msgprint("Reference No is mandatory if you entered Reference Date", raise_exception=1) @@ -85,11 +85,11 @@ class JournalVoucher(AccountsController): if d.against_jv == self.name: msgprint("You can not enter current voucher in 'Against JV' column", raise_exception=1) - elif not frappe.db.sql("""select name from `tabJournal Voucher Detail` - where account = %s and docstatus = 1 and parent = %s""", + elif not frappe.db.sql("""select name from `tabJournal Voucher Detail` + where account = %s and docstatus = 1 and parent = %s""", (d.account, d.against_jv)): msgprint("Against JV: %s is not valid." % d.against_jv, raise_exception=1) - + def set_against_account(self): # Debit = Credit debit, credit = 0.0, 0.0 @@ -104,9 +104,9 @@ class JournalVoucher(AccountsController): self.total_credit = credit if abs(self.total_debit-self.total_credit) > 0.001: - msgprint("Debit must be equal to Credit. The difference is %s" % + msgprint("Debit must be equal to Credit. The difference is %s" % (self.total_debit-self.total_credit), raise_exception=1) - + # update against account for d in self.get('entries'): if flt(d.debit) > 0: d.against_account = ', '.join(credit_list) @@ -114,28 +114,28 @@ class JournalVoucher(AccountsController): def create_remarks(self): r = [] - if self.cheque_no : + if self.cheque_no: if self.cheque_date: - r.append('Via Reference #%s dated %s' % + r.append('Via Reference #%s dated %s' % (self.cheque_no, formatdate(self.cheque_date))) else : msgprint("Please enter Reference date", raise_exception=1) - + for d in self.get('entries'): if d.against_invoice and d.credit: currency = frappe.db.get_value("Sales Invoice", d.against_invoice, "currency") - r.append('%s %s against Invoice: %s' % + r.append('%s %s against Invoice: %s' % (cstr(currency), fmt_money(flt(d.credit)), d.against_invoice)) - + if d.against_voucher and d.debit: - bill_no = frappe.db.sql("""select bill_no, bill_date, currency + bill_no = frappe.db.sql("""select bill_no, bill_date, currency from `tabPurchase Invoice` where name=%s""", d.against_voucher) if bill_no and bill_no[0][0] and bill_no[0][0].lower().strip() \ not in ['na', 'not applicable', 'none']: - r.append('%s %s against Bill %s dated %s' % - (cstr(bill_no[0][2]), fmt_money(flt(d.debit)), bill_no[0][0], + r.append('%s %s against Bill %s dated %s' % + (cstr(bill_no[0][2]), fmt_money(flt(d.debit)), bill_no[0][0], bill_no[0][1] and formatdate(bill_no[0][1].strftime('%Y-%m-%d')) or '')) - + if self.user_remark: r.append("User Remark : %s"%self.user_remark) @@ -157,25 +157,25 @@ class JournalVoucher(AccountsController): break # If customer/supplier account, aging date is mandatory - if exists and not self.aging_date: + if exists and not self.aging_date: msgprint("Aging Date is mandatory for opening entry", raise_exception=1) else: self.aging_date = self.posting_date def set_print_format_fields(self): for d in self.get('entries'): - account_type, master_type = frappe.db.get_value("Account", d.account, + account_type, master_type = frappe.db.get_value("Account", d.account, ["account_type", "master_type"]) - + if master_type in ['Supplier', 'Customer']: if not self.pay_to_recd_from: - self.pay_to_recd_from = frappe.db.get_value(master_type, - ' - '.join(d.account.split(' - ')[:-1]), + self.pay_to_recd_from = frappe.db.get_value(master_type, + ' - '.join(d.account.split(' - ')[:-1]), master_type == 'Customer' and 'customer_name' or 'supplier_name') - + if account_type in ['Bank', 'Cash']: company_currency = get_company_currency(self.company) - amt = flt(d.debit) and d.debit or d.credit + amt = flt(d.debit) and d.debit or d.credit self.total_amount = company_currency + ' ' + cstr(amt) from frappe.utils import money_in_words self.total_amount_in_words = money_in_words(amt, company_currency) @@ -184,29 +184,29 @@ class JournalVoucher(AccountsController): date_diff = 0 if self.cheque_date: date_diff = (getdate(self.cheque_date)-getdate(self.posting_date)).days - + if date_diff <= 0: return - + # Get List of Customer Account - acc_list = filter(lambda d: frappe.db.get_value("Account", d.account, + acc_list = filter(lambda d: frappe.db.get_value("Account", d.account, "master_type")=='Customer', self.get('entries')) - + for d in acc_list: credit_days = self.get_credit_days_for(d.account) # Check credit days if credit_days > 0 and not self.get_authorized_user() and cint(date_diff) > credit_days: msgprint("Credit Not Allowed: Cannot allow a check that is dated \ more than %s days after the posting date" % credit_days, raise_exception=1) - + def get_credit_days_for(self, ac): if not self.credit_days_for.has_key(ac): self.credit_days_for[ac] = cint(frappe.db.get_value("Account", ac, "credit_days")) if not self.credit_days_for[ac]: if self.credit_days_global==-1: - self.credit_days_global = cint(frappe.db.get_value("Company", + self.credit_days_global = cint(frappe.db.get_value("Company", self.company, "credit_days")) - + return self.credit_days_global else: return self.credit_days_for[ac] @@ -216,33 +216,33 @@ class JournalVoucher(AccountsController): self.is_approving_authority = 0 # Fetch credit controller role - approving_authority = frappe.db.get_value("Global Defaults", None, + approving_authority = frappe.db.get_value("Global Defaults", None, "credit_controller") - + # Check logged-in user is authorized if approving_authority in frappe.user.get_roles(): self.is_approving_authority = 1 - + return self.is_approving_authority def check_account_against_entries(self): for d in self.get("entries"): - if d.against_invoice and frappe.db.get_value("Sales Invoice", + if d.against_invoice and frappe.db.get_value("Sales Invoice", d.against_invoice, "debit_to") != d.account: frappe.throw(_("Row #") + cstr(d.idx) + ": " + _("Account is not matching with Debit To account of Sales Invoice")) - - if d.against_voucher and frappe.db.get_value("Purchase Invoice", + + if d.against_voucher and frappe.db.get_value("Purchase Invoice", d.against_voucher, "credit_to") != d.account: frappe.throw(_("Row #") + cstr(d.idx) + ": " + _("Account is not matching with Credit To account of Purchase Invoice")) def make_gl_entries(self, cancel=0, adv_adj=0): from erpnext.accounts.general_ledger import make_gl_entries - + if not cancel: self.check_account_against_entries() - + gl_map = [] for d in self.get("entries"): if d.debit or d.credit: @@ -252,8 +252,8 @@ class JournalVoucher(AccountsController): "against": d.against_account, "debit": d.debit, "credit": d.credit, - "against_voucher_type": ((d.against_voucher and "Purchase Invoice") - or (d.against_invoice and "Sales Invoice") + "against_voucher_type": ((d.against_voucher and "Purchase Invoice") + or (d.against_invoice and "Sales Invoice") or (d.against_jv and "Journal Voucher")), "against_voucher": d.against_voucher or d.against_invoice or d.against_jv, "remarks": self.remark, @@ -262,10 +262,10 @@ class JournalVoucher(AccountsController): ) if gl_map: make_gl_entries(gl_map, cancel=cancel, adv_adj=adv_adj) - + def check_credit_limit(self): for d in self.get("entries"): - master_type, master_name = frappe.db.get_value("Account", d.account, + master_type, master_name = frappe.db.get_value("Account", d.account, ["master_type", "master_name"]) if master_type == "Customer" and master_name: super(JournalVoucher, self).check_credit_limit(d.account) @@ -276,7 +276,7 @@ class JournalVoucher(AccountsController): else: flag, self.total_debit, self.total_credit = 0, 0, 0 diff = flt(self.difference, 2) - + # If any row without amount, set the diff on that row for d in self.get('entries'): if not d.credit and not d.debit and diff != 0: @@ -285,7 +285,7 @@ class JournalVoucher(AccountsController): elif diff<0: d.debit = diff flag = 1 - + # Set the diff in a new row if flag == 0 and diff != 0: jd = self.append('entries', {}) @@ -293,7 +293,7 @@ class JournalVoucher(AccountsController): jd.credit = abs(diff) elif diff<0: jd.debit = abs(diff) - + # Set the total debit, total credit and difference for d in self.get('entries'): self.total_debit += flt(d.debit, 2) @@ -326,12 +326,12 @@ class JournalVoucher(AccountsController): cond = (flt(self.write_off_amount) > 0) and \ ' and outstanding_amount <= '+ self.write_off_amount or '' if self.write_off_based_on == 'Accounts Receivable': - return frappe.db.sql("""select name, debit_to, outstanding_amount - from `tabSales Invoice` where docstatus = 1 and company = %s + return frappe.db.sql("""select name, debit_to, outstanding_amount + from `tabSales Invoice` where docstatus = 1 and company = %s and outstanding_amount > 0 %s""" % ('%s', cond), self.company) elif self.write_off_based_on == 'Accounts Payable': - return frappe.db.sql("""select name, credit_to, outstanding_amount - from `tabPurchase Invoice` where docstatus = 1 and company = %s + return frappe.db.sql("""select name, credit_to, outstanding_amount + from `tabPurchase Invoice` where docstatus = 1 and company = %s and outstanding_amount > 0 %s""" % ('%s', cond), self.company) @frappe.whitelist() @@ -344,7 +344,7 @@ def get_default_bank_cash_account(company, voucher_type): "account": account, "balance": get_balance_on(account) } - + @frappe.whitelist() def get_payment_entry_from_sales_invoice(sales_invoice): from erpnext.accounts.utils import get_balance_on @@ -360,7 +360,7 @@ def get_payment_entry_from_sales_invoice(sales_invoice): # debit bank jv.get("entries")[1].debit = si.outstanding_amount - + return jv.as_dict() @frappe.whitelist() @@ -369,7 +369,7 @@ def get_payment_entry_from_purchase_invoice(purchase_invoice): pi = frappe.get_doc("Purchase Invoice", purchase_invoice) jv = get_payment_entry(pi) jv.remark = 'Payment against Purchase Invoice {0}. {1}'.format(pi.name, pi.remarks) - + # credit supplier jv.get("entries")[0].account = pi.credit_to jv.get("entries")[0].balance = get_balance_on(pi.credit_to) @@ -378,12 +378,12 @@ def get_payment_entry_from_purchase_invoice(purchase_invoice): # credit bank jv.get("entries")[1].credit = pi.outstanding_amount - + return jv.as_dict() def get_payment_entry(doc): bank_account = get_default_bank_cash_account(doc.company, "Bank Voucher") - + jv = frappe.new_doc('Journal Voucher') jv.voucher_type = 'Bank Voucher' @@ -396,63 +396,63 @@ def get_payment_entry(doc): if bank_account: d2.account = bank_account["account"] d2.balance = bank_account["balance"] - + return jv - + @frappe.whitelist() def get_opening_accounts(company): """get all balance sheet accounts for opening entry""" from erpnext.accounts.utils import get_balance_on - accounts = frappe.db.sql_list("""select name from tabAccount + accounts = frappe.db.sql_list("""select name from tabAccount where group_or_ledger='Ledger' and report_type='Profit and Loss' and company=%s""", company) - + return [{"account": a, "balance": get_balance_on(a)} for a in accounts] - + def get_against_purchase_invoice(doctype, txt, searchfield, start, page_len, filters): - return frappe.db.sql("""select name, credit_to, outstanding_amount, bill_no, bill_date - from `tabPurchase Invoice` where credit_to = %s and docstatus = 1 + return frappe.db.sql("""select name, credit_to, outstanding_amount, bill_no, bill_date + from `tabPurchase Invoice` where credit_to = %s and docstatus = 1 and outstanding_amount > 0 and %s like %s order by name desc limit %s, %s""" % - ("%s", searchfield, "%s", "%s", "%s"), - (filters["account"], "%%%s%%" % txt, start, page_len)) - -def get_against_sales_invoice(doctype, txt, searchfield, start, page_len, filters): - return frappe.db.sql("""select name, debit_to, outstanding_amount - from `tabSales Invoice` where debit_to = %s and docstatus = 1 - and outstanding_amount > 0 and `%s` like %s order by name desc limit %s, %s""" % - ("%s", searchfield, "%s", "%s", "%s"), - (filters["account"], "%%%s%%" % txt, start, page_len)) - -def get_against_jv(doctype, txt, searchfield, start, page_len, filters): - return frappe.db.sql("""select jv.name, jv.posting_date, jv.user_remark - from `tabJournal Voucher` jv, `tabJournal Voucher Detail` jv_detail - where jv_detail.parent = jv.name and jv_detail.account = %s and jv.docstatus = 1 - and jv.%s like %s order by jv.name desc limit %s, %s""" % - ("%s", searchfield, "%s", "%s", "%s"), + ("%s", searchfield, "%s", "%s", "%s"), (filters["account"], "%%%s%%" % txt, start, page_len)) -@frappe.whitelist() +def get_against_sales_invoice(doctype, txt, searchfield, start, page_len, filters): + return frappe.db.sql("""select name, debit_to, outstanding_amount + from `tabSales Invoice` where debit_to = %s and docstatus = 1 + and outstanding_amount > 0 and `%s` like %s order by name desc limit %s, %s""" % + ("%s", searchfield, "%s", "%s", "%s"), + (filters["account"], "%%%s%%" % txt, start, page_len)) + +def get_against_jv(doctype, txt, searchfield, start, page_len, filters): + return frappe.db.sql("""select jv.name, jv.posting_date, jv.user_remark + from `tabJournal Voucher` jv, `tabJournal Voucher Detail` jv_detail + where jv_detail.parent = jv.name and jv_detail.account = %s and jv.docstatus = 1 + and jv.%s like %s order by jv.name desc limit %s, %s""" % + ("%s", searchfield, "%s", "%s", "%s"), + (filters["account"], "%%%s%%" % txt, start, page_len)) + +@frappe.whitelist() def get_outstanding(args): args = eval(args) if args.get("doctype") == "Journal Voucher" and args.get("account"): against_jv_amount = frappe.db.sql(""" - select sum(ifnull(debit, 0)) - sum(ifnull(credit, 0)) - from `tabJournal Voucher Detail` where parent=%s and account=%s + select sum(ifnull(debit, 0)) - sum(ifnull(credit, 0)) + from `tabJournal Voucher Detail` where parent=%s and account=%s and ifnull(against_invoice, '')='' and ifnull(against_voucher, '')='' and ifnull(against_jv, '')=''""", (args['docname'], args['account'])) - + against_jv_amount = flt(against_jv_amount[0][0]) if against_jv_amount else 0 if against_jv_amount > 0: return {"credit": against_jv_amount} else: return {"debit": -1* against_jv_amount} - + elif args.get("doctype") == "Sales Invoice": return { - "credit": flt(frappe.db.get_value("Sales Invoice", args["docname"], + "credit": flt(frappe.db.get_value("Sales Invoice", args["docname"], "outstanding_amount")) } elif args.get("doctype") == "Purchase Invoice": return { - "debit": flt(frappe.db.get_value("Purchase Invoice", args["docname"], + "debit": flt(frappe.db.get_value("Purchase Invoice", args["docname"], "outstanding_amount")) } diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index 88df6bdce5..e178d03b57 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -28,13 +28,13 @@ class PurchaseInvoice(BuyingController): 'source_field': 'amount', 'percent_join_field': 'purchase_order', }] - + def validate(self): if not self.is_opening: self.is_opening = 'No' - + super(PurchaseInvoice, self).validate() - + self.po_required() self.pr_required() self.check_active_purchase_items() @@ -51,22 +51,22 @@ class PurchaseInvoice(BuyingController): self.validate_write_off_account() self.update_raw_material_cost() self.update_valuation_rate("entries") - self.validate_multiple_billing("Purchase Receipt", "pr_detail", "amount", + self.validate_multiple_billing("Purchase Receipt", "pr_detail", "amount", "purchase_receipt_details") - + def set_missing_values(self, for_validate=False): if not self.credit_to: self.credit_to = get_party_account(self.company, self.supplier, "Supplier") if not self.due_date: self.due_date = get_due_date(self.posting_date, self.supplier, "Supplier", self.credit_to, self.company) - + super(PurchaseInvoice, self).set_missing_values(for_validate) - + def get_advances(self): - super(PurchaseInvoice, self).get_advances(self.credit_to, + super(PurchaseInvoice, self).get_advances(self.credit_to, "Purchase Invoice Advance", "advance_allocation_details", "debit") - + def check_active_purchase_items(self): for d in self.get('entries'): if d.item_code: # extra condn coz item_code is not mandatory in PV @@ -77,29 +77,29 @@ class PurchaseInvoice(BuyingController): if not valid_item[0][1] == 'Yes': msgprint("Item : '%s' is not Purchase Item"%(d.item_code)) raise Exception - + def check_conversion_rate(self): - default_currency = get_company_currency(self.company) + default_currency = get_company_currency(self.company) if not default_currency: msgprint('Message: Please enter default currency in Company Master') raise Exception if (self.currency == default_currency and flt(self.conversion_rate) != 1.00) or not self.conversion_rate or (self.currency != default_currency and flt(self.conversion_rate) == 1.00): msgprint("Message: Please Enter Appropriate Conversion Rate.") - raise Exception - + raise Exception + def validate_bill_no(self): if self.bill_no and self.bill_no.lower().strip() \ not in ['na', 'not applicable', 'none']: - b_no = frappe.db.sql("""select bill_no, name, ifnull(is_opening,'') from `tabPurchase Invoice` - where bill_no = %s and credit_to = %s and docstatus = 1 and name != %s""", + b_no = frappe.db.sql("""select bill_no, name, ifnull(is_opening,'') from `tabPurchase Invoice` + where bill_no = %s and credit_to = %s and docstatus = 1 and name != %s""", (self.bill_no, self.credit_to, self.name)) if b_no and cstr(b_no[0][2]) == cstr(self.is_opening): msgprint("Please check you have already booked expense against Bill No. %s \ - in Purchase Invoice %s" % (cstr(b_no[0][0]), cstr(b_no[0][1])), + in Purchase Invoice %s" % (cstr(b_no[0][0]), cstr(b_no[0][1])), raise_exception=1) - + if not self.remarks and self.bill_date: - self.remarks = (self.remarks or '') + "\n" + ("Against Bill %s dated %s" + self.remarks = (self.remarks or '') + "\n" + ("Against Bill %s dated %s" % (self.bill_no, formatdate(self.bill_date))) if not self.remarks: @@ -108,28 +108,28 @@ class PurchaseInvoice(BuyingController): def validate_credit_acc(self): if frappe.db.get_value("Account", self.credit_to, "report_type") != "Balance Sheet": frappe.throw(_("Account must be a balance sheet account")) - + # Validate Acc Head of Supplier and Credit To Account entered # ------------------------------------------------------------ - def check_for_acc_head_of_supplier(self): + def check_for_acc_head_of_supplier(self): if self.supplier and self.credit_to: acc_head = frappe.db.sql("select master_name from `tabAccount` where name = %s", self.credit_to) - + if (acc_head and cstr(acc_head[0][0]) != cstr(self.supplier)) or (not acc_head and (self.credit_to != cstr(self.supplier) + " - " + self.company_abbr)): msgprint("Credit To: %s do not match with Supplier: %s for Company: %s.\n If both correctly entered, please select Master Type and Master Name in account master." %(self.credit_to,self.supplier,self.company), raise_exception=1) - + # Check for Stopped PO # --------------------- def check_for_stopped_status(self): check_list = [] for d in self.get('entries'): if d.purchase_order and not d.purchase_order in check_list and not d.purchase_receipt: - check_list.append(d.purhcase_order) + check_list.append(d.purchase_order) stopped = frappe.db.sql("select name from `tabPurchase Order` where status = 'Stopped' and name = %s", d.purchase_order) if stopped: msgprint("One cannot do any transaction against 'Purchase Order' : %s, it's status is 'Stopped'" % (d.purhcase_order)) raise Exception - + def validate_with_previous_doc(self): super(PurchaseInvoice, self).validate_with_previous_doc(self.tname, { "Purchase Order": { @@ -152,7 +152,7 @@ class PurchaseInvoice(BuyingController): "is_child_table": True } }) - + if cint(frappe.defaults.get_global_default('maintain_same_rate')): super(PurchaseInvoice, self).validate_with_previous_doc(self.tname, { "Purchase Order Item": { @@ -167,21 +167,21 @@ class PurchaseInvoice(BuyingController): "is_child_table": True } }) - - + + def set_aging_date(self): if self.is_opening != 'Yes': self.aging_date = self.posting_date elif not self.aging_date: msgprint("Aging Date is mandatory for opening entry") raise Exception - + def set_against_expense_account(self): auto_accounting_for_stock = cint(frappe.defaults.get_global_default("auto_accounting_for_stock")) if auto_accounting_for_stock: stock_not_billed_account = self.get_company_default("stock_received_but_not_billed") - + against_accounts = [] stock_items = self.get_stock_items() for item in self.get("entries"): @@ -191,18 +191,18 @@ class PurchaseInvoice(BuyingController): # Stock Received But Not Billed for a stock item item.expense_account = stock_not_billed_account item.cost_center = None - + if stock_not_billed_account not in against_accounts: against_accounts.append(stock_not_billed_account) - + elif not item.expense_account: - msgprint(_("Expense account is mandatory for item") + ": " + + msgprint(_("Expense account is mandatory for item") + ": " + (item.item_code or item.item_name), raise_exception=1) - + elif item.expense_account not in against_accounts: # if no auto_accounting_for_stock or not a stock item against_accounts.append(item.expense_account) - + self.against_expense_account = ",".join(against_accounts) def po_required(self): @@ -233,8 +233,8 @@ class PurchaseInvoice(BuyingController): submitted = frappe.db.sql("select name from `tabPurchase Receipt` where docstatus = 1 and name = %s", d.purchase_receipt) if not submitted: frappe.throw("Purchase Receipt : "+ cstr(d.purchase_receipt) +" is not submitted") - - + + def update_against_document_in_jv(self): """ Links invoice and advance voucher: @@ -242,33 +242,33 @@ class PurchaseInvoice(BuyingController): 2. split into multiple rows if partially adjusted, assign against voucher 3. submit advance voucher """ - + lst = [] for d in self.get('advance_allocation_details'): if flt(d.allocated_amount) > 0: args = { - 'voucher_no' : d.journal_voucher, - 'voucher_detail_no' : d.jv_detail_no, - 'against_voucher_type' : 'Purchase Invoice', + 'voucher_no' : d.journal_voucher, + 'voucher_detail_no' : d.jv_detail_no, + 'against_voucher_type' : 'Purchase Invoice', 'against_voucher' : self.name, - 'account' : self.credit_to, - 'is_advance' : 'Yes', - 'dr_or_cr' : 'debit', + 'account' : self.credit_to, + 'is_advance' : 'Yes', + 'dr_or_cr' : 'debit', 'unadjusted_amt' : flt(d.advance_amount), 'allocated_amt' : flt(d.allocated_amount) } lst.append(args) - + if lst: from erpnext.accounts.utils import reconcile_against_document reconcile_against_document(lst) def on_submit(self): self.check_prev_docstatus() - - frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype, + + frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype, self.company, self.grand_total) - + # this sequence because outstanding may get -negative self.make_gl_entries() self.update_against_document_in_jv() @@ -278,9 +278,9 @@ class PurchaseInvoice(BuyingController): def make_gl_entries(self): auto_accounting_for_stock = \ cint(frappe.defaults.get_global_default("auto_accounting_for_stock")) - + gl_entries = [] - + # parent's gl entry if self.grand_total: gl_entries.append( @@ -293,7 +293,7 @@ class PurchaseInvoice(BuyingController): "against_voucher_type": self.doctype, }) ) - + # tax table gl entries valuation_tax = {} for tax in self.get("other_charges"): @@ -308,31 +308,31 @@ class PurchaseInvoice(BuyingController): "cost_center": tax.cost_center }) ) - + # accumulate valuation tax if tax.category in ("Valuation", "Valuation and Total") and flt(tax.tax_amount): if auto_accounting_for_stock and not tax.cost_center: frappe.throw(_("Row %(row)s: Cost Center is mandatory \ - if tax/charges category is Valuation or Valuation and Total" % + if tax/charges category is Valuation or Valuation and Total" % {"row": tax.idx})) valuation_tax.setdefault(tax.cost_center, 0) valuation_tax[tax.cost_center] += \ (tax.add_deduct_tax == "Add" and 1 or -1) * flt(tax.tax_amount) - + # item gl entries stock_item_and_auto_accounting_for_stock = False stock_items = self.get_stock_items() for item in self.get("entries"): if auto_accounting_for_stock and item.item_code in stock_items: if flt(item.valuation_rate): - # if auto inventory accounting enabled and stock item, + # if auto inventory accounting enabled and stock item, # then do stock related gl entries # expense will be booked in sales invoice stock_item_and_auto_accounting_for_stock = True - - valuation_amt = flt(item.base_amount + item.item_tax_amount + item.rm_supp_cost, + + valuation_amt = flt(item.base_amount + item.item_tax_amount + item.rm_supp_cost, self.precision("base_amount", item)) - + gl_entries.append( self.get_gl_dict({ "account": item.expense_account, @@ -341,7 +341,7 @@ class PurchaseInvoice(BuyingController): "remarks": self.remarks or "Accounting Entry for Stock" }) ) - + elif flt(item.base_amount): # if not a stock item or auto inventory accounting disabled, book the expense gl_entries.append( @@ -353,13 +353,13 @@ class PurchaseInvoice(BuyingController): "cost_center": item.cost_center }) ) - + if stock_item_and_auto_accounting_for_stock and valuation_tax: # credit valuation tax amount in "Expenses Included In Valuation" # this will balance out valuation amount included in cost of goods sold expenses_included_in_valuation = \ self.get_company_default("expenses_included_in_valuation") - + for cost_center, amount in valuation_tax.items(): gl_entries.append( self.get_gl_dict({ @@ -370,8 +370,8 @@ class PurchaseInvoice(BuyingController): "remarks": self.remarks or "Accounting Entry for Stock" }) ) - - # writeoff account includes petty difference in the invoice amount + + # writeoff account includes petty difference in the invoice amount # and the amount that is paid if self.write_off_account and flt(self.write_off_amount): gl_entries.append( @@ -383,7 +383,7 @@ class PurchaseInvoice(BuyingController): "cost_center": self.write_off_cost_center }) ) - + if gl_entries: from erpnext.accounts.general_ledger import make_gl_entries make_gl_entries(gl_entries, cancel=(self.docstatus == 2)) @@ -391,43 +391,43 @@ class PurchaseInvoice(BuyingController): def on_cancel(self): from erpnext.accounts.utils import remove_against_link_from_jv remove_against_link_from_jv(self.doctype, self.name, "against_voucher") - + self.update_prevdoc_status() self.update_billing_status_for_zero_amount_refdoc("Purchase Order") self.make_cancel_gl_entries() - + def on_update(self): pass - + def update_raw_material_cost(self): if self.sub_contracted_items: for d in self.get("entries"): - rm_cost = frappe.db.sql("""select raw_material_cost / quantity - from `tabBOM` where item = %s and is_default = 1 and docstatus = 1 + rm_cost = frappe.db.sql("""select raw_material_cost / quantity + from `tabBOM` where item = %s and is_default = 1 and docstatus = 1 and is_active = 1 """, (d.item_code,)) rm_cost = rm_cost and flt(rm_cost[0][0]) or 0 - + d.conversion_factor = d.conversion_factor or flt(frappe.db.get_value( - "UOM Conversion Detail", {"parent": d.item_code, "uom": d.uom}, + "UOM Conversion Detail", {"parent": d.item_code, "uom": d.uom}, "conversion_factor")) or 1 - + d.rm_supp_cost = rm_cost * flt(d.qty) * flt(d.conversion_factor) - + @frappe.whitelist() def get_expense_account(doctype, txt, searchfield, start, page_len, filters): from erpnext.controllers.queries import get_match_cond - - # expense account can be any Debit account, - # but can also be a Liability account with account_type='Expense Account' in special circumstances. + + # expense account can be any Debit account, + # but can also be a Liability account with account_type='Expense Account' in special circumstances. # Hence the first condition is an "OR" - return frappe.db.sql("""select tabAccount.name from `tabAccount` + return frappe.db.sql("""select tabAccount.name from `tabAccount` where (tabAccount.report_type = "Profit and Loss" or tabAccount.account_type = "Expense Account") - and tabAccount.group_or_ledger="Ledger" - and tabAccount.docstatus!=2 + and tabAccount.group_or_ledger="Ledger" + and tabAccount.docstatus!=2 and ifnull(tabAccount.master_type, "")="" and ifnull(tabAccount.master_name, "")="" - and tabAccount.company = '%(company)s' + and tabAccount.company = '%(company)s' and tabAccount.%(key)s LIKE '%(txt)s' - %(mcond)s""" % {'company': filters['company'], 'key': searchfield, + %(mcond)s""" % {'company': filters['company'], 'key': searchfield, 'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype)}) diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py index e5ad8c69d1..6aeb9402f6 100644 --- a/erpnext/controllers/stock_controller.py +++ b/erpnext/controllers/stock_controller.py @@ -14,29 +14,29 @@ class StockController(AccountsController): def make_gl_entries(self, repost_future_gle=True): if self.docstatus == 2: delete_gl_entries(voucher_type=self.doctype, voucher_no=self.name) - + if cint(frappe.defaults.get_global_default("auto_accounting_for_stock")): warehouse_account = self.get_warehouse_account() - + if self.docstatus==1: gl_entries = self.get_gl_entries(warehouse_account) make_gl_entries(gl_entries) if repost_future_gle: items, warehouse_account = self.get_items_and_warehouse_accounts(warehouse_account) - update_gl_entries_after(self.posting_date, self.posting_time, + update_gl_entries_after(self.posting_date, self.posting_time, warehouse_account, items) - + def get_gl_entries(self, warehouse_account=None, default_expense_account=None, default_cost_center=None): from erpnext.accounts.general_ledger import process_gl_map if not warehouse_account: warehouse_account = get_warehouse_account() - + stock_ledger = self.get_stock_ledger_details() - voucher_details = self.get_voucher_details(stock_ledger, default_expense_account, + voucher_details = self.get_voucher_details(stock_ledger, default_expense_account, default_cost_center) - + gl_list = [] warehouse_with_no_account = [] for detail in voucher_details: @@ -63,13 +63,13 @@ class StockController(AccountsController): })) elif sle.warehouse not in warehouse_with_no_account: warehouse_with_no_account.append(sle.warehouse) - - if warehouse_with_no_account: - msgprint(_("No accounting entries for following warehouses") + ": \n" + + + if warehouse_with_no_account: + msgprint(_("No accounting entries for following warehouses") + ": \n" + "\n".join(warehouse_with_no_account)) - + return process_gl_map(gl_list) - + def get_voucher_details(self, stock_ledger, default_expense_account, default_cost_center): if not default_expense_account: details = self.get(self.fname) @@ -77,18 +77,18 @@ class StockController(AccountsController): self.check_expense_account(d) else: details = [frappe._dict({ - "name":d, - "expense_account": default_expense_account, + "name":d, + "expense_account": default_expense_account, "cost_center": default_cost_center }) for d in stock_ledger.keys()] - + return details - + def get_items_and_warehouse_accounts(self, warehouse_account=None): items, warehouses = [], [] if not warehouse_account: warehouse_account = get_warehouse_account() - + if hasattr(self, "fname"): item_doclist = self.get(self.fname) elif self.doctype == "Stock Reconciliation": @@ -98,26 +98,26 @@ class StockController(AccountsController): for row in data[data.index(self.head_row)+1:]: d = frappe._dict(zip(["item_code", "warehouse", "qty", "valuation_rate"], row)) item_doclist.append(d) - + if item_doclist: for d in item_doclist: if d.item_code and d.item_code not in items: items.append(d.item_code) - + if d.get("warehouse") and d.warehouse not in warehouses: warehouses.append(d.warehouse) - + if self.doctype == "Stock Entry": if d.get("s_warehouse") and d.s_warehouse not in warehouses: warehouses.append(d.s_warehouse) if d.get("t_warehouse") and d.t_warehouse not in warehouses: warehouses.append(d.t_warehouse) - warehouse_account = {wh: warehouse_account[wh] for wh in warehouses + warehouse_account = {wh: warehouse_account[wh] for wh in warehouses if warehouse_account.get(wh)} - + return items, warehouse_account - + def get_stock_ledger_details(self): stock_ledger = {} for sle in frappe.db.sql("""select warehouse, stock_value_difference, voucher_detail_no @@ -125,12 +125,12 @@ class StockController(AccountsController): (self.doctype, self.name), as_dict=True): stock_ledger.setdefault(sle.voucher_detail_no, []).append(sle) return stock_ledger - + def get_warehouse_account(self): - warehouse_account = dict(frappe.db.sql("""select master_name, name from tabAccount + warehouse_account = dict(frappe.db.sql("""select master_name, name from tabAccount where account_type = 'Warehouse' and ifnull(master_name, '') != ''""")) return warehouse_account - + def update_gl_entries_after(self, warehouse_account=None): future_stock_vouchers = self.get_future_stock_vouchers() gle = self.get_voucherwise_gl_entries(future_stock_vouchers) @@ -153,53 +153,53 @@ class StockController(AccountsController): break else: matched = False - + if not matched: self.delete_gl_entries(voucher_type, voucher_no) voucher_obj.make_gl_entries(repost_future_gle=False) else: self.delete_gl_entries(voucher_type, voucher_no) - - + + def get_future_stock_vouchers(self): future_stock_vouchers = [] - + if hasattr(self, "fname"): item_list = [d.item_code for d in self.get(self.fname)] condition = ''.join(['and item_code in (\'', '\', \''.join(item_list) ,'\')']) else: condition = "" - - for d in frappe.db.sql("""select distinct sle.voucher_type, sle.voucher_no + + for d in frappe.db.sql("""select distinct sle.voucher_type, sle.voucher_no from `tabStock Ledger Entry` sle where timestamp(sle.posting_date, sle.posting_time) >= timestamp(%s, %s) %s - order by timestamp(sle.posting_date, sle.posting_time) asc, name asc""" % - ('%s', '%s', condition), (self.posting_date, self.posting_time), + order by timestamp(sle.posting_date, sle.posting_time) asc, name asc""" % + ('%s', '%s', condition), (self.posting_date, self.posting_time), as_dict=True): future_stock_vouchers.append([d.voucher_type, d.voucher_no]) - + return future_stock_vouchers - + def get_voucherwise_gl_entries(self, future_stock_vouchers): gl_entries = {} if future_stock_vouchers: - for d in frappe.db.sql("""select * from `tabGL Entry` - where posting_date >= %s and voucher_no in (%s)""" % - ('%s', ', '.join(['%s']*len(future_stock_vouchers))), + for d in frappe.db.sql("""select * from `tabGL Entry` + where posting_date >= %s and voucher_no in (%s)""" % + ('%s', ', '.join(['%s']*len(future_stock_vouchers))), tuple([self.posting_date] + [d[1] for d in future_stock_vouchers]), as_dict=1): gl_entries.setdefault((d.voucher_type, d.voucher_no), []).append(d) - + return gl_entries - + def delete_gl_entries(self, voucher_type, voucher_no): - frappe.db.sql("""delete from `tabGL Entry` + frappe.db.sql("""delete from `tabGL Entry` where voucher_type=%s and voucher_no=%s""", (voucher_type, voucher_no)) - + def make_adjustment_entry(self, expected_gle, voucher_obj): from erpnext.accounts.utils import get_stock_and_account_difference account_list = [d.account for d in expected_gle] acc_diff = get_stock_and_account_difference(account_list, expected_gle[0].posting_date) - + cost_center = self.get_company_default("cost_center") stock_adjustment_account = self.get_company_default("stock_adjustment_account") @@ -214,7 +214,7 @@ class StockController(AccountsController): "debit": diff, "remarks": "Adjustment Accounting Entry for Stock", }), - + # account against stock in hand voucher_obj.get_gl_dict({ "account": stock_adjustment_account, @@ -224,21 +224,21 @@ class StockController(AccountsController): "remarks": "Adjustment Accounting Entry for Stock", }), ]) - + if gl_entries: from erpnext.accounts.general_ledger import make_gl_entries make_gl_entries(gl_entries) - + def check_expense_account(self, item): if item.meta.get_field("expense_account") and not item.expense_account: - msgprint(_("""Expense/Difference account is mandatory for item: """) + item.item_code, + msgprint(_("""Expense/Difference account is mandatory for item: """) + item.item_code, raise_exception=1) - + if item.meta.get_field("expense_account") and not item.cost_center: - msgprint(_("""Cost Center is mandatory for item: """) + item.item_code, + msgprint(_("""Cost Center is mandatory for item: """) + item.item_code, raise_exception=1) - - def get_sl_entries(self, d, args): + + def get_sl_entries(self, d, args): sl_dict = { "item_code": d.item_code, "warehouse": d.get("warehouse", None), @@ -257,27 +257,27 @@ class StockController(AccountsController): "project": d.get("project_name"), "is_cancelled": self.docstatus==2 and "Yes" or "No" } - + sl_dict.update(args) return sl_dict - + def make_sl_entries(self, sl_entries, is_amended=None): from erpnext.stock.stock_ledger import make_sl_entries make_sl_entries(sl_entries, is_amended) - + def make_cancel_gl_entries(self): - if frappe.db.sql("""select name from `tabGL Entry` where voucher_type=%s + if frappe.db.sql("""select name from `tabGL Entry` where voucher_type=%s and voucher_no=%s""", (self.doctype, self.name)): self.make_gl_entries() - + def update_gl_entries_after(posting_date, posting_time, warehouse_account=None, for_items=None): def _delete_gl_entries(voucher_type, voucher_no): - frappe.db.sql("""delete from `tabGL Entry` + frappe.db.sql("""delete from `tabGL Entry` where voucher_type=%s and voucher_no=%s""", (voucher_type, voucher_no)) - + if not warehouse_account: warehouse_account = get_warehouse_account() - future_stock_vouchers = get_future_stock_vouchers(posting_date, posting_time, + future_stock_vouchers = get_future_stock_vouchers(posting_date, posting_time, warehouse_account, for_items) gle = get_voucherwise_gl_entries(future_stock_vouchers, posting_date) @@ -286,13 +286,13 @@ def update_gl_entries_after(posting_date, posting_time, warehouse_account=None, voucher_obj = frappe.get_doc(voucher_type, voucher_no) expected_gle = voucher_obj.get_gl_entries(warehouse_account) if expected_gle: - if not existing_gle or not compare_existing_and_expected_gle(existing_gle, + if not existing_gle or not compare_existing_and_expected_gle(existing_gle, expected_gle): _delete_gl_entries(voucher_type, voucher_no) voucher_obj.make_gl_entries(repost_future_gle=False) else: _delete_gl_entries(voucher_type, voucher_no) - + def compare_existing_and_expected_gle(existing_gle, expected_gle): matched = True for entry in expected_gle: @@ -306,36 +306,36 @@ def compare_existing_and_expected_gle(existing_gle, expected_gle): def get_future_stock_vouchers(posting_date, posting_time, warehouse_account=None, for_items=None): future_stock_vouchers = [] - + condition = "" if for_items: condition = ''.join([' and item_code in (\'', '\', \''.join(for_items) ,'\')']) - + if warehouse_account: condition += ''.join([' and warehouse in (\'', '\', \''.join(warehouse_account.keys()) ,'\')']) - - for d in frappe.db.sql("""select distinct sle.voucher_type, sle.voucher_no + + for d in frappe.db.sql("""select distinct sle.voucher_type, sle.voucher_no from `tabStock Ledger Entry` sle where timestamp(sle.posting_date, sle.posting_time) >= timestamp(%s, %s) %s - order by timestamp(sle.posting_date, sle.posting_time) asc, name asc""" % - ('%s', '%s', condition), (posting_date, posting_time), + order by timestamp(sle.posting_date, sle.posting_time) asc, name asc""" % + ('%s', '%s', condition), (posting_date, posting_time), as_dict=True): future_stock_vouchers.append([d.voucher_type, d.voucher_no]) - + return future_stock_vouchers - + def get_voucherwise_gl_entries(future_stock_vouchers, posting_date): gl_entries = {} if future_stock_vouchers: - for d in frappe.db.sql("""select * from `tabGL Entry` - where posting_date >= %s and voucher_no in (%s)""" % - ('%s', ', '.join(['%s']*len(future_stock_vouchers))), + for d in frappe.db.sql("""select * from `tabGL Entry` + where posting_date >= %s and voucher_no in (%s)""" % + ('%s', ', '.join(['%s']*len(future_stock_vouchers))), tuple([posting_date] + [d[1] for d in future_stock_vouchers]), as_dict=1): gl_entries.setdefault((d.voucher_type, d.voucher_no), []).append(d) - + return gl_entries def get_warehouse_account(): - warehouse_account = dict(frappe.db.sql("""select master_name, name from tabAccount + warehouse_account = dict(frappe.db.sql("""select master_name, name from tabAccount where account_type = 'Warehouse' and ifnull(master_name, '') != ''""")) return warehouse_account diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index b5d46a2c0f..9a28033912 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -19,12 +19,12 @@ class StockOverReturnError(frappe.ValidationError): pass class IncorrectValuationRateError(frappe.ValidationError): pass class DuplicateEntryForProductionOrderError(frappe.ValidationError): pass class StockOverProductionError(frappe.ValidationError): pass - + from erpnext.controllers.stock_controller import StockController class StockEntry(StockController): - fname = 'mtn_details' - + fname = 'mtn_details' + def validate(self): self.validate_posting_time() self.validate_purpose() @@ -44,7 +44,7 @@ class StockEntry(StockController): self.validate_with_material_request() self.validate_fiscal_year() self.set_total_amount() - + def on_submit(self): self.update_stock_ledger() @@ -57,32 +57,32 @@ class StockEntry(StockController): self.update_stock_ledger() self.update_production_order() self.make_cancel_gl_entries() - + def validate_fiscal_year(self): from erpnext.accounts.utils import validate_fiscal_year validate_fiscal_year(self.posting_date, self.fiscal_year, self.meta.get_label("posting_date")) - + def validate_purpose(self): - valid_purposes = ["Material Issue", "Material Receipt", "Material Transfer", + valid_purposes = ["Material Issue", "Material Receipt", "Material Transfer", "Manufacture/Repack", "Subcontract", "Sales Return", "Purchase Return"] if self.purpose not in valid_purposes: msgprint(_("Purpose must be one of ") + comma_or(valid_purposes), raise_exception=True) - + def validate_item(self): stock_items = self.get_stock_items() for item in self.get("mtn_details"): if item.item_code not in stock_items: msgprint(_("""Only Stock Items are allowed for Stock Entry"""), raise_exception=True) - + def validate_warehouse(self, pro_obj): """perform various (sometimes conditional) validations on warehouse""" - + source_mandatory = ["Material Issue", "Material Transfer", "Purchase Return"] target_mandatory = ["Material Receipt", "Material Transfer", "Sales Return"] - + validate_for_manufacture_repack = any([d.bom_no for d in self.get("mtn_details")]) if self.purpose in source_mandatory and self.purpose not in target_mandatory: @@ -101,11 +101,11 @@ class StockEntry(StockController): if not (d.s_warehouse or d.t_warehouse): msgprint(_("Atleast one warehouse is mandatory"), raise_exception=1) - + if self.purpose in source_mandatory and not d.s_warehouse: msgprint(_("Row # ") + "%s: " % cint(d.idx) + _("Source Warehouse") + _(" is mandatory"), raise_exception=1) - + if self.purpose in target_mandatory and not d.t_warehouse: msgprint(_("Row # ") + "%s: " % cint(d.idx) + _("Target Warehouse") + _(" is mandatory"), raise_exception=1) @@ -114,39 +114,39 @@ class StockEntry(StockController): if validate_for_manufacture_repack: if d.bom_no: d.s_warehouse = None - + if not d.t_warehouse: msgprint(_("Row # ") + "%s: " % cint(d.idx) + _("Target Warehouse") + _(" is mandatory"), raise_exception=1) - + elif pro_obj and cstr(d.t_warehouse) != pro_obj.fg_warehouse: msgprint(_("Row # ") + "%s: " % cint(d.idx) + _("Target Warehouse") + _(" should be same as that in ") + _("Production Order"), raise_exception=1) - + else: d.t_warehouse = None if not d.s_warehouse: msgprint(_("Row # ") + "%s: " % cint(d.idx) + _("Source Warehouse") + _(" is mandatory"), raise_exception=1) - + if cstr(d.s_warehouse) == cstr(d.t_warehouse): - msgprint(_("Source and Target Warehouse cannot be same"), + msgprint(_("Source and Target Warehouse cannot be same"), raise_exception=1) - + def validate_production_order(self, pro_obj=None): if not pro_obj: if self.production_order: pro_obj = frappe.get_doc('Production Order', self.production_order) else: return - + if self.purpose == "Manufacture/Repack": # check for double entry self.check_duplicate_entry_for_production_order() elif self.purpose != "Material Transfer": self.production_order = None - + def check_duplicate_entry_for_production_order(self): other_ste = [t[0] for t in frappe.db.get_values("Stock Entry", { "production_order": self.production_order, @@ -154,24 +154,24 @@ class StockEntry(StockController): "docstatus": ["!=", 2], "name": ["!=", self.name] }, "name")] - + if other_ste: - production_item, qty = frappe.db.get_value("Production Order", + production_item, qty = frappe.db.get_value("Production Order", self.production_order, ["production_item", "qty"]) args = other_ste + [production_item] fg_qty_already_entered = frappe.db.sql("""select sum(actual_qty) - from `tabStock Entry Detail` - where parent in (%s) - and item_code = %s + from `tabStock Entry Detail` + where parent in (%s) + and item_code = %s and ifnull(s_warehouse,'')='' """ % (", ".join(["%s" * len(other_ste)]), "%s"), args)[0][0] - + if fg_qty_already_entered >= qty: - frappe.throw(_("Stock Entries already created for Production Order ") + frappe.throw(_("Stock Entries already created for Production Order ") + self.production_order + ":" + ", ".join(other_ste), DuplicateEntryForProductionOrderError) def set_total_amount(self): self.total_amount = sum([flt(item.amount) for item in self.get("mtn_details")]) - + def get_stock_and_rate(self): """get stock and incoming rate on posting date""" for d in self.get('mtn_details'): @@ -186,21 +186,21 @@ class StockEntry(StockController): }) # get actual stock at source warehouse d.actual_qty = get_previous_sle(args).get("qty_after_transaction") or 0 - + # get incoming rate if not flt(d.incoming_rate): d.incoming_rate = self.get_incoming_rate(args) - + d.amount = flt(d.transfer_qty) * flt(d.incoming_rate) - + def get_incoming_rate(self, args): incoming_rate = 0 if self.purpose == "Sales Return" and \ (self.delivery_note_no or self.sales_invoice_no): - sle = frappe.db.sql("""select name, posting_date, posting_time, - actual_qty, stock_value, warehouse from `tabStock Ledger Entry` - where voucher_type = %s and voucher_no = %s and - item_code = %s limit 1""", + sle = frappe.db.sql("""select name, posting_date, posting_time, + actual_qty, stock_value, warehouse from `tabStock Ledger Entry` + where voucher_type = %s and voucher_no = %s and + item_code = %s limit 1""", ((self.delivery_note_no and "Delivery Note" or "Sales Invoice"), self.delivery_note_no or self.sales_invoice_no, args.item_code), as_dict=1) if sle: @@ -215,14 +215,14 @@ class StockEntry(StockController): flt(sle[0].actual_qty) else: incoming_rate = get_incoming_rate(args) - + return incoming_rate - + def validate_incoming_rate(self): for d in self.get('mtn_details'): if d.t_warehouse: self.validate_value("incoming_rate", ">", 0, d, raise_exception=IncorrectValuationRateError) - + def validate_bom(self): for d in self.get('mtn_details'): if d.bom_no and not frappe.db.sql("""select name from `tabBOM` @@ -231,72 +231,72 @@ class StockEntry(StockController): msgprint(_("Item") + " %s: " % cstr(d.item_code) + _("does not belong to BOM: ") + cstr(d.bom_no) + _(" or the BOM is cancelled or inactive"), raise_exception=1) - + def validate_finished_goods(self): """validation: finished good quantity should be same as manufacturing quantity""" for d in self.get('mtn_details'): if d.bom_no and flt(d.transfer_qty) != flt(self.fg_completed_qty): - msgprint(_("Row #") + " %s: " % d.idx + msgprint(_("Row #") + " %s: " % d.idx + _("Quantity should be equal to Manufacturing Quantity. To fetch items again, click on 'Get Items' button or update the Quantity manually."), raise_exception=1) - + def validate_return_reference_doc(self): """validate item with reference doc""" ref = get_return_doc_and_details(self) - + if ref.doc: # validate docstatus if ref.doc.docstatus != 1: - frappe.msgprint(_(ref.doc.doctype) + ' "' + ref.doc.name + '": ' + frappe.msgprint(_(ref.doc.doctype) + ' "' + ref.doc.name + '": ' + _("Status should be Submitted"), raise_exception=frappe.InvalidStatusError) - + # update stock check if ref.doc.doctype == "Sales Invoice" and cint(ref.doc.update_stock) != 1: - frappe.msgprint(_(ref.doc.doctype) + ' "' + ref.doc.name + '": ' - + _("Update Stock should be checked."), + frappe.msgprint(_(ref.doc.doctype) + ' "' + ref.doc.name + '": ' + + _("Update Stock should be checked."), raise_exception=NotUpdateStockError) - + # posting date check - ref_posting_datetime = "%s %s" % (cstr(ref.doc.posting_date), + ref_posting_datetime = "%s %s" % (cstr(ref.doc.posting_date), cstr(ref.doc.posting_time) or "00:00:00") - this_posting_datetime = "%s %s" % (cstr(self.posting_date), + this_posting_datetime = "%s %s" % (cstr(self.posting_date), cstr(self.posting_time)) if this_posting_datetime < ref_posting_datetime: from frappe.utils.dateutils import datetime_in_user_format frappe.msgprint(_("Posting Date Time cannot be before") + ": " + datetime_in_user_format(ref_posting_datetime), raise_exception=True) - + stock_items = get_stock_items_for_return(ref.doc, ref.parentfields) already_returned_item_qty = self.get_already_returned_item_qty(ref.fieldname) - + for item in self.get("mtn_details"): # validate if item exists in the ref doc and that it is a stock item if item.item_code not in stock_items: msgprint(_("Item") + ': "' + item.item_code + _("\" does not exist in ") + - ref.doc.doctype + ": " + ref.doc.name, + ref.doc.doctype + ": " + ref.doc.name, raise_exception=frappe.DoesNotExistError) - + # validate quantity <= ref item's qty - qty already returned ref_item = ref.doc.getone({"item_code": item.item_code}) returnable_qty = ref_item.qty - flt(already_returned_item_qty.get(item.item_code)) if not returnable_qty: frappe.throw("{item}: {item_code} {returned}".format( - item=_("Item"), item_code=item.item_code, - returned=_("already returned though some other documents")), + item=_("Item"), item_code=item.item_code, + returned=_("already returned though some other documents")), StockOverReturnError) elif item.transfer_qty > returnable_qty: frappe.throw("{item}: {item_code}, {returned}: {qty}".format( item=_("Item"), item_code=item.item_code, returned=_("Max Returnable Qty"), qty=returnable_qty), StockOverReturnError) - + def get_already_returned_item_qty(self, ref_fieldname): return dict(frappe.db.sql("""select item_code, sum(transfer_qty) as qty from `tabStock Entry Detail` where parent in ( select name from `tabStock Entry` where `%s`=%s and docstatus=1) group by item_code""" % (ref_fieldname, "%s"), (self.get(ref_fieldname),))) - + def update_stock_ledger(self): - sl_entries = [] + sl_entries = [] for d in self.get('mtn_details'): if cstr(d.s_warehouse) and self.docstatus == 1: sl_entries.append(self.get_sl_entries(d, { @@ -304,57 +304,57 @@ class StockEntry(StockController): "actual_qty": -flt(d.transfer_qty), "incoming_rate": 0 })) - + if cstr(d.t_warehouse): sl_entries.append(self.get_sl_entries(d, { "warehouse": cstr(d.t_warehouse), "actual_qty": flt(d.transfer_qty), "incoming_rate": flt(d.incoming_rate) })) - - # On cancellation, make stock ledger entry for + + # On cancellation, make stock ledger entry for # target warehouse first, to update serial no values properly - + if cstr(d.s_warehouse) and self.docstatus == 2: sl_entries.append(self.get_sl_entries(d, { "warehouse": cstr(d.s_warehouse), "actual_qty": -flt(d.transfer_qty), "incoming_rate": 0 })) - + self.make_sl_entries(sl_entries, self.amended_from and 'Yes' or 'No') def update_production_order(self): def _validate_production_order(pro_doc): if flt(pro_doc.docstatus) != 1: - frappe.throw(_("Production Order must be submitted") + ": " + + frappe.throw(_("Production Order must be submitted") + ": " + self.production_order) - + if pro_doc.status == 'Stopped': - msgprint(_("Transaction not allowed against stopped Production Order") + ": " + + msgprint(_("Transaction not allowed against stopped Production Order") + ": " + self.production_order) - + if self.production_order: pro_doc = frappe.get_doc("Production Order", self.production_order) _validate_production_order(pro_doc) self.update_produced_qty(pro_doc) if self.purpose == "Manufacture/Repack": self.update_planned_qty(pro_doc) - + def update_produced_qty(self, pro_doc): if self.purpose == "Manufacture/Repack": produced_qty = flt(pro_doc.produced_qty) + \ (self.docstatus==1 and 1 or -1 ) * flt(self.fg_completed_qty) - + if produced_qty > flt(pro_doc.qty): frappe.throw(_("Production Order") + ": " + self.production_order + "\n" + - _("Total Manufactured Qty can not be greater than Planned qty to manufacture") + _("Total Manufactured Qty can not be greater than Planned qty to manufacture") + "(%s/%s)" % (produced_qty, flt(pro_doc.qty)), StockOverProductionError) - + status = 'Completed' if flt(produced_qty) >= flt(pro_doc.qty) else 'In Process' - frappe.db.sql("""update `tabProduction Order` set status=%s, produced_qty=%s + frappe.db.sql("""update `tabProduction Order` set status=%s, produced_qty=%s where name=%s""", (status, produced_qty, self.production_order)) - + def update_planned_qty(self, pro_doc): from erpnext.stock.utils import update_bin update_bin({ @@ -363,16 +363,16 @@ class StockEntry(StockController): "posting_date": self.posting_date, "planned_qty": (self.docstatus==1 and -1 or 1 ) * flt(self.fg_completed_qty) }) - + def get_item_details(self, arg): arg = json.loads(arg) - item = frappe.db.sql("""select stock_uom, description, item_name, - expense_account, buying_cost_center from `tabItem` - where name = %s and (ifnull(end_of_life,'')='' or end_of_life ='0000-00-00' + item = frappe.db.sql("""select stock_uom, description, item_name, + expense_account, buying_cost_center from `tabItem` + where name = %s and (ifnull(end_of_life,'')='' or end_of_life ='0000-00-00' or end_of_life > now())""", (arg.get('item_code')), as_dict = 1) - if not item: + if not item: msgprint("Item is not active", raise_exception=1) - + ret = { 'uom' : item and item[0]['stock_uom'] or '', 'stock_uom' : item and item[0]['stock_uom'] or '', @@ -394,7 +394,7 @@ class StockEntry(StockController): def get_uom_details(self, arg = ''): arg, ret = eval(arg), {} - uom = frappe.db.sql("""select conversion_factor from `tabUOM Conversion Detail` + uom = frappe.db.sql("""select conversion_factor from `tabUOM Conversion Detail` where parent = %s and uom = %s""", (arg['item_code'], arg['uom']), as_dict = 1) if not uom or not flt(uom[0].conversion_factor): msgprint("There is no Conversion Factor for UOM '%s' in Item '%s'" % (arg['uom'], @@ -406,7 +406,7 @@ class StockEntry(StockController): 'transfer_qty' : flt(arg['qty']) * flt(uom[0]['conversion_factor']), } return ret - + def get_warehouse_details(self, args): args = json.loads(args) ret = {} @@ -416,14 +416,14 @@ class StockEntry(StockController): "posting_time": self.posting_time, }) args = frappe._dict(args) - + ret = { "actual_qty" : get_previous_sle(args).get("qty_after_transaction") or 0, "incoming_rate" : self.get_incoming_rate(args) } return ret - - def get_items(self): + + def get_items(self): pro_obj = None if self.production_order: # common validations @@ -434,7 +434,7 @@ class StockEntry(StockController): else: # invalid production order self.production_order = None - + if self.bom_no: if self.purpose in ["Material Issue", "Material Transfer", "Manufacture/Repack", "Subcontract"]: @@ -451,10 +451,10 @@ class StockEntry(StockController): # add raw materials to Stock Entry Detail table idx = self.add_to_stock_entry_detail(item_dict) - + # add finished good item to Stock Entry Detail table -- along with bom_no if self.production_order and self.purpose == "Manufacture/Repack": - item = frappe.db.get_value("Item", pro_obj.production_item, ["item_name", + item = frappe.db.get_value("Item", pro_obj.production_item, ["item_name", "description", "stock_uom", "expense_account", "buying_cost_center"], as_dict=1) self.add_to_stock_entry_detail({ cstr(pro_obj.production_item): { @@ -468,14 +468,14 @@ class StockEntry(StockController): "cost_center": item.buying_cost_center, } }, bom_no=pro_obj.bom_no, idx=idx) - + elif self.purpose in ["Material Receipt", "Manufacture/Repack"]: if self.purpose=="Material Receipt": self.from_warehouse = "" - - item = frappe.db.sql("""select name, item_name, description, - stock_uom, expense_account, buying_cost_center from `tabItem` - where name=(select item from tabBOM where name=%s)""", + + item = frappe.db.sql("""select name, item_name, description, + stock_uom, expense_account, buying_cost_center from `tabItem` + where name=(select item from tabBOM where name=%s)""", self.bom_no, as_dict=1) self.add_to_stock_entry_detail({ item[0]["name"] : { @@ -488,20 +488,20 @@ class StockEntry(StockController): "cost_center": item[0].buying_cost_center, } }, bom_no=self.bom_no, idx=idx) - + self.get_stock_and_rate() - + def get_bom_raw_materials(self, qty): from erpnext.manufacturing.doctype.bom.bom import get_bom_items_as_dict - + # item dict = { item_code: {qty, description, stock_uom} } item_dict = get_bom_items_as_dict(self.bom_no, qty=qty, fetch_exploded = self.use_multi_level_bom) - + for item in item_dict.values(): item.from_warehouse = item.default_warehouse - + return item_dict - + def get_pending_raw_materials(self, pro_obj): """ issue (item quantity) that is pending to issue or desire to transfer, @@ -509,10 +509,10 @@ class StockEntry(StockController): """ item_dict = self.get_bom_raw_materials(1) issued_item_qty = self.get_issued_qty() - + max_qty = flt(pro_obj.qty) only_pending_fetched = [] - + for item in item_dict: pending_to_issue = (max_qty * item_dict[item]["qty"]) - issued_item_qty.get(item, 0) desire_to_transfer = flt(self.fg_completed_qty) * item_dict[item]["qty"] @@ -522,17 +522,17 @@ class StockEntry(StockController): item_dict[item]["qty"] = pending_to_issue if pending_to_issue: only_pending_fetched.append(item) - + # delete items with 0 qty for item in item_dict.keys(): if not item_dict[item]["qty"]: del item_dict[item] - + # show some message if not len(item_dict): frappe.msgprint(_("""All items have already been transferred \ for this Production Order.""")) - + elif only_pending_fetched: frappe.msgprint(_("""Only quantities pending to be transferred \ were fetched for the following items:\n""" + "\n".join(only_pending_fetched))) @@ -548,7 +548,7 @@ class StockEntry(StockController): group by t1.item_code""", self.production_order) for t in result: issued_item_qty[t[0]] = flt(t[1]) - + return issued_item_qty def add_to_stock_entry_detail(self, item_dict, bom_no=None, idx=None): @@ -569,79 +569,79 @@ class StockEntry(StockController): se_child.qty = flt(item_dict[d]["qty"]) se_child.expense_account = item_dict[d]["expense_account"] or expense_account se_child.cost_center = item_dict[d]["cost_center"] or cost_center - + # in stock uom se_child.transfer_qty = flt(item_dict[d]["qty"]) se_child.conversion_factor = 1.00 - + # to be assigned for finished item se_child.bom_no = bom_no # increment idx by 1 idx += 1 return idx - + def validate_with_material_request(self): for item in self.get("mtn_details"): if item.material_request: - mreq_item = frappe.db.get_value("Material Request Item", + mreq_item = frappe.db.get_value("Material Request Item", {"name": item.material_request_item, "parent": item.material_request}, ["item_code", "warehouse", "idx"], as_dict=True) if mreq_item.item_code != item.item_code or mreq_item.warehouse != item.t_warehouse: msgprint(_("Row #") + (" %d: " % item.idx) + _("does not match") + " " + _("Row #") + (" %d %s " % (mreq_item.idx, _("of"))) - + _("Material Request") + (" - %s" % item.material_request), + + _("Material Request") + (" - %s" % item.material_request), raise_exception=frappe.MappingMismatchError) - -@frappe.whitelist() + +@frappe.whitelist() def get_party_details(ref_dt, ref_dn): if ref_dt in ["Delivery Note", "Sales Invoice"]: - res = frappe.db.get_value(ref_dt, ref_dn, + res = frappe.db.get_value(ref_dt, ref_dn, ["customer", "customer_name", "address_display as customer_address"], as_dict=1) else: - res = frappe.db.get_value(ref_dt, ref_dn, + res = frappe.db.get_value(ref_dt, ref_dn, ["supplier", "supplier_name", "address_display as supplier_address"], as_dict=1) return res or {} - + @frappe.whitelist() def get_production_order_details(production_order): - result = frappe.db.sql("""select bom_no, - ifnull(qty, 0) - ifnull(produced_qty, 0) as fg_completed_qty, use_multi_level_bom, + result = frappe.db.sql("""select bom_no, + ifnull(qty, 0) - ifnull(produced_qty, 0) as fg_completed_qty, use_multi_level_bom, wip_warehouse from `tabProduction Order` where name = %s""", production_order, as_dict=1) return result and result[0] or {} - + def query_sales_return_doc(doctype, txt, searchfield, start, page_len, filters): conditions = "" if doctype == "Sales Invoice": conditions = "and update_stock=1" - + return frappe.db.sql("""select name, customer, customer_name from `tab%s` where docstatus = 1 - and (`%s` like %%(txt)s + and (`%s` like %%(txt)s or `customer` like %%(txt)s) %s %s order by name, customer, customer_name - limit %s""" % (doctype, searchfield, conditions, - get_match_cond(doctype), "%(start)s, %(page_len)s"), - {"txt": "%%%s%%" % txt, "start": start, "page_len": page_len}, + limit %s""" % (doctype, searchfield, conditions, + get_match_cond(doctype), "%(start)s, %(page_len)s"), + {"txt": "%%%s%%" % txt, "start": start, "page_len": page_len}, as_list=True) - + def query_purchase_return_doc(doctype, txt, searchfield, start, page_len, filters): return frappe.db.sql("""select name, supplier, supplier_name from `tab%s` where docstatus = 1 - and (`%s` like %%(txt)s + and (`%s` like %%(txt)s or `supplier` like %%(txt)s) %s order by name, supplier, supplier_name - limit %s""" % (doctype, searchfield, get_match_cond(doctype), - "%(start)s, %(page_len)s"), {"txt": "%%%s%%" % txt, "start": + limit %s""" % (doctype, searchfield, get_match_cond(doctype), + "%(start)s, %(page_len)s"), {"txt": "%%%s%%" % txt, "start": start, "page_len": page_len}, as_list=True) - + def query_return_item(doctype, txt, searchfield, start, page_len, filters): txt = txt.replace("%", "") ref = get_return_doc_and_details(filters) - + stock_items = get_stock_items_for_return(ref.doc, ref.parentfields) - + result = [] for item in ref.doc.get_all_children(): if getattr(item, "item_code", None) in stock_items: @@ -649,8 +649,8 @@ def query_return_item(doctype, txt, searchfield, start, page_len, filters): item.description = cstr(item.description) if (txt in item.item_code) or (txt in item.item_name) or (txt in item.description): val = [ - item.item_code, - (len(item.item_name) > 40) and (item.item_name[:40] + "...") or item.item_name, + item.item_code, + (len(item.item_name) > 40) and (item.item_name[:40] + "...") or item.item_name, (len(item.description) > 40) and (item.description[:40] + "...") or \ item.description ] @@ -662,45 +662,45 @@ def query_return_item(doctype, txt, searchfield, start, page_len, filters): def get_batch_no(doctype, txt, searchfield, start, page_len, filters): if not filters.get("posting_date"): filters["posting_date"] = nowdate() - + batch_nos = None args = { - 'item_code': filters['item_code'], - 's_warehouse': filters['s_warehouse'], - 'posting_date': filters['posting_date'], - 'txt': "%%%s%%" % txt, - 'mcond':get_match_cond(doctype), - "start": start, + 'item_code': filters['item_code'], + 's_warehouse': filters['s_warehouse'], + 'posting_date': filters['posting_date'], + 'txt': "%%%s%%" % txt, + 'mcond':get_match_cond(doctype), + "start": start, "page_len": page_len } - + if filters.get("s_warehouse"): - batch_nos = frappe.db.sql("""select batch_no - from `tabStock Ledger Entry` sle - where item_code = '%(item_code)s' + batch_nos = frappe.db.sql("""select batch_no + from `tabStock Ledger Entry` sle + where item_code = '%(item_code)s' and warehouse = '%(s_warehouse)s' - and batch_no like '%(txt)s' - and exists(select * from `tabBatch` - where name = sle.batch_no - and (ifnull(expiry_date, '2099-12-31') >= %(posting_date)s + and batch_no like '%(txt)s' + and exists(select * from `tabBatch` + where name = sle.batch_no + and (ifnull(expiry_date, '2099-12-31') >= %(posting_date)s or expiry_date = '') - and docstatus != 2) + and docstatus != 2) %(mcond)s - group by batch_no having sum(actual_qty) > 0 - order by batch_no desc - limit %(start)s, %(page_len)s """ + group by batch_no having sum(actual_qty) > 0 + order by batch_no desc + limit %(start)s, %(page_len)s """ % args) - + if batch_nos: return batch_nos else: - return frappe.db.sql("""select name from `tabBatch` + return frappe.db.sql("""select name from `tabBatch` where item = '%(item_code)s' and docstatus < 2 - and (ifnull(expiry_date, '2099-12-31') >= %(posting_date)s + and (ifnull(expiry_date, '2099-12-31') >= %(posting_date)s or expiry_date = '' or expiry_date = "0000-00-00") %(mcond)s - order by name desc + order by name desc limit %(start)s, %(page_len)s """ % args) @@ -708,19 +708,19 @@ def get_stock_items_for_return(ref_doc, parentfields): """return item codes filtered from doc, which are stock items""" if isinstance(parentfields, basestring): parentfields = [parentfields] - - all_items = list(set([d.item_code for d in + + all_items = list(set([d.item_code for d in ref_doc.get_all_children() if d.get("item_code")])) stock_items = frappe.db.sql_list("""select name from `tabItem` where is_stock_item='Yes' and name in (%s)""" % (", ".join(["%s"] * len(all_items))), tuple(all_items)) return stock_items - + def get_return_doc_and_details(args): ref = frappe._dict() - - # get ref_doc + + # get ref_doc if args.get("purpose") in return_map: for fieldname, val in return_map[args.get("purpose")].items(): if args.get(fieldname): @@ -728,9 +728,9 @@ def get_return_doc_and_details(args): ref.doc = frappe.get_doc(val[0], args.get(fieldname)) ref.parentfields = val[1] break - + return ref - + return_map = { "Sales Return": { # [Ref DocType, [Item tables' parentfields]] @@ -747,29 +747,28 @@ def make_return_jv(stock_entry): se = frappe.get_doc("Stock Entry", stock_entry) if not se.purpose in ["Sales Return", "Purchase Return"]: return - + ref = get_return_doc_and_details(se) - + if ref.doc.doctype == "Delivery Note": result = make_return_jv_from_delivery_note(se, ref) elif ref.doc.doctype == "Sales Invoice": result = make_return_jv_from_sales_invoice(se, ref) elif ref.doc.doctype == "Purchase Receipt": result = make_return_jv_from_purchase_receipt(se, ref) - + # create jv doc and fetch balance for each unique row item - jv_list = [{ - "__islocal": 1, - "doctype": "Journal Voucher", + jv = frappe.new_doc("Journal Voucher") + jv.update({ "posting_date": se.posting_date, "voucher_type": se.purpose == "Sales Return" and "Credit Note" or "Debit Note", "fiscal_year": se.fiscal_year, "company": se.company - }] - + }) + from erpnext.accounts.utils import get_balance_on for r in result: - jv_list.append({ + jv.append("entries", { "__islocal": 1, "doctype": "Journal Voucher Detail", "parentfield": "entries", @@ -779,139 +778,140 @@ def make_return_jv(stock_entry): "balance": get_balance_on(r.get("account"), se.posting_date) \ if r.get("account") else 0 }) - - return jv_list - + + return jv + def make_return_jv_from_sales_invoice(se, ref): # customer account entry parent = { "account": ref.doc.debit_to, "against_invoice": ref.doc.name, } - + # income account entries children = [] for se_item in se.get("mtn_details"): # find item in ref.doc ref_item = ref.doc.get({"item_code": se_item.item_code})[0] - + account = get_sales_account_from_item(ref.doc, ref_item) - + if account not in children: children.append(account) - + return [parent] + [{"account": account} for account in children] - + def get_sales_account_from_item(doc, ref_item): account = None - if not ref_item.income_account: + if not getattr(ref_item, "income_account", None): if ref_item.parent_item: - parent_item = doc.get({"item_code": ref_item.parent_item})[0] + parent_item = doc.get(doc.fname, {"item_code": ref_item.parent_item})[0] account = parent_item.income_account else: account = ref_item.income_account - + return account - + def make_return_jv_from_delivery_note(se, ref): invoices_against_delivery = get_invoice_list("Sales Invoice Item", "delivery_note", ref.doc.name) - + if not invoices_against_delivery: - sales_orders_against_delivery = [d.against_sales_order for d in ref.doc.get_all_children() if d.against_sales_order] - + sales_orders_against_delivery = [d.against_sales_order for d in ref.doc.get_all_children() if getattr(d, "against_sales_order", None)] + if sales_orders_against_delivery: invoices_against_delivery = get_invoice_list("Sales Invoice Item", "sales_order", sales_orders_against_delivery) - + if not invoices_against_delivery: return [] - + packing_item_parent_map = dict([[d.item_code, d.parent_item] for d in ref.doc.get(ref.parentfields[1])]) - + parent = {} children = [] - + for se_item in se.get("mtn_details"): for sales_invoice in invoices_against_delivery: si = frappe.get_doc("Sales Invoice", sales_invoice) - + if se_item.item_code in packing_item_parent_map: ref_item = si.get({"item_code": packing_item_parent_map[se_item.item_code]}) else: ref_item = si.get({"item_code": se_item.item_code}) - + if not ref_item: continue - + ref_item = ref_item[0] - + account = get_sales_account_from_item(si, ref_item) - + if account not in children: children.append(account) - + if not parent: parent = {"account": si.debit_to} break - + if len(invoices_against_delivery) == 1: parent["against_invoice"] = invoices_against_delivery[0] - + result = [parent] + [{"account": account} for account in children] - + return result - + def get_invoice_list(doctype, link_field, value): if isinstance(value, basestring): value = [value] - + return frappe.db.sql_list("""select distinct parent from `tab%s` where docstatus = 1 and `%s` in (%s)""" % (doctype, link_field, ", ".join(["%s"]*len(value))), tuple(value)) - + def make_return_jv_from_purchase_receipt(se, ref): invoice_against_receipt = get_invoice_list("Purchase Invoice Item", "purchase_receipt", ref.doc.name) - + if not invoice_against_receipt: - purchase_orders_against_receipt = [d.prevdoc_docname for d in - ref.get({"prevdoc_doctype": "Purchase Order"}) if d.prevdoc_docname] - + purchase_orders_against_receipt = [d.prevdoc_docname for d in + ref.doc.get(ref.doc.fname, {"prevdoc_doctype": "Purchase Order"}) + if getattr(d, "prevdoc_docname", None)] + if purchase_orders_against_receipt: invoice_against_receipt = get_invoice_list("Purchase Invoice Item", "purchase_order", purchase_orders_against_receipt) - + if not invoice_against_receipt: return [] - + parent = {} children = [] - + for se_item in se.get("mtn_details"): for purchase_invoice in invoice_against_receipt: pi = frappe.get_doc("Purchase Invoice", purchase_invoice) ref_item = pi.get({"item_code": se_item.item_code}) - + if not ref_item: continue - + ref_item = ref_item[0] - + account = ref_item.expense_account - + if account not in children: children.append(account) - + if not parent: parent = {"account": pi.credit_to} break - + if len(invoice_against_receipt) == 1: parent["against_voucher"] = invoice_against_receipt[0] - + result = [parent] + [{"account": account} for account in children] - - return result \ No newline at end of file + + return result diff --git a/erpnext/stock/doctype/stock_entry/test_stock_entry.py b/erpnext/stock/doctype/stock_entry/test_stock_entry.py index 0aa043333e..f8cdeb79d1 100644 --- a/erpnext/stock/doctype/stock_entry/test_stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/test_stock_entry.py @@ -3,6 +3,7 @@ from __future__ import unicode_literals import frappe, unittest +import frappe.defaults from frappe.utils import flt, getdate from erpnext.stock.doctype.serial_no.serial_no import * from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory @@ -31,7 +32,6 @@ class TestStockEntry(unittest.TestCase): st2.submit() from erpnext.stock.utils import reorder_item - reorder_item() mr_name = frappe.db.sql("""select parent from `tabMaterial Request Item` @@ -39,8 +39,6 @@ class TestStockEntry(unittest.TestCase): self.assertTrue(mr_name) - frappe.db.set_default("company", self.old_default_company) - def test_material_receipt_gl_entry(self): self._clear_stock_account_balance() set_perpetual_inventory() @@ -367,14 +365,14 @@ class TestStockEntry(unittest.TestCase): def _test_sales_return_jv(self, se): from erpnext.stock.doctype.stock_entry.stock_entry import make_return_jv - jv_list = make_return_jv(se.name) + jv = make_return_jv(se.name) - self.assertEqual(len(jv_list), 3) - self.assertEqual(jv_list[0].get("voucher_type"), "Credit Note") - self.assertEqual(jv_list[0].get("posting_date"), se.posting_date) - self.assertEqual(jv_list[1].get("account"), "_Test Customer - _TC") - self.assertEqual(jv_list[2].get("account"), "Sales - _TC") - self.assertTrue(jv_list[1].get("against_invoice")) + self.assertEqual(len(jv.get("entries")), 2) + self.assertEqual(jv.get("voucher_type"), "Credit Note") + self.assertEqual(jv.get("posting_date"), se.posting_date) + self.assertEqual(jv.get("entries")[0].get("account"), "_Test Customer - _TC") + self.assertEqual(jv.get("entries")[1].get("account"), "Sales - _TC") + self.assertTrue(jv.get("entries")[0].get("against_invoice")) def test_make_return_jv_for_sales_invoice_non_packing_item(self): self._clear_stock_account_balance() @@ -527,14 +525,14 @@ class TestStockEntry(unittest.TestCase): def _test_purchase_return_jv(self, se): from erpnext.stock.doctype.stock_entry.stock_entry import make_return_jv - jv_list = make_return_jv(se.name) + jv = make_return_jv(se.name) - self.assertEqual(len(jv_list), 3) - self.assertEqual(jv_list[0].get("voucher_type"), "Debit Note") - self.assertEqual(jv_list[0].get("posting_date"), se.posting_date) - self.assertEqual(jv_list[1].get("account"), "_Test Supplier - _TC") - self.assertEqual(jv_list[2].get("account"), "_Test Account Cost for Goods Sold - _TC") - self.assertTrue(jv_list[1].get("against_voucher")) + self.assertEqual(len(jv.get("entries")), 2) + self.assertEqual(jv.get("voucher_type"), "Debit Note") + self.assertEqual(jv.get("posting_date"), se.posting_date) + self.assertEqual(jv.get("entries")[0].get("account"), "_Test Supplier - _TC") + self.assertEqual(jv.get("entries")[1].get("account"), "_Test Account Cost for Goods Sold - _TC") + self.assertTrue(jv.get("entries")[0].get("against_voucher")) def test_make_return_jv_for_purchase_receipt(self): self._clear_stock_account_balance() @@ -774,10 +772,9 @@ class TestStockEntry(unittest.TestCase): # permission tests def test_warehouse_user(self): - import frappe.defaults set_perpetual_inventory(0) - frappe.defaults.add_default("Warehouse", "_Test Warehouse 1 - _TC1", "test@example.com", "Restriction") + frappe.defaults.add_default("Warehouse", "_Test Warehouse 1 - _TC", "test@example.com", "Restriction") frappe.defaults.add_default("Warehouse", "_Test Warehouse 2 - _TC1", "test2@example.com", "Restriction") frappe.get_doc("User", "test@example.com")\ .add_roles("Sales User", "Sales Manager", "Material User", "Material Manager") @@ -797,15 +794,17 @@ class TestStockEntry(unittest.TestCase): st1.insert() st1.submit() - frappe.defaults.clear_default("Warehouse", "_Test Warehouse 1 - _TC1", "test@example.com", parenttype="Restriction") - frappe.defaults.clear_default("Warehouse", "_Test Warehouse 2 - _TC1", "test2@example.com", parenttype="Restriction") + frappe.defaults.clear_default("Warehouse", "_Test Warehouse 1 - _TC", + "test@example.com", parenttype="Restriction") + frappe.defaults.clear_default("Warehouse", "_Test Warehouse 2 - _TC1", + "test2@example.com", parenttype="Restriction") def test_freeze_stocks (self): self._clear_stock_account_balance() frappe.db.set_value('Stock Settings', None,'stock_auth_role', '') # test freeze_stocks_upto - date_newer_than_test_records = add_days(getdate(test_records[0][0]['posting_date']), 5) + date_newer_than_test_records = add_days(getdate(test_records[0]['posting_date']), 5) frappe.db.set_value("Stock Settings", None, "stock_frozen_upto", date_newer_than_test_records) se = frappe.copy_doc(test_records[0]).insert() self.assertRaises (StockFreezeError, se.submit) diff --git a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py index 17d4282f49..17d683f988 100644 --- a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py +++ b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py @@ -19,15 +19,15 @@ class StockLedgerEntry(DocListController): self.validate_item() validate_warehouse_company(self.warehouse, self.company) self.scrub_posting_time() - + from erpnext.accounts.utils import validate_fiscal_year - validate_fiscal_year(self.posting_date, self.fiscal_year, + validate_fiscal_year(self.posting_date, self.fiscal_year, self.meta.get_label("posting_date")) def on_submit(self): self.check_stock_frozen_date() self.actual_amt_check() - + from erpnext.stock.doctype.serial_no.serial_no import process_serial_no process_serial_no(self) @@ -58,7 +58,7 @@ class StockLedgerEntry(DocListController): msgprint("Stock Ledger Entry: '%s' is mandatory" % k, raise_exception = 1) elif k == 'warehouse': if not frappe.db.exists("Warehouse", self.get(k)): - msgprint("Warehouse: '%s' does not exist in the system. Please check." % + msgprint("Warehouse: '%s' does not exist in the system. Please check." % self.get(k), raise_exception = 1) def validate_item(self): @@ -76,9 +76,9 @@ class StockLedgerEntry(DocListController): frappe.throw("Batch number is mandatory for Item '%s'" % self.item_code) # check if batch belongs to item - if not frappe.db.get_value("Batch", + if not frappe.db.get_value("Batch", {"item": self.item_code, "name": self.batch_no}): - frappe.throw("'%s' is not a valid Batch Number for Item '%s'" % + frappe.throw("'%s' is not a valid Batch Number for Item '%s'" % (self.batch_no, self.item_code)) if not self.stock_uom: @@ -108,4 +108,4 @@ def on_doctype_update(): where Key_name="posting_sort_index" """): frappe.db.commit() frappe.db.sql("""alter table `tabStock Ledger Entry` - add index posting_sort_index(posting_date, posting_time, name)""") \ No newline at end of file + add index posting_sort_index(posting_date, posting_time, name)""") diff --git a/erpnext/stock/doctype/warehouse/test_records.json b/erpnext/stock/doctype/warehouse/test_records.json index 05d30d6eab..e0941af26c 100644 --- a/erpnext/stock/doctype/warehouse/test_records.json +++ b/erpnext/stock/doctype/warehouse/test_records.json @@ -1,25 +1,25 @@ [ { - "company": "_Test Company", - "create_account_under": "Stock Assets - _TC", - "doctype": "Warehouse", + "company": "_Test Company", + "create_account_under": "Stock Assets - _TC", + "doctype": "Warehouse", "warehouse_name": "_Test Warehouse" - }, + }, { - "company": "_Test Company", - "create_account_under": "Fixed Assets - _TC", - "doctype": "Warehouse", + "company": "_Test Company", + "create_account_under": "Fixed Assets - _TC", + "doctype": "Warehouse", "warehouse_name": "_Test Warehouse 1" - }, + }, { - "company": "_Test Company 1", - "create_account_under": "Stock Assets - _TC", - "doctype": "Warehouse", + "company": "_Test Company 1", + "create_account_under": "Stock Assets - _TC", + "doctype": "Warehouse", "warehouse_name": "_Test Warehouse 2" - }, + }, { - "company": "_Test Company", - "doctype": "Warehouse", + "company": "_Test Company", + "doctype": "Warehouse", "warehouse_name": "_Test Warehouse No Account" } -] \ No newline at end of file +] diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index 8a19bb19a7..34558fbbc4 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -169,9 +169,13 @@ def get_sle_before_datetime(args, for_update=False): def get_sle_after_datetime(args, for_update=False): """get Stock Ledger Entries after a particular datetime, for reposting""" # NOTE: using for update of - return get_stock_ledger_entries(args, - ["timestamp(posting_date, posting_time) > timestamp(%(posting_date)s, %(posting_time)s)"], - "asc", for_update=for_update) + conditions = ["timestamp(posting_date, posting_time) > timestamp(%(posting_date)s, %(posting_time)s)"] + + # Excluding name: Workaround for MariaDB timestamp() floating microsecond issue + if args.get("name"): + conditions.append("name!=%(name)s") + + return get_stock_ledger_entries(args, conditions, "asc", for_update=for_update) def get_stock_ledger_entries(args, conditions=None, order="desc", limit=None, for_update=False): """get stock ledger entries filtered by specific posting datetime conditions""" @@ -180,7 +184,7 @@ def get_stock_ledger_entries(args, conditions=None, order="desc", limit=None, fo if not args.get("posting_time"): args["posting_time"] = "00:00" - return frappe.db.sql("""select * from `tabStock Ledger Entry` + return frappe.db.sql("""select *, timestamp(posting_date, posting_time) as "timestamp" from `tabStock Ledger Entry` where item_code = %%(item_code)s and warehouse = %%(warehouse)s and ifnull(is_cancelled, 'No')='No' diff --git a/erpnext/stock/utils.py b/erpnext/stock/utils.py index 0345a7edf9..bce94f389d 100644 --- a/erpnext/stock/utils.py +++ b/erpnext/stock/utils.py @@ -9,34 +9,34 @@ from frappe.defaults import get_global_default from frappe.utils.email_lib import sendmail class InvalidWarehouseCompany(frappe.ValidationError): pass - + def get_stock_balance_on(warehouse, posting_date=None): if not posting_date: posting_date = nowdate() - + stock_ledger_entries = frappe.db.sql(""" - SELECT + SELECT item_code, stock_value - FROM + FROM `tabStock Ledger Entry` - WHERE + WHERE warehouse=%s AND posting_date <= %s ORDER BY timestamp(posting_date, posting_time) DESC, name DESC """, (warehouse, posting_date), as_dict=1) - + sle_map = {} for sle in stock_ledger_entries: sle_map.setdefault(sle.item_code, flt(sle.stock_value)) - + return sum(sle_map.values()) - + def get_latest_stock_balance(): bin_map = {} - for d in frappe.db.sql("""SELECT item_code, warehouse, stock_value as stock_value + for d in frappe.db.sql("""SELECT item_code, warehouse, stock_value as stock_value FROM tabBin""", as_dict=1): bin_map.setdefault(d.warehouse, {}).setdefault(d.item_code, flt(d.stock_value)) - + return bin_map - + def get_bin(item_code, warehouse): bin = frappe.db.get_value("Bin", {"item_code": item_code, "warehouse": warehouse}) if not bin: @@ -58,18 +58,18 @@ def update_bin(args): bin.update_stock(args) return bin else: - msgprint("[Stock Update] Ignored %s since it is not a stock item" + msgprint("[Stock Update] Ignored %s since it is not a stock item" % args.get("item_code")) def get_incoming_rate(args): """Get Incoming Rate based on valuation method""" from erpnext.stock.stock_ledger import get_previous_sle - + in_rate = 0 if args.get("serial_no"): in_rate = get_avg_purchase_rate(args.get("serial_no")) elif args.get("bom_no"): - result = frappe.db.sql("""select ifnull(total_cost, 0) / ifnull(quantity, 1) + result = frappe.db.sql("""select ifnull(total_cost, 0) / ifnull(quantity, 1) from `tabBOM` where name = %s and docstatus=1 and is_active=1""", args.get("bom_no")) in_rate = result and flt(result[0][0]) or 0 else: @@ -84,12 +84,12 @@ def get_incoming_rate(args): elif valuation_method == 'Moving Average': in_rate = previous_sle.get('valuation_rate') or 0 return in_rate - + def get_avg_purchase_rate(serial_nos): """get average value of serial numbers""" - + serial_nos = get_valid_serial_nos(serial_nos) - return flt(frappe.db.sql("""select avg(ifnull(purchase_rate, 0)) from `tabSerial No` + return flt(frappe.db.sql("""select avg(ifnull(purchase_rate, 0)) from `tabSerial No` where name in (%s)""" % ", ".join(["%s"] * len(serial_nos)), tuple(serial_nos))[0][0]) @@ -99,11 +99,11 @@ def get_valuation_method(item_code): if not val_method: val_method = get_global_default('valuation_method') or "FIFO" return val_method - + def get_fifo_rate(previous_stock_queue, qty): """get FIFO (average) Rate from Queue""" if qty >= 0: - total = sum(f[0] for f in previous_stock_queue) + total = sum(f[0] for f in previous_stock_queue) return total and sum(f[0] * f[1] for f in previous_stock_queue) / flt(total) or 0.0 else: outgoing_cost = 0 @@ -123,12 +123,12 @@ def get_fifo_rate(previous_stock_queue, qty): qty_to_pop = 0 # if queue gets blank and qty_to_pop remaining, get average rate of full queue return outgoing_cost / abs(qty) - qty_to_pop - + def get_valid_serial_nos(sr_nos, qty=0, item_code=''): """split serial nos, validate and return list of valid serial nos""" # TODO: remove duplicates in client side serial_nos = cstr(sr_nos).strip().replace(',', '\n').split('\n') - + valid_serial_nos = [] for val in serial_nos: if val: @@ -137,12 +137,12 @@ def get_valid_serial_nos(sr_nos, qty=0, item_code=''): msgprint("You have entered duplicate serial no: '%s'" % val, raise_exception=1) else: valid_serial_nos.append(val) - + if qty and len(valid_serial_nos) != abs(qty): msgprint("Please enter serial nos for " + cstr(abs(qty)) + " quantity against item code: " + item_code, raise_exception=1) - + return valid_serial_nos def validate_warehouse_company(warehouse, company): @@ -151,48 +151,48 @@ def validate_warehouse_company(warehouse, company): frappe.msgprint(_("Warehouse does not belong to company.") + " (" + \ warehouse + ", " + company +")", raise_exception=InvalidWarehouseCompany) -def get_sales_bom_buying_amount(item_code, warehouse, voucher_type, voucher_no, voucher_detail_no, +def get_sales_bom_buying_amount(item_code, warehouse, voucher_type, voucher_no, voucher_detail_no, stock_ledger_entries, item_sales_bom): # sales bom item buying_amount = 0.0 for bom_item in item_sales_bom[item_code]: if bom_item.get("parent_detail_docname")==voucher_detail_no: - buying_amount += get_buying_amount(voucher_type, voucher_no, voucher_detail_no, + buying_amount += get_buying_amount(voucher_type, voucher_no, voucher_detail_no, stock_ledger_entries.get((bom_item.item_code, warehouse), [])) return buying_amount - + def get_buying_amount(voucher_type, voucher_no, item_row, stock_ledger_entries): # IMP NOTE - # stock_ledger_entries should already be filtered by item_code and warehouse and + # stock_ledger_entries should already be filtered by item_code and warehouse and # sorted by posting_date desc, posting_time desc for i, sle in enumerate(stock_ledger_entries): if sle.voucher_type == voucher_type and sle.voucher_no == voucher_no and \ sle.voucher_detail_no == item_row: previous_stock_value = len(stock_ledger_entries) > i+1 and \ flt(stock_ledger_entries[i+1].stock_value) or 0.0 - buying_amount = previous_stock_value - flt(sle.stock_value) - + buying_amount = previous_stock_value - flt(sle.stock_value) + return buying_amount return 0.0 - + def reorder_item(): """ Reorder item if stock reaches reorder level""" if getattr(frappe.local, "auto_indent", None) is None: frappe.local.auto_indent = cint(frappe.db.get_value('Stock Settings', None, 'auto_indent')) - + if frappe.local.auto_indent: material_requests = {} bin_list = frappe.db.sql("""select item_code, warehouse, projected_qty from tabBin where ifnull(item_code, '') != '' and ifnull(warehouse, '') != '' - and exists (select name from `tabItem` - where `tabItem`.name = `tabBin`.item_code and + and exists (select name from `tabItem` + where `tabItem`.name = `tabBin`.item_code and is_stock_item='Yes' and (is_purchase_item='Yes' or is_sub_contracted_item='Yes') and - (ifnull(end_of_life, '')='' or end_of_life > now()))""", as_dict=True) + (ifnull(end_of_life, '')='' or end_of_life > curdate()))""", as_dict=True) for bin in bin_list: #check if re-order is required - item_reorder = frappe.db.get("Item Reorder", + item_reorder = frappe.db.get("Item Reorder", {"parent": bin.item_code, "warehouse": bin.warehouse}) if item_reorder: reorder_level = item_reorder.warehouse_reorder_level @@ -202,15 +202,15 @@ def reorder_item(): reorder_level, reorder_qty = frappe.db.get_value("Item", bin.item_code, ["re_order_level", "re_order_qty"]) material_request_type = "Purchase" - + if flt(reorder_level) and flt(bin.projected_qty) < flt(reorder_level): if flt(reorder_level) - flt(bin.projected_qty) > flt(reorder_qty): reorder_qty = flt(reorder_level) - flt(bin.projected_qty) - + company = frappe.db.get_value("Warehouse", bin.warehouse, "company") or \ frappe.defaults.get_defaults()["company"] or \ frappe.db.sql("""select name from tabCompany limit 1""")[0][0] - + material_requests.setdefault(material_request_type, frappe._dict()).setdefault( company, []).append(frappe._dict({ "item_code": bin.item_code, @@ -218,7 +218,7 @@ def reorder_item(): "reorder_qty": reorder_qty }) ) - + create_material_request(material_requests) def create_material_request(material_requests): @@ -234,21 +234,19 @@ def create_material_request(material_requests): items = material_requests[request_type][company] if not items: continue - - mr = [{ - "doctype": "Material Request", + + mr = frappe.new_doc("Material Request") + mr.update({ "company": company, "fiscal_year": current_fiscal_year, "transaction_date": nowdate(), "material_request_type": request_type - }] - + }) + for d in items: item = frappe.get_doc("Item", d.item_code) - mr.append({ + mr.append("indent_details", { "doctype": "Material Request Item", - "parenttype": "Material Request", - "parentfield": "indent_details", "item_code": d.item_code, "schedule_date": add_days(nowdate(),cint(item.lead_time_days)), "uom": item.stock_uom, @@ -259,11 +257,10 @@ def create_material_request(material_requests): "qty": d.reorder_qty, "brand": item.brand, }) - - mr_doc = frappe.get_doc(mr) - mr_doc.insert() - mr_doc.submit() - mr_list.append(mr_doc) + + mr.insert() + mr.submit() + mr_list.append(mr) except: if frappe.local.message_log: @@ -274,24 +271,24 @@ def create_material_request(material_requests): if mr_list: if getattr(frappe.local, "reorder_email_notify", None) is None: - frappe.local.reorder_email_notify = cint(frappe.db.get_value('Stock Settings', None, + frappe.local.reorder_email_notify = cint(frappe.db.get_value('Stock Settings', None, 'reorder_email_notify')) - + if(frappe.local.reorder_email_notify): send_email_notification(mr_list) if exceptions_list: notify_errors(exceptions_list) - + def send_email_notification(mr_list): """ Notify user about auto creation of indent""" - - email_list = frappe.db.sql_list("""select distinct r.parent + + email_list = frappe.db.sql_list("""select distinct r.parent 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 r.role in ('Purchase Manager','Material Manager') and p.name not in ('Administrator', 'All', 'Guest')""") - + msg="""

Following Material Requests has been raised automatically \ based on item reorder level:

""" for mr in mr_list: @@ -302,13 +299,13 @@ def send_email_notification(mr_list): cstr(item.qty) + "
" msg += "
Item CodeWarehouseQtyUOM
" + item.item_code + "" + item.warehouse + "" + \ diff --git a/erpnext/support/doctype/customer_issue/customer_issue.py b/erpnext/support/doctype/customer_issue/customer_issue.py index 406ea61529..619452b4cf 100644 --- a/erpnext/support/doctype/customer_issue/customer_issue.py +++ b/erpnext/support/doctype/customer_issue/customer_issue.py @@ -14,20 +14,20 @@ from erpnext.utilities.transaction_base import TransactionBase class CustomerIssue(TransactionBase): def validate(self): - if session['user'] != 'Guest' and not self.doc.customer: + if session['user'] != 'Guest' and not self.customer: msgprint("Please select Customer from whom issue is raised", raise_exception=True) - if self.doc.status=="Closed" and \ - frappe.db.get_value("Customer Issue", self.doc.name, "status")!="Closed": - self.doc.resolution_date = today() - self.doc.resolved_by = frappe.session.user + if self.status=="Closed" and \ + frappe.db.get_value("Customer Issue", self.name, "status")!="Closed": + self.resolution_date = today() + self.resolved_by = frappe.session.user def on_cancel(self): lst = frappe.db.sql("""select t1.name from `tabMaintenance Visit` t1, `tabMaintenance Visit Purpose` t2 where t2.parent = t1.name and t2.prevdoc_docname = %s and t1.docstatus!=2""", - (self.doc.name)) + (self.name)) if lst: lst1 = ','.join([x[0] for x in lst]) msgprint("Maintenance Visit No. "+lst1+" already created against this customer issue. So can not be Cancelled") diff --git a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py index 9f7aef13c1..1c40552711 100644 --- a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py +++ b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py @@ -24,7 +24,7 @@ class MaintenanceSchedule(TransactionBase): def generate_schedule(self): self.set('maintenance_schedule_detail', []) frappe.db.sql("""delete from `tabMaintenance Schedule Detail` - where parent=%s""", (self.doc.name)) + where parent=%s""", (self.name)) count = 1 for d in self.get('item_maintenance_detail'): self.validate_maintenance_detail() @@ -63,21 +63,21 @@ class MaintenanceSchedule(TransactionBase): scheduled_date = frappe.db.sql("""select scheduled_date from `tabMaintenance Schedule Detail` where sales_person=%s and item_code=%s and - parent=%s""", (d.sales_person, d.item_code, self.doc.name), as_dict=1) + parent=%s""", (d.sales_person, d.item_code, self.name), as_dict=1) for key in scheduled_date: if email_map[d.sales_person]: description = "Reference: %s, Item Code: %s and Customer: %s" % \ - (self.doc.name, d.item_code, self.doc.customer) + (self.name, d.item_code, self.customer) frappe.bean({ "doctype": "Event", - "owner": email_map[d.sales_person] or self.doc.owner, + "owner": email_map[d.sales_person] or self.owner, "subject": description, "description": description, "starts_on": key["scheduled_date"] + " 10:00:00", "event_type": "Private", - "ref_type": self.doc.doctype, - "ref_name": self.doc.name + "ref_type": self.doctype, + "ref_name": self.name }).insert(ignore_permissions=1) frappe.db.set(self.doc, 'status', 'Submitted') @@ -204,7 +204,7 @@ class MaintenanceSchedule(TransactionBase): def update_amc_date(self, serial_nos, amc_expiry_date=None): for serial_no in serial_nos: serial_no_bean = frappe.bean("Serial No", serial_no) - serial_no_bean.doc.amc_expiry_date = amc_expiry_date + serial_no_bean.amc_expiry_date = amc_expiry_date serial_no_bean.save() def validate_serial_no(self, serial_nos, amc_start_date): @@ -262,10 +262,10 @@ class MaintenanceSchedule(TransactionBase): serial_nos = get_valid_serial_nos(d.serial_no) self.update_amc_date(serial_nos) frappe.db.set(self.doc, 'status', 'Cancelled') - delete_events(self.doc.doctype, self.doc.name) + delete_events(self.doctype, self.name) def on_trash(self): - delete_events(self.doc.doctype, self.doc.name) + delete_events(self.doctype, self.name) @frappe.whitelist() def make_maintenance_visit(source_name, target_doclist=None): diff --git a/erpnext/support/doctype/maintenance_visit/maintenance_visit.py b/erpnext/support/doctype/maintenance_visit/maintenance_visit.py index 234756bf9a..c3f9181493 100644 --- a/erpnext/support/doctype/maintenance_visit/maintenance_visit.py +++ b/erpnext/support/doctype/maintenance_visit/maintenance_visit.py @@ -34,15 +34,15 @@ class MaintenanceVisit(TransactionBase): for d in self.get('maintenance_visit_details'): if d.prevdoc_docname and d.prevdoc_doctype == 'Customer Issue' : if flag==1: - mntc_date = self.doc.mntc_date + mntc_date = self.mntc_date service_person = d.service_person work_done = d.work_done - if self.doc.completion_status == 'Fully Completed': + if self.completion_status == 'Fully Completed': status = 'Closed' - elif self.doc.completion_status == 'Partially Completed': + elif self.completion_status == 'Partially Completed': status = 'Work In Progress' else: - nm = frappe.db.sql("select t1.name, t1.mntc_date, t2.service_person, t2.work_done from `tabMaintenance Visit` t1, `tabMaintenance Visit Purpose` t2 where t2.parent = t1.name and t1.completion_status = 'Partially Completed' and t2.prevdoc_docname = %s and t1.name!=%s and t1.docstatus = 1 order by t1.name desc limit 1", (d.prevdoc_docname, self.doc.name)) + nm = frappe.db.sql("select t1.name, t1.mntc_date, t2.service_person, t2.work_done from `tabMaintenance Visit` t1, `tabMaintenance Visit Purpose` t2 where t2.parent = t1.name and t1.completion_status = 'Partially Completed' and t2.prevdoc_docname = %s and t1.name!=%s and t1.docstatus = 1 order by t1.name desc limit 1", (d.prevdoc_docname, self.name)) if nm: status = 'Work In Progress' @@ -67,7 +67,7 @@ class MaintenanceVisit(TransactionBase): check_for_doctype = d.prevdoc_doctype if check_for_docname: - check = frappe.db.sql("select t1.name from `tabMaintenance Visit` t1, `tabMaintenance Visit Purpose` t2 where t2.parent = t1.name and t1.name!=%s and t2.prevdoc_docname=%s and t1.docstatus = 1 and (t1.mntc_date > %s or (t1.mntc_date = %s and t1.mntc_time > %s))", (self.doc.name, check_for_docname, self.doc.mntc_date, self.doc.mntc_date, self.doc.mntc_time)) + check = frappe.db.sql("select t1.name from `tabMaintenance Visit` t1, `tabMaintenance Visit Purpose` t2 where t2.parent = t1.name and t1.name!=%s and t2.prevdoc_docname=%s and t1.docstatus = 1 and (t1.mntc_date > %s or (t1.mntc_date = %s and t1.mntc_time > %s))", (self.name, check_for_docname, self.mntc_date, self.mntc_date, self.mntc_time)) if check: check_lst = [x[0] for x in check] diff --git a/erpnext/support/doctype/newsletter/newsletter.py b/erpnext/support/doctype/newsletter/newsletter.py index 7ede45c035..aed338ac82 100644 --- a/erpnext/support/doctype/newsletter/newsletter.py +++ b/erpnext/support/doctype/newsletter/newsletter.py @@ -12,23 +12,23 @@ from frappe.model.document import Document class Newsletter(Document): def onload(self): - if self.doc.email_sent: - self.doc.fields["__status_count"] = dict(frappe.db.sql("""select status, count(*) + if self.email_sent: + self.set("__status_count", dict(frappe.db.sql("""select status, count(*)) from `tabBulk Email` where ref_doctype=%s and ref_docname=%s - group by status""", (self.doc.doctype, self.doc.name))) or None + group by status""", (self.doctype, self.name))) or None def test_send(self, doctype="Lead"): - self.recipients = self.doc.test_email_id.split(",") + self.recipients = self.test_email_id.split(",") self.send_to_doctype = "Lead" self.send_bulk() msgprint("{send} {email}".format**{ "send": _("Scheduled to send to"), - "email": self.doc.test_email_id + "email": self.test_email_id }) def send_emails(self): """send emails to leads and customers""" - if self.doc.email_sent: + if self.email_sent: throw(_("Newsletter has already been sent")) self.recipients = self.get_recipients() @@ -44,23 +44,23 @@ class Newsletter(Document): def get_recipients(self): self.email_field = None - if self.doc.send_to_type=="Contact": + if self.send_to_type=="Contact": self.send_to_doctype = "Contact" - if self.doc.contact_type == "Customer": + if self.contact_type == "Customer": return frappe.db.sql_list("""select email_id from tabContact where ifnull(email_id, '') != '' and ifnull(customer, '') != ''""") - elif self.doc.contact_type == "Supplier": + elif self.contact_type == "Supplier": return frappe.db.sql_list("""select email_id from tabContact where ifnull(email_id, '') != '' and ifnull(supplier, '') != ''""") - elif self.doc.send_to_type=="Lead": + elif self.send_to_type=="Lead": self.send_to_doctype = "Lead" conditions = [] - if self.doc.lead_source and self.doc.lead_source != "All": - conditions.append(" and source='%s'" % self.doc.lead_source.replace("'", "\'")) - if self.doc.lead_status and self.doc.lead_status != "All": - conditions.append(" and status='%s'" % self.doc.lead_status.replace("'", "\'")) + if self.lead_source and self.lead_source != "All": + conditions.append(" and source='%s'" % self.lead_source.replace("'", "\'")) + if self.lead_status and self.lead_status != "All": + conditions.append(" and status='%s'" % self.lead_status.replace("'", "\'")) if conditions: conditions = "".join(conditions) @@ -68,7 +68,7 @@ class Newsletter(Document): return frappe.db.sql_list("""select email_id from tabLead where ifnull(email_id, '') != '' %s""" % (conditions or "")) - elif self.doc.send_to_type=="Employee": + elif self.send_to_type=="Employee": self.send_to_doctype = "Employee" self.email_field = "company_email" @@ -76,8 +76,8 @@ class Newsletter(Document): if(ifnull(company_email, '')!='', company_email, personal_email) as email_id from `tabEmployee` where status='Active'""") - elif self.doc.email_list: - email_list = [cstr(email).strip() for email in self.doc.email_list.split(",")] + elif self.email_list: + email_list = [cstr(email).strip() for email in self.email_list.split(",")] for email in email_list: create_lead(email) @@ -87,7 +87,7 @@ class Newsletter(Document): def send_bulk(self): self.validate_send() - sender = self.doc.send_from or frappe.utils.get_formatted_email(self.doc.owner) + sender = self.send_from or frappe.utils.get_formatted_email(self.owner) from frappe.utils.email_lib.bulk import send @@ -95,15 +95,15 @@ class Newsletter(Document): frappe.db.auto_commit_on_many_writes = True send(recipients = self.recipients, sender = sender, - subject = self.doc.subject, message = self.doc.message, + subject = self.subject, message = self.message, doctype = self.send_to_doctype, email_field = self.email_field or "email_id", - ref_doctype = self.doc.doctype, ref_docname = self.doc.name) + ref_doctype = self.doctype, ref_docname = self.name) if not frappe.flags.in_test: frappe.db.auto_commit_on_many_writes = False def validate_send(self): - if self.doc.fields.get("__islocal"): + if self.get("__islocal"): throw(_("Please save the Newsletter before sending.")) from frappe import conf diff --git a/erpnext/support/doctype/newsletter/test_newsletter.py b/erpnext/support/doctype/newsletter/test_newsletter.py index 1eff657746..f94c8d5fb3 100644 --- a/erpnext/support/doctype/newsletter/test_newsletter.py +++ b/erpnext/support/doctype/newsletter/test_newsletter.py @@ -14,7 +14,7 @@ class TestNewsletter(unittest.TestCase): def test_get_recipients_lead_by_status(self): w = frappe.bean(test_records[0]) - w.doc.lead_status="Converted" + w.lead_status="Converted" w.insert() self.assertTrue("test_lead3@example.com" in w.controller.get_recipients()) @@ -25,7 +25,7 @@ class TestNewsletter(unittest.TestCase): def test_get_recipients_contact_supplier(self): w = frappe.bean(test_records[1]) - w.doc.contact_type="Supplier" + w.contact_type="Supplier" w.insert() self.assertTrue("test_contact_supplier@example.com" in w.controller.get_recipients()) diff --git a/erpnext/support/doctype/support_email_settings/support_email_settings.py b/erpnext/support/doctype/support_email_settings/support_email_settings.py index 011a94368c..e4e33f8636 100644 --- a/erpnext/support/doctype/support_email_settings/support_email_settings.py +++ b/erpnext/support/doctype/support_email_settings/support_email_settings.py @@ -14,20 +14,20 @@ class SupportEmailSettings(Document): """ Checks support ticket email settings """ - if self.doc.sync_support_mails and self.doc.mail_server: + if self.sync_support_mails and self.mail_server: from frappe.utils.email_lib.receive import POP3Mailbox import _socket, poplib inc_email = frappe.get_doc('Incoming Email Settings') # inc_email.encode() - inc_email.host = self.doc.mail_server - inc_email.use_ssl = self.doc.use_ssl + inc_email.host = self.mail_server + inc_email.use_ssl = self.use_ssl try: err_msg = 'User Name or Support Password missing. Please enter and try again.' - if not (self.doc.mail_login and self.doc.mail_password): + if not (self.mail_login and self.mail_password): raise AttributeError, err_msg - inc_email.username = self.doc.mail_login - inc_email.password = self.doc.mail_password + inc_email.username = self.mail_login + inc_email.password = self.mail_password except AttributeError, e: frappe.msgprint(err_msg) raise diff --git a/erpnext/support/doctype/support_ticket/get_support_mails.py b/erpnext/support/doctype/support_ticket/get_support_mails.py index 8ac5eba17a..0edf54a1a6 100644 --- a/erpnext/support/doctype/support_ticket/get_support_mails.py +++ b/erpnext/support/doctype/support_ticket/get_support_mails.py @@ -19,7 +19,7 @@ class SupportMailbox(POP3Mailbox): }) def process_message(self, mail): - if mail.from_email == self.email_settings.fields.get('support_email'): + if mail.from_email == self.email_settings.get('support_email'): return thread_id = mail.get_thread_id() new_ticket = False @@ -35,8 +35,8 @@ class SupportMailbox(POP3Mailbox): self.send_auto_reply(ticket.doc) def send_auto_reply(self, d): - signature = self.email_settings.fields.get('support_signature') or '' - response = self.email_settings.fields.get('support_autoreply') or (""" + signature = self.email_settings.get('support_signature') or '' + response = self.email_settings.get('support_autoreply') or (""" A new Ticket has been raised for your query. If you have any additional information, please reply back to this mail. @@ -48,7 +48,7 @@ Original Query: sendmail(\ recipients = [cstr(d.raised_by)], \ - sender = cstr(self.email_settings.fields.get('support_email')), \ + sender = cstr(self.email_settings.get('support_email')), \ subject = '['+cstr(d.name)+'] ' + cstr(d.subject), \ msg = cstr(response)) @@ -59,9 +59,9 @@ def get_support_mails(): def add_support_communication(subject, content, sender, docname=None, mail=None): if docname: ticket = frappe.bean("Support Ticket", docname) - ticket.doc.status = 'Open' + ticket.status = 'Open' ticket.ignore_permissions = True - ticket.doc.save() + ticket.save() else: ticket = frappe.bean([decode_dict({ "doctype":"Support Ticket", @@ -76,7 +76,7 @@ def add_support_communication(subject, content, sender, docname=None, mail=None) ticket.insert() _make(content=content, sender=sender, subject = subject, - doctype="Support Ticket", name=ticket.doc.name, + doctype="Support Ticket", name=ticket.name, date=mail.date if mail else today(), sent_or_received="Received") if mail: diff --git a/erpnext/support/doctype/support_ticket/support_ticket.py b/erpnext/support/doctype/support_ticket/support_ticket.py index a01dad3814..6aa5b789d2 100644 --- a/erpnext/support/doctype/support_ticket/support_ticket.py +++ b/erpnext/support/doctype/support_ticket/support_ticket.py @@ -13,7 +13,7 @@ class SupportTicket(TransactionBase): return frappe.db.get_value('Support Email Settings',None,'support_email') def get_subject(self, comm): - return '[' + self.doc.name + '] ' + (comm.subject or 'No Subject Specified') + return '[' + self.name + '] ' + (comm.subject or 'No Subject Specified') def get_content(self, comm): signature = frappe.db.get_value('Support Email Settings',None,'support_signature') @@ -27,38 +27,38 @@ class SupportTicket(TransactionBase): def validate(self): self.update_status() - self.set_lead_contact(self.doc.raised_by) + self.set_lead_contact(self.raised_by) - if self.doc.status == "Closed": + if self.status == "Closed": from frappe.widgets.form.assign_to import clear - clear(self.doc.doctype, self.doc.name) + clear(self.doctype, self.name) def set_lead_contact(self, email_id): import email.utils email_id = email.utils.parseaddr(email_id) if email_id: - if not self.doc.lead: - self.doc.lead = frappe.db.get_value("Lead", {"email_id": email_id}) - if not self.doc.contact: - self.doc.contact = frappe.db.get_value("Contact", {"email_id": email_id}) + if not self.lead: + self.lead = frappe.db.get_value("Lead", {"email_id": email_id}) + if not self.contact: + self.contact = frappe.db.get_value("Contact", {"email_id": email_id}) - if not self.doc.company: - self.doc.company = frappe.db.get_value("Lead", self.doc.lead, "company") or \ + if not self.company: + self.company = frappe.db.get_value("Lead", self.lead, "company") or \ frappe.db.get_default("company") def update_status(self): - status = frappe.db.get_value("Support Ticket", self.doc.name, "status") - if self.doc.status!="Open" and status =="Open" and not self.doc.first_responded_on: - self.doc.first_responded_on = now() - if self.doc.status=="Closed" and status !="Closed": - self.doc.resolution_date = now() - if self.doc.status=="Open" and status !="Open": - self.doc.resolution_date = "" + status = frappe.db.get_value("Support Ticket", self.name, "status") + if self.status!="Open" and status =="Open" and not self.first_responded_on: + self.first_responded_on = now() + if self.status=="Closed" and status !="Closed": + self.resolution_date = now() + if self.status=="Open" and status !="Open": + self.resolution_date = "" @frappe.whitelist() def set_status(name, status): st = frappe.bean("Support Ticket", name) - st.doc.status = status + st.status = status st.save() def auto_close_tickets(): diff --git a/erpnext/utilities/cleanup_data.py b/erpnext/utilities/cleanup_data.py index c6a78c3163..328eed1296 100644 --- a/erpnext/utilities/cleanup_data.py +++ b/erpnext/utilities/cleanup_data.py @@ -157,8 +157,8 @@ def reset_global_defaults(): from frappe.model.code import get_obj gd = get_obj('Global Defaults', 'Global Defaults') for d in flds: - gd.doc.fields[d] = flds[d] - gd.doc.save() + gd.set(d, flds[d]) + gd.save() frappe.clear_cache() diff --git a/erpnext/utilities/doctype/address/address.py b/erpnext/utilities/doctype/address/address.py index 778451b073..9c9316c9f4 100644 --- a/erpnext/utilities/doctype/address/address.py +++ b/erpnext/utilities/doctype/address/address.py @@ -12,12 +12,12 @@ from frappe.model.document import Document class Address(Document): def autoname(self): - if not self.doc.address_title: - self.doc.address_title = self.doc.customer \ - or self.doc.supplier or self.doc.sales_partner or self.doc.lead + if not self.address_title: + self.address_title = self.customer \ + or self.supplier or self.sales_partner or self.lead - if self.doc.address_title: - self.doc.name = cstr(self.doc.address_title).strip() + "-" + cstr(self.doc.address_type).strip() + if self.address_title: + self.name = cstr(self.address_title).strip() + "-" + cstr(self.address_type).strip() else: throw(_("Address Title is mandatory.")) @@ -27,28 +27,28 @@ class Address(Document): def validate_primary_address(self): """Validate that there can only be one primary address for particular customer, supplier""" - if self.doc.is_primary_address == 1: + if self.is_primary_address == 1: self._unset_other("is_primary_address") - elif self.doc.is_shipping_address != 1: + elif self.is_shipping_address != 1: for fieldname in ["customer", "supplier", "sales_partner", "lead"]: - if self.doc.fields.get(fieldname): + if self.get(fieldname): if not frappe.db.sql("""select name from `tabAddress` where is_primary_address=1 and `%s`=%s and name!=%s""" % (fieldname, "%s", "%s"), - (self.doc.fields[fieldname], self.doc.name)): - self.doc.is_primary_address = 1 + (self.fields[fieldname], self.name)): + self.is_primary_address = 1 break def validate_shipping_address(self): """Validate that there can only be one shipping address for particular customer, supplier""" - if self.doc.is_shipping_address == 1: + if self.is_shipping_address == 1: self._unset_other("is_shipping_address") def _unset_other(self, is_address_type): for fieldname in ["customer", "supplier", "sales_partner", "lead"]: - if self.doc.fields.get(fieldname): + if self.get(fieldname): frappe.db.sql("""update `tabAddress` set `%s`=0 where `%s`=%s and name!=%s""" % - (is_address_type, fieldname, "%s", "%s"), (self.doc.fields[fieldname], self.doc.name)) + (is_address_type, fieldname, "%s", "%s"), (self.fields[fieldname], self.name)) break @frappe.whitelist() diff --git a/erpnext/utilities/doctype/contact/contact.py b/erpnext/utilities/doctype/contact/contact.py index 16522a85eb..96cc879d2e 100644 --- a/erpnext/utilities/doctype/contact/contact.py +++ b/erpnext/utilities/doctype/contact/contact.py @@ -11,13 +11,13 @@ class Contact(StatusUpdater): def autoname(self): # concat first and last name - self.doc.name = " ".join(filter(None, - [cstr(self.doc.fields.get(f)).strip() for f in ["first_name", "last_name"]])) + self.name = " ".join(filter(None, + [cstr(self.get(f)).strip() for f in ["first_name", "last_name"]])) # concat party name if reqd for fieldname in ("customer", "supplier", "sales_partner"): - if self.doc.fields.get(fieldname): - self.doc.name = self.doc.name + "-" + cstr(self.doc.fields.get(fieldname)).strip() + if self.get(fieldname): + self.name = self.name + "-" + cstr(self.get(fieldname)).strip() break def validate(self): @@ -25,34 +25,34 @@ class Contact(StatusUpdater): self.validate_primary_contact() def validate_primary_contact(self): - if self.doc.is_primary_contact == 1: - if self.doc.customer: + if self.is_primary_contact == 1: + if self.customer: frappe.db.sql("update tabContact set is_primary_contact=0 where customer = %s", - (self.doc.customer)) - elif self.doc.supplier: + (self.customer)) + elif self.supplier: frappe.db.sql("update tabContact set is_primary_contact=0 where supplier = %s", - (self.doc.supplier)) - elif self.doc.sales_partner: + (self.supplier)) + elif self.sales_partner: frappe.db.sql("""update tabContact set is_primary_contact=0 - where sales_partner = %s""", (self.doc.sales_partner)) + where sales_partner = %s""", (self.sales_partner)) else: - if self.doc.customer: + if self.customer: if not frappe.db.sql("select name from tabContact \ - where is_primary_contact=1 and customer = %s", (self.doc.customer)): - self.doc.is_primary_contact = 1 - elif self.doc.supplier: + where is_primary_contact=1 and customer = %s", (self.customer)): + self.is_primary_contact = 1 + elif self.supplier: if not frappe.db.sql("select name from tabContact \ - where is_primary_contact=1 and supplier = %s", (self.doc.supplier)): - self.doc.is_primary_contact = 1 - elif self.doc.sales_partner: + where is_primary_contact=1 and supplier = %s", (self.supplier)): + self.is_primary_contact = 1 + elif self.sales_partner: if not frappe.db.sql("select name from tabContact \ where is_primary_contact=1 and sales_partner = %s", - self.doc.sales_partner): - self.doc.is_primary_contact = 1 + self.sales_partner): + self.is_primary_contact = 1 def on_trash(self): frappe.db.sql("""update `tabSupport Ticket` set contact='' where contact=%s""", - self.doc.name) + self.name) @frappe.whitelist() def get_contact_details(contact): diff --git a/erpnext/utilities/doctype/note/note.py b/erpnext/utilities/doctype/note/note.py index 8936da77a9..a53313bb6d 100644 --- a/erpnext/utilities/doctype/note/note.py +++ b/erpnext/utilities/doctype/note/note.py @@ -13,16 +13,16 @@ class Note(Document): def autoname(self): # replace forbidden characters import re - self.doc.name = re.sub("[%'\"#*?`]", "", self.doc.title.strip()) + self.name = re.sub("[%'\"#*?`]", "", self.title.strip()) def onload(self): - if not self.doc.public and frappe.session.user != self.doc.owner: + if not self.public and frappe.session.user != self.owner: if frappe.session.user not in [d.user for d in self.doclist if d.doctype=="Note User"]: frappe.msgprint("You are not authorized to read this record.", raise_exception=True) def validate(self): - if not self.doc.fields.get("__islocal"): - if frappe.session.user != self.doc.owner: + if not self.get("__islocal"): + if frappe.session.user != self.owner: if frappe.session.user not in frappe.db.sql_list("""select user from `tabNote User` - where parent=%s and permission='Edit'""", self.doc.name): + where parent=%s and permission='Edit'""", self.name): frappe.msgprint("You are not authorized to edit this record.", raise_exception=True) diff --git a/erpnext/utilities/doctype/sms_control/sms_control.py b/erpnext/utilities/doctype/sms_control/sms_control.py index 3a23558573..74b6e41a3d 100644 --- a/erpnext/utilities/doctype/sms_control/sms_control.py +++ b/erpnext/utilities/doctype/sms_control/sms_control.py @@ -70,14 +70,14 @@ class SmsControl(Document): def send_via_gateway(self, arg): ss = get_obj('SMS Settings', 'SMS Settings', with_children=1) - args = {ss.doc.message_parameter : arg.get('message')} + args = {ss.message_parameter : arg.get('message')} for d in getlist(ss.doclist, 'static_parameter_details'): args[d.parameter] = d.value resp = [] for d in arg.get('receiver_list'): - args[ss.doc.receiver_parameter] = d - resp.append(self.send_request(ss.doc.sms_gateway_url, args)) + args[ss.receiver_parameter] = d + resp.append(self.send_request(ss.sms_gateway_url, args)) return resp diff --git a/erpnext/utilities/repost_stock.py b/erpnext/utilities/repost_stock.py index b9211fb248..507974bfc7 100644 --- a/erpnext/utilities/repost_stock.py +++ b/erpnext/utilities/repost_stock.py @@ -120,12 +120,12 @@ def update_bin(item_code, warehouse, qty_dict=None): bin = get_bin(item_code, warehouse) mismatch = False for fld, val in qty_dict.items(): - if flt(bin.doc.fields.get(fld)) != flt(val): - bin.doc.fields[fld] = flt(val) + if flt(bin.get(fld)) != flt(val): + bin.set(fld, flt(val)) mismatch = True if mismatch: - bin.doc.projected_qty = flt(bin.doc.actual_qty) + flt(bin.doc.ordered_qty) + \ - flt(bin.doc.indented_qty) + flt(bin.doc.planned_qty) - flt(bin.doc.reserved_qty) + bin.projected_qty = flt(bin.actual_qty) + flt(bin.ordered_qty) + \ + flt(bin.indented_qty) + flt(bin.planned_qty) - flt(bin.reserved_qty) - bin.doc.save() \ No newline at end of file + bin.save() \ No newline at end of file diff --git a/erpnext/utilities/transaction_base.py b/erpnext/utilities/transaction_base.py index ee78cede9a..57a07a76c2 100644 --- a/erpnext/utilities/transaction_base.py +++ b/erpnext/utilities/transaction_base.py @@ -11,46 +11,46 @@ from erpnext.controllers.status_updater import StatusUpdater class TransactionBase(StatusUpdater): def load_notification_message(self): - dt = self.doc.doctype.lower().replace(" ", "_") + dt = self.doctype.lower().replace(" ", "_") if int(frappe.db.get_value("Notification Control", None, dt) or 0): - self.doc.fields["__notification_message"] = \ + self.set("__notification_message", \) frappe.db.get_value("Notification Control", None, dt + "_message") def validate_posting_time(self): - if not self.doc.posting_time: - self.doc.posting_time = now_datetime().strftime('%H:%M:%S') + if not self.posting_time: + self.posting_time = now_datetime().strftime('%H:%M:%S') def add_calendar_event(self, opts, force=False): - if self.doc.contact_by != cstr(self._prev.contact_by) or \ - self.doc.contact_date != cstr(self._prev.contact_date) or force: + if self.contact_by != cstr(self._prev.contact_by) or \ + self.contact_date != cstr(self._prev.contact_date) or force: self.delete_events() self._add_calendar_event(opts) def delete_events(self): frappe.delete_doc("Event", frappe.db.sql_list("""select name from `tabEvent` - where ref_type=%s and ref_name=%s""", (self.doc.doctype, self.doc.name)), + where ref_type=%s and ref_name=%s""", (self.doctype, self.name)), ignore_permissions=True) def _add_calendar_event(self, opts): opts = frappe._dict(opts) - if self.doc.contact_date: + if self.contact_date: event_doclist = frappe.get_doc({ "doctype": "Event", - "owner": opts.owner or self.doc.owner, + "owner": opts.owner or self.owner, "subject": opts.subject, "description": opts.description, - "starts_on": self.doc.contact_date + " 10:00:00", + "starts_on": self.contact_date + " 10:00:00", "event_type": "Private", - "ref_type": self.doc.doctype, - "ref_name": self.doc.name + "ref_type": self.doctype, + "ref_name": self.name }) - if frappe.db.exists("User", self.doc.contact_by): + if frappe.db.exists("User", self.contact_by): event_doclist.append("event_individuals", { "doctype": "Event User", - "person": self.doc.contact_by + "person": self.contact_by }) event_doclist.insert() @@ -64,7 +64,7 @@ class TransactionBase(StatusUpdater): ref_doc = {} item_ref_dn = [] for d in self.doclist.get({"doctype": source_dt}): - ref_dn = d.fields.get(val["ref_dn_field"]) + ref_dn = d.get(val["ref_dn_field"]) if ref_dn: if is_child: self.compare_values({key: [ref_dn]}, val["compare_fields"], d) @@ -107,9 +107,9 @@ def validate_uom_is_integer(doclist, uom_field, qty_fields): return for d in doclist: - if d.fields.get(uom_field) in integer_uoms: + if d.get(uom_field) in integer_uoms: for f in qty_fields: - if d.fields.get(f): + if d.get(f): if cint(d.fields[f])!=d.fields[f]: frappe.msgprint(_("For UOM") + " '" + d.fields[uom_field] \ + "': " + _("Quantity cannot be a fraction.") \ From 81ba0b29da8328fd6b6dcec5bab37430f8c8f77a Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 28 Mar 2014 15:23:26 +0530 Subject: [PATCH 08/42] frappe/frappe#478 --- erpnext/accounts/doctype/c_form/c_form.py | 2 +- .../doctype/sales_invoice/sales_invoice.py | 20 +++--- .../doctype/purchase_order/purchase_order.py | 22 +++---- erpnext/buying/doctype/supplier/supplier.py | 2 +- .../supplier_quotation/supplier_quotation.py | 17 +++-- erpnext/controllers/buying_controller.py | 2 +- erpnext/controllers/selling_controller.py | 6 +- erpnext/hr/doctype/appraisal/appraisal.py | 34 ++++------ .../appraisal_template/appraisal_template.py | 3 +- erpnext/hr/doctype/attendance/attendance.py | 4 +- .../leave_allocation/leave_allocation.py | 9 +-- .../leave_control_panel.py | 5 -- erpnext/hr/doctype/salary_slip/salary_slip.py | 4 +- .../salary_structure/salary_structure.py | 12 ++-- erpnext/manufacturing/doctype/bom/bom.py | 8 +-- .../bom_replace_tool/bom_replace_tool.py | 4 -- .../production_order/production_order.py | 12 ++-- .../doctype/workstation/workstation.py | 28 ++++---- erpnext/selling/doctype/customer/customer.py | 2 +- .../installation_note/installation_note.py | 6 +- erpnext/selling/doctype/lead/lead.py | 20 +++--- .../doctype/opportunity/opportunity.py | 12 ++-- .../selling/doctype/quotation/quotation.py | 16 ++--- .../doctype/sales_order/sales_order.py | 54 ++++++++-------- erpnext/setup/doctype/company/company.py | 10 +-- .../notification_control.py | 2 +- .../doctype/delivery_note/delivery_note.py | 18 +++--- .../material_request/material_request.py | 64 +++++++++---------- .../purchase_receipt/purchase_receipt.py | 12 ++-- erpnext/stock/doctype/serial_no/serial_no.py | 5 +- .../stock_ledger_entry/stock_ledger_entry.py | 2 +- .../stock_uom_replace_utility.py | 3 - .../doctype/customer_issue/customer_issue.py | 10 +-- .../maintenance_schedule.py | 14 ++-- .../maintenance_visit/maintenance_visit.py | 4 +- .../support/doctype/newsletter/newsletter.py | 2 +- 36 files changed, 208 insertions(+), 242 deletions(-) diff --git a/erpnext/accounts/doctype/c_form/c_form.py b/erpnext/accounts/doctype/c_form/c_form.py index 48c952f16a..d0df2e4aed 100644 --- a/erpnext/accounts/doctype/c_form/c_form.py +++ b/erpnext/accounts/doctype/c_form/c_form.py @@ -62,7 +62,7 @@ class CForm(Document): def set_total_invoiced_amount(self): total = sum([flt(d.grand_total) for d in self.get('invoice_details')]) - frappe.db.set(self.doc, 'total_invoiced_amount', total) + frappe.db.set(self, 'total_invoiced_amount', total) def get_invoice_details(self, invoice_no): """ Pull details from invoices for referrence """ diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index d916adb295..449fca0f3a 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -374,7 +374,7 @@ class SalesInvoice(SellingController): frappe.db.sql("""delete from `tabC-Form Invoice Detail` where invoice_no = %s and parent = %s""", (self.amended_from, self.c_form_no)) - frappe.db.set(self.doc, 'c_form_no', '') + frappe.db.set(self, 'c_form_no', '') def update_current_stock(self): for d in self.get('entries'): @@ -422,14 +422,14 @@ class SalesInvoice(SellingController): if cint(self.is_pos) == 1: if flt(self.paid_amount) == 0: if self.cash_bank_account: - frappe.db.set(self.doc, 'paid_amount', + frappe.db.set(self, 'paid_amount', (flt(self.grand_total) - flt(self.write_off_amount))) else: # show message that the amount is not paid - frappe.db.set(self.doc,'paid_amount',0) + frappe.db.set(self,'paid_amount',0) frappe.msgprint("Note: Payment Entry will not be created since 'Cash/Bank Account' was not specified.") else: - frappe.db.set(self.doc,'paid_amount',0) + frappe.db.set(self,'paid_amount',0) def check_prev_docstatus(self): for d in self.get('entries'): @@ -609,7 +609,7 @@ class SalesInvoice(SellingController): def convert_to_recurring(self): if self.convert_into_recurring_invoice: if not self.recurring_id: - frappe.db.set(self.doc, "recurring_id", + frappe.db.set(self, "recurring_id", make_autoname("RECINV/.#####")) self.set_next_date() @@ -645,7 +645,7 @@ class SalesInvoice(SellingController): next_date = get_next_date(self.posting_date, month_map[self.recurring_type], cint(self.repeat_on_day_of_month)) - frappe.db.set(self.doc, 'next_date', next_date) + frappe.db.set(self, 'next_date', next_date) def get_next_date(dt, mcount, day=None): dt = getdate(dt) @@ -794,8 +794,8 @@ def get_income_account(doctype, txt, searchfield, start, page_len, filters): @frappe.whitelist() -def make_delivery_note(source_name, target_doclist=None): - from frappe.model.mapper import get_mapped_doclist +def make_delivery_note(source_name, target_doc=None): + from frappe.model.mapper import get_mapped_doc def set_missing_values(source, target): bean = frappe.bean(target) @@ -808,7 +808,7 @@ def make_delivery_note(source_name, target_doclist=None): flt(source_doc.rate) target_doc.qty = flt(source_doc.qty) - flt(source_doc.delivered_qty) - doclist = get_mapped_doclist("Sales Invoice", source_name, { + doclist = get_mapped_doc("Sales Invoice", source_name, { "Sales Invoice": { "doctype": "Delivery Note", "validation": { @@ -835,6 +835,6 @@ def make_delivery_note(source_name, target_doclist=None): }, "add_if_empty": True } - }, target_doclist, set_missing_values) + }, target_doc, set_missing_values) return [d.fields for d in doclist] \ No newline at end of file diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index 7b1c24d37e..066afe02b1 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -135,7 +135,7 @@ class PurchaseOrder(BuyingController): def update_status(self, status): self.check_modified_date() # step 1:=> Set Status - frappe.db.set(self.doc,'status',cstr(status)) + frappe.db.set(self,'status',cstr(status)) # step 2:=> Update Bin self.update_bin(is_submit = (status == 'Submitted') and 1 or 0, is_stopped = 1) @@ -154,7 +154,7 @@ class PurchaseOrder(BuyingController): purchase_controller.update_last_purchase_rate(self, is_submit = 1) - frappe.db.set(self.doc,'status','Submitted') + frappe.db.set(self,'status','Submitted') def on_cancel(self): pc_obj = get_obj(dt = 'Purchase Common') @@ -172,7 +172,7 @@ class PurchaseOrder(BuyingController): msgprint("Purchase Invoice : " + cstr(submitted[0][0]) + " has already been submitted !") raise Exception - frappe.db.set(self.doc,'status','Cancelled') + frappe.db.set(self,'status','Cancelled') self.update_prevdoc_status() self.update_bin( is_submit = 0, is_stopped = 0) pc_obj.update_last_purchase_rate(self, is_submit = 0) @@ -181,8 +181,8 @@ class PurchaseOrder(BuyingController): pass @frappe.whitelist() -def make_purchase_receipt(source_name, target_doclist=None): - from frappe.model.mapper import get_mapped_doclist +def make_purchase_receipt(source_name, target_doc=None): + from frappe.model.mapper import get_mapped_doc def set_missing_values(source, target): bean = frappe.bean(target) @@ -194,7 +194,7 @@ def make_purchase_receipt(source_name, target_doclist=None): target.amount = (flt(obj.qty) - flt(obj.received_qty)) * flt(obj.rate) target.base_amount = (flt(obj.qty) - flt(obj.received_qty)) * flt(obj.base_rate) - doclist = get_mapped_doclist("Purchase Order", source_name, { + doclist = get_mapped_doc("Purchase Order", source_name, { "Purchase Order": { "doctype": "Purchase Receipt", "validation": { @@ -215,13 +215,13 @@ def make_purchase_receipt(source_name, target_doclist=None): "doctype": "Purchase Taxes and Charges", "add_if_empty": True } - }, target_doclist, set_missing_values) + }, target_doc, set_missing_values) return [d.fields for d in doclist] @frappe.whitelist() -def make_purchase_invoice(source_name, target_doclist=None): - from frappe.model.mapper import get_mapped_doclist +def make_purchase_invoice(source_name, target_doc=None): + from frappe.model.mapper import get_mapped_doc def set_missing_values(source, target): bean = frappe.bean(target) @@ -233,7 +233,7 @@ def make_purchase_invoice(source_name, target_doclist=None): if flt(obj.base_rate): target.qty = target.base_amount / flt(obj.base_rate) - doclist = get_mapped_doclist("Purchase Order", source_name, { + doclist = get_mapped_doc("Purchase Order", source_name, { "Purchase Order": { "doctype": "Purchase Invoice", "validation": { @@ -253,6 +253,6 @@ def make_purchase_invoice(source_name, target_doclist=None): "doctype": "Purchase Taxes and Charges", "add_if_empty": True } - }, target_doclist, set_missing_values) + }, target_doc, set_missing_values) return [d.fields for d in doclist] \ No newline at end of file diff --git a/erpnext/buying/doctype/supplier/supplier.py b/erpnext/buying/doctype/supplier/supplier.py index cb97d72432..9179bc2c70 100644 --- a/erpnext/buying/doctype/supplier/supplier.py +++ b/erpnext/buying/doctype/supplier/supplier.py @@ -94,7 +94,7 @@ class Supplier(TransactionBase): def after_rename(self, olddn, newdn, merge=False): set_field = '' if frappe.defaults.get_global_default('supp_master_name') == 'Supplier Name': - frappe.db.set(self.doc, "supplier_name", newdn) + frappe.db.set(self, "supplier_name", newdn) self.update_contact() set_field = ", supplier_name=%(newdn)s" self.update_supplier_address(newdn, set_field) diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py index 8a11bfe7c1..ef48c79989 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py @@ -7,9 +7,8 @@ from frappe.model.code import get_obj from erpnext.controllers.buying_controller import BuyingController class SupplierQuotation(BuyingController): - def __init__(self, doc, doclist=None): - self.doc, self.doclist = doc, doclist or [] - self.tname, self.fname = "Supplier Quotation Item", "quotation_items" + tname = "Supplier Quotation Item" + fname = "quotation_items" def validate(self): super(DocType, self).validate() @@ -26,10 +25,10 @@ class SupplierQuotation(BuyingController): self.validate_uom_is_integer("uom", "qty") def on_submit(self): - frappe.db.set(self.doc, "status", "Submitted") + frappe.db.set(self, "status", "Submitted") def on_cancel(self): - frappe.db.set(self.doc, "status", "Cancelled") + frappe.db.set(self, "status", "Cancelled") def on_trash(self): pass @@ -53,8 +52,8 @@ class SupplierQuotation(BuyingController): pc.validate_for_items(self) @frappe.whitelist() -def make_purchase_order(source_name, target_doclist=None): - from frappe.model.mapper import get_mapped_doclist +def make_purchase_order(source_name, target_doc=None): + from frappe.model.mapper import get_mapped_doc def set_missing_values(source, target): bean = frappe.bean(target) @@ -64,7 +63,7 @@ def make_purchase_order(source_name, target_doclist=None): def update_item(obj, target, source_parent): target.conversion_factor = 1 - doclist = get_mapped_doclist("Supplier Quotation", source_name, { + doclist = get_mapped_doc("Supplier Quotation", source_name, { "Supplier Quotation": { "doctype": "Purchase Order", "validation": { @@ -88,6 +87,6 @@ def make_purchase_order(source_name, target_doclist=None): "doctype": "Purchase Taxes and Charges", "add_if_empty": True }, - }, target_doclist, set_missing_values) + }, target_doc, set_missing_values) return [d.fields for d in doclist] \ No newline at end of file diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index ebf84cdeeb..d0e482e522 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -103,7 +103,7 @@ class BuyingController(StockController): self.net_total += item.base_amount self.net_total_import += item.amount - self.round_floats_in(self.doc, ["net_total", "net_total_import"]) + self.round_floats_in(self, ["net_total", "net_total_import"]) def calculate_totals(self): self.grand_total = flt(self.tax_doclist[-1].total if self.tax_doclist diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index def5eb0dd5..5495e6fb2f 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -172,7 +172,7 @@ class SellingController(StockController): self.net_total += item.base_amount self.net_total_export += item.amount - self.round_floats_in(self.doc, ["net_total", "net_total_export"]) + self.round_floats_in(self, ["net_total", "net_total_export"]) def calculate_totals(self): self.grand_total = flt(self.tax_doclist and \ @@ -223,7 +223,7 @@ class SellingController(StockController): # write_off_amount is only for POS Invoice # total_advance is only for non POS Invoice if self.doctype == "Sales Invoice" and self.docstatus == 0: - self.round_floats_in(self.doc, ["grand_total", "total_advance", "write_off_amount", + self.round_floats_in(self, ["grand_total", "total_advance", "write_off_amount", "paid_amount"]) total_amount_to_pay = self.grand_total - self.write_off_amount self.outstanding_amount = flt(total_amount_to_pay - self.total_advance \ @@ -231,7 +231,7 @@ class SellingController(StockController): def calculate_commission(self): if self.meta.get_field("commission_rate"): - self.round_floats_in(self.doc, ["net_total", "commission_rate"]) + self.round_floats_in(self, ["net_total", "commission_rate"]) if self.commission_rate > 100.0: msgprint(_(self.meta.get_label("commission_rate")) + " " + _("cannot be greater than 100"), raise_exception=True) diff --git a/erpnext/hr/doctype/appraisal/appraisal.py b/erpnext/hr/doctype/appraisal/appraisal.py index 4fd1f99c2a..b7b1421133 100644 --- a/erpnext/hr/doctype/appraisal/appraisal.py +++ b/erpnext/hr/doctype/appraisal/appraisal.py @@ -6,12 +6,11 @@ import frappe from frappe.utils import cstr, flt, getdate from frappe.model.bean import getlist -from frappe import msgprint - +from frappe import msgprint, _ +from frappe.model.mapper import get_mapped_doc from frappe.model.document import Document class Appraisal(Document): - def validate(self): if not self.status: self.status = "Draft" @@ -21,26 +20,23 @@ class Appraisal(Document): self.calculate_total() def get_employee_name(self): - emp_nm = frappe.db.sql("select employee_name from `tabEmployee` where name=%s", self.employee) - emp_nm= emp_nm and emp_nm[0][0] or '' - self.employee_name = emp_nm - return emp_nm + self.employee_name = frappe.db.get_value("Employee", self.employee, "employee_name") + return self.employee_name def validate_dates(self): if getdate(self.start_date) > getdate(self.end_date): - msgprint("End Date can not be less than Start Date") - raise Exception + frappe.throw(_("End Date can not be less than Start Date")) def validate_existing_appraisal(self): chk = frappe.db.sql("""select name from `tabAppraisal` where employee=%s and (status='Submitted' or status='Completed') and ((start_date>=%s and start_date<=%s) - or (end_date>=%s and end_date<=%s))""",(self.employee,self.start_date,self.end_date,self.start_date,self.end_date)) + or (end_date>=%s and end_date<=%s))""", + (self.employee,self.start_date,self.end_date,self.start_date,self.end_date)) if chk: - msgprint("You have already created Appraisal "\ + frappe.throw("You have already created Appraisal "\ +cstr(chk[0][0])+" in the current date range for employee "\ +cstr(self.employee_name)) - raise Exception def calculate_total(self): total, total_w = 0, 0 @@ -61,22 +57,20 @@ class Appraisal(Document): self.total_score = total def on_submit(self): - frappe.db.set(self.doc, 'status', 'Submitted') + frappe.db.set(self, 'status', 'Submitted') def on_cancel(self): - frappe.db.set(self.doc, 'status', 'Cancelled') + frappe.db.set(self, 'status', 'Cancelled') @frappe.whitelist() -def fetch_appraisal_template(source_name, target_doclist=None): - from frappe.model.mapper import get_mapped_doclist - - doclist = get_mapped_doclist("Appraisal Template", source_name, { +def fetch_appraisal_template(source_name, target_doc=None): + target_doc = get_mapped_doc("Appraisal Template", source_name, { "Appraisal Template": { "doctype": "Appraisal", }, "Appraisal Template Goal": { "doctype": "Appraisal Goal", } - }, target_doclist) + }, target_doc) - return [d.fields for d in doclist] \ No newline at end of file + return target_doc \ No newline at end of file diff --git a/erpnext/hr/doctype/appraisal_template/appraisal_template.py b/erpnext/hr/doctype/appraisal_template/appraisal_template.py index bd3cc5f27a..930d509a7a 100644 --- a/erpnext/hr/doctype/appraisal_template/appraisal_template.py +++ b/erpnext/hr/doctype/appraisal_template/appraisal_template.py @@ -8,10 +8,9 @@ from frappe import _ from frappe.model.document import Document class AppraisalTemplate(Document): - def validate(self): self.total_points = 0 - for d in self.doclist.get({"doctype":"Appraisal Template Goal"}): + for d in self.get("kra_sheet"): self.total_points += int(d.per_weightage or 0) if int(self.total_points) != 100: diff --git a/erpnext/hr/doctype/attendance/attendance.py b/erpnext/hr/doctype/attendance/attendance.py index 1478e9f303..24dd1887a6 100644 --- a/erpnext/hr/doctype/attendance/attendance.py +++ b/erpnext/hr/doctype/attendance/attendance.py @@ -6,8 +6,6 @@ import frappe from frappe.utils import getdate, nowdate from frappe import msgprint, _ - - from frappe.model.document import Document class Attendance(Document): @@ -58,4 +56,4 @@ class Attendance(Document): # this is done because sometimes user entered wrong employee name # while uploading employee attendance employee_name = frappe.db.get_value("Employee", self.employee, "employee_name") - frappe.db.set(self.doc, 'employee_name', employee_name) \ No newline at end of file + frappe.db.set(self, 'employee_name', employee_name) \ No newline at end of file diff --git a/erpnext/hr/doctype/leave_allocation/leave_allocation.py b/erpnext/hr/doctype/leave_allocation/leave_allocation.py index 32812e2229..f16f615057 100755 --- a/erpnext/hr/doctype/leave_allocation/leave_allocation.py +++ b/erpnext/hr/doctype/leave_allocation/leave_allocation.py @@ -9,9 +9,6 @@ from frappe import msgprint from frappe.model.document import Document class LeaveAllocation(Document): - def __init__(self, doc, doclist): - self.doc, self.doclist = doc, doclist - def validate(self): self.validate_new_leaves_allocated_value() self.check_existing_leave_allocation() @@ -84,7 +81,7 @@ class LeaveAllocation(Document): self.leave_type) cf = cf and cint(cf[0][0]) or 0 if not cf: - frappe.db.set(self.doc,'carry_forward',0) + frappe.db.set(self,'carry_forward',0) msgprint("Sorry! You cannot carry forward %s" % (self.leave_type), raise_exception=1) @@ -107,8 +104,8 @@ class LeaveAllocation(Document): def get_total_allocated_leaves(self): leave_det = self.get_carry_forwarded_leaves() - frappe.db.set(self.doc,'carry_forwarded_leaves',flt(leave_det['carry_forwarded_leaves'])) - frappe.db.set(self.doc,'total_leaves_allocated',flt(leave_det['total_leaves_allocated'])) + frappe.db.set(self,'carry_forwarded_leaves',flt(leave_det['carry_forwarded_leaves'])) + frappe.db.set(self,'total_leaves_allocated',flt(leave_det['total_leaves_allocated'])) def check_for_leave_application(self): exists = frappe.db.sql("""select name from `tabLeave Application` diff --git a/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py index 57bb224273..81ab56bc13 100644 --- a/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py +++ b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py @@ -14,11 +14,6 @@ from frappe import msgprint, _ from frappe.model.document import Document class LeaveControlPanel(Document): - def __init__(self, doc, doclist): - self.doc = doc - self.doclist = doclist - - def get_employees(self): lst1 = [[self.employee_type,"employment_type"],[self.branch,"branch"],[self.designation,"designation"],[self.department, "department"],[self.grade,"grade"]] condition = "where " diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py index dbccaefd9e..c81f22da28 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.py +++ b/erpnext/hr/doctype/salary_slip/salary_slip.py @@ -34,8 +34,8 @@ class SalarySlip(TransactionBase): return struct and struct[0][0] or '' def pull_sal_struct(self, struct): - from erpnext.hr.doctype.salary_structure.salary_structure import get_mapped_doclist - self.doclist = get_mapped_doclist(struct, self.doclist) + from erpnext.hr.doctype.salary_structure.salary_structure import get_mapped_doc + self.doclist = get_mapped_doc(struct, self.doclist) def pull_emp_details(self): emp = frappe.db.get_value("Employee", self.employee, diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.py b/erpnext/hr/doctype/salary_structure/salary_structure.py index 340ffe9dd1..4c01073359 100644 --- a/erpnext/hr/doctype/salary_structure/salary_structure.py +++ b/erpnext/hr/doctype/salary_structure/salary_structure.py @@ -70,11 +70,11 @@ class SalaryStructure(Document): self.validate_amount() @frappe.whitelist() -def make_salary_slip(source_name, target_doclist=None): - return [d.fields for d in get_mapped_doclist(source_name, target_doclist)] +def make_salary_slip(source_name, target_doc=None): + return [d.fields for d in get_mapped_doc(source_name, target_doc)] -def get_mapped_doclist(source_name, target_doclist=None): - from frappe.model.mapper import get_mapped_doclist +def get_mapped_doc(source_name, target_doc=None): + from frappe.model.mapper import get_mapped_doc def postprocess(source, target): sal_slip = frappe.bean(target) @@ -82,7 +82,7 @@ def get_mapped_doclist(source_name, target_doclist=None): sal_slip.run_method("get_leave_details") sal_slip.run_method("calculate_net_pay") - doclist = get_mapped_doclist("Salary Structure", source_name, { + doclist = get_mapped_doc("Salary Structure", source_name, { "Salary Structure": { "doctype": "Salary Slip", "field_map": { @@ -107,6 +107,6 @@ def get_mapped_doclist(source_name, target_doclist=None): ], "add_if_empty": True } - }, target_doclist, postprocess) + }, target_doc, postprocess) return doclist diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index d3b822b50c..e3199f983b 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -45,8 +45,8 @@ class Bom(Document): self.manage_default_bom() def on_cancel(self): - frappe.db.set(self.doc, "is_active", 0) - frappe.db.set(self.doc, "is_default", 0) + frappe.db.set(self, "is_active", 0) + frappe.db.set(self, "is_default", 0) # check if used in any other bom self.validate_bom_links() @@ -174,12 +174,12 @@ class Bom(Document): """ if self.is_default and self.is_active: from frappe.model.utils import set_default - set_default(self.doc, "item") + set_default(self, "item") frappe.db.set_value("Item", self.item, "default_bom", self.name) else: if not self.is_active: - frappe.db.set(self.doc, "is_default", 0) + frappe.db.set(self, "is_default", 0) frappe.db.sql("update `tabItem` set default_bom = null where name = %s and default_bom = %s", (self.item, self.name)) diff --git a/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.py b/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.py index 96696c70e6..cf7750a269 100644 --- a/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.py +++ b/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.py @@ -10,10 +10,6 @@ from frappe import msgprint, _ from frappe.model.document import Document class BomReplaceTool(Document): - def __init__( self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist - def replace_bom(self): self.validate_bom() self.update_new_bom() diff --git a/erpnext/manufacturing/doctype/production_order/production_order.py b/erpnext/manufacturing/doctype/production_order/production_order.py index 4921d0631d..a22088a18b 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.py +++ b/erpnext/manufacturing/doctype/production_order/production_order.py @@ -94,20 +94,20 @@ class ProductionOrder(Document): def update_status(self, status): if status == 'Stopped': - frappe.db.set(self.doc, 'status', cstr(status)) + frappe.db.set(self, 'status', cstr(status)) else: if flt(self.qty) == flt(self.produced_qty): - frappe.db.set(self.doc, 'status', 'Completed') + frappe.db.set(self, 'status', 'Completed') if flt(self.qty) > flt(self.produced_qty): - frappe.db.set(self.doc, 'status', 'In Process') + frappe.db.set(self, 'status', 'In Process') if flt(self.produced_qty) == 0: - frappe.db.set(self.doc, 'status', 'Submitted') + frappe.db.set(self, 'status', 'Submitted') def on_submit(self): if not self.wip_warehouse: frappe.throw(_("WIP Warehouse required before Submit")) - frappe.db.set(self.doc,'status', 'Submitted') + frappe.db.set(self,'status', 'Submitted') self.update_planned_qty(self.qty) @@ -119,7 +119,7 @@ class ProductionOrder(Document): frappe.throw("""Submitted Stock Entry %s exists against this production order. Hence can not be cancelled.""" % stock_entry[0][0]) - frappe.db.set(self.doc,'status', 'Cancelled') + frappe.db.set(self,'status', 'Cancelled') self.update_planned_qty(-self.qty) def update_planned_qty(self, qty): diff --git a/erpnext/manufacturing/doctype/workstation/workstation.py b/erpnext/manufacturing/doctype/workstation/workstation.py index c2c492eb72..ec026c5c29 100644 --- a/erpnext/manufacturing/doctype/workstation/workstation.py +++ b/erpnext/manufacturing/doctype/workstation/workstation.py @@ -8,20 +8,16 @@ from frappe.utils import flt from frappe.model.document import Document class Workstation(Document): - def __init__(self, doc, doclist=[]): - self.doc = doc - self.doclist = doclist - - def update_bom_operation(self): - bom_list = frappe.db.sql("""select DISTINCT parent from `tabBOM Operation` - where workstation = %s""", self.name) - for bom_no in bom_list: - frappe.db.sql("""update `tabBOM Operation` set hour_rate = %s - where parent = %s and workstation = %s""", - (self.hour_rate, bom_no[0], self.name)) - - def on_update(self): - frappe.db.set(self.doc, 'overhead', flt(self.hour_rate_electricity) + + def update_bom_operation(self): + bom_list = frappe.db.sql("""select DISTINCT parent from `tabBOM Operation` + where workstation = %s""", self.name) + for bom_no in bom_list: + frappe.db.sql("""update `tabBOM Operation` set hour_rate = %s + where parent = %s and workstation = %s""", + (self.hour_rate, bom_no[0], self.name)) + + def on_update(self): + frappe.db.set(self, 'overhead', flt(self.hour_rate_electricity) + flt(self.hour_rate_consumable) + flt(self.hour_rate_rent)) - frappe.db.set(self.doc, 'hour_rate', flt(self.hour_rate_labour) + flt(self.overhead)) - self.update_bom_operation() \ No newline at end of file + frappe.db.set(self, 'hour_rate', flt(self.hour_rate_labour) + flt(self.overhead)) + self.update_bom_operation() \ No newline at end of file diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py index c9e79929c0..e5364d0871 100644 --- a/erpnext/selling/doctype/customer/customer.py +++ b/erpnext/selling/doctype/customer/customer.py @@ -128,7 +128,7 @@ class Customer(TransactionBase): def after_rename(self, olddn, newdn, merge=False): set_field = '' if frappe.defaults.get_global_default('cust_master_name') == 'Customer Name': - frappe.db.set(self.doc, "customer_name", newdn) + frappe.db.set(self, "customer_name", newdn) self.update_contact() set_field = ", customer_name=%(newdn)s" self.update_customer_address(newdn, set_field) diff --git a/erpnext/selling/doctype/installation_note/installation_note.py b/erpnext/selling/doctype/installation_note/installation_note.py index 3b1ea40ea7..db6d7ec519 100644 --- a/erpnext/selling/doctype/installation_note/installation_note.py +++ b/erpnext/selling/doctype/installation_note/installation_note.py @@ -100,12 +100,12 @@ class InstallationNote(TransactionBase): msgprint("Please fetch items from Delivery Note selected", raise_exception=1) def on_update(self): - frappe.db.set(self.doc, 'status', 'Draft') + frappe.db.set(self, 'status', 'Draft') def on_submit(self): self.validate_serial_no() self.update_prevdoc_status() - frappe.db.set(self.doc, 'status', 'Submitted') + frappe.db.set(self, 'status', 'Submitted') def on_cancel(self): for d in self.get('installed_item_details'): @@ -115,4 +115,4 @@ class InstallationNote(TransactionBase): frappe.db.set_value("Serial No", sr_no, "status", "Delivered") self.update_prevdoc_status() - frappe.db.set(self.doc, 'status', 'Cancelled') + frappe.db.set(self, 'status', 'Cancelled') diff --git a/erpnext/selling/doctype/lead/lead.py b/erpnext/selling/doctype/lead/lead.py index 908ab48a71..9852429519 100644 --- a/erpnext/selling/doctype/lead/lead.py +++ b/erpnext/selling/doctype/lead/lead.py @@ -71,11 +71,11 @@ class Lead(SellingController): "status": ["!=", "Lost"]}) @frappe.whitelist() -def make_customer(source_name, target_doclist=None): - return _make_customer(source_name, target_doclist) +def make_customer(source_name, target_doc=None): + return _make_customer(source_name, target_doc) -def _make_customer(source_name, target_doclist=None, ignore_permissions=False): - from frappe.model.mapper import get_mapped_doclist +def _make_customer(source_name, target_doc=None, ignore_permissions=False): + from frappe.model.mapper import get_mapped_doc def set_missing_values(source, target): if source.company_name: @@ -87,7 +87,7 @@ def _make_customer(source_name, target_doclist=None, ignore_permissions=False): target[0].customer_group = frappe.db.get_default("customer_group") - doclist = get_mapped_doclist("Lead", source_name, + doclist = get_mapped_doc("Lead", source_name, {"Lead": { "doctype": "Customer", "field_map": { @@ -96,15 +96,15 @@ def _make_customer(source_name, target_doclist=None, ignore_permissions=False): "contact_no": "phone_1", "fax": "fax_1" } - }}, target_doclist, set_missing_values, ignore_permissions=ignore_permissions) + }}, target_doc, set_missing_values, ignore_permissions=ignore_permissions) return [d.fields for d in doclist] @frappe.whitelist() -def make_opportunity(source_name, target_doclist=None): - from frappe.model.mapper import get_mapped_doclist +def make_opportunity(source_name, target_doc=None): + from frappe.model.mapper import get_mapped_doc - doclist = get_mapped_doclist("Lead", source_name, + doclist = get_mapped_doc("Lead", source_name, {"Lead": { "doctype": "Opportunity", "field_map": { @@ -116,7 +116,7 @@ def make_opportunity(source_name, target_doclist=None): "email_id": "contact_email", "mobile_no": "contact_mobile" } - }}, target_doclist) + }}, target_doc) return [d if isinstance(d, dict) else d.fields for d in doclist] diff --git a/erpnext/selling/doctype/opportunity/opportunity.py b/erpnext/selling/doctype/opportunity/opportunity.py index 4c6863ccd8..8a103be30f 100644 --- a/erpnext/selling/doctype/opportunity/opportunity.py +++ b/erpnext/selling/doctype/opportunity/opportunity.py @@ -118,8 +118,8 @@ class Opportunity(TransactionBase): def declare_enquiry_lost(self,arg): if not self.has_quotation(): - frappe.db.set(self.doc, 'status', 'Lost') - frappe.db.set(self.doc, 'order_lost_reason', arg) + frappe.db.set(self, 'status', 'Lost') + frappe.db.set(self, 'order_lost_reason', arg) else: frappe.throw(_("Cannot declare as lost, because Quotation has been made.")) @@ -130,15 +130,15 @@ class Opportunity(TransactionBase): return frappe.db.get_value("Quotation Item", {"prevdoc_docname": self.name, "docstatus": 1}) @frappe.whitelist() -def make_quotation(source_name, target_doclist=None): - from frappe.model.mapper import get_mapped_doclist +def make_quotation(source_name, target_doc=None): + from frappe.model.mapper import get_mapped_doc def set_missing_values(source, target): quotation = frappe.bean(target) quotation.run_method("onload_post_render") quotation.run_method("calculate_taxes_and_totals") - doclist = get_mapped_doclist("Opportunity", source_name, { + doclist = get_mapped_doc("Opportunity", source_name, { "Opportunity": { "doctype": "Quotation", "field_map": { @@ -159,6 +159,6 @@ def make_quotation(source_name, target_doclist=None): }, "add_if_empty": True } - }, target_doclist, set_missing_values) + }, target_doc, set_missing_values) return [d.fields for d in doclist] \ No newline at end of file diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py index 8f816c858e..bcccdaa411 100644 --- a/erpnext/selling/doctype/quotation/quotation.py +++ b/erpnext/selling/doctype/quotation/quotation.py @@ -59,8 +59,8 @@ class Quotation(SellingController): def declare_order_lost(self, arg): if not self.has_sales_order(): - frappe.db.set(self.doc, 'status', 'Lost') - frappe.db.set(self.doc, 'order_lost_reason', arg) + frappe.db.set(self, 'status', 'Lost') + frappe.db.set(self, 'order_lost_reason', arg) self.update_opportunity() else: frappe.throw(_("Cannot set as Lost as Sales Order is made.")) @@ -95,11 +95,11 @@ class Quotation(SellingController): @frappe.whitelist() -def make_sales_order(source_name, target_doclist=None): - return _make_sales_order(source_name, target_doclist) +def make_sales_order(source_name, target_doc=None): + return _make_sales_order(source_name, target_doc) -def _make_sales_order(source_name, target_doclist=None, ignore_permissions=False): - from frappe.model.mapper import get_mapped_doclist +def _make_sales_order(source_name, target_doc=None, ignore_permissions=False): + from frappe.model.mapper import get_mapped_doc customer = _make_customer(source_name, ignore_permissions) @@ -112,7 +112,7 @@ def _make_sales_order(source_name, target_doclist=None, ignore_permissions=False si.ignore_permissions = ignore_permissions si.run_method("onload_post_render") - doclist = get_mapped_doclist("Quotation", source_name, { + doclist = get_mapped_doc("Quotation", source_name, { "Quotation": { "doctype": "Sales Order", "validation": { @@ -133,7 +133,7 @@ def _make_sales_order(source_name, target_doclist=None, ignore_permissions=False "doctype": "Sales Team", "add_if_empty": True } - }, target_doclist, set_missing_values, ignore_permissions=ignore_permissions) + }, target_doc, set_missing_values, ignore_permissions=ignore_permissions) # postprocess: fetch shipping address, set missing values diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index 98ccf111af..ff235b147f 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -9,20 +9,16 @@ from frappe.utils import cstr, flt, getdate from frappe.model.bean import getlist from frappe.model.code import get_obj from frappe import msgprint -from frappe.model.mapper import get_mapped_doclist +from frappe.model.mapper import get_mapped_doc from erpnext.controllers.selling_controller import SellingController class SalesOrder(SellingController): - def __init__(self, doc, doclist=None): - self.doc = doc - if not doclist: doclist = [] - self.doclist = doclist - self.tname = 'Sales Order Item' - self.fname = 'sales_order_details' - self.person_tname = 'Target Detail' - self.partner_tname = 'Partner Target Detail' - self.territory_tname = 'Territory Target Detail' + tname = 'Sales Order Item' + fname = 'sales_order_details' + person_tname = 'Target Detail' + partner_tname = 'Partner Target Detail' + territory_tname = 'Territory Target Detail' def validate_mandatory(self): # validate transaction date v/s delivery date @@ -168,7 +164,7 @@ class SalesOrder(SellingController): get_obj('Authorization Control').validate_approving_authority(self.doctype, self.grand_total, self) self.update_prevdoc_status('submit') - frappe.db.set(self.doc, 'status', 'Submitted') + frappe.db.set(self, 'status', 'Submitted') def on_cancel(self): # Cannot cancel stopped SO @@ -180,7 +176,7 @@ class SalesOrder(SellingController): self.update_prevdoc_status('cancel') - frappe.db.set(self.doc, 'status', 'Cancelled') + frappe.db.set(self, 'status', 'Cancelled') def check_nextdoc_docstatus(self): # Checks Delivery Note @@ -224,14 +220,14 @@ class SalesOrder(SellingController): def stop_sales_order(self): self.check_modified_date() self.update_stock_ledger(-1) - frappe.db.set(self.doc, 'status', 'Stopped') + frappe.db.set(self, 'status', 'Stopped') msgprint("""%s: %s has been Stopped. To make transactions against this Sales Order you need to Unstop it.""" % (self.doctype, self.name)) def unstop_sales_order(self): self.check_modified_date() self.update_stock_ledger(1) - frappe.db.set(self.doc, 'status', 'Submitted') + frappe.db.set(self, 'status', 'Submitted') msgprint("%s: %s has been Unstopped" % (self.doctype, self.name)) @@ -261,11 +257,11 @@ def set_missing_values(source, target): bean.run_method("onload_post_render") @frappe.whitelist() -def make_material_request(source_name, target_doclist=None): +def make_material_request(source_name, target_doc=None): def postprocess(source, doclist): doclist[0].material_request_type = "Purchase" - doclist = get_mapped_doclist("Sales Order", source_name, { + doclist = get_mapped_doc("Sales Order", source_name, { "Sales Order": { "doctype": "Material Request", "validation": { @@ -279,18 +275,18 @@ def make_material_request(source_name, target_doclist=None): "stock_uom": "uom" } } - }, target_doclist, postprocess) + }, target_doc, postprocess) return [(d if isinstance(d, dict) else d.fields) for d in doclist] @frappe.whitelist() -def make_delivery_note(source_name, target_doclist=None): +def make_delivery_note(source_name, target_doc=None): def update_item(obj, target, source_parent): target.base_amount = (flt(obj.qty) - flt(obj.delivered_qty)) * flt(obj.base_rate) target.amount = (flt(obj.qty) - flt(obj.delivered_qty)) * flt(obj.rate) target.qty = flt(obj.qty) - flt(obj.delivered_qty) - doclist = get_mapped_doclist("Sales Order", source_name, { + doclist = get_mapped_doc("Sales Order", source_name, { "Sales Order": { "doctype": "Delivery Note", "field_map": { @@ -319,12 +315,12 @@ def make_delivery_note(source_name, target_doclist=None): "doctype": "Sales Team", "add_if_empty": True } - }, target_doclist, set_missing_values) + }, target_doc, set_missing_values) return [d.fields for d in doclist] @frappe.whitelist() -def make_sales_invoice(source_name, target_doclist=None): +def make_sales_invoice(source_name, target_doc=None): def set_missing_values(source, target): bean = frappe.bean(target) bean.is_pos = 0 @@ -335,7 +331,7 @@ def make_sales_invoice(source_name, target_doclist=None): target.base_amount = target.amount * flt(source_parent.conversion_rate) target.qty = obj.rate and target.amount / flt(obj.rate) or obj.qty - doclist = get_mapped_doclist("Sales Order", source_name, { + doclist = get_mapped_doc("Sales Order", source_name, { "Sales Order": { "doctype": "Sales Invoice", "validation": { @@ -359,18 +355,18 @@ def make_sales_invoice(source_name, target_doclist=None): "doctype": "Sales Team", "add_if_empty": True } - }, target_doclist, set_missing_values) + }, target_doc, set_missing_values) return [d.fields for d in doclist] @frappe.whitelist() -def make_maintenance_schedule(source_name, target_doclist=None): +def make_maintenance_schedule(source_name, target_doc=None): maint_schedule = frappe.db.sql("""select t1.name from `tabMaintenance Schedule` t1, `tabMaintenance Schedule Item` t2 where t2.parent=t1.name and t2.prevdoc_docname=%s and t1.docstatus=1""", source_name) if not maint_schedule: - doclist = get_mapped_doclist("Sales Order", source_name, { + doclist = get_mapped_doc("Sales Order", source_name, { "Sales Order": { "doctype": "Maintenance Schedule", "field_map": { @@ -387,19 +383,19 @@ def make_maintenance_schedule(source_name, target_doclist=None): }, "add_if_empty": True } - }, target_doclist) + }, target_doc) return [d.fields for d in doclist] @frappe.whitelist() -def make_maintenance_visit(source_name, target_doclist=None): +def make_maintenance_visit(source_name, target_doc=None): visit = frappe.db.sql("""select t1.name from `tabMaintenance Visit` t1, `tabMaintenance Visit Purpose` t2 where t2.parent=t1.name and t2.prevdoc_docname=%s and t1.docstatus=1 and t1.completion_status='Fully Completed'""", source_name) if not visit: - doclist = get_mapped_doclist("Sales Order", source_name, { + doclist = get_mapped_doc("Sales Order", source_name, { "Sales Order": { "doctype": "Maintenance Visit", "field_map": { @@ -417,6 +413,6 @@ def make_maintenance_visit(source_name, target_doclist=None): }, "add_if_empty": True } - }, target_doclist) + }, target_doc) return [d.fields for d in doclist] diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py index b6b23054aa..2aa324571a 100644 --- a/erpnext/setup/doctype/company/company.py +++ b/erpnext/setup/doctype/company/company.py @@ -107,8 +107,8 @@ class Company(Document): self.import_chart_of_account() else: self.create_standard_accounts() - frappe.db.set(self.doc, "receivables_group", "Accounts Receivable - " + self.abbr) - frappe.db.set(self.doc, "payables_group", "Accounts Payable - " + self.abbr) + frappe.db.set(self, "receivables_group", "Accounts Receivable - " + self.abbr) + frappe.db.set(self, "payables_group", "Accounts Payable - " + self.abbr) def import_chart_of_account(self): chart = frappe.bean("Chart of Accounts", self.chart_of_accounts) @@ -132,7 +132,7 @@ class Company(Document): "group_or_ledger": "Ledger", "company": self.name}) if account and not self.get(field): - frappe.db.set(self.doc, field, account) + frappe.db.set(self, field, account) _set_default_accounts({ "default_cash_account": "Cash", @@ -170,7 +170,7 @@ class Company(Document): cc_bean.ignore_mandatory = True cc_bean.insert() - frappe.db.set(self.doc, "cost_center", "Main - " + self.abbr) + frappe.db.set(self, "cost_center", "Main - " + self.abbr) def on_trash(self): """ @@ -200,7 +200,7 @@ class Company(Document): frappe.throw(_("Sorry, companies cannot be merged")) def after_rename(self, olddn, newdn, merge=False): - frappe.db.set(self.doc, "company_name", newdn) + frappe.db.set(self, "company_name", newdn) frappe.db.sql("""update `tabDefaultValue` set defvalue=%s where defkey='Company' and defvalue=%s""", (newdn, olddn)) diff --git a/erpnext/setup/doctype/notification_control/notification_control.py b/erpnext/setup/doctype/notification_control/notification_control.py index 9557171f76..8594856a08 100644 --- a/erpnext/setup/doctype/notification_control/notification_control.py +++ b/erpnext/setup/doctype/notification_control/notification_control.py @@ -19,6 +19,6 @@ class NotificationControl(Document): def set_message(self, arg = ''): fn = self.select_transaction.lower().replace(' ', '_') + '_message' - frappe.db.set(self.doc, fn, self.custom_message) + frappe.db.set(self, fn, self.custom_message) msgprint("Custom Message for %s updated!" % self.select_transaction) diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index 617a883594..d48024f081 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -9,7 +9,7 @@ from frappe.model.bean import getlist from frappe.model.code import get_obj from frappe import msgprint, _ import frappe.defaults -from frappe.model.mapper import get_mapped_doclist +from frappe.model.mapper import get_mapped_doc from erpnext.stock.utils import update_bin from erpnext.controllers.selling_controller import SellingController @@ -163,7 +163,7 @@ class DeliveryNote(SellingController): self.make_gl_entries() # set DN status - frappe.db.set(self.doc, 'status', 'Submitted') + frappe.db.set(self, 'status', 'Submitted') def on_cancel(self): @@ -174,7 +174,7 @@ class DeliveryNote(SellingController): self.update_stock_ledger() - frappe.db.set(self.doc, 'status', 'Cancelled') + frappe.db.set(self, 'status', 'Cancelled') self.cancel_packing_slips() self.make_cancel_gl_entries() @@ -285,7 +285,7 @@ def get_invoiced_qty_map(delivery_note): return invoiced_qty_map @frappe.whitelist() -def make_sales_invoice(source_name, target_doclist=None): +def make_sales_invoice(source_name, target_doc=None): invoiced_qty_map = get_invoiced_qty_map(source_name) def update_accounts(source, target): @@ -305,7 +305,7 @@ def make_sales_invoice(source_name, target_doclist=None): def update_item(source_doc, target_doc, source_parent): target_doc.qty = source_doc.qty - invoiced_qty_map.get(source_doc.name, 0) - doclist = get_mapped_doclist("Delivery Note", source_name, { + doclist = get_mapped_doc("Delivery Note", source_name, { "Delivery Note": { "doctype": "Sales Invoice", "validation": { @@ -334,17 +334,17 @@ def make_sales_invoice(source_name, target_doclist=None): }, "add_if_empty": True } - }, target_doclist, update_accounts) + }, target_doc, update_accounts) return [d.fields for d in doclist] @frappe.whitelist() -def make_installation_note(source_name, target_doclist=None): +def make_installation_note(source_name, target_doc=None): def update_item(obj, target, source_parent): target.qty = flt(obj.qty) - flt(obj.installed_qty) target.serial_no = obj.serial_no - doclist = get_mapped_doclist("Delivery Note", source_name, { + doclist = get_mapped_doc("Delivery Note", source_name, { "Delivery Note": { "doctype": "Installation Note", "validation": { @@ -361,6 +361,6 @@ def make_installation_note(source_name, target_doclist=None): "postprocess": update_item, "condition": lambda doc: doc.installed_qty < doc.qty } - }, target_doclist) + }, target_doc) return [d.fields for d in doclist] \ No newline at end of file diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py index 76e6aa236b..30ebb1b206 100644 --- a/erpnext/stock/doctype/material_request/material_request.py +++ b/erpnext/stock/doctype/material_request/material_request.py @@ -100,7 +100,7 @@ class MaterialRequest(BuyingController): update_bin(args) def on_submit(self): - frappe.db.set(self.doc, 'status', 'Submitted') + frappe.db.set(self, 'status', 'Submitted') self.update_bin(is_submit = 1, is_stopped = 0) def check_modified_date(self): @@ -118,7 +118,7 @@ class MaterialRequest(BuyingController): self.update_bin(is_submit = (status == 'Submitted') and 1 or 0, is_stopped = 1) # Step 2:=> Set status - frappe.db.set(self.doc, 'status', cstr(status)) + frappe.db.set(self, 'status', cstr(status)) # Step 3:=> Acknowledge User msgprint(self.doctype + ": " + self.name + " has been %s." % ((status == 'Submitted') and 'Unstopped' or cstr(status))) @@ -137,7 +137,7 @@ class MaterialRequest(BuyingController): self.update_bin(is_submit = 0, is_stopped = (cstr(self.status) == 'Stopped') and 1 or 0) # Step 5:=> Set Status - frappe.db.set(self.doc,'status','Cancelled') + frappe.db.set(self,'status','Cancelled') def update_completed_qty(self, mr_items=None): if self.material_request_type != "Transfer": @@ -217,8 +217,8 @@ def _update_requested_qty(bean, mr_obj, mr_items): "posting_date": bean.posting_date, }) -def set_missing_values(source, target_doclist): - po = frappe.bean(target_doclist) +def set_missing_values(source, target_doc): + po = frappe.bean(target_doc) po.run_method("set_missing_values") def update_item(obj, target, source_parent): @@ -226,10 +226,10 @@ def update_item(obj, target, source_parent): target.qty = flt(obj.qty) - flt(obj.ordered_qty) @frappe.whitelist() -def make_purchase_order(source_name, target_doclist=None): - from frappe.model.mapper import get_mapped_doclist +def make_purchase_order(source_name, target_doc=None): + from frappe.model.mapper import get_mapped_doc - doclist = get_mapped_doclist("Material Request", source_name, { + doclist = get_mapped_doc("Material Request", source_name, { "Material Request": { "doctype": "Purchase Order", "validation": { @@ -248,34 +248,34 @@ def make_purchase_order(source_name, target_doclist=None): ], "postprocess": update_item } - }, target_doclist, set_missing_values) + }, target_doc, set_missing_values) return [d.fields for d in doclist] @frappe.whitelist() -def make_purchase_order_based_on_supplier(source_name, target_doclist=None): - from frappe.model.mapper import get_mapped_doclist - if target_doclist: - if isinstance(target_doclist, basestring): +def make_purchase_order_based_on_supplier(source_name, target_doc=None): + from frappe.model.mapper import get_mapped_doc + if target_doc: + if isinstance(target_doc, basestring): import json - target_doclist = frappe.doclist(json.loads(target_doclist)) - target_doclist = target_doclist.get({"parentfield": ["!=", "po_details"]}) + target_doc = frappe.doclist(json.loads(target_doc)) + target_doc = target_doc.get({"parentfield": ["!=", "po_details"]}) material_requests, supplier_items = get_material_requests_based_on_supplier(source_name) - def postprocess(source, target_doclist): - target_doclist[0].supplier = source_name - set_missing_values(source, target_doclist) + def postprocess(source, target_doc): + target_doc[0].supplier = source_name + set_missing_values(source, target_doc) - po_items = target_doclist.get({"parentfield": "po_details"}) - target_doclist = target_doclist.get({"parentfield": ["!=", "po_details"]}) + \ + po_items = target_doc.get({"parentfield": "po_details"}) + target_doc = target_doc.get({"parentfield": ["!=", "po_details"]}) + \ [d for d in po_items if d.get("item_code") in supplier_items and d.get("qty") > 0] - return target_doclist + return target_doc for mr in material_requests: - target_doclist = get_mapped_doclist("Material Request", mr, { + target_doc = get_mapped_doc("Material Request", mr, { "Material Request": { "doctype": "Purchase Order", }, @@ -290,9 +290,9 @@ def make_purchase_order_based_on_supplier(source_name, target_doclist=None): ], "postprocess": update_item } - }, target_doclist, postprocess) + }, target_doc, postprocess) - return [d.fields for d in target_doclist] + return [d.fields for d in target_doc] def get_material_requests_based_on_supplier(supplier): supplier_items = [d[0] for d in frappe.db.get_values("Item", @@ -309,10 +309,10 @@ def get_material_requests_based_on_supplier(supplier): return material_requests, supplier_items @frappe.whitelist() -def make_supplier_quotation(source_name, target_doclist=None): - from frappe.model.mapper import get_mapped_doclist +def make_supplier_quotation(source_name, target_doc=None): + from frappe.model.mapper import get_mapped_doc - doclist = get_mapped_doclist("Material Request", source_name, { + doclist = get_mapped_doc("Material Request", source_name, { "Material Request": { "doctype": "Supplier Quotation", "validation": { @@ -328,13 +328,13 @@ def make_supplier_quotation(source_name, target_doclist=None): "parenttype": "prevdoc_doctype" } } - }, target_doclist, set_missing_values) + }, target_doc, set_missing_values) return [d.fields for d in doclist] @frappe.whitelist() -def make_stock_entry(source_name, target_doclist=None): - from frappe.model.mapper import get_mapped_doclist +def make_stock_entry(source_name, target_doc=None): + from frappe.model.mapper import get_mapped_doc def update_item(obj, target, source_parent): target.conversion_factor = 1 @@ -346,7 +346,7 @@ def make_stock_entry(source_name, target_doclist=None): se = frappe.bean(target) se.run_method("get_stock_and_rate") - doclist = get_mapped_doclist("Material Request", source_name, { + doclist = get_mapped_doc("Material Request", source_name, { "Material Request": { "doctype": "Stock Entry", "validation": { @@ -364,6 +364,6 @@ def make_stock_entry(source_name, target_doclist=None): }, "postprocess": update_item } - }, target_doclist, set_missing_values) + }, target_doc, set_missing_values) return [d.fields for d in doclist] diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py index b6e05399ff..74c8cffd43 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py @@ -229,7 +229,7 @@ class PurchaseReceipt(BuyingController): get_obj('Authorization Control').validate_approving_authority(self.doctype, self.company, self.grand_total) # Set status as Submitted - frappe.db.set(self.doc, 'status', 'Submitted') + frappe.db.set(self, 'status', 'Submitted') self.update_prevdoc_status() @@ -267,7 +267,7 @@ class PurchaseReceipt(BuyingController): frappe.throw("Purchase Invoice : " + cstr(submitted[0][0]) + " has already been submitted !") - frappe.db.set(self.doc,'status','Cancelled') + frappe.db.set(self,'status','Cancelled') self.update_ordered_qty() @@ -295,14 +295,14 @@ class PurchaseReceipt(BuyingController): @frappe.whitelist() -def make_purchase_invoice(source_name, target_doclist=None): - from frappe.model.mapper import get_mapped_doclist +def make_purchase_invoice(source_name, target_doc=None): + from frappe.model.mapper import get_mapped_doc def set_missing_values(source, target): bean = frappe.bean(target) bean.run_method("set_missing_values") - doclist = get_mapped_doclist("Purchase Receipt", source_name, { + doclist = get_mapped_doc("Purchase Receipt", source_name, { "Purchase Receipt": { "doctype": "Purchase Invoice", "validation": { @@ -322,6 +322,6 @@ def make_purchase_invoice(source_name, target_doclist=None): "doctype": "Purchase Taxes and Charges", "add_if_empty": True } - }, target_doclist, set_missing_values) + }, target_doc, set_missing_values) return [d.fields for d in doclist] \ No newline at end of file diff --git a/erpnext/stock/doctype/serial_no/serial_no.py b/erpnext/stock/doctype/serial_no/serial_no.py index 88b26026a6..333f3f7685 100644 --- a/erpnext/stock/doctype/serial_no/serial_no.py +++ b/erpnext/stock/doctype/serial_no/serial_no.py @@ -21,9 +21,8 @@ class SerialNoNotExistsError(ValidationError): pass class SerialNoDuplicateError(ValidationError): pass class SerialNo(StockController): - def __init__(self, doc, doclist=None): - self.doc = doc - self.doclist = doclist or [] + def __init__(self, arg1, arg2=None): + super(SerialNo, self).__init__(arg1, arg2) self.via_stock_ledger = False def validate(self): diff --git a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py index 69217b87a5..0482dd33b0 100644 --- a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py +++ b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.py @@ -29,7 +29,7 @@ class StockLedgerEntry(DocListController): self.actual_amt_check() from erpnext.stock.doctype.serial_no.serial_no import process_serial_no - process_serial_no(self.doc) + process_serial_no(self) #check for item quantity available in stock def actual_amt_check(self): diff --git a/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.py b/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.py index 6c49ed973a..28972d35fb 100644 --- a/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.py +++ b/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.py @@ -10,9 +10,6 @@ from frappe import msgprint, _ from frappe.model.document import Document class StockUomReplaceUtility(Document): - def __init__(self, d, dl=[]): - self.doc, self.doclist = d,dl - def validate_mandatory(self): if not cstr(self.item_code): msgprint("Please Enter an Item.") diff --git a/erpnext/support/doctype/customer_issue/customer_issue.py b/erpnext/support/doctype/customer_issue/customer_issue.py index 619452b4cf..7e69382d0d 100644 --- a/erpnext/support/doctype/customer_issue/customer_issue.py +++ b/erpnext/support/doctype/customer_issue/customer_issue.py @@ -33,14 +33,14 @@ class CustomerIssue(TransactionBase): msgprint("Maintenance Visit No. "+lst1+" already created against this customer issue. So can not be Cancelled") raise Exception else: - frappe.db.set(self.doc, 'status', 'Cancelled') + frappe.db.set(self, 'status', 'Cancelled') def on_update(self): pass @frappe.whitelist() -def make_maintenance_visit(source_name, target_doclist=None): - from frappe.model.mapper import get_mapped_doclist +def make_maintenance_visit(source_name, target_doc=None): + from frappe.model.mapper import get_mapped_doc visit = frappe.db.sql("""select t1.name from `tabMaintenance Visit` t1, `tabMaintenance Visit Purpose` t2 @@ -48,7 +48,7 @@ def make_maintenance_visit(source_name, target_doclist=None): and t1.docstatus=1 and t1.completion_status='Fully Completed'""", source_name) if not visit: - doclist = get_mapped_doclist("Customer Issue", source_name, { + doclist = get_mapped_doc("Customer Issue", source_name, { "Customer Issue": { "doctype": "Maintenance Visit", "field_map": { @@ -57,6 +57,6 @@ def make_maintenance_visit(source_name, target_doclist=None): "name": "prevdoc_docname" } } - }, target_doclist) + }, target_doc) return [d.fields for d in doclist] \ No newline at end of file diff --git a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py index 1c40552711..0052ab28e4 100644 --- a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py +++ b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py @@ -80,7 +80,7 @@ class MaintenanceSchedule(TransactionBase): "ref_name": self.name }).insert(ignore_permissions=1) - frappe.db.set(self.doc, 'status', 'Submitted') + frappe.db.set(self, 'status', 'Submitted') def create_schedule_list(self, start_date, end_date, no_of_visit, sales_person): schedule_list = [] @@ -199,7 +199,7 @@ class MaintenanceSchedule(TransactionBase): self.validate_sales_order() def on_update(self): - frappe.db.set(self.doc, 'status', 'Draft') + frappe.db.set(self, 'status', 'Draft') def update_amc_date(self, serial_nos, amc_expiry_date=None): for serial_no in serial_nos: @@ -261,20 +261,20 @@ class MaintenanceSchedule(TransactionBase): if d.serial_no: serial_nos = get_valid_serial_nos(d.serial_no) self.update_amc_date(serial_nos) - frappe.db.set(self.doc, 'status', 'Cancelled') + frappe.db.set(self, 'status', 'Cancelled') delete_events(self.doctype, self.name) def on_trash(self): delete_events(self.doctype, self.name) @frappe.whitelist() -def make_maintenance_visit(source_name, target_doclist=None): - from frappe.model.mapper import get_mapped_doclist +def make_maintenance_visit(source_name, target_doc=None): + from frappe.model.mapper import get_mapped_doc def update_status(source, target, parent): target.maintenance_type = "Scheduled" - doclist = get_mapped_doclist("Maintenance Schedule", source_name, { + doclist = get_mapped_doc("Maintenance Schedule", source_name, { "Maintenance Schedule": { "doctype": "Maintenance Visit", "field_map": { @@ -293,6 +293,6 @@ def make_maintenance_visit(source_name, target_doclist=None): "sales_person": "service_person" } } - }, target_doclist) + }, target_doc) return [d.fields for d in doclist] \ No newline at end of file diff --git a/erpnext/support/doctype/maintenance_visit/maintenance_visit.py b/erpnext/support/doctype/maintenance_visit/maintenance_visit.py index c3f9181493..f8eb96a428 100644 --- a/erpnext/support/doctype/maintenance_visit/maintenance_visit.py +++ b/erpnext/support/doctype/maintenance_visit/maintenance_visit.py @@ -79,11 +79,11 @@ class MaintenanceVisit(TransactionBase): def on_submit(self): self.update_customer_issue(1) - frappe.db.set(self.doc, 'status', 'Submitted') + frappe.db.set(self, 'status', 'Submitted') def on_cancel(self): self.check_if_last_visit() - frappe.db.set(self.doc, 'status', 'Cancelled') + frappe.db.set(self, 'status', 'Cancelled') def on_update(self): pass \ No newline at end of file diff --git a/erpnext/support/doctype/newsletter/newsletter.py b/erpnext/support/doctype/newsletter/newsletter.py index aed338ac82..f28afa8362 100644 --- a/erpnext/support/doctype/newsletter/newsletter.py +++ b/erpnext/support/doctype/newsletter/newsletter.py @@ -40,7 +40,7 @@ class Newsletter(Document): "doctype": self.send_to_doctype })) - frappe.db.set(self.doc, "email_sent", 1) + frappe.db.set(self, "email_sent", 1) def get_recipients(self): self.email_field = None From 43405203b2e2ec3462f63aaa80a65b77728bb250 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 28 Mar 2014 16:43:50 +0530 Subject: [PATCH 09/42] frappe/frappe#478 --- erpnext/hr/doctype/attendance/attendance.py | 1 - erpnext/hr/doctype/branch/test_branch.py | 2 +- erpnext/hr/doctype/deduction_type/test_deduction_type.py | 8 ++++---- erpnext/hr/doctype/department/test_department.py | 4 ++-- erpnext/hr/doctype/designation/test_designation.py | 2 +- erpnext/hr/doctype/earning_type/test_earning_type.py | 8 ++++---- erpnext/hr/doctype/employee/employee.py | 6 +++--- erpnext/hr/doctype/expense_claim/expense_claim.py | 5 ++--- erpnext/hr/doctype/grade/test_grade.py | 2 +- .../doctype/leave_application/test_leave_application.py | 4 ++-- 10 files changed, 20 insertions(+), 22 deletions(-) diff --git a/erpnext/hr/doctype/attendance/attendance.py b/erpnext/hr/doctype/attendance/attendance.py index 24dd1887a6..8c1c3f0a4e 100644 --- a/erpnext/hr/doctype/attendance/attendance.py +++ b/erpnext/hr/doctype/attendance/attendance.py @@ -9,7 +9,6 @@ from frappe import msgprint, _ from frappe.model.document import Document class Attendance(Document): - def validate_duplicate_record(self): res = frappe.db.sql("""select name from `tabAttendance` where employee = %s and att_date = %s and name != %s and docstatus = 1""", diff --git a/erpnext/hr/doctype/branch/test_branch.py b/erpnext/hr/doctype/branch/test_branch.py index ec84741326..f1db481eb7 100644 --- a/erpnext/hr/doctype/branch/test_branch.py +++ b/erpnext/hr/doctype/branch/test_branch.py @@ -1,4 +1,4 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [[{"doctype":"Branch", "branch":"_Test Branch"}]] \ No newline at end of file +test_records = [{"doctype":"Branch", "branch":"_Test Branch"}] \ No newline at end of file diff --git a/erpnext/hr/doctype/deduction_type/test_deduction_type.py b/erpnext/hr/doctype/deduction_type/test_deduction_type.py index ff3db8cbf4..6f46d24a5d 100644 --- a/erpnext/hr/doctype/deduction_type/test_deduction_type.py +++ b/erpnext/hr/doctype/deduction_type/test_deduction_type.py @@ -2,12 +2,12 @@ # License: GNU General Public License v3. See license.txt test_records = [ - [{ + { "doctype": "Deduction Type", "deduction_name": "_Test Professional Tax" - }], - [{ + }, + { "doctype": "Deduction Type", "deduction_name": "_Test TDS" - }] + } ] \ No newline at end of file diff --git a/erpnext/hr/doctype/department/test_department.py b/erpnext/hr/doctype/department/test_department.py index 6fa2dce927..654c250737 100644 --- a/erpnext/hr/doctype/department/test_department.py +++ b/erpnext/hr/doctype/department/test_department.py @@ -4,6 +4,6 @@ test_ignore = ["Leave Block List"] test_records = [ - [{"doctype":"Department", "department_name":"_Test Department"}], - [{"doctype":"Department", "department_name":"_Test Department 1"}] + {"doctype":"Department", "department_name":"_Test Department"}, + {"doctype":"Department", "department_name":"_Test Department 1"} ] diff --git a/erpnext/hr/doctype/designation/test_designation.py b/erpnext/hr/doctype/designation/test_designation.py index 8b28fa54b5..2ed331c740 100644 --- a/erpnext/hr/doctype/designation/test_designation.py +++ b/erpnext/hr/doctype/designation/test_designation.py @@ -1,4 +1,4 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [[{"doctype":"Designation", "designation_name":"_Test Designation"}]] \ No newline at end of file +test_records = [{"doctype":"Designation", "designation_name":"_Test Designation"}] \ No newline at end of file diff --git a/erpnext/hr/doctype/earning_type/test_earning_type.py b/erpnext/hr/doctype/earning_type/test_earning_type.py index 5d838a27e5..a7184a1663 100644 --- a/erpnext/hr/doctype/earning_type/test_earning_type.py +++ b/erpnext/hr/doctype/earning_type/test_earning_type.py @@ -2,14 +2,14 @@ # License: GNU General Public License v3. See license.txt test_records = [ - [{ + { "doctype": "Earning Type", "earning_name": "_Test Basic Salary", "taxable": "Yes" - }], - [{ + }, + { "doctype": "Earning Type", "earning_name": "_Test Allowance", "taxable": "Yes" - }] + } ] \ No newline at end of file diff --git a/erpnext/hr/doctype/employee/employee.py b/erpnext/hr/doctype/employee/employee.py index 231e7b9c9b..0291eb64cd 100644 --- a/erpnext/hr/doctype/employee/employee.py +++ b/erpnext/hr/doctype/employee/employee.py @@ -78,7 +78,7 @@ class Employee(DocListController): from frappe.utils.user import add_role add_role(self.user_id, "Employee") - user_wrapper = frappe.bean("User", self.user_id) + user_wrapper = frappe.get_doc("User", self.user_id) # copy details like Fullname, DOB and Image to User if self.employee_name: @@ -182,12 +182,12 @@ class Employee(DocListController): ends_on = self.date_of_birth + " 00:15:00" if birthday_event: - event = frappe.bean("Event", birthday_event[0][0]) + event = frappe.get_doc("Event", birthday_event[0][0]) event.starts_on = starts_on event.ends_on = ends_on event.save() else: - frappe.bean({ + frappe.get_doc({ "doctype": "Event", "subject": _("Birthday") + ": " + self.employee_name, "description": _("Happy Birthday!") + " " + self.employee_name, diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.py b/erpnext/hr/doctype/expense_claim/expense_claim.py index 1d3697be3d..749f3420de 100644 --- a/erpnext/hr/doctype/expense_claim/expense_claim.py +++ b/erpnext/hr/doctype/expense_claim/expense_claim.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import frappe from frappe.model.bean import getlist -from frappe import msgprint +from frappe import _ from frappe.model.document import Document @@ -26,5 +26,4 @@ class ExpenseClaim(Document): def validate_exp_details(self): if not self.get('expense_voucher_details'): - msgprint("Please add expense voucher details") - raise Exception + frappe.throw(_("Please add expense voucher details")) diff --git a/erpnext/hr/doctype/grade/test_grade.py b/erpnext/hr/doctype/grade/test_grade.py index e3595e026c..e0330e6169 100644 --- a/erpnext/hr/doctype/grade/test_grade.py +++ b/erpnext/hr/doctype/grade/test_grade.py @@ -1,4 +1,4 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [[{"doctype":"Grade", "grade_name":"_Test Grade"}]] \ No newline at end of file +test_records = [{"doctype":"Grade", "grade_name":"_Test Grade"}] \ No newline at end of file diff --git a/erpnext/hr/doctype/leave_application/test_leave_application.py b/erpnext/hr/doctype/leave_application/test_leave_application.py index 04d049bca3..26cc093acf 100644 --- a/erpnext/hr/doctype/leave_application/test_leave_application.py +++ b/erpnext/hr/doctype/leave_application/test_leave_application.py @@ -31,8 +31,8 @@ class TestLeaveApplication(unittest.TestCase): employee.save() frappe.set_user(temp_session_user) - def get_application(self, doclist): - application = frappe.bean(copy=doclist) + def get_application(self, doc): + application = frappe.copy_doc(doc) application.from_date = "2013-01-01" application.to_date = "2013-01-05" return application From b385ecf65e9dc329d336e1f512682cfdbfdbb184 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Fri, 28 Mar 2014 16:44:37 +0530 Subject: [PATCH 10/42] frappe/frappe#478 --- .../accounts_settings/accounts_settings.py | 4 +- .../chart_of_accounts/chart_of_accounts.py | 2 +- .../chart_of_accounts/import_charts.py | 2 +- .../journal_voucher/journal_voucher.py | 4 +- .../journal_voucher/test_journal_voucher.py | 16 ++-- .../test_period_closing_voucher.py | 6 +- .../doctype/pricing_rule/test_pricing_rule.py | 8 +- .../purchase_invoice/test_purchase_invoice.py | 14 +-- .../doctype/sales_invoice/sales_invoice.py | 6 +- .../sales_invoice/test_sales_invoice.py | 76 +++++++-------- .../shipping_rule/test_shipping_rule.py | 6 +- erpnext/accounts/general_ledger.py | 2 +- erpnext/accounts/party.py | 4 +- erpnext/accounts/utils.py | 4 +- .../doctype/purchase_order/purchase_order.py | 4 +- .../purchase_order/test_purchase_order.py | 26 ++--- .../supplier_quotation/supplier_quotation.py | 2 +- .../test_supplier_quotation.py | 6 +- erpnext/controllers/accounts_controller.py | 2 +- erpnext/controllers/selling_controller.py | 6 +- erpnext/hr/doctype/employee/employee.py | 2 +- .../job_applicant/get_job_applications.py | 6 +- .../leave_application/leave_application.py | 8 +- .../test_leave_application.py | 2 +- .../doctype/salary_manager/salary_manager.py | 2 +- .../doctype/salary_slip/test_salary_slip.py | 6 +- .../salary_structure/salary_structure.py | 2 +- erpnext/manufacturing/doctype/bom/bom.py | 4 +- .../production_order/production_order.py | 2 +- .../production_order/test_production_order.py | 10 +- .../production_planning_tool.py | 2 +- .../4_0/customer_discount_to_pricing_rule.py | 2 +- erpnext/patches/4_0/fix_contact_address.py | 4 +- erpnext/patches/4_0/split_email_settings.py | 6 +- erpnext/patches/4_0/update_user_properties.py | 2 +- erpnext/projects/doctype/project/project.py | 2 +- erpnext/projects/doctype/task/task.py | 2 +- .../doctype/time_log/test_time_log.py | 2 +- .../time_log_batch/test_time_log_batch.py | 4 +- .../doctype/time_log_batch/time_log_batch.py | 4 +- erpnext/selling/doctype/lead/get_leads.py | 6 +- erpnext/selling/doctype/lead/lead.py | 2 +- erpnext/selling/doctype/lead/test_lead.py | 2 +- .../doctype/opportunity/opportunity.py | 4 +- .../selling/doctype/quotation/quotation.py | 6 +- .../doctype/quotation/test_quotation.py | 4 +- .../doctype/sales_order/sales_order.py | 8 +- .../doctype/sales_order/test_sales_order.py | 24 ++--- .../page/sales_browser/sales_browser.py | 2 +- erpnext/setup/doctype/company/company.py | 14 +-- erpnext/setup/doctype/company/test_company.py | 2 +- .../global_defaults/global_defaults.py | 2 +- .../doctype/item_group/test_item_group.py | 20 ++-- erpnext/setup/install.py | 10 +- .../setup/page/setup_wizard/setup_wizard.py | 46 ++++----- erpnext/startup/boot.py | 4 +- .../doctype/delivery_note/delivery_note.py | 2 +- .../delivery_note/test_delivery_note.py | 22 ++--- erpnext/stock/doctype/item/test_item.py | 2 +- .../doctype/item_price/test_item_price.py | 2 +- .../landed_cost_wizard/landed_cost_wizard.py | 6 +- .../material_request/material_request.py | 4 +- .../material_request/test_material_request.py | 38 ++++---- .../stock/doctype/price_list/price_list.py | 2 +- .../purchase_receipt/purchase_receipt.py | 2 +- .../purchase_receipt/test_purchase_receipt.py | 16 ++-- erpnext/stock/doctype/serial_no/serial_no.py | 6 +- .../stock/doctype/stock_entry/stock_entry.py | 8 +- .../doctype/stock_entry/test_stock_entry.py | 96 +++++++++---------- .../doctype/stock_ledger/stock_ledger.py | 2 +- .../stock_reconciliation.py | 2 +- .../test_stock_reconciliation.py | 12 +-- .../stock_uom_replace_utility.py | 2 +- erpnext/stock/doctype/warehouse/warehouse.py | 4 +- erpnext/stock/get_item_details.py | 2 +- erpnext/stock/stock_ledger.py | 4 +- erpnext/stock/utils.py | 6 +- .../maintenance_schedule.py | 6 +- .../support/doctype/newsletter/newsletter.py | 2 +- .../doctype/newsletter/test_newsletter.py | 10 +- .../support_ticket/get_support_mails.py | 6 +- .../doctype/support_ticket/support_ticket.py | 2 +- erpnext/utilities/doctype/contact/contact.py | 2 +- 83 files changed, 349 insertions(+), 349 deletions(-) diff --git a/erpnext/accounts/doctype/accounts_settings/accounts_settings.py b/erpnext/accounts/doctype/accounts_settings/accounts_settings.py index 0559559a20..b3949ffec3 100644 --- a/erpnext/accounts/doctype/accounts_settings/accounts_settings.py +++ b/erpnext/accounts/doctype/accounts_settings/accounts_settings.py @@ -18,7 +18,7 @@ class AccountsSettings(Document): if cint(self.auto_accounting_for_stock): # set default perpetual account in company for company in frappe.db.sql("select name from tabCompany"): - frappe.bean("Company", company[0]).save() + frappe.get_doc("Company", company[0]).save() # Create account head for warehouses warehouse_list = frappe.db.sql("select name, company from tabWarehouse", as_dict=1) @@ -27,5 +27,5 @@ class AccountsSettings(Document): frappe.throw(_("Company is missing in following warehouses") + ": \n" + "\n".join(warehouse_with_no_company)) for wh in warehouse_list: - wh_bean = frappe.bean("Warehouse", wh.name) + wh_bean = frappe.get_doc("Warehouse", wh.name) wh_bean.save() \ No newline at end of file diff --git a/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.py b/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.py index 536b1998c3..3be7c043a0 100644 --- a/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.py +++ b/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.py @@ -36,7 +36,7 @@ class ChartOfAccounts(Document): child.update(account_properties.get(chart.get("name"), {})\ .get(account_name, {})) - account = frappe.bean({ + account = frappe.get_doc({ "doctype": "Account", "account_name": account_name, "company": company, diff --git a/erpnext/accounts/doctype/chart_of_accounts/import_charts.py b/erpnext/accounts/doctype/chart_of_accounts/import_charts.py index 1d34ab2be0..fd36bf8a86 100644 --- a/erpnext/accounts/doctype/chart_of_accounts/import_charts.py +++ b/erpnext/accounts/doctype/chart_of_accounts/import_charts.py @@ -13,7 +13,7 @@ def import_charts(): chart = json.loads(f.read()) country = frappe.db.get_value("Country", {"code": fname.split("_", 1)[0]}) if country: - bean = frappe.bean({ + bean = frappe.get_doc({ "doctype":"Chart of Accounts", "chart_name": chart.get("name"), "source_file": fname, diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher.py b/erpnext/accounts/doctype/journal_voucher/journal_voucher.py index 99aae56715..cbb8fd95a9 100644 --- a/erpnext/accounts/doctype/journal_voucher/journal_voucher.py +++ b/erpnext/accounts/doctype/journal_voucher/journal_voucher.py @@ -347,7 +347,7 @@ def get_default_bank_cash_account(company, voucher_type): @frappe.whitelist() def get_payment_entry_from_sales_invoice(sales_invoice): from erpnext.accounts.utils import get_balance_on - si = frappe.bean("Sales Invoice", sales_invoice) + si = frappe.get_doc("Sales Invoice", sales_invoice) jv = get_payment_entry(si.doc) jv.remark = 'Payment received against Sales Invoice %(name)s. %(remarks)s' % si.fields @@ -365,7 +365,7 @@ def get_payment_entry_from_sales_invoice(sales_invoice): @frappe.whitelist() def get_payment_entry_from_purchase_invoice(purchase_invoice): from erpnext.accounts.utils import get_balance_on - pi = frappe.bean("Purchase Invoice", purchase_invoice) + pi = frappe.get_doc("Purchase Invoice", purchase_invoice) jv = get_payment_entry(pi.doc) jv.remark = 'Payment against Purchase Invoice %(name)s. %(remarks)s' % pi.fields diff --git a/erpnext/accounts/doctype/journal_voucher/test_journal_voucher.py b/erpnext/accounts/doctype/journal_voucher/test_journal_voucher.py index 0e02e02124..20a342d090 100644 --- a/erpnext/accounts/doctype/journal_voucher/test_journal_voucher.py +++ b/erpnext/accounts/doctype/journal_voucher/test_journal_voucher.py @@ -9,14 +9,14 @@ import frappe class TestJournalVoucher(unittest.TestCase): def test_journal_voucher_with_against_jv(self): self.clear_account_balance() - jv_invoice = frappe.bean(copy=test_records[2]) + jv_invoice = frappe.get_doc(copy=test_records[2]) jv_invoice.insert() jv_invoice.submit() self.assertTrue(not frappe.db.sql("""select name from `tabJournal Voucher Detail` where against_jv=%s""", jv_invoice.name)) - jv_payment = frappe.bean(copy=test_records[0]) + jv_payment = frappe.get_doc(copy=test_records[0]) jv_payment.doclist[1].against_jv = jv_invoice.name jv_payment.insert() jv_payment.submit() @@ -37,7 +37,7 @@ class TestJournalVoucher(unittest.TestCase): from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory set_perpetual_inventory() - jv = frappe.bean(copy=test_records[0]) + jv = frappe.get_doc(copy=test_records[0]) jv.doclist[1].account = "_Test Warehouse - _TC" jv.insert() @@ -50,7 +50,7 @@ class TestJournalVoucher(unittest.TestCase): frappe.db.set_value("Company", "_Test Company", "monthly_bgt_flag", "Ignore") self.clear_account_balance() - jv = frappe.bean(copy=test_records[0]) + jv = frappe.get_doc(copy=test_records[0]) jv.doclist[2].account = "_Test Account Cost for Goods Sold - _TC" jv.doclist[2].cost_center = "_Test Cost Center - _TC" jv.doclist[2].debit = 20000.0 @@ -65,7 +65,7 @@ class TestJournalVoucher(unittest.TestCase): frappe.db.set_value("Company", "_Test Company", "monthly_bgt_flag", "Stop") self.clear_account_balance() - jv = frappe.bean(copy=test_records[0]) + jv = frappe.get_doc(copy=test_records[0]) jv.doclist[2].account = "_Test Account Cost for Goods Sold - _TC" jv.doclist[2].cost_center = "_Test Cost Center - _TC" jv.doclist[2].debit = 20000.0 @@ -83,7 +83,7 @@ class TestJournalVoucher(unittest.TestCase): frappe.db.set_value("Company", "_Test Company", "yearly_bgt_flag", "Stop") - jv = frappe.bean(copy=test_records[0]) + jv = frappe.get_doc(copy=test_records[0]) jv.posting_date = "2013-08-12" jv.doclist[2].account = "_Test Account Cost for Goods Sold - _TC" jv.doclist[2].cost_center = "_Test Cost Center - _TC" @@ -100,7 +100,7 @@ class TestJournalVoucher(unittest.TestCase): frappe.db.set_value("Company", "_Test Company", "monthly_bgt_flag", "Stop") self.clear_account_balance() - jv = frappe.bean(copy=test_records[0]) + jv = frappe.get_doc(copy=test_records[0]) jv.doclist[1].account = "_Test Account Cost for Goods Sold - _TC" jv.doclist[1].cost_center = "_Test Cost Center - _TC" jv.doclist[1].credit = 30000.0 @@ -110,7 +110,7 @@ class TestJournalVoucher(unittest.TestCase): self.assertTrue(frappe.db.get_value("GL Entry", {"voucher_type": "Journal Voucher", "voucher_no": jv.name})) - jv1 = frappe.bean(copy=test_records[0]) + jv1 = frappe.get_doc(copy=test_records[0]) jv1.doclist[2].account = "_Test Account Cost for Goods Sold - _TC" jv1.doclist[2].cost_center = "_Test Cost Center - _TC" jv1.doclist[2].debit = 40000.0 diff --git a/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py b/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py index b9dca05e99..9ffe451e91 100644 --- a/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py +++ b/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py @@ -12,18 +12,18 @@ class TestPeriodClosingVoucher(unittest.TestCase): frappe.db.sql("""delete from `tabGL Entry`""") from erpnext.accounts.doctype.journal_voucher.test_journal_voucher import test_records as jv_records - jv = frappe.bean(copy=jv_records[2]) + jv = frappe.get_doc(copy=jv_records[2]) jv.insert() jv.submit() - jv1 = frappe.bean(copy=jv_records[0]) + jv1 = frappe.get_doc(copy=jv_records[0]) jv1.doclist[2].account = "_Test Account Cost for Goods Sold - _TC" jv1.doclist[2].debit = 600.0 jv1.doclist[1].credit = 600.0 jv1.insert() jv1.submit() - pcv = frappe.bean(copy=test_record) + pcv = frappe.get_doc(copy=test_record) pcv.insert() pcv.submit() diff --git a/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py index 9d1e5da8f8..c1bd3195d3 100644 --- a/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py +++ b/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py @@ -19,7 +19,7 @@ class TestPricingRule(unittest.TestCase): "price": 0, "discount_percentage": 10, }] - frappe.bean(copy=test_record).insert() + frappe.get_doc(copy=test_record).insert() args = frappe._dict({ "item_code": "_Test Item", @@ -38,7 +38,7 @@ class TestPricingRule(unittest.TestCase): details = get_item_details(args) self.assertEquals(details.get("discount_percentage"), 10) - prule = frappe.bean(copy=test_record) + prule = frappe.get_doc(copy=test_record) prule.applicable_for = "Customer" self.assertRaises(MandatoryError, prule.insert) prule.customer = "_Test Customer" @@ -47,7 +47,7 @@ class TestPricingRule(unittest.TestCase): details = get_item_details(args) self.assertEquals(details.get("discount_percentage"), 20) - prule = frappe.bean(copy=test_record) + prule = frappe.get_doc(copy=test_record) prule.apply_on = "Item Group" prule.item_group = "All Item Groups" prule.discount_percentage = 15 @@ -57,7 +57,7 @@ class TestPricingRule(unittest.TestCase): details = get_item_details(args) self.assertEquals(details.get("discount_percentage"), 10) - prule = frappe.bean(copy=test_record) + prule = frappe.get_doc(copy=test_record) prule.applicable_for = "Campaign" prule.campaign = "_Test Campaign" prule.discount_percentage = 5 diff --git a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py index f3fae30731..fa79c37d20 100644 --- a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py @@ -19,7 +19,7 @@ class TestPurchaseInvoice(unittest.TestCase): set_perpetual_inventory(0) self.assertTrue(not cint(frappe.defaults.get_global_default("auto_accounting_for_stock"))) - wrapper = frappe.bean(copy=test_records[0]) + wrapper = frappe.get_doc(copy=test_records[0]) wrapper.insert() wrapper.submit() wrapper.load_from_db() @@ -45,7 +45,7 @@ class TestPurchaseInvoice(unittest.TestCase): set_perpetual_inventory(1) self.assertEqual(cint(frappe.defaults.get_global_default("auto_accounting_for_stock")), 1) - pi = frappe.bean(copy=test_records[1]) + pi = frappe.get_doc(copy=test_records[1]) pi.insert() pi.submit() @@ -73,7 +73,7 @@ class TestPurchaseInvoice(unittest.TestCase): set_perpetual_inventory() self.assertEqual(cint(frappe.defaults.get_global_default("auto_accounting_for_stock")), 1) - pi = frappe.bean(copy=test_records[1]) + pi = frappe.get_doc(copy=test_records[1]) pi.doclist[1].item_code = "_Test Non Stock Item" pi.doclist[1].expense_account = "_Test Account Cost for Goods Sold - _TC" pi.doclist.pop(2) @@ -99,7 +99,7 @@ class TestPurchaseInvoice(unittest.TestCase): set_perpetual_inventory(0) def test_purchase_invoice_calculation(self): - wrapper = frappe.bean(copy=test_records[0]) + wrapper = frappe.get_doc(copy=test_records[0]) wrapper.insert() wrapper.load_from_db() @@ -132,7 +132,7 @@ class TestPurchaseInvoice(unittest.TestCase): self.assertEqual(tax.total, expected_values[i][2]) def test_purchase_invoice_with_subcontracted_item(self): - wrapper = frappe.bean(copy=test_records[0]) + wrapper = frappe.get_doc(copy=test_records[0]) wrapper.doclist[1].item_code = "_Test FG Item" wrapper.insert() wrapper.load_from_db() @@ -169,11 +169,11 @@ class TestPurchaseInvoice(unittest.TestCase): from erpnext.accounts.doctype.journal_voucher.test_journal_voucher \ import test_records as jv_test_records - jv = frappe.bean(copy=jv_test_records[1]) + jv = frappe.get_doc(copy=jv_test_records[1]) jv.insert() jv.submit() - pi = frappe.bean(copy=test_records[0]) + pi = frappe.get_doc(copy=test_records[0]) pi.append("advance_allocation_details", { "journal_voucher": jv.name, "jv_detail_no": jv.doclist[1].name, diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 449fca0f3a..ccdd99f0de 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -156,7 +156,7 @@ class SalesInvoice(SellingController): def update_time_log_batch(self, sales_invoice): for d in self.doclist.get({"doctype":"Sales Invoice Item"}): if d.time_log_batch: - tlb = frappe.bean("Time Log Batch", d.time_log_batch) + tlb = frappe.get_doc("Time Log Batch", d.time_log_batch) tlb.sales_invoice = sales_invoice tlb.update_after_submit() @@ -672,7 +672,7 @@ def manage_recurring_invoices(next_date=None, commit=True): where posting_date=%s and recurring_id=%s and docstatus=1""", (next_date, recurring_id)): try: - ref_wrapper = frappe.bean('Sales Invoice', ref_invoice) + ref_wrapper = frappe.get_doc('Sales Invoice', ref_invoice) new_invoice_wrapper = make_new_invoice(ref_wrapper, next_date) send_notification(new_invoice_wrapper) if commit: @@ -798,7 +798,7 @@ def make_delivery_note(source_name, target_doc=None): from frappe.model.mapper import get_mapped_doc def set_missing_values(source, target): - bean = frappe.bean(target) + bean = frappe.get_doc(target) bean.run_method("onload_post_render") def update_item(source_doc, target_doc, source_parent): diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index 740e752dee..87c8923887 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -10,29 +10,29 @@ from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_per class TestSalesInvoice(unittest.TestCase): def make(self): - w = frappe.bean(copy=test_records[0]) + w = frappe.get_doc(copy=test_records[0]) w.is_pos = 0 w.insert() w.submit() return w def test_double_submission(self): - w = frappe.bean(copy=test_records[0]) + w = frappe.get_doc(copy=test_records[0]) w.docstatus = '0' w.insert() w2 = [d for d in w.doclist] w.submit() - w = frappe.bean(w2) + w = frappe.get_doc(w2) self.assertRaises(DocstatusTransitionError, w.submit) def test_timestamp_change(self): - w = frappe.bean(copy=test_records[0]) + w = frappe.get_doc(copy=test_records[0]) w.docstatus = '0' w.insert() - w2 = frappe.bean([d.fields.copy() for d in w.doclist]) + w2 = frappe.get_doc([d.fields.copy() for d in w.doclist]) import time time.sleep(1) @@ -43,7 +43,7 @@ class TestSalesInvoice(unittest.TestCase): self.assertRaises(TimestampMismatchError, w2.save) def test_sales_invoice_calculation_base_currency(self): - si = frappe.bean(copy=test_records[2]) + si = frappe.get_doc(copy=test_records[2]) si.insert() expected_values = { @@ -87,7 +87,7 @@ class TestSalesInvoice(unittest.TestCase): self.assertEquals(si.grand_total_export, 1627.05) def test_sales_invoice_calculation_export_currency(self): - si = frappe.bean(copy=test_records[2]) + si = frappe.get_doc(copy=test_records[2]) si.currency = "USD" si.conversion_rate = 50 si.doclist[1].rate = 1 @@ -137,7 +137,7 @@ class TestSalesInvoice(unittest.TestCase): self.assertEquals(si.grand_total_export, 32.54) def test_sales_invoice_discount_amount(self): - si = frappe.bean(copy=test_records[3]) + si = frappe.get_doc(copy=test_records[3]) si.discount_amount = 104.95 si.append("other_charges", { "doctype": "Sales Taxes and Charges", @@ -192,7 +192,7 @@ class TestSalesInvoice(unittest.TestCase): self.assertEquals(si.grand_total_export, 1500) def test_discount_amount_gl_entry(self): - si = frappe.bean(copy=test_records[3]) + si = frappe.get_doc(copy=test_records[3]) si.discount_amount = 104.95 si.append("other_charges", { "doctype": "Sales Taxes and Charges", @@ -240,7 +240,7 @@ class TestSalesInvoice(unittest.TestCase): self.assertFalse(gle) def test_inclusive_rate_validations(self): - si = frappe.bean(copy=test_records[2]) + si = frappe.get_doc(copy=test_records[2]) for i, tax in enumerate(si.get("other_charges")): tax.idx = i+1 @@ -258,7 +258,7 @@ class TestSalesInvoice(unittest.TestCase): def test_sales_invoice_calculation_base_currency_with_tax_inclusive_price(self): # prepare - si = frappe.bean(copy=test_records[3]) + si = frappe.get_doc(copy=test_records[3]) si.insert() expected_values = { @@ -303,7 +303,7 @@ class TestSalesInvoice(unittest.TestCase): def test_sales_invoice_calculation_export_currency_with_tax_inclusive_price(self): # prepare - si = frappe.bean(copy=test_records[3]) + si = frappe.get_doc(copy=test_records[3]) si.currency = "USD" si.conversion_rate = 50 si.doclist[1].price_list_rate = 55.56 @@ -365,7 +365,7 @@ class TestSalesInvoice(unittest.TestCase): from erpnext.accounts.doctype.journal_voucher.test_journal_voucher \ import test_records as jv_test_records - jv = frappe.bean(frappe.copy_doc(jv_test_records[0])) + jv = frappe.get_doc(frappe.copy_doc(jv_test_records[0])) jv.doclist[1].against_invoice = w.name jv.insert() jv.submit() @@ -378,10 +378,10 @@ class TestSalesInvoice(unittest.TestCase): 561.8) def test_time_log_batch(self): - tlb = frappe.bean("Time Log Batch", "_T-Time Log Batch-00001") + tlb = frappe.get_doc("Time Log Batch", "_T-Time Log Batch-00001") tlb.submit() - si = frappe.bean(frappe.copy_doc(test_records[0])) + si = frappe.get_doc(frappe.copy_doc(test_records[0])) si.doclist[1].time_log_batch = "_T-Time Log Batch-00001" si.insert() si.submit() @@ -403,7 +403,7 @@ class TestSalesInvoice(unittest.TestCase): def test_sales_invoice_gl_entry_without_aii(self): self.clear_stock_account_balance() set_perpetual_inventory(0) - si = frappe.bean(copy=test_records[1]) + si = frappe.get_doc(copy=test_records[1]) si.insert() si.submit() @@ -447,7 +447,7 @@ class TestSalesInvoice(unittest.TestCase): pos[0]["cash_bank_account"] = "_Test Account Bank Account - _TC" pos[0]["paid_amount"] = 600.0 - si = frappe.bean(copy=pos) + si = frappe.get_doc(copy=pos) si.insert() si.submit() @@ -500,7 +500,7 @@ class TestSalesInvoice(unittest.TestCase): # insert purchase receipt from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import test_records \ as pr_test_records - pr = frappe.bean(copy=pr_test_records[0]) + pr = frappe.get_doc(copy=pr_test_records[0]) pr.naming_series = "_T-Purchase Receipt-" pr.doclist[1].warehouse = "_Test Warehouse No Account - _TC" pr.insert() @@ -511,7 +511,7 @@ class TestSalesInvoice(unittest.TestCase): si_doclist[0]["posting_time"] = "12:05" si_doclist[1]["warehouse"] = "_Test Warehouse No Account - _TC" - si = frappe.bean(copy=si_doclist) + si = frappe.get_doc(copy=si_doclist) si.insert() si.submit() @@ -553,7 +553,7 @@ class TestSalesInvoice(unittest.TestCase): si_copy = frappe.copy_doc(test_records[1]) si_copy[1]["item_code"] = None - si = frappe.bean(si_copy) + si = frappe.get_doc(si_copy) si.insert() si.submit() @@ -580,7 +580,7 @@ class TestSalesInvoice(unittest.TestCase): set_perpetual_inventory() si_copy = frappe.copy_doc(test_records[1]) si_copy[1]["item_code"] = "_Test Non Stock Item" - si = frappe.bean(si_copy) + si = frappe.get_doc(si_copy) si.insert() si.submit() @@ -605,7 +605,7 @@ class TestSalesInvoice(unittest.TestCase): def _insert_purchase_receipt(self): from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import test_records \ as pr_test_records - pr = frappe.bean(copy=pr_test_records[0]) + pr = frappe.get_doc(copy=pr_test_records[0]) pr.naming_series = "_T-Purchase Receipt-" pr.insert() pr.submit() @@ -613,7 +613,7 @@ class TestSalesInvoice(unittest.TestCase): def _insert_delivery_note(self): from erpnext.stock.doctype.delivery_note.test_delivery_note import test_records \ as dn_test_records - dn = frappe.bean(copy=dn_test_records[0]) + dn = frappe.get_doc(copy=dn_test_records[0]) dn.naming_series = "_T-Delivery Note-" dn.insert() dn.submit() @@ -624,18 +624,18 @@ class TestSalesInvoice(unittest.TestCase): import test_records as pos_setting_test_records frappe.db.sql("""delete from `tabPOS Setting`""") - ps = frappe.bean(copy=pos_setting_test_records[0]) + ps = frappe.get_doc(copy=pos_setting_test_records[0]) ps.insert() def test_sales_invoice_with_advance(self): from erpnext.accounts.doctype.journal_voucher.test_journal_voucher \ import test_records as jv_test_records - jv = frappe.bean(copy=jv_test_records[0]) + jv = frappe.get_doc(copy=jv_test_records[0]) jv.insert() jv.submit() - si = frappe.bean(copy=test_records[0]) + si = frappe.get_doc(copy=test_records[0]) si.append("advance_adjustment_details", { "doctype": "Sales Invoice Advance", "journal_voucher": jv.name, @@ -665,7 +665,7 @@ class TestSalesInvoice(unittest.TestCase): from frappe.utils import get_first_day, get_last_day, add_to_date, nowdate, getdate from erpnext.accounts.utils import get_fiscal_year today = nowdate() - base_si = frappe.bean(copy=test_records[0]) + base_si = frappe.get_doc(copy=test_records[0]) base_si.update({ "convert_into_recurring_invoice": 1, "recurring_type": "Monthly", @@ -678,13 +678,13 @@ class TestSalesInvoice(unittest.TestCase): }) # monthly - si1 = frappe.bean(copy=base_si.doclist) + si1 = frappe.get_doc(copy=base_si.doclist) si1.insert() si1.submit() self._test_recurring_invoice(si1, True) # monthly without a first and last day period - si2 = frappe.bean(copy=base_si.doclist) + si2 = frappe.get_doc(copy=base_si.doclist) si2.update({ "invoice_period_from_date": today, "invoice_period_to_date": add_to_date(today, days=30) @@ -694,7 +694,7 @@ class TestSalesInvoice(unittest.TestCase): self._test_recurring_invoice(si2, False) # quarterly - si3 = frappe.bean(copy=base_si.doclist) + si3 = frappe.get_doc(copy=base_si.doclist) si3.update({ "recurring_type": "Quarterly", "invoice_period_from_date": get_first_day(today), @@ -705,7 +705,7 @@ class TestSalesInvoice(unittest.TestCase): self._test_recurring_invoice(si3, True) # quarterly without a first and last day period - si4 = frappe.bean(copy=base_si.doclist) + si4 = frappe.get_doc(copy=base_si.doclist) si4.update({ "recurring_type": "Quarterly", "invoice_period_from_date": today, @@ -716,7 +716,7 @@ class TestSalesInvoice(unittest.TestCase): self._test_recurring_invoice(si4, False) # yearly - si5 = frappe.bean(copy=base_si.doclist) + si5 = frappe.get_doc(copy=base_si.doclist) si5.update({ "recurring_type": "Yearly", "invoice_period_from_date": get_first_day(today), @@ -727,7 +727,7 @@ class TestSalesInvoice(unittest.TestCase): self._test_recurring_invoice(si5, True) # yearly without a first and last day period - si6 = frappe.bean(copy=base_si.doclist) + si6 = frappe.get_doc(copy=base_si.doclist) si6.update({ "recurring_type": "Yearly", "invoice_period_from_date": today, @@ -738,7 +738,7 @@ class TestSalesInvoice(unittest.TestCase): self._test_recurring_invoice(si6, False) # change posting date but keep recuring day to be today - si7 = frappe.bean(copy=base_si.doclist) + si7 = frappe.get_doc(copy=base_si.doclist) si7.update({ "posting_date": add_to_date(today, days=-1) }) @@ -771,7 +771,7 @@ class TestSalesInvoice(unittest.TestCase): self.assertEquals(i+2, len(recurred_invoices)) - new_si = frappe.bean("Sales Invoice", recurred_invoices[0][0]) + new_si = frappe.get_doc("Sales Invoice", recurred_invoices[0][0]) for fieldname in ["convert_into_recurring_invoice", "recurring_type", "repeat_on_day_of_month", "notification_email_address"]: @@ -811,7 +811,7 @@ class TestSalesInvoice(unittest.TestCase): se = make_serialized_item() serial_nos = get_serial_nos(se.doclist[1].serial_no) - si = frappe.bean(copy=test_records[0]) + si = frappe.get_doc(copy=test_records[0]) si.update_stock = 1 si.doclist[1].item_code = "_Test Serialized Item With Series" si.doclist[1].qty = 1 @@ -845,11 +845,11 @@ class TestSalesInvoice(unittest.TestCase): se = make_serialized_item() serial_nos = get_serial_nos(se.doclist[1].serial_no) - sr = frappe.bean("Serial No", serial_nos[0]) + sr = frappe.get_doc("Serial No", serial_nos[0]) sr.status = "Not Available" sr.save() - si = frappe.bean(copy=test_records[0]) + si = frappe.get_doc(copy=test_records[0]) si.update_stock = 1 si.doclist[1].item_code = "_Test Serialized Item With Series" si.doclist[1].qty = 1 diff --git a/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py b/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py index 40853471a7..fe763e7438 100644 --- a/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py +++ b/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py @@ -7,12 +7,12 @@ from erpnext.accounts.doctype.shipping_rule.shipping_rule import FromGreaterThan class TestShippingRule(unittest.TestCase): def test_from_greater_than_to(self): - shipping_rule = frappe.bean(copy=test_records[0]) + shipping_rule = frappe.get_doc(copy=test_records[0]) shipping_rule.doclist[1].from_value = 101 self.assertRaises(FromGreaterThanToError, shipping_rule.insert) def test_many_zero_to_values(self): - shipping_rule = frappe.bean(copy=test_records[0]) + shipping_rule = frappe.get_doc(copy=test_records[0]) shipping_rule.doclist[1].to_value = 0 self.assertRaises(ManyBlankToValuesError, shipping_rule.insert) @@ -24,7 +24,7 @@ class TestShippingRule(unittest.TestCase): ((50, 150), (25, 175)), ((50, 150), (50, 150)), ]: - shipping_rule = frappe.bean(copy=test_records[0]) + shipping_rule = frappe.get_doc(copy=test_records[0]) shipping_rule.doclist[1].from_value = range_a[0] shipping_rule.doclist[1].to_value = range_a[1] shipping_rule.doclist[2].from_value = range_b[0] diff --git a/erpnext/accounts/general_ledger.py b/erpnext/accounts/general_ledger.py index f2eef285ce..2531e17f27 100644 --- a/erpnext/accounts/general_ledger.py +++ b/erpnext/accounts/general_ledger.py @@ -77,7 +77,7 @@ def save_entries(gl_map, adv_adj, update_outstanding): def make_entry(args, adv_adj, update_outstanding): args.update({"doctype": "GL Entry"}) - gle = frappe.bean([args]) + gle = frappe.get_doc([args]) gle.ignore_permissions = 1 gle.insert() gle.run_method("on_update_with_args", adv_adj, update_outstanding) diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py index 1557e3f3c6..7804734d25 100644 --- a/erpnext/accounts/party.py +++ b/erpnext/accounts/party.py @@ -25,7 +25,7 @@ def _get_party_details(party=None, account=None, party_type="Customer", company= if not ignore_permissions and not frappe.has_permission(party_type, "read", party): frappe.throw("Not Permitted", frappe.PermissionError) - party_bean = frappe.bean(party_type, party) + party_bean = frappe.get_doc(party_type, party) party = party_bean.doc set_address_details(out, party, party_type) @@ -166,7 +166,7 @@ def create_party_account(party, party_type, company): frappe.throw(_("Please enter Account Receivable/Payable group in company master")) # create - account = frappe.bean({ + account = frappe.get_doc({ "doctype": "Account", 'account_name': party, 'parent_account': parent_account, diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index db13d62012..e0c1e3ac12 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -103,7 +103,7 @@ def add_ac(args=None): args = frappe.local.form_dict args.pop("cmd") - ac = frappe.bean(args) + ac = frappe.get_doc(args) ac.doctype = "Account" ac.old_parent = "" ac.freeze_account = "No" @@ -116,7 +116,7 @@ def add_cc(args=None): args = frappe.local.form_dict args.pop("cmd") - cc = frappe.bean(args) + cc = frappe.get_doc(args) cc.doctype = "Cost Center" cc.old_parent = "" cc.insert() diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index 066afe02b1..ee68134b7a 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -185,7 +185,7 @@ def make_purchase_receipt(source_name, target_doc=None): from frappe.model.mapper import get_mapped_doc def set_missing_values(source, target): - bean = frappe.bean(target) + bean = frappe.get_doc(target) bean.run_method("set_missing_values") def update_item(obj, target, source_parent): @@ -224,7 +224,7 @@ def make_purchase_invoice(source_name, target_doc=None): from frappe.model.mapper import get_mapped_doc def set_missing_values(source, target): - bean = frappe.bean(target) + bean = frappe.get_doc(target) bean.run_method("set_missing_values") def update_item(obj, target, source_parent): diff --git a/erpnext/buying/doctype/purchase_order/test_purchase_order.py b/erpnext/buying/doctype/purchase_order/test_purchase_order.py index 1bc7c5473d..997d6dc88d 100644 --- a/erpnext/buying/doctype/purchase_order/test_purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/test_purchase_order.py @@ -11,12 +11,12 @@ class TestPurchaseOrder(unittest.TestCase): def test_make_purchase_receipt(self): from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_receipt - po = frappe.bean(copy=test_records[0]).insert() + po = frappe.get_doc(copy=test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_purchase_receipt, po.name) - po = frappe.bean("Purchase Order", po.name) + po = frappe.get_doc("Purchase Order", po.name) po.submit() pr = make_purchase_receipt(po.name) @@ -26,7 +26,7 @@ class TestPurchaseOrder(unittest.TestCase): self.assertEquals(len(pr), len(test_records[0])) pr[0]["naming_series"] = "_T-Purchase Receipt-" - pr_bean = frappe.bean(pr) + pr_bean = frappe.get_doc(pr) pr_bean.insert() def test_ordered_qty(self): @@ -34,12 +34,12 @@ class TestPurchaseOrder(unittest.TestCase): from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_receipt - po = frappe.bean(copy=test_records[0]).insert() + po = frappe.get_doc(copy=test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_purchase_receipt, po.name) - po = frappe.bean("Purchase Order", po.name) + po = frappe.get_doc("Purchase Order", po.name) po.is_subcontracted = "No" po.doclist[1].item_code = "_Test Item" po.submit() @@ -54,7 +54,7 @@ class TestPurchaseOrder(unittest.TestCase): pr[0]["posting_date"] = "2013-05-12" pr[0]["naming_series"] = "_T-Purchase Receipt-" pr[1]["qty"] = 4.0 - pr_bean = frappe.bean(pr) + pr_bean = frappe.get_doc(pr) pr_bean.insert() pr_bean.submit() @@ -67,7 +67,7 @@ class TestPurchaseOrder(unittest.TestCase): pr1[0]["naming_series"] = "_T-Purchase Receipt-" pr1[0]["posting_date"] = "2013-05-12" pr1[1]["qty"] = 8 - pr1_bean = frappe.bean(pr1) + pr1_bean = frappe.get_doc(pr1) pr1_bean.insert() pr1_bean.submit() @@ -77,12 +77,12 @@ class TestPurchaseOrder(unittest.TestCase): def test_make_purchase_invoice(self): from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_invoice - po = frappe.bean(copy=test_records[0]).insert() + po = frappe.get_doc(copy=test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_purchase_invoice, po.name) - po = frappe.bean("Purchase Order", po.name) + po = frappe.get_doc("Purchase Order", po.name) po.submit() pi = make_purchase_invoice(po.name) @@ -90,23 +90,23 @@ class TestPurchaseOrder(unittest.TestCase): self.assertEquals(len(pi), len(test_records[0])) pi[0]["posting_date"] = "2013-05-12" pi[0]["bill_no"] = "NA" - frappe.bean(pi).insert() + frappe.get_doc(pi).insert() def test_subcontracting(self): - po = frappe.bean(copy=test_records[0]) + po = frappe.get_doc(copy=test_records[0]) po.insert() self.assertEquals(len(po.get("po_raw_material_details")), 2) def test_warehouse_company_validation(self): from erpnext.stock.utils import InvalidWarehouseCompany - po = frappe.bean(copy=test_records[0]) + po = frappe.get_doc(copy=test_records[0]) po.company = "_Test Company 1" po.conversion_rate = 0.0167 self.assertRaises(InvalidWarehouseCompany, po.insert) def test_uom_integer_validation(self): from erpnext.utilities.transaction_base import UOMMustBeIntegerError - po = frappe.bean(copy=test_records[0]) + po = frappe.get_doc(copy=test_records[0]) po.doclist[1].qty = 3.4 self.assertRaises(UOMMustBeIntegerError, po.insert) diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py index ef48c79989..6fced379a3 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py @@ -56,7 +56,7 @@ def make_purchase_order(source_name, target_doc=None): from frappe.model.mapper import get_mapped_doc def set_missing_values(source, target): - bean = frappe.bean(target) + bean = frappe.get_doc(target) bean.run_method("set_missing_values") bean.run_method("get_schedule_dates") diff --git a/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py b/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py index 3e5461ab3a..fc1d25d398 100644 --- a/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py +++ b/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py @@ -11,12 +11,12 @@ class TestPurchaseOrder(unittest.TestCase): def test_make_purchase_order(self): from erpnext.buying.doctype.supplier_quotation.supplier_quotation import make_purchase_order - sq = frappe.bean(copy=test_records[0]).insert() + sq = frappe.get_doc(copy=test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_purchase_order, sq.name) - sq = frappe.bean("Supplier Quotation", sq.name) + sq = frappe.get_doc("Supplier Quotation", sq.name) sq.submit() po = make_purchase_order(sq.name) @@ -29,7 +29,7 @@ class TestPurchaseOrder(unittest.TestCase): if doc.get("item_code"): doc["schedule_date"] = "2013-04-12" - frappe.bean(po).insert() + frappe.get_doc(po).insert() test_records = [ [ diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 7ebd1af919..4801c75ee8 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -118,7 +118,7 @@ class AccountsController(TransactionBase): tax_doctype = self.meta.get_field(tax_parentfield).options from frappe.model import default_fields - tax_master = frappe.bean(tax_master_doctype, self.get(tax_master_field)) + tax_master = frappe.get_doc(tax_master_doctype, self.get(tax_master_field)) for i, tax in enumerate(tax_master.get(tax_parentfield)): for fieldname in default_fields: diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index 5495e6fb2f..da4d939f60 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -35,7 +35,7 @@ class SellingController(StockController): if self.customer: from erpnext.accounts.party import _get_party_details self.update_if_missing(_get_party_details(self.customer, - ignore_permissions=self.bean.ignore_permissions)) + ignore_permissions=self.ignore_permissions)) elif self.lead: from erpnext.selling.doctype.lead.lead import get_lead_details @@ -47,7 +47,7 @@ class SellingController(StockController): def apply_shipping_rule(self): if self.shipping_rule: - shipping_rule = frappe.bean("Shipping Rule", self.shipping_rule) + shipping_rule = frappe.get_doc("Shipping Rule", self.shipping_rule) value = self.net_total # TODO @@ -274,7 +274,7 @@ class SellingController(StockController): total_outstanding = total_outstanding[0][0] if total_outstanding else 0 outstanding_including_current = flt(total_outstanding) + flt(grand_total) - frappe.bean('Account', customer_account).run_method("check_credit_limit", + frappe.get_doc('Account', customer_account).run_method("check_credit_limit", outstanding_including_current) def validate_max_discount(self): diff --git a/erpnext/hr/doctype/employee/employee.py b/erpnext/hr/doctype/employee/employee.py index 0291eb64cd..914d80db63 100644 --- a/erpnext/hr/doctype/employee/employee.py +++ b/erpnext/hr/doctype/employee/employee.py @@ -101,7 +101,7 @@ class Employee(DocListController): if not user_wrapper.user_image == self.image: user_wrapper.user_image = self.image try: - frappe.doc({ + frappe.get_doc({ "doctype": "File Data", "file_name": self.image, "attached_to_doctype": "User", diff --git a/erpnext/hr/doctype/job_applicant/get_job_applications.py b/erpnext/hr/doctype/job_applicant/get_job_applications.py index c384ccc159..a94325d562 100644 --- a/erpnext/hr/doctype/job_applicant/get_job_applications.py +++ b/erpnext/hr/doctype/job_applicant/get_job_applications.py @@ -9,7 +9,7 @@ from frappe.core.doctype.communication.communication import _make class JobsMailbox(POP3Mailbox): def setup(self, args=None): - self.settings = args or frappe.doc("Jobs Email Settings", "Jobs Email Settings") + self.settings = args or frappe.get_doc("Jobs Email Settings", "Jobs Email Settings") def process_message(self, mail): if mail.from_email == self.settings.email_id: @@ -18,7 +18,7 @@ class JobsMailbox(POP3Mailbox): name = frappe.db.get_value("Job Applicant", {"email_id": mail.from_email}, "name") if name: - applicant = frappe.bean("Job Applicant", name) + applicant = frappe.get_doc("Job Applicant", name) if applicant.status!="Rejected": applicant.status = "Open" applicant.ignore_permissions = True @@ -26,7 +26,7 @@ class JobsMailbox(POP3Mailbox): else: name = (mail.from_real_name and (mail.from_real_name + " - ") or "") \ + mail.from_email - applicant = frappe.bean({ + applicant = frappe.get_doc({ "creation": mail.date, "doctype":"Job Applicant", "applicant_name": name, diff --git a/erpnext/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py index de8bff78bc..f2f95bfa36 100755 --- a/erpnext/hr/doctype/leave_application/leave_application.py +++ b/erpnext/hr/doctype/leave_application/leave_application.py @@ -18,7 +18,7 @@ from frappe.model.controller import DocListController class LeaveApplication(DocListController): def setup(self): if frappe.db.exists(self.doctype, self.name): - self.previous_doc = frappe.doc(self.doctype, self.name) + self.previous_doc = frappe.get_doc(self.doctype, self.name) else: self.previous_doc = None @@ -147,7 +147,7 @@ class LeaveApplication(DocListController): (self.leave_type, max_days)) def validate_leave_approver(self): - employee = frappe.bean("Employee", self.employee) + employee = frappe.get_doc("Employee", self.employee) leave_approvers = [l.leave_approver for l in employee.get("employee_leave_approvers")] @@ -166,7 +166,7 @@ class LeaveApplication(DocListController): raise_exception=LeaveApproverIdentityError) def notify_employee(self, status): - employee = frappe.doc("Employee", self.employee) + employee = frappe.get_doc("Employee", self.employee) if not employee.user_id: return @@ -186,7 +186,7 @@ class LeaveApplication(DocListController): }) def notify_leave_approver(self): - employee = frappe.doc("Employee", self.employee) + employee = frappe.get_doc("Employee", self.employee) def _get_message(url=False): name = self.name diff --git a/erpnext/hr/doctype/leave_application/test_leave_application.py b/erpnext/hr/doctype/leave_application/test_leave_application.py index 26cc093acf..3ed9d56161 100644 --- a/erpnext/hr/doctype/leave_application/test_leave_application.py +++ b/erpnext/hr/doctype/leave_application/test_leave_application.py @@ -23,7 +23,7 @@ class TestLeaveApplication(unittest.TestCase): def _add_employee_leave_approver(self, employee, leave_approver): temp_session_user = frappe.session.user frappe.set_user("Administrator") - employee = frappe.bean("Employee", employee) + employee = frappe.get_doc("Employee", employee) employee.append("employee_leave_approvers", { "doctype": "Employee Leave Approver", "leave_approver": leave_approver diff --git a/erpnext/hr/doctype/salary_manager/salary_manager.py b/erpnext/hr/doctype/salary_manager/salary_manager.py index cd11598f77..0079b2ed7d 100644 --- a/erpnext/hr/doctype/salary_manager/salary_manager.py +++ b/erpnext/hr/doctype/salary_manager/salary_manager.py @@ -86,7 +86,7 @@ class SalaryManager(Document): if not frappe.db.sql("""select name from `tabSalary Slip` where docstatus!= 2 and employee = %s and month = %s and fiscal_year = %s and company = %s """, (emp[0], self.month, self.fiscal_year, self.company)): - ss = frappe.bean({ + ss = frappe.get_doc({ "doctype": "Salary Slip", "fiscal_year": self.fiscal_year, "employee": emp[0], diff --git a/erpnext/hr/doctype/salary_slip/test_salary_slip.py b/erpnext/hr/doctype/salary_slip/test_salary_slip.py index e991a8a4ed..c14901a5c5 100644 --- a/erpnext/hr/doctype/salary_slip/test_salary_slip.py +++ b/erpnext/hr/doctype/salary_slip/test_salary_slip.py @@ -9,7 +9,7 @@ class TestSalarySlip(unittest.TestCase): frappe.db.sql("""delete from `tabLeave Application`""") frappe.db.sql("""delete from `tabSalary Slip`""") from erpnext.hr.doctype.leave_application.test_leave_application import test_records as leave_applications - la = frappe.bean(copy=leave_applications[4]) + la = frappe.get_doc(copy=leave_applications[4]) la.insert() la.status = "Approved" la.submit() @@ -19,7 +19,7 @@ class TestSalarySlip(unittest.TestCase): def test_salary_slip_with_holidays_included(self): frappe.db.set_value("HR Settings", "HR Settings", "include_holidays_in_total_working_days", 1) - ss = frappe.bean(copy=test_records[0]) + ss = frappe.get_doc(copy=test_records[0]) ss.insert() self.assertEquals(ss.total_days_in_month, 31) self.assertEquals(ss.payment_days, 30) @@ -31,7 +31,7 @@ class TestSalarySlip(unittest.TestCase): self.assertEquals(ss.net_pay, 14867.74) def test_salary_slip_with_holidays_excluded(self): - ss = frappe.bean(copy=test_records[0]) + ss = frappe.get_doc(copy=test_records[0]) ss.insert() self.assertEquals(ss.total_days_in_month, 30) self.assertEquals(ss.payment_days, 29) diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.py b/erpnext/hr/doctype/salary_structure/salary_structure.py index 4c01073359..09956d136c 100644 --- a/erpnext/hr/doctype/salary_structure/salary_structure.py +++ b/erpnext/hr/doctype/salary_structure/salary_structure.py @@ -77,7 +77,7 @@ def get_mapped_doc(source_name, target_doc=None): from frappe.model.mapper import get_mapped_doc def postprocess(source, target): - sal_slip = frappe.bean(target) + sal_slip = frappe.get_doc(target) sal_slip.run_method("pull_emp_details") sal_slip.run_method("get_leave_details") sal_slip.run_method("calculate_net_pay") diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index e3199f983b..237c0cd1e6 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -134,11 +134,11 @@ class Bom(Document): })["rate"] if self.docstatus == 0: - frappe.bean(self.doclist).save() + frappe.get_doc(self.doclist).save() elif self.docstatus == 1: self.calculate_cost() self.update_exploded_items() - frappe.bean(self.doclist).update_after_submit() + frappe.get_doc(self.doclist).update_after_submit() def get_bom_unitcost(self, bom_no): bom = frappe.db.sql("""select name, total_cost/quantity as unit_cost from `tabBOM` diff --git a/erpnext/manufacturing/doctype/production_order/production_order.py b/erpnext/manufacturing/doctype/production_order/production_order.py index a22088a18b..f878cd8933 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.py +++ b/erpnext/manufacturing/doctype/production_order/production_order.py @@ -152,7 +152,7 @@ def get_item_details(item): @frappe.whitelist() def make_stock_entry(production_order_id, purpose): - production_order = frappe.bean("Production Order", production_order_id) + production_order = frappe.get_doc("Production Order", production_order_id) stock_entry = frappe.new_bean("Stock Entry") stock_entry.purpose = purpose diff --git a/erpnext/manufacturing/doctype/production_order/test_production_order.py b/erpnext/manufacturing/doctype/production_order/test_production_order.py index 73b7bcffa3..b3d655a2e4 100644 --- a/erpnext/manufacturing/doctype/production_order/test_production_order.py +++ b/erpnext/manufacturing/doctype/production_order/test_production_order.py @@ -17,22 +17,22 @@ class TestProductionOrder(unittest.TestCase): frappe.db.sql("""delete from `tabBin`""") frappe.db.sql("""delete from `tabGL Entry`""") - pro_bean = frappe.bean(copy = test_records[0]) + pro_bean = frappe.get_doc(copy = test_records[0]) pro_bean.insert() pro_bean.submit() from erpnext.stock.doctype.stock_entry.test_stock_entry import test_records as se_test_records - mr1 = frappe.bean(copy = se_test_records[0]) + mr1 = frappe.get_doc(copy = se_test_records[0]) mr1.insert() mr1.submit() - mr2 = frappe.bean(copy = se_test_records[0]) + mr2 = frappe.get_doc(copy = se_test_records[0]) mr2.doclist[1].item_code = "_Test Item Home Desktop 100" mr2.insert() mr2.submit() stock_entry = make_stock_entry(pro_bean.name, "Manufacture/Repack") - stock_entry = frappe.bean(stock_entry) + stock_entry = frappe.get_doc(stock_entry) stock_entry.fiscal_year = "_Test Fiscal Year 2013" stock_entry.fg_completed_qty = 4 stock_entry.posting_date = "2013-05-12" @@ -52,7 +52,7 @@ class TestProductionOrder(unittest.TestCase): pro_order = self.test_planned_qty() stock_entry = make_stock_entry(pro_order, "Manufacture/Repack") - stock_entry = frappe.bean(stock_entry) + stock_entry = frappe.get_doc(stock_entry) stock_entry.posting_date = "2013-05-12" stock_entry.fiscal_year = "_Test Fiscal Year 2013" stock_entry.fg_completed_qty = 15 diff --git a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py index cdda05ed26..39a0d57d12 100644 --- a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py +++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py @@ -365,7 +365,7 @@ class ProductionPlanningTool(Document): purchase_request_list = [] if items_to_be_requested: for item in items_to_be_requested: - item_wrapper = frappe.bean("Item", item) + item_wrapper = frappe.get_doc("Item", item) pr_doc = frappe.get_doc({ "doctype": "Material Request", "__islocal": 1, 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 156630138c..51719c5b50 100644 --- a/erpnext/patches/4_0/customer_discount_to_pricing_rule.py +++ b/erpnext/patches/4_0/customer_discount_to_pricing_rule.py @@ -17,7 +17,7 @@ def execute(): else: item_group = d.item_group - frappe.bean([{ + frappe.get_doc([{ "doctype": "Pricing Rule", "apply_on": "Item Group", "item_group": item_group, diff --git a/erpnext/patches/4_0/fix_contact_address.py b/erpnext/patches/4_0/fix_contact_address.py index fe33230611..91d1a0b0c6 100644 --- a/erpnext/patches/4_0/fix_contact_address.py +++ b/erpnext/patches/4_0/fix_contact_address.py @@ -4,8 +4,8 @@ def execute(): frappe.reload_doc("website", "doctype", "contact_us_settings") address = frappe.db.get_value("Contact Us Settings", None, "address") if address: - address = frappe.doc("Address", address) - contact = frappe.bean("Contact Us Settings", "Contact Us Settings") + address = frappe.get_doc("Address", address) + contact = frappe.get_doc("Contact Us Settings", "Contact Us Settings") for f in ("address_title", "address_line1", "address_line2", "city", "state", "country", "pincode"): contact.set(f, address.get(f)) diff --git a/erpnext/patches/4_0/split_email_settings.py b/erpnext/patches/4_0/split_email_settings.py index 6f4395b89d..40aad390b1 100644 --- a/erpnext/patches/4_0/split_email_settings.py +++ b/erpnext/patches/4_0/split_email_settings.py @@ -8,13 +8,13 @@ def execute(): frappe.reload_doc("core", "doctype", "outgoing_email_settings") frappe.reload_doc("support", "doctype", "support_email_settings") - email_settings = frappe.bean("Email Settings") + email_settings = frappe.get_doc("Email Settings") map_outgoing_email_settings(email_settings) map_support_email_settings(email_settings) frappe.delete_doc("Doctype", "Email Settings") def map_outgoing_email_settings(email_settings): - outgoing_email_settings = frappe.bean("Outgoing Email Settings") + outgoing_email_settings = frappe.get_doc("Outgoing Email Settings") for fieldname in (("outgoing_mail_server", "mail_server"), "use_ssl", "mail_port", "mail_login", "mail_password", "always_use_login_id_as_sender", @@ -30,7 +30,7 @@ def map_outgoing_email_settings(email_settings): outgoing_email_settings.save() def map_support_email_settings(email_settings): - support_email_settings = frappe.bean("Support Email Settings") + support_email_settings = frappe.get_doc("Support Email Settings") for fieldname in ("sync_support_mails", "support_email", ("support_host", "mail_server"), diff --git a/erpnext/patches/4_0/update_user_properties.py b/erpnext/patches/4_0/update_user_properties.py index 262f7b8230..da8635ed29 100644 --- a/erpnext/patches/4_0/update_user_properties.py +++ b/erpnext/patches/4_0/update_user_properties.py @@ -87,7 +87,7 @@ def add_employee_restrictions_to_leave_approver(): where `tabEmployee Leave Approver`.parent=`tabEmployee`.name) or ifnull(`reports_to`, '')!=''"""): - frappe.bean("Employee", employee).save() + frappe.get_doc("Employee", employee).save() def update_permissions(): # clear match conditions other than owner diff --git a/erpnext/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py index f9c561e8aa..2225acd53b 100644 --- a/erpnext/projects/doctype/project/project.py +++ b/erpnext/projects/doctype/project/project.py @@ -47,7 +47,7 @@ class Project(Document): for milestone in self.get("project_milestones"): if milestone.milestone_date: description = (milestone.milestone or "Milestone") + " for " + self.name - frappe.bean({ + frappe.get_doc({ "doctype": "Event", "owner": self.owner, "subject": description, diff --git a/erpnext/projects/doctype/task/task.py b/erpnext/projects/doctype/task/task.py index 9de6b1b37f..a4dfb4776b 100644 --- a/erpnext/projects/doctype/task/task.py +++ b/erpnext/projects/doctype/task/task.py @@ -44,7 +44,7 @@ class Task(Document): def on_update(self): """update percent complete in project""" if self.project: - project = frappe.bean("Project", self.project) + project = frappe.get_doc("Project", self.project) project.run_method("update_percent_complete") @frappe.whitelist() diff --git a/erpnext/projects/doctype/time_log/test_time_log.py b/erpnext/projects/doctype/time_log/test_time_log.py index 973e89ba59..c0bfa750a2 100644 --- a/erpnext/projects/doctype/time_log/test_time_log.py +++ b/erpnext/projects/doctype/time_log/test_time_log.py @@ -8,7 +8,7 @@ from erpnext.projects.doctype.time_log.time_log import OverlapError class TestTimeLog(unittest.TestCase): def test_duplication(self): - ts = frappe.bean(frappe.copy_doc(test_records[0])) + ts = frappe.get_doc(frappe.copy_doc(test_records[0])) self.assertRaises(OverlapError, ts.insert) test_records = [[{ diff --git a/erpnext/projects/doctype/time_log_batch/test_time_log_batch.py b/erpnext/projects/doctype/time_log_batch/test_time_log_batch.py index f974d709aa..e059c04e99 100644 --- a/erpnext/projects/doctype/time_log_batch/test_time_log_batch.py +++ b/erpnext/projects/doctype/time_log_batch/test_time_log_batch.py @@ -6,7 +6,7 @@ import frappe, unittest class TimeLogBatchTest(unittest.TestCase): def test_time_log_status(self): from erpnext.projects.doctype.time_log.test_time_log import test_records as time_log_records - time_log = frappe.bean(copy=time_log_records[0]) + time_log = frappe.get_doc(copy=time_log_records[0]) time_log.update({ "from_time": "2013-01-02 10:00:00.000000", "to_time": "2013-01-02 11:00:00.000000", @@ -16,7 +16,7 @@ class TimeLogBatchTest(unittest.TestCase): time_log.submit() self.assertEquals(frappe.db.get_value("Time Log", time_log.name, "status"), "Submitted") - tlb = frappe.bean(copy=test_records[0]) + tlb = frappe.get_doc(copy=test_records[0]) tlb.doclist[1].time_log = time_log.name tlb.insert() tlb.submit() diff --git a/erpnext/projects/doctype/time_log_batch/time_log_batch.py b/erpnext/projects/doctype/time_log_batch/time_log_batch.py index 103eb114a6..a8e9be8eb7 100644 --- a/erpnext/projects/doctype/time_log_batch/time_log_batch.py +++ b/erpnext/projects/doctype/time_log_batch/time_log_batch.py @@ -15,7 +15,7 @@ class TimeLogBatch(Document): self.set_status() self.total_hours = 0.0 for d in self.doclist.get({"doctype":"Time Log Batch Detail"}): - tl = frappe.doc("Time Log", d.time_log) + tl = frappe.get_doc("Time Log", d.time_log) self.update_time_log_values(d, tl) self.validate_time_log_is_submitted(tl) self.total_hours += float(tl.hours or 0.0) @@ -54,7 +54,7 @@ class TimeLogBatch(Document): def update_status(self, time_log_batch): self.set_status() for d in self.doclist.get({"doctype":"Time Log Batch Detail"}): - tl = frappe.bean("Time Log", d.time_log) + tl = frappe.get_doc("Time Log", d.time_log) tl.time_log_batch = time_log_batch tl.sales_invoice = self.sales_invoice tl.update_after_submit() \ No newline at end of file diff --git a/erpnext/selling/doctype/lead/get_leads.py b/erpnext/selling/doctype/lead/get_leads.py index 1fe490756f..661021ef0a 100644 --- a/erpnext/selling/doctype/lead/get_leads.py +++ b/erpnext/selling/doctype/lead/get_leads.py @@ -14,7 +14,7 @@ def add_sales_communication(subject, content, sender, real_name, mail=None, if not (lead_name or contact_name): # none, create a new Lead - lead = frappe.bean({ + lead = frappe.get_doc({ "doctype":"Lead", "lead_name": real_name or sender, "email_id": sender, @@ -34,12 +34,12 @@ def add_sales_communication(subject, content, sender, real_name, mail=None, if mail: # save attachments to parent if from mail - bean = frappe.bean(parent_doctype, parent_name) + bean = frappe.get_doc(parent_doctype, parent_name) mail.save_attachments_in_doc(bean.doc) class SalesMailbox(POP3Mailbox): def setup(self, args=None): - self.settings = args or frappe.doc("Sales Email Settings", "Sales Email Settings") + self.settings = args or frappe.get_doc("Sales Email Settings", "Sales Email Settings") def process_message(self, mail): if mail.from_email == self.settings.email_id: diff --git a/erpnext/selling/doctype/lead/lead.py b/erpnext/selling/doctype/lead/lead.py index 9852429519..9e4ead86f4 100644 --- a/erpnext/selling/doctype/lead/lead.py +++ b/erpnext/selling/doctype/lead/lead.py @@ -127,7 +127,7 @@ def get_lead_details(lead): from erpnext.accounts.party import set_address_details out = frappe._dict() - lead_bean = frappe.bean("Lead", lead) + lead_bean = frappe.get_doc("Lead", lead) lead = lead_bean.doc out.update({ diff --git a/erpnext/selling/doctype/lead/test_lead.py b/erpnext/selling/doctype/lead/test_lead.py index 1e64851e02..a403e93332 100644 --- a/erpnext/selling/doctype/lead/test_lead.py +++ b/erpnext/selling/doctype/lead/test_lead.py @@ -28,5 +28,5 @@ class TestLead(unittest.TestCase): customer[0]["company"] = "_Test Company" customer[0]["customer_group"] = "_Test Customer Group" - frappe.bean(customer).insert() + frappe.get_doc(customer).insert() \ No newline at end of file diff --git a/erpnext/selling/doctype/opportunity/opportunity.py b/erpnext/selling/doctype/opportunity/opportunity.py index 8a103be30f..bd33f042c8 100644 --- a/erpnext/selling/doctype/opportunity/opportunity.py +++ b/erpnext/selling/doctype/opportunity/opportunity.py @@ -109,7 +109,7 @@ class Opportunity(TransactionBase): def on_submit(self): if self.lead: - frappe.bean("Lead", self.lead).get_controller().set_status(update=True) + frappe.get_doc("Lead", self.lead).set_status(update=True) def on_cancel(self): if self.has_quotation(): @@ -134,7 +134,7 @@ def make_quotation(source_name, target_doc=None): from frappe.model.mapper import get_mapped_doc def set_missing_values(source, target): - quotation = frappe.bean(target) + quotation = frappe.get_doc(target) quotation.run_method("onload_post_render") quotation.run_method("calculate_taxes_and_totals") diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py index bcccdaa411..ad6d30b843 100644 --- a/erpnext/selling/doctype/quotation/quotation.py +++ b/erpnext/selling/doctype/quotation/quotation.py @@ -55,7 +55,7 @@ class Quotation(SellingController): def update_opportunity(self): for opportunity in self.doclist.get_distinct_values("prevdoc_docname"): - frappe.bean("Opportunity", opportunity).get_controller().set_status(update=True) + frappe.get_doc("Opportunity", opportunity).set_status(update=True) def declare_order_lost(self, arg): if not self.has_sales_order(): @@ -108,7 +108,7 @@ def _make_sales_order(source_name, target_doc=None, ignore_permissions=False): target[0].customer = customer.name target[0].customer_name = customer.customer_name - si = frappe.bean(target) + si = frappe.get_doc(target) si.ignore_permissions = ignore_permissions si.run_method("onload_post_render") @@ -147,7 +147,7 @@ def _make_customer(source_name, ignore_permissions=False): if not customer_name: from erpnext.selling.doctype.lead.lead import _make_customer customer_doclist = _make_customer(lead_name, ignore_permissions=ignore_permissions) - customer = frappe.bean(customer_doclist) + customer = frappe.get_doc(customer_doclist) customer.ignore_permissions = ignore_permissions if quotation[1] == "Shopping Cart": customer.customer_group = frappe.db.get_value("Shopping Cart Settings", None, diff --git a/erpnext/selling/doctype/quotation/test_quotation.py b/erpnext/selling/doctype/quotation/test_quotation.py index b3c6d619ef..b9f4921140 100644 --- a/erpnext/selling/doctype/quotation/test_quotation.py +++ b/erpnext/selling/doctype/quotation/test_quotation.py @@ -11,7 +11,7 @@ class TestQuotation(unittest.TestCase): def test_make_sales_order(self): from erpnext.selling.doctype.quotation.quotation import make_sales_order - quotation = frappe.bean(copy=test_records[0]) + quotation = frappe.get_doc(copy=test_records[0]) quotation.insert() self.assertRaises(frappe.ValidationError, make_sales_order, quotation.name) @@ -29,7 +29,7 @@ class TestQuotation(unittest.TestCase): sales_order[0]["delivery_date"] = "2014-01-01" sales_order[0]["naming_series"] = "_T-Quotation-" sales_order[0]["transaction_date"] = "2013-05-12" - frappe.bean(sales_order).insert() + frappe.get_doc(sales_order).insert() test_records = [ diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index ff235b147f..f29b36f1f5 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -150,11 +150,11 @@ class SalesOrder(SellingController): def update_prevdoc_status(self, flag): for quotation in self.doclist.get_distinct_values("prevdoc_docname"): - bean = frappe.bean("Quotation", quotation) + bean = frappe.get_doc("Quotation", quotation) if bean.docstatus==2: frappe.throw(quotation + ": " + frappe._("Quotation is cancelled.")) - bean.get_controller().set_status(update=True) + bean.set_status(update=True) def on_submit(self): self.update_stock_ledger(update_stock = 1) @@ -253,7 +253,7 @@ class SalesOrder(SellingController): return "order" if self.docstatus==1 else None def set_missing_values(source, target): - bean = frappe.bean(target) + bean = frappe.get_doc(target) bean.run_method("onload_post_render") @frappe.whitelist() @@ -322,7 +322,7 @@ def make_delivery_note(source_name, target_doc=None): @frappe.whitelist() def make_sales_invoice(source_name, target_doc=None): def set_missing_values(source, target): - bean = frappe.bean(target) + bean = frappe.get_doc(target) bean.is_pos = 0 bean.run_method("onload_post_render") diff --git a/erpnext/selling/doctype/sales_order/test_sales_order.py b/erpnext/selling/doctype/sales_order/test_sales_order.py index 6171a2b083..62411b0543 100644 --- a/erpnext/selling/doctype/sales_order/test_sales_order.py +++ b/erpnext/selling/doctype/sales_order/test_sales_order.py @@ -12,12 +12,12 @@ class TestSalesOrder(unittest.TestCase): def test_make_material_request(self): from erpnext.selling.doctype.sales_order.sales_order import make_material_request - so = frappe.bean(copy=test_records[0]).insert() + so = frappe.get_doc(copy=test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_material_request, so.name) - sales_order = frappe.bean("Sales Order", so.name) + sales_order = frappe.get_doc("Sales Order", so.name) sales_order.submit() mr = make_material_request(so.name) @@ -27,12 +27,12 @@ class TestSalesOrder(unittest.TestCase): def test_make_delivery_note(self): from erpnext.selling.doctype.sales_order.sales_order import make_delivery_note - so = frappe.bean(copy=test_records[0]).insert() + so = frappe.get_doc(copy=test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_delivery_note, so.name) - sales_order = frappe.bean("Sales Order", so.name) + sales_order = frappe.get_doc("Sales Order", so.name) sales_order.submit() dn = make_delivery_note(so.name) @@ -42,12 +42,12 @@ class TestSalesOrder(unittest.TestCase): def test_make_sales_invoice(self): from erpnext.selling.doctype.sales_order.sales_order import make_sales_invoice - so = frappe.bean(copy=test_records[0]).insert() + so = frappe.get_doc(copy=test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_sales_invoice, so.name) - sales_order = frappe.bean("Sales Order", so.name) + sales_order = frappe.get_doc("Sales Order", so.name) sales_order.submit() si = make_sales_invoice(so.name) @@ -55,7 +55,7 @@ class TestSalesOrder(unittest.TestCase): self.assertEquals(len(si), len(sales_order.doclist)) self.assertEquals(len([d for d in si if d["doctype"]=="Sales Invoice Item"]), 1) - si = frappe.bean(si) + si = frappe.get_doc(si) si.posting_date = "2013-10-10" si.insert() si.submit() @@ -68,7 +68,7 @@ class TestSalesOrder(unittest.TestCase): if not so_doclist: so_doclist = test_records[0] - w = frappe.bean(copy=so_doclist) + w = frappe.get_doc(copy=so_doclist) w.insert() w.submit() @@ -80,7 +80,7 @@ class TestSalesOrder(unittest.TestCase): _insert_purchase_receipt(so.doclist[1].item_code) - dn = frappe.bean(frappe.copy_doc(dn_test_records[0])) + dn = frappe.get_doc(frappe.copy_doc(dn_test_records[0])) dn.doclist[1].item_code = so.doclist[1].item_code dn.doclist[1].against_sales_order = so.name dn.doclist[1].prevdoc_detail_docname = so.doclist[1].name @@ -281,16 +281,16 @@ class TestSalesOrder(unittest.TestCase): def test_warehouse_user(self): frappe.defaults.add_default("Warehouse", "_Test Warehouse 1 - _TC1", "test@example.com", "Restriction") - frappe.bean("User", "test@example.com").get_controller()\ + frappe.get_doc("User", "test@example.com").get_controller()\ .add_roles("Sales User", "Sales Manager", "Material User", "Material Manager") - frappe.bean("User", "test2@example.com").get_controller()\ + frappe.get_doc("User", "test2@example.com").get_controller()\ .add_roles("Sales User", "Sales Manager", "Material User", "Material Manager") frappe.set_user("test@example.com") from frappe.model.bean import BeanPermissionError - so = frappe.bean(copy = test_records[0]) + so = frappe.get_doc(copy = test_records[0]) so.company = "_Test Company 1" so.conversion_rate = 0.02 so.plc_conversion_rate = 0.02 diff --git a/erpnext/selling/page/sales_browser/sales_browser.py b/erpnext/selling/page/sales_browser/sales_browser.py index 42839f3e4e..fcb270e5c5 100644 --- a/erpnext/selling/page/sales_browser/sales_browser.py +++ b/erpnext/selling/page/sales_browser/sales_browser.py @@ -35,4 +35,4 @@ def add_node(): if ctype == "Sales Person": doclist[0]["employee"] = frappe.form_dict.get('employee') - frappe.bean(doclist).save() \ No newline at end of file + frappe.get_doc(doclist).save() \ No newline at end of file diff --git a/erpnext/setup/doctype/company/company.py b/erpnext/setup/doctype/company/company.py index 2aa324571a..1880ffd3cd 100644 --- a/erpnext/setup/doctype/company/company.py +++ b/erpnext/setup/doctype/company/company.py @@ -61,7 +61,7 @@ class Company(Document): stock_group = frappe.db.get_value("Account", {"account_type": "Stock", "group_or_ledger": "Group"}) if stock_group: - frappe.bean({ + frappe.get_doc({ "doctype":"Warehouse", "warehouse_name": whname, "company": self.name, @@ -73,7 +73,7 @@ class Company(Document): not frappe.db.sql("select name from tabCompany where name!=%s", self.name): import os with open(os.path.join(os.path.dirname(__file__), "sample_home_page.html"), "r") as webfile: - webpage = frappe.bean({ + webpage = frappe.get_doc({ "doctype": "Web Page", "title": self.name + " Home", "published": 1, @@ -82,7 +82,7 @@ class Company(Document): }).insert() # update in home page in settings - website_settings = frappe.bean("Website Settings", "Website Settings") + website_settings = frappe.get_doc("Website Settings", "Website Settings") website_settings.home_page = webpage.name website_settings.brand_html = self.name website_settings.copyright = self.name @@ -97,7 +97,7 @@ class Company(Document): "url": "blog" }) website_settings.save() - style_settings = frappe.bean("Style Settings", "Style Settings") + style_settings = frappe.get_doc("Style Settings", "Style Settings") style_settings.top_bar_background = "F2F2F2" style_settings.font_size = "15px" style_settings.save() @@ -111,11 +111,11 @@ class Company(Document): frappe.db.set(self, "payables_group", "Accounts Payable - " + self.abbr) def import_chart_of_account(self): - chart = frappe.bean("Chart of Accounts", self.chart_of_accounts) + chart = frappe.get_doc("Chart of Accounts", self.chart_of_accounts) chart.make_controller().create_accounts(self.name) def add_acc(self,lst): - account = frappe.bean({ + account = frappe.get_doc({ "doctype": "Account", "freeze_account": "No", "master_type": "", @@ -163,7 +163,7 @@ class Company(Document): ] for cc in cc_list: cc.update({"doctype": "Cost Center"}) - cc_bean = frappe.bean(cc) + cc_bean = frappe.get_doc(cc) cc_bean.ignore_permissions = True if cc.get("cost_center_name") == self.name: diff --git a/erpnext/setup/doctype/company/test_company.py b/erpnext/setup/doctype/company/test_company.py index 932c45af2a..691bc72f9d 100644 --- a/erpnext/setup/doctype/company/test_company.py +++ b/erpnext/setup/doctype/company/test_company.py @@ -13,7 +13,7 @@ class TestCompany(unittest.TestCase): print "Country: ", country print "Chart Name: ", chart_name - company_bean = frappe.bean({ + company_bean = frappe.get_doc({ "doctype": "Company", "company_name": "_Test Company 2", "abbr": "_TC2", diff --git a/erpnext/setup/doctype/global_defaults/global_defaults.py b/erpnext/setup/doctype/global_defaults/global_defaults.py index 26b44979f9..a9896dcd16 100644 --- a/erpnext/setup/doctype/global_defaults/global_defaults.py +++ b/erpnext/setup/doctype/global_defaults/global_defaults.py @@ -60,7 +60,7 @@ class GlobalDefaults(Document): raise_exception=1) def update_control_panel(self): - cp_bean = frappe.bean("Control Panel") + cp_bean = frappe.get_doc("Control Panel") if self.country: cp_bean.country = self.country if self.time_zone: diff --git a/erpnext/setup/doctype/item_group/test_item_group.py b/erpnext/setup/doctype/item_group/test_item_group.py index 27160952ee..4bdace8ef5 100644 --- a/erpnext/setup/doctype/item_group/test_item_group.py +++ b/erpnext/setup/doctype/item_group/test_item_group.py @@ -127,7 +127,7 @@ class TestItem(unittest.TestCase): return get_no_of_children([item_group], 0) def test_recursion(self): - group_b = frappe.bean("Item Group", "_Test Item Group B") + group_b = frappe.get_doc("Item Group", "_Test Item Group B") group_b.parent_item_group = "_Test Item Group B - 3" self.assertRaises(NestedSetRecursionError, group_b.save) @@ -140,7 +140,7 @@ class TestItem(unittest.TestCase): self.test_basic_tree() def move_it_back(self): - group_b = frappe.bean("Item Group", "_Test Item Group B") + group_b = frappe.get_doc("Item Group", "_Test Item Group B") group_b.parent_item_group = "All Item Groups" group_b.save() self.test_basic_tree() @@ -150,7 +150,7 @@ class TestItem(unittest.TestCase): old_lft, old_rgt = frappe.db.get_value("Item Group", "_Test Item Group C", ["lft", "rgt"]) # put B under C - group_b = frappe.bean("Item Group", "_Test Item Group B") + group_b = frappe.get_doc("Item Group", "_Test Item Group B") lft, rgt = group_b.lft, group_b.rgt group_b.parent_item_group = "_Test Item Group C" @@ -169,7 +169,7 @@ class TestItem(unittest.TestCase): self.move_it_back() def test_move_group_into_root(self): - group_b = frappe.bean("Item Group", "_Test Item Group B") + group_b = frappe.get_doc("Item Group", "_Test Item Group B") group_b.parent_item_group = "" self.assertRaises(NestedSetMultipleRootsError, group_b.save) @@ -186,7 +186,7 @@ class TestItem(unittest.TestCase): # before move old_lft, old_rgt = frappe.db.get_value("Item Group", "_Test Item Group C", ["lft", "rgt"]) - group_b_3 = frappe.bean("Item Group", "_Test Item Group B - 3") + group_b_3 = frappe.get_doc("Item Group", "_Test Item Group B - 3") lft, rgt = group_b_3.lft, group_b_3.rgt # child of right sibling is moved into it @@ -203,7 +203,7 @@ class TestItem(unittest.TestCase): self.assertEquals(new_rgt - old_rgt, rgt - lft + 1) # move it back - group_b_3 = frappe.bean("Item Group", "_Test Item Group B - 3") + group_b_3 = frappe.get_doc("Item Group", "_Test Item Group B - 3") group_b_3.parent_item_group = "_Test Item Group B" group_b_3.save() self.test_basic_tree() @@ -228,7 +228,7 @@ class TestItem(unittest.TestCase): self.assertEquals(new_rgt, item_group.rgt - 2) # insert it back - frappe.bean(copy=test_records[6]).insert() + frappe.get_doc(copy=test_records[6]).insert() self.test_basic_tree() @@ -243,14 +243,14 @@ class TestItem(unittest.TestCase): self.test_basic_tree(records=records_to_test) # insert Group B back - frappe.bean(copy=test_records[3]).insert() + frappe.get_doc(copy=test_records[3]).insert() self.test_basic_tree() # move its children back for name in frappe.db.sql_list("""select name from `tabItem Group` where parent_item_group='_Test Item Group C'"""): - bean = frappe.bean("Item Group", name) + bean = frappe.get_doc("Item Group", name) bean.parent_item_group = "_Test Item Group B" bean.save() @@ -263,7 +263,7 @@ class TestItem(unittest.TestCase): self.test_basic_tree(records=records_to_test) # insert Group B - 2back - frappe.bean(copy=test_records[5]).insert() + frappe.get_doc(copy=test_records[5]).insert() self.test_basic_tree() def test_merge_leaf_into_group(self): diff --git a/erpnext/setup/install.py b/erpnext/setup/install.py index 9fe243d966..c7955d90e2 100644 --- a/erpnext/setup/install.py +++ b/erpnext/setup/install.py @@ -24,7 +24,7 @@ def import_country_and_currency(): for name in data: country = frappe._dict(data[name]) if not frappe.db.exists("Country", name): - frappe.doc({ + frappe.get_doc({ "doctype": "Country", "country_name": name, "code": country.code, @@ -33,7 +33,7 @@ def import_country_and_currency(): }).insert() if country.currency and not frappe.db.exists("Currency", country.currency): - frappe.doc({ + frappe.get_doc({ "doctype": "Currency", "currency_name": country.currency, "fraction": country.currency_fraction, @@ -111,7 +111,7 @@ def import_defaults(): from frappe.modules import scrub for r in records: - bean = frappe.bean(r) + bean = frappe.get_doc(r) # ignore mandatory for root parent_link_field = ("parent_" + scrub(bean.doctype)) @@ -122,7 +122,7 @@ def import_defaults(): def feature_setup(): """save global defaults and features setup""" - bean = frappe.bean("Features Setup", "Features Setup") + bean = frappe.get_doc("Features Setup", "Features Setup") bean.ignore_permissions = True # store value as 1 for all these fields @@ -142,7 +142,7 @@ def set_single_defaults(): where parent=%s""", dt, as_dict=True) if default_values: try: - b = frappe.bean(dt, dt) + b = frappe.get_doc(dt, dt) for fieldname, value in default_values: b.set(fieldname, value) b.save() diff --git a/erpnext/setup/page/setup_wizard/setup_wizard.py b/erpnext/setup/page/setup_wizard/setup_wizard.py index 917cfd14b1..d635e08e28 100644 --- a/erpnext/setup/page/setup_wizard/setup_wizard.py +++ b/erpnext/setup/page/setup_wizard/setup_wizard.py @@ -45,7 +45,7 @@ def update_user_name(args): if args.get("email"): args['name'] = args.get("email") frappe.flags.mute_emails = True - frappe.bean({ + frappe.get_doc({ "doctype":"User", "email": args.get("email"), "first_name": args.get("first_name"), @@ -73,7 +73,7 @@ def update_user_name(args): def create_fiscal_year_and_company(args): curr_fiscal_year = get_fy_details(args.get('fy_start_date'), args.get('fy_end_date')) - frappe.bean([{ + frappe.get_doc([{ "doctype":"Fiscal Year", 'year': curr_fiscal_year, 'year_start_date': args.get('fy_start_date'), @@ -82,7 +82,7 @@ def create_fiscal_year_and_company(args): print args # Company - frappe.bean([{ + frappe.get_doc([{ "doctype":"Company", 'domain': args.get("industry"), 'company_name':args.get('company_name'), @@ -96,7 +96,7 @@ def create_fiscal_year_and_company(args): def create_price_lists(args): for pl_type in ["Selling", "Buying"]: - frappe.bean([ + frappe.get_doc([ { "doctype": "Price List", "price_list_name": "Standard " + pl_type, @@ -116,7 +116,7 @@ def set_defaults(args): # enable default currency frappe.db.set_value("Currency", args.get("currency"), "enabled", 1) - global_defaults = frappe.bean("Global Defaults", "Global Defaults") + global_defaults = frappe.get_doc("Global Defaults", "Global Defaults") global_defaults.update({ 'current_fiscal_year': args.curr_fiscal_year, 'default_currency': args.get('currency'), @@ -128,46 +128,46 @@ def set_defaults(args): }) global_defaults.save() - accounts_settings = frappe.bean("Accounts Settings") + accounts_settings = frappe.get_doc("Accounts Settings") accounts_settings.auto_accounting_for_stock = 1 accounts_settings.save() - stock_settings = frappe.bean("Stock Settings") + stock_settings = frappe.get_doc("Stock Settings") stock_settings.item_naming_by = "Item Code" stock_settings.valuation_method = "FIFO" stock_settings.stock_uom = "Nos" stock_settings.auto_indent = 1 stock_settings.save() - selling_settings = frappe.bean("Selling Settings") + selling_settings = frappe.get_doc("Selling Settings") selling_settings.cust_master_name = "Customer Name" selling_settings.so_required = "No" selling_settings.dn_required = "No" selling_settings.save() - buying_settings = frappe.bean("Buying Settings") + buying_settings = frappe.get_doc("Buying Settings") buying_settings.supp_master_name = "Supplier Name" buying_settings.po_required = "No" buying_settings.pr_required = "No" buying_settings.maintain_same_rate = 1 buying_settings.save() - notification_control = frappe.bean("Notification Control") + notification_control = frappe.get_doc("Notification Control") notification_control.quotation = 1 notification_control.sales_invoice = 1 notification_control.purchase_order = 1 notification_control.save() - hr_settings = frappe.bean("HR Settings") + hr_settings = frappe.get_doc("HR Settings") hr_settings.emp_created_by = "Naming Series" hr_settings.save() - email_settings = frappe.bean("Outgoing Email Settings") + email_settings = frappe.get_doc("Outgoing Email Settings") email_settings.send_print_in_body_and_attachment = 1 email_settings.save() # control panel - cp = frappe.doc("Control Panel", "Control Panel") + cp = frappe.get_doc("Control Panel", "Control Panel") cp.company_name = args["company_name"] cp.save() @@ -186,7 +186,7 @@ def create_email_digest(): companies = frappe.db.sql_list("select name FROM `tabCompany`") for company in companies: if not frappe.db.exists("Email Digest", "Default Weekly Digest - " + company): - edigest = frappe.bean({ + edigest = frappe.get_doc({ "doctype": "Email Digest", "name": "Default Weekly Digest - " + company, "company": company, @@ -224,7 +224,7 @@ def get_fy_details(fy_start_date, fy_end_date): def create_taxes(args): for i in xrange(1,6): if args.get("tax_" + str(i)): - frappe.bean({ + frappe.get_doc({ "doctype":"Account", "company": args.get("company_name"), "parent_account": "Duties and Taxes - " + args.get("company_abbr"), @@ -240,7 +240,7 @@ def create_items(args): item = args.get("item_" + str(i)) if item: item_group = args.get("item_group_" + str(i)) - frappe.bean({ + frappe.get_doc({ "doctype":"Item", "item_code": item, "item_name": item, @@ -261,7 +261,7 @@ def create_items(args): item = args.get("item_buy_" + str(i)) if item: item_group = args.get("item_buy_group_" + str(i)) - frappe.bean({ + frappe.get_doc({ "doctype":"Item", "item_code": item, "item_name": item, @@ -283,7 +283,7 @@ def create_customers(args): for i in xrange(1,6): customer = args.get("customer_" + str(i)) if customer: - frappe.bean({ + frappe.get_doc({ "doctype":"Customer", "customer_name": customer, "customer_type": "Company", @@ -294,7 +294,7 @@ def create_customers(args): if args.get("customer_contact_" + str(i)): contact = args.get("customer_contact_" + str(i)).split(" ") - frappe.bean({ + frappe.get_doc({ "doctype":"Contact", "customer": customer, "first_name":contact[0], @@ -305,7 +305,7 @@ def create_suppliers(args): for i in xrange(1,6): supplier = args.get("supplier_" + str(i)) if supplier: - frappe.bean({ + frappe.get_doc({ "doctype":"Supplier", "supplier_name": supplier, "supplier_type": "Local", @@ -314,7 +314,7 @@ def create_suppliers(args): if args.get("supplier_contact_" + str(i)): contact = args.get("supplier_contact_" + str(i)).split(" ") - frappe.bean({ + frappe.get_doc({ "doctype":"Contact", "supplier": supplier, "first_name":contact[0], @@ -324,7 +324,7 @@ def create_suppliers(args): def create_letter_head(args): if args.get("attach_letterhead"): - lh = frappe.bean({ + lh = frappe.get_doc({ "doctype":"Letter Head", "letter_head_name": "Standard", "is_default": 1 @@ -349,7 +349,7 @@ def create_territories(): root_territory = get_root_of("Territory") for name in (country, "Rest Of The World"): if name and not frappe.db.exists("Territory", name): - frappe.bean({ + frappe.get_doc({ "doctype": "Territory", "territory_name": name.replace("'", ""), "parent_territory": root_territory, diff --git a/erpnext/startup/boot.py b/erpnext/startup/boot.py index fdc20fabdf..0311cdcd63 100644 --- a/erpnext/startup/boot.py +++ b/erpnext/startup/boot.py @@ -19,7 +19,7 @@ def boot_session(bootinfo): load_country_and_currency(bootinfo) import frappe.model.doctype - bootinfo['notification_settings'] = frappe.doc("Notification Control", + bootinfo['notification_settings'] = frappe.get_doc("Notification Control", "Notification Control").get_values() # if no company, show a dialog box to create a new company @@ -35,7 +35,7 @@ def boot_session(bootinfo): def load_country_and_currency(bootinfo): if bootinfo.control_panel.country and \ frappe.db.exists("Country", bootinfo.control_panel.country): - bootinfo["docs"] += [frappe.doc("Country", bootinfo.control_panel.country)] + bootinfo["docs"] += [frappe.get_doc("Country", bootinfo.control_panel.country)] bootinfo["docs"] += frappe.db.sql("""select * from tabCurrency where ifnull(enabled,0)=1""", as_dict=1, update={"doctype":":Currency"}) diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index d48024f081..ce6986c0d7 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -289,7 +289,7 @@ def make_sales_invoice(source_name, target_doc=None): invoiced_qty_map = get_invoiced_qty_map(source_name) def update_accounts(source, target): - si = frappe.bean(target) + si = frappe.get_doc(target) si.is_pos = 0 si.run_method("onload_post_render") diff --git a/erpnext/stock/doctype/delivery_note/test_delivery_note.py b/erpnext/stock/doctype/delivery_note/test_delivery_note.py index 4c6af1b1f1..1c2bececdd 100644 --- a/erpnext/stock/doctype/delivery_note/test_delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/test_delivery_note.py @@ -13,7 +13,7 @@ def _insert_purchase_receipt(item_code=None): if not item_code: item_code = pr_test_records[0][1]["item_code"] - pr = frappe.bean(copy=pr_test_records[0]) + pr = frappe.get_doc(copy=pr_test_records[0]) pr.doclist[1].item_code = item_code pr.insert() pr.submit() @@ -25,12 +25,12 @@ class TestDeliveryNote(unittest.TestCase): from erpnext.stock.doctype.delivery_note.delivery_note import make_sales_invoice _insert_purchase_receipt() - dn = frappe.bean(copy=test_records[0]).insert() + dn = frappe.get_doc(copy=test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_sales_invoice, dn.name) - dn = frappe.bean("Delivery Note", dn.name) + dn = frappe.get_doc("Delivery Note", dn.name) dn.submit() si = make_sales_invoice(dn.name) @@ -38,7 +38,7 @@ class TestDeliveryNote(unittest.TestCase): # modify amount si[1]["rate"] = 200 - self.assertRaises(frappe.ValidationError, frappe.bean(si).insert) + self.assertRaises(frappe.ValidationError, frappe.get_doc(si).insert) def test_delivery_note_no_gl_entry(self): @@ -48,7 +48,7 @@ class TestDeliveryNote(unittest.TestCase): _insert_purchase_receipt() - dn = frappe.bean(copy=test_records[0]) + dn = frappe.get_doc(copy=test_records[0]) dn.insert() dn.submit() @@ -68,7 +68,7 @@ class TestDeliveryNote(unittest.TestCase): _insert_purchase_receipt() - dn = frappe.bean(copy=test_records[0]) + dn = frappe.get_doc(copy=test_records[0]) dn.doclist[1].expense_account = "Cost of Goods Sold - _TC" dn.doclist[1].cost_center = "Main - _TC" @@ -95,7 +95,7 @@ class TestDeliveryNote(unittest.TestCase): self.assertEquals(bal, prev_bal - 375.0) # back dated purchase receipt - pr = frappe.bean(copy=pr_test_records[0]) + pr = frappe.get_doc(copy=pr_test_records[0]) pr.posting_date = "2013-01-01" pr.doclist[1].rate = 100 pr.doclist[1].base_amount = 100 @@ -123,7 +123,7 @@ class TestDeliveryNote(unittest.TestCase): _insert_purchase_receipt() _insert_purchase_receipt("_Test Item Home Desktop 100") - dn = frappe.bean(copy=test_records[0]) + dn = frappe.get_doc(copy=test_records[0]) dn.doclist[1].item_code = "_Test Sales BOM Item" dn.doclist[1].qty = 1 @@ -162,7 +162,7 @@ class TestDeliveryNote(unittest.TestCase): se = make_serialized_item() serial_nos = get_serial_nos(se.doclist[1].serial_no) - dn = frappe.bean(copy=test_records[0]) + dn = frappe.get_doc(copy=test_records[0]) dn.doclist[1].item_code = "_Test Serialized Item With Series" dn.doclist[1].qty = 1 dn.doclist[1].serial_no = serial_nos[0] @@ -195,11 +195,11 @@ class TestDeliveryNote(unittest.TestCase): se = make_serialized_item() serial_nos = get_serial_nos(se.doclist[1].serial_no) - sr = frappe.bean("Serial No", serial_nos[0]) + sr = frappe.get_doc("Serial No", serial_nos[0]) sr.status = "Not Available" sr.save() - dn = frappe.bean(copy=test_records[0]) + dn = frappe.get_doc(copy=test_records[0]) dn.doclist[1].item_code = "_Test Serialized Item With Series" dn.doclist[1].qty = 1 dn.doclist[1].serial_no = serial_nos[0] diff --git a/erpnext/stock/doctype/item/test_item.py b/erpnext/stock/doctype/item/test_item.py index 8d99b2f952..0ad6be2268 100644 --- a/erpnext/stock/doctype/item/test_item.py +++ b/erpnext/stock/doctype/item/test_item.py @@ -13,7 +13,7 @@ test_dependencies = ["Warehouse"] class TestItem(unittest.TestCase): def test_default_warehouse(self): from erpnext.stock.doctype.item.item import WarehouseNotSet - item = frappe.bean(copy=test_records[0]) + item = frappe.get_doc(copy=test_records[0]) item.is_stock_item = "Yes" item.default_warehouse = None self.assertRaises(WarehouseNotSet, item.insert) diff --git a/erpnext/stock/doctype/item_price/test_item_price.py b/erpnext/stock/doctype/item_price/test_item_price.py index 4585e38b03..310c7d9b46 100644 --- a/erpnext/stock/doctype/item_price/test_item_price.py +++ b/erpnext/stock/doctype/item_price/test_item_price.py @@ -8,7 +8,7 @@ import frappe class TestItem(unittest.TestCase): def test_duplicate_item(self): from erpnext.stock.doctype.item_price.item_price import ItemPriceDuplicateItem - bean = frappe.bean(copy=test_records[0]) + bean = frappe.get_doc(copy=test_records[0]) self.assertRaises(ItemPriceDuplicateItem, bean.insert) test_records = [ diff --git a/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.py b/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.py index 2a80a4d571..3850cec385 100644 --- a/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.py +++ b/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.py @@ -34,7 +34,7 @@ class LandedCostWizard(Document): total_amt = self.get_total_pr_amt(purchase_receipts) for pr in purchase_receipts: - pr_bean = frappe.bean('Purchase Receipt', pr) + pr_bean = frappe.get_doc('Purchase Receipt', pr) pr_items = pr_bean.get("purchase_tax_details") for lc in self.get("landed_cost_details"): @@ -76,7 +76,7 @@ class LandedCostWizard(Document): def cancel_pr(self, purchase_receipts): for pr in purchase_receipts: - pr_bean = frappe.bean("Purchase Receipt", pr) + pr_bean = frappe.get_doc("Purchase Receipt", pr) pr_bean.run_method("update_ordered_qty") @@ -87,7 +87,7 @@ class LandedCostWizard(Document): def submit_pr(self, purchase_receipts): for pr in purchase_receipts: - pr_bean = frappe.bean("Purchase Receipt", pr) + pr_bean = frappe.get_doc("Purchase Receipt", pr) pr_bean.run_method("update_ordered_qty") pr_bean.run_method("update_stock") pr_bean.run_method("make_gl_entries") \ No newline at end of file diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py index 30ebb1b206..c8f38ed5d2 100644 --- a/erpnext/stock/doctype/material_request/material_request.py +++ b/erpnext/stock/doctype/material_request/material_request.py @@ -218,7 +218,7 @@ def _update_requested_qty(bean, mr_obj, mr_items): }) def set_missing_values(source, target_doc): - po = frappe.bean(target_doc) + po = frappe.get_doc(target_doc) po.run_method("set_missing_values") def update_item(obj, target, source_parent): @@ -343,7 +343,7 @@ def make_stock_entry(source_name, target_doc=None): def set_missing_values(source, target): target[0].purpose = "Material Transfer" - se = frappe.bean(target) + se = frappe.get_doc(target) se.run_method("get_stock_and_rate") doclist = get_mapped_doc("Material Request", source_name, { diff --git a/erpnext/stock/doctype/material_request/test_material_request.py b/erpnext/stock/doctype/material_request/test_material_request.py index f70f14c733..66c4dd2c0a 100644 --- a/erpnext/stock/doctype/material_request/test_material_request.py +++ b/erpnext/stock/doctype/material_request/test_material_request.py @@ -15,12 +15,12 @@ class TestMaterialRequest(unittest.TestCase): def test_make_purchase_order(self): from erpnext.stock.doctype.material_request.material_request import make_purchase_order - mr = frappe.bean(copy=test_records[0]).insert() + mr = frappe.get_doc(copy=test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_purchase_order, mr.name) - mr = frappe.bean("Material Request", mr.name) + mr = frappe.get_doc("Material Request", mr.name) mr.submit() po = make_purchase_order(mr.name) @@ -30,12 +30,12 @@ class TestMaterialRequest(unittest.TestCase): def test_make_supplier_quotation(self): from erpnext.stock.doctype.material_request.material_request import make_supplier_quotation - mr = frappe.bean(copy=test_records[0]).insert() + mr = frappe.get_doc(copy=test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_supplier_quotation, mr.name) - mr = frappe.bean("Material Request", mr.name) + mr = frappe.get_doc("Material Request", mr.name) mr.submit() sq = make_supplier_quotation(mr.name) @@ -46,12 +46,12 @@ class TestMaterialRequest(unittest.TestCase): def test_make_stock_entry(self): from erpnext.stock.doctype.material_request.material_request import make_stock_entry - mr = frappe.bean(copy=test_records[0]).insert() + mr = frappe.get_doc(copy=test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_stock_entry, mr.name) - mr = frappe.bean("Material Request", mr.name) + mr = frappe.get_doc("Material Request", mr.name) mr.material_request_type = "Transfer" mr.submit() se = make_stock_entry(mr.name) @@ -71,7 +71,7 @@ class TestMaterialRequest(unittest.TestCase): "warehouse": "_Test Warehouse - _TC"}, "indented_qty")), qty2) def _insert_stock_entry(self, qty1, qty2): - se = frappe.bean([ + se = frappe.get_doc([ { "company": "_Test Company", "doctype": "Stock Entry", @@ -112,7 +112,7 @@ class TestMaterialRequest(unittest.TestCase): frappe.db.sql("""delete from `tabBin`""") # submit material request of type Purchase - mr = frappe.bean(copy=test_records[0]) + mr = frappe.get_doc(copy=test_records[0]) mr.insert() mr.submit() @@ -133,14 +133,14 @@ class TestMaterialRequest(unittest.TestCase): # check for stopped status of Material Request - po = frappe.bean(copy=po_doclist) + po = frappe.get_doc(copy=po_doclist) po.insert() mr.obj.update_status('Stopped') self.assertRaises(frappe.ValidationError, po.submit) self.assertRaises(frappe.ValidationError, po.cancel) mr.obj.update_status('Submitted') - po = frappe.bean(copy=po_doclist) + po = frappe.get_doc(copy=po_doclist) po.insert() po.submit() @@ -160,7 +160,7 @@ class TestMaterialRequest(unittest.TestCase): frappe.db.sql("""delete from `tabStock Ledger Entry`""") # submit material request of type Purchase - mr = frappe.bean(copy=test_records[0]) + mr = frappe.get_doc(copy=test_records[0]) mr.material_request_type = "Transfer" mr.insert() mr.submit() @@ -196,14 +196,14 @@ class TestMaterialRequest(unittest.TestCase): self._insert_stock_entry(27.0, 1.5) # check for stopped status of Material Request - se = frappe.bean(copy=se_doclist) + se = frappe.get_doc(copy=se_doclist) se.insert() mr.obj.update_status('Stopped') self.assertRaises(frappe.ValidationError, se.submit) self.assertRaises(frappe.ValidationError, se.cancel) mr.obj.update_status('Submitted') - se = frappe.bean(copy=se_doclist) + se = frappe.get_doc(copy=se_doclist) se.insert() se.submit() @@ -223,7 +223,7 @@ class TestMaterialRequest(unittest.TestCase): frappe.db.sql("""delete from `tabStock Ledger Entry`""") # submit material request of type Purchase - mr = frappe.bean(copy=test_records[0]) + mr = frappe.get_doc(copy=test_records[0]) mr.material_request_type = "Transfer" mr.insert() mr.submit() @@ -259,14 +259,14 @@ class TestMaterialRequest(unittest.TestCase): self._insert_stock_entry(60.0, 3.0) # check for stopped status of Material Request - se = frappe.bean(copy=se_doclist) + se = frappe.get_doc(copy=se_doclist) se.insert() mr.obj.update_status('Stopped') self.assertRaises(frappe.ValidationError, se.submit) self.assertRaises(frappe.ValidationError, se.cancel) mr.obj.update_status('Submitted') - se = frappe.bean(copy=se_doclist) + se = frappe.get_doc(copy=se_doclist) se.insert() se.submit() @@ -283,7 +283,7 @@ class TestMaterialRequest(unittest.TestCase): def test_incorrect_mapping_of_stock_entry(self): # submit material request of type Purchase - mr = frappe.bean(copy=test_records[0]) + mr = frappe.get_doc(copy=test_records[0]) mr.material_request_type = "Transfer" mr.insert() mr.submit() @@ -312,12 +312,12 @@ class TestMaterialRequest(unittest.TestCase): }) # check for stopped status of Material Request - se = frappe.bean(copy=se_doclist) + se = frappe.get_doc(copy=se_doclist) self.assertRaises(frappe.MappingMismatchError, se.insert) def test_warehouse_company_validation(self): from erpnext.stock.utils import InvalidWarehouseCompany - mr = frappe.bean(copy=test_records[0]) + mr = frappe.get_doc(copy=test_records[0]) mr.company = "_Test Company 1" self.assertRaises(InvalidWarehouseCompany, mr.insert) diff --git a/erpnext/stock/doctype/price_list/price_list.py b/erpnext/stock/doctype/price_list/price_list.py index bfb3ea7298..7f5d7e7506 100644 --- a/erpnext/stock/doctype/price_list/price_list.py +++ b/erpnext/stock/doctype/price_list/price_list.py @@ -44,7 +44,7 @@ class PriceList(DocListController): def on_trash(self): def _update_default_price_list(module): - b = frappe.bean(module + " Settings") + b = frappe.get_doc(module + " Settings") price_list_fieldname = module.lower() + "_price_list" if self.name == b.fields[price_list_fieldname]: diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py index 74c8cffd43..f970d94f1f 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py @@ -299,7 +299,7 @@ def make_purchase_invoice(source_name, target_doc=None): from frappe.model.mapper import get_mapped_doc def set_missing_values(source, target): - bean = frappe.bean(target) + bean = frappe.get_doc(target) bean.run_method("set_missing_values") doclist = get_mapped_doc("Purchase Receipt", source_name, { diff --git a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py index 58b8d7dc14..0b22425951 100644 --- a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py @@ -14,12 +14,12 @@ class TestPurchaseReceipt(unittest.TestCase): set_perpetual_inventory(0) from erpnext.stock.doctype.purchase_receipt.purchase_receipt import make_purchase_invoice - pr = frappe.bean(copy=test_records[0]).insert() + pr = frappe.get_doc(copy=test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_purchase_invoice, pr.name) - pr = frappe.bean("Purchase Receipt", pr.name) + pr = frappe.get_doc("Purchase Receipt", pr.name) pr.submit() pi = make_purchase_invoice(pr.name) @@ -28,12 +28,12 @@ class TestPurchaseReceipt(unittest.TestCase): # modify rate pi[1]["rate"] = 200 - self.assertRaises(frappe.ValidationError, frappe.bean(pi).submit) + self.assertRaises(frappe.ValidationError, frappe.get_doc(pi).submit) def test_purchase_receipt_no_gl_entry(self): self._clear_stock_account_balance() set_perpetual_inventory(0) - pr = frappe.bean(copy=test_records[0]) + pr = frappe.get_doc(copy=test_records[0]) pr.insert() pr.submit() @@ -56,7 +56,7 @@ class TestPurchaseReceipt(unittest.TestCase): set_perpetual_inventory() self.assertEqual(cint(frappe.defaults.get_global_default("auto_accounting_for_stock")), 1) - pr = frappe.bean(copy=test_records[0]) + pr = frappe.get_doc(copy=test_records[0]) pr.insert() pr.submit() @@ -90,7 +90,7 @@ class TestPurchaseReceipt(unittest.TestCase): frappe.db.sql("""delete from `tabGL Entry`""") def test_subcontracting(self): - pr = frappe.bean(copy=test_records[1]) + pr = frappe.get_doc(copy=test_records[1]) pr.run_method("calculate_taxes_and_totals") pr.insert() @@ -98,7 +98,7 @@ class TestPurchaseReceipt(unittest.TestCase): self.assertEquals(len(pr.get("pr_raw_material_details")), 2) def test_serial_no_supplier(self): - pr = frappe.bean(copy=test_records[0]) + pr = frappe.get_doc(copy=test_records[0]) pr.doclist[1].item_code = "_Test Serialized Item With Series" pr.doclist[1].qty = 1 pr.doclist[1].received_qty = 1 @@ -123,7 +123,7 @@ def get_gl_entries(voucher_type, voucher_no): order by account desc""", (voucher_type, voucher_no), as_dict=1) def set_perpetual_inventory(enable=1): - accounts_settings = frappe.bean("Accounts Settings") + accounts_settings = frappe.get_doc("Accounts Settings") accounts_settings.auto_accounting_for_stock = enable accounts_settings.save() diff --git a/erpnext/stock/doctype/serial_no/serial_no.py b/erpnext/stock/doctype/serial_no/serial_no.py index 333f3f7685..7f4c4380b5 100644 --- a/erpnext/stock/doctype/serial_no/serial_no.py +++ b/erpnext/stock/doctype/serial_no/serial_no.py @@ -66,7 +66,7 @@ class SerialNo(StockController): """ Validate whether serial no is required for this item """ - item = frappe.doc("Item", self.item_code) + item = frappe.get_doc("Item", self.item_code) if item.has_serial_no!="Yes": frappe.throw(_("Item must have 'Has Serial No' as 'Yes'") + ": " + self.item_code) @@ -223,7 +223,7 @@ def validate_serial_no(sle, item_det): for serial_no in serial_nos: if frappe.db.exists("Serial No", serial_no): - sr = frappe.bean("Serial No", serial_no) + sr = frappe.get_doc("Serial No", serial_no) if sr.item_code!=sle.item_code: frappe.throw(_("Serial No does not belong to Item") + @@ -263,7 +263,7 @@ def update_serial_nos(sle, item_det): serial_nos = get_serial_nos(sle.serial_no) for serial_no in serial_nos: if frappe.db.exists("Serial No", serial_no): - sr = frappe.bean("Serial No", serial_no) + sr = frappe.get_doc("Serial No", serial_no) sr.make_controller().via_stock_ledger = True sr.warehouse = sle.warehouse if sle.actual_qty > 0 else None sr.save() diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index eeb8d82bd6..92f7746bee 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -337,7 +337,7 @@ class StockEntry(StockController): self.production_order) if self.production_order: - pro_bean = frappe.bean("Production Order", self.production_order) + pro_bean = frappe.get_doc("Production Order", self.production_order) _validate_production_order(pro_bean) self.update_produced_qty(pro_bean) if self.purpose == "Manufacture/Repack": @@ -749,7 +749,7 @@ return_map = { @frappe.whitelist() def make_return_jv(stock_entry): - se = frappe.bean("Stock Entry", stock_entry) + se = frappe.get_doc("Stock Entry", stock_entry) if not se.purpose in ["Sales Return", "Purchase Return"]: return @@ -840,7 +840,7 @@ def make_return_jv_from_delivery_note(se, ref): for se_item in se.get("mtn_details"): for sales_invoice in invoices_against_delivery: - si = frappe.bean("Sales Invoice", sales_invoice) + si = frappe.get_doc("Sales Invoice", sales_invoice) if se_item.item_code in packing_item_parent_map: ref_item = si.doclist.get({"item_code": packing_item_parent_map[se_item.item_code]}) @@ -897,7 +897,7 @@ def make_return_jv_from_purchase_receipt(se, ref): for se_item in se.get("mtn_details"): for purchase_invoice in invoice_against_receipt: - pi = frappe.bean("Purchase Invoice", purchase_invoice) + pi = frappe.get_doc("Purchase Invoice", purchase_invoice) ref_item = pi.doclist.get({"item_code": se_item.item_code}) if not ref_item: diff --git a/erpnext/stock/doctype/stock_entry/test_stock_entry.py b/erpnext/stock/doctype/stock_entry/test_stock_entry.py index bcdc0feaed..db816fd320 100644 --- a/erpnext/stock/doctype/stock_entry/test_stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/test_stock_entry.py @@ -22,11 +22,11 @@ class TestStockEntry(unittest.TestCase): frappe.db.set_value("Stock Settings", None, "auto_indent", True) - st1 = frappe.bean(copy=test_records[0]) + st1 = frappe.get_doc(copy=test_records[0]) st1.insert() st1.submit() - st2 = frappe.bean(copy=test_records[1]) + st2 = frappe.get_doc(copy=test_records[1]) st2.insert() st2.submit() @@ -45,7 +45,7 @@ class TestStockEntry(unittest.TestCase): self._clear_stock_account_balance() set_perpetual_inventory() - mr = frappe.bean(copy=test_records[0]) + mr = frappe.get_doc(copy=test_records[0]) mr.insert() mr.submit() @@ -77,7 +77,7 @@ class TestStockEntry(unittest.TestCase): self._insert_material_receipt() - mi = frappe.bean(copy=test_records[1]) + mi = frappe.get_doc(copy=test_records[1]) mi.insert() mi.submit() @@ -113,7 +113,7 @@ class TestStockEntry(unittest.TestCase): self._insert_material_receipt() - mtn = frappe.bean(copy=test_records[2]) + mtn = frappe.get_doc(copy=test_records[2]) mtn.insert() mtn.submit() @@ -149,7 +149,7 @@ class TestStockEntry(unittest.TestCase): self._insert_material_receipt() - repack = frappe.bean(copy=test_records[3]) + repack = frappe.get_doc(copy=test_records[3]) repack.insert() repack.submit() @@ -170,7 +170,7 @@ class TestStockEntry(unittest.TestCase): self._insert_material_receipt() - repack = frappe.bean(copy=test_records[3]) + repack = frappe.get_doc(copy=test_records[3]) repack.doclist[2].incoming_rate = 6000 repack.insert() repack.submit() @@ -218,11 +218,11 @@ class TestStockEntry(unittest.TestCase): def _insert_material_receipt(self): self._clear_stock_account_balance() - se1 = frappe.bean(copy=test_records[0]) + se1 = frappe.get_doc(copy=test_records[0]) se1.insert() se1.submit() - se2 = frappe.bean(copy=test_records[0]) + se2 = frappe.get_doc(copy=test_records[0]) se2.doclist[1].item_code = "_Test Item Home Desktop 100" se2.insert() se2.submit() @@ -240,11 +240,11 @@ class TestStockEntry(unittest.TestCase): import test_records as sales_invoice_test_records # invalid sales invoice as update stock not checked - si = frappe.bean(copy=sales_invoice_test_records[1]) + si = frappe.get_doc(copy=sales_invoice_test_records[1]) si.insert() si.submit() - se = frappe.bean(copy=test_records[0]) + se = frappe.get_doc(copy=test_records[0]) se.purpose = "Sales Return" se.sales_invoice_no = si.name se.doclist[1].qty = returned_qty @@ -257,7 +257,7 @@ class TestStockEntry(unittest.TestCase): actual_qty_0 = self._get_actual_qty() # insert a pos invoice with update stock - si = frappe.bean(copy=sales_invoice_test_records[1]) + si = frappe.get_doc(copy=sales_invoice_test_records[1]) si.is_pos = si.update_stock = 1 si.doclist[1].warehouse = "_Test Warehouse - _TC" si.doclist[1].item_code = item_code @@ -271,7 +271,7 @@ class TestStockEntry(unittest.TestCase): self.assertEquals(actual_qty_0 - delivered_qty, actual_qty_1) # check if item is validated - se = frappe.bean(copy=test_records[0]) + se = frappe.get_doc(copy=test_records[0]) se.purpose = "Sales Return" se.sales_invoice_no = si.name se.posting_date = "2013-03-10" @@ -284,7 +284,7 @@ class TestStockEntry(unittest.TestCase): self.assertRaises(frappe.DoesNotExistError, se.insert) # try again - se = frappe.bean(copy=test_records[0]) + se = frappe.get_doc(copy=test_records[0]) se.purpose = "Sales Return" se.posting_date = "2013-03-10" se.fiscal_year = "_Test Fiscal Year 2013" @@ -321,7 +321,7 @@ class TestStockEntry(unittest.TestCase): actual_qty_0 = self._get_actual_qty() # make a delivery note based on this invoice - dn = frappe.bean(copy=delivery_note_test_records[0]) + dn = frappe.get_doc(copy=delivery_note_test_records[0]) dn.doclist[1].item_code = item_code dn.insert() dn.submit() @@ -332,7 +332,7 @@ class TestStockEntry(unittest.TestCase): si_doclist = make_sales_invoice(dn.name) - si = frappe.bean(si_doclist) + si = frappe.get_doc(si_doclist) si.posting_date = dn.posting_date si.debit_to = "_Test Customer - _TC" for d in si.get("entries"): @@ -342,7 +342,7 @@ class TestStockEntry(unittest.TestCase): si.submit() # insert and submit stock entry for sales return - se = frappe.bean(copy=test_records[0]) + se = frappe.get_doc(copy=test_records[0]) se.purpose = "Sales Return" se.delivery_note_no = dn.name se.posting_date = "2013-03-10" @@ -410,7 +410,7 @@ class TestStockEntry(unittest.TestCase): actual_qty_0 = self._get_actual_qty() - so = frappe.bean(copy=sales_order_test_records[0]) + so = frappe.get_doc(copy=sales_order_test_records[0]) so.doclist[1].item_code = item_code so.doclist[1].qty = 5.0 so.insert() @@ -418,7 +418,7 @@ class TestStockEntry(unittest.TestCase): dn_doclist = make_delivery_note(so.name) - dn = frappe.bean(dn_doclist) + dn = frappe.get_doc(dn_doclist) dn.status = "Draft" dn.posting_date = so.delivery_date dn.insert() @@ -430,7 +430,7 @@ class TestStockEntry(unittest.TestCase): si_doclist = make_sales_invoice(so.name) - si = frappe.bean(si_doclist) + si = frappe.get_doc(si_doclist) si.posting_date = dn.posting_date si.debit_to = "_Test Customer - _TC" for d in si.get("entries"): @@ -440,7 +440,7 @@ class TestStockEntry(unittest.TestCase): si.submit() # insert and submit stock entry for sales return - se = frappe.bean(copy=test_records[0]) + se = frappe.get_doc(copy=test_records[0]) se.purpose = "Sales Return" se.delivery_note_no = dn.name se.posting_date = "2013-03-10" @@ -466,7 +466,7 @@ class TestStockEntry(unittest.TestCase): from erpnext.stock.doctype.purchase_receipt.purchase_receipt import make_purchase_invoice # submit purchase receipt - pr = frappe.bean(copy=purchase_receipt_test_records[0]) + pr = frappe.get_doc(copy=purchase_receipt_test_records[0]) pr.insert() pr.submit() @@ -476,7 +476,7 @@ class TestStockEntry(unittest.TestCase): pi_doclist = make_purchase_invoice(pr.name) - pi = frappe.bean(pi_doclist) + pi = frappe.get_doc(pi_doclist) pi.posting_date = pr.posting_date pi.credit_to = "_Test Supplier - _TC" for d in pi.get("entries"): @@ -492,7 +492,7 @@ class TestStockEntry(unittest.TestCase): pi.submit() # submit purchase return - se = frappe.bean(copy=test_records[0]) + se = frappe.get_doc(copy=test_records[0]) se.purpose = "Purchase Return" se.purchase_receipt_no = pr.name se.posting_date = "2013-03-01" @@ -518,7 +518,7 @@ class TestStockEntry(unittest.TestCase): prev_se, pr_docname = self.test_purchase_receipt_return() # submit purchase return - return another 6 qtys so that exception is raised - se = frappe.bean(copy=test_records[0]) + se = frappe.get_doc(copy=test_records[0]) se.purpose = "Purchase Return" se.purchase_receipt_no = pr_docname se.posting_date = "2013-03-01" @@ -559,7 +559,7 @@ class TestStockEntry(unittest.TestCase): make_purchase_receipt, make_purchase_invoice # submit purchase receipt - po = frappe.bean(copy=purchase_order_test_records[0]) + po = frappe.get_doc(copy=purchase_order_test_records[0]) po.is_subcontracted = None po.doclist[1].item_code = "_Test Item" po.doclist[1].rate = 50 @@ -568,7 +568,7 @@ class TestStockEntry(unittest.TestCase): pr_doclist = make_purchase_receipt(po.name) - pr = frappe.bean(pr_doclist) + pr = frappe.get_doc(pr_doclist) pr.posting_date = po.transaction_date pr.insert() pr.submit() @@ -579,7 +579,7 @@ class TestStockEntry(unittest.TestCase): pi_doclist = make_purchase_invoice(po.name) - pi = frappe.bean(pi_doclist) + pi = frappe.get_doc(pi_doclist) pi.posting_date = pr.posting_date pi.credit_to = "_Test Supplier - _TC" for d in pi.get("entries"): @@ -594,7 +594,7 @@ class TestStockEntry(unittest.TestCase): pi.submit() # submit purchase return - se = frappe.bean(copy=test_records[0]) + se = frappe.get_doc(copy=test_records[0]) se.purpose = "Purchase Return" se.purchase_receipt_no = pr.name se.posting_date = "2013-03-01" @@ -621,13 +621,13 @@ class TestStockEntry(unittest.TestCase): frappe.db.set_default("company", "_Test Company") def test_serial_no_not_reqd(self): - se = frappe.bean(copy=test_records[0]) + se = frappe.get_doc(copy=test_records[0]) se.doclist[1].serial_no = "ABCD" se.insert() self.assertRaises(SerialNoNotRequiredError, se.submit) def test_serial_no_reqd(self): - se = frappe.bean(copy=test_records[0]) + se = frappe.get_doc(copy=test_records[0]) se.doclist[1].item_code = "_Test Serialized Item" se.doclist[1].qty = 2 se.doclist[1].transfer_qty = 2 @@ -635,7 +635,7 @@ class TestStockEntry(unittest.TestCase): self.assertRaises(SerialNoRequiredError, se.submit) def test_serial_no_qty_more(self): - se = frappe.bean(copy=test_records[0]) + se = frappe.get_doc(copy=test_records[0]) se.doclist[1].item_code = "_Test Serialized Item" se.doclist[1].qty = 2 se.doclist[1].serial_no = "ABCD\nEFGH\nXYZ" @@ -644,7 +644,7 @@ class TestStockEntry(unittest.TestCase): self.assertRaises(SerialNoQtyError, se.submit) def test_serial_no_qty_less(self): - se = frappe.bean(copy=test_records[0]) + se = frappe.get_doc(copy=test_records[0]) se.doclist[1].item_code = "_Test Serialized Item" se.doclist[1].qty = 2 se.doclist[1].serial_no = "ABCD" @@ -654,7 +654,7 @@ class TestStockEntry(unittest.TestCase): def test_serial_no_transfer_in(self): self._clear_stock_account_balance() - se = frappe.bean(copy=test_records[0]) + se = frappe.get_doc(copy=test_records[0]) se.doclist[1].item_code = "_Test Serialized Item" se.doclist[1].qty = 2 se.doclist[1].serial_no = "ABCD\nEFGH" @@ -670,7 +670,7 @@ class TestStockEntry(unittest.TestCase): def test_serial_no_not_exists(self): self._clear_stock_account_balance() - se = frappe.bean(copy=test_records[0]) + se = frappe.get_doc(copy=test_records[0]) se.purpose = "Material Issue" se.doclist[1].item_code = "_Test Serialized Item" se.doclist[1].qty = 2 @@ -685,7 +685,7 @@ class TestStockEntry(unittest.TestCase): self._clear_stock_account_balance() self.test_serial_by_series() - se = frappe.bean(copy=test_records[0]) + se = frappe.get_doc(copy=test_records[0]) se.doclist[1].item_code = "_Test Serialized Item With Series" se.doclist[1].qty = 1 se.doclist[1].serial_no = "ABCD00001" @@ -708,7 +708,7 @@ class TestStockEntry(unittest.TestCase): self._clear_stock_account_balance() self.test_serial_by_series() - se = frappe.bean(copy=test_records[0]) + se = frappe.get_doc(copy=test_records[0]) se.purpose = "Material Transfer" se.doclist[1].item_code = "_Test Serialized Item" se.doclist[1].qty = 1 @@ -724,7 +724,7 @@ class TestStockEntry(unittest.TestCase): se = make_serialized_item() serial_no = get_serial_nos(se.doclist[1].serial_no)[0] - se = frappe.bean(copy=test_records[0]) + se = frappe.get_doc(copy=test_records[0]) se.purpose = "Material Transfer" se.doclist[1].item_code = "_Test Serialized Item With Series" se.doclist[1].qty = 1 @@ -743,7 +743,7 @@ class TestStockEntry(unittest.TestCase): self._clear_stock_account_balance() make_serialized_item() - se = frappe.bean(copy=test_records[0]) + se = frappe.get_doc(copy=test_records[0]) se.purpose = "Material Transfer" se.doclist[1].item_code = "_Test Serialized Item With Series" se.doclist[1].qty = 1 @@ -765,12 +765,12 @@ class TestStockEntry(unittest.TestCase): def test_warehouse_company_validation(self): set_perpetual_inventory(0) self._clear_stock_account_balance() - frappe.bean("User", "test2@example.com").get_controller()\ + frappe.get_doc("User", "test2@example.com").get_controller()\ .add_roles("Sales User", "Sales Manager", "Material User", "Material Manager") frappe.set_user("test2@example.com") from erpnext.stock.utils import InvalidWarehouseCompany - st1 = frappe.bean(copy=test_records[0]) + st1 = frappe.get_doc(copy=test_records[0]) st1.doclist[1].t_warehouse="_Test Warehouse 2 - _TC1" st1.insert() self.assertRaises(InvalidWarehouseCompany, st1.submit) @@ -783,19 +783,19 @@ 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("User", "test@example.com").get_controller()\ + frappe.get_doc("User", "test@example.com").get_controller()\ .add_roles("Sales User", "Sales Manager", "Material User", "Material Manager") - frappe.bean("User", "test2@example.com").get_controller()\ + frappe.get_doc("User", "test2@example.com").get_controller()\ .add_roles("Sales User", "Sales Manager", "Material User", "Material Manager") frappe.set_user("test@example.com") - st1 = frappe.bean(copy=test_records[0]) + st1 = frappe.get_doc(copy=test_records[0]) st1.company = "_Test Company 1" st1.doclist[1].t_warehouse="_Test Warehouse 2 - _TC1" self.assertRaises(BeanPermissionError, st1.insert) frappe.set_user("test2@example.com") - st1 = frappe.bean(copy=test_records[0]) + st1 = frappe.get_doc(copy=test_records[0]) st1.company = "_Test Company 1" st1.doclist[1].t_warehouse="_Test Warehouse 2 - _TC1" st1.insert() @@ -811,18 +811,18 @@ class TestStockEntry(unittest.TestCase): # test freeze_stocks_upto date_newer_than_test_records = add_days(getdate(test_records[0][0]['posting_date']), 5) frappe.db.set_value("Stock Settings", None, "stock_frozen_upto", date_newer_than_test_records) - se = frappe.bean(copy=test_records[0]).insert() + se = frappe.get_doc(copy=test_records[0]).insert() self.assertRaises (StockFreezeError, se.submit) frappe.db.set_value("Stock Settings", None, "stock_frozen_upto", '') # test freeze_stocks_upto_days frappe.db.set_value("Stock Settings", None, "stock_frozen_upto_days", 7) - se = frappe.bean(copy=test_records[0]).insert() + se = frappe.get_doc(copy=test_records[0]).insert() self.assertRaises (StockFreezeError, se.submit) frappe.db.set_value("Stock Settings", None, "stock_frozen_upto_days", 0) def make_serialized_item(): - se = frappe.bean(copy=test_records[0]) + se = frappe.get_doc(copy=test_records[0]) se.doclist[1].item_code = "_Test Serialized Item With Series" se.doclist[1].qty = 2 se.doclist[1].transfer_qty = 2 diff --git a/erpnext/stock/doctype/stock_ledger/stock_ledger.py b/erpnext/stock/doctype/stock_ledger/stock_ledger.py index d0fe60a7eb..4f287acc06 100644 --- a/erpnext/stock/doctype/stock_ledger/stock_ledger.py +++ b/erpnext/stock/doctype/stock_ledger/stock_ledger.py @@ -42,7 +42,7 @@ class StockLedger(Document): def make_entry(self, args): args.update({"doctype": "Stock Ledger Entry"}) - sle = frappe.bean([args]) + sle = frappe.get_doc([args]) sle.ignore_permissions = 1 sle.insert() return sle.name diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py index 60f37e12f7..2ddf8318e3 100644 --- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py @@ -97,7 +97,7 @@ class StockReconciliation(StockController): # using try except to catch all validation msgs and display together try: - item = frappe.doc("Item", item_code) + item = frappe.get_doc("Item", item_code) # end of life and stock item validate_end_of_life(item_code, item.end_of_life, verbose=0) diff --git a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py index ca1519cce6..0438d6e7ae 100644 --- a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py @@ -175,7 +175,7 @@ class TestStockReconciliation(unittest.TestCase): frappe.db.sql("delete from `tabGL Entry`") def submit_stock_reconciliation(self, qty, rate, posting_date, posting_time): - stock_reco = frappe.bean([{ + stock_reco = frappe.get_doc([{ "doctype": "Stock Reconciliation", "posting_date": posting_date, "posting_time": posting_time, @@ -221,11 +221,11 @@ class TestStockReconciliation(unittest.TestCase): }, ] - pr = frappe.bean(copy=stock_entry) + pr = frappe.get_doc(copy=stock_entry) pr.insert() pr.submit() - pr1 = frappe.bean(copy=stock_entry) + pr1 = frappe.get_doc(copy=stock_entry) pr1.posting_date = "2012-12-15" pr1.posting_time = "02:00" pr1.doclist[1].qty = 10 @@ -234,7 +234,7 @@ class TestStockReconciliation(unittest.TestCase): pr1.insert() pr1.submit() - pr2 = frappe.bean(copy=stock_entry) + pr2 = frappe.get_doc(copy=stock_entry) pr2.posting_date = "2012-12-25" pr2.posting_time = "03:00" pr2.purpose = "Material Issue" @@ -246,7 +246,7 @@ class TestStockReconciliation(unittest.TestCase): pr2.insert() pr2.submit() - pr3 = frappe.bean(copy=stock_entry) + pr3 = frappe.get_doc(copy=stock_entry) pr3.posting_date = "2012-12-31" pr3.posting_time = "08:00" pr3.purpose = "Material Issue" @@ -259,7 +259,7 @@ class TestStockReconciliation(unittest.TestCase): pr3.submit() - pr4 = frappe.bean(copy=stock_entry) + pr4 = frappe.get_doc(copy=stock_entry) pr4.posting_date = "2013-01-05" pr4.fiscal_year = "_Test Fiscal Year 2013" pr4.posting_time = "07:00" diff --git a/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.py b/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.py index 28972d35fb..48f5a3dfad 100644 --- a/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.py +++ b/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.py @@ -34,7 +34,7 @@ class StockUomReplaceUtility(Document): raise Exception def update_item_master(self): - item_bean = frappe.bean("Item", self.item_code) + item_bean = frappe.get_doc("Item", self.item_code) item_bean.stock_uom = self.new_stock_uom item_bean.save() diff --git a/erpnext/stock/doctype/warehouse/warehouse.py b/erpnext/stock/doctype/warehouse/warehouse.py index d621985ff5..0bb70a5a7a 100644 --- a/erpnext/stock/doctype/warehouse/warehouse.py +++ b/erpnext/stock/doctype/warehouse/warehouse.py @@ -28,7 +28,7 @@ class Warehouse(Document): {"account_type": "Warehouse", "company": self.company, "master_name": self.name}, ["name", "parent_account"]) if warehouse_account and warehouse_account[1] != self.create_account_under: - acc_bean = frappe.bean("Account", warehouse_account[0]) + acc_bean = frappe.get_doc("Account", warehouse_account[0]) acc_bean.parent_account = self.create_account_under acc_bean.save() @@ -43,7 +43,7 @@ class Warehouse(Document): if self.get("__islocal") or not frappe.db.get_value( "Stock Ledger Entry", {"warehouse": self.name}): self.validate_parent_account() - ac_bean = frappe.bean({ + ac_bean = frappe.get_doc({ "doctype": "Account", 'account_name': self.warehouse_name, 'parent_account': self.create_account_under, diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index 1bf431ad29..f4588f582c 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -47,7 +47,7 @@ def get_item_details(args): elif not args.item_code and args.serial_no: args.item_code = get_item_code(serial_no=args.serial_no) - item_bean = frappe.bean("Item", args.item_code) + item_bean = frappe.get_doc("Item", args.item_code) item = item_bean.doc validate_item_details(args, item) diff --git a/erpnext/stock/stock_ledger.py b/erpnext/stock/stock_ledger.py index e812285e1a..c8921d614c 100644 --- a/erpnext/stock/stock_ledger.py +++ b/erpnext/stock/stock_ledger.py @@ -49,7 +49,7 @@ def set_as_cancel(voucher_type, voucher_no): def make_entry(args): args.update({"doctype": "Stock Ledger Entry"}) - sle = frappe.bean([args]) + sle = frappe.get_doc([args]) sle.ignore_permissions = 1 sle.insert() sle.submit() @@ -137,7 +137,7 @@ def update_entries_after(args, verbose=1): # update bin if not frappe.db.exists({"doctype": "Bin", "item_code": args["item_code"], "warehouse": args["warehouse"]}): - bin_wrapper = frappe.bean([{ + bin_wrapper = frappe.get_doc([{ "doctype": "Bin", "item_code": args["item_code"], "warehouse": args["warehouse"], diff --git a/erpnext/stock/utils.py b/erpnext/stock/utils.py index 981f674acf..2f28e1a0c8 100644 --- a/erpnext/stock/utils.py +++ b/erpnext/stock/utils.py @@ -40,7 +40,7 @@ def get_latest_stock_balance(): def get_bin(item_code, warehouse): bin = frappe.db.get_value("Bin", {"item_code": item_code, "warehouse": warehouse}) if not bin: - bin_wrapper = frappe.bean([{ + bin_wrapper = frappe.get_doc([{ "doctype": "Bin", "item_code": item_code, "warehouse": warehouse, @@ -246,7 +246,7 @@ def create_material_request(material_requests): }] for d in items: - item = frappe.doc("Item", d.item_code) + item = frappe.get_doc("Item", d.item_code) mr.append({ "doctype": "Material Request Item", "parenttype": "Material Request", @@ -262,7 +262,7 @@ def create_material_request(material_requests): "brand": item.brand, }) - mr_bean = frappe.bean(mr) + mr_bean = frappe.get_doc(mr) mr_bean.insert() mr_bean.submit() mr_list.append(mr_bean) diff --git a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py index 0052ab28e4..c10d691fb1 100644 --- a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py +++ b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py @@ -58,7 +58,7 @@ class MaintenanceSchedule(TransactionBase): self.update_amc_date(serial_nos, d.end_date) if d.sales_person not in email_map: - sp = frappe.bean("Sales Person", d.sales_person).make_controller() + sp = frappe.get_doc("Sales Person", d.sales_person).make_controller() email_map[d.sales_person] = sp.get_email_id() scheduled_date = frappe.db.sql("""select scheduled_date from @@ -69,7 +69,7 @@ class MaintenanceSchedule(TransactionBase): if email_map[d.sales_person]: description = "Reference: %s, Item Code: %s and Customer: %s" % \ (self.name, d.item_code, self.customer) - frappe.bean({ + frappe.get_doc({ "doctype": "Event", "owner": email_map[d.sales_person] or self.owner, "subject": description, @@ -203,7 +203,7 @@ class MaintenanceSchedule(TransactionBase): def update_amc_date(self, serial_nos, amc_expiry_date=None): for serial_no in serial_nos: - serial_no_bean = frappe.bean("Serial No", serial_no) + serial_no_bean = frappe.get_doc("Serial No", serial_no) serial_no_bean.amc_expiry_date = amc_expiry_date serial_no_bean.save() diff --git a/erpnext/support/doctype/newsletter/newsletter.py b/erpnext/support/doctype/newsletter/newsletter.py index f28afa8362..a2ac2de87b 100644 --- a/erpnext/support/doctype/newsletter/newsletter.py +++ b/erpnext/support/doctype/newsletter/newsletter.py @@ -130,7 +130,7 @@ def create_lead(email_id): if frappe.db.get_value("Lead", {"email_id": email_id}): return - lead = frappe.bean({ + lead = frappe.get_doc({ "doctype": "Lead", "email_id": email_id, "lead_name": real_name or email_id, diff --git a/erpnext/support/doctype/newsletter/test_newsletter.py b/erpnext/support/doctype/newsletter/test_newsletter.py index f94c8d5fb3..01ed84eb98 100644 --- a/erpnext/support/doctype/newsletter/test_newsletter.py +++ b/erpnext/support/doctype/newsletter/test_newsletter.py @@ -5,7 +5,7 @@ import frappe, unittest class TestNewsletter(unittest.TestCase): def test_get_recipients_lead(self): - w = frappe.bean(test_records[0]) + w = frappe.get_doc(test_records[0]) w.insert() self.assertTrue("test_lead@example.com" in w.controller.get_recipients()) frappe.db.sql("""delete from `tabBulk Email`""") @@ -13,24 +13,24 @@ class TestNewsletter(unittest.TestCase): self.assertTrue(frappe.db.get_value("Bulk Email", {"recipient": "test_lead@example.com"})) def test_get_recipients_lead_by_status(self): - w = frappe.bean(test_records[0]) + w = frappe.get_doc(test_records[0]) w.lead_status="Converted" w.insert() self.assertTrue("test_lead3@example.com" in w.controller.get_recipients()) def test_get_recipients_contact_customer(self): - w = frappe.bean(test_records[1]) + w = frappe.get_doc(test_records[1]) w.insert() self.assertTrue("test_contact_customer@example.com" in w.controller.get_recipients()) def test_get_recipients_contact_supplier(self): - w = frappe.bean(test_records[1]) + w = frappe.get_doc(test_records[1]) w.contact_type="Supplier" w.insert() self.assertTrue("test_contact_supplier@example.com" in w.controller.get_recipients()) def test_get_recipients_custom(self): - w = frappe.bean(test_records[2]) + w = frappe.get_doc(test_records[2]) w.insert() self.assertTrue("test_custom2@example.com" in w.controller.get_recipients()) self.assertTrue(frappe.db.get("Lead", diff --git a/erpnext/support/doctype/support_ticket/get_support_mails.py b/erpnext/support/doctype/support_ticket/get_support_mails.py index 0edf54a1a6..fa3b283e3a 100644 --- a/erpnext/support/doctype/support_ticket/get_support_mails.py +++ b/erpnext/support/doctype/support_ticket/get_support_mails.py @@ -10,7 +10,7 @@ from frappe.core.doctype.communication.communication import _make class SupportMailbox(POP3Mailbox): def setup(self, args=None): - self.email_settings = frappe.doc("Support Email Settings", "Support Email Settings") + self.email_settings = frappe.get_doc("Support Email Settings", "Support Email Settings") self.settings = args or frappe._dict({ "use_ssl": self.email_settings.use_ssl, "host": self.email_settings.mail_server, @@ -58,12 +58,12 @@ def get_support_mails(): def add_support_communication(subject, content, sender, docname=None, mail=None): if docname: - ticket = frappe.bean("Support Ticket", docname) + ticket = frappe.get_doc("Support Ticket", docname) ticket.status = 'Open' ticket.ignore_permissions = True ticket.save() else: - ticket = frappe.bean([decode_dict({ + ticket = frappe.get_doc([decode_dict({ "doctype":"Support Ticket", "description": content, "subject": subject, diff --git a/erpnext/support/doctype/support_ticket/support_ticket.py b/erpnext/support/doctype/support_ticket/support_ticket.py index 6aa5b789d2..9517ea48de 100644 --- a/erpnext/support/doctype/support_ticket/support_ticket.py +++ b/erpnext/support/doctype/support_ticket/support_ticket.py @@ -57,7 +57,7 @@ class SupportTicket(TransactionBase): @frappe.whitelist() def set_status(name, status): - st = frappe.bean("Support Ticket", name) + st = frappe.get_doc("Support Ticket", name) st.status = status st.save() diff --git a/erpnext/utilities/doctype/contact/contact.py b/erpnext/utilities/doctype/contact/contact.py index 96cc879d2e..28597efdcb 100644 --- a/erpnext/utilities/doctype/contact/contact.py +++ b/erpnext/utilities/doctype/contact/contact.py @@ -56,7 +56,7 @@ class Contact(StatusUpdater): @frappe.whitelist() def get_contact_details(contact): - contact = frappe.doc("Contact", contact) + contact = frappe.get_doc("Contact", contact) out = { "contact_person": contact.get("name"), "contact_display": " ".join(filter(None, From 0d8d30e1cc8526977d1469151f4135e86accf6dd Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Fri, 28 Mar 2014 16:57:21 +0530 Subject: [PATCH 11/42] frappe/frappe#478 --- erpnext/accounts/doctype/account/account.py | 35 ++---- .../accounts/doctype/account/test_account.py | 4 +- .../accounts_settings/accounts_settings.py | 4 +- .../bank_reconciliation.py | 28 +++-- .../bank_reconciliation_detail.py | 1 - .../doctype/budget_detail/budget_detail.py | 1 - .../budget_distribution.py | 12 +- .../test_budget_distribution.py | 103 +++++++----------- .../budget_distribution_detail.py | 1 - erpnext/accounts/doctype/c_form/c_form.py | 43 +++----- .../c_form_invoice_detail.py | 1 - .../chart_of_accounts/chart_of_accounts.py | 21 ++-- .../chart_of_accounts/import_charts.py | 2 +- .../doctype/cost_center/cost_center.py | 16 ++- .../payment_to_invoice_matching_tool.py | 2 +- .../purchase_invoice/purchase_invoice.py | 2 +- .../doctype/sales_invoice/sales_invoice.py | 2 +- .../doctype/purchase_order/purchase_order.py | 2 +- erpnext/hr/doctype/appraisal/appraisal.py | 2 +- .../hr/doctype/expense_claim/expense_claim.py | 2 +- erpnext/hr/doctype/salary_slip/salary_slip.py | 2 +- erpnext/manufacturing/doctype/bom/bom.py | 2 +- .../production_planning_tool.py | 2 +- .../installation_note/installation_note.py | 2 +- .../doctype/opportunity/opportunity.py | 2 +- .../selling/doctype/quotation/quotation.py | 2 +- .../doctype/sales_order/sales_order.py | 2 +- .../authorization_control.py | 2 +- .../doctype/sales_person/sales_person.py | 2 +- erpnext/setup/doctype/territory/territory.py | 2 +- .../doctype/delivery_note/delivery_note.py | 2 +- erpnext/stock/doctype/item/item.py | 2 +- .../stock/doctype/packed_item/packed_item.py | 2 +- .../purchase_receipt/purchase_receipt.py | 2 +- .../stock/doctype/stock_entry/stock_entry.py | 2 +- .../doctype/stock_ledger/stock_ledger.py | 2 +- .../maintenance_schedule.py | 2 +- .../maintenance_visit/maintenance_visit.py | 2 +- .../doctype/sms_control/sms_control.py | 2 +- 39 files changed, 134 insertions(+), 188 deletions(-) diff --git a/erpnext/accounts/doctype/account/account.py b/erpnext/accounts/doctype/account/account.py index 18ae244fd9..094edd0d2c 100644 --- a/erpnext/accounts/doctype/account/account.py +++ b/erpnext/accounts/doctype/account/account.py @@ -3,12 +3,8 @@ from __future__ import unicode_literals import frappe - from frappe.utils import flt, fmt_money, cstr, cint from frappe import msgprint, throw, _ - -get_value = frappe.db.get_value - from frappe.model.document import Document class Account(Document): @@ -19,10 +15,7 @@ class Account(Document): frappe.db.get_value("Company", self.company, "abbr") def get_address(self): - return { - 'address': frappe.db.get_value(self.master_type, - self.master_name, "address") - } + return {'address': frappe.db.get_value(self.master_type, self.master_name, "address")} def validate(self): self.validate_master_name() @@ -32,24 +25,19 @@ class Account(Document): self.validate_mandatory() self.validate_warehouse_account() self.validate_frozen_accounts_modifier() - - if not self.parent_account: - self.parent_account = '' def validate_master_name(self): - """Remind to add master name""" if self.master_type in ('Customer', 'Supplier') or self.account_type == "Warehouse": if not self.master_name: msgprint(_("Please enter Master Name once the account is created.")) - elif not frappe.db.exists(self.master_type or self.account_type, - self.master_name): + elif not frappe.db.exists(self.master_type or self.account_type, self.master_name): throw(_("Invalid Master Name")) def validate_parent(self): """Fetch Parent Details and validation for account not to be created under ledger""" if self.parent_account: - par = frappe.db.sql("""select name, group_or_ledger, report_type - from tabAccount where name =%s""", self.parent_account, as_dict=1) + par = frappe.db.get_value("Account", self.parent_account, + ["name", "group_or_ledger", "report_type"], as_dict=1) if not par: throw(_("Parent account does not exists")) elif par[0]["name"] == self.name: @@ -63,14 +51,13 @@ class Account(Document): def validate_duplicate_account(self): if self.get('__islocal') or not self.name: company_abbr = frappe.db.get_value("Company", self.company, "abbr") - if frappe.db.sql("""select name from tabAccount where name=%s""", - (self.account_name + " - " + company_abbr)): - throw("{name}: {acc_name} {exist}, {rename}".format(**{ - "name": _("Account Name"), - "acc_name": self.account_name, - "exist": _("already exists"), - "rename": _("please rename") - })) + if frappe.db.exists("Account", (self.account_name + " - " + company_abbr)): + throw("{name}: {acc_name} {exist}, {rename}".format(**{ + "name": _("Account Name"), + "acc_name": self.account_name, + "exist": _("already exists"), + "rename": _("please rename") + })) def validate_root_details(self): #does not exists parent diff --git a/erpnext/accounts/doctype/account/test_account.py b/erpnext/accounts/doctype/account/test_account.py index 10883d9dde..5cecab42bf 100644 --- a/erpnext/accounts/doctype/account/test_account.py +++ b/erpnext/accounts/doctype/account/test_account.py @@ -35,12 +35,12 @@ def _make_test_records(verbose): ] for company, abbr in [["_Test Company", "_TC"], ["_Test Company 1", "_TC1"]]: - test_objects = make_test_objects("Account", [[{ + test_objects = make_test_objects("Account", [{ "doctype": "Account", "account_name": account_name, "parent_account": parent_account + " - " + abbr, "company": company, "group_or_ledger": group_or_ledger - }] for account_name, parent_account, group_or_ledger in accounts]) + } for account_name, parent_account, group_or_ledger in accounts]) return test_objects \ No newline at end of file diff --git a/erpnext/accounts/doctype/accounts_settings/accounts_settings.py b/erpnext/accounts/doctype/accounts_settings/accounts_settings.py index 0559559a20..89d7c00074 100644 --- a/erpnext/accounts/doctype/accounts_settings/accounts_settings.py +++ b/erpnext/accounts/doctype/accounts_settings/accounts_settings.py @@ -7,18 +7,16 @@ from __future__ import unicode_literals import frappe from frappe import _ from frappe.utils import cint - from frappe.model.document import Document class AccountsSettings(Document): - def on_update(self): frappe.db.set_default("auto_accounting_for_stock", self.auto_accounting_for_stock) if cint(self.auto_accounting_for_stock): # set default perpetual account in company for company in frappe.db.sql("select name from tabCompany"): - frappe.bean("Company", company[0]).save() + frappe.get_doc("Company", company[0]).save() # Create account head for warehouses warehouse_list = frappe.db.sql("select name, company from tabWarehouse", as_dict=1) diff --git a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py index d8edb20def..dc7d57becb 100644 --- a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py +++ b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py @@ -3,20 +3,25 @@ from __future__ import unicode_literals import frappe - -from frappe.utils import cstr, flt, getdate, now, nowdate -from frappe import msgprint - +from frappe.utils import cstr, flt, getdate, nowdate +from frappe import msgprint, _ from frappe.model.document import Document class BankReconciliation(Document): - def get_details(self): if not (self.bank_account and self.from_date and self.to_date): msgprint("Bank Account, From Date and To Date are Mandatory") return - dl = frappe.db.sql("select t1.name, t1.cheque_no, t1.cheque_date, t2.debit, t2.credit, t1.posting_date, t2.against_account from `tabJournal Voucher` t1, `tabJournal Voucher Detail` t2 where t2.parent = t1.name and t2.account = %s and (clearance_date is null or clearance_date = '0000-00-00' or clearance_date = '') and t1.posting_date >= %s and t1.posting_date <= %s and t1.docstatus=1", (self.bank_account, self.from_date, self.to_date)) + dl = frappe.db.sql("""select t1.name, t1.cheque_no, t1.cheque_date, t2.debit, + t2.credit, t1.posting_date, t2.against_account + from + `tabJournal Voucher` t1, `tabJournal Voucher Detail` t2 + where + t2.parent = t1.name and t2.account = %s + and (clearance_date is null or clearance_date = '0000-00-00' or clearance_date = '') + and t1.posting_date >= %s and t1.posting_date <= %s and t1.docstatus=1""", + (self.bank_account, self.from_date, self.to_date)) self.set('entries', []) self.total_amount = 0.0 @@ -37,15 +42,14 @@ class BankReconciliation(Document): for d in self.get('entries'): if d.clearance_date: if d.cheque_date and getdate(d.clearance_date) < getdate(d.cheque_date): - msgprint("Clearance Date can not be before Cheque Date (Row #%s)" % - d.idx, raise_exception=1) + frappe.throw("Clearance Date can not be before Cheque Date (Row #%s)" % d.idx) - frappe.db.sql("""update `tabJournal Voucher` - set clearance_date = %s, modified = %s where name=%s""", - (d.clearance_date, nowdate(), d.voucher_id)) + frappe.db.set_value("Journal Voucher", d.voucher_id, "clearance_date", d.clearance_date) + frappe.db.sql("""update `tabJournal Voucher` set clearance_date = %s, modified = %s + where name=%s""", (d.clearance_date, nowdate(), d.voucher_id)) vouchers.append(d.voucher_id) if vouchers: msgprint("Clearance Date updated in %s" % ", ".join(vouchers)) else: - msgprint("Clearance Date not mentioned") \ No newline at end of file + msgprint(_("Clearance Date not mentioned")) \ No newline at end of file diff --git a/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.py b/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.py index 93dca1da23..9be696cb0d 100644 --- a/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.py +++ b/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals import frappe - from frappe.model.document import Document class BankReconciliationDetail(Document): diff --git a/erpnext/accounts/doctype/budget_detail/budget_detail.py b/erpnext/accounts/doctype/budget_detail/budget_detail.py index 58106a06ac..ff4f8867f7 100644 --- a/erpnext/accounts/doctype/budget_detail/budget_detail.py +++ b/erpnext/accounts/doctype/budget_detail/budget_detail.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals import frappe - from frappe.model.document import Document class BudgetDetail(Document): diff --git a/erpnext/accounts/doctype/budget_distribution/budget_distribution.py b/erpnext/accounts/doctype/budget_distribution/budget_distribution.py index 069c4d3390..2cc5015c4d 100644 --- a/erpnext/accounts/doctype/budget_distribution/budget_distribution.py +++ b/erpnext/accounts/doctype/budget_distribution/budget_distribution.py @@ -3,11 +3,8 @@ from __future__ import unicode_literals import frappe - from frappe.utils import flt -from frappe.model.bean import getlist -from frappe import msgprint, _ - +from frappe import _ from frappe.model.document import Document class BudgetDistribution(Document): @@ -17,13 +14,12 @@ class BudgetDistribution(Document): idx =1 for m in month_list: mnth = self.append('budget_distribution_details') - mnth.month = m or '' + mnth.month = m mnth.idx = idx idx += 1 def validate(self): - total = sum([flt(d.percentage_allocation, 2) for d in self.doclist.get( - {"parentfield": "budget_distribution_details"})]) + total = sum([flt(d.percentage_allocation) for d in self.get("budget_distribution_details")]) if total != 100.0: - msgprint(_("Percentage Allocation should be equal to ") + "100%", raise_exception=1) \ No newline at end of file + frappe.throw(_("Percentage Allocation should be equal to ") + "100%") \ No newline at end of file diff --git a/erpnext/accounts/doctype/budget_distribution/test_budget_distribution.py b/erpnext/accounts/doctype/budget_distribution/test_budget_distribution.py index 15b60db996..57fc162fe5 100644 --- a/erpnext/accounts/doctype/budget_distribution/test_budget_distribution.py +++ b/erpnext/accounts/doctype/budget_distribution/test_budget_distribution.py @@ -2,69 +2,48 @@ # License: GNU General Public License v3. See license.txt test_records = [ - [{ + { "doctype": "Budget Distribution", "distribution_id": "_Test Distribution", "fiscal_year": "_Test Fiscal Year 2013", - }, { - "doctype": "Budget Distribution Detail", - "parentfield": "budget_distribution_details", - "month": "January", - "percentage_allocation": "8" - }, { - "doctype": "Budget Distribution Detail", - "parentfield": "budget_distribution_details", - "month": "February", - "percentage_allocation": "8" - }, { - "doctype": "Budget Distribution Detail", - "parentfield": "budget_distribution_details", - "month": "March", - "percentage_allocation": "8" - }, { - "doctype": "Budget Distribution Detail", - "parentfield": "budget_distribution_details", - "month": "April", - "percentage_allocation": "8" - }, { - "doctype": "Budget Distribution Detail", - "parentfield": "budget_distribution_details", - "month": "May", - "percentage_allocation": "8" - }, { - "doctype": "Budget Distribution Detail", - "parentfield": "budget_distribution_details", - "month": "June", - "percentage_allocation": "8" - }, { - "doctype": "Budget Distribution Detail", - "parentfield": "budget_distribution_details", - "month": "July", - "percentage_allocation": "8" - }, { - "doctype": "Budget Distribution Detail", - "parentfield": "budget_distribution_details", - "month": "August", - "percentage_allocation": "8" - }, { - "doctype": "Budget Distribution Detail", - "parentfield": "budget_distribution_details", - "month": "September", - "percentage_allocation": "8" - }, { - "doctype": "Budget Distribution Detail", - "parentfield": "budget_distribution_details", - "month": "October", - "percentage_allocation": "8" - }, { - "doctype": "Budget Distribution Detail", - "parentfield": "budget_distribution_details", - "month": "November", - "percentage_allocation": "10" - }, { - "doctype": "Budget Distribution Detail", - "parentfield": "budget_distribution_details", - "month": "December", - "percentage_allocation": "10" - }] + "budget_distribution_details": [ + { + "month": "January", + "percentage_allocation": "8" + }, { + "month": "February", + "percentage_allocation": "8" + }, { + "month": "March", + "percentage_allocation": "8" + }, { + "month": "April", + "percentage_allocation": "8" + }, { + "month": "May", + "percentage_allocation": "8" + }, { + "month": "June", + "percentage_allocation": "8" + }, { + "month": "July", + "percentage_allocation": "8" + }, { + "month": "August", + "percentage_allocation": "8" + }, { + "month": "September", + "percentage_allocation": "8" + }, { + "month": "October", + "percentage_allocation": "8" + }, { + "month": "November", + "percentage_allocation": "10" + }, { + "month": "December", + "percentage_allocation": "10" + } + ] + } ] \ No newline at end of file diff --git a/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.py b/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.py index 84d8060731..87d38fd36a 100644 --- a/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.py +++ b/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals import frappe - from frappe.model.document import Document class BudgetDistributionDetail(Document): diff --git a/erpnext/accounts/doctype/c_form/c_form.py b/erpnext/accounts/doctype/c_form/c_form.py index d0df2e4aed..95e2e4060f 100644 --- a/erpnext/accounts/doctype/c_form/c_form.py +++ b/erpnext/accounts/doctype/c_form/c_form.py @@ -3,14 +3,11 @@ from __future__ import unicode_literals import frappe -from frappe.utils import flt, getdate -from frappe.model.bean import getlist - +from frappe.utils import flt +from frappe import _ from frappe.model.document import Document class CForm(Document): - - def validate(self): """Validate invoice that c-form is applicable and no other c-form is received for that""" @@ -21,18 +18,17 @@ class CForm(Document): `tabSales Invoice` where name = %s and docstatus = 1""", d.invoice_no) if not inv: - frappe.msgprint("""Invoice: %s is not exists in the system or - is not submitted, please check.""" % d.invoice_no, raise_exception=1) + frappe.throw("""Invoice: %s is not exists in the system or + is not submitted, please check.""" % d.invoice_no) elif inv[0][0] != 'Yes': - frappe.msgprint("C-form is not applicable for Invoice: %s" % - d.invoice_no, raise_exception=1) + frappe.throw("C-form is not applicable for Invoice: %s" % d.invoice_no) elif inv[0][1] and inv[0][1] != self.name: - frappe.msgprint("""Invoice %s is tagged in another C-form: %s. + frappe.throw("""Invoice %s is tagged in another C-form: %s. If you want to change C-form no for this invoice, please remove invoice no from the previous c-form and then try again""" % - (d.invoice_no, inv[0][1]), raise_exception=1) + (d.invoice_no, inv[0][1])) def on_update(self): """ Update C-Form No on invoices""" @@ -43,22 +39,19 @@ class CForm(Document): def before_cancel(self): # remove cform reference - frappe.db.sql("""update `tabSales Invoice` set c_form_no=null - where c_form_no=%s""", self.name) + frappe.db.sql("""update `tabSales Invoice` set c_form_no=null where c_form_no=%s""", self.name) def set_cform_in_sales_invoices(self): inv = [d.invoice_no for d in self.get('invoice_details')] if inv: - frappe.db.sql("""update `tabSales Invoice` set c_form_no=%s, modified=%s - where name in (%s)""" % ('%s', '%s', ', '.join(['%s'] * len(inv))), - tuple([self.name, self.modified] + inv)) + frappe.db.sql("""update `tabSales Invoice` set c_form_no=%s, modified=%s where name in (%s)""" % + ('%s', '%s', ', '.join(['%s'] * len(inv))), tuple([self.name, self.modified] + inv)) frappe.db.sql("""update `tabSales Invoice` set c_form_no = null, modified = %s where name not in (%s) and ifnull(c_form_no, '') = %s""" % - ('%s', ', '.join(['%s']*len(inv)), '%s'), - tuple([self.modified] + inv + [self.name])) + ('%s', ', '.join(['%s']*len(inv)), '%s'), tuple([self.modified] + inv + [self.name])) else: - frappe.msgprint("Please enter atleast 1 invoice in the table", raise_exception=1) + frappe.throw(_("Please enter atleast 1 invoice in the table")) def set_total_invoiced_amount(self): total = sum([flt(d.grand_total) for d in self.get('invoice_details')]) @@ -67,13 +60,13 @@ class CForm(Document): def get_invoice_details(self, invoice_no): """ Pull details from invoices for referrence """ - inv = frappe.db.sql("""select posting_date, territory, net_total, grand_total - from `tabSales Invoice` where name = %s""", invoice_no) + inv = frappe.db.get_value("Sales Invoice", invoice_no, + ["posting_date", "territory", "net_total", "grand_total"], as_dict=True) return { - 'invoice_date' : inv and getdate(inv[0][0]).strftime('%Y-%m-%d') or '', - 'territory' : inv and inv[0][1] or '', - 'net_total' : inv and flt(inv[0][2]) or '', - 'grand_total' : inv and flt(inv[0][3]) or '' + 'invoice_date' : inv.posting_date, + 'territory' : inv.territory, + 'net_total' : inv.net_total, + 'grand_total' : inv.grand_total } def get_invoice_nos(doctype, txt, searchfield, start, page_len, filters): diff --git a/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.py b/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.py index 8e3bc2974a..f6b5474686 100644 --- a/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.py +++ b/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals import frappe - from frappe.model.document import Document class CFormInvoiceDetail(Document): diff --git a/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.py b/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.py index 536b1998c3..d6b9eebde1 100644 --- a/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.py +++ b/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.py @@ -5,25 +5,21 @@ from __future__ import unicode_literals import frappe, os, json from frappe.utils import cstr from unidecode import unidecode - - from frappe.model.document import Document class ChartOfAccounts(Document): - self.no_report_type = False + no_report_type = False def create_accounts(self, company): chart = {} - with open(os.path.join(os.path.dirname(__file__), "charts", - self.source_file), "r") as f: + with open(os.path.join(os.path.dirname(__file__), "charts", self.source_file), "r") as f: chart = json.loads(f.read()) - from erpnext.accounts.doctype.chart_of_accounts.charts.account_properties \ - import account_properties + from erpnext.accounts.doctype.chart_of_accounts.charts.account_properties import account_properties if chart: accounts = [] - + def _import_accounts(children, parent): for child in children: account_name = child.get("name") @@ -33,10 +29,9 @@ class ChartOfAccounts(Document): count = accounts.count(account_name_in_db) account_name = account_name + " " + cstr(count) - child.update(account_properties.get(chart.get("name"), {})\ - .get(account_name, {})) + child.update(account_properties.get(chart.get("name"), {}).get(account_name, {})) - account = frappe.bean({ + account = frappe.new_doc({ "doctype": "Account", "account_name": account_name, "company": company, @@ -63,5 +58,5 @@ class ChartOfAccounts(Document): @frappe.whitelist() def get_charts_for_country(country): - return frappe.db.sql_list("select chart_name from `tabChart of Accounts` where country=%s", - country) \ No newline at end of file + return frappe.db.sql_list("""select chart_name from `tabChart of Accounts` + where country=%s""", country) \ No newline at end of file diff --git a/erpnext/accounts/doctype/chart_of_accounts/import_charts.py b/erpnext/accounts/doctype/chart_of_accounts/import_charts.py index 1d34ab2be0..3806f08086 100644 --- a/erpnext/accounts/doctype/chart_of_accounts/import_charts.py +++ b/erpnext/accounts/doctype/chart_of_accounts/import_charts.py @@ -13,7 +13,7 @@ def import_charts(): chart = json.loads(f.read()) country = frappe.db.get_value("Country", {"code": fname.split("_", 1)[0]}) if country: - bean = frappe.bean({ + bean = frappe.new_doc({ "doctype":"Chart of Accounts", "chart_name": chart.get("name"), "source_file": fname, diff --git a/erpnext/accounts/doctype/cost_center/cost_center.py b/erpnext/accounts/doctype/cost_center/cost_center.py index 79bd1213bf..ac69e75f13 100644 --- a/erpnext/accounts/doctype/cost_center/cost_center.py +++ b/erpnext/accounts/doctype/cost_center/cost_center.py @@ -3,19 +3,17 @@ from __future__ import unicode_literals import frappe -from frappe.model.bean import getlist + from frappe import msgprint, _ from frappe.utils.nestedset import DocTypeNestedSet class CostCenter(DocTypeNestedSet): - - self.nsm_parent_field = 'parent_cost_center' - + nsm_parent_field = 'parent_cost_center' + def autoname(self): - company_abbr = frappe.db.sql("select abbr from tabCompany where name=%s", - self.company)[0][0] - self.name = self.cost_center_name.strip() + ' - ' + company_abbr + self.name = self.cost_center_name.strip() + ' - ' + \ + frappe.get_value("Company", self.company, "abbr") def validate_mandatory(self): if not self.group_or_ledger: @@ -78,7 +76,7 @@ class CostCenter(DocTypeNestedSet): new_cost_center = get_name_with_abbr(newdn, self.company) # Validate properties before merging - super(DocType, self).before_rename(olddn, new_cost_center, merge, "group_or_ledger") + super(CostCenter, self).before_rename(olddn, new_cost_center, merge, "group_or_ledger") return new_cost_center @@ -87,5 +85,5 @@ class CostCenter(DocTypeNestedSet): frappe.db.set_value("Cost Center", newdn, "cost_center_name", " - ".join(newdn.split(" - ")[:-1])) else: - super(DocType, self).after_rename(olddn, newdn, merge) + super(CostCenter, self).after_rename(olddn, newdn, merge) diff --git a/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py b/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py index fb1508e8bd..36b4e95213 100644 --- a/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py +++ b/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import frappe from frappe.utils import flt -from frappe.model.bean import getlist + from frappe import msgprint, _ from frappe.model.document import Document diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index f9e9481b23..eb8b93a5d6 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import frappe from frappe.utils import cint, cstr, flt, formatdate -from frappe.model.bean import getlist + from frappe.model.code import get_obj from frappe import msgprint, _ from erpnext.setup.utils import get_company_currency diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 449fca0f3a..6413f91dc6 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -10,7 +10,7 @@ from frappe.utils import add_days, cint, cstr, date_diff, flt, getdate, nowdate, from frappe.utils import comma_and from frappe.model.naming import make_autoname -from frappe.model.bean import getlist + from frappe.model.code import get_obj from frappe import _, msgprint diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index 066afe02b1..bc6e17f3ce 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import frappe from frappe.utils import cstr, flt -from frappe.model.bean import getlist + from frappe.model.code import get_obj from frappe import msgprint diff --git a/erpnext/hr/doctype/appraisal/appraisal.py b/erpnext/hr/doctype/appraisal/appraisal.py index b7b1421133..1f7f255c8b 100644 --- a/erpnext/hr/doctype/appraisal/appraisal.py +++ b/erpnext/hr/doctype/appraisal/appraisal.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import frappe from frappe.utils import cstr, flt, getdate -from frappe.model.bean import getlist + from frappe import msgprint, _ from frappe.model.mapper import get_mapped_doc from frappe.model.document import Document diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.py b/erpnext/hr/doctype/expense_claim/expense_claim.py index 1d3697be3d..6a1be6e35c 100644 --- a/erpnext/hr/doctype/expense_claim/expense_claim.py +++ b/erpnext/hr/doctype/expense_claim/expense_claim.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import frappe -from frappe.model.bean import getlist + from frappe import msgprint from frappe.model.document import Document diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py index c81f22da28..cfd39fc5e1 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.py +++ b/erpnext/hr/doctype/salary_slip/salary_slip.py @@ -6,7 +6,7 @@ import frappe from frappe.utils import add_days, cint, cstr, flt, getdate, nowdate, _round from frappe.model.naming import make_autoname -from frappe.model.bean import getlist + from frappe.model.code import get_obj from frappe import msgprint, _ from erpnext.setup.utils import get_company_currency diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index e3199f983b..0799a60efa 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import frappe from frappe.utils import cint, cstr, flt, now, nowdate -from frappe.model.bean import getlist + from frappe.model.code import get_obj from frappe import msgprint, _ diff --git a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py index cdda05ed26..fa85eb1d36 100644 --- a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py +++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import frappe from frappe.utils import cstr, flt, cint, nowdate, add_days -from frappe.model.bean import getlist + from frappe.model.code import get_obj from frappe import msgprint, _ diff --git a/erpnext/selling/doctype/installation_note/installation_note.py b/erpnext/selling/doctype/installation_note/installation_note.py index db6d7ec519..91f1a07e93 100644 --- a/erpnext/selling/doctype/installation_note/installation_note.py +++ b/erpnext/selling/doctype/installation_note/installation_note.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import frappe from frappe.utils import cstr, getdate -from frappe.model.bean import getlist + from frappe import msgprint from erpnext.stock.utils import get_valid_serial_nos diff --git a/erpnext/selling/doctype/opportunity/opportunity.py b/erpnext/selling/doctype/opportunity/opportunity.py index 8a103be30f..b9e873dafd 100644 --- a/erpnext/selling/doctype/opportunity/opportunity.py +++ b/erpnext/selling/doctype/opportunity/opportunity.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import frappe from frappe.utils import cstr, cint -from frappe.model.bean import getlist + from frappe import msgprint, _ diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py index bcccdaa411..2730dc5666 100644 --- a/erpnext/selling/doctype/quotation/quotation.py +++ b/erpnext/selling/doctype/quotation/quotation.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import frappe from frappe.utils import cstr -from frappe.model.bean import getlist + from frappe.model.code import get_obj from frappe import _, msgprint diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index ff235b147f..679bffe937 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -6,7 +6,7 @@ import frappe import frappe.utils from frappe.utils import cstr, flt, getdate -from frappe.model.bean import getlist + from frappe.model.code import get_obj from frappe import msgprint from frappe.model.mapper import get_mapped_doc diff --git a/erpnext/setup/doctype/authorization_control/authorization_control.py b/erpnext/setup/doctype/authorization_control/authorization_control.py index 6e2485996a..a50eb2f8c6 100644 --- a/erpnext/setup/doctype/authorization_control/authorization_control.py +++ b/erpnext/setup/doctype/authorization_control/authorization_control.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import frappe from frappe.utils import cstr, flt, has_common, make_esc -from frappe.model.bean import getlist + from frappe import session, msgprint from erpnext.setup.utils import get_company_currency diff --git a/erpnext/setup/doctype/sales_person/sales_person.py b/erpnext/setup/doctype/sales_person/sales_person.py index 9139bab259..db2057db10 100644 --- a/erpnext/setup/doctype/sales_person/sales_person.py +++ b/erpnext/setup/doctype/sales_person/sales_person.py @@ -3,7 +3,7 @@ from __future__ import unicode_literals import frappe -from frappe.model.bean import getlist + from frappe.utils import flt from frappe.utils.nestedset import DocTypeNestedSet diff --git a/erpnext/setup/doctype/territory/territory.py b/erpnext/setup/doctype/territory/territory.py index 67669d9902..ed2d5f1de8 100644 --- a/erpnext/setup/doctype/territory/territory.py +++ b/erpnext/setup/doctype/territory/territory.py @@ -4,7 +4,7 @@ from __future__ import unicode_literals import frappe -from frappe.model.bean import getlist + from frappe.utils import flt from frappe.utils.nestedset import DocTypeNestedSet diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index d48024f081..100a599482 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import frappe from frappe.utils import cstr, flt, cint -from frappe.model.bean import getlist + from frappe.model.code import get_obj from frappe import msgprint, _ import frappe.defaults diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index 9f556db2a1..ea43b167fc 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import frappe from frappe.utils import cstr, flt, getdate, now_datetime, formatdate -from frappe.model.bean import getlist + from frappe import msgprint, _ from frappe.model.controller import DocListController diff --git a/erpnext/stock/doctype/packed_item/packed_item.py b/erpnext/stock/doctype/packed_item/packed_item.py index 6c7ee517bb..232e60149d 100644 --- a/erpnext/stock/doctype/packed_item/packed_item.py +++ b/erpnext/stock/doctype/packed_item/packed_item.py @@ -6,7 +6,7 @@ from __future__ import unicode_literals import frappe from frappe.utils import cstr, flt -from frappe.model.bean import getlist + from frappe.model.document import Document diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py index 74c8cffd43..b1abf123d9 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import frappe from frappe.utils import cstr, flt, cint -from frappe.model.bean import getlist + from frappe.model.code import get_obj from frappe import msgprint, _ import frappe.defaults diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index eeb8d82bd6..25f3157f52 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -6,7 +6,7 @@ import frappe import frappe.defaults from frappe.utils import cstr, cint, flt, comma_or, nowdate -from frappe.model.bean import getlist + from frappe.model.code import get_obj from frappe import msgprint, _ from erpnext.stock.utils import get_incoming_rate diff --git a/erpnext/stock/doctype/stock_ledger/stock_ledger.py b/erpnext/stock/doctype/stock_ledger/stock_ledger.py index d0fe60a7eb..615352fb23 100644 --- a/erpnext/stock/doctype/stock_ledger/stock_ledger.py +++ b/erpnext/stock/doctype/stock_ledger/stock_ledger.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import frappe from frappe.utils import add_days, cstr, flt, nowdate, cint, now -from frappe.model.bean import getlist + from frappe.model.code import get_obj from frappe import session, msgprint from erpnext.stock.utils import get_valid_serial_nos diff --git a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py index 0052ab28e4..b3ed19c1a6 100644 --- a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py +++ b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import frappe from frappe.utils import add_days, cstr, getdate, cint -from frappe.model.bean import getlist + from frappe import throw, _ from erpnext.utilities.transaction_base import TransactionBase, delete_events from erpnext.stock.utils import get_valid_serial_nos diff --git a/erpnext/support/doctype/maintenance_visit/maintenance_visit.py b/erpnext/support/doctype/maintenance_visit/maintenance_visit.py index f8eb96a428..b11d6562c2 100644 --- a/erpnext/support/doctype/maintenance_visit/maintenance_visit.py +++ b/erpnext/support/doctype/maintenance_visit/maintenance_visit.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import frappe from frappe.utils import cstr -from frappe.model.bean import getlist + from frappe import msgprint diff --git a/erpnext/utilities/doctype/sms_control/sms_control.py b/erpnext/utilities/doctype/sms_control/sms_control.py index 74b6e41a3d..d16e54d8cc 100644 --- a/erpnext/utilities/doctype/sms_control/sms_control.py +++ b/erpnext/utilities/doctype/sms_control/sms_control.py @@ -7,7 +7,7 @@ import frappe, json from frappe.utils import nowdate, cstr from frappe.model.code import get_obj from frappe import msgprint, throw, _ -from frappe.model.bean import getlist + from frappe.model.document import Document From 0a0f2495a27585294e129deb60160259f0e72886 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 31 Mar 2014 17:27:06 +0530 Subject: [PATCH 12/42] frappe/frappe#478, frappe tests pass, .txt renamed to .json --- ...Format.txt => Cheque Printing Format.json} | 0 .../{POS Invoice.txt => POS Invoice.json} | 0 ...ucher.txt => Payment Receipt Voucher.json} | 0 ...Classic.txt => Sales Invoice Classic.json} | 0 ...e Modern.txt => Sales Invoice Modern.json} | 0 ...Spartan.txt => Sales Invoice Spartan.json} | 0 .../{SalesInvoice.txt => SalesInvoice.json} | 0 .../account/{account.txt => account.json} | 0 ...ts_settings.txt => accounts_settings.json} | 0 ...ciliation.txt => bank_reconciliation.json} | 0 ...il.txt => bank_reconciliation_detail.json} | 0 .../{budget_detail.txt => budget_detail.json} | 0 ...tribution.txt => budget_distribution.json} | 0 .../test_budget_distribution.py | 49 +- ...il.txt => budget_distribution_detail.json} | 0 .../c_form/{c_form.txt => c_form.json} | 0 ..._detail.txt => c_form_invoice_detail.json} | 0 ...of_accounts.txt => chart_of_accounts.json} | 0 .../{cost_center.txt => cost_center.json} | 0 .../doctype/cost_center/test_cost_center.py | 19 +- .../{fiscal_year.txt => fiscal_year.json} | 0 .../doctype/fiscal_year/fiscal_year.py | 2 +- .../doctype/fiscal_year/test_fiscal_year.py | 33 +- .../gl_entry/{gl_entry.txt => gl_entry.json} | 0 ...urnal_voucher.txt => journal_voucher.json} | 0 .../journal_voucher/test_journal_voucher.py | 95 +--- ...detail.txt => journal_voucher_detail.json} | 0 ...de_of_payment.txt => mode_of_payment.json} | 0 ... => payment_to_invoice_matching_tool.json} | 0 .../test_payment_to_invoice_matching_tool.py | 2 +- ...ment_to_invoice_matching_tool_detail.json} | 0 ...oucher.txt => period_closing_voucher.json} | 0 .../test_period_closing_voucher.py | 6 +- .../{pos_setting.txt => pos_setting.json} | 0 .../doctype/pos_setting/pos_setting.py | 6 +- .../doctype/pos_setting/test_pos_setting.py | 19 +- .../{pricing_rule.txt => pricing_rule.json} | 0 .../doctype/pricing_rule/test_pricing_rule.py | 8 +- ...hase_invoice.txt => purchase_invoice.json} | 0 .../purchase_invoice/purchase_invoice.py | 3 +- .../purchase_invoice/test_purchase_invoice.py | 224 +-------- ...ance.txt => purchase_invoice_advance.json} | 0 ...ce_item.txt => purchase_invoice_item.json} | 0 ...es.txt => purchase_taxes_and_charges.json} | 0 ...=> purchase_taxes_and_charges_master.json} | 0 .../{sales_invoice.txt => sales_invoice.json} | 0 .../doctype/sales_invoice/sales_invoice.py | 3 +- .../sales_invoice/test_sales_invoice.py | 442 ++---------------- ...advance.txt => sales_invoice_advance.json} | 0 ...voice_item.txt => sales_invoice_item.json} | 0 ...arges.txt => sales_taxes_and_charges.json} | 0 ...xt => sales_taxes_and_charges_master.json} | 0 .../test_sales_taxes_and_charges_master.py | 154 +----- .../{shipping_rule.txt => shipping_rule.json} | 0 .../shipping_rule/test_shipping_rule.py | 117 +---- ...ition.txt => shipping_rule_condition.json} | 0 ...unts_browser.txt => accounts_browser.json} | 0 ...analytics.txt => financial_analytics.json} | 0 .../{trial_balance.txt => trial_balance.json} | 0 ...unts_payable.txt => accounts_payable.json} | 0 ...eceivable.txt => accounts_receivable.json} | 0 ...ummary.txt => bank_clearance_summary.json} | 0 ...txt => bank_reconciliation_statement.json} | 0 ...report.txt => budget_variance_report.json} | 0 ...nt_head.txt => customer_account_head.json} | 0 ....txt => delivered_items_to_be_billed.json} | 0 ...general_ledger.txt => general_ledger.json} | 0 .../{gross_profit.txt => gross_profit.json} | 0 ...r.txt => item_wise_purchase_register.json} | 0 ...ster.txt => item_wise_sales_register.json} | 0 ...ed.txt => ordered_items_to_be_billed.json} | 0 ...payment_period_based_on_invoice_date.json} | 0 ...rends.txt => purchase_invoice_trends.json} | 0 ...=> purchase_order_items_to_be_billed.json} | 0 ...se_register.txt => purchase_register.json} | 0 ...d.txt => received_items_to_be_billed.json} | 0 ...e_trends.txt => sales_invoice_trends.json} | 0 ...ion.txt => sales_partners_commission.json} | 0 ...sales_register.txt => sales_register.json} | 0 ...nt_head.txt => supplier_account_head.json} | 0 erpnext/accounts/utils.py | 4 +- ...lassic.txt => Purchase Order Classic.json} | 0 ... Modern.txt => Purchase Order Modern.json} | 0 ...partan.txt => Purchase Order Spartan.json} | 0 ...ying_settings.txt => buying_settings.json} | 0 ...rchase_common.txt => purchase_common.json} | 0 ...purchase_order.txt => purchase_order.json} | 0 .../doctype/purchase_order/purchase_order.py | 13 +- .../purchase_order/test_purchase_order.py | 48 +- ...rder_item.txt => purchase_order_item.json} | 0 ....txt => purchase_order_item_supplied.json} | 0 ...xt => purchase_receipt_item_supplied.json} | 0 ...inspection.txt => quality_inspection.json} | 0 ...ng.txt => quality_inspection_reading.json} | 0 .../supplier/{supplier.txt => supplier.json} | 0 .../buying/doctype/supplier/test_supplier.py | 11 +- ..._quotation.txt => supplier_quotation.json} | 0 .../supplier_quotation/supplier_quotation.py | 3 +- .../test_supplier_quotation.py | 35 +- ..._item.txt => supplier_quotation_item.json} | 0 ..._analytics.txt => purchase_analytics.json} | 0 ...ry.txt => item_wise_purchase_history.json} | 0 ..._trends.txt => purchase_order_trends.json} | 0 ...txt => requested_items_to_be_ordered.json} | 0 ...t => supplier_addresses_and_contacts.json} | 0 erpnext/controllers/accounts_controller.py | 3 +- erpnext/controllers/status_updater.py | 3 +- erpnext/controllers/stock_controller.py | 4 +- .../home/doctype/feed/{feed.txt => feed.json} | 0 .../activity/{activity.txt => activity.json} | 0 .../{appraisal.txt => appraisal.json} | 0 ...appraisal_goal.txt => appraisal_goal.json} | 0 ...l_template.txt => appraisal_template.json} | 0 ..._goal.txt => appraisal_template_goal.json} | 0 .../{attendance.txt => attendance.json} | 0 .../branch/{branch.txt => branch.json} | 0 erpnext/hr/doctype/branch/test_branch.py | 4 +- ...deduction_type.txt => deduction_type.json} | 0 .../deduction_type/test_deduction_type.py | 13 +- .../{department.txt => department.json} | 0 .../hr/doctype/department/test_department.py | 7 +- .../{designation.txt => designation.json} | 0 .../doctype/designation/test_designation.py | 4 +- .../{earning_type.txt => earning_type.json} | 0 .../doctype/earning_type/test_earning_type.py | 15 +- .../employee/{employee.txt => employee.json} | 0 erpnext/hr/doctype/employee/test_employee.py | 40 +- ..._education.txt => employee_education.json} | 0 ...xt => employee_external_work_history.json} | 0 ...xt => employee_internal_work_history.json} | 0 ...rover.txt => employee_leave_approver.json} | 0 ...ployment_type.txt => employment_type.json} | 0 .../employment_type/test_employment_type.py | 5 +- .../{expense_claim.txt => expense_claim.json} | 0 ...m_detail.txt => expense_claim_detail.json} | 0 ...claim_type.txt => expense_claim_type.json} | 0 .../doctype/grade/{grade.txt => grade.json} | 0 erpnext/hr/doctype/grade/test_grade.py | 4 +- .../holiday/{holiday.txt => holiday.json} | 0 .../{holiday_list.txt => holiday_list.json} | 0 .../doctype/holiday_list/test_holiday_list.py | 16 +- .../{hr_settings.txt => hr_settings.json} | 0 erpnext/hr/doctype/hr_settings/hr_settings.py | 2 +- .../{job_applicant.txt => job_applicant.json} | 0 .../{job_opening.txt => job_opening.json} | 0 ...e_allocation.txt => leave_allocation.json} | 0 ...application.txt => leave_application.json} | 0 .../test_leave_application.py | 49 +- ...e_block_list.txt => leave_block_list.json} | 0 .../leave_block_list/test_leave_block_list.py | 21 +- ..._allow.txt => leave_block_list_allow.json} | 0 ...st_date.txt => leave_block_list_date.json} | 0 ...rol_panel.txt => leave_control_panel.json} | 0 .../leave_control_panel.py | 1 - .../{leave_type.txt => leave_type.json} | 0 .../hr/doctype/leave_type/test_leave_type.py | 14 +- ...salary_manager.txt => salary_manager.json} | 0 .../doctype/salary_manager/salary_manager.py | 3 +- .../{salary_slip.txt => salary_slip.json} | 0 erpnext/hr/doctype/salary_slip/salary_slip.py | 3 +- .../doctype/salary_slip/test_salary_slip.py | 49 +- ...duction.txt => salary_slip_deduction.json} | 0 ...p_earning.txt => salary_slip_earning.json} | 0 ...ry_structure.txt => salary_structure.json} | 0 ...on.txt => salary_structure_deduction.json} | 0 ...ning.txt => salary_structure_earning.json} | 0 ..._attendance.txt => upload_attendance.json} | 0 .../upload_attendance/upload_attendance.py | 13 +- ...ee_birthday.txt => employee_birthday.json} | 0 ...ormation.txt => employee_information.json} | 0 ...alance.txt => employee_leave_balance.json} | 0 ...heet.txt => monthly_attendance_sheet.json} | 0 ...ister.txt => monthly_salary_register.json} | 0 .../doctype/bom/{bom.txt => bom.json} | 0 erpnext/manufacturing/doctype/bom/bom.py | 3 +- erpnext/manufacturing/doctype/bom/test_bom.py | 93 +--- ...osion_item.txt => bom_explosion_item.json} | 0 .../bom_item/{bom_item.txt => bom_item.json} | 0 .../{bom_operation.txt => bom_operation.json} | 0 ...replace_tool.txt => bom_replace_tool.json} | 0 .../bom_replace_tool/bom_replace_tool.py | 3 +- ...uction_order.txt => production_order.json} | 0 .../production_order/production_order.py | 1 - .../production_order/test_production_order.py | 21 +- ...lan_item.txt => production_plan_item.json} | 0 ...r.txt => production_plan_sales_order.json} | 0 ...tool.txt => production_planning_tool.json} | 0 .../production_planning_tool.py | 1 - .../{workstation.txt => workstation.json} | 0 ...s.txt => completed_production_orders.json} | 0 ...ssued_items_against_production_order.json} | 0 ...orders.txt => open_production_orders.json} | 0 ...txt => production_orders_in_progress.json} | 0 erpnext/patches/4_0/update_user_properties.py | 3 +- .../{activity_type.txt => activity_type.json} | 0 .../activity_type/test_activity_type.py | 8 +- .../project/{project.txt => project.json} | 0 .../projects/doctype/project/test_project.py | 11 +- ...t_milestone.txt => project_milestone.json} | 0 .../doctype/task/{task.txt => task.json} | 0 erpnext/projects/doctype/task/test_task.py | 8 +- .../doctype/time_log/test_time_log.py | 11 +- .../time_log/{time_log.txt => time_log.json} | 0 .../time_log_batch/test_time_log_batch.py | 17 +- ...time_log_batch.txt => time_log_batch.json} | 0 ..._detail.txt => time_log_batch_detail.json} | 0 ...ummary.txt => daily_time_log_summary.json} | 0 ...g.txt => project_wise_stock_tracking.json} | 0 ...ion Classic.txt => Quotation Classic.json} | 0 ...ation Modern.txt => Quotation Modern.json} | 0 ...ion Spartan.txt => Quotation Spartan.json} | 0 ...r Classic.txt => Sales Order Classic.json} | 0 ...der Modern.txt => Sales Order Modern.json} | 0 ...r Spartan.txt => Sales Order Spartan.json} | 0 .../campaign/{campaign.txt => campaign.json} | 0 .../selling/doctype/campaign/test_campaign.py | 7 +- .../customer/{customer.txt => customer.json} | 0 .../selling/doctype/customer/test_customer.py | 27 +- .../{industry_type.txt => industry_type.json} | 0 .../industry_type/test_industry_type.py | 7 +- ...lation_note.txt => installation_note.json} | 0 ...e_item.txt => installation_note_item.json} | 0 .../doctype/lead/{lead.txt => lead.json} | 0 erpnext/selling/doctype/lead/test_lead.py | 14 +- .../{opportunity.txt => opportunity.json} | 0 ...rtunity_item.txt => opportunity_item.json} | 0 .../{quotation.txt => quotation.json} | 0 .../selling/doctype/quotation/quotation.py | 3 +- .../doctype/quotation/test_quotation.py | 37 +- ...quotation_item.txt => quotation_item.json} | 0 .../{sales_bom.txt => sales_bom.json} | 0 .../doctype/sales_bom/test_sales_bom.py | 23 +- ...sales_bom_item.txt => sales_bom_item.json} | 0 .../{sales_order.txt => sales_order.json} | 0 .../doctype/sales_order/sales_order.py | 3 +- .../doctype/sales_order/test_sales_order.py | 47 +- ...s_order_item.txt => sales_order_item.json} | 0 .../{sales_team.txt => sales_team.json} | 0 ...ing_settings.txt => selling_settings.json} | 0 .../{sms_center.txt => sms_center.json} | 0 .../selling/doctype/sms_center/sms_center.py | 3 +- ...les_analytics.txt => sales_analytics.json} | 0 .../{sales_browser.txt => sales_browser.json} | 0 .../{sales_funnel.txt => sales_funnel.json} | 0 ...=> available_stock_for_packing_items.json} | 0 ... => customer_acquisition_and_loyalty.json} | 0 ...t => customer_addresses_and_contacts.json} | 0 ...customers_not_buying_since_long_time.json} | 0 ...story.txt => item_wise_sales_history.json} | 0 .../{lead_details.txt => lead_details.json} | 0 ...ending_so_items_for_purchase_request.json} | 0 ...ation_trends.txt => quotation_trends.json} | 0 ...der_trends.txt => sales_order_trends.json} | 0 ...rson_target_variance_item_group_wise.json} | 0 ...ales_person_wise_transaction_summary.json} | 0 ...tory_target_variance_item_group_wise.json} | 0 ...erritory.txt => applicable_territory.json} | 0 ...control.txt => authorization_control.json} | 0 ...ation_rule.txt => authorization_rule.json} | 0 ...backup_manager.txt => backup_manager.json} | 0 .../doctype/brand/{brand.txt => brand.json} | 0 erpnext/setup/doctype/brand/test_brand.py | 9 +- .../company/{company.txt => company.json} | 0 erpnext/setup/doctype/company/test_company.py | 17 +- ...ntact_control.txt => contact_control.json} | 0 .../country/{country.txt => country.json} | 0 erpnext/setup/doctype/country/test_country.py | 9 +- .../currency/{currency.txt => currency.json} | 0 .../setup/doctype/currency/test_currency.py | 4 +- ...cy_exchange.txt => currency_exchange.json} | 0 .../test_currency_exchange.py | 23 +- ...customer_group.txt => customer_group.json} | 0 .../customer_group/test_customer_group.py | 11 +- .../{email_digest.txt => email_digest.json} | 0 .../doctype/email_digest/email_digest.py | 5 +- ...features_setup.txt => features_setup.json} | 0 ...obal_defaults.txt => global_defaults.json} | 0 .../{item_group.txt => item_group.json} | 0 .../doctype/item_group/test_item_group.py | 75 +-- ..._settings.txt => jobs_email_settings.json} | 0 .../{naming_series.txt => naming_series.json} | 0 .../doctype/naming_series/naming_series.py | 10 +- ..._control.txt => notification_control.json} | 0 .../{print_heading.txt => print_heading.json} | 0 .../print_heading/test_print_heading.py | 4 +- ..._reason.txt => quotation_lost_reason.json} | 0 .../test_quotation_lost_reason.py | 4 +- ...settings.txt => sales_email_settings.json} | 0 .../{sales_partner.txt => sales_partner.json} | 0 .../sales_partner/test_sales_partner.py | 4 +- .../{sales_person.txt => sales_person.json} | 0 .../doctype/sales_person/test_sales_person.py | 28 +- .../{sms_parameter.txt => sms_parameter.json} | 0 .../{sms_settings.txt => sms_settings.json} | 0 .../{supplier_type.txt => supplier_type.json} | 0 .../supplier_type/test_supplier_type.py | 9 +- .../{target_detail.txt => target_detail.json} | 0 ...nditions.txt => terms_and_conditions.json} | 0 .../test_terms_and_conditions.py | 4 +- .../{territory.txt => territory.json} | 0 .../setup/doctype/territory/test_territory.py | 35 +- erpnext/setup/doctype/uom/test_uom.py | 14 +- .../setup/doctype/uom/{uom.txt => uom.json} | 0 ...item_group.txt => website_item_group.json} | 0 .../{setup_wizard.txt => setup_wizard.json} | 0 erpnext/startup/boot.py | 2 - ...Classic.txt => Delivery Note Classic.json} | 0 ...e Modern.txt => Delivery Note Modern.json} | 0 ...t => Delivery Note Packing List Wise.json} | 0 ...Spartan.txt => Delivery Note Spartan.json} | 0 .../doctype/batch/{batch.txt => batch.json} | 0 .../stock/doctype/bin/{bin.txt => bin.json} | 0 .../{delivery_note.txt => delivery_note.json} | 0 .../doctype/delivery_note/delivery_note.py | 3 +- .../delivery_note/test_delivery_note.py | 57 +-- ..._note_item.txt => delivery_note_item.json} | 0 .../doctype/item/{item.txt => item.json} | 0 erpnext/stock/doctype/item/test_item.py | 246 +--------- ...r_detail.txt => item_customer_detail.json} | 0 .../{item_price.txt => item_price.json} | 0 .../doctype/item_price/test_item_price.py | 13 +- ...=> item_quality_inspection_parameter.json} | 0 .../{item_reorder.txt => item_reorder.json} | 0 .../{item_supplier.txt => item_supplier.json} | 0 .../item_tax/{item_tax.txt => item_tax.json} | 0 ...on.txt => item_website_specification.json} | 0 ...ed_cost_item.txt => landed_cost_item.json} | 0 ....txt => landed_cost_purchase_receipt.json} | 0 ...ost_wizard.txt => landed_cost_wizard.json} | 0 ...rial_request.txt => material_request.json} | 0 .../material_request/material_request.py | 7 +- .../material_request/test_material_request.py | 65 +-- ...st_item.txt => material_request_item.json} | 0 .../{packed_item.txt => packed_item.json} | 0 .../{packing_slip.txt => packing_slip.json} | 0 ...g_slip_item.txt => packing_slip_item.json} | 0 .../{price_list.txt => price_list.json} | 0 .../doctype/price_list/test_price_list.py | 68 +-- ...hase_receipt.txt => purchase_receipt.json} | 0 .../purchase_receipt/purchase_receipt.py | 11 +- .../purchase_receipt/test_purchase_receipt.py | 127 +---- ...pt_item.txt => purchase_receipt_item.json} | 0 .../{serial_no.txt => serial_no.json} | 0 .../stock/doctype/serial_no/test_serial_no.py | 2 +- .../{stock_entry.txt => stock_entry.json} | 0 .../stock/doctype/stock_entry/stock_entry.py | 7 +- .../doctype/stock_entry/test_stock_entry.py | 192 ++------ ...try_detail.txt => stock_entry_detail.json} | 0 .../doctype/stock_ledger/stock_ledger.py | 5 +- ...dger_entry.txt => stock_ledger_entry.json} | 0 ...iliation.txt => stock_reconciliation.json} | 0 .../test_stock_reconciliation.py | 10 +- ...stock_settings.txt => stock_settings.json} | 0 ...ity.txt => stock_uom_replace_utility.json} | 0 ..._detail.txt => uom_conversion_detail.json} | 0 .../stock/doctype/warehouse/test_warehouse.py | 28 +- .../{warehouse.txt => warehouse.json} | 0 ...warehouse_user.txt => warehouse_user.json} | 0 erpnext/stock/get_item_details.py | 3 +- .../{stock_ageing.txt => stock_ageing.json} | 0 ...ock_analytics.txt => stock_analytics.json} | 0 .../{stock_balance.txt => stock_balance.json} | 0 .../{stock_ledger.txt => stock_ledger.json} | 0 .../{stock_level.txt => stock_level.json} | 0 ...ry.txt => batch_wise_balance_history.json} | 0 ...e_trends.txt => delivery_note_trends.json} | 0 .../{item_prices.txt => item_prices.json} | 0 ...e_report.txt => item_shortage_report.json} | 0 ...ate.txt => item_wise_price_list_rate.json} | 0 ...quested.txt => items_to_be_requested.json} | 0 ...> itemwise_recommended_reorder_level.json} | 0 ..._supplier_quotations_are_not_created.json} | 0 ...txt => ordered_items_to_be_delivered.json} | 0 ...n_transit.txt => purchase_in_transit.json} | 0 ... purchase_order_items_to_be_received.json} | 0 ...rends.txt => purchase_receipt_trends.json} | 0 ...=> requested_items_to_be_transferred.json} | 0 ...=> serial_no_service_contract_expiry.json} | 0 ...al_no_status.txt => serial_no_status.json} | 0 ...iry.txt => serial_no_warranty_expiry.json} | 0 .../{stock_ageing.txt => stock_ageing.json} | 0 .../{stock_ledger.txt => stock_ledger.json} | 0 ...ected_qty.txt => stock_projected_qty.json} | 0 ...txt => supplier_wise_sales_analytics.json} | 0 ....txt => warehouse_wise_stock_balance.json} | 0 erpnext/stock/utils.py | 3 +- ...customer_issue.txt => customer_issue.json} | 0 ...schedule.txt => maintenance_schedule.json} | 0 ...l.txt => maintenance_schedule_detail.json} | 0 ...tem.txt => maintenance_schedule_item.json} | 0 ...nance_visit.txt => maintenance_visit.json} | 0 ...ose.txt => maintenance_visit_purpose.json} | 0 .../{newsletter.txt => newsletter.json} | 0 .../support/doctype/newsletter/newsletter.py | 2 +- .../doctype/newsletter/test_newsletter.py | 27 +- ...ttings.txt => support_email_settings.json} | 0 ...support_ticket.txt => support_ticket.json} | 0 ...t_analytics.txt => support_analytics.json} | 0 ...hedules.txt => maintenance_schedules.json} | 0 erpnext/utilities/cleanup_data.py | 3 +- .../address/{address.txt => address.json} | 0 .../utilities/doctype/address/test_address.py | 17 +- .../contact/{contact.txt => contact.json} | 0 .../utilities/doctype/contact/test_contact.py | 25 +- .../doctype/note/{note.txt => note.json} | 0 .../{note_user.txt => note_user.json} | 0 .../{rename_tool.txt => rename_tool.json} | 0 .../{sms_control.txt => sms_control.json} | 0 .../doctype/sms_control/sms_control.py | 3 +- .../sms_log/{sms_log.txt => sms_log.json} | 0 410 files changed, 347 insertions(+), 2764 deletions(-) rename erpnext/accounts/Print Format/Cheque Printing Format/{Cheque Printing Format.txt => Cheque Printing Format.json} (100%) rename erpnext/accounts/Print Format/POS Invoice/{POS Invoice.txt => POS Invoice.json} (100%) rename erpnext/accounts/Print Format/Payment Receipt Voucher/{Payment Receipt Voucher.txt => Payment Receipt Voucher.json} (100%) rename erpnext/accounts/Print Format/Sales Invoice Classic/{Sales Invoice Classic.txt => Sales Invoice Classic.json} (100%) rename erpnext/accounts/Print Format/Sales Invoice Modern/{Sales Invoice Modern.txt => Sales Invoice Modern.json} (100%) rename erpnext/accounts/Print Format/Sales Invoice Spartan/{Sales Invoice Spartan.txt => Sales Invoice Spartan.json} (100%) rename erpnext/accounts/Print Format/SalesInvoice/{SalesInvoice.txt => SalesInvoice.json} (100%) rename erpnext/accounts/doctype/account/{account.txt => account.json} (100%) rename erpnext/accounts/doctype/accounts_settings/{accounts_settings.txt => accounts_settings.json} (100%) rename erpnext/accounts/doctype/bank_reconciliation/{bank_reconciliation.txt => bank_reconciliation.json} (100%) rename erpnext/accounts/doctype/bank_reconciliation_detail/{bank_reconciliation_detail.txt => bank_reconciliation_detail.json} (100%) rename erpnext/accounts/doctype/budget_detail/{budget_detail.txt => budget_detail.json} (100%) rename erpnext/accounts/doctype/budget_distribution/{budget_distribution.txt => budget_distribution.json} (100%) rename erpnext/accounts/doctype/budget_distribution_detail/{budget_distribution_detail.txt => budget_distribution_detail.json} (100%) rename erpnext/accounts/doctype/c_form/{c_form.txt => c_form.json} (100%) rename erpnext/accounts/doctype/c_form_invoice_detail/{c_form_invoice_detail.txt => c_form_invoice_detail.json} (100%) rename erpnext/accounts/doctype/chart_of_accounts/{chart_of_accounts.txt => chart_of_accounts.json} (100%) rename erpnext/accounts/doctype/cost_center/{cost_center.txt => cost_center.json} (100%) rename erpnext/accounts/doctype/fiscal_year/{fiscal_year.txt => fiscal_year.json} (100%) rename erpnext/accounts/doctype/gl_entry/{gl_entry.txt => gl_entry.json} (100%) rename erpnext/accounts/doctype/journal_voucher/{journal_voucher.txt => journal_voucher.json} (100%) rename erpnext/accounts/doctype/journal_voucher_detail/{journal_voucher_detail.txt => journal_voucher_detail.json} (100%) rename erpnext/accounts/doctype/mode_of_payment/{mode_of_payment.txt => mode_of_payment.json} (100%) rename erpnext/accounts/doctype/payment_to_invoice_matching_tool/{payment_to_invoice_matching_tool.txt => payment_to_invoice_matching_tool.json} (100%) rename erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/{payment_to_invoice_matching_tool_detail.txt => payment_to_invoice_matching_tool_detail.json} (100%) rename erpnext/accounts/doctype/period_closing_voucher/{period_closing_voucher.txt => period_closing_voucher.json} (100%) rename erpnext/accounts/doctype/pos_setting/{pos_setting.txt => pos_setting.json} (100%) rename erpnext/accounts/doctype/pricing_rule/{pricing_rule.txt => pricing_rule.json} (100%) rename erpnext/accounts/doctype/purchase_invoice/{purchase_invoice.txt => purchase_invoice.json} (100%) rename erpnext/accounts/doctype/purchase_invoice_advance/{purchase_invoice_advance.txt => purchase_invoice_advance.json} (100%) rename erpnext/accounts/doctype/purchase_invoice_item/{purchase_invoice_item.txt => purchase_invoice_item.json} (100%) rename erpnext/accounts/doctype/purchase_taxes_and_charges/{purchase_taxes_and_charges.txt => purchase_taxes_and_charges.json} (100%) rename erpnext/accounts/doctype/purchase_taxes_and_charges_master/{purchase_taxes_and_charges_master.txt => purchase_taxes_and_charges_master.json} (100%) rename erpnext/accounts/doctype/sales_invoice/{sales_invoice.txt => sales_invoice.json} (100%) rename erpnext/accounts/doctype/sales_invoice_advance/{sales_invoice_advance.txt => sales_invoice_advance.json} (100%) rename erpnext/accounts/doctype/sales_invoice_item/{sales_invoice_item.txt => sales_invoice_item.json} (100%) rename erpnext/accounts/doctype/sales_taxes_and_charges/{sales_taxes_and_charges.txt => sales_taxes_and_charges.json} (100%) rename erpnext/accounts/doctype/sales_taxes_and_charges_master/{sales_taxes_and_charges_master.txt => sales_taxes_and_charges_master.json} (100%) rename erpnext/accounts/doctype/shipping_rule/{shipping_rule.txt => shipping_rule.json} (100%) rename erpnext/accounts/doctype/shipping_rule_condition/{shipping_rule_condition.txt => shipping_rule_condition.json} (100%) rename erpnext/accounts/page/accounts_browser/{accounts_browser.txt => accounts_browser.json} (100%) rename erpnext/accounts/page/financial_analytics/{financial_analytics.txt => financial_analytics.json} (100%) rename erpnext/accounts/page/trial_balance/{trial_balance.txt => trial_balance.json} (100%) rename erpnext/accounts/report/accounts_payable/{accounts_payable.txt => accounts_payable.json} (100%) rename erpnext/accounts/report/accounts_receivable/{accounts_receivable.txt => accounts_receivable.json} (100%) rename erpnext/accounts/report/bank_clearance_summary/{bank_clearance_summary.txt => bank_clearance_summary.json} (100%) rename erpnext/accounts/report/bank_reconciliation_statement/{bank_reconciliation_statement.txt => bank_reconciliation_statement.json} (100%) rename erpnext/accounts/report/budget_variance_report/{budget_variance_report.txt => budget_variance_report.json} (100%) rename erpnext/accounts/report/customer_account_head/{customer_account_head.txt => customer_account_head.json} (100%) rename erpnext/accounts/report/delivered_items_to_be_billed/{delivered_items_to_be_billed.txt => delivered_items_to_be_billed.json} (100%) rename erpnext/accounts/report/general_ledger/{general_ledger.txt => general_ledger.json} (100%) rename erpnext/accounts/report/gross_profit/{gross_profit.txt => gross_profit.json} (100%) rename erpnext/accounts/report/item_wise_purchase_register/{item_wise_purchase_register.txt => item_wise_purchase_register.json} (100%) rename erpnext/accounts/report/item_wise_sales_register/{item_wise_sales_register.txt => item_wise_sales_register.json} (100%) rename erpnext/accounts/report/ordered_items_to_be_billed/{ordered_items_to_be_billed.txt => ordered_items_to_be_billed.json} (100%) rename erpnext/accounts/report/payment_period_based_on_invoice_date/{payment_period_based_on_invoice_date.txt => payment_period_based_on_invoice_date.json} (100%) rename erpnext/accounts/report/purchase_invoice_trends/{purchase_invoice_trends.txt => purchase_invoice_trends.json} (100%) rename erpnext/accounts/report/purchase_order_items_to_be_billed/{purchase_order_items_to_be_billed.txt => purchase_order_items_to_be_billed.json} (100%) rename erpnext/accounts/report/purchase_register/{purchase_register.txt => purchase_register.json} (100%) rename erpnext/accounts/report/received_items_to_be_billed/{received_items_to_be_billed.txt => received_items_to_be_billed.json} (100%) rename erpnext/accounts/report/sales_invoice_trends/{sales_invoice_trends.txt => sales_invoice_trends.json} (100%) rename erpnext/accounts/report/sales_partners_commission/{sales_partners_commission.txt => sales_partners_commission.json} (100%) rename erpnext/accounts/report/sales_register/{sales_register.txt => sales_register.json} (100%) rename erpnext/accounts/report/supplier_account_head/{supplier_account_head.txt => supplier_account_head.json} (100%) rename erpnext/buying/Print Format/Purchase Order Classic/{Purchase Order Classic.txt => Purchase Order Classic.json} (100%) rename erpnext/buying/Print Format/Purchase Order Modern/{Purchase Order Modern.txt => Purchase Order Modern.json} (100%) rename erpnext/buying/Print Format/Purchase Order Spartan/{Purchase Order Spartan.txt => Purchase Order Spartan.json} (100%) rename erpnext/buying/doctype/buying_settings/{buying_settings.txt => buying_settings.json} (100%) rename erpnext/buying/doctype/purchase_common/{purchase_common.txt => purchase_common.json} (100%) rename erpnext/buying/doctype/purchase_order/{purchase_order.txt => purchase_order.json} (100%) rename erpnext/buying/doctype/purchase_order_item/{purchase_order_item.txt => purchase_order_item.json} (100%) rename erpnext/buying/doctype/purchase_order_item_supplied/{purchase_order_item_supplied.txt => purchase_order_item_supplied.json} (100%) rename erpnext/buying/doctype/purchase_receipt_item_supplied/{purchase_receipt_item_supplied.txt => purchase_receipt_item_supplied.json} (100%) rename erpnext/buying/doctype/quality_inspection/{quality_inspection.txt => quality_inspection.json} (100%) rename erpnext/buying/doctype/quality_inspection_reading/{quality_inspection_reading.txt => quality_inspection_reading.json} (100%) rename erpnext/buying/doctype/supplier/{supplier.txt => supplier.json} (100%) rename erpnext/buying/doctype/supplier_quotation/{supplier_quotation.txt => supplier_quotation.json} (100%) rename erpnext/buying/doctype/supplier_quotation_item/{supplier_quotation_item.txt => supplier_quotation_item.json} (100%) rename erpnext/buying/page/purchase_analytics/{purchase_analytics.txt => purchase_analytics.json} (100%) rename erpnext/buying/report/item_wise_purchase_history/{item_wise_purchase_history.txt => item_wise_purchase_history.json} (100%) rename erpnext/buying/report/purchase_order_trends/{purchase_order_trends.txt => purchase_order_trends.json} (100%) rename erpnext/buying/report/requested_items_to_be_ordered/{requested_items_to_be_ordered.txt => requested_items_to_be_ordered.json} (100%) rename erpnext/buying/report/supplier_addresses_and_contacts/{supplier_addresses_and_contacts.txt => supplier_addresses_and_contacts.json} (100%) rename erpnext/home/doctype/feed/{feed.txt => feed.json} (100%) rename erpnext/home/page/activity/{activity.txt => activity.json} (100%) rename erpnext/hr/doctype/appraisal/{appraisal.txt => appraisal.json} (100%) rename erpnext/hr/doctype/appraisal_goal/{appraisal_goal.txt => appraisal_goal.json} (100%) rename erpnext/hr/doctype/appraisal_template/{appraisal_template.txt => appraisal_template.json} (100%) rename erpnext/hr/doctype/appraisal_template_goal/{appraisal_template_goal.txt => appraisal_template_goal.json} (100%) rename erpnext/hr/doctype/attendance/{attendance.txt => attendance.json} (100%) rename erpnext/hr/doctype/branch/{branch.txt => branch.json} (100%) rename erpnext/hr/doctype/deduction_type/{deduction_type.txt => deduction_type.json} (100%) rename erpnext/hr/doctype/department/{department.txt => department.json} (100%) rename erpnext/hr/doctype/designation/{designation.txt => designation.json} (100%) rename erpnext/hr/doctype/earning_type/{earning_type.txt => earning_type.json} (100%) rename erpnext/hr/doctype/employee/{employee.txt => employee.json} (100%) rename erpnext/hr/doctype/employee_education/{employee_education.txt => employee_education.json} (100%) rename erpnext/hr/doctype/employee_external_work_history/{employee_external_work_history.txt => employee_external_work_history.json} (100%) rename erpnext/hr/doctype/employee_internal_work_history/{employee_internal_work_history.txt => employee_internal_work_history.json} (100%) rename erpnext/hr/doctype/employee_leave_approver/{employee_leave_approver.txt => employee_leave_approver.json} (100%) rename erpnext/hr/doctype/employment_type/{employment_type.txt => employment_type.json} (100%) rename erpnext/hr/doctype/expense_claim/{expense_claim.txt => expense_claim.json} (100%) rename erpnext/hr/doctype/expense_claim_detail/{expense_claim_detail.txt => expense_claim_detail.json} (100%) rename erpnext/hr/doctype/expense_claim_type/{expense_claim_type.txt => expense_claim_type.json} (100%) rename erpnext/hr/doctype/grade/{grade.txt => grade.json} (100%) rename erpnext/hr/doctype/holiday/{holiday.txt => holiday.json} (100%) rename erpnext/hr/doctype/holiday_list/{holiday_list.txt => holiday_list.json} (100%) rename erpnext/hr/doctype/hr_settings/{hr_settings.txt => hr_settings.json} (100%) rename erpnext/hr/doctype/job_applicant/{job_applicant.txt => job_applicant.json} (100%) rename erpnext/hr/doctype/job_opening/{job_opening.txt => job_opening.json} (100%) rename erpnext/hr/doctype/leave_allocation/{leave_allocation.txt => leave_allocation.json} (100%) rename erpnext/hr/doctype/leave_application/{leave_application.txt => leave_application.json} (100%) rename erpnext/hr/doctype/leave_block_list/{leave_block_list.txt => leave_block_list.json} (100%) rename erpnext/hr/doctype/leave_block_list_allow/{leave_block_list_allow.txt => leave_block_list_allow.json} (100%) rename erpnext/hr/doctype/leave_block_list_date/{leave_block_list_date.txt => leave_block_list_date.json} (100%) rename erpnext/hr/doctype/leave_control_panel/{leave_control_panel.txt => leave_control_panel.json} (100%) rename erpnext/hr/doctype/leave_type/{leave_type.txt => leave_type.json} (100%) rename erpnext/hr/doctype/salary_manager/{salary_manager.txt => salary_manager.json} (100%) rename erpnext/hr/doctype/salary_slip/{salary_slip.txt => salary_slip.json} (100%) rename erpnext/hr/doctype/salary_slip_deduction/{salary_slip_deduction.txt => salary_slip_deduction.json} (100%) rename erpnext/hr/doctype/salary_slip_earning/{salary_slip_earning.txt => salary_slip_earning.json} (100%) rename erpnext/hr/doctype/salary_structure/{salary_structure.txt => salary_structure.json} (100%) rename erpnext/hr/doctype/salary_structure_deduction/{salary_structure_deduction.txt => salary_structure_deduction.json} (100%) rename erpnext/hr/doctype/salary_structure_earning/{salary_structure_earning.txt => salary_structure_earning.json} (100%) rename erpnext/hr/doctype/upload_attendance/{upload_attendance.txt => upload_attendance.json} (100%) rename erpnext/hr/report/employee_birthday/{employee_birthday.txt => employee_birthday.json} (100%) rename erpnext/hr/report/employee_information/{employee_information.txt => employee_information.json} (100%) rename erpnext/hr/report/employee_leave_balance/{employee_leave_balance.txt => employee_leave_balance.json} (100%) rename erpnext/hr/report/monthly_attendance_sheet/{monthly_attendance_sheet.txt => monthly_attendance_sheet.json} (100%) rename erpnext/hr/report/monthly_salary_register/{monthly_salary_register.txt => monthly_salary_register.json} (100%) rename erpnext/manufacturing/doctype/bom/{bom.txt => bom.json} (100%) rename erpnext/manufacturing/doctype/bom_explosion_item/{bom_explosion_item.txt => bom_explosion_item.json} (100%) rename erpnext/manufacturing/doctype/bom_item/{bom_item.txt => bom_item.json} (100%) rename erpnext/manufacturing/doctype/bom_operation/{bom_operation.txt => bom_operation.json} (100%) rename erpnext/manufacturing/doctype/bom_replace_tool/{bom_replace_tool.txt => bom_replace_tool.json} (100%) rename erpnext/manufacturing/doctype/production_order/{production_order.txt => production_order.json} (100%) rename erpnext/manufacturing/doctype/production_plan_item/{production_plan_item.txt => production_plan_item.json} (100%) rename erpnext/manufacturing/doctype/production_plan_sales_order/{production_plan_sales_order.txt => production_plan_sales_order.json} (100%) rename erpnext/manufacturing/doctype/production_planning_tool/{production_planning_tool.txt => production_planning_tool.json} (100%) rename erpnext/manufacturing/doctype/workstation/{workstation.txt => workstation.json} (100%) rename erpnext/manufacturing/report/completed_production_orders/{completed_production_orders.txt => completed_production_orders.json} (100%) rename erpnext/manufacturing/report/issued_items_against_production_order/{issued_items_against_production_order.txt => issued_items_against_production_order.json} (100%) rename erpnext/manufacturing/report/open_production_orders/{open_production_orders.txt => open_production_orders.json} (100%) rename erpnext/manufacturing/report/production_orders_in_progress/{production_orders_in_progress.txt => production_orders_in_progress.json} (100%) rename erpnext/projects/doctype/activity_type/{activity_type.txt => activity_type.json} (100%) rename erpnext/projects/doctype/project/{project.txt => project.json} (100%) rename erpnext/projects/doctype/project_milestone/{project_milestone.txt => project_milestone.json} (100%) rename erpnext/projects/doctype/task/{task.txt => task.json} (100%) rename erpnext/projects/doctype/time_log/{time_log.txt => time_log.json} (100%) rename erpnext/projects/doctype/time_log_batch/{time_log_batch.txt => time_log_batch.json} (100%) rename erpnext/projects/doctype/time_log_batch_detail/{time_log_batch_detail.txt => time_log_batch_detail.json} (100%) rename erpnext/projects/report/daily_time_log_summary/{daily_time_log_summary.txt => daily_time_log_summary.json} (100%) rename erpnext/projects/report/project_wise_stock_tracking/{project_wise_stock_tracking.txt => project_wise_stock_tracking.json} (100%) rename erpnext/selling/Print Format/Quotation Classic/{Quotation Classic.txt => Quotation Classic.json} (100%) rename erpnext/selling/Print Format/Quotation Modern/{Quotation Modern.txt => Quotation Modern.json} (100%) rename erpnext/selling/Print Format/Quotation Spartan/{Quotation Spartan.txt => Quotation Spartan.json} (100%) rename erpnext/selling/Print Format/Sales Order Classic/{Sales Order Classic.txt => Sales Order Classic.json} (100%) rename erpnext/selling/Print Format/Sales Order Modern/{Sales Order Modern.txt => Sales Order Modern.json} (100%) rename erpnext/selling/Print Format/Sales Order Spartan/{Sales Order Spartan.txt => Sales Order Spartan.json} (100%) rename erpnext/selling/doctype/campaign/{campaign.txt => campaign.json} (100%) rename erpnext/selling/doctype/customer/{customer.txt => customer.json} (100%) rename erpnext/selling/doctype/industry_type/{industry_type.txt => industry_type.json} (100%) rename erpnext/selling/doctype/installation_note/{installation_note.txt => installation_note.json} (100%) rename erpnext/selling/doctype/installation_note_item/{installation_note_item.txt => installation_note_item.json} (100%) rename erpnext/selling/doctype/lead/{lead.txt => lead.json} (100%) rename erpnext/selling/doctype/opportunity/{opportunity.txt => opportunity.json} (100%) rename erpnext/selling/doctype/opportunity_item/{opportunity_item.txt => opportunity_item.json} (100%) rename erpnext/selling/doctype/quotation/{quotation.txt => quotation.json} (100%) rename erpnext/selling/doctype/quotation_item/{quotation_item.txt => quotation_item.json} (100%) rename erpnext/selling/doctype/sales_bom/{sales_bom.txt => sales_bom.json} (100%) rename erpnext/selling/doctype/sales_bom_item/{sales_bom_item.txt => sales_bom_item.json} (100%) rename erpnext/selling/doctype/sales_order/{sales_order.txt => sales_order.json} (100%) rename erpnext/selling/doctype/sales_order_item/{sales_order_item.txt => sales_order_item.json} (100%) rename erpnext/selling/doctype/sales_team/{sales_team.txt => sales_team.json} (100%) rename erpnext/selling/doctype/selling_settings/{selling_settings.txt => selling_settings.json} (100%) rename erpnext/selling/doctype/sms_center/{sms_center.txt => sms_center.json} (100%) rename erpnext/selling/page/sales_analytics/{sales_analytics.txt => sales_analytics.json} (100%) rename erpnext/selling/page/sales_browser/{sales_browser.txt => sales_browser.json} (100%) rename erpnext/selling/page/sales_funnel/{sales_funnel.txt => sales_funnel.json} (100%) rename erpnext/selling/report/available_stock_for_packing_items/{available_stock_for_packing_items.txt => available_stock_for_packing_items.json} (100%) rename erpnext/selling/report/customer_acquisition_and_loyalty/{customer_acquisition_and_loyalty.txt => customer_acquisition_and_loyalty.json} (100%) rename erpnext/selling/report/customer_addresses_and_contacts/{customer_addresses_and_contacts.txt => customer_addresses_and_contacts.json} (100%) rename erpnext/selling/report/customers_not_buying_since_long_time/{customers_not_buying_since_long_time.txt => customers_not_buying_since_long_time.json} (100%) rename erpnext/selling/report/item_wise_sales_history/{item_wise_sales_history.txt => item_wise_sales_history.json} (100%) rename erpnext/selling/report/lead_details/{lead_details.txt => lead_details.json} (100%) rename erpnext/selling/report/pending_so_items_for_purchase_request/{pending_so_items_for_purchase_request.txt => pending_so_items_for_purchase_request.json} (100%) rename erpnext/selling/report/quotation_trends/{quotation_trends.txt => quotation_trends.json} (100%) rename erpnext/selling/report/sales_order_trends/{sales_order_trends.txt => sales_order_trends.json} (100%) rename erpnext/selling/report/sales_person_target_variance_item_group_wise/{sales_person_target_variance_item_group_wise.txt => sales_person_target_variance_item_group_wise.json} (100%) rename erpnext/selling/report/sales_person_wise_transaction_summary/{sales_person_wise_transaction_summary.txt => sales_person_wise_transaction_summary.json} (100%) rename erpnext/selling/report/territory_target_variance_item_group_wise/{territory_target_variance_item_group_wise.txt => territory_target_variance_item_group_wise.json} (100%) rename erpnext/setup/doctype/applicable_territory/{applicable_territory.txt => applicable_territory.json} (100%) rename erpnext/setup/doctype/authorization_control/{authorization_control.txt => authorization_control.json} (100%) rename erpnext/setup/doctype/authorization_rule/{authorization_rule.txt => authorization_rule.json} (100%) rename erpnext/setup/doctype/backup_manager/{backup_manager.txt => backup_manager.json} (100%) rename erpnext/setup/doctype/brand/{brand.txt => brand.json} (100%) rename erpnext/setup/doctype/company/{company.txt => company.json} (100%) rename erpnext/setup/doctype/contact_control/{contact_control.txt => contact_control.json} (100%) rename erpnext/setup/doctype/country/{country.txt => country.json} (100%) rename erpnext/setup/doctype/currency/{currency.txt => currency.json} (100%) rename erpnext/setup/doctype/currency_exchange/{currency_exchange.txt => currency_exchange.json} (100%) rename erpnext/setup/doctype/customer_group/{customer_group.txt => customer_group.json} (100%) rename erpnext/setup/doctype/email_digest/{email_digest.txt => email_digest.json} (100%) rename erpnext/setup/doctype/features_setup/{features_setup.txt => features_setup.json} (100%) rename erpnext/setup/doctype/global_defaults/{global_defaults.txt => global_defaults.json} (100%) rename erpnext/setup/doctype/item_group/{item_group.txt => item_group.json} (100%) rename erpnext/setup/doctype/jobs_email_settings/{jobs_email_settings.txt => jobs_email_settings.json} (100%) rename erpnext/setup/doctype/naming_series/{naming_series.txt => naming_series.json} (100%) rename erpnext/setup/doctype/notification_control/{notification_control.txt => notification_control.json} (100%) rename erpnext/setup/doctype/print_heading/{print_heading.txt => print_heading.json} (100%) rename erpnext/setup/doctype/quotation_lost_reason/{quotation_lost_reason.txt => quotation_lost_reason.json} (100%) rename erpnext/setup/doctype/sales_email_settings/{sales_email_settings.txt => sales_email_settings.json} (100%) rename erpnext/setup/doctype/sales_partner/{sales_partner.txt => sales_partner.json} (100%) rename erpnext/setup/doctype/sales_person/{sales_person.txt => sales_person.json} (100%) rename erpnext/setup/doctype/sms_parameter/{sms_parameter.txt => sms_parameter.json} (100%) rename erpnext/setup/doctype/sms_settings/{sms_settings.txt => sms_settings.json} (100%) rename erpnext/setup/doctype/supplier_type/{supplier_type.txt => supplier_type.json} (100%) rename erpnext/setup/doctype/target_detail/{target_detail.txt => target_detail.json} (100%) rename erpnext/setup/doctype/terms_and_conditions/{terms_and_conditions.txt => terms_and_conditions.json} (100%) rename erpnext/setup/doctype/territory/{territory.txt => territory.json} (100%) rename erpnext/setup/doctype/uom/{uom.txt => uom.json} (100%) rename erpnext/setup/doctype/website_item_group/{website_item_group.txt => website_item_group.json} (100%) rename erpnext/setup/page/setup_wizard/{setup_wizard.txt => setup_wizard.json} (100%) rename erpnext/stock/Print Format/Delivery Note Classic/{Delivery Note Classic.txt => Delivery Note Classic.json} (100%) rename erpnext/stock/Print Format/Delivery Note Modern/{Delivery Note Modern.txt => Delivery Note Modern.json} (100%) rename erpnext/stock/Print Format/Delivery Note Packing List Wise/{Delivery Note Packing List Wise.txt => Delivery Note Packing List Wise.json} (100%) rename erpnext/stock/Print Format/Delivery Note Spartan/{Delivery Note Spartan.txt => Delivery Note Spartan.json} (100%) rename erpnext/stock/doctype/batch/{batch.txt => batch.json} (100%) rename erpnext/stock/doctype/bin/{bin.txt => bin.json} (100%) rename erpnext/stock/doctype/delivery_note/{delivery_note.txt => delivery_note.json} (100%) rename erpnext/stock/doctype/delivery_note_item/{delivery_note_item.txt => delivery_note_item.json} (100%) rename erpnext/stock/doctype/item/{item.txt => item.json} (100%) rename erpnext/stock/doctype/item_customer_detail/{item_customer_detail.txt => item_customer_detail.json} (100%) rename erpnext/stock/doctype/item_price/{item_price.txt => item_price.json} (100%) rename erpnext/stock/doctype/item_quality_inspection_parameter/{item_quality_inspection_parameter.txt => item_quality_inspection_parameter.json} (100%) rename erpnext/stock/doctype/item_reorder/{item_reorder.txt => item_reorder.json} (100%) rename erpnext/stock/doctype/item_supplier/{item_supplier.txt => item_supplier.json} (100%) rename erpnext/stock/doctype/item_tax/{item_tax.txt => item_tax.json} (100%) rename erpnext/stock/doctype/item_website_specification/{item_website_specification.txt => item_website_specification.json} (100%) rename erpnext/stock/doctype/landed_cost_item/{landed_cost_item.txt => landed_cost_item.json} (100%) rename erpnext/stock/doctype/landed_cost_purchase_receipt/{landed_cost_purchase_receipt.txt => landed_cost_purchase_receipt.json} (100%) rename erpnext/stock/doctype/landed_cost_wizard/{landed_cost_wizard.txt => landed_cost_wizard.json} (100%) rename erpnext/stock/doctype/material_request/{material_request.txt => material_request.json} (100%) rename erpnext/stock/doctype/material_request_item/{material_request_item.txt => material_request_item.json} (100%) rename erpnext/stock/doctype/packed_item/{packed_item.txt => packed_item.json} (100%) rename erpnext/stock/doctype/packing_slip/{packing_slip.txt => packing_slip.json} (100%) rename erpnext/stock/doctype/packing_slip_item/{packing_slip_item.txt => packing_slip_item.json} (100%) rename erpnext/stock/doctype/price_list/{price_list.txt => price_list.json} (100%) rename erpnext/stock/doctype/purchase_receipt/{purchase_receipt.txt => purchase_receipt.json} (100%) rename erpnext/stock/doctype/purchase_receipt_item/{purchase_receipt_item.txt => purchase_receipt_item.json} (100%) rename erpnext/stock/doctype/serial_no/{serial_no.txt => serial_no.json} (100%) rename erpnext/stock/doctype/stock_entry/{stock_entry.txt => stock_entry.json} (100%) rename erpnext/stock/doctype/stock_entry_detail/{stock_entry_detail.txt => stock_entry_detail.json} (100%) rename erpnext/stock/doctype/stock_ledger_entry/{stock_ledger_entry.txt => stock_ledger_entry.json} (100%) rename erpnext/stock/doctype/stock_reconciliation/{stock_reconciliation.txt => stock_reconciliation.json} (100%) rename erpnext/stock/doctype/stock_settings/{stock_settings.txt => stock_settings.json} (100%) rename erpnext/stock/doctype/stock_uom_replace_utility/{stock_uom_replace_utility.txt => stock_uom_replace_utility.json} (100%) rename erpnext/stock/doctype/uom_conversion_detail/{uom_conversion_detail.txt => uom_conversion_detail.json} (100%) rename erpnext/stock/doctype/warehouse/{warehouse.txt => warehouse.json} (100%) rename erpnext/stock/doctype/warehouse_user/{warehouse_user.txt => warehouse_user.json} (100%) rename erpnext/stock/page/stock_ageing/{stock_ageing.txt => stock_ageing.json} (100%) rename erpnext/stock/page/stock_analytics/{stock_analytics.txt => stock_analytics.json} (100%) rename erpnext/stock/page/stock_balance/{stock_balance.txt => stock_balance.json} (100%) rename erpnext/stock/page/stock_ledger/{stock_ledger.txt => stock_ledger.json} (100%) rename erpnext/stock/page/stock_level/{stock_level.txt => stock_level.json} (100%) rename erpnext/stock/report/batch_wise_balance_history/{batch_wise_balance_history.txt => batch_wise_balance_history.json} (100%) rename erpnext/stock/report/delivery_note_trends/{delivery_note_trends.txt => delivery_note_trends.json} (100%) rename erpnext/stock/report/item_prices/{item_prices.txt => item_prices.json} (100%) rename erpnext/stock/report/item_shortage_report/{item_shortage_report.txt => item_shortage_report.json} (100%) rename erpnext/stock/report/item_wise_price_list_rate/{item_wise_price_list_rate.txt => item_wise_price_list_rate.json} (100%) rename erpnext/stock/report/items_to_be_requested/{items_to_be_requested.txt => items_to_be_requested.json} (100%) rename erpnext/stock/report/itemwise_recommended_reorder_level/{itemwise_recommended_reorder_level.txt => itemwise_recommended_reorder_level.json} (100%) rename erpnext/stock/report/material_requests_for_which_supplier_quotations_are_not_created/{material_requests_for_which_supplier_quotations_are_not_created.txt => material_requests_for_which_supplier_quotations_are_not_created.json} (100%) rename erpnext/stock/report/ordered_items_to_be_delivered/{ordered_items_to_be_delivered.txt => ordered_items_to_be_delivered.json} (100%) rename erpnext/stock/report/purchase_in_transit/{purchase_in_transit.txt => purchase_in_transit.json} (100%) rename erpnext/stock/report/purchase_order_items_to_be_received/{purchase_order_items_to_be_received.txt => purchase_order_items_to_be_received.json} (100%) rename erpnext/stock/report/purchase_receipt_trends/{purchase_receipt_trends.txt => purchase_receipt_trends.json} (100%) rename erpnext/stock/report/requested_items_to_be_transferred/{requested_items_to_be_transferred.txt => requested_items_to_be_transferred.json} (100%) rename erpnext/stock/report/serial_no_service_contract_expiry/{serial_no_service_contract_expiry.txt => serial_no_service_contract_expiry.json} (100%) rename erpnext/stock/report/serial_no_status/{serial_no_status.txt => serial_no_status.json} (100%) rename erpnext/stock/report/serial_no_warranty_expiry/{serial_no_warranty_expiry.txt => serial_no_warranty_expiry.json} (100%) rename erpnext/stock/report/stock_ageing/{stock_ageing.txt => stock_ageing.json} (100%) rename erpnext/stock/report/stock_ledger/{stock_ledger.txt => stock_ledger.json} (100%) rename erpnext/stock/report/stock_projected_qty/{stock_projected_qty.txt => stock_projected_qty.json} (100%) rename erpnext/stock/report/supplier_wise_sales_analytics/{supplier_wise_sales_analytics.txt => supplier_wise_sales_analytics.json} (100%) rename erpnext/stock/report/warehouse_wise_stock_balance/{warehouse_wise_stock_balance.txt => warehouse_wise_stock_balance.json} (100%) rename erpnext/support/doctype/customer_issue/{customer_issue.txt => customer_issue.json} (100%) rename erpnext/support/doctype/maintenance_schedule/{maintenance_schedule.txt => maintenance_schedule.json} (100%) rename erpnext/support/doctype/maintenance_schedule_detail/{maintenance_schedule_detail.txt => maintenance_schedule_detail.json} (100%) rename erpnext/support/doctype/maintenance_schedule_item/{maintenance_schedule_item.txt => maintenance_schedule_item.json} (100%) rename erpnext/support/doctype/maintenance_visit/{maintenance_visit.txt => maintenance_visit.json} (100%) rename erpnext/support/doctype/maintenance_visit_purpose/{maintenance_visit_purpose.txt => maintenance_visit_purpose.json} (100%) rename erpnext/support/doctype/newsletter/{newsletter.txt => newsletter.json} (100%) rename erpnext/support/doctype/support_email_settings/{support_email_settings.txt => support_email_settings.json} (100%) rename erpnext/support/doctype/support_ticket/{support_ticket.txt => support_ticket.json} (100%) rename erpnext/support/page/support_analytics/{support_analytics.txt => support_analytics.json} (100%) rename erpnext/support/report/maintenance_schedules/{maintenance_schedules.txt => maintenance_schedules.json} (100%) rename erpnext/utilities/doctype/address/{address.txt => address.json} (100%) rename erpnext/utilities/doctype/contact/{contact.txt => contact.json} (100%) rename erpnext/utilities/doctype/note/{note.txt => note.json} (100%) rename erpnext/utilities/doctype/note_user/{note_user.txt => note_user.json} (100%) rename erpnext/utilities/doctype/rename_tool/{rename_tool.txt => rename_tool.json} (100%) rename erpnext/utilities/doctype/sms_control/{sms_control.txt => sms_control.json} (100%) rename erpnext/utilities/doctype/sms_log/{sms_log.txt => sms_log.json} (100%) diff --git a/erpnext/accounts/Print Format/Cheque Printing Format/Cheque Printing Format.txt b/erpnext/accounts/Print Format/Cheque Printing Format/Cheque Printing Format.json similarity index 100% rename from erpnext/accounts/Print Format/Cheque Printing Format/Cheque Printing Format.txt rename to erpnext/accounts/Print Format/Cheque Printing Format/Cheque Printing Format.json diff --git a/erpnext/accounts/Print Format/POS Invoice/POS Invoice.txt b/erpnext/accounts/Print Format/POS Invoice/POS Invoice.json similarity index 100% rename from erpnext/accounts/Print Format/POS Invoice/POS Invoice.txt rename to erpnext/accounts/Print Format/POS Invoice/POS Invoice.json diff --git a/erpnext/accounts/Print Format/Payment Receipt Voucher/Payment Receipt Voucher.txt b/erpnext/accounts/Print Format/Payment Receipt Voucher/Payment Receipt Voucher.json similarity index 100% rename from erpnext/accounts/Print Format/Payment Receipt Voucher/Payment Receipt Voucher.txt rename to erpnext/accounts/Print Format/Payment Receipt Voucher/Payment Receipt Voucher.json diff --git a/erpnext/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.txt b/erpnext/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.json similarity index 100% rename from erpnext/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.txt rename to erpnext/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.json diff --git a/erpnext/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.txt b/erpnext/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.json similarity index 100% rename from erpnext/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.txt rename to erpnext/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.json diff --git a/erpnext/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.txt b/erpnext/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.json similarity index 100% rename from erpnext/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.txt rename to erpnext/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.json diff --git a/erpnext/accounts/Print Format/SalesInvoice/SalesInvoice.txt b/erpnext/accounts/Print Format/SalesInvoice/SalesInvoice.json similarity index 100% rename from erpnext/accounts/Print Format/SalesInvoice/SalesInvoice.txt rename to erpnext/accounts/Print Format/SalesInvoice/SalesInvoice.json diff --git a/erpnext/accounts/doctype/account/account.txt b/erpnext/accounts/doctype/account/account.json similarity index 100% rename from erpnext/accounts/doctype/account/account.txt rename to erpnext/accounts/doctype/account/account.json diff --git a/erpnext/accounts/doctype/accounts_settings/accounts_settings.txt b/erpnext/accounts/doctype/accounts_settings/accounts_settings.json similarity index 100% rename from erpnext/accounts/doctype/accounts_settings/accounts_settings.txt rename to erpnext/accounts/doctype/accounts_settings/accounts_settings.json diff --git a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.txt b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.json similarity index 100% rename from erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.txt rename to erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.json diff --git a/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.txt b/erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.json similarity index 100% rename from erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.txt rename to erpnext/accounts/doctype/bank_reconciliation_detail/bank_reconciliation_detail.json diff --git a/erpnext/accounts/doctype/budget_detail/budget_detail.txt b/erpnext/accounts/doctype/budget_detail/budget_detail.json similarity index 100% rename from erpnext/accounts/doctype/budget_detail/budget_detail.txt rename to erpnext/accounts/doctype/budget_detail/budget_detail.json diff --git a/erpnext/accounts/doctype/budget_distribution/budget_distribution.txt b/erpnext/accounts/doctype/budget_distribution/budget_distribution.json similarity index 100% rename from erpnext/accounts/doctype/budget_distribution/budget_distribution.txt rename to erpnext/accounts/doctype/budget_distribution/budget_distribution.json diff --git a/erpnext/accounts/doctype/budget_distribution/test_budget_distribution.py b/erpnext/accounts/doctype/budget_distribution/test_budget_distribution.py index 57fc162fe5..4626bae4db 100644 --- a/erpnext/accounts/doctype/budget_distribution/test_budget_distribution.py +++ b/erpnext/accounts/doctype/budget_distribution/test_budget_distribution.py @@ -1,49 +1,6 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [ - { - "doctype": "Budget Distribution", - "distribution_id": "_Test Distribution", - "fiscal_year": "_Test Fiscal Year 2013", - "budget_distribution_details": [ - { - "month": "January", - "percentage_allocation": "8" - }, { - "month": "February", - "percentage_allocation": "8" - }, { - "month": "March", - "percentage_allocation": "8" - }, { - "month": "April", - "percentage_allocation": "8" - }, { - "month": "May", - "percentage_allocation": "8" - }, { - "month": "June", - "percentage_allocation": "8" - }, { - "month": "July", - "percentage_allocation": "8" - }, { - "month": "August", - "percentage_allocation": "8" - }, { - "month": "September", - "percentage_allocation": "8" - }, { - "month": "October", - "percentage_allocation": "8" - }, { - "month": "November", - "percentage_allocation": "10" - }, { - "month": "December", - "percentage_allocation": "10" - } - ] - } -] \ No newline at end of file + +import frappe +test_records = frappe.get_test_records('Budget Distribution') \ No newline at end of file diff --git a/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.txt b/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.json similarity index 100% rename from erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.txt rename to erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.json diff --git a/erpnext/accounts/doctype/c_form/c_form.txt b/erpnext/accounts/doctype/c_form/c_form.json similarity index 100% rename from erpnext/accounts/doctype/c_form/c_form.txt rename to erpnext/accounts/doctype/c_form/c_form.json diff --git a/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.txt b/erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.json similarity index 100% rename from erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.txt rename to erpnext/accounts/doctype/c_form_invoice_detail/c_form_invoice_detail.json diff --git a/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.txt b/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.json similarity index 100% rename from erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.txt rename to erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.json diff --git a/erpnext/accounts/doctype/cost_center/cost_center.txt b/erpnext/accounts/doctype/cost_center/cost_center.json similarity index 100% rename from erpnext/accounts/doctype/cost_center/cost_center.txt rename to erpnext/accounts/doctype/cost_center/cost_center.json diff --git a/erpnext/accounts/doctype/cost_center/test_cost_center.py b/erpnext/accounts/doctype/cost_center/test_cost_center.py index 2fd7ecf966..d23d38af61 100644 --- a/erpnext/accounts/doctype/cost_center/test_cost_center.py +++ b/erpnext/accounts/doctype/cost_center/test_cost_center.py @@ -1,19 +1,6 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [ - [{ - "doctype": "Cost Center", - "cost_center_name": "_Test Cost Center", - "parent_cost_center": "_Test Company - _TC", - "company": "_Test Company", - "group_or_ledger": "Ledger", - "distribution_id": "_Test Distribution", - }, { - "doctype": "Budget Detail", - "parentfield": "budget_details", - "account": "_Test Account Cost for Goods Sold - _TC", - "budget_allocated": 100000, - "fiscal_year": "_Test Fiscal Year 2013" - }], -] \ No newline at end of file + +import frappe +test_records = frappe.get_test_records('Cost Center') \ No newline at end of file diff --git a/erpnext/accounts/doctype/fiscal_year/fiscal_year.txt b/erpnext/accounts/doctype/fiscal_year/fiscal_year.json similarity index 100% rename from erpnext/accounts/doctype/fiscal_year/fiscal_year.txt rename to erpnext/accounts/doctype/fiscal_year/fiscal_year.json diff --git a/erpnext/accounts/doctype/fiscal_year/fiscal_year.py b/erpnext/accounts/doctype/fiscal_year/fiscal_year.py index aa393e0a1a..6e72c9ad79 100644 --- a/erpnext/accounts/doctype/fiscal_year/fiscal_year.py +++ b/erpnext/accounts/doctype/fiscal_year/fiscal_year.py @@ -12,7 +12,7 @@ class FiscalYear(Document): def set_as_default(self): frappe.db.set_value("Global Defaults", None, "current_fiscal_year", self.name) - frappe.get_obj("Global Defaults").on_update() + frappe.get_doc("Global Defaults").on_update() # clear cache frappe.clear_cache() diff --git a/erpnext/accounts/doctype/fiscal_year/test_fiscal_year.py b/erpnext/accounts/doctype/fiscal_year/test_fiscal_year.py index cd9b1f4ead..d0e6c6cd0f 100644 --- a/erpnext/accounts/doctype/fiscal_year/test_fiscal_year.py +++ b/erpnext/accounts/doctype/fiscal_year/test_fiscal_year.py @@ -3,35 +3,4 @@ from __future__ import unicode_literals -test_records = [ - [{ - "doctype": "Fiscal Year", - "year": "_Test Fiscal Year 2012", - "year_start_date": "2012-01-01", - "year_end_date": "2012-12-31" - }], - [{ - "doctype": "Fiscal Year", - "year": "_Test Fiscal Year 2013", - "year_start_date": "2013-01-01", - "year_end_date": "2013-12-31" - }], - [{ - "doctype": "Fiscal Year", - "year": "_Test Fiscal Year 2014", - "year_start_date": "2014-01-01", - "year_end_date": "2014-12-31" - }], - [{ - "doctype": "Fiscal Year", - "year": "_Test Fiscal Year 2015", - "year_start_date": "2015-01-01", - "year_end_date": "2015-12-31" - }], - [{ - "doctype": "Fiscal Year", - "year": "_Test Fiscal Year 2016", - "year_start_date": "2016-01-01", - "year_end_date": "2016-12-31" - }], -] \ No newline at end of file +test_records = frappe.get_test_records('Fiscal Year') \ No newline at end of file diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.txt b/erpnext/accounts/doctype/gl_entry/gl_entry.json similarity index 100% rename from erpnext/accounts/doctype/gl_entry/gl_entry.txt rename to erpnext/accounts/doctype/gl_entry/gl_entry.json diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher.txt b/erpnext/accounts/doctype/journal_voucher/journal_voucher.json similarity index 100% rename from erpnext/accounts/doctype/journal_voucher/journal_voucher.txt rename to erpnext/accounts/doctype/journal_voucher/journal_voucher.json diff --git a/erpnext/accounts/doctype/journal_voucher/test_journal_voucher.py b/erpnext/accounts/doctype/journal_voucher/test_journal_voucher.py index 20a342d090..c3a3d85ae9 100644 --- a/erpnext/accounts/doctype/journal_voucher/test_journal_voucher.py +++ b/erpnext/accounts/doctype/journal_voucher/test_journal_voucher.py @@ -9,14 +9,14 @@ import frappe class TestJournalVoucher(unittest.TestCase): def test_journal_voucher_with_against_jv(self): self.clear_account_balance() - jv_invoice = frappe.get_doc(copy=test_records[2]) + jv_invoice = frappe.copy_doc(test_records[2]) jv_invoice.insert() jv_invoice.submit() self.assertTrue(not frappe.db.sql("""select name from `tabJournal Voucher Detail` where against_jv=%s""", jv_invoice.name)) - jv_payment = frappe.get_doc(copy=test_records[0]) + jv_payment = frappe.copy_doc(test_records[0]) jv_payment.doclist[1].against_jv = jv_invoice.name jv_payment.insert() jv_payment.submit() @@ -37,7 +37,7 @@ class TestJournalVoucher(unittest.TestCase): from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory set_perpetual_inventory() - jv = frappe.get_doc(copy=test_records[0]) + jv = frappe.copy_doc(test_records[0]) jv.doclist[1].account = "_Test Warehouse - _TC" jv.insert() @@ -50,7 +50,7 @@ class TestJournalVoucher(unittest.TestCase): frappe.db.set_value("Company", "_Test Company", "monthly_bgt_flag", "Ignore") self.clear_account_balance() - jv = frappe.get_doc(copy=test_records[0]) + jv = frappe.copy_doc(test_records[0]) jv.doclist[2].account = "_Test Account Cost for Goods Sold - _TC" jv.doclist[2].cost_center = "_Test Cost Center - _TC" jv.doclist[2].debit = 20000.0 @@ -65,7 +65,7 @@ class TestJournalVoucher(unittest.TestCase): frappe.db.set_value("Company", "_Test Company", "monthly_bgt_flag", "Stop") self.clear_account_balance() - jv = frappe.get_doc(copy=test_records[0]) + jv = frappe.copy_doc(test_records[0]) jv.doclist[2].account = "_Test Account Cost for Goods Sold - _TC" jv.doclist[2].cost_center = "_Test Cost Center - _TC" jv.doclist[2].debit = 20000.0 @@ -83,7 +83,7 @@ class TestJournalVoucher(unittest.TestCase): frappe.db.set_value("Company", "_Test Company", "yearly_bgt_flag", "Stop") - jv = frappe.get_doc(copy=test_records[0]) + jv = frappe.copy_doc(test_records[0]) jv.posting_date = "2013-08-12" jv.doclist[2].account = "_Test Account Cost for Goods Sold - _TC" jv.doclist[2].cost_center = "_Test Cost Center - _TC" @@ -100,7 +100,7 @@ class TestJournalVoucher(unittest.TestCase): frappe.db.set_value("Company", "_Test Company", "monthly_bgt_flag", "Stop") self.clear_account_balance() - jv = frappe.get_doc(copy=test_records[0]) + jv = frappe.copy_doc(test_records[0]) jv.doclist[1].account = "_Test Account Cost for Goods Sold - _TC" jv.doclist[1].cost_center = "_Test Cost Center - _TC" jv.doclist[1].credit = 30000.0 @@ -110,7 +110,7 @@ class TestJournalVoucher(unittest.TestCase): self.assertTrue(frappe.db.get_value("GL Entry", {"voucher_type": "Journal Voucher", "voucher_no": jv.name})) - jv1 = frappe.get_doc(copy=test_records[0]) + jv1 = frappe.copy_doc(test_records[0]) jv1.doclist[2].account = "_Test Account Cost for Goods Sold - _TC" jv1.doclist[2].cost_center = "_Test Cost Center - _TC" jv1.doclist[2].debit = 40000.0 @@ -128,81 +128,4 @@ class TestJournalVoucher(unittest.TestCase): frappe.db.sql("""delete from `tabGL Entry`""") -test_records = [ - [{ - "company": "_Test Company", - "doctype": "Journal Voucher", - "fiscal_year": "_Test Fiscal Year 2013", - "naming_series": "_T-Journal Voucher-", - "posting_date": "2013-02-14", - "user_remark": "test", - "voucher_type": "Bank Voucher", - "cheque_no": "33", - "cheque_date": "2013-02-14" - }, - { - "account": "_Test Customer - _TC", - "doctype": "Journal Voucher Detail", - "credit": 400.0, - "debit": 0.0, - "parentfield": "entries" - }, - { - "account": "_Test Account Bank Account - _TC", - "doctype": "Journal Voucher Detail", - "debit": 400.0, - "credit": 0.0, - "parentfield": "entries" - }], - [{ - "company": "_Test Company", - "doctype": "Journal Voucher", - "fiscal_year": "_Test Fiscal Year 2013", - "naming_series": "_T-Journal Voucher-", - "posting_date": "2013-02-14", - "user_remark": "test", - "voucher_type": "Bank Voucher", - "cheque_no": "33", - "cheque_date": "2013-02-14" - }, - { - "account": "_Test Supplier - _TC", - "doctype": "Journal Voucher Detail", - "credit": 0.0, - "debit": 400.0, - "parentfield": "entries" - }, - { - "account": "_Test Account Bank Account - _TC", - "doctype": "Journal Voucher Detail", - "debit": 0.0, - "credit": 400.0, - "parentfield": "entries" - }], - [{ - "company": "_Test Company", - "doctype": "Journal Voucher", - "fiscal_year": "_Test Fiscal Year 2013", - "naming_series": "_T-Journal Voucher-", - "posting_date": "2013-02-14", - "user_remark": "test", - "voucher_type": "Bank Voucher", - "cheque_no": "33", - "cheque_date": "2013-02-14" - }, - { - "account": "_Test Customer - _TC", - "doctype": "Journal Voucher Detail", - "credit": 0.0, - "debit": 400.0, - "parentfield": "entries" - }, - { - "account": "Sales - _TC", - "doctype": "Journal Voucher Detail", - "credit": 400.0, - "debit": 0.0, - "parentfield": "entries", - "cost_center": "_Test Cost Center - _TC" - }], -] \ No newline at end of file +test_records = frappe.get_test_records('Journal Voucher') \ No newline at end of file diff --git a/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt b/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.json similarity index 100% rename from erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.txt rename to erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.json diff --git a/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.txt b/erpnext/accounts/doctype/mode_of_payment/mode_of_payment.json similarity index 100% rename from erpnext/accounts/doctype/mode_of_payment/mode_of_payment.txt rename to erpnext/accounts/doctype/mode_of_payment/mode_of_payment.json diff --git a/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.txt b/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.json similarity index 100% rename from erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.txt rename to erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.json diff --git a/erpnext/accounts/doctype/payment_to_invoice_matching_tool/test_payment_to_invoice_matching_tool.py b/erpnext/accounts/doctype/payment_to_invoice_matching_tool/test_payment_to_invoice_matching_tool.py index fed0252376..2198909d45 100644 --- a/erpnext/accounts/doctype/payment_to_invoice_matching_tool/test_payment_to_invoice_matching_tool.py +++ b/erpnext/accounts/doctype/payment_to_invoice_matching_tool/test_payment_to_invoice_matching_tool.py @@ -5,4 +5,4 @@ from __future__ import unicode_literals import unittest import frappe -test_records = [] \ No newline at end of file +test_records = frappe.get_test_records('Payment To Invoice Matching Tool') \ No newline at end of file diff --git a/erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.txt b/erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.json similarity index 100% rename from erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.txt rename to erpnext/accounts/doctype/payment_to_invoice_matching_tool_detail/payment_to_invoice_matching_tool_detail.json diff --git a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.txt b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.json similarity index 100% rename from erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.txt rename to erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.json diff --git a/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py b/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py index 9ffe451e91..12facd8aa3 100644 --- a/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py +++ b/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py @@ -12,18 +12,18 @@ class TestPeriodClosingVoucher(unittest.TestCase): frappe.db.sql("""delete from `tabGL Entry`""") from erpnext.accounts.doctype.journal_voucher.test_journal_voucher import test_records as jv_records - jv = frappe.get_doc(copy=jv_records[2]) + jv = frappe.copy_doc(jv_records[2]) jv.insert() jv.submit() - jv1 = frappe.get_doc(copy=jv_records[0]) + jv1 = frappe.copy_doc(jv_records[0]) jv1.doclist[2].account = "_Test Account Cost for Goods Sold - _TC" jv1.doclist[2].debit = 600.0 jv1.doclist[1].credit = 600.0 jv1.insert() jv1.submit() - pcv = frappe.get_doc(copy=test_record) + pcv = frappe.copy_doc(test_record) pcv.insert() pcv.submit() diff --git a/erpnext/accounts/doctype/pos_setting/pos_setting.txt b/erpnext/accounts/doctype/pos_setting/pos_setting.json similarity index 100% rename from erpnext/accounts/doctype/pos_setting/pos_setting.txt rename to erpnext/accounts/doctype/pos_setting/pos_setting.json diff --git a/erpnext/accounts/doctype/pos_setting/pos_setting.py b/erpnext/accounts/doctype/pos_setting/pos_setting.py index ed3f5f4a42..65761c93a5 100755 --- a/erpnext/accounts/doctype/pos_setting/pos_setting.py +++ b/erpnext/accounts/doctype/pos_setting/pos_setting.py @@ -10,11 +10,7 @@ from frappe.model.document import Document class PosSetting(Document): def get_series(self): - import frappe.model.doctype - docfield = frappe.model.doctype.get('Sales Invoice') - series = [d.options for d in docfield - if d.doctype == 'DocField' and d.fieldname == 'naming_series'] - return series and series[0] or '' + frappe.get_meta("Sales Invoice").get_field("naming_series").options or "" def validate(self): self.check_for_duplicate() diff --git a/erpnext/accounts/doctype/pos_setting/test_pos_setting.py b/erpnext/accounts/doctype/pos_setting/test_pos_setting.py index 42125cd0f9..d563be96d7 100644 --- a/erpnext/accounts/doctype/pos_setting/test_pos_setting.py +++ b/erpnext/accounts/doctype/pos_setting/test_pos_setting.py @@ -1,19 +1,6 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [ - [{ - "doctype": "POS Setting", - "name": "_Test POS Setting", - "currency": "INR", - "selling_price_list": "_Test Price List", - "company": "_Test Company", - "warehouse": "_Test Warehouse - _TC", - "territory": "_Test Territory", - "cash_bank_account": "_Test Account Bank Account - _TC", - "income_account": "Sales - _TC", - "cost_center": "_Test Cost Center - _TC", - "expense_account": "_Test Account Cost for Goods Sold - _TC", - "naming_series": "_T-Sales Invoice-" - }] -] \ No newline at end of file + +import frappe +test_records = frappe.get_test_records('Pos Setting') \ No newline at end of file diff --git a/erpnext/accounts/doctype/pricing_rule/pricing_rule.txt b/erpnext/accounts/doctype/pricing_rule/pricing_rule.json similarity index 100% rename from erpnext/accounts/doctype/pricing_rule/pricing_rule.txt rename to erpnext/accounts/doctype/pricing_rule/pricing_rule.json diff --git a/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py index c1bd3195d3..5e427971e5 100644 --- a/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py +++ b/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py @@ -19,7 +19,7 @@ class TestPricingRule(unittest.TestCase): "price": 0, "discount_percentage": 10, }] - frappe.get_doc(copy=test_record).insert() + frappe.copy_doc(test_record).insert() args = frappe._dict({ "item_code": "_Test Item", @@ -38,7 +38,7 @@ class TestPricingRule(unittest.TestCase): details = get_item_details(args) self.assertEquals(details.get("discount_percentage"), 10) - prule = frappe.get_doc(copy=test_record) + prule = frappe.copy_doc(test_record) prule.applicable_for = "Customer" self.assertRaises(MandatoryError, prule.insert) prule.customer = "_Test Customer" @@ -47,7 +47,7 @@ class TestPricingRule(unittest.TestCase): details = get_item_details(args) self.assertEquals(details.get("discount_percentage"), 20) - prule = frappe.get_doc(copy=test_record) + prule = frappe.copy_doc(test_record) prule.apply_on = "Item Group" prule.item_group = "All Item Groups" prule.discount_percentage = 15 @@ -57,7 +57,7 @@ class TestPricingRule(unittest.TestCase): details = get_item_details(args) self.assertEquals(details.get("discount_percentage"), 10) - prule = frappe.get_doc(copy=test_record) + prule = frappe.copy_doc(test_record) prule.applicable_for = "Campaign" prule.campaign = "_Test Campaign" prule.discount_percentage = 5 diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.txt b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json similarity index 100% rename from erpnext/accounts/doctype/purchase_invoice/purchase_invoice.txt rename to erpnext/accounts/doctype/purchase_invoice/purchase_invoice.json diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index eb8b93a5d6..b37479614f 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -6,7 +6,6 @@ import frappe from frappe.utils import cint, cstr, flt, formatdate -from frappe.model.code import get_obj from frappe import msgprint, _ from erpnext.setup.utils import get_company_currency @@ -267,7 +266,7 @@ class PurchaseInvoice(BuyingController): def on_submit(self): self.check_prev_docstatus() - get_obj('Authorization Control').validate_approving_authority(self.doctype, + frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype, self.company, self.grand_total) # this sequence because outstanding may get -negative diff --git a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py index fa79c37d20..cb5cd31c5d 100644 --- a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py @@ -19,7 +19,7 @@ class TestPurchaseInvoice(unittest.TestCase): set_perpetual_inventory(0) self.assertTrue(not cint(frappe.defaults.get_global_default("auto_accounting_for_stock"))) - wrapper = frappe.get_doc(copy=test_records[0]) + wrapper = frappe.copy_doc(test_records[0]) wrapper.insert() wrapper.submit() wrapper.load_from_db() @@ -45,7 +45,7 @@ class TestPurchaseInvoice(unittest.TestCase): set_perpetual_inventory(1) self.assertEqual(cint(frappe.defaults.get_global_default("auto_accounting_for_stock")), 1) - pi = frappe.get_doc(copy=test_records[1]) + pi = frappe.copy_doc(test_records[1]) pi.insert() pi.submit() @@ -73,7 +73,7 @@ class TestPurchaseInvoice(unittest.TestCase): set_perpetual_inventory() self.assertEqual(cint(frappe.defaults.get_global_default("auto_accounting_for_stock")), 1) - pi = frappe.get_doc(copy=test_records[1]) + pi = frappe.copy_doc(test_records[1]) pi.doclist[1].item_code = "_Test Non Stock Item" pi.doclist[1].expense_account = "_Test Account Cost for Goods Sold - _TC" pi.doclist.pop(2) @@ -99,7 +99,7 @@ class TestPurchaseInvoice(unittest.TestCase): set_perpetual_inventory(0) def test_purchase_invoice_calculation(self): - wrapper = frappe.get_doc(copy=test_records[0]) + wrapper = frappe.copy_doc(test_records[0]) wrapper.insert() wrapper.load_from_db() @@ -132,7 +132,7 @@ class TestPurchaseInvoice(unittest.TestCase): self.assertEqual(tax.total, expected_values[i][2]) def test_purchase_invoice_with_subcontracted_item(self): - wrapper = frappe.get_doc(copy=test_records[0]) + wrapper = frappe.copy_doc(test_records[0]) wrapper.doclist[1].item_code = "_Test FG Item" wrapper.insert() wrapper.load_from_db() @@ -169,11 +169,11 @@ class TestPurchaseInvoice(unittest.TestCase): from erpnext.accounts.doctype.journal_voucher.test_journal_voucher \ import test_records as jv_test_records - jv = frappe.get_doc(copy=jv_test_records[1]) + jv = frappe.copy_doc(jv_test_records[1]) jv.insert() jv.submit() - pi = frappe.get_doc(copy=test_records[0]) + pi = frappe.copy_doc(test_records[0]) pi.append("advance_allocation_details", { "journal_voucher": jv.name, "jv_detail_no": jv.doclist[1].name, @@ -198,212 +198,4 @@ class TestPurchaseInvoice(unittest.TestCase): self.assertTrue(not frappe.db.sql("""select name from `tabJournal Voucher Detail` where against_voucher=%s""", pi.name)) -test_records = [ - [ - # parent - { - "doctype": "Purchase Invoice", - "naming_series": "BILL", - "supplier_name": "_Test Supplier", - "credit_to": "_Test Supplier - _TC", - "bill_no": "NA", - "posting_date": "2013-02-03", - "fiscal_year": "_Test Fiscal Year 2013", - "company": "_Test Company", - "currency": "INR", - "conversion_rate": 1, - "grand_total_import": 0, # for feed - "buying_price_list": "_Test Price List" - }, - # items - { - "doctype": "Purchase Invoice Item", - "parentfield": "entries", - "item_code": "_Test Item Home Desktop 100", - "item_name": "_Test Item Home Desktop 100", - "qty": 10, - "rate": 50, - "amount": 500, - "base_rate": 50, - "base_amount": 500, - "uom": "_Test UOM", - "item_tax_rate": json.dumps({"_Test Account Excise Duty - _TC": 10}), - "expense_account": "_Test Account Cost for Goods Sold - _TC", - "cost_center": "_Test Cost Center - _TC", - "conversion_factor": 1.0, - - }, - { - "doctype": "Purchase Invoice Item", - "parentfield": "entries", - "item_code": "_Test Item Home Desktop 200", - "item_name": "_Test Item Home Desktop 200", - "qty": 5, - "rate": 150, - "amount": 750, - "base_rate": 150, - "base_amount": 750, - "uom": "_Test UOM", - "expense_account": "_Test Account Cost for Goods Sold - _TC", - "cost_center": "_Test Cost Center - _TC", - "conversion_factor": 1.0, - }, - # taxes - { - "doctype": "Purchase Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "Actual", - "account_head": "_Test Account Shipping Charges - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "Shipping Charges", - "category": "Valuation and Total", - "add_deduct_tax": "Add", - "rate": 100 - }, - { - "doctype": "Purchase Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "On Net Total", - "account_head": "_Test Account Customs Duty - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "Customs Duty", - "category": "Valuation", - "add_deduct_tax": "Add", - "rate": 10 - }, - { - "doctype": "Purchase Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "On Net Total", - "account_head": "_Test Account Excise Duty - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "Excise Duty", - "category": "Total", - "add_deduct_tax": "Add", - "rate": 12 - }, - { - "doctype": "Purchase Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "On Previous Row Amount", - "account_head": "_Test Account Education Cess - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "Education Cess", - "category": "Total", - "add_deduct_tax": "Add", - "rate": 2, - "row_id": 3 - }, - { - "doctype": "Purchase Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "On Previous Row Amount", - "account_head": "_Test Account S&H Education Cess - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "S&H Education Cess", - "category": "Total", - "add_deduct_tax": "Add", - "rate": 1, - "row_id": 3 - }, - { - "doctype": "Purchase Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "On Previous Row Total", - "account_head": "_Test Account CST - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "CST", - "category": "Total", - "add_deduct_tax": "Add", - "rate": 2, - "row_id": 5 - }, - { - "doctype": "Purchase Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "On Net Total", - "account_head": "_Test Account VAT - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "VAT", - "category": "Total", - "add_deduct_tax": "Add", - "rate": 12.5 - }, - { - "doctype": "Purchase Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "On Previous Row Total", - "account_head": "_Test Account Discount - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "Discount", - "category": "Total", - "add_deduct_tax": "Deduct", - "rate": 10, - "row_id": 7 - }, - ], - [ - # parent - { - "doctype": "Purchase Invoice", - "naming_series": "_T-Purchase Invoice-", - "supplier_name": "_Test Supplier", - "credit_to": "_Test Supplier - _TC", - "bill_no": "NA", - "posting_date": "2013-02-03", - "fiscal_year": "_Test Fiscal Year 2013", - "company": "_Test Company", - "currency": "INR", - "conversion_rate": 1.0, - "grand_total_import": 0, # for feed - "buying_price_list": "_Test Price List" - }, - # items - { - "doctype": "Purchase Invoice Item", - "parentfield": "entries", - "item_code": "_Test Item", - "item_name": "_Test Item", - "qty": 10.0, - "rate": 50.0, - "uom": "_Test UOM", - "expense_account": "_Test Account Cost for Goods Sold - _TC", - "cost_center": "_Test Cost Center - _TC", - "conversion_factor": 1.0, - }, - # taxes - { - "doctype": "Purchase Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "Actual", - "account_head": "_Test Account Shipping Charges - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "Shipping Charges", - "category": "Valuation and Total", - "add_deduct_tax": "Add", - "rate": 100.0 - }, - { - "doctype": "Purchase Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "Actual", - "account_head": "_Test Account VAT - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "VAT", - "category": "Total", - "add_deduct_tax": "Add", - "rate": 120.0 - }, - { - "doctype": "Purchase Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "Actual", - "account_head": "_Test Account Customs Duty - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "Customs Duty", - "category": "Valuation", - "add_deduct_tax": "Add", - "rate": 150.0 - }, - ] -] \ No newline at end of file +test_records = frappe.get_test_records('Purchase Invoice') \ No newline at end of file diff --git a/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.txt b/erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.json similarity index 100% rename from erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.txt rename to erpnext/accounts/doctype/purchase_invoice_advance/purchase_invoice_advance.json diff --git a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json similarity index 100% rename from erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.txt rename to erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.txt b/erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.json similarity index 100% rename from erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.txt rename to erpnext/accounts/doctype/purchase_taxes_and_charges/purchase_taxes_and_charges.json diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.txt b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.json similarity index 100% rename from erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.txt rename to erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.json diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.txt b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json similarity index 100% rename from erpnext/accounts/doctype/sales_invoice/sales_invoice.txt rename to erpnext/accounts/doctype/sales_invoice/sales_invoice.json diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 5bb8df81b5..d55d3a5676 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -11,7 +11,6 @@ from frappe.utils import add_days, cint, cstr, date_diff, flt, getdate, nowdate, from frappe.utils import comma_and from frappe.model.naming import make_autoname -from frappe.model.code import get_obj from frappe import _, msgprint from erpnext.accounts.party import get_party_account, get_due_date @@ -78,7 +77,7 @@ class SalesInvoice(SellingController): else: # Check for Approving Authority if not self.recurring_id: - get_obj('Authorization Control').validate_approving_authority(self.doctype, + frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype, self.company, self.grand_total, self) self.check_prev_docstatus() diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index 87c8923887..4e366b3e5f 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -10,14 +10,14 @@ from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_per class TestSalesInvoice(unittest.TestCase): def make(self): - w = frappe.get_doc(copy=test_records[0]) + w = frappe.copy_doc(test_records[0]) w.is_pos = 0 w.insert() w.submit() return w def test_double_submission(self): - w = frappe.get_doc(copy=test_records[0]) + w = frappe.copy_doc(test_records[0]) w.docstatus = '0' w.insert() @@ -28,7 +28,7 @@ class TestSalesInvoice(unittest.TestCase): self.assertRaises(DocstatusTransitionError, w.submit) def test_timestamp_change(self): - w = frappe.get_doc(copy=test_records[0]) + w = frappe.copy_doc(test_records[0]) w.docstatus = '0' w.insert() @@ -43,7 +43,7 @@ class TestSalesInvoice(unittest.TestCase): self.assertRaises(TimestampMismatchError, w2.save) def test_sales_invoice_calculation_base_currency(self): - si = frappe.get_doc(copy=test_records[2]) + si = frappe.copy_doc(test_records[2]) si.insert() expected_values = { @@ -87,7 +87,7 @@ class TestSalesInvoice(unittest.TestCase): self.assertEquals(si.grand_total_export, 1627.05) def test_sales_invoice_calculation_export_currency(self): - si = frappe.get_doc(copy=test_records[2]) + si = frappe.copy_doc(test_records[2]) si.currency = "USD" si.conversion_rate = 50 si.doclist[1].rate = 1 @@ -137,7 +137,7 @@ class TestSalesInvoice(unittest.TestCase): self.assertEquals(si.grand_total_export, 32.54) def test_sales_invoice_discount_amount(self): - si = frappe.get_doc(copy=test_records[3]) + si = frappe.copy_doc(test_records[3]) si.discount_amount = 104.95 si.append("other_charges", { "doctype": "Sales Taxes and Charges", @@ -192,7 +192,7 @@ class TestSalesInvoice(unittest.TestCase): self.assertEquals(si.grand_total_export, 1500) def test_discount_amount_gl_entry(self): - si = frappe.get_doc(copy=test_records[3]) + si = frappe.copy_doc(test_records[3]) si.discount_amount = 104.95 si.append("other_charges", { "doctype": "Sales Taxes and Charges", @@ -240,7 +240,7 @@ class TestSalesInvoice(unittest.TestCase): self.assertFalse(gle) def test_inclusive_rate_validations(self): - si = frappe.get_doc(copy=test_records[2]) + si = frappe.copy_doc(test_records[2]) for i, tax in enumerate(si.get("other_charges")): tax.idx = i+1 @@ -258,7 +258,7 @@ class TestSalesInvoice(unittest.TestCase): def test_sales_invoice_calculation_base_currency_with_tax_inclusive_price(self): # prepare - si = frappe.get_doc(copy=test_records[3]) + si = frappe.copy_doc(test_records[3]) si.insert() expected_values = { @@ -303,7 +303,7 @@ class TestSalesInvoice(unittest.TestCase): def test_sales_invoice_calculation_export_currency_with_tax_inclusive_price(self): # prepare - si = frappe.get_doc(copy=test_records[3]) + si = frappe.copy_doc(test_records[3]) si.currency = "USD" si.conversion_rate = 50 si.doclist[1].price_list_rate = 55.56 @@ -403,7 +403,7 @@ class TestSalesInvoice(unittest.TestCase): def test_sales_invoice_gl_entry_without_aii(self): self.clear_stock_account_balance() set_perpetual_inventory(0) - si = frappe.get_doc(copy=test_records[1]) + si = frappe.copy_doc(test_records[1]) si.insert() si.submit() @@ -447,7 +447,7 @@ class TestSalesInvoice(unittest.TestCase): pos[0]["cash_bank_account"] = "_Test Account Bank Account - _TC" pos[0]["paid_amount"] = 600.0 - si = frappe.get_doc(copy=pos) + si = frappe.copy_doc(pos) si.insert() si.submit() @@ -500,7 +500,7 @@ class TestSalesInvoice(unittest.TestCase): # insert purchase receipt from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import test_records \ as pr_test_records - pr = frappe.get_doc(copy=pr_test_records[0]) + pr = frappe.copy_doc(pr_test_records[0]) pr.naming_series = "_T-Purchase Receipt-" pr.doclist[1].warehouse = "_Test Warehouse No Account - _TC" pr.insert() @@ -511,7 +511,7 @@ class TestSalesInvoice(unittest.TestCase): si_doclist[0]["posting_time"] = "12:05" si_doclist[1]["warehouse"] = "_Test Warehouse No Account - _TC" - si = frappe.get_doc(copy=si_doclist) + si = frappe.copy_doc(si_doclist) si.insert() si.submit() @@ -605,7 +605,7 @@ class TestSalesInvoice(unittest.TestCase): def _insert_purchase_receipt(self): from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import test_records \ as pr_test_records - pr = frappe.get_doc(copy=pr_test_records[0]) + pr = frappe.copy_doc(pr_test_records[0]) pr.naming_series = "_T-Purchase Receipt-" pr.insert() pr.submit() @@ -613,7 +613,7 @@ class TestSalesInvoice(unittest.TestCase): def _insert_delivery_note(self): from erpnext.stock.doctype.delivery_note.test_delivery_note import test_records \ as dn_test_records - dn = frappe.get_doc(copy=dn_test_records[0]) + dn = frappe.copy_doc(dn_test_records[0]) dn.naming_series = "_T-Delivery Note-" dn.insert() dn.submit() @@ -624,18 +624,18 @@ class TestSalesInvoice(unittest.TestCase): import test_records as pos_setting_test_records frappe.db.sql("""delete from `tabPOS Setting`""") - ps = frappe.get_doc(copy=pos_setting_test_records[0]) + ps = frappe.copy_doc(pos_setting_test_records[0]) ps.insert() def test_sales_invoice_with_advance(self): from erpnext.accounts.doctype.journal_voucher.test_journal_voucher \ import test_records as jv_test_records - jv = frappe.get_doc(copy=jv_test_records[0]) + jv = frappe.copy_doc(jv_test_records[0]) jv.insert() jv.submit() - si = frappe.get_doc(copy=test_records[0]) + si = frappe.copy_doc(test_records[0]) si.append("advance_adjustment_details", { "doctype": "Sales Invoice Advance", "journal_voucher": jv.name, @@ -665,7 +665,7 @@ class TestSalesInvoice(unittest.TestCase): from frappe.utils import get_first_day, get_last_day, add_to_date, nowdate, getdate from erpnext.accounts.utils import get_fiscal_year today = nowdate() - base_si = frappe.get_doc(copy=test_records[0]) + base_si = frappe.copy_doc(test_records[0]) base_si.update({ "convert_into_recurring_invoice": 1, "recurring_type": "Monthly", @@ -678,13 +678,13 @@ class TestSalesInvoice(unittest.TestCase): }) # monthly - si1 = frappe.get_doc(copy=base_si.doclist) + si1 = frappe.copy_doc(base_si.doclist) si1.insert() si1.submit() self._test_recurring_invoice(si1, True) # monthly without a first and last day period - si2 = frappe.get_doc(copy=base_si.doclist) + si2 = frappe.copy_doc(base_si.doclist) si2.update({ "invoice_period_from_date": today, "invoice_period_to_date": add_to_date(today, days=30) @@ -694,7 +694,7 @@ class TestSalesInvoice(unittest.TestCase): self._test_recurring_invoice(si2, False) # quarterly - si3 = frappe.get_doc(copy=base_si.doclist) + si3 = frappe.copy_doc(base_si.doclist) si3.update({ "recurring_type": "Quarterly", "invoice_period_from_date": get_first_day(today), @@ -705,7 +705,7 @@ class TestSalesInvoice(unittest.TestCase): self._test_recurring_invoice(si3, True) # quarterly without a first and last day period - si4 = frappe.get_doc(copy=base_si.doclist) + si4 = frappe.copy_doc(base_si.doclist) si4.update({ "recurring_type": "Quarterly", "invoice_period_from_date": today, @@ -716,7 +716,7 @@ class TestSalesInvoice(unittest.TestCase): self._test_recurring_invoice(si4, False) # yearly - si5 = frappe.get_doc(copy=base_si.doclist) + si5 = frappe.copy_doc(base_si.doclist) si5.update({ "recurring_type": "Yearly", "invoice_period_from_date": get_first_day(today), @@ -727,7 +727,7 @@ class TestSalesInvoice(unittest.TestCase): self._test_recurring_invoice(si5, True) # yearly without a first and last day period - si6 = frappe.get_doc(copy=base_si.doclist) + si6 = frappe.copy_doc(base_si.doclist) si6.update({ "recurring_type": "Yearly", "invoice_period_from_date": today, @@ -738,7 +738,7 @@ class TestSalesInvoice(unittest.TestCase): self._test_recurring_invoice(si6, False) # change posting date but keep recuring day to be today - si7 = frappe.get_doc(copy=base_si.doclist) + si7 = frappe.copy_doc(base_si.doclist) si7.update({ "posting_date": add_to_date(today, days=-1) }) @@ -811,7 +811,7 @@ class TestSalesInvoice(unittest.TestCase): se = make_serialized_item() serial_nos = get_serial_nos(se.doclist[1].serial_no) - si = frappe.get_doc(copy=test_records[0]) + si = frappe.copy_doc(test_records[0]) si.update_stock = 1 si.doclist[1].item_code = "_Test Serialized Item With Series" si.doclist[1].qty = 1 @@ -849,7 +849,7 @@ class TestSalesInvoice(unittest.TestCase): sr.status = "Not Available" sr.save() - si = frappe.get_doc(copy=test_records[0]) + si = frappe.copy_doc(test_records[0]) si.update_stock = 1 si.doclist[1].item_code = "_Test Serialized Item With Series" si.doclist[1].qty = 1 @@ -860,386 +860,4 @@ class TestSalesInvoice(unittest.TestCase): test_dependencies = ["Journal Voucher", "POS Setting", "Contact", "Address"] -test_records = [ - [ - { - "naming_series": "_T-Sales Invoice-", - "company": "_Test Company", - "is_pos": 0, - "conversion_rate": 1.0, - "currency": "INR", - "debit_to": "_Test Customer - _TC", - "customer": "_Test Customer", - "customer_name": "_Test Customer", - "doctype": "Sales Invoice", - "due_date": "2013-01-23", - "fiscal_year": "_Test Fiscal Year 2013", - "grand_total": 561.8, - "grand_total_export": 561.8, - "net_total": 500.0, - "plc_conversion_rate": 1.0, - "posting_date": "2013-01-23", - "price_list_currency": "INR", - "selling_price_list": "_Test Price List", - "territory": "_Test Territory" - }, - { - "base_amount": 500.0, - "base_rate": 500.0, - "description": "138-CMS Shoe", - "doctype": "Sales Invoice Item", - "amount": 500.0, - "rate": 500.0, - "income_account": "Sales - _TC", - "cost_center": "_Test Cost Center - _TC", - "item_name": "138-CMS Shoe", - "parentfield": "entries", - "qty": 1.0 - }, - { - "account_head": "_Test Account VAT - _TC", - "charge_type": "On Net Total", - "description": "VAT", - "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", - "rate": 6, - }, - { - "account_head": "_Test Account Service Tax - _TC", - "charge_type": "On Net Total", - "description": "Service Tax", - "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", - "rate": 6.36, - }, - { - "parentfield": "sales_team", - "doctype": "Sales Team", - "sales_person": "_Test Sales Person 1", - "allocated_percentage": 65.5, - }, - { - "parentfield": "sales_team", - "doctype": "Sales Team", - "sales_person": "_Test Sales Person 2", - "allocated_percentage": 34.5, - }, - ], - [ - { - "naming_series": "_T-Sales Invoice-", - "company": "_Test Company", - "is_pos": 0, - "conversion_rate": 1.0, - "currency": "INR", - "debit_to": "_Test Customer - _TC", - "customer": "_Test Customer", - "customer_name": "_Test Customer", - "doctype": "Sales Invoice", - "due_date": "2013-01-23", - "fiscal_year": "_Test Fiscal Year 2013", - "grand_total": 630.0, - "grand_total_export": 630.0, - "net_total": 500.0, - "plc_conversion_rate": 1.0, - "posting_date": "2013-03-07", - "price_list_currency": "INR", - "selling_price_list": "_Test Price List", - "territory": "_Test Territory" - }, - { - "item_code": "_Test Item", - "item_name": "_Test Item", - "description": "_Test Item", - "doctype": "Sales Invoice Item", - "parentfield": "entries", - "qty": 1.0, - "base_rate": 500.0, - "base_amount": 500.0, - "price_list_rate": 500.0, - "amount": 500.0, - "income_account": "Sales - _TC", - "expense_account": "_Test Account Cost for Goods Sold - _TC", - "cost_center": "_Test Cost Center - _TC", - }, - { - "account_head": "_Test Account VAT - _TC", - "charge_type": "On Net Total", - "description": "VAT", - "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", - "rate": 16, - }, - { - "account_head": "_Test Account Service Tax - _TC", - "charge_type": "On Net Total", - "description": "Service Tax", - "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", - "rate": 10 - } - ], - [ - { - "naming_series": "_T-Sales Invoice-", - "company": "_Test Company", - "is_pos": 0, - "conversion_rate": 1.0, - "currency": "INR", - "debit_to": "_Test Customer - _TC", - "customer": "_Test Customer", - "customer_name": "_Test Customer", - "doctype": "Sales Invoice", - "due_date": "2013-01-23", - "fiscal_year": "_Test Fiscal Year 2013", - "grand_total_export": 0, - "plc_conversion_rate": 1.0, - "posting_date": "2013-01-23", - "price_list_currency": "INR", - "selling_price_list": "_Test Price List", - "territory": "_Test Territory", - }, - # items - { - "doctype": "Sales Invoice Item", - "parentfield": "entries", - "item_code": "_Test Item Home Desktop 100", - "item_name": "_Test Item Home Desktop 100", - "qty": 10, - "price_list_rate": 50, - "rate": 50, - "stock_uom": "_Test UOM", - "item_tax_rate": json.dumps({"_Test Account Excise Duty - _TC": 10}), - "income_account": "Sales - _TC", - "cost_center": "_Test Cost Center - _TC", - - }, - { - "doctype": "Sales Invoice Item", - "parentfield": "entries", - "item_code": "_Test Item Home Desktop 200", - "item_name": "_Test Item Home Desktop 200", - "qty": 5, - "price_list_rate": 150, - "rate": 150, - "stock_uom": "_Test UOM", - "income_account": "Sales - _TC", - "cost_center": "_Test Cost Center - _TC", - - }, - # taxes - { - "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "Actual", - "account_head": "_Test Account Shipping Charges - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "Shipping Charges", - "rate": 100 - }, - { - "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "On Net Total", - "account_head": "_Test Account Customs Duty - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "Customs Duty", - "rate": 10 - }, - { - "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "On Net Total", - "account_head": "_Test Account Excise Duty - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "Excise Duty", - "rate": 12 - }, - { - "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "On Previous Row Amount", - "account_head": "_Test Account Education Cess - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "Education Cess", - "rate": 2, - "row_id": 3 - }, - { - "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "On Previous Row Amount", - "account_head": "_Test Account S&H Education Cess - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "S&H Education Cess", - "rate": 1, - "row_id": 3 - }, - { - "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "On Previous Row Total", - "account_head": "_Test Account CST - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "CST", - "rate": 2, - "row_id": 5 - }, - { - "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "On Net Total", - "account_head": "_Test Account VAT - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "VAT", - "rate": 12.5 - }, - { - "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "On Previous Row Total", - "account_head": "_Test Account Discount - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "Discount", - "rate": -10, - "row_id": 7 - }, - ], - [ - { - "naming_series": "_T-Sales Invoice-", - "company": "_Test Company", - "is_pos": 0, - "conversion_rate": 1.0, - "currency": "INR", - "debit_to": "_Test Customer - _TC", - "customer": "_Test Customer", - "customer_name": "_Test Customer", - "doctype": "Sales Invoice", - "due_date": "2013-01-23", - "fiscal_year": "_Test Fiscal Year 2013", - "grand_total_export": 0, - "plc_conversion_rate": 1.0, - "posting_date": "2013-01-23", - "price_list_currency": "INR", - "selling_price_list": "_Test Price List", - "territory": "_Test Territory", - }, - # items - { - "doctype": "Sales Invoice Item", - "parentfield": "entries", - "item_code": "_Test Item Home Desktop 100", - "item_name": "_Test Item Home Desktop 100", - "qty": 10, - "price_list_rate": 62.5, - "stock_uom": "_Test UOM", - "item_tax_rate": json.dumps({"_Test Account Excise Duty - _TC": 10}), - "income_account": "Sales - _TC", - "cost_center": "_Test Cost Center - _TC", - - }, - { - "doctype": "Sales Invoice Item", - "parentfield": "entries", - "item_code": "_Test Item Home Desktop 200", - "item_name": "_Test Item Home Desktop 200", - "qty": 5, - "price_list_rate": 190.66, - "stock_uom": "_Test UOM", - "income_account": "Sales - _TC", - "cost_center": "_Test Cost Center - _TC", - - }, - # taxes - { - "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "On Net Total", - "account_head": "_Test Account Excise Duty - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "Excise Duty", - "rate": 12, - "included_in_print_rate": 1, - "idx": 1 - }, - { - "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "On Previous Row Amount", - "account_head": "_Test Account Education Cess - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "Education Cess", - "rate": 2, - "row_id": 1, - "included_in_print_rate": 1, - "idx": 2 - }, - { - "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "On Previous Row Amount", - "account_head": "_Test Account S&H Education Cess - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "S&H Education Cess", - "rate": 1, - "row_id": 1, - "included_in_print_rate": 1, - "idx": 3 - }, - { - "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "On Previous Row Total", - "account_head": "_Test Account CST - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "CST", - "rate": 2, - "row_id": 3, - "included_in_print_rate": 1, - "idx": 4 - }, - { - "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "On Net Total", - "account_head": "_Test Account VAT - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "VAT", - "rate": 12.5, - "included_in_print_rate": 1, - "idx": 5 - }, - { - "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "On Net Total", - "account_head": "_Test Account Customs Duty - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "Customs Duty", - "rate": 10, - "idx": 6 - }, - { - "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "Actual", - "account_head": "_Test Account Shipping Charges - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "Shipping Charges", - "rate": 100, - "idx": 7 - }, - { - "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "On Previous Row Total", - "account_head": "_Test Account Discount - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "Discount", - "rate": -10, - "row_id": 7, - "idx": 8 - }, - ], -] \ No newline at end of file +test_records = frappe.get_test_records('Sales Invoice') \ No newline at end of file diff --git a/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.txt b/erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.json similarity index 100% rename from erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.txt rename to erpnext/accounts/doctype/sales_invoice_advance/sales_invoice_advance.json diff --git a/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.txt b/erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json similarity index 100% rename from erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.txt rename to erpnext/accounts/doctype/sales_invoice_item/sales_invoice_item.json diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.txt b/erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.json similarity index 100% rename from erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.txt rename to erpnext/accounts/doctype/sales_taxes_and_charges/sales_taxes_and_charges.json diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.txt b/erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.json similarity index 100% rename from erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.txt rename to erpnext/accounts/doctype/sales_taxes_and_charges_master/sales_taxes_and_charges_master.json diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges_master/test_sales_taxes_and_charges_master.py b/erpnext/accounts/doctype/sales_taxes_and_charges_master/test_sales_taxes_and_charges_master.py index 670edc44e0..e31474d37f 100644 --- a/erpnext/accounts/doctype/sales_taxes_and_charges_master/test_sales_taxes_and_charges_master.py +++ b/erpnext/accounts/doctype/sales_taxes_and_charges_master/test_sales_taxes_and_charges_master.py @@ -1,154 +1,6 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [ - [ - { - "doctype": "Sales Taxes and Charges Master", - "title": "_Test Sales Taxes and Charges Master", - "company": "_Test Company" - }, - { - "account_head": "_Test Account VAT - _TC", - "charge_type": "On Net Total", - "description": "VAT", - "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", - "rate": 6, - }, - { - "account_head": "_Test Account Service Tax - _TC", - "charge_type": "On Net Total", - "description": "Service Tax", - "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", - "rate": 6.36, - }, - { - "doctype": "Applicable Territory", - "parentfield": "valid_for_territories", - "territory": "All Territories" - }, - { - "doctype": "Applicable Territory", - "parentfield": "valid_for_territories", - "territory": "_Test Territory Rest Of The World" - } - ], - [ - { - "doctype": "Sales Taxes and Charges Master", - "title": "_Test India Tax Master", - "company": "_Test Company" - }, - { - "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "Actual", - "account_head": "_Test Account Shipping Charges - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "Shipping Charges", - "rate": 100 - }, - { - "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "On Net Total", - "account_head": "_Test Account Customs Duty - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "Customs Duty", - "rate": 10 - }, - { - "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "On Net Total", - "account_head": "_Test Account Excise Duty - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "Excise Duty", - "rate": 12 - }, - { - "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "On Previous Row Amount", - "account_head": "_Test Account Education Cess - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "Education Cess", - "rate": 2, - "row_id": 3 - }, - { - "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "On Previous Row Amount", - "account_head": "_Test Account S&H Education Cess - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "S&H Education Cess", - "rate": 1, - "row_id": 3 - }, - { - "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "On Previous Row Total", - "account_head": "_Test Account CST - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "CST", - "rate": 2, - "row_id": 5 - }, - { - "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "On Net Total", - "account_head": "_Test Account VAT - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "VAT", - "rate": 12.5 - }, - { - "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", - "charge_type": "On Previous Row Total", - "account_head": "_Test Account Discount - _TC", - "cost_center": "_Test Cost Center - _TC", - "description": "Discount", - "rate": -10, - "row_id": 7 - }, - { - "doctype": "Applicable Territory", - "parentfield": "valid_for_territories", - "territory": "_Test Territory India" - } - ], - [ - { - "doctype": "Sales Taxes and Charges Master", - "title": "_Test Sales Taxes and Charges Master - Rest of the World", - "company": "_Test Company" - }, - { - "account_head": "_Test Account VAT - _TC", - "charge_type": "On Net Total", - "description": "VAT", - "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", - "rate": 12, - }, - { - "account_head": "_Test Account Service Tax - _TC", - "charge_type": "On Net Total", - "description": "Service Tax", - "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", - "rate": 4, - }, - { - "doctype": "Applicable Territory", - "parentfield": "valid_for_territories", - "territory": "_Test Territory Rest Of The World" - } - ], -] \ No newline at end of file + +import frappe +test_records = frappe.get_test_records('Sales Taxes And Charges Master') \ No newline at end of file diff --git a/erpnext/accounts/doctype/shipping_rule/shipping_rule.txt b/erpnext/accounts/doctype/shipping_rule/shipping_rule.json similarity index 100% rename from erpnext/accounts/doctype/shipping_rule/shipping_rule.txt rename to erpnext/accounts/doctype/shipping_rule/shipping_rule.json diff --git a/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py b/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py index fe763e7438..0f41a567cd 100644 --- a/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py +++ b/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py @@ -7,12 +7,12 @@ from erpnext.accounts.doctype.shipping_rule.shipping_rule import FromGreaterThan class TestShippingRule(unittest.TestCase): def test_from_greater_than_to(self): - shipping_rule = frappe.get_doc(copy=test_records[0]) + shipping_rule = frappe.copy_doc(test_records[0]) shipping_rule.doclist[1].from_value = 101 self.assertRaises(FromGreaterThanToError, shipping_rule.insert) def test_many_zero_to_values(self): - shipping_rule = frappe.get_doc(copy=test_records[0]) + shipping_rule = frappe.copy_doc(test_records[0]) shipping_rule.doclist[1].to_value = 0 self.assertRaises(ManyBlankToValuesError, shipping_rule.insert) @@ -24,120 +24,11 @@ class TestShippingRule(unittest.TestCase): ((50, 150), (25, 175)), ((50, 150), (50, 150)), ]: - shipping_rule = frappe.get_doc(copy=test_records[0]) + shipping_rule = frappe.copy_doc(test_records[0]) shipping_rule.doclist[1].from_value = range_a[0] shipping_rule.doclist[1].to_value = range_a[1] shipping_rule.doclist[2].from_value = range_b[0] shipping_rule.doclist[2].to_value = range_b[1] self.assertRaises(OverlappingConditionError, shipping_rule.insert) -test_records = [ - [ - { - "doctype": "Shipping Rule", - "label": "_Test Shipping Rule", - "name": "_Test Shipping Rule", - "calculate_based_on": "Net Total", - "company": "_Test Company", - "account": "_Test Account Shipping Charges - _TC", - "cost_center": "_Test Cost Center - _TC" - }, - { - "doctype": "Shipping Rule Condition", - "parentfield": "shipping_rule_conditions", - "from_value": 0, - "to_value": 100, - "shipping_amount": 50.0 - }, - { - "doctype": "Shipping Rule Condition", - "parentfield": "shipping_rule_conditions", - "from_value": 101, - "to_value": 200, - "shipping_amount": 100.0 - }, - { - "doctype": "Shipping Rule Condition", - "parentfield": "shipping_rule_conditions", - "from_value": 201, - "shipping_amount": 0.0 - }, - { - "doctype": "Applicable Territory", - "parentfield": "valid_for_territories", - "territory": "_Test Territory" - } - ], - [ - { - "doctype": "Shipping Rule", - "name": "_Test Shipping Rule - India", - "label": "_Test Shipping Rule - India", - "calculate_based_on": "Net Total", - "company": "_Test Company", - "account": "_Test Account Shipping Charges - _TC", - "cost_center": "_Test Cost Center - _TC" - }, - { - "doctype": "Shipping Rule Condition", - "parentfield": "shipping_rule_conditions", - "from_value": 0, - "to_value": 100, - "shipping_amount": 50.0 - }, - { - "doctype": "Shipping Rule Condition", - "parentfield": "shipping_rule_conditions", - "from_value": 101, - "to_value": 200, - "shipping_amount": 100.0 - }, - { - "doctype": "Shipping Rule Condition", - "parentfield": "shipping_rule_conditions", - "from_value": 201, - "shipping_amount": 0.0 - }, - { - "doctype": "Applicable Territory", - "parentfield": "valid_for_territories", - "territory": "_Test Territory India" - } - ], - [ - { - "doctype": "Shipping Rule", - "name": "_Test Shipping Rule - Rest of the World", - "label": "_Test Shipping Rule - Rest of the World", - "calculate_based_on": "Net Total", - "company": "_Test Company", - "account": "_Test Account Shipping Charges - _TC", - "cost_center": "_Test Cost Center - _TC" - }, - { - "doctype": "Shipping Rule Condition", - "parentfield": "shipping_rule_conditions", - "from_value": 0, - "to_value": 1000, - "shipping_amount": 500.0 - }, - { - "doctype": "Shipping Rule Condition", - "parentfield": "shipping_rule_conditions", - "from_value": 1001, - "to_value": 2000, - "shipping_amount": 1000.0 - }, - { - "doctype": "Shipping Rule Condition", - "parentfield": "shipping_rule_conditions", - "from_value": 2001, - "shipping_amount": 1500.0 - }, - { - "doctype": "Applicable Territory", - "parentfield": "valid_for_territories", - "territory": "_Test Territory Rest Of The World" - } - ], -] \ No newline at end of file +test_records = frappe.get_test_records('Shipping Rule') \ No newline at end of file diff --git a/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.txt b/erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.json similarity index 100% rename from erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.txt rename to erpnext/accounts/doctype/shipping_rule_condition/shipping_rule_condition.json diff --git a/erpnext/accounts/page/accounts_browser/accounts_browser.txt b/erpnext/accounts/page/accounts_browser/accounts_browser.json similarity index 100% rename from erpnext/accounts/page/accounts_browser/accounts_browser.txt rename to erpnext/accounts/page/accounts_browser/accounts_browser.json diff --git a/erpnext/accounts/page/financial_analytics/financial_analytics.txt b/erpnext/accounts/page/financial_analytics/financial_analytics.json similarity index 100% rename from erpnext/accounts/page/financial_analytics/financial_analytics.txt rename to erpnext/accounts/page/financial_analytics/financial_analytics.json diff --git a/erpnext/accounts/page/trial_balance/trial_balance.txt b/erpnext/accounts/page/trial_balance/trial_balance.json similarity index 100% rename from erpnext/accounts/page/trial_balance/trial_balance.txt rename to erpnext/accounts/page/trial_balance/trial_balance.json diff --git a/erpnext/accounts/report/accounts_payable/accounts_payable.txt b/erpnext/accounts/report/accounts_payable/accounts_payable.json similarity index 100% rename from erpnext/accounts/report/accounts_payable/accounts_payable.txt rename to erpnext/accounts/report/accounts_payable/accounts_payable.json diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.txt b/erpnext/accounts/report/accounts_receivable/accounts_receivable.json similarity index 100% rename from erpnext/accounts/report/accounts_receivable/accounts_receivable.txt rename to erpnext/accounts/report/accounts_receivable/accounts_receivable.json diff --git a/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.txt b/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.json similarity index 100% rename from erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.txt rename to erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.json diff --git a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.txt b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.json similarity index 100% rename from erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.txt rename to erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.json diff --git a/erpnext/accounts/report/budget_variance_report/budget_variance_report.txt b/erpnext/accounts/report/budget_variance_report/budget_variance_report.json similarity index 100% rename from erpnext/accounts/report/budget_variance_report/budget_variance_report.txt rename to erpnext/accounts/report/budget_variance_report/budget_variance_report.json diff --git a/erpnext/accounts/report/customer_account_head/customer_account_head.txt b/erpnext/accounts/report/customer_account_head/customer_account_head.json similarity index 100% rename from erpnext/accounts/report/customer_account_head/customer_account_head.txt rename to erpnext/accounts/report/customer_account_head/customer_account_head.json 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.json similarity index 100% rename from erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.txt rename to erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.json diff --git a/erpnext/accounts/report/general_ledger/general_ledger.txt b/erpnext/accounts/report/general_ledger/general_ledger.json similarity index 100% rename from erpnext/accounts/report/general_ledger/general_ledger.txt rename to erpnext/accounts/report/general_ledger/general_ledger.json diff --git a/erpnext/accounts/report/gross_profit/gross_profit.txt b/erpnext/accounts/report/gross_profit/gross_profit.json similarity index 100% rename from erpnext/accounts/report/gross_profit/gross_profit.txt rename to erpnext/accounts/report/gross_profit/gross_profit.json 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.json similarity index 100% rename from erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.txt rename to erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.json 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.json similarity index 100% rename from erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.txt rename to erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.json 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.json similarity index 100% rename from erpnext/accounts/report/ordered_items_to_be_billed/ordered_items_to_be_billed.txt rename to erpnext/accounts/report/ordered_items_to_be_billed/ordered_items_to_be_billed.json 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.json similarity index 100% rename from erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.txt rename to erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.json diff --git a/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.txt b/erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.json similarity index 100% rename from erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.txt rename to erpnext/accounts/report/purchase_invoice_trends/purchase_invoice_trends.json 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.json similarity index 100% rename from erpnext/accounts/report/purchase_order_items_to_be_billed/purchase_order_items_to_be_billed.txt rename to erpnext/accounts/report/purchase_order_items_to_be_billed/purchase_order_items_to_be_billed.json diff --git a/erpnext/accounts/report/purchase_register/purchase_register.txt b/erpnext/accounts/report/purchase_register/purchase_register.json similarity index 100% rename from erpnext/accounts/report/purchase_register/purchase_register.txt rename to erpnext/accounts/report/purchase_register/purchase_register.json 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.json similarity index 100% rename from erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.txt rename to erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.json diff --git a/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.txt b/erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.json similarity index 100% rename from erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.txt rename to erpnext/accounts/report/sales_invoice_trends/sales_invoice_trends.json diff --git a/erpnext/accounts/report/sales_partners_commission/sales_partners_commission.txt b/erpnext/accounts/report/sales_partners_commission/sales_partners_commission.json similarity index 100% rename from erpnext/accounts/report/sales_partners_commission/sales_partners_commission.txt rename to erpnext/accounts/report/sales_partners_commission/sales_partners_commission.json diff --git a/erpnext/accounts/report/sales_register/sales_register.txt b/erpnext/accounts/report/sales_register/sales_register.json similarity index 100% rename from erpnext/accounts/report/sales_register/sales_register.txt rename to erpnext/accounts/report/sales_register/sales_register.json diff --git a/erpnext/accounts/report/supplier_account_head/supplier_account_head.txt b/erpnext/accounts/report/supplier_account_head/supplier_account_head.json similarity index 100% rename from erpnext/accounts/report/supplier_account_head/supplier_account_head.txt rename to erpnext/accounts/report/supplier_account_head/supplier_account_head.json diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index e0c1e3ac12..b096cbf0c2 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -138,14 +138,14 @@ def reconcile_against_document(args): d['against_fld'] = against_fld[d['against_voucher_type']] # cancel JV - jv_obj = frappe.get_obj('Journal Voucher', d['voucher_no'], with_children=1) + jv_obj = frappe.get_doc('Journal Voucher', d['voucher_no']) jv_obj.make_gl_entries(cancel=1, adv_adj=1) # update ref in JV Detail update_against_doc(d, jv_obj) # re-submit JV - jv_obj = frappe.get_obj('Journal Voucher', d['voucher_no'], with_children =1) + jv_obj = frappe.get_doc('Journal Voucher', d['voucher_no']) jv_obj.make_gl_entries(cancel = 0, adv_adj =1) diff --git a/erpnext/buying/Print Format/Purchase Order Classic/Purchase Order Classic.txt b/erpnext/buying/Print Format/Purchase Order Classic/Purchase Order Classic.json similarity index 100% rename from erpnext/buying/Print Format/Purchase Order Classic/Purchase Order Classic.txt rename to erpnext/buying/Print Format/Purchase Order Classic/Purchase Order Classic.json diff --git a/erpnext/buying/Print Format/Purchase Order Modern/Purchase Order Modern.txt b/erpnext/buying/Print Format/Purchase Order Modern/Purchase Order Modern.json similarity index 100% rename from erpnext/buying/Print Format/Purchase Order Modern/Purchase Order Modern.txt rename to erpnext/buying/Print Format/Purchase Order Modern/Purchase Order Modern.json diff --git a/erpnext/buying/Print Format/Purchase Order Spartan/Purchase Order Spartan.txt b/erpnext/buying/Print Format/Purchase Order Spartan/Purchase Order Spartan.json similarity index 100% rename from erpnext/buying/Print Format/Purchase Order Spartan/Purchase Order Spartan.txt rename to erpnext/buying/Print Format/Purchase Order Spartan/Purchase Order Spartan.json diff --git a/erpnext/buying/doctype/buying_settings/buying_settings.txt b/erpnext/buying/doctype/buying_settings/buying_settings.json similarity index 100% rename from erpnext/buying/doctype/buying_settings/buying_settings.txt rename to erpnext/buying/doctype/buying_settings/buying_settings.json diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.txt b/erpnext/buying/doctype/purchase_common/purchase_common.json similarity index 100% rename from erpnext/buying/doctype/purchase_common/purchase_common.txt rename to erpnext/buying/doctype/purchase_common/purchase_common.json diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.txt b/erpnext/buying/doctype/purchase_order/purchase_order.json similarity index 100% rename from erpnext/buying/doctype/purchase_order/purchase_order.txt rename to erpnext/buying/doctype/purchase_order/purchase_order.json diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index f6ef8a2474..b8504977f6 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -6,7 +6,6 @@ import frappe from frappe.utils import cstr, flt -from frappe.model.code import get_obj from frappe import msgprint @@ -36,7 +35,7 @@ class PurchaseOrder(BuyingController): validate_status(self.status, ["Draft", "Submitted", "Stopped", "Cancelled"]) - pc_obj = get_obj(dt='Purchase Common') + pc_obj = frappe.get_doc(dt='Purchase Common') pc_obj.validate_for_items(self) self.check_for_stopped_status(pc_obj) @@ -68,7 +67,7 @@ class PurchaseOrder(BuyingController): d.prevdoc_detail_docname, "schedule_date") def get_last_purchase_rate(self): - get_obj('Purchase Common').get_last_purchase_rate(self) + frappe.get_doc('Purchase Common').get_last_purchase_rate(self) # Check for Stopped status def check_for_stopped_status(self, pc_obj): @@ -81,7 +80,7 @@ class PurchaseOrder(BuyingController): def update_bin(self, is_submit, is_stopped = 0): from erpnext.stock.utils import update_bin - pc_obj = get_obj('Purchase Common') + pc_obj = frappe.get_doc('Purchase Common') for d in self.get('po_details'): #1. Check if is_stock_item == 'Yes' if frappe.db.get_value("Item", d.item_code, "is_stock_item") == "Yes": @@ -144,12 +143,12 @@ class PurchaseOrder(BuyingController): msgprint(self.doctype + ": " + self.name + " has been %s." % ((status == 'Submitted') and 'Unstopped' or cstr(status))) def on_submit(self): - purchase_controller = frappe.get_obj("Purchase Common") + purchase_controller = frappe.get_doc("Purchase Common") self.update_prevdoc_status() self.update_bin(is_submit = 1, is_stopped = 0) - get_obj('Authorization Control').validate_approving_authority(self.doctype, + frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype, self.company, self.grand_total) purchase_controller.update_last_purchase_rate(self, is_submit = 1) @@ -157,7 +156,7 @@ class PurchaseOrder(BuyingController): frappe.db.set(self,'status','Submitted') def on_cancel(self): - pc_obj = get_obj(dt = 'Purchase Common') + pc_obj = frappe.get_doc(dt = 'Purchase Common') self.check_for_stopped_status(pc_obj) # Check if Purchase Receipt has been submitted against current Purchase Order diff --git a/erpnext/buying/doctype/purchase_order/test_purchase_order.py b/erpnext/buying/doctype/purchase_order/test_purchase_order.py index 997d6dc88d..0acb83688f 100644 --- a/erpnext/buying/doctype/purchase_order/test_purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/test_purchase_order.py @@ -11,7 +11,7 @@ class TestPurchaseOrder(unittest.TestCase): def test_make_purchase_receipt(self): from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_receipt - po = frappe.get_doc(copy=test_records[0]).insert() + po = frappe.copy_doc(test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_purchase_receipt, po.name) @@ -34,7 +34,7 @@ class TestPurchaseOrder(unittest.TestCase): from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_receipt - po = frappe.get_doc(copy=test_records[0]).insert() + po = frappe.copy_doc(test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_purchase_receipt, po.name) @@ -77,7 +77,7 @@ class TestPurchaseOrder(unittest.TestCase): def test_make_purchase_invoice(self): from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_invoice - po = frappe.get_doc(copy=test_records[0]).insert() + po = frappe.copy_doc(test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_purchase_invoice, po.name) @@ -93,58 +93,24 @@ class TestPurchaseOrder(unittest.TestCase): frappe.get_doc(pi).insert() def test_subcontracting(self): - po = frappe.get_doc(copy=test_records[0]) + po = frappe.copy_doc(test_records[0]) po.insert() self.assertEquals(len(po.get("po_raw_material_details")), 2) def test_warehouse_company_validation(self): from erpnext.stock.utils import InvalidWarehouseCompany - po = frappe.get_doc(copy=test_records[0]) + po = frappe.copy_doc(test_records[0]) po.company = "_Test Company 1" po.conversion_rate = 0.0167 self.assertRaises(InvalidWarehouseCompany, po.insert) def test_uom_integer_validation(self): from erpnext.utilities.transaction_base import UOMMustBeIntegerError - po = frappe.get_doc(copy=test_records[0]) + po = frappe.copy_doc(test_records[0]) po.doclist[1].qty = 3.4 self.assertRaises(UOMMustBeIntegerError, po.insert) test_dependencies = ["BOM"] -test_records = [ - [ - { - "company": "_Test Company", - "naming_series": "_T-Purchase Order-", - "conversion_rate": 1.0, - "currency": "INR", - "doctype": "Purchase Order", - "fiscal_year": "_Test Fiscal Year 2013", - "transaction_date": "2013-02-12", - "is_subcontracted": "Yes", - "supplier": "_Test Supplier", - "supplier_name": "_Test Supplier", - "net_total": 5000.0, - "grand_total": 5000.0, - "grand_total_import": 5000.0, - "buying_price_list": "_Test Price List" - }, - { - "conversion_factor": 1.0, - "description": "_Test FG Item", - "doctype": "Purchase Order Item", - "item_code": "_Test FG Item", - "item_name": "_Test FG Item", - "parentfield": "po_details", - "qty": 10.0, - "rate": 500.0, - "base_amount": 5000.0, - "warehouse": "_Test Warehouse - _TC", - "stock_uom": "_Test UOM", - "uom": "_Test UOM", - "schedule_date": "2013-03-01" - } - ], -] \ No newline at end of file +test_records = frappe.get_test_records('Purchase Order') \ No newline at end of file diff --git a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.txt b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json similarity index 100% rename from erpnext/buying/doctype/purchase_order_item/purchase_order_item.txt rename to erpnext/buying/doctype/purchase_order_item/purchase_order_item.json diff --git a/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.txt b/erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.json similarity index 100% rename from erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.txt rename to erpnext/buying/doctype/purchase_order_item_supplied/purchase_order_item_supplied.json diff --git a/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.txt b/erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.json similarity index 100% rename from erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.txt rename to erpnext/buying/doctype/purchase_receipt_item_supplied/purchase_receipt_item_supplied.json diff --git a/erpnext/buying/doctype/quality_inspection/quality_inspection.txt b/erpnext/buying/doctype/quality_inspection/quality_inspection.json similarity index 100% rename from erpnext/buying/doctype/quality_inspection/quality_inspection.txt rename to erpnext/buying/doctype/quality_inspection/quality_inspection.json diff --git a/erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.txt b/erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.json similarity index 100% rename from erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.txt rename to erpnext/buying/doctype/quality_inspection_reading/quality_inspection_reading.json diff --git a/erpnext/buying/doctype/supplier/supplier.txt b/erpnext/buying/doctype/supplier/supplier.json similarity index 100% rename from erpnext/buying/doctype/supplier/supplier.txt rename to erpnext/buying/doctype/supplier/supplier.json diff --git a/erpnext/buying/doctype/supplier/test_supplier.py b/erpnext/buying/doctype/supplier/test_supplier.py index d5bd4cb24b..1f7c3e0b81 100644 --- a/erpnext/buying/doctype/supplier/test_supplier.py +++ b/erpnext/buying/doctype/supplier/test_supplier.py @@ -1,11 +1,6 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [ - [{ - "doctype": "Supplier", - "supplier_name": "_Test Supplier", - "supplier_type": "_Test Supplier Type", - "company": "_Test Company" - }] -] \ No newline at end of file + +import frappe +test_records = frappe.get_test_records('Supplier') \ No newline at end of file diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.txt b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.json similarity index 100% rename from erpnext/buying/doctype/supplier_quotation/supplier_quotation.txt rename to erpnext/buying/doctype/supplier_quotation/supplier_quotation.json diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py index 6fced379a3..004954f2bc 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals import frappe -from frappe.model.code import get_obj from erpnext.controllers.buying_controller import BuyingController class SupplierQuotation(BuyingController): @@ -48,7 +47,7 @@ class SupplierQuotation(BuyingController): def validate_common(self): - pc = get_obj('Purchase Common') + pc = frappe.get_doc('Purchase Common') pc.validate_for_items(self) @frappe.whitelist() diff --git a/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py b/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py index fc1d25d398..d526fd15f6 100644 --- a/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py +++ b/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py @@ -11,7 +11,7 @@ class TestPurchaseOrder(unittest.TestCase): def test_make_purchase_order(self): from erpnext.buying.doctype.supplier_quotation.supplier_quotation import make_purchase_order - sq = frappe.get_doc(copy=test_records[0]).insert() + sq = frappe.copy_doc(test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_purchase_order, sq.name) @@ -31,35 +31,4 @@ class TestPurchaseOrder(unittest.TestCase): frappe.get_doc(po).insert() -test_records = [ - [ - { - "company": "_Test Company", - "conversion_rate": 1.0, - "currency": "INR", - "doctype": "Supplier Quotation", - "fiscal_year": "_Test Fiscal Year 2013", - "transaction_date": "2013-02-12", - "is_subcontracted": "No", - "supplier": "_Test Supplier", - "supplier_name": "_Test Supplier", - "net_total": 5000.0, - "grand_total": 5000.0, - "grand_total_import": 5000.0, - "naming_series": "_T-Supplier Quotation-", - "buying_price_list": "_Test Price List" - }, - { - "description": "_Test FG Item", - "doctype": "Supplier Quotation Item", - "item_code": "_Test FG Item", - "item_name": "_Test FG Item", - "parentfield": "quotation_items", - "qty": 10.0, - "rate": 500.0, - "base_amount": 5000.0, - "warehouse": "_Test Warehouse - _TC", - "uom": "_Test UOM", - } - ], -] \ No newline at end of file +test_records = frappe.get_test_records('Supplier Quotation') \ No newline at end of file diff --git a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json similarity index 100% rename from erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.txt rename to erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json diff --git a/erpnext/buying/page/purchase_analytics/purchase_analytics.txt b/erpnext/buying/page/purchase_analytics/purchase_analytics.json similarity index 100% rename from erpnext/buying/page/purchase_analytics/purchase_analytics.txt rename to erpnext/buying/page/purchase_analytics/purchase_analytics.json 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.json similarity index 100% rename from erpnext/buying/report/item_wise_purchase_history/item_wise_purchase_history.txt rename to erpnext/buying/report/item_wise_purchase_history/item_wise_purchase_history.json diff --git a/erpnext/buying/report/purchase_order_trends/purchase_order_trends.txt b/erpnext/buying/report/purchase_order_trends/purchase_order_trends.json similarity index 100% rename from erpnext/buying/report/purchase_order_trends/purchase_order_trends.txt rename to erpnext/buying/report/purchase_order_trends/purchase_order_trends.json 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.json similarity index 100% rename from erpnext/buying/report/requested_items_to_be_ordered/requested_items_to_be_ordered.txt rename to erpnext/buying/report/requested_items_to_be_ordered/requested_items_to_be_ordered.json 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.json similarity index 100% rename from erpnext/buying/report/supplier_addresses_and_contacts/supplier_addresses_and_contacts.txt rename to erpnext/buying/report/supplier_addresses_and_contacts/supplier_addresses_and_contacts.json diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 4801c75ee8..2d54b74d07 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -5,7 +5,6 @@ from __future__ import unicode_literals import frappe from frappe import _, throw from frappe.utils import flt, cint, today, cstr -from frappe.model.code import get_obj from erpnext.setup.utils import get_company_currency from erpnext.accounts.utils import get_fiscal_year, validate_fiscal_year from erpnext.utilities.transaction_base import TransactionBase @@ -481,7 +480,7 @@ class AccountsController(TransactionBase): total_outstanding = total_outstanding[0][0] if total_outstanding else 0 if total_outstanding: - get_obj('Account', account).check_credit_limit(total_outstanding) + frappe.get_doc('Account', account).check_credit_limit(total_outstanding) @frappe.whitelist() diff --git a/erpnext/controllers/status_updater.py b/erpnext/controllers/status_updater.py index dee9833406..24c5db17d8 100644 --- a/erpnext/controllers/status_updater.py +++ b/erpnext/controllers/status_updater.py @@ -262,8 +262,7 @@ class StatusUpdater(DocListController): / ref_doc_qty)*100 frappe.db.set_value(ref_dt, ref_dn, "per_billed", per_billed) - from frappe.model.meta import has_field - if has_field(ref_dt, "billing_status"): + if frappe.get_meta(ref_dt).get_field("billing_status"): if per_billed < 0.001: billing_status = "Not Billed" elif per_billed >= 99.99: billing_status = "Fully Billed" else: billing_status = "Partly Billed" diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py index 3ff780d726..a24834ea75 100644 --- a/erpnext/controllers/stock_controller.py +++ b/erpnext/controllers/stock_controller.py @@ -131,7 +131,7 @@ class StockController(AccountsController): warehouse_account = self.get_warehouse_account() for voucher_type, voucher_no in future_stock_vouchers: existing_gle = gle.get((voucher_type, voucher_no), []) - voucher_obj = frappe.get_obj(voucher_type, voucher_no) + voucher_obj = frappe.get_doc(voucher_type, voucher_no) expected_gle = voucher_obj.get_gl_entries(warehouse_account) if expected_gle: matched = True @@ -276,7 +276,7 @@ def update_gl_entries_after(posting_date, posting_time, warehouse_account=None, for voucher_type, voucher_no in future_stock_vouchers: existing_gle = gle.get((voucher_type, voucher_no), []) - voucher_obj = frappe.get_obj(voucher_type, voucher_no) + voucher_obj = frappe.get_doc(voucher_type, voucher_no) expected_gle = voucher_obj.get_gl_entries(warehouse_account) if expected_gle: if not existing_gle or not compare_existing_and_expected_gle(existing_gle, diff --git a/erpnext/home/doctype/feed/feed.txt b/erpnext/home/doctype/feed/feed.json similarity index 100% rename from erpnext/home/doctype/feed/feed.txt rename to erpnext/home/doctype/feed/feed.json diff --git a/erpnext/home/page/activity/activity.txt b/erpnext/home/page/activity/activity.json similarity index 100% rename from erpnext/home/page/activity/activity.txt rename to erpnext/home/page/activity/activity.json diff --git a/erpnext/hr/doctype/appraisal/appraisal.txt b/erpnext/hr/doctype/appraisal/appraisal.json similarity index 100% rename from erpnext/hr/doctype/appraisal/appraisal.txt rename to erpnext/hr/doctype/appraisal/appraisal.json diff --git a/erpnext/hr/doctype/appraisal_goal/appraisal_goal.txt b/erpnext/hr/doctype/appraisal_goal/appraisal_goal.json similarity index 100% rename from erpnext/hr/doctype/appraisal_goal/appraisal_goal.txt rename to erpnext/hr/doctype/appraisal_goal/appraisal_goal.json diff --git a/erpnext/hr/doctype/appraisal_template/appraisal_template.txt b/erpnext/hr/doctype/appraisal_template/appraisal_template.json similarity index 100% rename from erpnext/hr/doctype/appraisal_template/appraisal_template.txt rename to erpnext/hr/doctype/appraisal_template/appraisal_template.json diff --git a/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.txt b/erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.json similarity index 100% rename from erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.txt rename to erpnext/hr/doctype/appraisal_template_goal/appraisal_template_goal.json diff --git a/erpnext/hr/doctype/attendance/attendance.txt b/erpnext/hr/doctype/attendance/attendance.json similarity index 100% rename from erpnext/hr/doctype/attendance/attendance.txt rename to erpnext/hr/doctype/attendance/attendance.json diff --git a/erpnext/hr/doctype/branch/branch.txt b/erpnext/hr/doctype/branch/branch.json similarity index 100% rename from erpnext/hr/doctype/branch/branch.txt rename to erpnext/hr/doctype/branch/branch.json diff --git a/erpnext/hr/doctype/branch/test_branch.py b/erpnext/hr/doctype/branch/test_branch.py index f1db481eb7..52f2fe42e7 100644 --- a/erpnext/hr/doctype/branch/test_branch.py +++ b/erpnext/hr/doctype/branch/test_branch.py @@ -1,4 +1,6 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [{"doctype":"Branch", "branch":"_Test Branch"}] \ No newline at end of file + +import frappe +test_records = frappe.get_test_records('Branch') \ No newline at end of file diff --git a/erpnext/hr/doctype/deduction_type/deduction_type.txt b/erpnext/hr/doctype/deduction_type/deduction_type.json similarity index 100% rename from erpnext/hr/doctype/deduction_type/deduction_type.txt rename to erpnext/hr/doctype/deduction_type/deduction_type.json diff --git a/erpnext/hr/doctype/deduction_type/test_deduction_type.py b/erpnext/hr/doctype/deduction_type/test_deduction_type.py index 6f46d24a5d..577edc41a5 100644 --- a/erpnext/hr/doctype/deduction_type/test_deduction_type.py +++ b/erpnext/hr/doctype/deduction_type/test_deduction_type.py @@ -1,13 +1,6 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [ - { - "doctype": "Deduction Type", - "deduction_name": "_Test Professional Tax" - }, - { - "doctype": "Deduction Type", - "deduction_name": "_Test TDS" - } -] \ No newline at end of file + +import frappe +test_records = frappe.get_test_records('Deduction Type') \ No newline at end of file diff --git a/erpnext/hr/doctype/department/department.txt b/erpnext/hr/doctype/department/department.json similarity index 100% rename from erpnext/hr/doctype/department/department.txt rename to erpnext/hr/doctype/department/department.json diff --git a/erpnext/hr/doctype/department/test_department.py b/erpnext/hr/doctype/department/test_department.py index 654c250737..6642bc2bf1 100644 --- a/erpnext/hr/doctype/department/test_department.py +++ b/erpnext/hr/doctype/department/test_department.py @@ -3,7 +3,6 @@ test_ignore = ["Leave Block List"] -test_records = [ - {"doctype":"Department", "department_name":"_Test Department"}, - {"doctype":"Department", "department_name":"_Test Department 1"} -] + +import frappe +test_records = frappe.get_test_records('Department') \ No newline at end of file diff --git a/erpnext/hr/doctype/designation/designation.txt b/erpnext/hr/doctype/designation/designation.json similarity index 100% rename from erpnext/hr/doctype/designation/designation.txt rename to erpnext/hr/doctype/designation/designation.json diff --git a/erpnext/hr/doctype/designation/test_designation.py b/erpnext/hr/doctype/designation/test_designation.py index 2ed331c740..cb327e7d05 100644 --- a/erpnext/hr/doctype/designation/test_designation.py +++ b/erpnext/hr/doctype/designation/test_designation.py @@ -1,4 +1,6 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [{"doctype":"Designation", "designation_name":"_Test Designation"}] \ No newline at end of file + +import frappe +test_records = frappe.get_test_records('Designation') \ No newline at end of file diff --git a/erpnext/hr/doctype/earning_type/earning_type.txt b/erpnext/hr/doctype/earning_type/earning_type.json similarity index 100% rename from erpnext/hr/doctype/earning_type/earning_type.txt rename to erpnext/hr/doctype/earning_type/earning_type.json diff --git a/erpnext/hr/doctype/earning_type/test_earning_type.py b/erpnext/hr/doctype/earning_type/test_earning_type.py index a7184a1663..7b84af6e2a 100644 --- a/erpnext/hr/doctype/earning_type/test_earning_type.py +++ b/erpnext/hr/doctype/earning_type/test_earning_type.py @@ -1,15 +1,6 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [ - { - "doctype": "Earning Type", - "earning_name": "_Test Basic Salary", - "taxable": "Yes" - }, - { - "doctype": "Earning Type", - "earning_name": "_Test Allowance", - "taxable": "Yes" - } -] \ No newline at end of file + +import frappe +test_records = frappe.get_test_records('Earning Type') \ No newline at end of file diff --git a/erpnext/hr/doctype/employee/employee.txt b/erpnext/hr/doctype/employee/employee.json similarity index 100% rename from erpnext/hr/doctype/employee/employee.txt rename to erpnext/hr/doctype/employee/employee.json diff --git a/erpnext/hr/doctype/employee/test_employee.py b/erpnext/hr/doctype/employee/test_employee.py index cfafb63dce..699e439c53 100644 --- a/erpnext/hr/doctype/employee/test_employee.py +++ b/erpnext/hr/doctype/employee/test_employee.py @@ -1,40 +1,6 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [[{ - "doctype":"Employee", - "employee_name": "_Test Employee", - "naming_series": "_T-Employee-", - "date_of_joining": "2010-01-01", - "date_of_birth": "1980-01-01", - "gender": "Female", - "status": "Active", - "company": "_Test Company", - "user_id": "test@example.com", - "department": "_Test Department" -}], -[{ - "doctype":"Employee", - "employee_name": "_Test Employee 1", - "naming_series": "_T-Employee-", - "date_of_joining": "2010-01-01", - "date_of_birth": "1980-01-01", - "gender": "Male", - "status": "Active", - "company": "_Test Company", - "user_id": "test1@example.com", - "department": "_Test Department 1" -}], -[{ - "doctype":"Employee", - "employee_name": "_Test Employee 2", - "naming_series": "_T-Employee-", - "date_of_joining": "2010-01-01", - "date_of_birth": "1980-01-01", - "gender": "Male", - "status": "Active", - "company": "_Test Company", - "user_id": "test2@example.com", - "department": "_Test Department 1" -}] -] \ No newline at end of file + +import frappe +test_records = frappe.get_test_records('Employee') \ No newline at end of file diff --git a/erpnext/hr/doctype/employee_education/employee_education.txt b/erpnext/hr/doctype/employee_education/employee_education.json similarity index 100% rename from erpnext/hr/doctype/employee_education/employee_education.txt rename to erpnext/hr/doctype/employee_education/employee_education.json diff --git a/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.txt b/erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.json similarity index 100% rename from erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.txt rename to erpnext/hr/doctype/employee_external_work_history/employee_external_work_history.json diff --git a/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.txt b/erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.json similarity index 100% rename from erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.txt rename to erpnext/hr/doctype/employee_internal_work_history/employee_internal_work_history.json diff --git a/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.txt b/erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.json similarity index 100% rename from erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.txt rename to erpnext/hr/doctype/employee_leave_approver/employee_leave_approver.json diff --git a/erpnext/hr/doctype/employment_type/employment_type.txt b/erpnext/hr/doctype/employment_type/employment_type.json similarity index 100% rename from erpnext/hr/doctype/employment_type/employment_type.txt rename to erpnext/hr/doctype/employment_type/employment_type.json diff --git a/erpnext/hr/doctype/employment_type/test_employment_type.py b/erpnext/hr/doctype/employment_type/test_employment_type.py index d2624dc703..8a080f9b6d 100644 --- a/erpnext/hr/doctype/employment_type/test_employment_type.py +++ b/erpnext/hr/doctype/employment_type/test_employment_type.py @@ -1,5 +1,6 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [[{"doctype":"Employment Type", - "employee_type_name": "_Test Employment Type"}]] \ No newline at end of file + +import frappe +test_records = frappe.get_test_records('Employment Type') \ No newline at end of file diff --git a/erpnext/hr/doctype/expense_claim/expense_claim.txt b/erpnext/hr/doctype/expense_claim/expense_claim.json similarity index 100% rename from erpnext/hr/doctype/expense_claim/expense_claim.txt rename to erpnext/hr/doctype/expense_claim/expense_claim.json diff --git a/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.txt b/erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.json similarity index 100% rename from erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.txt rename to erpnext/hr/doctype/expense_claim_detail/expense_claim_detail.json diff --git a/erpnext/hr/doctype/expense_claim_type/expense_claim_type.txt b/erpnext/hr/doctype/expense_claim_type/expense_claim_type.json similarity index 100% rename from erpnext/hr/doctype/expense_claim_type/expense_claim_type.txt rename to erpnext/hr/doctype/expense_claim_type/expense_claim_type.json diff --git a/erpnext/hr/doctype/grade/grade.txt b/erpnext/hr/doctype/grade/grade.json similarity index 100% rename from erpnext/hr/doctype/grade/grade.txt rename to erpnext/hr/doctype/grade/grade.json diff --git a/erpnext/hr/doctype/grade/test_grade.py b/erpnext/hr/doctype/grade/test_grade.py index e0330e6169..fabab8d72b 100644 --- a/erpnext/hr/doctype/grade/test_grade.py +++ b/erpnext/hr/doctype/grade/test_grade.py @@ -1,4 +1,6 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [{"doctype":"Grade", "grade_name":"_Test Grade"}] \ No newline at end of file + +import frappe +test_records = frappe.get_test_records('Grade') \ No newline at end of file diff --git a/erpnext/hr/doctype/holiday/holiday.txt b/erpnext/hr/doctype/holiday/holiday.json similarity index 100% rename from erpnext/hr/doctype/holiday/holiday.txt rename to erpnext/hr/doctype/holiday/holiday.json diff --git a/erpnext/hr/doctype/holiday_list/holiday_list.txt b/erpnext/hr/doctype/holiday_list/holiday_list.json similarity index 100% rename from erpnext/hr/doctype/holiday_list/holiday_list.txt rename to erpnext/hr/doctype/holiday_list/holiday_list.json diff --git a/erpnext/hr/doctype/holiday_list/test_holiday_list.py b/erpnext/hr/doctype/holiday_list/test_holiday_list.py index 4acd33915c..959f82611c 100644 --- a/erpnext/hr/doctype/holiday_list/test_holiday_list.py +++ b/erpnext/hr/doctype/holiday_list/test_holiday_list.py @@ -1,16 +1,6 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [[{ - "doctype": "Holiday List", - "holiday_list_name": "_Test Holiday List", - "fiscal_year": "_Test Fiscal Year 2013", - "is_default": 1 - }, { - "doctype": "Holiday", - "parent": "_Test Holiday List", - "parenttype": "Holiday List", - "parentfield": "holiday_list_details", - "holiday_date": "2013-01-01", - "description": "New Year" - }]] \ No newline at end of file + +import frappe +test_records = frappe.get_test_records('Holiday List') \ No newline at end of file diff --git a/erpnext/hr/doctype/hr_settings/hr_settings.txt b/erpnext/hr/doctype/hr_settings/hr_settings.json similarity index 100% rename from erpnext/hr/doctype/hr_settings/hr_settings.txt rename to erpnext/hr/doctype/hr_settings/hr_settings.json diff --git a/erpnext/hr/doctype/hr_settings/hr_settings.py b/erpnext/hr/doctype/hr_settings/hr_settings.py index 602558ba5c..861408d064 100644 --- a/erpnext/hr/doctype/hr_settings/hr_settings.py +++ b/erpnext/hr/doctype/hr_settings/hr_settings.py @@ -30,6 +30,6 @@ class HrSettings(Document): if not self.stop_birthday_reminders: for employee in frappe.db.sql_list("""select name from `tabEmployee` where status='Active' and ifnull(date_of_birth, '')!=''"""): - frappe.get_obj("Employee", employee).update_dob_event() + frappe.get_doc("Employee", employee).update_dob_event() frappe.msgprint(frappe._("Updated Birthday Reminders")) \ No newline at end of file diff --git a/erpnext/hr/doctype/job_applicant/job_applicant.txt b/erpnext/hr/doctype/job_applicant/job_applicant.json similarity index 100% rename from erpnext/hr/doctype/job_applicant/job_applicant.txt rename to erpnext/hr/doctype/job_applicant/job_applicant.json diff --git a/erpnext/hr/doctype/job_opening/job_opening.txt b/erpnext/hr/doctype/job_opening/job_opening.json similarity index 100% rename from erpnext/hr/doctype/job_opening/job_opening.txt rename to erpnext/hr/doctype/job_opening/job_opening.json diff --git a/erpnext/hr/doctype/leave_allocation/leave_allocation.txt b/erpnext/hr/doctype/leave_allocation/leave_allocation.json similarity index 100% rename from erpnext/hr/doctype/leave_allocation/leave_allocation.txt rename to erpnext/hr/doctype/leave_allocation/leave_allocation.json diff --git a/erpnext/hr/doctype/leave_application/leave_application.txt b/erpnext/hr/doctype/leave_application/leave_application.json similarity index 100% rename from erpnext/hr/doctype/leave_application/leave_application.txt rename to erpnext/hr/doctype/leave_application/leave_application.json diff --git a/erpnext/hr/doctype/leave_application/test_leave_application.py b/erpnext/hr/doctype/leave_application/test_leave_application.py index 3ed9d56161..89c98332fb 100644 --- a/erpnext/hr/doctype/leave_application/test_leave_application.py +++ b/erpnext/hr/doctype/leave_application/test_leave_application.py @@ -194,51 +194,4 @@ class TestLeaveApplication(unittest.TestCase): test_dependencies = ["Leave Block List"] -test_records = [ - [{ - "doctype": "Leave Allocation", - "leave_type": "_Test Leave Type", - "fiscal_year": "_Test Fiscal Year 2013", - "employee":"_T-Employee-0001", - "new_leaves_allocated": 15, - "docstatus": 1 - }], - [{ - "doctype": "Leave Application", - "leave_type": "_Test Leave Type", - "from_date": "2013-05-01", - "to_date": "2013-05-05", - "posting_date": "2013-01-02", - "fiscal_year": "_Test Fiscal Year 2013", - "employee": "_T-Employee-0001", - "company": "_Test Company" - }], - [{ - "doctype": "Leave Allocation", - "leave_type": "_Test Leave Type", - "fiscal_year": "_Test Fiscal Year 2013", - "employee":"_T-Employee-0002", - "new_leaves_allocated": 15, - "docstatus": 1 - }], - [{ - "doctype": "Leave Application", - "leave_type": "_Test Leave Type", - "from_date": "2013-05-01", - "to_date": "2013-05-05", - "posting_date": "2013-01-02", - "fiscal_year": "_Test Fiscal Year 2013", - "employee": "_T-Employee-0002", - "company": "_Test Company" - }], - [{ - "doctype": "Leave Application", - "leave_type": "_Test Leave Type LWP", - "from_date": "2013-01-15", - "to_date": "2013-01-15", - "posting_date": "2013-01-02", - "fiscal_year": "_Test Fiscal Year 2013", - "employee": "_T-Employee-0001", - "company": "_Test Company", - }] -] +test_records = frappe.get_test_records('Leave Application') \ No newline at end of file diff --git a/erpnext/hr/doctype/leave_block_list/leave_block_list.txt b/erpnext/hr/doctype/leave_block_list/leave_block_list.json similarity index 100% rename from erpnext/hr/doctype/leave_block_list/leave_block_list.txt rename to erpnext/hr/doctype/leave_block_list/leave_block_list.json diff --git a/erpnext/hr/doctype/leave_block_list/test_leave_block_list.py b/erpnext/hr/doctype/leave_block_list/test_leave_block_list.py index 811d897827..88786587e4 100644 --- a/erpnext/hr/doctype/leave_block_list/test_leave_block_list.py +++ b/erpnext/hr/doctype/leave_block_list/test_leave_block_list.py @@ -32,23 +32,4 @@ class TestLeaveBlockList(unittest.TestCase): test_dependencies = ["Employee"] -test_records = [[{ - "doctype":"Leave Block List", - "leave_block_list_name": "_Test Leave Block List", - "year": "_Test Fiscal Year 2013", - "company": "_Test Company" - }, { - "doctype": "Leave Block List Date", - "parent": "_Test Leave Block List", - "parenttype": "Leave Block List", - "parentfield": "leave_block_list_dates", - "block_date": "2013-01-02", - "reason": "First work day" - }, { - "doctype": "Leave Block List Allow", - "parent": "_Test Leave Block List", - "parenttype": "Leave Block List", - "parentfield": "leave_block_list_allowed", - "allow_user": "test1@example.com", - } - ]] \ No newline at end of file +test_records = frappe.get_test_records('Leave Block List') \ No newline at end of file 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.json similarity index 100% rename from erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.txt rename to erpnext/hr/doctype/leave_block_list_allow/leave_block_list_allow.json diff --git a/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.txt b/erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.json similarity index 100% rename from erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.txt rename to erpnext/hr/doctype/leave_block_list_date/leave_block_list_date.json diff --git a/erpnext/hr/doctype/leave_control_panel/leave_control_panel.txt b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.json similarity index 100% rename from erpnext/hr/doctype/leave_control_panel/leave_control_panel.txt rename to erpnext/hr/doctype/leave_control_panel/leave_control_panel.json diff --git a/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py index 81ab56bc13..4a8795affd 100644 --- a/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py +++ b/erpnext/hr/doctype/leave_control_panel/leave_control_panel.py @@ -5,7 +5,6 @@ from __future__ import unicode_literals import frappe from frappe.utils import cint, cstr, flt, nowdate -from frappe.model.code import get_obj from frappe import msgprint, _ diff --git a/erpnext/hr/doctype/leave_type/leave_type.txt b/erpnext/hr/doctype/leave_type/leave_type.json similarity index 100% rename from erpnext/hr/doctype/leave_type/leave_type.txt rename to erpnext/hr/doctype/leave_type/leave_type.json diff --git a/erpnext/hr/doctype/leave_type/test_leave_type.py b/erpnext/hr/doctype/leave_type/test_leave_type.py index 50c3e795cc..59fff57cc6 100644 --- a/erpnext/hr/doctype/leave_type/test_leave_type.py +++ b/erpnext/hr/doctype/leave_type/test_leave_type.py @@ -1,14 +1,6 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [ - [{ - "leave_type_name": "_Test Leave Type", - "doctype": "Leave Type" - }], - [{ - "leave_type_name": "_Test Leave Type LWP", - "doctype": "Leave Type", - "is_lwp": 1 - }] -] \ No newline at end of file + +import frappe +test_records = frappe.get_test_records('Leave Type') \ No newline at end of file diff --git a/erpnext/hr/doctype/salary_manager/salary_manager.txt b/erpnext/hr/doctype/salary_manager/salary_manager.json similarity index 100% rename from erpnext/hr/doctype/salary_manager/salary_manager.txt rename to erpnext/hr/doctype/salary_manager/salary_manager.json diff --git a/erpnext/hr/doctype/salary_manager/salary_manager.py b/erpnext/hr/doctype/salary_manager/salary_manager.py index 0079b2ed7d..ac64963bbc 100644 --- a/erpnext/hr/doctype/salary_manager/salary_manager.py +++ b/erpnext/hr/doctype/salary_manager/salary_manager.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals import frappe from frappe.utils import cint, flt -from frappe.model.code import get_obj from frappe import msgprint from frappe.model.document import Document @@ -128,7 +127,7 @@ class SalaryManager(Document): ss_list = self.get_sal_slip_list() not_submitted_ss = [] for ss in ss_list: - ss_obj = get_obj("Salary Slip",ss[0],with_children=1) + ss_obj = frappe.get_doc("Salary Slip",ss[0]) try: frappe.db.set(ss_obj.doc, 'email_check', cint(self.send_mail)) if cint(self.send_email) == 1: diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.txt b/erpnext/hr/doctype/salary_slip/salary_slip.json similarity index 100% rename from erpnext/hr/doctype/salary_slip/salary_slip.txt rename to erpnext/hr/doctype/salary_slip/salary_slip.json diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py index cfd39fc5e1..981935f35c 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.py +++ b/erpnext/hr/doctype/salary_slip/salary_slip.py @@ -7,7 +7,6 @@ import frappe from frappe.utils import add_days, cint, cstr, flt, getdate, nowdate, _round from frappe.model.naming import make_autoname -from frappe.model.code import get_obj from frappe import msgprint, _ from erpnext.setup.utils import get_company_currency @@ -52,7 +51,7 @@ class SalarySlip(TransactionBase): if not self.month: self.month = "%02d" % getdate(nowdate()).month - m = get_obj('Salary Manager').get_month_details(self.fiscal_year, self.month) + m = frappe.get_doc('Salary Manager').get_month_details(self.fiscal_year, self.month) holidays = self.get_holidays_for_employee(m) if not cint(frappe.db.get_value("HR Settings", "HR Settings", diff --git a/erpnext/hr/doctype/salary_slip/test_salary_slip.py b/erpnext/hr/doctype/salary_slip/test_salary_slip.py index c14901a5c5..ab590444b4 100644 --- a/erpnext/hr/doctype/salary_slip/test_salary_slip.py +++ b/erpnext/hr/doctype/salary_slip/test_salary_slip.py @@ -9,7 +9,7 @@ class TestSalarySlip(unittest.TestCase): frappe.db.sql("""delete from `tabLeave Application`""") frappe.db.sql("""delete from `tabSalary Slip`""") from erpnext.hr.doctype.leave_application.test_leave_application import test_records as leave_applications - la = frappe.get_doc(copy=leave_applications[4]) + la = frappe.copy_doc(leave_applications[4]) la.insert() la.status = "Approved" la.submit() @@ -19,7 +19,7 @@ class TestSalarySlip(unittest.TestCase): def test_salary_slip_with_holidays_included(self): frappe.db.set_value("HR Settings", "HR Settings", "include_holidays_in_total_working_days", 1) - ss = frappe.get_doc(copy=test_records[0]) + ss = frappe.copy_doc(test_records[0]) ss.insert() self.assertEquals(ss.total_days_in_month, 31) self.assertEquals(ss.payment_days, 30) @@ -31,7 +31,7 @@ class TestSalarySlip(unittest.TestCase): self.assertEquals(ss.net_pay, 14867.74) def test_salary_slip_with_holidays_excluded(self): - ss = frappe.get_doc(copy=test_records[0]) + ss = frappe.copy_doc(test_records[0]) ss.insert() self.assertEquals(ss.total_days_in_month, 30) self.assertEquals(ss.payment_days, 29) @@ -44,45 +44,4 @@ class TestSalarySlip(unittest.TestCase): test_dependencies = ["Leave Application"] -test_records = [ - [ - { - "doctype": "Salary Slip", - "employee": "_T-Employee-0001", - "employee_name": "_Test Employee", - "company": "_Test Company", - "fiscal_year": "_Test Fiscal Year 2013", - "month": "01", - "total_days_in_month": 31, - "payment_days": 31 - }, - { - "doctype": "Salary Slip Earning", - "parentfield": "earning_details", - "e_type": "_Test Basic Salary", - "e_amount": 15000, - "e_depends_on_lwp": 1 - }, - { - "doctype": "Salary Slip Earning", - "parentfield": "earning_details", - "e_type": "_Test Allowance", - "e_amount": 500, - "e_depends_on_lwp": 0 - }, - { - "doctype": "Salary Slip Deduction", - "parentfield": "deduction_details", - "d_type": "_Test Professional Tax", - "d_amount": 100, - "d_depends_on_lwp": 0 - }, - { - "doctype": "Salary Slip Deduction", - "parentfield": "deduction_details", - "d_type": "_Test TDS", - "d_amount": 50, - "d_depends_on_lwp": 1 - }, - ] -] \ No newline at end of file +test_records = frappe.get_test_records('Salary Slip') \ No newline at end of file diff --git a/erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.txt b/erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.json similarity index 100% rename from erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.txt rename to erpnext/hr/doctype/salary_slip_deduction/salary_slip_deduction.json diff --git a/erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.txt b/erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.json similarity index 100% rename from erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.txt rename to erpnext/hr/doctype/salary_slip_earning/salary_slip_earning.json diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.txt b/erpnext/hr/doctype/salary_structure/salary_structure.json similarity index 100% rename from erpnext/hr/doctype/salary_structure/salary_structure.txt rename to erpnext/hr/doctype/salary_structure/salary_structure.json diff --git a/erpnext/hr/doctype/salary_structure_deduction/salary_structure_deduction.txt b/erpnext/hr/doctype/salary_structure_deduction/salary_structure_deduction.json similarity index 100% rename from erpnext/hr/doctype/salary_structure_deduction/salary_structure_deduction.txt rename to erpnext/hr/doctype/salary_structure_deduction/salary_structure_deduction.json diff --git a/erpnext/hr/doctype/salary_structure_earning/salary_structure_earning.txt b/erpnext/hr/doctype/salary_structure_earning/salary_structure_earning.json similarity index 100% rename from erpnext/hr/doctype/salary_structure_earning/salary_structure_earning.txt rename to erpnext/hr/doctype/salary_structure_earning/salary_structure_earning.json diff --git a/erpnext/hr/doctype/upload_attendance/upload_attendance.txt b/erpnext/hr/doctype/upload_attendance/upload_attendance.json similarity index 100% rename from erpnext/hr/doctype/upload_attendance/upload_attendance.txt rename to erpnext/hr/doctype/upload_attendance/upload_attendance.json diff --git a/erpnext/hr/doctype/upload_attendance/upload_attendance.py b/erpnext/hr/doctype/upload_attendance/upload_attendance.py index 8a54415832..1ba31e9f20 100644 --- a/erpnext/hr/doctype/upload_attendance/upload_attendance.py +++ b/erpnext/hr/doctype/upload_attendance/upload_attendance.py @@ -10,9 +10,6 @@ from frappe import msgprint, _ from frappe.utils.datautils import UnicodeWriter from frappe.model.document import Document -# doclist = None -doclist = frappe.local('uploadattendance_doclist') - class UploadAttendance(Document): pass @@ -22,7 +19,6 @@ def get_template(): raise frappe.PermissionError args = frappe.local.form_dict - frappe.local.uploadattendance_doclist = frappe.model.doctype.get("Attendance") w = UnicodeWriter() w = add_header(w) @@ -34,13 +30,8 @@ def get_template(): frappe.response['type'] = 'csv' frappe.response['doctype'] = "Attendance" -def getdocfield(fieldname): - """get docfield from doclist of doctype""" - l = [d for d in doclist if d.doctype=='DocField' and d.fieldname==fieldname] - return l and l[0] or None - def add_header(w): - status = ", ".join(getdocfield("status").options.strip().split("\n")) + status = ", ".join((frappe.get_meta("Attendance").get_field("status").options or "").strip().split("\n")) w.writerow(["Notes:"]) w.writerow(["Please do not change the template headings"]) w.writerow(["Status should be one of these values: " + status]) @@ -94,7 +85,7 @@ def get_existing_attendance_records(args): return existing_attendance def get_naming_series(): - series = getdocfield("naming_series").options.strip().split("\n") + series = frappe.get_meta("Attendance").get_field("naming_series").options.strip().split("\n") if not series: msgprint("""Please create naming series for Attendance \ through Setup -> Numbering Series.""", raise_exception=1) diff --git a/erpnext/hr/report/employee_birthday/employee_birthday.txt b/erpnext/hr/report/employee_birthday/employee_birthday.json similarity index 100% rename from erpnext/hr/report/employee_birthday/employee_birthday.txt rename to erpnext/hr/report/employee_birthday/employee_birthday.json diff --git a/erpnext/hr/report/employee_information/employee_information.txt b/erpnext/hr/report/employee_information/employee_information.json similarity index 100% rename from erpnext/hr/report/employee_information/employee_information.txt rename to erpnext/hr/report/employee_information/employee_information.json diff --git a/erpnext/hr/report/employee_leave_balance/employee_leave_balance.txt b/erpnext/hr/report/employee_leave_balance/employee_leave_balance.json similarity index 100% rename from erpnext/hr/report/employee_leave_balance/employee_leave_balance.txt rename to erpnext/hr/report/employee_leave_balance/employee_leave_balance.json diff --git a/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.txt b/erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.json similarity index 100% rename from erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.txt rename to erpnext/hr/report/monthly_attendance_sheet/monthly_attendance_sheet.json diff --git a/erpnext/hr/report/monthly_salary_register/monthly_salary_register.txt b/erpnext/hr/report/monthly_salary_register/monthly_salary_register.json similarity index 100% rename from erpnext/hr/report/monthly_salary_register/monthly_salary_register.txt rename to erpnext/hr/report/monthly_salary_register/monthly_salary_register.json diff --git a/erpnext/manufacturing/doctype/bom/bom.txt b/erpnext/manufacturing/doctype/bom/bom.json similarity index 100% rename from erpnext/manufacturing/doctype/bom/bom.txt rename to erpnext/manufacturing/doctype/bom/bom.json diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index 14e18f2299..6fdf6414e2 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -5,7 +5,6 @@ from __future__ import unicode_literals import frappe from frappe.utils import cint, cstr, flt, now, nowdate -from frappe.model.code import get_obj from frappe import msgprint, _ @@ -282,7 +281,7 @@ class Bom(Document): def update_cost_and_exploded_items(self, bom_list=[]): bom_list = self.traverse_tree(bom_list) for bom in bom_list: - bom_obj = get_obj("BOM", bom, with_children=1) + bom_obj = frappe.get_doc("BOM", bom) bom_obj.on_update() return bom_list diff --git a/erpnext/manufacturing/doctype/bom/test_bom.py b/erpnext/manufacturing/doctype/bom/test_bom.py index 9bd9a07409..074daa4eb9 100644 --- a/erpnext/manufacturing/doctype/bom/test_bom.py +++ b/erpnext/manufacturing/doctype/bom/test_bom.py @@ -6,95 +6,7 @@ from __future__ import unicode_literals import unittest import frappe -test_records = [ - [ - { - "doctype": "BOM", - "item": "_Test Item Home Desktop Manufactured", - "quantity": 1.0, - "is_active": 1, - "is_default": 1, - "docstatus": 1 - }, - { - "doctype": "BOM Item", - "item_code": "_Test Serialized Item With Series", - "parentfield": "bom_materials", - "qty": 1.0, - "rate": 5000.0, - "amount": 5000.0, - "stock_uom": "_Test UOM" - }, - { - "doctype": "BOM Item", - "item_code": "_Test Item 2", - "parentfield": "bom_materials", - "qty": 2.0, - "rate": 1000.0, - "amount": 2000.0, - "stock_uom": "_Test UOM" - } - ], - - [ - { - "doctype": "BOM", - "item": "_Test FG Item", - "quantity": 1.0, - "is_active": 1, - "is_default": 1, - "docstatus": 1 - }, - { - "doctype": "BOM Item", - "item_code": "_Test Item", - "parentfield": "bom_materials", - "qty": 1.0, - "rate": 5000.0, - "amount": 5000.0, - "stock_uom": "_Test UOM" - }, - { - "doctype": "BOM Item", - "item_code": "_Test Item Home Desktop 100", - "parentfield": "bom_materials", - "qty": 2.0, - "rate": 1000.0, - "amount": 2000.0, - "stock_uom": "_Test UOM" - } - ], - - [ - { - "doctype": "BOM", - "item": "_Test FG Item 2", - "quantity": 1.0, - "is_active": 1, - "is_default": 1, - "docstatus": 1 - }, - { - "doctype": "BOM Item", - "item_code": "_Test Item", - "parentfield": "bom_materials", - "qty": 1.0, - "rate": 5000.0, - "amount": 5000.0, - "stock_uom": "_Test UOM" - }, - { - "doctype": "BOM Item", - "item_code": "_Test Item Home Desktop Manufactured", - "bom_no": "BOM/_Test Item Home Desktop Manufactured/001", - "parentfield": "bom_materials", - "qty": 2.0, - "rate": 1000.0, - "amount": 2000.0, - "stock_uom": "_Test UOM" - } - ], -] +test_records = frappe.get_test_records('Bom') class TestBOM(unittest.TestCase): def test_get_items(self): @@ -115,5 +27,4 @@ class TestBOM(unittest.TestCase): def test_get_items_list(self): from erpnext.manufacturing.doctype.bom.bom import get_bom_items - self.assertEquals(len(get_bom_items(bom="BOM/_Test FG Item 2/001", qty=1, fetch_exploded=1)), 3) - + self.assertEquals(len(get_bom_items(bom="BOM/_Test FG Item 2/001", qty=1, fetch_exploded=1)), 3) \ No newline at end of file diff --git a/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.txt b/erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.json similarity index 100% rename from erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.txt rename to erpnext/manufacturing/doctype/bom_explosion_item/bom_explosion_item.json diff --git a/erpnext/manufacturing/doctype/bom_item/bom_item.txt b/erpnext/manufacturing/doctype/bom_item/bom_item.json similarity index 100% rename from erpnext/manufacturing/doctype/bom_item/bom_item.txt rename to erpnext/manufacturing/doctype/bom_item/bom_item.json diff --git a/erpnext/manufacturing/doctype/bom_operation/bom_operation.txt b/erpnext/manufacturing/doctype/bom_operation/bom_operation.json similarity index 100% rename from erpnext/manufacturing/doctype/bom_operation/bom_operation.txt rename to erpnext/manufacturing/doctype/bom_operation/bom_operation.json diff --git a/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.txt b/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.json similarity index 100% rename from erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.txt rename to erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.json diff --git a/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.py b/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.py index cf7750a269..34f45bdbf9 100644 --- a/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.py +++ b/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals import frappe from frappe.utils import cstr, flt -from frappe.model.code import get_obj from frappe import msgprint, _ from frappe.model.document import Document @@ -16,7 +15,7 @@ class BomReplaceTool(Document): bom_list = self.get_parent_boms() updated_bom = [] for bom in bom_list: - bom_obj = get_obj("BOM", bom, with_children=1) + bom_obj = frappe.get_doc("BOM", bom) updated_bom = bom_obj.update_cost_and_exploded_items(updated_bom) frappe.msgprint(_("BOM replaced")) diff --git a/erpnext/manufacturing/doctype/production_order/production_order.txt b/erpnext/manufacturing/doctype/production_order/production_order.json similarity index 100% rename from erpnext/manufacturing/doctype/production_order/production_order.txt rename to erpnext/manufacturing/doctype/production_order/production_order.json diff --git a/erpnext/manufacturing/doctype/production_order/production_order.py b/erpnext/manufacturing/doctype/production_order/production_order.py index f878cd8933..fd979805a2 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.py +++ b/erpnext/manufacturing/doctype/production_order/production_order.py @@ -5,7 +5,6 @@ from __future__ import unicode_literals import frappe from frappe.utils import cstr, flt, nowdate -from frappe.model.code import get_obj from frappe import msgprint, _ class OverProductionError(frappe.ValidationError): pass diff --git a/erpnext/manufacturing/doctype/production_order/test_production_order.py b/erpnext/manufacturing/doctype/production_order/test_production_order.py index b3d655a2e4..1af4815aa1 100644 --- a/erpnext/manufacturing/doctype/production_order/test_production_order.py +++ b/erpnext/manufacturing/doctype/production_order/test_production_order.py @@ -17,16 +17,16 @@ class TestProductionOrder(unittest.TestCase): frappe.db.sql("""delete from `tabBin`""") frappe.db.sql("""delete from `tabGL Entry`""") - pro_bean = frappe.get_doc(copy = test_records[0]) + pro_bean = frappe.copy_doc(test_records[0]) pro_bean.insert() pro_bean.submit() from erpnext.stock.doctype.stock_entry.test_stock_entry import test_records as se_test_records - mr1 = frappe.get_doc(copy = se_test_records[0]) + mr1 = frappe.copy_doc(se_test_records[0]) mr1.insert() mr1.submit() - mr2 = frappe.get_doc(copy = se_test_records[0]) + mr2 = frappe.copy_doc(se_test_records[0]) mr2.doclist[1].item_code = "_Test Item Home Desktop 100" mr2.insert() mr2.submit() @@ -63,17 +63,4 @@ class TestProductionOrder(unittest.TestCase): -test_records = [ - [ - { - "bom_no": "BOM/_Test FG Item/001", - "company": "_Test Company", - "doctype": "Production Order", - "production_item": "_Test FG Item", - "qty": 10.0, - "fg_warehouse": "_Test Warehouse 1 - _TC", - "wip_warehouse": "_Test Warehouse - _TC", - "stock_uom": "Nos" - } - ] -] \ No newline at end of file +test_records = frappe.get_test_records('Production Order') \ No newline at end of file diff --git a/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.txt b/erpnext/manufacturing/doctype/production_plan_item/production_plan_item.json similarity index 100% rename from erpnext/manufacturing/doctype/production_plan_item/production_plan_item.txt rename to erpnext/manufacturing/doctype/production_plan_item/production_plan_item.json diff --git a/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.txt b/erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.json similarity index 100% rename from erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.txt rename to erpnext/manufacturing/doctype/production_plan_sales_order/production_plan_sales_order.json diff --git a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.txt b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.json similarity index 100% rename from erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.txt rename to erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.json diff --git a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py index c925c0c5e2..8c9c3cdb9f 100644 --- a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py +++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py @@ -5,7 +5,6 @@ from __future__ import unicode_literals import frappe from frappe.utils import cstr, flt, cint, nowdate, add_days -from frappe.model.code import get_obj from frappe import msgprint, _ from frappe.model.document import Document diff --git a/erpnext/manufacturing/doctype/workstation/workstation.txt b/erpnext/manufacturing/doctype/workstation/workstation.json similarity index 100% rename from erpnext/manufacturing/doctype/workstation/workstation.txt rename to erpnext/manufacturing/doctype/workstation/workstation.json diff --git a/erpnext/manufacturing/report/completed_production_orders/completed_production_orders.txt b/erpnext/manufacturing/report/completed_production_orders/completed_production_orders.json similarity index 100% rename from erpnext/manufacturing/report/completed_production_orders/completed_production_orders.txt rename to erpnext/manufacturing/report/completed_production_orders/completed_production_orders.json 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.json similarity index 100% rename from erpnext/manufacturing/report/issued_items_against_production_order/issued_items_against_production_order.txt rename to erpnext/manufacturing/report/issued_items_against_production_order/issued_items_against_production_order.json diff --git a/erpnext/manufacturing/report/open_production_orders/open_production_orders.txt b/erpnext/manufacturing/report/open_production_orders/open_production_orders.json similarity index 100% rename from erpnext/manufacturing/report/open_production_orders/open_production_orders.txt rename to erpnext/manufacturing/report/open_production_orders/open_production_orders.json 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.json similarity index 100% rename from erpnext/manufacturing/report/production_orders_in_progress/production_orders_in_progress.txt rename to erpnext/manufacturing/report/production_orders_in_progress/production_orders_in_progress.json diff --git a/erpnext/patches/4_0/update_user_properties.py b/erpnext/patches/4_0/update_user_properties.py index da8635ed29..0c3aa4ab2e 100644 --- a/erpnext/patches/4_0/update_user_properties.py +++ b/erpnext/patches/4_0/update_user_properties.py @@ -4,7 +4,6 @@ from __future__ import unicode_literals import frappe import frappe.permissions -import frappe.model.doctype import frappe.defaults def execute(): @@ -79,7 +78,7 @@ def add_employee_restrictions_to_leave_approver(): # add restrict rights to HR User and HR Manager frappe.db.sql("""update `tabDocPerm` set `restrict`=1 where parent in ('Employee', 'Leave Application') and role in ('HR User', 'HR Manager') and permlevel=0 and `read`=1""") - frappe.model.doctype.clear_cache() + frappe.clear_cache() # add Employee restrictions (in on_update method) for employee in frappe.db.sql_list("""select name from `tabEmployee` diff --git a/erpnext/projects/doctype/activity_type/activity_type.txt b/erpnext/projects/doctype/activity_type/activity_type.json similarity index 100% rename from erpnext/projects/doctype/activity_type/activity_type.txt rename to erpnext/projects/doctype/activity_type/activity_type.json diff --git a/erpnext/projects/doctype/activity_type/test_activity_type.py b/erpnext/projects/doctype/activity_type/test_activity_type.py index b8933170f0..ec319799b3 100644 --- a/erpnext/projects/doctype/activity_type/test_activity_type.py +++ b/erpnext/projects/doctype/activity_type/test_activity_type.py @@ -1,8 +1,6 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [ - [{"activity_type":"_Test Activity Type"}], - [{"activity_type":"_Test Activity Type 1"}], - [{"activity_type":"_Test Activity Type 2"}] -] \ No newline at end of file + +import frappe +test_records = frappe.get_test_records('Activity Type') \ No newline at end of file diff --git a/erpnext/projects/doctype/project/project.txt b/erpnext/projects/doctype/project/project.json similarity index 100% rename from erpnext/projects/doctype/project/project.txt rename to erpnext/projects/doctype/project/project.json diff --git a/erpnext/projects/doctype/project/test_project.py b/erpnext/projects/doctype/project/test_project.py index b4ea021698..7769ff421f 100644 --- a/erpnext/projects/doctype/project/test_project.py +++ b/erpnext/projects/doctype/project/test_project.py @@ -1,11 +1,6 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [[{ - "project_name": "_Test Project", - "status": "Open" -}], -[{ - "project_name": "_Test Project 1", - "status": "Open" -}]] \ No newline at end of file + +import frappe +test_records = frappe.get_test_records('Project') \ No newline at end of file diff --git a/erpnext/projects/doctype/project_milestone/project_milestone.txt b/erpnext/projects/doctype/project_milestone/project_milestone.json similarity index 100% rename from erpnext/projects/doctype/project_milestone/project_milestone.txt rename to erpnext/projects/doctype/project_milestone/project_milestone.json diff --git a/erpnext/projects/doctype/task/task.txt b/erpnext/projects/doctype/task/task.json similarity index 100% rename from erpnext/projects/doctype/task/task.txt rename to erpnext/projects/doctype/task/task.json diff --git a/erpnext/projects/doctype/task/test_task.py b/erpnext/projects/doctype/task/test_task.py index af7ad288f0..c345649c44 100644 --- a/erpnext/projects/doctype/task/test_task.py +++ b/erpnext/projects/doctype/task/test_task.py @@ -1,10 +1,8 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [ - [{"subject": "_Test Task", "project":"_Test Project", "status":"Open"}], - [{"subject": "_Test Task 1", "status":"Open"}], - [{"subject": "_Test Task 2", "status":"Open"}] -] + +import frappe +test_records = frappe.get_test_records('Task') test_ignore = ["Customer"] \ No newline at end of file diff --git a/erpnext/projects/doctype/time_log/test_time_log.py b/erpnext/projects/doctype/time_log/test_time_log.py index c0bfa750a2..eedad0b387 100644 --- a/erpnext/projects/doctype/time_log/test_time_log.py +++ b/erpnext/projects/doctype/time_log/test_time_log.py @@ -11,13 +11,4 @@ class TestTimeLog(unittest.TestCase): ts = frappe.get_doc(frappe.copy_doc(test_records[0])) self.assertRaises(OverlapError, ts.insert) -test_records = [[{ - "doctype": "Time Log", - "from_time": "2013-01-01 10:00:00.000000", - "to_time": "2013-01-01 11:00:00.000000", - "activity_type": "_Test Activity Type", - "note": "_Test Note", - "docstatus": 1 -}]] - -test_ignore = ["Sales Invoice", "Time Log Batch"] \ No newline at end of file +test_records = frappe.get_test_records('Time Log') \ No newline at end of file diff --git a/erpnext/projects/doctype/time_log/time_log.txt b/erpnext/projects/doctype/time_log/time_log.json similarity index 100% rename from erpnext/projects/doctype/time_log/time_log.txt rename to erpnext/projects/doctype/time_log/time_log.json diff --git a/erpnext/projects/doctype/time_log_batch/test_time_log_batch.py b/erpnext/projects/doctype/time_log_batch/test_time_log_batch.py index e059c04e99..eaf498c2d6 100644 --- a/erpnext/projects/doctype/time_log_batch/test_time_log_batch.py +++ b/erpnext/projects/doctype/time_log_batch/test_time_log_batch.py @@ -6,7 +6,7 @@ import frappe, unittest class TimeLogBatchTest(unittest.TestCase): def test_time_log_status(self): from erpnext.projects.doctype.time_log.test_time_log import test_records as time_log_records - time_log = frappe.get_doc(copy=time_log_records[0]) + time_log = frappe.copy_doc(time_log_records[0]) time_log.update({ "from_time": "2013-01-02 10:00:00.000000", "to_time": "2013-01-02 11:00:00.000000", @@ -16,7 +16,7 @@ class TimeLogBatchTest(unittest.TestCase): time_log.submit() self.assertEquals(frappe.db.get_value("Time Log", time_log.name, "status"), "Submitted") - tlb = frappe.get_doc(copy=test_records[0]) + tlb = frappe.copy_doc(test_records[0]) tlb.doclist[1].time_log = time_log.name tlb.insert() tlb.submit() @@ -25,15 +25,4 @@ class TimeLogBatchTest(unittest.TestCase): tlb.cancel() self.assertEquals(frappe.db.get_value("Time Log", time_log.name, "status"), "Submitted") -test_records = [[ - { - "doctype": "Time Log Batch", - "rate": "500" - }, - { - "doctype": "Time Log Batch Detail", - "parenttype": "Time Log Batch", - "parentfield": "time_log_batch_details", - "time_log": "_T-Time Log-00001", - } -]] \ No newline at end of file +test_records = frappe.get_test_records('Time Log Batch') \ No newline at end of file diff --git a/erpnext/projects/doctype/time_log_batch/time_log_batch.txt b/erpnext/projects/doctype/time_log_batch/time_log_batch.json similarity index 100% rename from erpnext/projects/doctype/time_log_batch/time_log_batch.txt rename to erpnext/projects/doctype/time_log_batch/time_log_batch.json 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.json similarity index 100% rename from erpnext/projects/doctype/time_log_batch_detail/time_log_batch_detail.txt rename to erpnext/projects/doctype/time_log_batch_detail/time_log_batch_detail.json 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.json similarity index 100% rename from erpnext/projects/report/daily_time_log_summary/daily_time_log_summary.txt rename to erpnext/projects/report/daily_time_log_summary/daily_time_log_summary.json 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.json similarity index 100% rename from erpnext/projects/report/project_wise_stock_tracking/project_wise_stock_tracking.txt rename to erpnext/projects/report/project_wise_stock_tracking/project_wise_stock_tracking.json diff --git a/erpnext/selling/Print Format/Quotation Classic/Quotation Classic.txt b/erpnext/selling/Print Format/Quotation Classic/Quotation Classic.json similarity index 100% rename from erpnext/selling/Print Format/Quotation Classic/Quotation Classic.txt rename to erpnext/selling/Print Format/Quotation Classic/Quotation Classic.json diff --git a/erpnext/selling/Print Format/Quotation Modern/Quotation Modern.txt b/erpnext/selling/Print Format/Quotation Modern/Quotation Modern.json similarity index 100% rename from erpnext/selling/Print Format/Quotation Modern/Quotation Modern.txt rename to erpnext/selling/Print Format/Quotation Modern/Quotation Modern.json diff --git a/erpnext/selling/Print Format/Quotation Spartan/Quotation Spartan.txt b/erpnext/selling/Print Format/Quotation Spartan/Quotation Spartan.json similarity index 100% rename from erpnext/selling/Print Format/Quotation Spartan/Quotation Spartan.txt rename to erpnext/selling/Print Format/Quotation Spartan/Quotation Spartan.json diff --git a/erpnext/selling/Print Format/Sales Order Classic/Sales Order Classic.txt b/erpnext/selling/Print Format/Sales Order Classic/Sales Order Classic.json similarity index 100% rename from erpnext/selling/Print Format/Sales Order Classic/Sales Order Classic.txt rename to erpnext/selling/Print Format/Sales Order Classic/Sales Order Classic.json diff --git a/erpnext/selling/Print Format/Sales Order Modern/Sales Order Modern.txt b/erpnext/selling/Print Format/Sales Order Modern/Sales Order Modern.json similarity index 100% rename from erpnext/selling/Print Format/Sales Order Modern/Sales Order Modern.txt rename to erpnext/selling/Print Format/Sales Order Modern/Sales Order Modern.json diff --git a/erpnext/selling/Print Format/Sales Order Spartan/Sales Order Spartan.txt b/erpnext/selling/Print Format/Sales Order Spartan/Sales Order Spartan.json similarity index 100% rename from erpnext/selling/Print Format/Sales Order Spartan/Sales Order Spartan.txt rename to erpnext/selling/Print Format/Sales Order Spartan/Sales Order Spartan.json diff --git a/erpnext/selling/doctype/campaign/campaign.txt b/erpnext/selling/doctype/campaign/campaign.json similarity index 100% rename from erpnext/selling/doctype/campaign/campaign.txt rename to erpnext/selling/doctype/campaign/campaign.json diff --git a/erpnext/selling/doctype/campaign/test_campaign.py b/erpnext/selling/doctype/campaign/test_campaign.py index d3bf61e80a..5d7c9a4649 100644 --- a/erpnext/selling/doctype/campaign/test_campaign.py +++ b/erpnext/selling/doctype/campaign/test_campaign.py @@ -1,7 +1,6 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [ - [{"doctype":"Campaign", "campaign_name":"_Test Campaign"}], - [{"doctype":"Campaign", "campaign_name":"_Test Campaign 1"}], -] \ No newline at end of file + +import frappe +test_records = frappe.get_test_records('Campaign') \ No newline at end of file diff --git a/erpnext/selling/doctype/customer/customer.txt b/erpnext/selling/doctype/customer/customer.json similarity index 100% rename from erpnext/selling/doctype/customer/customer.txt rename to erpnext/selling/doctype/customer/customer.json diff --git a/erpnext/selling/doctype/customer/test_customer.py b/erpnext/selling/doctype/customer/test_customer.py index b6a7116843..be60795ccc 100644 --- a/erpnext/selling/doctype/customer/test_customer.py +++ b/erpnext/selling/doctype/customer/test_customer.py @@ -49,29 +49,4 @@ class TestCustomer(unittest.TestCase): test_ignore = ["Price List"] -test_records = [ - [{ - "doctype": "Customer", - "customer_name": "_Test Customer", - "customer_type": "Individual", - "customer_group": "_Test Customer Group", - "territory": "_Test Territory", - "company": "_Test Company" - }], - [{ - "doctype": "Customer", - "customer_name": "_Test Customer 1", - "customer_type": "Individual", - "customer_group": "_Test Customer Group", - "territory": "_Test Territory", - "company": "_Test Company" - }], - [{ - "doctype": "Customer", - "customer_name": "_Test Customer 2", - "customer_type": "Individual", - "customer_group": "_Test Customer Group", - "territory": "_Test Territory", - "company": "_Test Company" - }] -] \ No newline at end of file +test_records = frappe.get_test_records('Customer') \ No newline at end of file diff --git a/erpnext/selling/doctype/industry_type/industry_type.txt b/erpnext/selling/doctype/industry_type/industry_type.json similarity index 100% rename from erpnext/selling/doctype/industry_type/industry_type.txt rename to erpnext/selling/doctype/industry_type/industry_type.json diff --git a/erpnext/selling/doctype/industry_type/test_industry_type.py b/erpnext/selling/doctype/industry_type/test_industry_type.py index 91679c77bb..31c5bb2672 100644 --- a/erpnext/selling/doctype/industry_type/test_industry_type.py +++ b/erpnext/selling/doctype/industry_type/test_industry_type.py @@ -1,7 +1,6 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [ - [{"doctype":"Industry Type", "industry":"_Test Industry"}], - [{"doctype":"Industry Type", "industry":"_Test Industry 1"}], -] \ No newline at end of file + +import frappe +test_records = frappe.get_test_records('Industry Type') \ No newline at end of file diff --git a/erpnext/selling/doctype/installation_note/installation_note.txt b/erpnext/selling/doctype/installation_note/installation_note.json similarity index 100% rename from erpnext/selling/doctype/installation_note/installation_note.txt rename to erpnext/selling/doctype/installation_note/installation_note.json diff --git a/erpnext/selling/doctype/installation_note_item/installation_note_item.txt b/erpnext/selling/doctype/installation_note_item/installation_note_item.json similarity index 100% rename from erpnext/selling/doctype/installation_note_item/installation_note_item.txt rename to erpnext/selling/doctype/installation_note_item/installation_note_item.json diff --git a/erpnext/selling/doctype/lead/lead.txt b/erpnext/selling/doctype/lead/lead.json similarity index 100% rename from erpnext/selling/doctype/lead/lead.txt rename to erpnext/selling/doctype/lead/lead.json diff --git a/erpnext/selling/doctype/lead/test_lead.py b/erpnext/selling/doctype/lead/test_lead.py index a403e93332..697f2e156f 100644 --- a/erpnext/selling/doctype/lead/test_lead.py +++ b/erpnext/selling/doctype/lead/test_lead.py @@ -3,16 +3,7 @@ from __future__ import unicode_literals -test_records = [ - [{"doctype":"Lead", "lead_name": "_Test Lead", "status":"Open", - "email_id":"test_lead@example.com", "territory": "_Test Territory"}], - [{"doctype":"Lead", "lead_name": "_Test Lead 1", "status":"Open", - "email_id":"test_lead1@example.com"}], - [{"doctype":"Lead", "lead_name": "_Test Lead 2", "status":"Contacted", - "email_id":"test_lead2@example.com"}], - [{"doctype":"Lead", "lead_name": "_Test Lead 3", "status":"Converted", - "email_id":"test_lead3@example.com"}], -] +test_records = frappe.get_test_records('Lead') import frappe import unittest @@ -28,5 +19,4 @@ class TestLead(unittest.TestCase): customer[0]["company"] = "_Test Company" customer[0]["customer_group"] = "_Test Customer Group" - frappe.get_doc(customer).insert() - \ No newline at end of file + frappe.get_doc(customer).insert() \ No newline at end of file diff --git a/erpnext/selling/doctype/opportunity/opportunity.txt b/erpnext/selling/doctype/opportunity/opportunity.json similarity index 100% rename from erpnext/selling/doctype/opportunity/opportunity.txt rename to erpnext/selling/doctype/opportunity/opportunity.json diff --git a/erpnext/selling/doctype/opportunity_item/opportunity_item.txt b/erpnext/selling/doctype/opportunity_item/opportunity_item.json similarity index 100% rename from erpnext/selling/doctype/opportunity_item/opportunity_item.txt rename to erpnext/selling/doctype/opportunity_item/opportunity_item.json diff --git a/erpnext/selling/doctype/quotation/quotation.txt b/erpnext/selling/doctype/quotation/quotation.json similarity index 100% rename from erpnext/selling/doctype/quotation/quotation.txt rename to erpnext/selling/doctype/quotation/quotation.json diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py index 6b24858021..900d764afe 100644 --- a/erpnext/selling/doctype/quotation/quotation.py +++ b/erpnext/selling/doctype/quotation/quotation.py @@ -5,7 +5,6 @@ from __future__ import unicode_literals import frappe from frappe.utils import cstr -from frappe.model.code import get_obj from frappe import _, msgprint from erpnext.controllers.selling_controller import SellingController @@ -74,7 +73,7 @@ class Quotation(SellingController): self.check_item_table() # Check for Approving Authority - get_obj('Authorization Control').validate_approving_authority(self.doctype, self.company, self.grand_total, self) + frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype, self.company, self.grand_total, self) #update enquiry status self.update_opportunity() diff --git a/erpnext/selling/doctype/quotation/test_quotation.py b/erpnext/selling/doctype/quotation/test_quotation.py index b9f4921140..54aa1c4eb0 100644 --- a/erpnext/selling/doctype/quotation/test_quotation.py +++ b/erpnext/selling/doctype/quotation/test_quotation.py @@ -11,7 +11,7 @@ class TestQuotation(unittest.TestCase): def test_make_sales_order(self): from erpnext.selling.doctype.quotation.quotation import make_sales_order - quotation = frappe.get_doc(copy=test_records[0]) + quotation = frappe.copy_doc(test_records[0]) quotation.insert() self.assertRaises(frappe.ValidationError, make_sales_order, quotation.name) @@ -32,37 +32,4 @@ class TestQuotation(unittest.TestCase): frappe.get_doc(sales_order).insert() -test_records = [ - [ - { - "company": "_Test Company", - "conversion_rate": 1.0, - "currency": "INR", - "quotation_to": "Customer", - "customer": "_Test Customer", - "customer_name": "_Test Customer", - "customer_group": "_Test Customer Group", - "doctype": "Quotation", - "fiscal_year": "_Test Fiscal Year 2013", - "order_type": "Sales", - "plc_conversion_rate": 1.0, - "price_list_currency": "INR", - "selling_price_list": "_Test Price List", - "territory": "_Test Territory", - "transaction_date": "2013-02-21", - "grand_total": 1000.0, - "grand_total_export": 1000.0, - }, - { - "description": "CPU", - "doctype": "Quotation Item", - "item_code": "_Test Item Home Desktop 100", - "item_name": "CPU", - "parentfield": "quotation_details", - "qty": 10.0, - "base_rate": 100.0, - "rate": 100.0, - "base_amount": 1000.0, - } - ], -] \ No newline at end of file +test_records = frappe.get_test_records('Quotation') \ No newline at end of file diff --git a/erpnext/selling/doctype/quotation_item/quotation_item.txt b/erpnext/selling/doctype/quotation_item/quotation_item.json similarity index 100% rename from erpnext/selling/doctype/quotation_item/quotation_item.txt rename to erpnext/selling/doctype/quotation_item/quotation_item.json diff --git a/erpnext/selling/doctype/sales_bom/sales_bom.txt b/erpnext/selling/doctype/sales_bom/sales_bom.json similarity index 100% rename from erpnext/selling/doctype/sales_bom/sales_bom.txt rename to erpnext/selling/doctype/sales_bom/sales_bom.json diff --git a/erpnext/selling/doctype/sales_bom/test_sales_bom.py b/erpnext/selling/doctype/sales_bom/test_sales_bom.py index 02ca68f0c5..6d39ee2e0f 100644 --- a/erpnext/selling/doctype/sales_bom/test_sales_bom.py +++ b/erpnext/selling/doctype/sales_bom/test_sales_bom.py @@ -1,23 +1,6 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [ - [ - { - "doctype": "Sales BOM", - "new_item_code": "_Test Sales BOM Item" - }, - { - "doctype": "Sales BOM Item", - "item_code": "_Test Item", - "parentfield": "sales_bom_items", - "qty": 5.0 - }, - { - "doctype": "Sales BOM Item", - "item_code": "_Test Item Home Desktop 100", - "parentfield": "sales_bom_items", - "qty": 2.0 - } - ], -] \ No newline at end of file + +import frappe +test_records = frappe.get_test_records('Sales Bom') \ No newline at end of file diff --git a/erpnext/selling/doctype/sales_bom_item/sales_bom_item.txt b/erpnext/selling/doctype/sales_bom_item/sales_bom_item.json similarity index 100% rename from erpnext/selling/doctype/sales_bom_item/sales_bom_item.txt rename to erpnext/selling/doctype/sales_bom_item/sales_bom_item.json diff --git a/erpnext/selling/doctype/sales_order/sales_order.txt b/erpnext/selling/doctype/sales_order/sales_order.json similarity index 100% rename from erpnext/selling/doctype/sales_order/sales_order.txt rename to erpnext/selling/doctype/sales_order/sales_order.json diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index e553b26f04..0dbb78ac26 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -7,7 +7,6 @@ import frappe.utils from frappe.utils import cstr, flt, getdate -from frappe.model.code import get_obj from frappe import msgprint from frappe.model.mapper import get_mapped_doc @@ -161,7 +160,7 @@ class SalesOrder(SellingController): self.check_credit(self.grand_total) - get_obj('Authorization Control').validate_approving_authority(self.doctype, self.grand_total, self) + frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype, self.grand_total, self) self.update_prevdoc_status('submit') frappe.db.set(self, 'status', 'Submitted') diff --git a/erpnext/selling/doctype/sales_order/test_sales_order.py b/erpnext/selling/doctype/sales_order/test_sales_order.py index 62411b0543..e56de33db5 100644 --- a/erpnext/selling/doctype/sales_order/test_sales_order.py +++ b/erpnext/selling/doctype/sales_order/test_sales_order.py @@ -12,7 +12,7 @@ class TestSalesOrder(unittest.TestCase): def test_make_material_request(self): from erpnext.selling.doctype.sales_order.sales_order import make_material_request - so = frappe.get_doc(copy=test_records[0]).insert() + so = frappe.copy_doc(test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_material_request, so.name) @@ -27,7 +27,7 @@ class TestSalesOrder(unittest.TestCase): def test_make_delivery_note(self): from erpnext.selling.doctype.sales_order.sales_order import make_delivery_note - so = frappe.get_doc(copy=test_records[0]).insert() + so = frappe.copy_doc(test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_delivery_note, so.name) @@ -42,7 +42,7 @@ class TestSalesOrder(unittest.TestCase): def test_make_sales_invoice(self): from erpnext.selling.doctype.sales_order.sales_order import make_sales_invoice - so = frappe.get_doc(copy=test_records[0]).insert() + so = frappe.copy_doc(test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_sales_invoice, so.name) @@ -68,7 +68,7 @@ class TestSalesOrder(unittest.TestCase): if not so_doclist: so_doclist = test_records[0] - w = frappe.get_doc(copy=so_doclist) + w = frappe.copy_doc(so_doclist) w.insert() w.submit() @@ -290,7 +290,7 @@ class TestSalesOrder(unittest.TestCase): frappe.set_user("test@example.com") from frappe.model.bean import BeanPermissionError - so = frappe.get_doc(copy = test_records[0]) + so = frappe.copy_doc(test_records[0]) so.company = "_Test Company 1" so.conversion_rate = 0.02 so.plc_conversion_rate = 0.02 @@ -304,39 +304,4 @@ class TestSalesOrder(unittest.TestCase): test_dependencies = ["Sales BOM", "Currency Exchange"] -test_records = [ - [ - { - "company": "_Test Company", - "conversion_rate": 1.0, - "currency": "INR", - "customer": "_Test Customer", - "customer_name": "_Test Customer", - "customer_group": "_Test Customer Group", - "doctype": "Sales Order", - "fiscal_year": "_Test Fiscal Year 2013", - "order_type": "Sales", - "delivery_date": "2013-02-23", - "plc_conversion_rate": 1.0, - "price_list_currency": "INR", - "selling_price_list": "_Test Price List", - "territory": "_Test Territory", - "transaction_date": "2013-02-21", - "grand_total": 1000.0, - "grand_total_export": 1000.0, - "naming_series": "_T-Sales Order-" - }, - { - "description": "CPU", - "doctype": "Sales Order Item", - "item_code": "_Test Item Home Desktop 100", - "item_name": "CPU", - "parentfield": "sales_order_details", - "qty": 10.0, - "base_rate": 100.0, - "rate": 100.0, - "base_amount": 1000.0, - "warehouse": "_Test Warehouse - _TC", - } - ], -] \ No newline at end of file +test_records = frappe.get_test_records('Sales Order') \ No newline at end of file diff --git a/erpnext/selling/doctype/sales_order_item/sales_order_item.txt b/erpnext/selling/doctype/sales_order_item/sales_order_item.json similarity index 100% rename from erpnext/selling/doctype/sales_order_item/sales_order_item.txt rename to erpnext/selling/doctype/sales_order_item/sales_order_item.json diff --git a/erpnext/selling/doctype/sales_team/sales_team.txt b/erpnext/selling/doctype/sales_team/sales_team.json similarity index 100% rename from erpnext/selling/doctype/sales_team/sales_team.txt rename to erpnext/selling/doctype/sales_team/sales_team.json diff --git a/erpnext/selling/doctype/selling_settings/selling_settings.txt b/erpnext/selling/doctype/selling_settings/selling_settings.json similarity index 100% rename from erpnext/selling/doctype/selling_settings/selling_settings.txt rename to erpnext/selling/doctype/selling_settings/selling_settings.json diff --git a/erpnext/selling/doctype/sms_center/sms_center.txt b/erpnext/selling/doctype/sms_center/sms_center.json similarity index 100% rename from erpnext/selling/doctype/sms_center/sms_center.txt rename to erpnext/selling/doctype/sms_center/sms_center.json diff --git a/erpnext/selling/doctype/sms_center/sms_center.py b/erpnext/selling/doctype/sms_center/sms_center.py index 51f9d77061..487df38644 100644 --- a/erpnext/selling/doctype/sms_center/sms_center.py +++ b/erpnext/selling/doctype/sms_center/sms_center.py @@ -5,7 +5,6 @@ from __future__ import unicode_literals import frappe from frappe.utils import cstr -from frappe.model.code import get_obj from frappe import msgprint, _ from frappe.model.document import Document @@ -74,4 +73,4 @@ class SmsCenter(Document): else: receiver_list = self.get_receiver_nos() if receiver_list: - msgprint(get_obj('SMS Control', 'SMS Control').send_sms(receiver_list, cstr(self.message))) \ No newline at end of file + msgprint(frappe.get_doc('SMS Control', 'SMS Control').send_sms(receiver_list, cstr(self.message))) \ No newline at end of file diff --git a/erpnext/selling/page/sales_analytics/sales_analytics.txt b/erpnext/selling/page/sales_analytics/sales_analytics.json similarity index 100% rename from erpnext/selling/page/sales_analytics/sales_analytics.txt rename to erpnext/selling/page/sales_analytics/sales_analytics.json diff --git a/erpnext/selling/page/sales_browser/sales_browser.txt b/erpnext/selling/page/sales_browser/sales_browser.json similarity index 100% rename from erpnext/selling/page/sales_browser/sales_browser.txt rename to erpnext/selling/page/sales_browser/sales_browser.json diff --git a/erpnext/selling/page/sales_funnel/sales_funnel.txt b/erpnext/selling/page/sales_funnel/sales_funnel.json similarity index 100% rename from erpnext/selling/page/sales_funnel/sales_funnel.txt rename to erpnext/selling/page/sales_funnel/sales_funnel.json diff --git a/erpnext/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.txt b/erpnext/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.json similarity index 100% rename from erpnext/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.txt rename to erpnext/selling/report/available_stock_for_packing_items/available_stock_for_packing_items.json diff --git a/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.txt b/erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.json similarity index 100% rename from erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.txt rename to erpnext/selling/report/customer_acquisition_and_loyalty/customer_acquisition_and_loyalty.json diff --git a/erpnext/selling/report/customer_addresses_and_contacts/customer_addresses_and_contacts.txt b/erpnext/selling/report/customer_addresses_and_contacts/customer_addresses_and_contacts.json similarity index 100% rename from erpnext/selling/report/customer_addresses_and_contacts/customer_addresses_and_contacts.txt rename to erpnext/selling/report/customer_addresses_and_contacts/customer_addresses_and_contacts.json diff --git a/erpnext/selling/report/customers_not_buying_since_long_time/customers_not_buying_since_long_time.txt b/erpnext/selling/report/customers_not_buying_since_long_time/customers_not_buying_since_long_time.json similarity index 100% rename from erpnext/selling/report/customers_not_buying_since_long_time/customers_not_buying_since_long_time.txt rename to erpnext/selling/report/customers_not_buying_since_long_time/customers_not_buying_since_long_time.json diff --git a/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.txt b/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.json similarity index 100% rename from erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.txt rename to erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.json diff --git a/erpnext/selling/report/lead_details/lead_details.txt b/erpnext/selling/report/lead_details/lead_details.json similarity index 100% rename from erpnext/selling/report/lead_details/lead_details.txt rename to erpnext/selling/report/lead_details/lead_details.json diff --git a/erpnext/selling/report/pending_so_items_for_purchase_request/pending_so_items_for_purchase_request.txt b/erpnext/selling/report/pending_so_items_for_purchase_request/pending_so_items_for_purchase_request.json similarity index 100% rename from erpnext/selling/report/pending_so_items_for_purchase_request/pending_so_items_for_purchase_request.txt rename to erpnext/selling/report/pending_so_items_for_purchase_request/pending_so_items_for_purchase_request.json diff --git a/erpnext/selling/report/quotation_trends/quotation_trends.txt b/erpnext/selling/report/quotation_trends/quotation_trends.json similarity index 100% rename from erpnext/selling/report/quotation_trends/quotation_trends.txt rename to erpnext/selling/report/quotation_trends/quotation_trends.json diff --git a/erpnext/selling/report/sales_order_trends/sales_order_trends.txt b/erpnext/selling/report/sales_order_trends/sales_order_trends.json similarity index 100% rename from erpnext/selling/report/sales_order_trends/sales_order_trends.txt rename to erpnext/selling/report/sales_order_trends/sales_order_trends.json diff --git a/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.txt b/erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.json similarity index 100% rename from erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.txt rename to erpnext/selling/report/sales_person_target_variance_item_group_wise/sales_person_target_variance_item_group_wise.json diff --git a/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.txt b/erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.json similarity index 100% rename from erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.txt rename to erpnext/selling/report/sales_person_wise_transaction_summary/sales_person_wise_transaction_summary.json diff --git a/erpnext/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.txt b/erpnext/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.json similarity index 100% rename from erpnext/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.txt rename to erpnext/selling/report/territory_target_variance_item_group_wise/territory_target_variance_item_group_wise.json diff --git a/erpnext/setup/doctype/applicable_territory/applicable_territory.txt b/erpnext/setup/doctype/applicable_territory/applicable_territory.json similarity index 100% rename from erpnext/setup/doctype/applicable_territory/applicable_territory.txt rename to erpnext/setup/doctype/applicable_territory/applicable_territory.json diff --git a/erpnext/setup/doctype/authorization_control/authorization_control.txt b/erpnext/setup/doctype/authorization_control/authorization_control.json similarity index 100% rename from erpnext/setup/doctype/authorization_control/authorization_control.txt rename to erpnext/setup/doctype/authorization_control/authorization_control.json diff --git a/erpnext/setup/doctype/authorization_rule/authorization_rule.txt b/erpnext/setup/doctype/authorization_rule/authorization_rule.json similarity index 100% rename from erpnext/setup/doctype/authorization_rule/authorization_rule.txt rename to erpnext/setup/doctype/authorization_rule/authorization_rule.json diff --git a/erpnext/setup/doctype/backup_manager/backup_manager.txt b/erpnext/setup/doctype/backup_manager/backup_manager.json similarity index 100% rename from erpnext/setup/doctype/backup_manager/backup_manager.txt rename to erpnext/setup/doctype/backup_manager/backup_manager.json diff --git a/erpnext/setup/doctype/brand/brand.txt b/erpnext/setup/doctype/brand/brand.json similarity index 100% rename from erpnext/setup/doctype/brand/brand.txt rename to erpnext/setup/doctype/brand/brand.json diff --git a/erpnext/setup/doctype/brand/test_brand.py b/erpnext/setup/doctype/brand/test_brand.py index c66413ffa0..34dc6de048 100644 --- a/erpnext/setup/doctype/brand/test_brand.py +++ b/erpnext/setup/doctype/brand/test_brand.py @@ -1,9 +1,6 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [ - [{ - "doctype": "Brand", - "brand": "_Test Brand" - }] -] \ No newline at end of file + +import frappe +test_records = frappe.get_test_records('Brand') \ No newline at end of file diff --git a/erpnext/setup/doctype/company/company.txt b/erpnext/setup/doctype/company/company.json similarity index 100% rename from erpnext/setup/doctype/company/company.txt rename to erpnext/setup/doctype/company/company.json diff --git a/erpnext/setup/doctype/company/test_company.py b/erpnext/setup/doctype/company/test_company.py index 691bc72f9d..570cd23aa9 100644 --- a/erpnext/setup/doctype/company/test_company.py +++ b/erpnext/setup/doctype/company/test_company.py @@ -29,19 +29,4 @@ class TestCompany(unittest.TestCase): frappe.delete_doc("Company", "_Test Company 2") -test_records = [ - [{ - "doctype": "Company", - "company_name": "_Test Company", - "abbr": "_TC", - "default_currency": "INR", - "domain": "Manufacturing" - }], - [{ - "doctype": "Company", - "company_name": "_Test Company 1", - "abbr": "_TC1", - "default_currency": "USD", - "domain": "Retail" - }], -] \ No newline at end of file +test_records = frappe.get_test_records('Company') \ No newline at end of file diff --git a/erpnext/setup/doctype/contact_control/contact_control.txt b/erpnext/setup/doctype/contact_control/contact_control.json similarity index 100% rename from erpnext/setup/doctype/contact_control/contact_control.txt rename to erpnext/setup/doctype/contact_control/contact_control.json diff --git a/erpnext/setup/doctype/country/country.txt b/erpnext/setup/doctype/country/country.json similarity index 100% rename from erpnext/setup/doctype/country/country.txt rename to erpnext/setup/doctype/country/country.json diff --git a/erpnext/setup/doctype/country/test_country.py b/erpnext/setup/doctype/country/test_country.py index 27174a1024..b2610667af 100644 --- a/erpnext/setup/doctype/country/test_country.py +++ b/erpnext/setup/doctype/country/test_country.py @@ -1,9 +1,6 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [ - [{ - "doctype": "Country", - "country_name": "_Test Country" - }] -] \ No newline at end of file + +import frappe +test_records = frappe.get_test_records('Country') \ No newline at end of file diff --git a/erpnext/setup/doctype/currency/currency.txt b/erpnext/setup/doctype/currency/currency.json similarity index 100% rename from erpnext/setup/doctype/currency/currency.txt rename to erpnext/setup/doctype/currency/currency.json diff --git a/erpnext/setup/doctype/currency/test_currency.py b/erpnext/setup/doctype/currency/test_currency.py index 41a2fab254..f0c6cee260 100644 --- a/erpnext/setup/doctype/currency/test_currency.py +++ b/erpnext/setup/doctype/currency/test_currency.py @@ -2,4 +2,6 @@ # License: GNU General Public License v3. See license.txt # pre loaded -test_records = [] \ No newline at end of file + +import frappe +test_records = frappe.get_test_records('Currency') \ No newline at end of file diff --git a/erpnext/setup/doctype/currency_exchange/currency_exchange.txt b/erpnext/setup/doctype/currency_exchange/currency_exchange.json similarity index 100% rename from erpnext/setup/doctype/currency_exchange/currency_exchange.txt rename to erpnext/setup/doctype/currency_exchange/currency_exchange.json diff --git a/erpnext/setup/doctype/currency_exchange/test_currency_exchange.py b/erpnext/setup/doctype/currency_exchange/test_currency_exchange.py index f8260be607..6726dc8318 100644 --- a/erpnext/setup/doctype/currency_exchange/test_currency_exchange.py +++ b/erpnext/setup/doctype/currency_exchange/test_currency_exchange.py @@ -1,23 +1,6 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [ - [{ - "doctype": "Currency Exchange", - "from_currency": "USD", - "to_currency": "INR", - "exchange_rate": 60.0 - }], - [{ - "doctype": "Currency Exchange", - "from_currency": "USD", - "to_currency": "EUR", - "exchange_rate": 0.773 - }], - [{ - "doctype": "Currency Exchange", - "from_currency": "INR", - "to_currency": "USD", - "exchange_rate": 0.0167 - }], -] \ No newline at end of file + +import frappe +test_records = frappe.get_test_records('Currency Exchange') \ No newline at end of file diff --git a/erpnext/setup/doctype/customer_group/customer_group.txt b/erpnext/setup/doctype/customer_group/customer_group.json similarity index 100% rename from erpnext/setup/doctype/customer_group/customer_group.txt rename to erpnext/setup/doctype/customer_group/customer_group.json diff --git a/erpnext/setup/doctype/customer_group/test_customer_group.py b/erpnext/setup/doctype/customer_group/test_customer_group.py index e08ec23e3f..68f7aacc3b 100644 --- a/erpnext/setup/doctype/customer_group/test_customer_group.py +++ b/erpnext/setup/doctype/customer_group/test_customer_group.py @@ -4,11 +4,6 @@ test_ignore = ["Price List"] -test_records = [ - [{ - "doctype": "Customer Group", - "customer_group_name": "_Test Customer Group", - "parent_customer_group": "All Customer Groups", - "is_group": "No" - }] -] \ No newline at end of file + +import frappe +test_records = frappe.get_test_records('Customer Group') \ No newline at end of file diff --git a/erpnext/setup/doctype/email_digest/email_digest.txt b/erpnext/setup/doctype/email_digest/email_digest.json similarity index 100% rename from erpnext/setup/doctype/email_digest/email_digest.txt rename to erpnext/setup/doctype/email_digest/email_digest.json diff --git a/erpnext/setup/doctype/email_digest/email_digest.py b/erpnext/setup/doctype/email_digest/email_digest.py index 5d3efcd7a5..e077c95715 100644 --- a/erpnext/setup/doctype/email_digest/email_digest.py +++ b/erpnext/setup/doctype/email_digest/email_digest.py @@ -471,12 +471,11 @@ class EmailDigest(DocListController): self.get_next_sending() def send(): - from frappe.model.code import get_obj - from frappe.utils import getdate + from frappe.utils import getdate now_date = now_datetime().date() for ed in frappe.db.sql("""select name from `tabEmail Digest` where enabled=1 and docstatus<2""", as_list=1): - ed_obj = get_obj('Email Digest', ed[0]) + ed_obj = frappe.get_doc('Email Digest', ed[0]) if (now_date == ed_obj.get_next_sending()): ed_obj.send() diff --git a/erpnext/setup/doctype/features_setup/features_setup.txt b/erpnext/setup/doctype/features_setup/features_setup.json similarity index 100% rename from erpnext/setup/doctype/features_setup/features_setup.txt rename to erpnext/setup/doctype/features_setup/features_setup.json diff --git a/erpnext/setup/doctype/global_defaults/global_defaults.txt b/erpnext/setup/doctype/global_defaults/global_defaults.json similarity index 100% rename from erpnext/setup/doctype/global_defaults/global_defaults.txt rename to erpnext/setup/doctype/global_defaults/global_defaults.json diff --git a/erpnext/setup/doctype/item_group/item_group.txt b/erpnext/setup/doctype/item_group/item_group.json similarity index 100% rename from erpnext/setup/doctype/item_group/item_group.txt rename to erpnext/setup/doctype/item_group/item_group.json diff --git a/erpnext/setup/doctype/item_group/test_item_group.py b/erpnext/setup/doctype/item_group/test_item_group.py index 4bdace8ef5..ae23499620 100644 --- a/erpnext/setup/doctype/item_group/test_item_group.py +++ b/erpnext/setup/doctype/item_group/test_item_group.py @@ -7,74 +7,7 @@ import frappe from frappe.utils.nestedset import NestedSetRecursionError, NestedSetMultipleRootsError, \ NestedSetChildExistsError, NestedSetInvalidMergeError, rebuild_tree, get_ancestors_of -test_records = [ - [{ - "doctype": "Item Group", - "item_group_name": "_Test Item Group", - "parent_item_group": "All Item Groups", - "is_group": "No" - }], - [{ - "doctype": "Item Group", - "item_group_name": "_Test Item Group Desktops", - "parent_item_group": "All Item Groups", - "is_group": "No" - }], - [{ - "doctype": "Item Group", - "item_group_name": "_Test Item Group A", - "parent_item_group": "All Item Groups", - "is_group": "Yes" - }], - [{ - "doctype": "Item Group", - "item_group_name": "_Test Item Group B", - "parent_item_group": "All Item Groups", - "is_group": "Yes" - }], - [{ - "doctype": "Item Group", - "item_group_name": "_Test Item Group B - 1", - "parent_item_group": "_Test Item Group B", - "is_group": "Yes" - }], - [{ - "doctype": "Item Group", - "item_group_name": "_Test Item Group B - 2", - "parent_item_group": "_Test Item Group B", - "is_group": "Yes" - }], - [{ - "doctype": "Item Group", - "item_group_name": "_Test Item Group B - 3", - "parent_item_group": "_Test Item Group B", - "is_group": "No" - }], - [{ - "doctype": "Item Group", - "item_group_name": "_Test Item Group C", - "parent_item_group": "All Item Groups", - "is_group": "Yes" - }], - [{ - "doctype": "Item Group", - "item_group_name": "_Test Item Group C - 1", - "parent_item_group": "_Test Item Group C", - "is_group": "Yes" - }], - [{ - "doctype": "Item Group", - "item_group_name": "_Test Item Group C - 2", - "parent_item_group": "_Test Item Group C", - "is_group": "Yes" - }], - [{ - "doctype": "Item Group", - "item_group_name": "_Test Item Group D", - "parent_item_group": "All Item Groups", - "is_group": "Yes" - }], -] +test_records = frappe.get_test_records('Item Group') class TestItem(unittest.TestCase): def test_basic_tree(self, records=None): @@ -228,7 +161,7 @@ class TestItem(unittest.TestCase): self.assertEquals(new_rgt, item_group.rgt - 2) # insert it back - frappe.get_doc(copy=test_records[6]).insert() + frappe.copy_doc(test_records[6]).insert() self.test_basic_tree() @@ -243,7 +176,7 @@ class TestItem(unittest.TestCase): self.test_basic_tree(records=records_to_test) # insert Group B back - frappe.get_doc(copy=test_records[3]).insert() + frappe.copy_doc(test_records[3]).insert() self.test_basic_tree() # move its children back @@ -263,7 +196,7 @@ class TestItem(unittest.TestCase): self.test_basic_tree(records=records_to_test) # insert Group B - 2back - frappe.get_doc(copy=test_records[5]).insert() + frappe.copy_doc(test_records[5]).insert() self.test_basic_tree() def test_merge_leaf_into_group(self): diff --git a/erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.txt b/erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.json similarity index 100% rename from erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.txt rename to erpnext/setup/doctype/jobs_email_settings/jobs_email_settings.json diff --git a/erpnext/setup/doctype/naming_series/naming_series.txt b/erpnext/setup/doctype/naming_series/naming_series.json similarity index 100% rename from erpnext/setup/doctype/naming_series/naming_series.txt rename to erpnext/setup/doctype/naming_series/naming_series.json diff --git a/erpnext/setup/doctype/naming_series/naming_series.py b/erpnext/setup/doctype/naming_series/naming_series.py index 7338de0189..8fc596e05f 100644 --- a/erpnext/setup/doctype/naming_series/naming_series.py +++ b/erpnext/setup/doctype/naming_series/naming_series.py @@ -6,7 +6,6 @@ import frappe from frappe.utils import cstr from frappe import msgprint, throw, _ -import frappe.model.doctype from frappe.model.document import Document @@ -96,7 +95,7 @@ class NamingSeries(Document): where dt.name = df.dt and df.fieldname='naming_series' and dt.name != %s""", self.select_doc_for_series) )) - sr = [[frappe.model.doctype.get_property(p, 'options', 'naming_series'), p] + sr = [[frappe.get_meta(p).get_field("naming_series").options, p] for p in parent] options = self.scrub_options_list(self.set_options.split("\n")) for series in options: @@ -120,9 +119,7 @@ class NamingSeries(Document): throw('Special Characters except "-" and "/" not allowed in naming series') def get_options(self, arg=''): - sr = frappe.model.doctype.get_property(self.select_doc_for_series, - 'options', 'naming_series') - return sr + return frappe.get_meta(self.select_doc_for_series).get_field("naming_series").options def get_current(self, arg=None): """get series current""" @@ -172,7 +169,6 @@ def set_by_naming_series(doctype, fieldname, naming_series, hide_name_field=True ifnull({fieldname}, '')=''""".format(doctype=doctype, fieldname=fieldname)) def get_default_naming_series(doctype): - from frappe.model.doctype import get_property - naming_series = get_property(doctype, "options", "naming_series") + naming_series = frappe.model.get_meta(doctype).get_field("naming_series").options or "" naming_series = naming_series.split("\n") return naming_series[0] or naming_series[1] \ No newline at end of file diff --git a/erpnext/setup/doctype/notification_control/notification_control.txt b/erpnext/setup/doctype/notification_control/notification_control.json similarity index 100% rename from erpnext/setup/doctype/notification_control/notification_control.txt rename to erpnext/setup/doctype/notification_control/notification_control.json diff --git a/erpnext/setup/doctype/print_heading/print_heading.txt b/erpnext/setup/doctype/print_heading/print_heading.json similarity index 100% rename from erpnext/setup/doctype/print_heading/print_heading.txt rename to erpnext/setup/doctype/print_heading/print_heading.json diff --git a/erpnext/setup/doctype/print_heading/test_print_heading.py b/erpnext/setup/doctype/print_heading/test_print_heading.py index e9f61c4b48..6ccb4d677a 100644 --- a/erpnext/setup/doctype/print_heading/test_print_heading.py +++ b/erpnext/setup/doctype/print_heading/test_print_heading.py @@ -1,4 +1,6 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [[{"print_heading": "_Test Print Heading"}]] \ No newline at end of file + +import frappe +test_records = frappe.get_test_records('Print Heading') \ No newline at end of file diff --git a/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.txt b/erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.json similarity index 100% rename from erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.txt rename to erpnext/setup/doctype/quotation_lost_reason/quotation_lost_reason.json diff --git a/erpnext/setup/doctype/quotation_lost_reason/test_quotation_lost_reason.py b/erpnext/setup/doctype/quotation_lost_reason/test_quotation_lost_reason.py index 486dd86e36..0c96d45142 100644 --- a/erpnext/setup/doctype/quotation_lost_reason/test_quotation_lost_reason.py +++ b/erpnext/setup/doctype/quotation_lost_reason/test_quotation_lost_reason.py @@ -1,4 +1,6 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [[{"doctype":"Quotation Lost Reason", "order_lost_reason": "_Test Quotation Lost Reason"}]] \ No newline at end of file + +import frappe +test_records = frappe.get_test_records('Quotation Lost Reason') \ No newline at end of file diff --git a/erpnext/setup/doctype/sales_email_settings/sales_email_settings.txt b/erpnext/setup/doctype/sales_email_settings/sales_email_settings.json similarity index 100% rename from erpnext/setup/doctype/sales_email_settings/sales_email_settings.txt rename to erpnext/setup/doctype/sales_email_settings/sales_email_settings.json diff --git a/erpnext/setup/doctype/sales_partner/sales_partner.txt b/erpnext/setup/doctype/sales_partner/sales_partner.json similarity index 100% rename from erpnext/setup/doctype/sales_partner/sales_partner.txt rename to erpnext/setup/doctype/sales_partner/sales_partner.json diff --git a/erpnext/setup/doctype/sales_partner/test_sales_partner.py b/erpnext/setup/doctype/sales_partner/test_sales_partner.py index 2dc000680a..e14f5ec6e7 100644 --- a/erpnext/setup/doctype/sales_partner/test_sales_partner.py +++ b/erpnext/setup/doctype/sales_partner/test_sales_partner.py @@ -1,4 +1,6 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [] \ No newline at end of file + +import frappe +test_records = frappe.get_test_records('Sales Partner') \ No newline at end of file diff --git a/erpnext/setup/doctype/sales_person/sales_person.txt b/erpnext/setup/doctype/sales_person/sales_person.json similarity index 100% rename from erpnext/setup/doctype/sales_person/sales_person.txt rename to erpnext/setup/doctype/sales_person/sales_person.json diff --git a/erpnext/setup/doctype/sales_person/test_sales_person.py b/erpnext/setup/doctype/sales_person/test_sales_person.py index ebbc25ed9b..8db97d387f 100644 --- a/erpnext/setup/doctype/sales_person/test_sales_person.py +++ b/erpnext/setup/doctype/sales_person/test_sales_person.py @@ -2,28 +2,6 @@ # License: GNU General Public License v3. See license.txt test_dependencies = ["Employee"] -test_records = [ - [{ - "doctype": "Sales Person", - "sales_person_name": "_Test Sales Person", - "parent_sales_person": "Sales Team", - "is_group": "No", - "employee": "_T-Employee-0001", - }], - [{ - "doctype": "Sales Person", - "sales_person_name": "_Test Sales Person 1", - "parent_sales_person": "Sales Team", - "is_group": "No", - "employee": "_T-Employee-0002", - }], - [{ - "doctype": "Sales Person", - "sales_person_name": "_Test Sales Person 2", - "parent_sales_person": "Sales Team", - "is_group": "No", - "employee": "_T-Employee-0003", - }] - - -] \ No newline at end of file + +import frappe +test_records = frappe.get_test_records('Sales Person') \ No newline at end of file diff --git a/erpnext/setup/doctype/sms_parameter/sms_parameter.txt b/erpnext/setup/doctype/sms_parameter/sms_parameter.json similarity index 100% rename from erpnext/setup/doctype/sms_parameter/sms_parameter.txt rename to erpnext/setup/doctype/sms_parameter/sms_parameter.json diff --git a/erpnext/setup/doctype/sms_settings/sms_settings.txt b/erpnext/setup/doctype/sms_settings/sms_settings.json similarity index 100% rename from erpnext/setup/doctype/sms_settings/sms_settings.txt rename to erpnext/setup/doctype/sms_settings/sms_settings.json diff --git a/erpnext/setup/doctype/supplier_type/supplier_type.txt b/erpnext/setup/doctype/supplier_type/supplier_type.json similarity index 100% rename from erpnext/setup/doctype/supplier_type/supplier_type.txt rename to erpnext/setup/doctype/supplier_type/supplier_type.json diff --git a/erpnext/setup/doctype/supplier_type/test_supplier_type.py b/erpnext/setup/doctype/supplier_type/test_supplier_type.py index eb49ef4ceb..b365a05a85 100644 --- a/erpnext/setup/doctype/supplier_type/test_supplier_type.py +++ b/erpnext/setup/doctype/supplier_type/test_supplier_type.py @@ -1,9 +1,6 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [ - [{ - "doctype": "Supplier Type", - "supplier_type": "_Test Supplier Type", - }] -] \ No newline at end of file + +import frappe +test_records = frappe.get_test_records('Supplier Type') \ No newline at end of file diff --git a/erpnext/setup/doctype/target_detail/target_detail.txt b/erpnext/setup/doctype/target_detail/target_detail.json similarity index 100% rename from erpnext/setup/doctype/target_detail/target_detail.txt rename to erpnext/setup/doctype/target_detail/target_detail.json diff --git a/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.txt b/erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.json similarity index 100% rename from erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.txt rename to erpnext/setup/doctype/terms_and_conditions/terms_and_conditions.json diff --git a/erpnext/setup/doctype/terms_and_conditions/test_terms_and_conditions.py b/erpnext/setup/doctype/terms_and_conditions/test_terms_and_conditions.py index acebf7982c..146930f373 100644 --- a/erpnext/setup/doctype/terms_and_conditions/test_terms_and_conditions.py +++ b/erpnext/setup/doctype/terms_and_conditions/test_terms_and_conditions.py @@ -1,4 +1,6 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [[{"title": "_Test Terms and Conditions", "terms": "_Test Terms"}]] \ No newline at end of file + +import frappe +test_records = frappe.get_test_records('Terms And Conditions') \ No newline at end of file diff --git a/erpnext/setup/doctype/territory/territory.txt b/erpnext/setup/doctype/territory/territory.json similarity index 100% rename from erpnext/setup/doctype/territory/territory.txt rename to erpnext/setup/doctype/territory/territory.json diff --git a/erpnext/setup/doctype/territory/test_territory.py b/erpnext/setup/doctype/territory/test_territory.py index 3068b5f969..22fad29f6a 100644 --- a/erpnext/setup/doctype/territory/test_territory.py +++ b/erpnext/setup/doctype/territory/test_territory.py @@ -1,35 +1,6 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [ - [{ - "doctype": "Territory", - "territory_name": "_Test Territory", - "parent_territory": "All Territories", - "is_group": "No", - }], - [{ - "doctype": "Territory", - "territory_name": "_Test Territory India", - "parent_territory": "All Territories", - "is_group": "Yes", - }], - [{ - "doctype": "Territory", - "territory_name": "_Test Territory Maharashtra", - "parent_territory": "_Test Territory India", - "is_group": "No", - }], - [{ - "doctype": "Territory", - "territory_name": "_Test Territory Rest Of The World", - "parent_territory": "All Territories", - "is_group": "No", - }], - [{ - "doctype": "Territory", - "territory_name": "_Test Territory United States", - "parent_territory": "All Territories", - "is_group": "No", - }], -] \ No newline at end of file + +import frappe +test_records = frappe.get_test_records('Territory') \ No newline at end of file diff --git a/erpnext/setup/doctype/uom/test_uom.py b/erpnext/setup/doctype/uom/test_uom.py index 2a7f2eea31..3511874e6f 100644 --- a/erpnext/setup/doctype/uom/test_uom.py +++ b/erpnext/setup/doctype/uom/test_uom.py @@ -1,14 +1,6 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [ - [{ - "doctype": "UOM", - "uom_name": "_Test UOM", - "must_be_whole_number": 1 - }], - [{ - "doctype": "UOM", - "uom_name": "_Test UOM 1" - }] -] \ No newline at end of file + +import frappe +test_records = frappe.get_test_records('Uom') \ No newline at end of file diff --git a/erpnext/setup/doctype/uom/uom.txt b/erpnext/setup/doctype/uom/uom.json similarity index 100% rename from erpnext/setup/doctype/uom/uom.txt rename to erpnext/setup/doctype/uom/uom.json diff --git a/erpnext/setup/doctype/website_item_group/website_item_group.txt b/erpnext/setup/doctype/website_item_group/website_item_group.json similarity index 100% rename from erpnext/setup/doctype/website_item_group/website_item_group.txt rename to erpnext/setup/doctype/website_item_group/website_item_group.json diff --git a/erpnext/setup/page/setup_wizard/setup_wizard.txt b/erpnext/setup/page/setup_wizard/setup_wizard.json similarity index 100% rename from erpnext/setup/page/setup_wizard/setup_wizard.txt rename to erpnext/setup/page/setup_wizard/setup_wizard.json diff --git a/erpnext/startup/boot.py b/erpnext/startup/boot.py index 0311cdcd63..6624b1d91e 100644 --- a/erpnext/startup/boot.py +++ b/erpnext/startup/boot.py @@ -8,7 +8,6 @@ import frappe def boot_session(bootinfo): """boot session - send website info if guest""" import frappe - import frappe.model.doc bootinfo['custom_css'] = frappe.db.get_value('Style Settings', None, 'custom_css') or '' bootinfo['website_settings'] = frappe.model.getsingle('Website Settings') @@ -18,7 +17,6 @@ def boot_session(bootinfo): load_country_and_currency(bootinfo) - import frappe.model.doctype bootinfo['notification_settings'] = frappe.get_doc("Notification Control", "Notification Control").get_values() diff --git a/erpnext/stock/Print Format/Delivery Note Classic/Delivery Note Classic.txt b/erpnext/stock/Print Format/Delivery Note Classic/Delivery Note Classic.json similarity index 100% rename from erpnext/stock/Print Format/Delivery Note Classic/Delivery Note Classic.txt rename to erpnext/stock/Print Format/Delivery Note Classic/Delivery Note Classic.json diff --git a/erpnext/stock/Print Format/Delivery Note Modern/Delivery Note Modern.txt b/erpnext/stock/Print Format/Delivery Note Modern/Delivery Note Modern.json similarity index 100% rename from erpnext/stock/Print Format/Delivery Note Modern/Delivery Note Modern.txt rename to erpnext/stock/Print Format/Delivery Note Modern/Delivery Note Modern.json diff --git a/erpnext/stock/Print Format/Delivery Note Packing List Wise/Delivery Note Packing List Wise.txt b/erpnext/stock/Print Format/Delivery Note Packing List Wise/Delivery Note Packing List Wise.json similarity index 100% rename from erpnext/stock/Print Format/Delivery Note Packing List Wise/Delivery Note Packing List Wise.txt rename to erpnext/stock/Print Format/Delivery Note Packing List Wise/Delivery Note Packing List Wise.json diff --git a/erpnext/stock/Print Format/Delivery Note Spartan/Delivery Note Spartan.txt b/erpnext/stock/Print Format/Delivery Note Spartan/Delivery Note Spartan.json similarity index 100% rename from erpnext/stock/Print Format/Delivery Note Spartan/Delivery Note Spartan.txt rename to erpnext/stock/Print Format/Delivery Note Spartan/Delivery Note Spartan.json diff --git a/erpnext/stock/doctype/batch/batch.txt b/erpnext/stock/doctype/batch/batch.json similarity index 100% rename from erpnext/stock/doctype/batch/batch.txt rename to erpnext/stock/doctype/batch/batch.json diff --git a/erpnext/stock/doctype/bin/bin.txt b/erpnext/stock/doctype/bin/bin.json similarity index 100% rename from erpnext/stock/doctype/bin/bin.txt rename to erpnext/stock/doctype/bin/bin.json diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.txt b/erpnext/stock/doctype/delivery_note/delivery_note.json similarity index 100% rename from erpnext/stock/doctype/delivery_note/delivery_note.txt rename to erpnext/stock/doctype/delivery_note/delivery_note.json diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index 6207d6cd2e..c0302446e6 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -6,7 +6,6 @@ import frappe from frappe.utils import cstr, flt, cint -from frappe.model.code import get_obj from frappe import msgprint, _ import frappe.defaults from frappe.model.mapper import get_mapped_doc @@ -150,7 +149,7 @@ class DeliveryNote(SellingController): self.validate_packed_qty() # Check for Approving Authority - get_obj('Authorization Control').validate_approving_authority(self.doctype, self.company, self.grand_total, self) + frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype, self.company, self.grand_total, self) # update delivered qty in sales order self.update_prevdoc_status() diff --git a/erpnext/stock/doctype/delivery_note/test_delivery_note.py b/erpnext/stock/doctype/delivery_note/test_delivery_note.py index 1c2bececdd..1ee4993cec 100644 --- a/erpnext/stock/doctype/delivery_note/test_delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/test_delivery_note.py @@ -13,7 +13,7 @@ def _insert_purchase_receipt(item_code=None): if not item_code: item_code = pr_test_records[0][1]["item_code"] - pr = frappe.get_doc(copy=pr_test_records[0]) + pr = frappe.copy_doc(pr_test_records[0]) pr.doclist[1].item_code = item_code pr.insert() pr.submit() @@ -25,7 +25,7 @@ class TestDeliveryNote(unittest.TestCase): from erpnext.stock.doctype.delivery_note.delivery_note import make_sales_invoice _insert_purchase_receipt() - dn = frappe.get_doc(copy=test_records[0]).insert() + dn = frappe.copy_doc(test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_sales_invoice, dn.name) @@ -48,7 +48,7 @@ class TestDeliveryNote(unittest.TestCase): _insert_purchase_receipt() - dn = frappe.get_doc(copy=test_records[0]) + dn = frappe.copy_doc(test_records[0]) dn.insert() dn.submit() @@ -68,7 +68,7 @@ class TestDeliveryNote(unittest.TestCase): _insert_purchase_receipt() - dn = frappe.get_doc(copy=test_records[0]) + dn = frappe.copy_doc(test_records[0]) dn.doclist[1].expense_account = "Cost of Goods Sold - _TC" dn.doclist[1].cost_center = "Main - _TC" @@ -95,7 +95,7 @@ class TestDeliveryNote(unittest.TestCase): self.assertEquals(bal, prev_bal - 375.0) # back dated purchase receipt - pr = frappe.get_doc(copy=pr_test_records[0]) + pr = frappe.copy_doc(pr_test_records[0]) pr.posting_date = "2013-01-01" pr.doclist[1].rate = 100 pr.doclist[1].base_amount = 100 @@ -123,7 +123,7 @@ class TestDeliveryNote(unittest.TestCase): _insert_purchase_receipt() _insert_purchase_receipt("_Test Item Home Desktop 100") - dn = frappe.get_doc(copy=test_records[0]) + dn = frappe.copy_doc(test_records[0]) dn.doclist[1].item_code = "_Test Sales BOM Item" dn.doclist[1].qty = 1 @@ -162,7 +162,7 @@ class TestDeliveryNote(unittest.TestCase): se = make_serialized_item() serial_nos = get_serial_nos(se.doclist[1].serial_no) - dn = frappe.get_doc(copy=test_records[0]) + dn = frappe.copy_doc(test_records[0]) dn.doclist[1].item_code = "_Test Serialized Item With Series" dn.doclist[1].qty = 1 dn.doclist[1].serial_no = serial_nos[0] @@ -199,7 +199,7 @@ class TestDeliveryNote(unittest.TestCase): sr.status = "Not Available" sr.save() - dn = frappe.get_doc(copy=test_records[0]) + dn = frappe.copy_doc(test_records[0]) dn.doclist[1].item_code = "_Test Serialized Item With Series" dn.doclist[1].qty = 1 dn.doclist[1].serial_no = serial_nos[0] @@ -214,43 +214,4 @@ class TestDeliveryNote(unittest.TestCase): test_dependencies = ["Sales BOM"] -test_records = [ - [ - { - "company": "_Test Company", - "conversion_rate": 1.0, - "currency": "INR", - "customer": "_Test Customer", - "customer_name": "_Test Customer", - "doctype": "Delivery Note", - "fiscal_year": "_Test Fiscal Year 2013", - "plc_conversion_rate": 1.0, - "posting_date": "2013-02-21", - "posting_time": "9:00:00", - "price_list_currency": "INR", - "selling_price_list": "_Test Price List", - "status": "Draft", - "territory": "_Test Territory", - "net_total": 500.0, - "grand_total": 500.0, - "grand_total_export": 500.0, - "naming_series": "_T-Delivery Note-" - }, - { - "description": "CPU", - "doctype": "Delivery Note Item", - "item_code": "_Test Item", - "item_name": "_Test Item", - "parentfield": "delivery_note_details", - "qty": 5.0, - "base_rate": 100.0, - "rate": 100.0, - "base_amount": 500.0, - "warehouse": "_Test Warehouse - _TC", - "stock_uom": "_Test UOM", - "expense_account": "Cost of Goods Sold - _TC", - "cost_center": "Main - _TC" - } - ] - -] +test_records = frappe.get_test_records('Delivery Note') \ No newline at end of file diff --git a/erpnext/stock/doctype/delivery_note_item/delivery_note_item.txt b/erpnext/stock/doctype/delivery_note_item/delivery_note_item.json similarity index 100% rename from erpnext/stock/doctype/delivery_note_item/delivery_note_item.txt rename to erpnext/stock/doctype/delivery_note_item/delivery_note_item.json diff --git a/erpnext/stock/doctype/item/item.txt b/erpnext/stock/doctype/item/item.json similarity index 100% rename from erpnext/stock/doctype/item/item.txt rename to erpnext/stock/doctype/item/item.json diff --git a/erpnext/stock/doctype/item/test_item.py b/erpnext/stock/doctype/item/test_item.py index 0ad6be2268..506e5d016c 100644 --- a/erpnext/stock/doctype/item/test_item.py +++ b/erpnext/stock/doctype/item/test_item.py @@ -13,7 +13,7 @@ test_dependencies = ["Warehouse"] class TestItem(unittest.TestCase): def test_default_warehouse(self): from erpnext.stock.doctype.item.item import WarehouseNotSet - item = frappe.get_doc(copy=test_records[0]) + item = frappe.copy_doc(test_records[0]) item.is_stock_item = "Yes" item.default_warehouse = None self.assertRaises(WarehouseNotSet, item.insert) @@ -60,246 +60,4 @@ class TestItem(unittest.TestCase): for key, value in to_check.iteritems(): self.assertEquals(value, details.get(key)) -test_records = [ - [{ - "doctype": "Item", - "item_code": "_Test Item", - "item_name": "_Test Item", - "description": "_Test Item", - "item_group": "_Test Item Group", - "is_stock_item": "Yes", - "is_asset_item": "No", - "has_batch_no": "No", - "has_serial_no": "No", - "is_purchase_item": "Yes", - "is_sales_item": "Yes", - "is_service_item": "No", - "inspection_required": "No", - "is_pro_applicable": "Yes", - "is_sub_contracted_item": "No", - "stock_uom": "_Test UOM", - "income_account": "Sales - _TC", - "default_warehouse": "_Test Warehouse - _TC", - "expense_account": "_Test Account Cost for Goods Sold - _TC", - "selling_cost_center": "_Test Cost Center - _TC", - }, { - "doctype": "Item Reorder", - "parentfield": "item_reorder", - "warehouse": "_Test Warehouse - _TC", - "warehouse_reorder_level": 20, - "warehouse_reorder_qty": 20, - "material_request_type": "Purchase" - }, - ], - [{ - "doctype": "Item", - "item_code": "_Test Item 2", - "item_name": "_Test Item 2", - "description": "_Test Item 2", - "item_group": "_Test Item Group", - "is_stock_item": "Yes", - "is_asset_item": "No", - "has_batch_no": "No", - "has_serial_no": "No", - "is_purchase_item": "Yes", - "is_sales_item": "Yes", - "is_service_item": "No", - "inspection_required": "No", - "is_pro_applicable": "Yes", - "is_sub_contracted_item": "No", - "stock_uom": "_Test UOM", - "income_account": "Sales - _TC", - "default_warehouse": "_Test Warehouse - _TC", - "expense_account": "_Test Account Cost for Goods Sold - _TC" - }], - [{ - "doctype": "Item", - "item_code": "_Test Item Home Desktop 100", - "item_name": "_Test Item Home Desktop 100", - "description": "_Test Item Home Desktop 100", - "item_group": "_Test Item Group Desktops", - "default_warehouse": "_Test Warehouse - _TC", - "income_account": "Sales - _TC", - "expense_account": "_Test Account Cost for Goods Sold - _TC", - "is_stock_item": "Yes", - "is_asset_item": "No", - "has_batch_no": "No", - "has_serial_no": "No", - "is_purchase_item": "Yes", - "is_sales_item": "Yes", - "is_service_item": "No", - "inspection_required": "No", - "is_pro_applicable": "No", - "is_sub_contracted_item": "No", - "is_manufactured_item": "No", - "stock_uom": "_Test UOM" - }, - { - "doctype": "Item Tax", - "tax_type": "_Test Account Excise Duty - _TC", - "tax_rate": 10 - }], - [{ - "doctype": "Item", - "item_code": "_Test Item Home Desktop 200", - "item_name": "_Test Item Home Desktop 200", - "description": "_Test Item Home Desktop 200", - "item_group": "_Test Item Group Desktops", - "default_warehouse": "_Test Warehouse - _TC", - "income_account": "Sales - _TC", - "expense_account": "_Test Account Cost for Goods Sold - _TC", - "is_stock_item": "Yes", - "is_asset_item": "No", - "has_batch_no": "No", - "has_serial_no": "No", - "is_purchase_item": "Yes", - "is_sales_item": "Yes", - "is_service_item": "No", - "inspection_required": "No", - "is_pro_applicable": "No", - "is_sub_contracted_item": "No", - "is_manufactured_item": "No", - "stock_uom": "_Test UOM" - }], - [{ - "doctype": "Item", - "item_code": "_Test Sales BOM Item", - "item_name": "_Test Sales BOM Item", - "description": "_Test Sales BOM Item", - "item_group": "_Test Item Group Desktops", - "income_account": "Sales - _TC", - "expense_account": "_Test Account Cost for Goods Sold - _TC", - "is_stock_item": "No", - "is_asset_item": "No", - "has_batch_no": "No", - "has_serial_no": "No", - "is_purchase_item": "Yes", - "is_sales_item": "Yes", - "is_service_item": "No", - "inspection_required": "No", - "is_pro_applicable": "No", - "is_sub_contracted_item": "No", - "stock_uom": "_Test UOM" - }], - [{ - "doctype": "Item", - "item_code": "_Test FG Item", - "item_name": "_Test FG Item", - "description": "_Test FG Item", - "item_group": "_Test Item Group Desktops", - "is_stock_item": "Yes", - "default_warehouse": "_Test Warehouse - _TC", - "income_account": "Sales - _TC", - "expense_account": "_Test Account Cost for Goods Sold - _TC", - "is_asset_item": "No", - "has_batch_no": "No", - "has_serial_no": "No", - "is_purchase_item": "Yes", - "is_sales_item": "Yes", - "is_service_item": "No", - "inspection_required": "No", - "is_pro_applicable": "Yes", - "is_sub_contracted_item": "Yes", - "stock_uom": "_Test UOM" - }], - [{ - "doctype": "Item", - "item_code": "_Test Non Stock Item", - "item_name": "_Test Non Stock Item", - "description": "_Test Non Stock Item", - "item_group": "_Test Item Group Desktops", - "is_stock_item": "No", - "is_asset_item": "No", - "has_batch_no": "No", - "has_serial_no": "No", - "is_purchase_item": "Yes", - "is_sales_item": "Yes", - "is_service_item": "No", - "inspection_required": "No", - "is_pro_applicable": "No", - "is_sub_contracted_item": "No", - "stock_uom": "_Test UOM" - }], - [{ - "doctype": "Item", - "item_code": "_Test Serialized Item", - "item_name": "_Test Serialized Item", - "description": "_Test Serialized Item", - "item_group": "_Test Item Group Desktops", - "is_stock_item": "Yes", - "default_warehouse": "_Test Warehouse - _TC", - "is_asset_item": "No", - "has_batch_no": "No", - "has_serial_no": "Yes", - "is_purchase_item": "Yes", - "is_sales_item": "Yes", - "is_service_item": "No", - "inspection_required": "No", - "is_pro_applicable": "No", - "is_sub_contracted_item": "No", - "stock_uom": "_Test UOM" - }], - [{ - "doctype": "Item", - "item_code": "_Test Serialized Item With Series", - "item_name": "_Test Serialized Item With Series", - "description": "_Test Serialized Item", - "item_group": "_Test Item Group Desktops", - "is_stock_item": "Yes", - "default_warehouse": "_Test Warehouse - _TC", - "is_asset_item": "No", - "has_batch_no": "No", - "has_serial_no": "Yes", - "serial_no_series": "ABCD.#####", - "is_purchase_item": "Yes", - "is_sales_item": "Yes", - "is_service_item": "No", - "inspection_required": "No", - "is_pro_applicable": "Yes", - "is_sub_contracted_item": "No", - "stock_uom": "_Test UOM" - }], - [{ - "doctype": "Item", - "item_code": "_Test Item Home Desktop Manufactured", - "item_name": "_Test Item Home Desktop Manufactured", - "description": "_Test Item Home Desktop Manufactured", - "item_group": "_Test Item Group Desktops", - "default_warehouse": "_Test Warehouse - _TC", - "income_account": "Sales - _TC", - "expense_account": "_Test Account Cost for Goods Sold - _TC", - "is_stock_item": "Yes", - "is_asset_item": "No", - "has_batch_no": "No", - "has_serial_no": "No", - "is_purchase_item": "Yes", - "is_sales_item": "Yes", - "is_service_item": "No", - "inspection_required": "No", - "is_pro_applicable": "Yes", - "is_sub_contracted_item": "No", - "is_manufactured_item": "Yes", - "stock_uom": "_Test UOM" - }], - [{ - "doctype": "Item", - "item_code": "_Test FG Item 2", - "item_name": "_Test FG Item 2", - "description": "_Test FG Item 2", - "item_group": "_Test Item Group Desktops", - "is_stock_item": "Yes", - "default_warehouse": "_Test Warehouse - _TC", - "income_account": "Sales - _TC", - "expense_account": "_Test Account Cost for Goods Sold - _TC", - "is_asset_item": "No", - "has_batch_no": "No", - "has_serial_no": "No", - "is_purchase_item": "Yes", - "is_sales_item": "Yes", - "is_service_item": "No", - "inspection_required": "No", - "is_pro_applicable": "Yes", - "is_sub_contracted_item": "Yes", - "stock_uom": "_Test UOM" - }], -] \ No newline at end of file +test_records = frappe.get_test_records('Item') \ No newline at end of file diff --git a/erpnext/stock/doctype/item_customer_detail/item_customer_detail.txt b/erpnext/stock/doctype/item_customer_detail/item_customer_detail.json similarity index 100% rename from erpnext/stock/doctype/item_customer_detail/item_customer_detail.txt rename to erpnext/stock/doctype/item_customer_detail/item_customer_detail.json diff --git a/erpnext/stock/doctype/item_price/item_price.txt b/erpnext/stock/doctype/item_price/item_price.json similarity index 100% rename from erpnext/stock/doctype/item_price/item_price.txt rename to erpnext/stock/doctype/item_price/item_price.json diff --git a/erpnext/stock/doctype/item_price/test_item_price.py b/erpnext/stock/doctype/item_price/test_item_price.py index 310c7d9b46..a1a10bae55 100644 --- a/erpnext/stock/doctype/item_price/test_item_price.py +++ b/erpnext/stock/doctype/item_price/test_item_price.py @@ -8,16 +8,7 @@ import frappe class TestItem(unittest.TestCase): def test_duplicate_item(self): from erpnext.stock.doctype.item_price.item_price import ItemPriceDuplicateItem - bean = frappe.get_doc(copy=test_records[0]) + bean = frappe.copy_doc(test_records[0]) self.assertRaises(ItemPriceDuplicateItem, bean.insert) -test_records = [ - [ - { - "doctype": "Item Price", - "price_list": "_Test Price List", - "item_code": "_Test Item", - "price_list_rate": 100 - } - ] -] \ No newline at end of file +test_records = frappe.get_test_records('Item Price') \ No newline at end of file diff --git a/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.txt b/erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.json similarity index 100% rename from erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.txt rename to erpnext/stock/doctype/item_quality_inspection_parameter/item_quality_inspection_parameter.json diff --git a/erpnext/stock/doctype/item_reorder/item_reorder.txt b/erpnext/stock/doctype/item_reorder/item_reorder.json similarity index 100% rename from erpnext/stock/doctype/item_reorder/item_reorder.txt rename to erpnext/stock/doctype/item_reorder/item_reorder.json diff --git a/erpnext/stock/doctype/item_supplier/item_supplier.txt b/erpnext/stock/doctype/item_supplier/item_supplier.json similarity index 100% rename from erpnext/stock/doctype/item_supplier/item_supplier.txt rename to erpnext/stock/doctype/item_supplier/item_supplier.json diff --git a/erpnext/stock/doctype/item_tax/item_tax.txt b/erpnext/stock/doctype/item_tax/item_tax.json similarity index 100% rename from erpnext/stock/doctype/item_tax/item_tax.txt rename to erpnext/stock/doctype/item_tax/item_tax.json diff --git a/erpnext/stock/doctype/item_website_specification/item_website_specification.txt b/erpnext/stock/doctype/item_website_specification/item_website_specification.json similarity index 100% rename from erpnext/stock/doctype/item_website_specification/item_website_specification.txt rename to erpnext/stock/doctype/item_website_specification/item_website_specification.json diff --git a/erpnext/stock/doctype/landed_cost_item/landed_cost_item.txt b/erpnext/stock/doctype/landed_cost_item/landed_cost_item.json similarity index 100% rename from erpnext/stock/doctype/landed_cost_item/landed_cost_item.txt rename to erpnext/stock/doctype/landed_cost_item/landed_cost_item.json diff --git a/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.txt b/erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.json similarity index 100% rename from erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.txt rename to erpnext/stock/doctype/landed_cost_purchase_receipt/landed_cost_purchase_receipt.json diff --git a/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.txt b/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.json similarity index 100% rename from erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.txt rename to erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.json diff --git a/erpnext/stock/doctype/material_request/material_request.txt b/erpnext/stock/doctype/material_request/material_request.json similarity index 100% rename from erpnext/stock/doctype/material_request/material_request.txt rename to erpnext/stock/doctype/material_request/material_request.json diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py index c8f38ed5d2..42c6f23ae2 100644 --- a/erpnext/stock/doctype/material_request/material_request.py +++ b/erpnext/stock/doctype/material_request/material_request.py @@ -9,7 +9,6 @@ import frappe from frappe.utils import cstr, flt from frappe.model.utils import getlist -from frappe.model.code import get_obj from frappe import msgprint, _ from erpnext.controllers.buying_controller import BuyingController @@ -70,7 +69,7 @@ class MaterialRequest(BuyingController): self.validate_value("material_request_type", "in", ["Purchase", "Transfer"]) - pc_obj = get_obj(dt='Purchase Common') + pc_obj = frappe.get_doc(dt='Purchase Common') pc_obj.validate_for_items(self) # self.validate_qty_against_so() @@ -126,7 +125,7 @@ class MaterialRequest(BuyingController): def on_cancel(self): # Step 1:=> Get Purchase Common Obj - pc_obj = get_obj(dt='Purchase Common') + pc_obj = frappe.get_doc(dt='Purchase Common') # Step 2:=> Check for stopped status pc_obj.check_for_stopped_status(self.doctype, self.name) @@ -176,7 +175,7 @@ def update_completed_qty(bean, method): material_request_map.setdefault(d.material_request, []).append(d.material_request_item) for mr_name, mr_items in material_request_map.items(): - mr_obj = frappe.get_obj("Material Request", mr_name, with_children=1) + mr_obj = frappe.get_doc("Material Request", mr_name) mr_doctype = frappe.get_meta("Material Request") if mr_obj.status in ["Stopped", "Cancelled"]: diff --git a/erpnext/stock/doctype/material_request/test_material_request.py b/erpnext/stock/doctype/material_request/test_material_request.py index 66c4dd2c0a..ecdc9c0efd 100644 --- a/erpnext/stock/doctype/material_request/test_material_request.py +++ b/erpnext/stock/doctype/material_request/test_material_request.py @@ -15,7 +15,7 @@ class TestMaterialRequest(unittest.TestCase): def test_make_purchase_order(self): from erpnext.stock.doctype.material_request.material_request import make_purchase_order - mr = frappe.get_doc(copy=test_records[0]).insert() + mr = frappe.copy_doc(test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_purchase_order, mr.name) @@ -30,7 +30,7 @@ class TestMaterialRequest(unittest.TestCase): def test_make_supplier_quotation(self): from erpnext.stock.doctype.material_request.material_request import make_supplier_quotation - mr = frappe.get_doc(copy=test_records[0]).insert() + mr = frappe.copy_doc(test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_supplier_quotation, mr.name) @@ -46,7 +46,7 @@ class TestMaterialRequest(unittest.TestCase): def test_make_stock_entry(self): from erpnext.stock.doctype.material_request.material_request import make_stock_entry - mr = frappe.get_doc(copy=test_records[0]).insert() + mr = frappe.copy_doc(test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_stock_entry, mr.name) @@ -112,7 +112,7 @@ class TestMaterialRequest(unittest.TestCase): frappe.db.sql("""delete from `tabBin`""") # submit material request of type Purchase - mr = frappe.get_doc(copy=test_records[0]) + mr = frappe.copy_doc(test_records[0]) mr.insert() mr.submit() @@ -133,14 +133,14 @@ class TestMaterialRequest(unittest.TestCase): # check for stopped status of Material Request - po = frappe.get_doc(copy=po_doclist) + po = frappe.copy_doc(po_doclist) po.insert() mr.obj.update_status('Stopped') self.assertRaises(frappe.ValidationError, po.submit) self.assertRaises(frappe.ValidationError, po.cancel) mr.obj.update_status('Submitted') - po = frappe.get_doc(copy=po_doclist) + po = frappe.copy_doc(po_doclist) po.insert() po.submit() @@ -160,7 +160,7 @@ class TestMaterialRequest(unittest.TestCase): frappe.db.sql("""delete from `tabStock Ledger Entry`""") # submit material request of type Purchase - mr = frappe.get_doc(copy=test_records[0]) + mr = frappe.copy_doc(test_records[0]) mr.material_request_type = "Transfer" mr.insert() mr.submit() @@ -196,14 +196,14 @@ class TestMaterialRequest(unittest.TestCase): self._insert_stock_entry(27.0, 1.5) # check for stopped status of Material Request - se = frappe.get_doc(copy=se_doclist) + se = frappe.copy_doc(se_doclist) se.insert() mr.obj.update_status('Stopped') self.assertRaises(frappe.ValidationError, se.submit) self.assertRaises(frappe.ValidationError, se.cancel) mr.obj.update_status('Submitted') - se = frappe.get_doc(copy=se_doclist) + se = frappe.copy_doc(se_doclist) se.insert() se.submit() @@ -223,7 +223,7 @@ class TestMaterialRequest(unittest.TestCase): frappe.db.sql("""delete from `tabStock Ledger Entry`""") # submit material request of type Purchase - mr = frappe.get_doc(copy=test_records[0]) + mr = frappe.copy_doc(test_records[0]) mr.material_request_type = "Transfer" mr.insert() mr.submit() @@ -259,14 +259,14 @@ class TestMaterialRequest(unittest.TestCase): self._insert_stock_entry(60.0, 3.0) # check for stopped status of Material Request - se = frappe.get_doc(copy=se_doclist) + se = frappe.copy_doc(se_doclist) se.insert() mr.obj.update_status('Stopped') self.assertRaises(frappe.ValidationError, se.submit) self.assertRaises(frappe.ValidationError, se.cancel) mr.obj.update_status('Submitted') - se = frappe.get_doc(copy=se_doclist) + se = frappe.copy_doc(se_doclist) se.insert() se.submit() @@ -283,7 +283,7 @@ class TestMaterialRequest(unittest.TestCase): def test_incorrect_mapping_of_stock_entry(self): # submit material request of type Purchase - mr = frappe.get_doc(copy=test_records[0]) + mr = frappe.copy_doc(test_records[0]) mr.material_request_type = "Transfer" mr.insert() mr.submit() @@ -312,47 +312,14 @@ class TestMaterialRequest(unittest.TestCase): }) # check for stopped status of Material Request - se = frappe.get_doc(copy=se_doclist) + se = frappe.copy_doc(se_doclist) self.assertRaises(frappe.MappingMismatchError, se.insert) def test_warehouse_company_validation(self): from erpnext.stock.utils import InvalidWarehouseCompany - mr = frappe.get_doc(copy=test_records[0]) + mr = frappe.copy_doc(test_records[0]) mr.company = "_Test Company 1" self.assertRaises(InvalidWarehouseCompany, mr.insert) test_dependencies = ["Currency Exchange"] -test_records = [ - [ - { - "company": "_Test Company", - "doctype": "Material Request", - "fiscal_year": "_Test Fiscal Year 2013", - "transaction_date": "2013-02-18", - "material_request_type": "Purchase", - "naming_series": "_T-Material Request-" - }, - { - "description": "_Test Item Home Desktop 100", - "doctype": "Material Request Item", - "item_code": "_Test Item Home Desktop 100", - "item_name": "_Test Item Home Desktop 100", - "parentfield": "indent_details", - "qty": 54.0, - "schedule_date": "2013-02-18", - "uom": "_Test UOM 1", - "warehouse": "_Test Warehouse - _TC" - }, - { - "description": "_Test Item Home Desktop 200", - "doctype": "Material Request Item", - "item_code": "_Test Item Home Desktop 200", - "item_name": "_Test Item Home Desktop 200", - "parentfield": "indent_details", - "qty": 3.0, - "schedule_date": "2013-02-19", - "uom": "_Test UOM 1", - "warehouse": "_Test Warehouse - _TC" - } - ], -] \ No newline at end of file +test_records = frappe.get_test_records('Material Request') \ No newline at end of file diff --git a/erpnext/stock/doctype/material_request_item/material_request_item.txt b/erpnext/stock/doctype/material_request_item/material_request_item.json similarity index 100% rename from erpnext/stock/doctype/material_request_item/material_request_item.txt rename to erpnext/stock/doctype/material_request_item/material_request_item.json diff --git a/erpnext/stock/doctype/packed_item/packed_item.txt b/erpnext/stock/doctype/packed_item/packed_item.json similarity index 100% rename from erpnext/stock/doctype/packed_item/packed_item.txt rename to erpnext/stock/doctype/packed_item/packed_item.json diff --git a/erpnext/stock/doctype/packing_slip/packing_slip.txt b/erpnext/stock/doctype/packing_slip/packing_slip.json similarity index 100% rename from erpnext/stock/doctype/packing_slip/packing_slip.txt rename to erpnext/stock/doctype/packing_slip/packing_slip.json diff --git a/erpnext/stock/doctype/packing_slip_item/packing_slip_item.txt b/erpnext/stock/doctype/packing_slip_item/packing_slip_item.json similarity index 100% rename from erpnext/stock/doctype/packing_slip_item/packing_slip_item.txt rename to erpnext/stock/doctype/packing_slip_item/packing_slip_item.json diff --git a/erpnext/stock/doctype/price_list/price_list.txt b/erpnext/stock/doctype/price_list/price_list.json similarity index 100% rename from erpnext/stock/doctype/price_list/price_list.txt rename to erpnext/stock/doctype/price_list/price_list.json diff --git a/erpnext/stock/doctype/price_list/test_price_list.py b/erpnext/stock/doctype/price_list/test_price_list.py index 8ec53cbfc7..ca7f47d579 100644 --- a/erpnext/stock/doctype/price_list/test_price_list.py +++ b/erpnext/stock/doctype/price_list/test_price_list.py @@ -6,70 +6,4 @@ import frappe # test_ignore = ["Item"] -test_records = [ - [ - { - "doctype": "Price List", - "price_list_name": "_Test Price List", - "enabled": 1, - "currency": "INR", - "selling": 1, - "buying": 1 - }, - { - "doctype": "Applicable Territory", - "parentfield": "valid_for_territories", - "territory": "All Territories" - }, - ], - [ - { - "doctype": "Price List", - "price_list_name": "_Test Price List 2", - "enabled": 1, - "currency": "INR", - "selling": 1, - "buying": 1 - }, - { - "doctype": "Applicable Territory", - "parentfield": "valid_for_territories", - "territory": "_Test Territory Rest Of The World" - } - ], - [ - { - "doctype": "Price List", - "price_list_name": "_Test Price List India", - "enabled": 1, - "currency": "INR", - "selling": 1, - "buying": 1 - }, - { - "doctype": "Applicable Territory", - "parentfield": "valid_for_territories", - "territory": "_Test Territory India" - } - ], - [ - { - "doctype": "Price List", - "price_list_name": "_Test Price List Rest of the World", - "enabled": 1, - "currency": "USD", - "selling": 1, - "buying": 1 - }, - { - "doctype": "Applicable Territory", - "parentfield": "valid_for_territories", - "territory": "_Test Territory Rest Of The World" - }, - { - "doctype": "Applicable Territory", - "parentfield": "valid_for_territories", - "territory": "_Test Territory United States" - } - ], -] \ No newline at end of file +test_records = frappe.get_test_records('Price List') \ No newline at end of file diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.txt b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.json similarity index 100% rename from erpnext/stock/doctype/purchase_receipt/purchase_receipt.txt rename to erpnext/stock/doctype/purchase_receipt/purchase_receipt.json diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py index a00a07a141..950db93a56 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py @@ -6,7 +6,6 @@ import frappe from frappe.utils import cstr, flt, cint -from frappe.model.code import get_obj from frappe import msgprint, _ import frappe.defaults from erpnext.stock.utils import update_bin @@ -54,7 +53,7 @@ class PurchaseReceipt(BuyingController): self.validate_uom_is_integer("stock_uom", "stock_qty") self.validate_challan_no() - pc_obj = get_obj(dt='Purchase Common') + pc_obj = frappe.get_doc(dt='Purchase Common') pc_obj.validate_for_items(self) self.check_for_stopped_status(pc_obj) @@ -223,10 +222,10 @@ class PurchaseReceipt(BuyingController): # on submit def on_submit(self): - purchase_controller = frappe.get_obj("Purchase Common") + purchase_controller = frappe.get_doc("Purchase Common") # Check for Approving Authority - get_obj('Authorization Control').validate_approving_authority(self.doctype, self.company, self.grand_total) + frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype, self.company, self.grand_total) # Set status as Submitted frappe.db.set(self, 'status', 'Submitted') @@ -255,7 +254,7 @@ class PurchaseReceipt(BuyingController): def on_cancel(self): - pc_obj = get_obj('Purchase Common') + pc_obj = frappe.get_doc('Purchase Common') self.check_for_stopped_status(pc_obj) # Check if Purchase Invoice has been submitted against current Purchase Order @@ -285,7 +284,7 @@ class PurchaseReceipt(BuyingController): d.current_stock = bin and flt(bin[0]['actual_qty']) or 0 def get_rate(self,arg): - return get_obj('Purchase Common').get_rate(arg,self) + return frappe.get_doc('Purchase Common').get_rate(arg,self) def get_gl_entries(self, warehouse_account=None): against_stock_account = self.get_company_default("stock_received_but_not_billed") diff --git a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py index 0b22425951..4c2b3a001c 100644 --- a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py @@ -14,7 +14,7 @@ class TestPurchaseReceipt(unittest.TestCase): set_perpetual_inventory(0) from erpnext.stock.doctype.purchase_receipt.purchase_receipt import make_purchase_invoice - pr = frappe.get_doc(copy=test_records[0]).insert() + pr = frappe.copy_doc(test_records[0]).insert() self.assertRaises(frappe.ValidationError, make_purchase_invoice, pr.name) @@ -33,7 +33,7 @@ class TestPurchaseReceipt(unittest.TestCase): def test_purchase_receipt_no_gl_entry(self): self._clear_stock_account_balance() set_perpetual_inventory(0) - pr = frappe.get_doc(copy=test_records[0]) + pr = frappe.copy_doc(test_records[0]) pr.insert() pr.submit() @@ -56,7 +56,7 @@ class TestPurchaseReceipt(unittest.TestCase): set_perpetual_inventory() self.assertEqual(cint(frappe.defaults.get_global_default("auto_accounting_for_stock")), 1) - pr = frappe.get_doc(copy=test_records[0]) + pr = frappe.copy_doc(test_records[0]) pr.insert() pr.submit() @@ -90,7 +90,7 @@ class TestPurchaseReceipt(unittest.TestCase): frappe.db.sql("""delete from `tabGL Entry`""") def test_subcontracting(self): - pr = frappe.get_doc(copy=test_records[1]) + pr = frappe.copy_doc(test_records[1]) pr.run_method("calculate_taxes_and_totals") pr.insert() @@ -98,7 +98,7 @@ class TestPurchaseReceipt(unittest.TestCase): self.assertEquals(len(pr.get("pr_raw_material_details")), 2) def test_serial_no_supplier(self): - pr = frappe.get_doc(copy=test_records[0]) + pr = frappe.copy_doc(test_records[0]) pr.doclist[1].item_code = "_Test Serialized Item With Series" pr.doclist[1].qty = 1 pr.doclist[1].received_qty = 1 @@ -130,119 +130,4 @@ def set_perpetual_inventory(enable=1): test_dependencies = ["BOM"] -test_records = [ - [ - { - "company": "_Test Company", - "conversion_rate": 1.0, - "currency": "INR", - "doctype": "Purchase Receipt", - "fiscal_year": "_Test Fiscal Year 2013", - "posting_date": "2013-02-12", - "posting_time": "15:33:30", - "supplier": "_Test Supplier", - "net_total": 500.0, - "grand_total": 720.0, - "naming_series": "_T-Purchase Receipt-", - "buying_price_list": "_Test Price List" - }, - { - "conversion_factor": 1.0, - "description": "_Test Item", - "doctype": "Purchase Receipt Item", - "item_code": "_Test Item", - "item_name": "_Test Item", - "parentfield": "purchase_receipt_details", - "received_qty": 5.0, - "qty": 5.0, - "rejected_qty": 0.0, - "rate": 50.0, - "base_amount": 250.0, - "warehouse": "_Test Warehouse - _TC", - "stock_uom": "Nos", - "uom": "_Test UOM", - }, - { - "conversion_factor": 1.0, - "description": "_Test Item", - "doctype": "Purchase Receipt Item", - "item_code": "_Test Item", - "item_name": "_Test Item", - "parentfield": "purchase_receipt_details", - "received_qty": 5.0, - "qty": 5.0, - "rejected_qty": 0.0, - "rate": 50.0, - "base_amount": 250.0, - "warehouse": "_Test Warehouse 1 - _TC", - "stock_uom": "Nos", - "uom": "_Test UOM", - }, - { - "account_head": "_Test Account Shipping Charges - _TC", - "add_deduct_tax": "Add", - "category": "Valuation and Total", - "charge_type": "Actual", - "description": "Shipping Charges", - "doctype": "Purchase Taxes and Charges", - "parentfield": "other_charges", - "rate": 100.0, - "tax_amount": 100.0, - }, - { - "account_head": "_Test Account VAT - _TC", - "add_deduct_tax": "Add", - "category": "Total", - "charge_type": "Actual", - "description": "VAT", - "doctype": "Purchase Taxes and Charges", - "parentfield": "other_charges", - "rate": 120.0, - "tax_amount": 120.0, - }, - { - "account_head": "_Test Account Customs Duty - _TC", - "add_deduct_tax": "Add", - "category": "Valuation", - "charge_type": "Actual", - "description": "Customs Duty", - "doctype": "Purchase Taxes and Charges", - "parentfield": "other_charges", - "rate": 150.0, - "tax_amount": 150.0, - }, - ], - [ - { - "company": "_Test Company", - "conversion_rate": 1.0, - "currency": "INR", - "doctype": "Purchase Receipt", - "fiscal_year": "_Test Fiscal Year 2013", - "posting_date": "2013-02-12", - "posting_time": "15:33:30", - "is_subcontracted": "Yes", - "supplier_warehouse": "_Test Warehouse - _TC", - "supplier": "_Test Supplier", - "net_total": 5000.0, - "grand_total": 5000.0, - "buying_price_list": "_Test Price List" - }, - { - "conversion_factor": 1.0, - "description": "_Test FG Item", - "doctype": "Purchase Receipt Item", - "item_code": "_Test FG Item", - "item_name": "_Test FG Item", - "parentfield": "purchase_receipt_details", - "received_qty": 10.0, - "qty": 10.0, - "rejected_qty": 0.0, - "rate": 500.0, - "base_amount": 5000.0, - "warehouse": "_Test Warehouse - _TC", - "stock_uom": "Nos", - "uom": "_Test UOM", - } - ], -] \ No newline at end of file +test_records = frappe.get_test_records('Purchase Receipt') \ No newline at end of file diff --git a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json similarity index 100% rename from erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.txt rename to erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json diff --git a/erpnext/stock/doctype/serial_no/serial_no.txt b/erpnext/stock/doctype/serial_no/serial_no.json similarity index 100% rename from erpnext/stock/doctype/serial_no/serial_no.txt rename to erpnext/stock/doctype/serial_no/serial_no.json diff --git a/erpnext/stock/doctype/serial_no/test_serial_no.py b/erpnext/stock/doctype/serial_no/test_serial_no.py index dc9c155bd9..30368b6393 100644 --- a/erpnext/stock/doctype/serial_no/test_serial_no.py +++ b/erpnext/stock/doctype/serial_no/test_serial_no.py @@ -8,7 +8,7 @@ from __future__ import unicode_literals import frappe, unittest test_dependencies = ["Item"] -test_records = [] +test_records = frappe.get_test_records('Serial No') from erpnext.stock.doctype.serial_no.serial_no import * diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.txt b/erpnext/stock/doctype/stock_entry/stock_entry.json similarity index 100% rename from erpnext/stock/doctype/stock_entry/stock_entry.txt rename to erpnext/stock/doctype/stock_entry/stock_entry.json diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index a21c9fc81e..6191811a9c 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -7,7 +7,6 @@ import frappe.defaults from frappe.utils import cstr, cint, flt, comma_or, nowdate -from frappe.model.code import get_obj from frappe import msgprint, _ from erpnext.stock.utils import get_incoming_rate from erpnext.stock.stock_ledger import get_previous_sle @@ -30,7 +29,7 @@ class StockEntry(StockController): self.validate_posting_time() self.validate_purpose() pro_obj = self.production_order and \ - get_obj('Production Order', self.production_order) or None + frappe.get_doc('Production Order', self.production_order) or None self.validate_item() self.validate_uom_is_integer("uom", "qty") @@ -139,7 +138,7 @@ class StockEntry(StockController): def validate_production_order(self, pro_obj=None): if not pro_obj: if self.production_order: - pro_obj = get_obj('Production Order', self.production_order) + pro_obj = frappe.get_doc('Production Order', self.production_order) else: return @@ -432,7 +431,7 @@ class StockEntry(StockController): pro_obj = None if self.production_order: # common validations - pro_obj = get_obj('Production Order', self.production_order) + pro_obj = frappe.get_doc('Production Order', self.production_order) if pro_obj: self.validate_production_order(pro_obj) self.bom_no = pro_obj.bom_no diff --git a/erpnext/stock/doctype/stock_entry/test_stock_entry.py b/erpnext/stock/doctype/stock_entry/test_stock_entry.py index db816fd320..98e1b00811 100644 --- a/erpnext/stock/doctype/stock_entry/test_stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/test_stock_entry.py @@ -22,11 +22,11 @@ class TestStockEntry(unittest.TestCase): frappe.db.set_value("Stock Settings", None, "auto_indent", True) - st1 = frappe.get_doc(copy=test_records[0]) + st1 = frappe.copy_doc(test_records[0]) st1.insert() st1.submit() - st2 = frappe.get_doc(copy=test_records[1]) + st2 = frappe.copy_doc(test_records[1]) st2.insert() st2.submit() @@ -45,7 +45,7 @@ class TestStockEntry(unittest.TestCase): self._clear_stock_account_balance() set_perpetual_inventory() - mr = frappe.get_doc(copy=test_records[0]) + mr = frappe.copy_doc(test_records[0]) mr.insert() mr.submit() @@ -77,7 +77,7 @@ class TestStockEntry(unittest.TestCase): self._insert_material_receipt() - mi = frappe.get_doc(copy=test_records[1]) + mi = frappe.copy_doc(test_records[1]) mi.insert() mi.submit() @@ -113,7 +113,7 @@ class TestStockEntry(unittest.TestCase): self._insert_material_receipt() - mtn = frappe.get_doc(copy=test_records[2]) + mtn = frappe.copy_doc(test_records[2]) mtn.insert() mtn.submit() @@ -149,7 +149,7 @@ class TestStockEntry(unittest.TestCase): self._insert_material_receipt() - repack = frappe.get_doc(copy=test_records[3]) + repack = frappe.copy_doc(test_records[3]) repack.insert() repack.submit() @@ -170,7 +170,7 @@ class TestStockEntry(unittest.TestCase): self._insert_material_receipt() - repack = frappe.get_doc(copy=test_records[3]) + repack = frappe.copy_doc(test_records[3]) repack.doclist[2].incoming_rate = 6000 repack.insert() repack.submit() @@ -218,11 +218,11 @@ class TestStockEntry(unittest.TestCase): def _insert_material_receipt(self): self._clear_stock_account_balance() - se1 = frappe.get_doc(copy=test_records[0]) + se1 = frappe.copy_doc(test_records[0]) se1.insert() se1.submit() - se2 = frappe.get_doc(copy=test_records[0]) + se2 = frappe.copy_doc(test_records[0]) se2.doclist[1].item_code = "_Test Item Home Desktop 100" se2.insert() se2.submit() @@ -240,11 +240,11 @@ class TestStockEntry(unittest.TestCase): import test_records as sales_invoice_test_records # invalid sales invoice as update stock not checked - si = frappe.get_doc(copy=sales_invoice_test_records[1]) + si = frappe.copy_doc(sales_invoice_test_records[1]) si.insert() si.submit() - se = frappe.get_doc(copy=test_records[0]) + se = frappe.copy_doc(test_records[0]) se.purpose = "Sales Return" se.sales_invoice_no = si.name se.doclist[1].qty = returned_qty @@ -257,7 +257,7 @@ class TestStockEntry(unittest.TestCase): actual_qty_0 = self._get_actual_qty() # insert a pos invoice with update stock - si = frappe.get_doc(copy=sales_invoice_test_records[1]) + si = frappe.copy_doc(sales_invoice_test_records[1]) si.is_pos = si.update_stock = 1 si.doclist[1].warehouse = "_Test Warehouse - _TC" si.doclist[1].item_code = item_code @@ -271,7 +271,7 @@ class TestStockEntry(unittest.TestCase): self.assertEquals(actual_qty_0 - delivered_qty, actual_qty_1) # check if item is validated - se = frappe.get_doc(copy=test_records[0]) + se = frappe.copy_doc(test_records[0]) se.purpose = "Sales Return" se.sales_invoice_no = si.name se.posting_date = "2013-03-10" @@ -284,7 +284,7 @@ class TestStockEntry(unittest.TestCase): self.assertRaises(frappe.DoesNotExistError, se.insert) # try again - se = frappe.get_doc(copy=test_records[0]) + se = frappe.copy_doc(test_records[0]) se.purpose = "Sales Return" se.posting_date = "2013-03-10" se.fiscal_year = "_Test Fiscal Year 2013" @@ -321,7 +321,7 @@ class TestStockEntry(unittest.TestCase): actual_qty_0 = self._get_actual_qty() # make a delivery note based on this invoice - dn = frappe.get_doc(copy=delivery_note_test_records[0]) + dn = frappe.copy_doc(delivery_note_test_records[0]) dn.doclist[1].item_code = item_code dn.insert() dn.submit() @@ -342,7 +342,7 @@ class TestStockEntry(unittest.TestCase): si.submit() # insert and submit stock entry for sales return - se = frappe.get_doc(copy=test_records[0]) + se = frappe.copy_doc(test_records[0]) se.purpose = "Sales Return" se.delivery_note_no = dn.name se.posting_date = "2013-03-10" @@ -410,7 +410,7 @@ class TestStockEntry(unittest.TestCase): actual_qty_0 = self._get_actual_qty() - so = frappe.get_doc(copy=sales_order_test_records[0]) + so = frappe.copy_doc(sales_order_test_records[0]) so.doclist[1].item_code = item_code so.doclist[1].qty = 5.0 so.insert() @@ -440,7 +440,7 @@ class TestStockEntry(unittest.TestCase): si.submit() # insert and submit stock entry for sales return - se = frappe.get_doc(copy=test_records[0]) + se = frappe.copy_doc(test_records[0]) se.purpose = "Sales Return" se.delivery_note_no = dn.name se.posting_date = "2013-03-10" @@ -466,7 +466,7 @@ class TestStockEntry(unittest.TestCase): from erpnext.stock.doctype.purchase_receipt.purchase_receipt import make_purchase_invoice # submit purchase receipt - pr = frappe.get_doc(copy=purchase_receipt_test_records[0]) + pr = frappe.copy_doc(purchase_receipt_test_records[0]) pr.insert() pr.submit() @@ -492,7 +492,7 @@ class TestStockEntry(unittest.TestCase): pi.submit() # submit purchase return - se = frappe.get_doc(copy=test_records[0]) + se = frappe.copy_doc(test_records[0]) se.purpose = "Purchase Return" se.purchase_receipt_no = pr.name se.posting_date = "2013-03-01" @@ -518,7 +518,7 @@ class TestStockEntry(unittest.TestCase): prev_se, pr_docname = self.test_purchase_receipt_return() # submit purchase return - return another 6 qtys so that exception is raised - se = frappe.get_doc(copy=test_records[0]) + se = frappe.copy_doc(test_records[0]) se.purpose = "Purchase Return" se.purchase_receipt_no = pr_docname se.posting_date = "2013-03-01" @@ -559,7 +559,7 @@ class TestStockEntry(unittest.TestCase): make_purchase_receipt, make_purchase_invoice # submit purchase receipt - po = frappe.get_doc(copy=purchase_order_test_records[0]) + po = frappe.copy_doc(purchase_order_test_records[0]) po.is_subcontracted = None po.doclist[1].item_code = "_Test Item" po.doclist[1].rate = 50 @@ -594,7 +594,7 @@ class TestStockEntry(unittest.TestCase): pi.submit() # submit purchase return - se = frappe.get_doc(copy=test_records[0]) + se = frappe.copy_doc(test_records[0]) se.purpose = "Purchase Return" se.purchase_receipt_no = pr.name se.posting_date = "2013-03-01" @@ -621,13 +621,13 @@ class TestStockEntry(unittest.TestCase): frappe.db.set_default("company", "_Test Company") def test_serial_no_not_reqd(self): - se = frappe.get_doc(copy=test_records[0]) + se = frappe.copy_doc(test_records[0]) se.doclist[1].serial_no = "ABCD" se.insert() self.assertRaises(SerialNoNotRequiredError, se.submit) def test_serial_no_reqd(self): - se = frappe.get_doc(copy=test_records[0]) + se = frappe.copy_doc(test_records[0]) se.doclist[1].item_code = "_Test Serialized Item" se.doclist[1].qty = 2 se.doclist[1].transfer_qty = 2 @@ -635,7 +635,7 @@ class TestStockEntry(unittest.TestCase): self.assertRaises(SerialNoRequiredError, se.submit) def test_serial_no_qty_more(self): - se = frappe.get_doc(copy=test_records[0]) + se = frappe.copy_doc(test_records[0]) se.doclist[1].item_code = "_Test Serialized Item" se.doclist[1].qty = 2 se.doclist[1].serial_no = "ABCD\nEFGH\nXYZ" @@ -644,7 +644,7 @@ class TestStockEntry(unittest.TestCase): self.assertRaises(SerialNoQtyError, se.submit) def test_serial_no_qty_less(self): - se = frappe.get_doc(copy=test_records[0]) + se = frappe.copy_doc(test_records[0]) se.doclist[1].item_code = "_Test Serialized Item" se.doclist[1].qty = 2 se.doclist[1].serial_no = "ABCD" @@ -654,7 +654,7 @@ class TestStockEntry(unittest.TestCase): def test_serial_no_transfer_in(self): self._clear_stock_account_balance() - se = frappe.get_doc(copy=test_records[0]) + se = frappe.copy_doc(test_records[0]) se.doclist[1].item_code = "_Test Serialized Item" se.doclist[1].qty = 2 se.doclist[1].serial_no = "ABCD\nEFGH" @@ -670,7 +670,7 @@ class TestStockEntry(unittest.TestCase): def test_serial_no_not_exists(self): self._clear_stock_account_balance() - se = frappe.get_doc(copy=test_records[0]) + se = frappe.copy_doc(test_records[0]) se.purpose = "Material Issue" se.doclist[1].item_code = "_Test Serialized Item" se.doclist[1].qty = 2 @@ -685,7 +685,7 @@ class TestStockEntry(unittest.TestCase): self._clear_stock_account_balance() self.test_serial_by_series() - se = frappe.get_doc(copy=test_records[0]) + se = frappe.copy_doc(test_records[0]) se.doclist[1].item_code = "_Test Serialized Item With Series" se.doclist[1].qty = 1 se.doclist[1].serial_no = "ABCD00001" @@ -708,7 +708,7 @@ class TestStockEntry(unittest.TestCase): self._clear_stock_account_balance() self.test_serial_by_series() - se = frappe.get_doc(copy=test_records[0]) + se = frappe.copy_doc(test_records[0]) se.purpose = "Material Transfer" se.doclist[1].item_code = "_Test Serialized Item" se.doclist[1].qty = 1 @@ -724,7 +724,7 @@ class TestStockEntry(unittest.TestCase): se = make_serialized_item() serial_no = get_serial_nos(se.doclist[1].serial_no)[0] - se = frappe.get_doc(copy=test_records[0]) + se = frappe.copy_doc(test_records[0]) se.purpose = "Material Transfer" se.doclist[1].item_code = "_Test Serialized Item With Series" se.doclist[1].qty = 1 @@ -743,7 +743,7 @@ class TestStockEntry(unittest.TestCase): self._clear_stock_account_balance() make_serialized_item() - se = frappe.get_doc(copy=test_records[0]) + se = frappe.copy_doc(test_records[0]) se.purpose = "Material Transfer" se.doclist[1].item_code = "_Test Serialized Item With Series" se.doclist[1].qty = 1 @@ -770,7 +770,7 @@ class TestStockEntry(unittest.TestCase): frappe.set_user("test2@example.com") from erpnext.stock.utils import InvalidWarehouseCompany - st1 = frappe.get_doc(copy=test_records[0]) + st1 = frappe.copy_doc(test_records[0]) st1.doclist[1].t_warehouse="_Test Warehouse 2 - _TC1" st1.insert() self.assertRaises(InvalidWarehouseCompany, st1.submit) @@ -789,13 +789,13 @@ class TestStockEntry(unittest.TestCase): .add_roles("Sales User", "Sales Manager", "Material User", "Material Manager") frappe.set_user("test@example.com") - st1 = frappe.get_doc(copy=test_records[0]) + st1 = frappe.copy_doc(test_records[0]) st1.company = "_Test Company 1" st1.doclist[1].t_warehouse="_Test Warehouse 2 - _TC1" self.assertRaises(BeanPermissionError, st1.insert) frappe.set_user("test2@example.com") - st1 = frappe.get_doc(copy=test_records[0]) + st1 = frappe.copy_doc(test_records[0]) st1.company = "_Test Company 1" st1.doclist[1].t_warehouse="_Test Warehouse 2 - _TC1" st1.insert() @@ -811,18 +811,18 @@ class TestStockEntry(unittest.TestCase): # test freeze_stocks_upto date_newer_than_test_records = add_days(getdate(test_records[0][0]['posting_date']), 5) frappe.db.set_value("Stock Settings", None, "stock_frozen_upto", date_newer_than_test_records) - se = frappe.get_doc(copy=test_records[0]).insert() + se = frappe.copy_doc(test_records[0]).insert() self.assertRaises (StockFreezeError, se.submit) frappe.db.set_value("Stock Settings", None, "stock_frozen_upto", '') # test freeze_stocks_upto_days frappe.db.set_value("Stock Settings", None, "stock_frozen_upto_days", 7) - se = frappe.get_doc(copy=test_records[0]).insert() + se = frappe.copy_doc(test_records[0]).insert() self.assertRaises (StockFreezeError, se.submit) frappe.db.set_value("Stock Settings", None, "stock_frozen_upto_days", 0) def make_serialized_item(): - se = frappe.get_doc(copy=test_records[0]) + se = frappe.copy_doc(test_records[0]) se.doclist[1].item_code = "_Test Serialized Item With Series" se.doclist[1].qty = 2 se.doclist[1].transfer_qty = 2 @@ -830,116 +830,4 @@ def make_serialized_item(): se.submit() return se -test_records = [ - [ - { - "company": "_Test Company", - "doctype": "Stock Entry", - "posting_date": "2013-01-01", - "posting_time": "17:14:24", - "purpose": "Material Receipt", - "fiscal_year": "_Test Fiscal Year 2013", - }, - { - "conversion_factor": 1.0, - "doctype": "Stock Entry Detail", - "item_code": "_Test Item", - "parentfield": "mtn_details", - "incoming_rate": 100, - "qty": 50.0, - "stock_uom": "_Test UOM", - "transfer_qty": 50.0, - "uom": "_Test UOM", - "t_warehouse": "_Test Warehouse - _TC", - "expense_account": "Stock Adjustment - _TC", - "cost_center": "_Test Cost Center - _TC" - }, - ], - [ - { - "company": "_Test Company", - "doctype": "Stock Entry", - "posting_date": "2013-01-25", - "posting_time": "17:15", - "purpose": "Material Issue", - "fiscal_year": "_Test Fiscal Year 2013", - }, - { - "conversion_factor": 1.0, - "doctype": "Stock Entry Detail", - "item_code": "_Test Item", - "parentfield": "mtn_details", - "incoming_rate": 100, - "qty": 40.0, - "stock_uom": "_Test UOM", - "transfer_qty": 40.0, - "uom": "_Test UOM", - "s_warehouse": "_Test Warehouse - _TC", - "expense_account": "Stock Adjustment - _TC", - "cost_center": "_Test Cost Center - _TC" - }, - ], - [ - { - "company": "_Test Company", - "doctype": "Stock Entry", - "posting_date": "2013-01-25", - "posting_time": "17:14:24", - "purpose": "Material Transfer", - "fiscal_year": "_Test Fiscal Year 2013", - }, - { - "conversion_factor": 1.0, - "doctype": "Stock Entry Detail", - "item_code": "_Test Item", - "parentfield": "mtn_details", - "incoming_rate": 100, - "qty": 45.0, - "stock_uom": "_Test UOM", - "transfer_qty": 45.0, - "uom": "_Test UOM", - "s_warehouse": "_Test Warehouse - _TC", - "t_warehouse": "_Test Warehouse 1 - _TC", - "expense_account": "Stock Adjustment - _TC", - "cost_center": "_Test Cost Center - _TC" - } - ], - [ - { - "company": "_Test Company", - "doctype": "Stock Entry", - "posting_date": "2013-01-25", - "posting_time": "17:14:24", - "purpose": "Manufacture/Repack", - "fiscal_year": "_Test Fiscal Year 2013", - }, - { - "conversion_factor": 1.0, - "doctype": "Stock Entry Detail", - "item_code": "_Test Item", - "parentfield": "mtn_details", - "incoming_rate": 100, - "qty": 50.0, - "stock_uom": "_Test UOM", - "transfer_qty": 50.0, - "uom": "_Test UOM", - "s_warehouse": "_Test Warehouse - _TC", - "expense_account": "Stock Adjustment - _TC", - "cost_center": "_Test Cost Center - _TC" - }, - { - "conversion_factor": 1.0, - "doctype": "Stock Entry Detail", - "item_code": "_Test Item Home Desktop 100", - "parentfield": "mtn_details", - "incoming_rate": 5000, - "qty": 1, - "stock_uom": "_Test UOM", - "transfer_qty": 1, - "uom": "_Test UOM", - "t_warehouse": "_Test Warehouse - _TC", - "expense_account": "Stock Adjustment - _TC", - "cost_center": "_Test Cost Center - _TC" - }, - ], -] +test_records = frappe.get_test_records('Stock Entry') \ No newline at end of file diff --git a/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.txt b/erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json similarity index 100% rename from erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.txt rename to erpnext/stock/doctype/stock_entry_detail/stock_entry_detail.json diff --git a/erpnext/stock/doctype/stock_ledger/stock_ledger.py b/erpnext/stock/doctype/stock_ledger/stock_ledger.py index e55e51232d..a20da19123 100644 --- a/erpnext/stock/doctype/stock_ledger/stock_ledger.py +++ b/erpnext/stock/doctype/stock_ledger/stock_ledger.py @@ -6,7 +6,6 @@ import frappe from frappe.utils import add_days, cstr, flt, nowdate, cint, now -from frappe.model.code import get_obj from frappe import session, msgprint from erpnext.stock.utils import get_valid_serial_nos @@ -37,7 +36,7 @@ class StockLedger(Document): "is_amended": is_amended }) - get_obj('Warehouse', v["warehouse"]).update_bin(args) + frappe.get_doc('Warehouse', v["warehouse"]).update_bin(args) def make_entry(self, args): @@ -52,4 +51,4 @@ class StockLedger(Document): Repost everything! """ for wh in frappe.db.sql("select name from tabWarehouse"): - get_obj('Warehouse', wh[0]).repost_stock() + frappe.get_doc('Warehouse', wh[0]).repost_stock() diff --git a/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.txt b/erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.json similarity index 100% rename from erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.txt rename to erpnext/stock/doctype/stock_ledger_entry/stock_ledger_entry.json diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.txt b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.json similarity index 100% rename from erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.txt rename to erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.json diff --git a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py index 0438d6e7ae..2f88c5674a 100644 --- a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py @@ -221,11 +221,11 @@ class TestStockReconciliation(unittest.TestCase): }, ] - pr = frappe.get_doc(copy=stock_entry) + pr = frappe.copy_doc(stock_entry) pr.insert() pr.submit() - pr1 = frappe.get_doc(copy=stock_entry) + pr1 = frappe.copy_doc(stock_entry) pr1.posting_date = "2012-12-15" pr1.posting_time = "02:00" pr1.doclist[1].qty = 10 @@ -234,7 +234,7 @@ class TestStockReconciliation(unittest.TestCase): pr1.insert() pr1.submit() - pr2 = frappe.get_doc(copy=stock_entry) + pr2 = frappe.copy_doc(stock_entry) pr2.posting_date = "2012-12-25" pr2.posting_time = "03:00" pr2.purpose = "Material Issue" @@ -246,7 +246,7 @@ class TestStockReconciliation(unittest.TestCase): pr2.insert() pr2.submit() - pr3 = frappe.get_doc(copy=stock_entry) + pr3 = frappe.copy_doc(stock_entry) pr3.posting_date = "2012-12-31" pr3.posting_time = "08:00" pr3.purpose = "Material Issue" @@ -259,7 +259,7 @@ class TestStockReconciliation(unittest.TestCase): pr3.submit() - pr4 = frappe.get_doc(copy=stock_entry) + pr4 = frappe.copy_doc(stock_entry) pr4.posting_date = "2013-01-05" pr4.fiscal_year = "_Test Fiscal Year 2013" pr4.posting_time = "07:00" diff --git a/erpnext/stock/doctype/stock_settings/stock_settings.txt b/erpnext/stock/doctype/stock_settings/stock_settings.json similarity index 100% rename from erpnext/stock/doctype/stock_settings/stock_settings.txt rename to erpnext/stock/doctype/stock_settings/stock_settings.json diff --git a/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.txt b/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.json similarity index 100% rename from erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.txt rename to erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.json diff --git a/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.txt b/erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.json similarity index 100% rename from erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.txt rename to erpnext/stock/doctype/uom_conversion_detail/uom_conversion_detail.json diff --git a/erpnext/stock/doctype/warehouse/test_warehouse.py b/erpnext/stock/doctype/warehouse/test_warehouse.py index b0e7641a28..dea61f8ee0 100644 --- a/erpnext/stock/doctype/warehouse/test_warehouse.py +++ b/erpnext/stock/doctype/warehouse/test_warehouse.py @@ -1,28 +1,6 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [ - [{ - "doctype": "Warehouse", - "warehouse_name": "_Test Warehouse", - "company": "_Test Company", - "create_account_under": "Stock Assets - _TC" - }], - [{ - "doctype": "Warehouse", - "warehouse_name": "_Test Warehouse 1", - "company": "_Test Company", - "create_account_under": "Fixed Assets - _TC" - }], - [{ - "doctype": "Warehouse", - "warehouse_name": "_Test Warehouse 2", - "create_account_under": "Stock Assets - _TC", - "company": "_Test Company 1" - }], - [{ - "doctype": "Warehouse", - "warehouse_name": "_Test Warehouse No Account", - "company": "_Test Company", - }], -] + +import frappe +test_records = frappe.get_test_records('Warehouse') \ No newline at end of file diff --git a/erpnext/stock/doctype/warehouse/warehouse.txt b/erpnext/stock/doctype/warehouse/warehouse.json similarity index 100% rename from erpnext/stock/doctype/warehouse/warehouse.txt rename to erpnext/stock/doctype/warehouse/warehouse.json diff --git a/erpnext/stock/doctype/warehouse_user/warehouse_user.txt b/erpnext/stock/doctype/warehouse_user/warehouse_user.json similarity index 100% rename from erpnext/stock/doctype/warehouse_user/warehouse_user.txt rename to erpnext/stock/doctype/warehouse_user/warehouse_user.json diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index f4588f582c..57b2c2eda5 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -5,7 +5,6 @@ from __future__ import unicode_literals import frappe from frappe import _, throw from frappe.utils import flt, cint, add_days -from frappe.model.meta import has_field import json @frappe.whitelist() @@ -36,7 +35,7 @@ def get_item_details(args): args = frappe._dict(args) if not args.get("transaction_type"): - args.transaction_type = "buying" if has_field(args.get("doctype"), "supplier") \ + args.transaction_type = "buying" if frappe.get_meta(args.get("doctype")).get_field("supplier") \ else "selling" if not args.get("price_list"): diff --git a/erpnext/stock/page/stock_ageing/stock_ageing.txt b/erpnext/stock/page/stock_ageing/stock_ageing.json similarity index 100% rename from erpnext/stock/page/stock_ageing/stock_ageing.txt rename to erpnext/stock/page/stock_ageing/stock_ageing.json diff --git a/erpnext/stock/page/stock_analytics/stock_analytics.txt b/erpnext/stock/page/stock_analytics/stock_analytics.json similarity index 100% rename from erpnext/stock/page/stock_analytics/stock_analytics.txt rename to erpnext/stock/page/stock_analytics/stock_analytics.json diff --git a/erpnext/stock/page/stock_balance/stock_balance.txt b/erpnext/stock/page/stock_balance/stock_balance.json similarity index 100% rename from erpnext/stock/page/stock_balance/stock_balance.txt rename to erpnext/stock/page/stock_balance/stock_balance.json diff --git a/erpnext/stock/page/stock_ledger/stock_ledger.txt b/erpnext/stock/page/stock_ledger/stock_ledger.json similarity index 100% rename from erpnext/stock/page/stock_ledger/stock_ledger.txt rename to erpnext/stock/page/stock_ledger/stock_ledger.json diff --git a/erpnext/stock/page/stock_level/stock_level.txt b/erpnext/stock/page/stock_level/stock_level.json similarity index 100% rename from erpnext/stock/page/stock_level/stock_level.txt rename to erpnext/stock/page/stock_level/stock_level.json diff --git a/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.txt b/erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.json similarity index 100% rename from erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.txt rename to erpnext/stock/report/batch_wise_balance_history/batch_wise_balance_history.json diff --git a/erpnext/stock/report/delivery_note_trends/delivery_note_trends.txt b/erpnext/stock/report/delivery_note_trends/delivery_note_trends.json similarity index 100% rename from erpnext/stock/report/delivery_note_trends/delivery_note_trends.txt rename to erpnext/stock/report/delivery_note_trends/delivery_note_trends.json diff --git a/erpnext/stock/report/item_prices/item_prices.txt b/erpnext/stock/report/item_prices/item_prices.json similarity index 100% rename from erpnext/stock/report/item_prices/item_prices.txt rename to erpnext/stock/report/item_prices/item_prices.json diff --git a/erpnext/stock/report/item_shortage_report/item_shortage_report.txt b/erpnext/stock/report/item_shortage_report/item_shortage_report.json similarity index 100% rename from erpnext/stock/report/item_shortage_report/item_shortage_report.txt rename to erpnext/stock/report/item_shortage_report/item_shortage_report.json diff --git a/erpnext/stock/report/item_wise_price_list_rate/item_wise_price_list_rate.txt b/erpnext/stock/report/item_wise_price_list_rate/item_wise_price_list_rate.json similarity index 100% rename from erpnext/stock/report/item_wise_price_list_rate/item_wise_price_list_rate.txt rename to erpnext/stock/report/item_wise_price_list_rate/item_wise_price_list_rate.json diff --git a/erpnext/stock/report/items_to_be_requested/items_to_be_requested.txt b/erpnext/stock/report/items_to_be_requested/items_to_be_requested.json similarity index 100% rename from erpnext/stock/report/items_to_be_requested/items_to_be_requested.txt rename to erpnext/stock/report/items_to_be_requested/items_to_be_requested.json diff --git a/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.txt b/erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.json similarity index 100% rename from erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.txt rename to erpnext/stock/report/itemwise_recommended_reorder_level/itemwise_recommended_reorder_level.json diff --git a/erpnext/stock/report/material_requests_for_which_supplier_quotations_are_not_created/material_requests_for_which_supplier_quotations_are_not_created.txt b/erpnext/stock/report/material_requests_for_which_supplier_quotations_are_not_created/material_requests_for_which_supplier_quotations_are_not_created.json similarity index 100% rename from erpnext/stock/report/material_requests_for_which_supplier_quotations_are_not_created/material_requests_for_which_supplier_quotations_are_not_created.txt rename to erpnext/stock/report/material_requests_for_which_supplier_quotations_are_not_created/material_requests_for_which_supplier_quotations_are_not_created.json diff --git a/erpnext/stock/report/ordered_items_to_be_delivered/ordered_items_to_be_delivered.txt b/erpnext/stock/report/ordered_items_to_be_delivered/ordered_items_to_be_delivered.json similarity index 100% rename from erpnext/stock/report/ordered_items_to_be_delivered/ordered_items_to_be_delivered.txt rename to erpnext/stock/report/ordered_items_to_be_delivered/ordered_items_to_be_delivered.json diff --git a/erpnext/stock/report/purchase_in_transit/purchase_in_transit.txt b/erpnext/stock/report/purchase_in_transit/purchase_in_transit.json similarity index 100% rename from erpnext/stock/report/purchase_in_transit/purchase_in_transit.txt rename to erpnext/stock/report/purchase_in_transit/purchase_in_transit.json diff --git a/erpnext/stock/report/purchase_order_items_to_be_received/purchase_order_items_to_be_received.txt b/erpnext/stock/report/purchase_order_items_to_be_received/purchase_order_items_to_be_received.json similarity index 100% rename from erpnext/stock/report/purchase_order_items_to_be_received/purchase_order_items_to_be_received.txt rename to erpnext/stock/report/purchase_order_items_to_be_received/purchase_order_items_to_be_received.json diff --git a/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.txt b/erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.json similarity index 100% rename from erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.txt rename to erpnext/stock/report/purchase_receipt_trends/purchase_receipt_trends.json diff --git a/erpnext/stock/report/requested_items_to_be_transferred/requested_items_to_be_transferred.txt b/erpnext/stock/report/requested_items_to_be_transferred/requested_items_to_be_transferred.json similarity index 100% rename from erpnext/stock/report/requested_items_to_be_transferred/requested_items_to_be_transferred.txt rename to erpnext/stock/report/requested_items_to_be_transferred/requested_items_to_be_transferred.json diff --git a/erpnext/stock/report/serial_no_service_contract_expiry/serial_no_service_contract_expiry.txt b/erpnext/stock/report/serial_no_service_contract_expiry/serial_no_service_contract_expiry.json similarity index 100% rename from erpnext/stock/report/serial_no_service_contract_expiry/serial_no_service_contract_expiry.txt rename to erpnext/stock/report/serial_no_service_contract_expiry/serial_no_service_contract_expiry.json diff --git a/erpnext/stock/report/serial_no_status/serial_no_status.txt b/erpnext/stock/report/serial_no_status/serial_no_status.json similarity index 100% rename from erpnext/stock/report/serial_no_status/serial_no_status.txt rename to erpnext/stock/report/serial_no_status/serial_no_status.json diff --git a/erpnext/stock/report/serial_no_warranty_expiry/serial_no_warranty_expiry.txt b/erpnext/stock/report/serial_no_warranty_expiry/serial_no_warranty_expiry.json similarity index 100% rename from erpnext/stock/report/serial_no_warranty_expiry/serial_no_warranty_expiry.txt rename to erpnext/stock/report/serial_no_warranty_expiry/serial_no_warranty_expiry.json diff --git a/erpnext/stock/report/stock_ageing/stock_ageing.txt b/erpnext/stock/report/stock_ageing/stock_ageing.json similarity index 100% rename from erpnext/stock/report/stock_ageing/stock_ageing.txt rename to erpnext/stock/report/stock_ageing/stock_ageing.json diff --git a/erpnext/stock/report/stock_ledger/stock_ledger.txt b/erpnext/stock/report/stock_ledger/stock_ledger.json similarity index 100% rename from erpnext/stock/report/stock_ledger/stock_ledger.txt rename to erpnext/stock/report/stock_ledger/stock_ledger.json diff --git a/erpnext/stock/report/stock_projected_qty/stock_projected_qty.txt b/erpnext/stock/report/stock_projected_qty/stock_projected_qty.json similarity index 100% rename from erpnext/stock/report/stock_projected_qty/stock_projected_qty.txt rename to erpnext/stock/report/stock_projected_qty/stock_projected_qty.json diff --git a/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.txt b/erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.json similarity index 100% rename from erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.txt rename to erpnext/stock/report/supplier_wise_sales_analytics/supplier_wise_sales_analytics.json diff --git a/erpnext/stock/report/warehouse_wise_stock_balance/warehouse_wise_stock_balance.txt b/erpnext/stock/report/warehouse_wise_stock_balance/warehouse_wise_stock_balance.json similarity index 100% rename from erpnext/stock/report/warehouse_wise_stock_balance/warehouse_wise_stock_balance.txt rename to erpnext/stock/report/warehouse_wise_stock_balance/warehouse_wise_stock_balance.json diff --git a/erpnext/stock/utils.py b/erpnext/stock/utils.py index 2f28e1a0c8..69d27ba277 100644 --- a/erpnext/stock/utils.py +++ b/erpnext/stock/utils.py @@ -49,8 +49,7 @@ def get_bin(item_code, warehouse): bin_wrapper.insert() bin_obj = bin_wrapper.make_controller() else: - from frappe.model.code import get_obj - bin_obj = get_obj('Bin', bin) + bin_obj = frappe.get_doc('Bin', bin) return bin_obj def update_bin(args): diff --git a/erpnext/support/doctype/customer_issue/customer_issue.txt b/erpnext/support/doctype/customer_issue/customer_issue.json similarity index 100% rename from erpnext/support/doctype/customer_issue/customer_issue.txt rename to erpnext/support/doctype/customer_issue/customer_issue.json diff --git a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.txt b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.json similarity index 100% rename from erpnext/support/doctype/maintenance_schedule/maintenance_schedule.txt rename to erpnext/support/doctype/maintenance_schedule/maintenance_schedule.json diff --git a/erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.txt b/erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.json similarity index 100% rename from erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.txt rename to erpnext/support/doctype/maintenance_schedule_detail/maintenance_schedule_detail.json diff --git a/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.txt b/erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.json similarity index 100% rename from erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.txt rename to erpnext/support/doctype/maintenance_schedule_item/maintenance_schedule_item.json diff --git a/erpnext/support/doctype/maintenance_visit/maintenance_visit.txt b/erpnext/support/doctype/maintenance_visit/maintenance_visit.json similarity index 100% rename from erpnext/support/doctype/maintenance_visit/maintenance_visit.txt rename to erpnext/support/doctype/maintenance_visit/maintenance_visit.json diff --git a/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.txt b/erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.json similarity index 100% rename from erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.txt rename to erpnext/support/doctype/maintenance_visit_purpose/maintenance_visit_purpose.json diff --git a/erpnext/support/doctype/newsletter/newsletter.txt b/erpnext/support/doctype/newsletter/newsletter.json similarity index 100% rename from erpnext/support/doctype/newsletter/newsletter.txt rename to erpnext/support/doctype/newsletter/newsletter.json diff --git a/erpnext/support/doctype/newsletter/newsletter.py b/erpnext/support/doctype/newsletter/newsletter.py index a2ac2de87b..8518a377ad 100644 --- a/erpnext/support/doctype/newsletter/newsletter.py +++ b/erpnext/support/doctype/newsletter/newsletter.py @@ -124,7 +124,7 @@ def get_lead_options(): def create_lead(email_id): """create a lead if it does not exist""" from email.utils import parseaddr - from frappe.model.doc import get_default_naming_series + from frappe.model.naming import get_default_naming_series real_name, email_id = parseaddr(email_id) if frappe.db.get_value("Lead", {"email_id": email_id}): diff --git a/erpnext/support/doctype/newsletter/test_newsletter.py b/erpnext/support/doctype/newsletter/test_newsletter.py index 01ed84eb98..3d89b9a136 100644 --- a/erpnext/support/doctype/newsletter/test_newsletter.py +++ b/erpnext/support/doctype/newsletter/test_newsletter.py @@ -39,29 +39,4 @@ class TestNewsletter(unittest.TestCase): test_dependencies = ["Lead", "Contact"] -test_records =[ - [{ - "doctype": "Newsletter", - "subject": "_Test Newsletter to Lead", - "send_to_type": "Lead", - "lead_source": "All", - "message": "This is a test newsletter", - "send_from": "admin@example.com" - }], - [{ - "doctype": "Newsletter", - "subject": "_Test Newsletter to Contact", - "send_to_type": "Contact", - "contact_type": "Customer", - "message": "This is a test newsletter", - "send_from": "admin@example.com" - }], - [{ - "doctype": "Newsletter", - "subject": "_Test Newsletter to Custom", - "send_to_type": "Custom", - "email_list": "test_custom@example.com, test_custom1@example.com, test_custom2@example.com", - "message": "This is a test newsletter", - "send_from": "admin@example.com" - }], -] +test_records = frappe.get_test_records('Newsletter') \ No newline at end of file diff --git a/erpnext/support/doctype/support_email_settings/support_email_settings.txt b/erpnext/support/doctype/support_email_settings/support_email_settings.json similarity index 100% rename from erpnext/support/doctype/support_email_settings/support_email_settings.txt rename to erpnext/support/doctype/support_email_settings/support_email_settings.json diff --git a/erpnext/support/doctype/support_ticket/support_ticket.txt b/erpnext/support/doctype/support_ticket/support_ticket.json similarity index 100% rename from erpnext/support/doctype/support_ticket/support_ticket.txt rename to erpnext/support/doctype/support_ticket/support_ticket.json diff --git a/erpnext/support/page/support_analytics/support_analytics.txt b/erpnext/support/page/support_analytics/support_analytics.json similarity index 100% rename from erpnext/support/page/support_analytics/support_analytics.txt rename to erpnext/support/page/support_analytics/support_analytics.json diff --git a/erpnext/support/report/maintenance_schedules/maintenance_schedules.txt b/erpnext/support/report/maintenance_schedules/maintenance_schedules.json similarity index 100% rename from erpnext/support/report/maintenance_schedules/maintenance_schedules.txt rename to erpnext/support/report/maintenance_schedules/maintenance_schedules.json diff --git a/erpnext/utilities/cleanup_data.py b/erpnext/utilities/cleanup_data.py index 328eed1296..30b16bcbf2 100644 --- a/erpnext/utilities/cleanup_data.py +++ b/erpnext/utilities/cleanup_data.py @@ -154,8 +154,7 @@ def reset_global_defaults(): 'default_price_list_currency': None, } - from frappe.model.code import get_obj - gd = get_obj('Global Defaults', 'Global Defaults') + gd = frappe.get_doc('Global Defaults', 'Global Defaults') for d in flds: gd.set(d, flds[d]) gd.save() diff --git a/erpnext/utilities/doctype/address/address.txt b/erpnext/utilities/doctype/address/address.json similarity index 100% rename from erpnext/utilities/doctype/address/address.txt rename to erpnext/utilities/doctype/address/address.json diff --git a/erpnext/utilities/doctype/address/test_address.py b/erpnext/utilities/doctype/address/test_address.py index befbe82b24..815449aaa7 100644 --- a/erpnext/utilities/doctype/address/test_address.py +++ b/erpnext/utilities/doctype/address/test_address.py @@ -1,17 +1,6 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [ - [{ - "doctype": "Address", - "customer": "_Test Customer", - "customer_name": "_Test Customer", - "address_type": "Office", - "address_title": "_Test Address", - "address_line1": "_Test Address Line 1", - "city": "_Test City", - "country": "India", - "phone": "+91 0000000000", - "is_primary_address": 1 - }], -] \ No newline at end of file + +import frappe +test_records = frappe.get_test_records('Address') \ No newline at end of file diff --git a/erpnext/utilities/doctype/contact/contact.txt b/erpnext/utilities/doctype/contact/contact.json similarity index 100% rename from erpnext/utilities/doctype/contact/contact.txt rename to erpnext/utilities/doctype/contact/contact.json diff --git a/erpnext/utilities/doctype/contact/test_contact.py b/erpnext/utilities/doctype/contact/test_contact.py index 5e7898f08a..129ec30052 100644 --- a/erpnext/utilities/doctype/contact/test_contact.py +++ b/erpnext/utilities/doctype/contact/test_contact.py @@ -1,25 +1,6 @@ # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt -test_records = [ - [{ - "doctype": "Contact", - "customer": "_Test Customer", - "customer_name": "_Test Customer", - "first_name": "_Test Contact For _Test Customer", - "email_id": "test_contact_customer@example.com", - "phone": "+91 0000000000", - "status": "Open", - "is_primary_contact": 1 - }], - [{ - "doctype": "Contact", - "supplier": "_Test Supplier", - "supplier_name": "_Test Supplier", - "first_name": "_Test Contact For _Test Supplier", - "email_id": "test_contact_supplier@example.com", - "phone": "+91 0000000000", - "status": "Open", - "is_primary_contact": 1 - }] -] \ No newline at end of file + +import frappe +test_records = frappe.get_test_records('Contact') \ No newline at end of file diff --git a/erpnext/utilities/doctype/note/note.txt b/erpnext/utilities/doctype/note/note.json similarity index 100% rename from erpnext/utilities/doctype/note/note.txt rename to erpnext/utilities/doctype/note/note.json diff --git a/erpnext/utilities/doctype/note_user/note_user.txt b/erpnext/utilities/doctype/note_user/note_user.json similarity index 100% rename from erpnext/utilities/doctype/note_user/note_user.txt rename to erpnext/utilities/doctype/note_user/note_user.json diff --git a/erpnext/utilities/doctype/rename_tool/rename_tool.txt b/erpnext/utilities/doctype/rename_tool/rename_tool.json similarity index 100% rename from erpnext/utilities/doctype/rename_tool/rename_tool.txt rename to erpnext/utilities/doctype/rename_tool/rename_tool.json diff --git a/erpnext/utilities/doctype/sms_control/sms_control.txt b/erpnext/utilities/doctype/sms_control/sms_control.json similarity index 100% rename from erpnext/utilities/doctype/sms_control/sms_control.txt rename to erpnext/utilities/doctype/sms_control/sms_control.json diff --git a/erpnext/utilities/doctype/sms_control/sms_control.py b/erpnext/utilities/doctype/sms_control/sms_control.py index d16e54d8cc..c0a46471fc 100644 --- a/erpnext/utilities/doctype/sms_control/sms_control.py +++ b/erpnext/utilities/doctype/sms_control/sms_control.py @@ -5,7 +5,6 @@ from __future__ import unicode_literals import frappe, json from frappe.utils import nowdate, cstr -from frappe.model.code import get_obj from frappe import msgprint, throw, _ @@ -69,7 +68,7 @@ class SmsControl(Document): msgprint(ret) def send_via_gateway(self, arg): - ss = get_obj('SMS Settings', 'SMS Settings', with_children=1) + ss = frappe.get_doc('SMS Settings', 'SMS Settings') args = {ss.message_parameter : arg.get('message')} for d in getlist(ss.doclist, 'static_parameter_details'): args[d.parameter] = d.value diff --git a/erpnext/utilities/doctype/sms_log/sms_log.txt b/erpnext/utilities/doctype/sms_log/sms_log.json similarity index 100% rename from erpnext/utilities/doctype/sms_log/sms_log.txt rename to erpnext/utilities/doctype/sms_log/sms_log.json From 231f6a5b589a902127329f147aa2b27f3b7f4603 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 31 Mar 2014 23:05:12 +0530 Subject: [PATCH 13/42] frappe/frappe#478 added test_records.json --- .../budget_distribution/test_records.json | 1 + .../doctype/cost_center/test_records.json | 19 + .../doctype/fiscal_year/test_records.json | 32 ++ .../doctype/journal_voucher/test_records.json | 84 ++++ .../test_records.json | 1 + .../doctype/pos_setting/test_records.json | 16 + .../purchase_invoice/test_records.json | 206 ++++++++++ .../doctype/sales_invoice/test_records.json | 385 ++++++++++++++++++ .../test_records.json | 157 +++++++ .../doctype/shipping_rule/test_records.json | 116 ++++++ .../doctype/purchase_order/test_records.json | 35 ++ .../buying/doctype/supplier/test_records.json | 8 + .../supplier_quotation/test_records.json | 32 ++ erpnext/hr/doctype/branch/test_records.json | 1 + .../doctype/deduction_type/test_records.json | 1 + .../hr/doctype/department/test_records.json | 1 + .../hr/doctype/designation/test_records.json | 1 + .../hr/doctype/earning_type/test_records.json | 1 + erpnext/hr/doctype/employee/test_records.json | 38 ++ .../doctype/employment_type/test_records.json | 6 + erpnext/hr/doctype/grade/test_records.json | 1 + .../hr/doctype/holiday_list/test_records.json | 18 + .../leave_application/test_records.json | 48 +++ .../leave_block_list/test_records.json | 27 ++ .../hr/doctype/leave_type/test_records.json | 11 + .../hr/doctype/salary_slip/test_records.json | 44 ++ .../doctype/bom/test_records.json | 87 ++++ .../production_order/test_records.json | 12 + .../doctype/activity_type/test_records.json | 11 + .../doctype/project/test_records.json | 10 + .../projects/doctype/task/test_records.json | 15 + .../doctype/time_log/test_records.json | 10 + .../doctype/time_log_batch/test_records.json | 14 + .../doctype/campaign/test_records.json | 10 + .../doctype/customer/test_records.json | 26 ++ .../doctype/industry_type/test_records.json | 10 + .../selling/doctype/lead/test_records.json | 27 ++ .../doctype/quotation/test_records.json | 34 ++ .../doctype/sales_bom/test_records.json | 20 + .../doctype/sales_order/test_records.json | 36 ++ erpnext/setup/doctype/brand/test_records.json | 6 + .../setup/doctype/company/test_records.json | 16 + .../setup/doctype/country/test_records.json | 6 + .../setup/doctype/currency/test_records.json | 1 + .../currency_exchange/test_records.json | 20 + .../doctype/customer_group/test_records.json | 8 + .../doctype/item_group/test_records.json | 68 ++++ .../doctype/print_heading/test_records.json | 5 + .../quotation_lost_reason/test_records.json | 6 + .../doctype/sales_partner/test_records.json | 1 + .../doctype/sales_person/test_records.json | 23 ++ .../doctype/supplier_type/test_records.json | 6 + .../terms_and_conditions/test_records.json | 6 + .../setup/doctype/territory/test_records.json | 32 ++ erpnext/setup/doctype/uom/test_records.json | 11 + .../doctype/delivery_note/test_records.json | 39 ++ erpnext/stock/doctype/item/test_records.json | 248 +++++++++++ .../doctype/item_price/test_records.json | 8 + .../material_request/test_records.json | 34 ++ .../doctype/price_list/test_records.json | 67 +++ .../purchase_receipt/test_records.json | 118 ++++++ .../stock/doctype/serial_no/test_records.json | 1 + .../doctype/stock_entry/test_records.json | 113 +++++ .../stock/doctype/warehouse/test_records.json | 25 ++ .../doctype/newsletter/test_records.json | 26 ++ .../doctype/address/test_records.json | 14 + .../doctype/contact/test_records.json | 22 + 67 files changed, 2542 insertions(+) create mode 100644 erpnext/accounts/doctype/budget_distribution/test_records.json create mode 100644 erpnext/accounts/doctype/cost_center/test_records.json create mode 100644 erpnext/accounts/doctype/fiscal_year/test_records.json create mode 100644 erpnext/accounts/doctype/journal_voucher/test_records.json create mode 100644 erpnext/accounts/doctype/payment_to_invoice_matching_tool/test_records.json create mode 100644 erpnext/accounts/doctype/pos_setting/test_records.json create mode 100644 erpnext/accounts/doctype/purchase_invoice/test_records.json create mode 100644 erpnext/accounts/doctype/sales_invoice/test_records.json create mode 100644 erpnext/accounts/doctype/sales_taxes_and_charges_master/test_records.json create mode 100644 erpnext/accounts/doctype/shipping_rule/test_records.json create mode 100644 erpnext/buying/doctype/purchase_order/test_records.json create mode 100644 erpnext/buying/doctype/supplier/test_records.json create mode 100644 erpnext/buying/doctype/supplier_quotation/test_records.json create mode 100644 erpnext/hr/doctype/branch/test_records.json create mode 100644 erpnext/hr/doctype/deduction_type/test_records.json create mode 100644 erpnext/hr/doctype/department/test_records.json create mode 100644 erpnext/hr/doctype/designation/test_records.json create mode 100644 erpnext/hr/doctype/earning_type/test_records.json create mode 100644 erpnext/hr/doctype/employee/test_records.json create mode 100644 erpnext/hr/doctype/employment_type/test_records.json create mode 100644 erpnext/hr/doctype/grade/test_records.json create mode 100644 erpnext/hr/doctype/holiday_list/test_records.json create mode 100644 erpnext/hr/doctype/leave_application/test_records.json create mode 100644 erpnext/hr/doctype/leave_block_list/test_records.json create mode 100644 erpnext/hr/doctype/leave_type/test_records.json create mode 100644 erpnext/hr/doctype/salary_slip/test_records.json create mode 100644 erpnext/manufacturing/doctype/bom/test_records.json create mode 100644 erpnext/manufacturing/doctype/production_order/test_records.json create mode 100644 erpnext/projects/doctype/activity_type/test_records.json create mode 100644 erpnext/projects/doctype/project/test_records.json create mode 100644 erpnext/projects/doctype/task/test_records.json create mode 100644 erpnext/projects/doctype/time_log/test_records.json create mode 100644 erpnext/projects/doctype/time_log_batch/test_records.json create mode 100644 erpnext/selling/doctype/campaign/test_records.json create mode 100644 erpnext/selling/doctype/customer/test_records.json create mode 100644 erpnext/selling/doctype/industry_type/test_records.json create mode 100644 erpnext/selling/doctype/lead/test_records.json create mode 100644 erpnext/selling/doctype/quotation/test_records.json create mode 100644 erpnext/selling/doctype/sales_bom/test_records.json create mode 100644 erpnext/selling/doctype/sales_order/test_records.json create mode 100644 erpnext/setup/doctype/brand/test_records.json create mode 100644 erpnext/setup/doctype/company/test_records.json create mode 100644 erpnext/setup/doctype/country/test_records.json create mode 100644 erpnext/setup/doctype/currency/test_records.json create mode 100644 erpnext/setup/doctype/currency_exchange/test_records.json create mode 100644 erpnext/setup/doctype/customer_group/test_records.json create mode 100644 erpnext/setup/doctype/item_group/test_records.json create mode 100644 erpnext/setup/doctype/print_heading/test_records.json create mode 100644 erpnext/setup/doctype/quotation_lost_reason/test_records.json create mode 100644 erpnext/setup/doctype/sales_partner/test_records.json create mode 100644 erpnext/setup/doctype/sales_person/test_records.json create mode 100644 erpnext/setup/doctype/supplier_type/test_records.json create mode 100644 erpnext/setup/doctype/terms_and_conditions/test_records.json create mode 100644 erpnext/setup/doctype/territory/test_records.json create mode 100644 erpnext/setup/doctype/uom/test_records.json create mode 100644 erpnext/stock/doctype/delivery_note/test_records.json create mode 100644 erpnext/stock/doctype/item/test_records.json create mode 100644 erpnext/stock/doctype/item_price/test_records.json create mode 100644 erpnext/stock/doctype/material_request/test_records.json create mode 100644 erpnext/stock/doctype/price_list/test_records.json create mode 100644 erpnext/stock/doctype/purchase_receipt/test_records.json create mode 100644 erpnext/stock/doctype/serial_no/test_records.json create mode 100644 erpnext/stock/doctype/stock_entry/test_records.json create mode 100644 erpnext/stock/doctype/warehouse/test_records.json create mode 100644 erpnext/support/doctype/newsletter/test_records.json create mode 100644 erpnext/utilities/doctype/address/test_records.json create mode 100644 erpnext/utilities/doctype/contact/test_records.json diff --git a/erpnext/accounts/doctype/budget_distribution/test_records.json b/erpnext/accounts/doctype/budget_distribution/test_records.json new file mode 100644 index 0000000000..0637a088a0 --- /dev/null +++ b/erpnext/accounts/doctype/budget_distribution/test_records.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/erpnext/accounts/doctype/cost_center/test_records.json b/erpnext/accounts/doctype/cost_center/test_records.json new file mode 100644 index 0000000000..9e3e011fe2 --- /dev/null +++ b/erpnext/accounts/doctype/cost_center/test_records.json @@ -0,0 +1,19 @@ +[ + { + "budget_details": [ + { + "account": "_Test Account Cost for Goods Sold - _TC", + "budget_allocated": 100000, + "doctype": "Budget Detail", + "fiscal_year": "_Test Fiscal Year 2013", + "parentfield": "budget_details" + } + ], + "company": "_Test Company", + "cost_center_name": "_Test Cost Center", + "distribution_id": "_Test Distribution", + "doctype": "Cost Center", + "group_or_ledger": "Ledger", + "parent_cost_center": "_Test Company - _TC" + } +] \ No newline at end of file diff --git a/erpnext/accounts/doctype/fiscal_year/test_records.json b/erpnext/accounts/doctype/fiscal_year/test_records.json new file mode 100644 index 0000000000..09fb90e9e3 --- /dev/null +++ b/erpnext/accounts/doctype/fiscal_year/test_records.json @@ -0,0 +1,32 @@ +[ + { + "doctype": "Fiscal Year", + "year": "_Test Fiscal Year 2012", + "year_end_date": "2012-12-31", + "year_start_date": "2012-01-01" + }, + { + "doctype": "Fiscal Year", + "year": "_Test Fiscal Year 2013", + "year_end_date": "2013-12-31", + "year_start_date": "2013-01-01" + }, + { + "doctype": "Fiscal Year", + "year": "_Test Fiscal Year 2014", + "year_end_date": "2014-12-31", + "year_start_date": "2014-01-01" + }, + { + "doctype": "Fiscal Year", + "year": "_Test Fiscal Year 2015", + "year_end_date": "2015-12-31", + "year_start_date": "2015-01-01" + }, + { + "doctype": "Fiscal Year", + "year": "_Test Fiscal Year 2016", + "year_end_date": "2016-12-31", + "year_start_date": "2016-01-01" + } +] \ No newline at end of file diff --git a/erpnext/accounts/doctype/journal_voucher/test_records.json b/erpnext/accounts/doctype/journal_voucher/test_records.json new file mode 100644 index 0000000000..78ec10cdd0 --- /dev/null +++ b/erpnext/accounts/doctype/journal_voucher/test_records.json @@ -0,0 +1,84 @@ +[ + { + "cheque_date": "2013-02-14", + "cheque_no": "33", + "company": "_Test Company", + "doctype": "Journal Voucher", + "entries": [ + { + "account": "_Test Customer - _TC", + "credit": 400.0, + "debit": 0.0, + "doctype": "Journal Voucher Detail", + "parentfield": "entries" + }, + { + "account": "_Test Account Bank Account - _TC", + "credit": 0.0, + "debit": 400.0, + "doctype": "Journal Voucher Detail", + "parentfield": "entries" + } + ], + "fiscal_year": "_Test Fiscal Year 2013", + "naming_series": "_T-Journal Voucher-", + "posting_date": "2013-02-14", + "user_remark": "test", + "voucher_type": "Bank Voucher" + }, + { + "cheque_date": "2013-02-14", + "cheque_no": "33", + "company": "_Test Company", + "doctype": "Journal Voucher", + "entries": [ + { + "account": "_Test Supplier - _TC", + "credit": 0.0, + "debit": 400.0, + "doctype": "Journal Voucher Detail", + "parentfield": "entries" + }, + { + "account": "_Test Account Bank Account - _TC", + "credit": 400.0, + "debit": 0.0, + "doctype": "Journal Voucher Detail", + "parentfield": "entries" + } + ], + "fiscal_year": "_Test Fiscal Year 2013", + "naming_series": "_T-Journal Voucher-", + "posting_date": "2013-02-14", + "user_remark": "test", + "voucher_type": "Bank Voucher" + }, + { + "cheque_date": "2013-02-14", + "cheque_no": "33", + "company": "_Test Company", + "doctype": "Journal Voucher", + "entries": [ + { + "account": "_Test Customer - _TC", + "credit": 0.0, + "debit": 400.0, + "doctype": "Journal Voucher Detail", + "parentfield": "entries" + }, + { + "account": "Sales - _TC", + "cost_center": "_Test Cost Center - _TC", + "credit": 400.0, + "debit": 0.0, + "doctype": "Journal Voucher Detail", + "parentfield": "entries" + } + ], + "fiscal_year": "_Test Fiscal Year 2013", + "naming_series": "_T-Journal Voucher-", + "posting_date": "2013-02-14", + "user_remark": "test", + "voucher_type": "Bank Voucher" + } +] \ No newline at end of file diff --git a/erpnext/accounts/doctype/payment_to_invoice_matching_tool/test_records.json b/erpnext/accounts/doctype/payment_to_invoice_matching_tool/test_records.json new file mode 100644 index 0000000000..0637a088a0 --- /dev/null +++ b/erpnext/accounts/doctype/payment_to_invoice_matching_tool/test_records.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/erpnext/accounts/doctype/pos_setting/test_records.json b/erpnext/accounts/doctype/pos_setting/test_records.json new file mode 100644 index 0000000000..f5071629e1 --- /dev/null +++ b/erpnext/accounts/doctype/pos_setting/test_records.json @@ -0,0 +1,16 @@ +[ + { + "cash_bank_account": "_Test Account Bank Account - _TC", + "company": "_Test Company", + "cost_center": "_Test Cost Center - _TC", + "currency": "INR", + "doctype": "POS Setting", + "expense_account": "_Test Account Cost for Goods Sold - _TC", + "income_account": "Sales - _TC", + "name": "_Test POS Setting", + "naming_series": "_T-Sales Invoice-", + "selling_price_list": "_Test Price List", + "territory": "_Test Territory", + "warehouse": "_Test Warehouse - _TC" + } +] \ No newline at end of file diff --git a/erpnext/accounts/doctype/purchase_invoice/test_records.json b/erpnext/accounts/doctype/purchase_invoice/test_records.json new file mode 100644 index 0000000000..67a705cc4a --- /dev/null +++ b/erpnext/accounts/doctype/purchase_invoice/test_records.json @@ -0,0 +1,206 @@ +[ + { + "bill_no": "NA", + "buying_price_list": "_Test Price List", + "company": "_Test Company", + "conversion_rate": 1, + "credit_to": "_Test Supplier - _TC", + "currency": "INR", + "doctype": "Purchase Invoice", + "entries": [ + { + "amount": 500, + "base_amount": 500, + "base_rate": 50, + "conversion_factor": 1.0, + "cost_center": "_Test Cost Center - _TC", + "doctype": "Purchase Invoice Item", + "expense_account": "_Test Account Cost for Goods Sold - _TC", + "item_code": "_Test Item Home Desktop 100", + "item_name": "_Test Item Home Desktop 100", + "item_tax_rate": "{\"_Test Account Excise Duty - _TC\": 10}", + "parentfield": "entries", + "qty": 10, + "rate": 50, + "uom": "_Test UOM" + }, + { + "amount": 750, + "base_amount": 750, + "base_rate": 150, + "conversion_factor": 1.0, + "cost_center": "_Test Cost Center - _TC", + "doctype": "Purchase Invoice Item", + "expense_account": "_Test Account Cost for Goods Sold - _TC", + "item_code": "_Test Item Home Desktop 200", + "item_name": "_Test Item Home Desktop 200", + "parentfield": "entries", + "qty": 5, + "rate": 150, + "uom": "_Test UOM" + } + ], + "fiscal_year": "_Test Fiscal Year 2013", + "grand_total_import": 0, + "naming_series": "BILL", + "other_charges": [ + { + "account_head": "_Test Account Shipping Charges - _TC", + "add_deduct_tax": "Add", + "category": "Valuation and Total", + "charge_type": "Actual", + "cost_center": "_Test Cost Center - _TC", + "description": "Shipping Charges", + "doctype": "Purchase Taxes and Charges", + "parentfield": "other_charges", + "rate": 100 + }, + { + "account_head": "_Test Account Customs Duty - _TC", + "add_deduct_tax": "Add", + "category": "Valuation", + "charge_type": "On Net Total", + "cost_center": "_Test Cost Center - _TC", + "description": "Customs Duty", + "doctype": "Purchase Taxes and Charges", + "parentfield": "other_charges", + "rate": 10 + }, + { + "account_head": "_Test Account Excise Duty - _TC", + "add_deduct_tax": "Add", + "category": "Total", + "charge_type": "On Net Total", + "cost_center": "_Test Cost Center - _TC", + "description": "Excise Duty", + "doctype": "Purchase Taxes and Charges", + "parentfield": "other_charges", + "rate": 12 + }, + { + "account_head": "_Test Account Education Cess - _TC", + "add_deduct_tax": "Add", + "category": "Total", + "charge_type": "On Previous Row Amount", + "cost_center": "_Test Cost Center - _TC", + "description": "Education Cess", + "doctype": "Purchase Taxes and Charges", + "parentfield": "other_charges", + "rate": 2, + "row_id": 3 + }, + { + "account_head": "_Test Account S&H Education Cess - _TC", + "add_deduct_tax": "Add", + "category": "Total", + "charge_type": "On Previous Row Amount", + "cost_center": "_Test Cost Center - _TC", + "description": "S&H Education Cess", + "doctype": "Purchase Taxes and Charges", + "parentfield": "other_charges", + "rate": 1, + "row_id": 3 + }, + { + "account_head": "_Test Account CST - _TC", + "add_deduct_tax": "Add", + "category": "Total", + "charge_type": "On Previous Row Total", + "cost_center": "_Test Cost Center - _TC", + "description": "CST", + "doctype": "Purchase Taxes and Charges", + "parentfield": "other_charges", + "rate": 2, + "row_id": 5 + }, + { + "account_head": "_Test Account VAT - _TC", + "add_deduct_tax": "Add", + "category": "Total", + "charge_type": "On Net Total", + "cost_center": "_Test Cost Center - _TC", + "description": "VAT", + "doctype": "Purchase Taxes and Charges", + "parentfield": "other_charges", + "rate": 12.5 + }, + { + "account_head": "_Test Account Discount - _TC", + "add_deduct_tax": "Deduct", + "category": "Total", + "charge_type": "On Previous Row Total", + "cost_center": "_Test Cost Center - _TC", + "description": "Discount", + "doctype": "Purchase Taxes and Charges", + "parentfield": "other_charges", + "rate": 10, + "row_id": 7 + } + ], + "posting_date": "2013-02-03", + "supplier_name": "_Test Supplier" + }, + { + "bill_no": "NA", + "buying_price_list": "_Test Price List", + "company": "_Test Company", + "conversion_rate": 1.0, + "credit_to": "_Test Supplier - _TC", + "currency": "INR", + "doctype": "Purchase Invoice", + "entries": [ + { + "conversion_factor": 1.0, + "cost_center": "_Test Cost Center - _TC", + "doctype": "Purchase Invoice Item", + "expense_account": "_Test Account Cost for Goods Sold - _TC", + "item_code": "_Test Item", + "item_name": "_Test Item", + "parentfield": "entries", + "qty": 10.0, + "rate": 50.0, + "uom": "_Test UOM" + } + ], + "fiscal_year": "_Test Fiscal Year 2013", + "grand_total_import": 0, + "naming_series": "_T-Purchase Invoice-", + "other_charges": [ + { + "account_head": "_Test Account Shipping Charges - _TC", + "add_deduct_tax": "Add", + "category": "Valuation and Total", + "charge_type": "Actual", + "cost_center": "_Test Cost Center - _TC", + "description": "Shipping Charges", + "doctype": "Purchase Taxes and Charges", + "parentfield": "other_charges", + "rate": 100.0 + }, + { + "account_head": "_Test Account VAT - _TC", + "add_deduct_tax": "Add", + "category": "Total", + "charge_type": "Actual", + "cost_center": "_Test Cost Center - _TC", + "description": "VAT", + "doctype": "Purchase Taxes and Charges", + "parentfield": "other_charges", + "rate": 120.0 + }, + { + "account_head": "_Test Account Customs Duty - _TC", + "add_deduct_tax": "Add", + "category": "Valuation", + "charge_type": "Actual", + "cost_center": "_Test Cost Center - _TC", + "description": "Customs Duty", + "doctype": "Purchase Taxes and Charges", + "parentfield": "other_charges", + "rate": 150.0 + } + ], + "posting_date": "2013-02-03", + "supplier_name": "_Test Supplier" + } +] \ No newline at end of file diff --git a/erpnext/accounts/doctype/sales_invoice/test_records.json b/erpnext/accounts/doctype/sales_invoice/test_records.json new file mode 100644 index 0000000000..b0828f5c7e --- /dev/null +++ b/erpnext/accounts/doctype/sales_invoice/test_records.json @@ -0,0 +1,385 @@ +[ + { + "company": "_Test Company", + "conversion_rate": 1.0, + "currency": "INR", + "customer": "_Test Customer", + "customer_name": "_Test Customer", + "debit_to": "_Test Customer - _TC", + "doctype": "Sales Invoice", + "due_date": "2013-01-23", + "entries": [ + { + "amount": 500.0, + "base_amount": 500.0, + "base_rate": 500.0, + "cost_center": "_Test Cost Center - _TC", + "description": "138-CMS Shoe", + "doctype": "Sales Invoice Item", + "income_account": "Sales - _TC", + "item_name": "138-CMS Shoe", + "parentfield": "entries", + "qty": 1.0, + "rate": 500.0 + } + ], + "fiscal_year": "_Test Fiscal Year 2013", + "grand_total": 561.8, + "grand_total_export": 561.8, + "is_pos": 0, + "naming_series": "_T-Sales Invoice-", + "net_total": 500.0, + "other_charges": [ + { + "account_head": "_Test Account VAT - _TC", + "charge_type": "On Net Total", + "description": "VAT", + "doctype": "Sales Taxes and Charges", + "parentfield": "other_charges", + "rate": 6 + }, + { + "account_head": "_Test Account Service Tax - _TC", + "charge_type": "On Net Total", + "description": "Service Tax", + "doctype": "Sales Taxes and Charges", + "parentfield": "other_charges", + "rate": 6.36 + } + ], + "plc_conversion_rate": 1.0, + "posting_date": "2013-01-23", + "price_list_currency": "INR", + "sales_team": [ + { + "allocated_percentage": 65.5, + "doctype": "Sales Team", + "parentfield": "sales_team", + "sales_person": "_Test Sales Person 1" + }, + { + "allocated_percentage": 34.5, + "doctype": "Sales Team", + "parentfield": "sales_team", + "sales_person": "_Test Sales Person 2" + } + ], + "selling_price_list": "_Test Price List", + "territory": "_Test Territory" + }, + { + "company": "_Test Company", + "conversion_rate": 1.0, + "currency": "INR", + "customer": "_Test Customer", + "customer_name": "_Test Customer", + "debit_to": "_Test Customer - _TC", + "doctype": "Sales Invoice", + "due_date": "2013-01-23", + "entries": [ + { + "amount": 500.0, + "base_amount": 500.0, + "base_rate": 500.0, + "cost_center": "_Test Cost Center - _TC", + "description": "_Test Item", + "doctype": "Sales Invoice Item", + "expense_account": "_Test Account Cost for Goods Sold - _TC", + "income_account": "Sales - _TC", + "item_code": "_Test Item", + "item_name": "_Test Item", + "parentfield": "entries", + "price_list_rate": 500.0, + "qty": 1.0 + } + ], + "fiscal_year": "_Test Fiscal Year 2013", + "grand_total": 630.0, + "grand_total_export": 630.0, + "is_pos": 0, + "naming_series": "_T-Sales Invoice-", + "net_total": 500.0, + "other_charges": [ + { + "account_head": "_Test Account VAT - _TC", + "charge_type": "On Net Total", + "description": "VAT", + "doctype": "Sales Taxes and Charges", + "parentfield": "other_charges", + "rate": 16 + }, + { + "account_head": "_Test Account Service Tax - _TC", + "charge_type": "On Net Total", + "description": "Service Tax", + "doctype": "Sales Taxes and Charges", + "parentfield": "other_charges", + "rate": 10 + } + ], + "plc_conversion_rate": 1.0, + "posting_date": "2013-03-07", + "price_list_currency": "INR", + "selling_price_list": "_Test Price List", + "territory": "_Test Territory" + }, + { + "company": "_Test Company", + "conversion_rate": 1.0, + "currency": "INR", + "customer": "_Test Customer", + "customer_name": "_Test Customer", + "debit_to": "_Test Customer - _TC", + "doctype": "Sales Invoice", + "due_date": "2013-01-23", + "entries": [ + { + "cost_center": "_Test Cost Center - _TC", + "doctype": "Sales Invoice Item", + "income_account": "Sales - _TC", + "item_code": "_Test Item Home Desktop 100", + "item_name": "_Test Item Home Desktop 100", + "item_tax_rate": "{\"_Test Account Excise Duty - _TC\": 10}", + "parentfield": "entries", + "price_list_rate": 50, + "qty": 10, + "rate": 50, + "stock_uom": "_Test UOM" + }, + { + "cost_center": "_Test Cost Center - _TC", + "doctype": "Sales Invoice Item", + "income_account": "Sales - _TC", + "item_code": "_Test Item Home Desktop 200", + "item_name": "_Test Item Home Desktop 200", + "parentfield": "entries", + "price_list_rate": 150, + "qty": 5, + "rate": 150, + "stock_uom": "_Test UOM" + } + ], + "fiscal_year": "_Test Fiscal Year 2013", + "grand_total_export": 0, + "is_pos": 0, + "naming_series": "_T-Sales Invoice-", + "other_charges": [ + { + "account_head": "_Test Account Shipping Charges - _TC", + "charge_type": "Actual", + "cost_center": "_Test Cost Center - _TC", + "description": "Shipping Charges", + "doctype": "Sales Taxes and Charges", + "parentfield": "other_charges", + "rate": 100 + }, + { + "account_head": "_Test Account Customs Duty - _TC", + "charge_type": "On Net Total", + "cost_center": "_Test Cost Center - _TC", + "description": "Customs Duty", + "doctype": "Sales Taxes and Charges", + "parentfield": "other_charges", + "rate": 10 + }, + { + "account_head": "_Test Account Excise Duty - _TC", + "charge_type": "On Net Total", + "cost_center": "_Test Cost Center - _TC", + "description": "Excise Duty", + "doctype": "Sales Taxes and Charges", + "parentfield": "other_charges", + "rate": 12 + }, + { + "account_head": "_Test Account Education Cess - _TC", + "charge_type": "On Previous Row Amount", + "cost_center": "_Test Cost Center - _TC", + "description": "Education Cess", + "doctype": "Sales Taxes and Charges", + "parentfield": "other_charges", + "rate": 2, + "row_id": 3 + }, + { + "account_head": "_Test Account S&H Education Cess - _TC", + "charge_type": "On Previous Row Amount", + "cost_center": "_Test Cost Center - _TC", + "description": "S&H Education Cess", + "doctype": "Sales Taxes and Charges", + "parentfield": "other_charges", + "rate": 1, + "row_id": 3 + }, + { + "account_head": "_Test Account CST - _TC", + "charge_type": "On Previous Row Total", + "cost_center": "_Test Cost Center - _TC", + "description": "CST", + "doctype": "Sales Taxes and Charges", + "parentfield": "other_charges", + "rate": 2, + "row_id": 5 + }, + { + "account_head": "_Test Account VAT - _TC", + "charge_type": "On Net Total", + "cost_center": "_Test Cost Center - _TC", + "description": "VAT", + "doctype": "Sales Taxes and Charges", + "parentfield": "other_charges", + "rate": 12.5 + }, + { + "account_head": "_Test Account Discount - _TC", + "charge_type": "On Previous Row Total", + "cost_center": "_Test Cost Center - _TC", + "description": "Discount", + "doctype": "Sales Taxes and Charges", + "parentfield": "other_charges", + "rate": -10, + "row_id": 7 + } + ], + "plc_conversion_rate": 1.0, + "posting_date": "2013-01-23", + "price_list_currency": "INR", + "selling_price_list": "_Test Price List", + "territory": "_Test Territory" + }, + { + "company": "_Test Company", + "conversion_rate": 1.0, + "currency": "INR", + "customer": "_Test Customer", + "customer_name": "_Test Customer", + "debit_to": "_Test Customer - _TC", + "doctype": "Sales Invoice", + "due_date": "2013-01-23", + "entries": [ + { + "cost_center": "_Test Cost Center - _TC", + "doctype": "Sales Invoice Item", + "income_account": "Sales - _TC", + "item_code": "_Test Item Home Desktop 100", + "item_name": "_Test Item Home Desktop 100", + "item_tax_rate": "{\"_Test Account Excise Duty - _TC\": 10}", + "parentfield": "entries", + "price_list_rate": 62.5, + "qty": 10, + "stock_uom": "_Test UOM" + }, + { + "cost_center": "_Test Cost Center - _TC", + "doctype": "Sales Invoice Item", + "income_account": "Sales - _TC", + "item_code": "_Test Item Home Desktop 200", + "item_name": "_Test Item Home Desktop 200", + "parentfield": "entries", + "price_list_rate": 190.66, + "qty": 5, + "stock_uom": "_Test UOM" + } + ], + "fiscal_year": "_Test Fiscal Year 2013", + "grand_total_export": 0, + "is_pos": 0, + "naming_series": "_T-Sales Invoice-", + "other_charges": [ + { + "account_head": "_Test Account Excise Duty - _TC", + "charge_type": "On Net Total", + "cost_center": "_Test Cost Center - _TC", + "description": "Excise Duty", + "doctype": "Sales Taxes and Charges", + "idx": 1, + "included_in_print_rate": 1, + "parentfield": "other_charges", + "rate": 12 + }, + { + "account_head": "_Test Account Education Cess - _TC", + "charge_type": "On Previous Row Amount", + "cost_center": "_Test Cost Center - _TC", + "description": "Education Cess", + "doctype": "Sales Taxes and Charges", + "idx": 2, + "included_in_print_rate": 1, + "parentfield": "other_charges", + "rate": 2, + "row_id": 1 + }, + { + "account_head": "_Test Account S&H Education Cess - _TC", + "charge_type": "On Previous Row Amount", + "cost_center": "_Test Cost Center - _TC", + "description": "S&H Education Cess", + "doctype": "Sales Taxes and Charges", + "idx": 3, + "included_in_print_rate": 1, + "parentfield": "other_charges", + "rate": 1, + "row_id": 1 + }, + { + "account_head": "_Test Account CST - _TC", + "charge_type": "On Previous Row Total", + "cost_center": "_Test Cost Center - _TC", + "description": "CST", + "doctype": "Sales Taxes and Charges", + "idx": 4, + "included_in_print_rate": 1, + "parentfield": "other_charges", + "rate": 2, + "row_id": 3 + }, + { + "account_head": "_Test Account VAT - _TC", + "charge_type": "On Net Total", + "cost_center": "_Test Cost Center - _TC", + "description": "VAT", + "doctype": "Sales Taxes and Charges", + "idx": 5, + "included_in_print_rate": 1, + "parentfield": "other_charges", + "rate": 12.5 + }, + { + "account_head": "_Test Account Customs Duty - _TC", + "charge_type": "On Net Total", + "cost_center": "_Test Cost Center - _TC", + "description": "Customs Duty", + "doctype": "Sales Taxes and Charges", + "idx": 6, + "parentfield": "other_charges", + "rate": 10 + }, + { + "account_head": "_Test Account Shipping Charges - _TC", + "charge_type": "Actual", + "cost_center": "_Test Cost Center - _TC", + "description": "Shipping Charges", + "doctype": "Sales Taxes and Charges", + "idx": 7, + "parentfield": "other_charges", + "rate": 100 + }, + { + "account_head": "_Test Account Discount - _TC", + "charge_type": "On Previous Row Total", + "cost_center": "_Test Cost Center - _TC", + "description": "Discount", + "doctype": "Sales Taxes and Charges", + "idx": 8, + "parentfield": "other_charges", + "rate": -10, + "row_id": 7 + } + ], + "plc_conversion_rate": 1.0, + "posting_date": "2013-01-23", + "price_list_currency": "INR", + "selling_price_list": "_Test Price List", + "territory": "_Test Territory" + } +] \ No newline at end of file diff --git a/erpnext/accounts/doctype/sales_taxes_and_charges_master/test_records.json b/erpnext/accounts/doctype/sales_taxes_and_charges_master/test_records.json new file mode 100644 index 0000000000..dda8a4aa8f --- /dev/null +++ b/erpnext/accounts/doctype/sales_taxes_and_charges_master/test_records.json @@ -0,0 +1,157 @@ +[ + { + "company": "_Test Company", + "doctype": "Sales Taxes and Charges Master", + "other_charges": [ + { + "account_head": "_Test Account VAT - _TC", + "charge_type": "On Net Total", + "description": "VAT", + "doctype": "Sales Taxes and Charges", + "parentfield": "other_charges", + "rate": 6 + }, + { + "account_head": "_Test Account Service Tax - _TC", + "charge_type": "On Net Total", + "description": "Service Tax", + "doctype": "Sales Taxes and Charges", + "parentfield": "other_charges", + "rate": 6.36 + } + ], + "title": "_Test Sales Taxes and Charges Master", + "valid_for_territories": [ + { + "doctype": "Applicable Territory", + "parentfield": "valid_for_territories", + "territory": "All Territories" + }, + { + "doctype": "Applicable Territory", + "parentfield": "valid_for_territories", + "territory": "_Test Territory Rest Of The World" + } + ] + }, + { + "company": "_Test Company", + "doctype": "Sales Taxes and Charges Master", + "other_charges": [ + { + "account_head": "_Test Account Shipping Charges - _TC", + "charge_type": "Actual", + "cost_center": "_Test Cost Center - _TC", + "description": "Shipping Charges", + "doctype": "Sales Taxes and Charges", + "parentfield": "other_charges", + "rate": 100 + }, + { + "account_head": "_Test Account Customs Duty - _TC", + "charge_type": "On Net Total", + "cost_center": "_Test Cost Center - _TC", + "description": "Customs Duty", + "doctype": "Sales Taxes and Charges", + "parentfield": "other_charges", + "rate": 10 + }, + { + "account_head": "_Test Account Excise Duty - _TC", + "charge_type": "On Net Total", + "cost_center": "_Test Cost Center - _TC", + "description": "Excise Duty", + "doctype": "Sales Taxes and Charges", + "parentfield": "other_charges", + "rate": 12 + }, + { + "account_head": "_Test Account Education Cess - _TC", + "charge_type": "On Previous Row Amount", + "cost_center": "_Test Cost Center - _TC", + "description": "Education Cess", + "doctype": "Sales Taxes and Charges", + "parentfield": "other_charges", + "rate": 2, + "row_id": 3 + }, + { + "account_head": "_Test Account S&H Education Cess - _TC", + "charge_type": "On Previous Row Amount", + "cost_center": "_Test Cost Center - _TC", + "description": "S&H Education Cess", + "doctype": "Sales Taxes and Charges", + "parentfield": "other_charges", + "rate": 1, + "row_id": 3 + }, + { + "account_head": "_Test Account CST - _TC", + "charge_type": "On Previous Row Total", + "cost_center": "_Test Cost Center - _TC", + "description": "CST", + "doctype": "Sales Taxes and Charges", + "parentfield": "other_charges", + "rate": 2, + "row_id": 5 + }, + { + "account_head": "_Test Account VAT - _TC", + "charge_type": "On Net Total", + "cost_center": "_Test Cost Center - _TC", + "description": "VAT", + "doctype": "Sales Taxes and Charges", + "parentfield": "other_charges", + "rate": 12.5 + }, + { + "account_head": "_Test Account Discount - _TC", + "charge_type": "On Previous Row Total", + "cost_center": "_Test Cost Center - _TC", + "description": "Discount", + "doctype": "Sales Taxes and Charges", + "parentfield": "other_charges", + "rate": -10, + "row_id": 7 + } + ], + "title": "_Test India Tax Master", + "valid_for_territories": [ + { + "doctype": "Applicable Territory", + "parentfield": "valid_for_territories", + "territory": "_Test Territory India" + } + ] + }, + { + "company": "_Test Company", + "doctype": "Sales Taxes and Charges Master", + "other_charges": [ + { + "account_head": "_Test Account VAT - _TC", + "charge_type": "On Net Total", + "description": "VAT", + "doctype": "Sales Taxes and Charges", + "parentfield": "other_charges", + "rate": 12 + }, + { + "account_head": "_Test Account Service Tax - _TC", + "charge_type": "On Net Total", + "description": "Service Tax", + "doctype": "Sales Taxes and Charges", + "parentfield": "other_charges", + "rate": 4 + } + ], + "title": "_Test Sales Taxes and Charges Master - Rest of the World", + "valid_for_territories": [ + { + "doctype": "Applicable Territory", + "parentfield": "valid_for_territories", + "territory": "_Test Territory Rest Of The World" + } + ] + } +] \ No newline at end of file diff --git a/erpnext/accounts/doctype/shipping_rule/test_records.json b/erpnext/accounts/doctype/shipping_rule/test_records.json new file mode 100644 index 0000000000..5477c8f957 --- /dev/null +++ b/erpnext/accounts/doctype/shipping_rule/test_records.json @@ -0,0 +1,116 @@ +[ + { + "account": "_Test Account Shipping Charges - _TC", + "calculate_based_on": "Net Total", + "company": "_Test Company", + "cost_center": "_Test Cost Center - _TC", + "doctype": "Shipping Rule", + "label": "_Test Shipping Rule", + "name": "_Test Shipping Rule", + "shipping_rule_conditions": [ + { + "doctype": "Shipping Rule Condition", + "from_value": 0, + "parentfield": "shipping_rule_conditions", + "shipping_amount": 50.0, + "to_value": 100 + }, + { + "doctype": "Shipping Rule Condition", + "from_value": 101, + "parentfield": "shipping_rule_conditions", + "shipping_amount": 100.0, + "to_value": 200 + }, + { + "doctype": "Shipping Rule Condition", + "from_value": 201, + "parentfield": "shipping_rule_conditions", + "shipping_amount": 0.0 + } + ], + "valid_for_territories": [ + { + "doctype": "Applicable Territory", + "parentfield": "valid_for_territories", + "territory": "_Test Territory" + } + ] + }, + { + "account": "_Test Account Shipping Charges - _TC", + "calculate_based_on": "Net Total", + "company": "_Test Company", + "cost_center": "_Test Cost Center - _TC", + "doctype": "Shipping Rule", + "label": "_Test Shipping Rule - India", + "name": "_Test Shipping Rule - India", + "shipping_rule_conditions": [ + { + "doctype": "Shipping Rule Condition", + "from_value": 0, + "parentfield": "shipping_rule_conditions", + "shipping_amount": 50.0, + "to_value": 100 + }, + { + "doctype": "Shipping Rule Condition", + "from_value": 101, + "parentfield": "shipping_rule_conditions", + "shipping_amount": 100.0, + "to_value": 200 + }, + { + "doctype": "Shipping Rule Condition", + "from_value": 201, + "parentfield": "shipping_rule_conditions", + "shipping_amount": 0.0 + } + ], + "valid_for_territories": [ + { + "doctype": "Applicable Territory", + "parentfield": "valid_for_territories", + "territory": "_Test Territory India" + } + ] + }, + { + "account": "_Test Account Shipping Charges - _TC", + "calculate_based_on": "Net Total", + "company": "_Test Company", + "cost_center": "_Test Cost Center - _TC", + "doctype": "Shipping Rule", + "label": "_Test Shipping Rule - Rest of the World", + "name": "_Test Shipping Rule - Rest of the World", + "shipping_rule_conditions": [ + { + "doctype": "Shipping Rule Condition", + "from_value": 0, + "parentfield": "shipping_rule_conditions", + "shipping_amount": 500.0, + "to_value": 1000 + }, + { + "doctype": "Shipping Rule Condition", + "from_value": 1001, + "parentfield": "shipping_rule_conditions", + "shipping_amount": 1000.0, + "to_value": 2000 + }, + { + "doctype": "Shipping Rule Condition", + "from_value": 2001, + "parentfield": "shipping_rule_conditions", + "shipping_amount": 1500.0 + } + ], + "valid_for_territories": [ + { + "doctype": "Applicable Territory", + "parentfield": "valid_for_territories", + "territory": "_Test Territory Rest Of The World" + } + ] + } +] \ No newline at end of file diff --git a/erpnext/buying/doctype/purchase_order/test_records.json b/erpnext/buying/doctype/purchase_order/test_records.json new file mode 100644 index 0000000000..3aaf542a32 --- /dev/null +++ b/erpnext/buying/doctype/purchase_order/test_records.json @@ -0,0 +1,35 @@ +[ + { + "buying_price_list": "_Test Price List", + "company": "_Test Company", + "conversion_rate": 1.0, + "currency": "INR", + "doctype": "Purchase Order", + "fiscal_year": "_Test Fiscal Year 2013", + "grand_total": 5000.0, + "grand_total_import": 5000.0, + "is_subcontracted": "Yes", + "naming_series": "_T-Purchase Order-", + "net_total": 5000.0, + "po_details": [ + { + "base_amount": 5000.0, + "conversion_factor": 1.0, + "description": "_Test FG Item", + "doctype": "Purchase Order Item", + "item_code": "_Test FG Item", + "item_name": "_Test FG Item", + "parentfield": "po_details", + "qty": 10.0, + "rate": 500.0, + "schedule_date": "2013-03-01", + "stock_uom": "_Test UOM", + "uom": "_Test UOM", + "warehouse": "_Test Warehouse - _TC" + } + ], + "supplier": "_Test Supplier", + "supplier_name": "_Test Supplier", + "transaction_date": "2013-02-12" + } +] \ No newline at end of file diff --git a/erpnext/buying/doctype/supplier/test_records.json b/erpnext/buying/doctype/supplier/test_records.json new file mode 100644 index 0000000000..a1d1054ff2 --- /dev/null +++ b/erpnext/buying/doctype/supplier/test_records.json @@ -0,0 +1,8 @@ +[ + { + "company": "_Test Company", + "doctype": "Supplier", + "supplier_name": "_Test Supplier", + "supplier_type": "_Test Supplier Type" + } +] \ No newline at end of file diff --git a/erpnext/buying/doctype/supplier_quotation/test_records.json b/erpnext/buying/doctype/supplier_quotation/test_records.json new file mode 100644 index 0000000000..90807d4674 --- /dev/null +++ b/erpnext/buying/doctype/supplier_quotation/test_records.json @@ -0,0 +1,32 @@ +[ + { + "buying_price_list": "_Test Price List", + "company": "_Test Company", + "conversion_rate": 1.0, + "currency": "INR", + "doctype": "Supplier Quotation", + "fiscal_year": "_Test Fiscal Year 2013", + "grand_total": 5000.0, + "grand_total_import": 5000.0, + "is_subcontracted": "No", + "naming_series": "_T-Supplier Quotation-", + "net_total": 5000.0, + "quotation_items": [ + { + "base_amount": 5000.0, + "description": "_Test FG Item", + "doctype": "Supplier Quotation Item", + "item_code": "_Test FG Item", + "item_name": "_Test FG Item", + "parentfield": "quotation_items", + "qty": 10.0, + "rate": 500.0, + "uom": "_Test UOM", + "warehouse": "_Test Warehouse - _TC" + } + ], + "supplier": "_Test Supplier", + "supplier_name": "_Test Supplier", + "transaction_date": "2013-02-12" + } +] \ No newline at end of file diff --git a/erpnext/hr/doctype/branch/test_records.json b/erpnext/hr/doctype/branch/test_records.json new file mode 100644 index 0000000000..0637a088a0 --- /dev/null +++ b/erpnext/hr/doctype/branch/test_records.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/erpnext/hr/doctype/deduction_type/test_records.json b/erpnext/hr/doctype/deduction_type/test_records.json new file mode 100644 index 0000000000..0637a088a0 --- /dev/null +++ b/erpnext/hr/doctype/deduction_type/test_records.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/erpnext/hr/doctype/department/test_records.json b/erpnext/hr/doctype/department/test_records.json new file mode 100644 index 0000000000..0637a088a0 --- /dev/null +++ b/erpnext/hr/doctype/department/test_records.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/erpnext/hr/doctype/designation/test_records.json b/erpnext/hr/doctype/designation/test_records.json new file mode 100644 index 0000000000..0637a088a0 --- /dev/null +++ b/erpnext/hr/doctype/designation/test_records.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/erpnext/hr/doctype/earning_type/test_records.json b/erpnext/hr/doctype/earning_type/test_records.json new file mode 100644 index 0000000000..0637a088a0 --- /dev/null +++ b/erpnext/hr/doctype/earning_type/test_records.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/erpnext/hr/doctype/employee/test_records.json b/erpnext/hr/doctype/employee/test_records.json new file mode 100644 index 0000000000..087265fa48 --- /dev/null +++ b/erpnext/hr/doctype/employee/test_records.json @@ -0,0 +1,38 @@ +[ + { + "company": "_Test Company", + "date_of_birth": "1980-01-01", + "date_of_joining": "2010-01-01", + "department": "_Test Department", + "doctype": "Employee", + "employee_name": "_Test Employee", + "gender": "Female", + "naming_series": "_T-Employee-", + "status": "Active", + "user_id": "test@example.com" + }, + { + "company": "_Test Company", + "date_of_birth": "1980-01-01", + "date_of_joining": "2010-01-01", + "department": "_Test Department 1", + "doctype": "Employee", + "employee_name": "_Test Employee 1", + "gender": "Male", + "naming_series": "_T-Employee-", + "status": "Active", + "user_id": "test1@example.com" + }, + { + "company": "_Test Company", + "date_of_birth": "1980-01-01", + "date_of_joining": "2010-01-01", + "department": "_Test Department 1", + "doctype": "Employee", + "employee_name": "_Test Employee 2", + "gender": "Male", + "naming_series": "_T-Employee-", + "status": "Active", + "user_id": "test2@example.com" + } +] \ No newline at end of file diff --git a/erpnext/hr/doctype/employment_type/test_records.json b/erpnext/hr/doctype/employment_type/test_records.json new file mode 100644 index 0000000000..fa571798a0 --- /dev/null +++ b/erpnext/hr/doctype/employment_type/test_records.json @@ -0,0 +1,6 @@ +[ + { + "doctype": "Employment Type", + "employee_type_name": "_Test Employment Type" + } +] \ No newline at end of file diff --git a/erpnext/hr/doctype/grade/test_records.json b/erpnext/hr/doctype/grade/test_records.json new file mode 100644 index 0000000000..0637a088a0 --- /dev/null +++ b/erpnext/hr/doctype/grade/test_records.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/erpnext/hr/doctype/holiday_list/test_records.json b/erpnext/hr/doctype/holiday_list/test_records.json new file mode 100644 index 0000000000..9ef8c8efde --- /dev/null +++ b/erpnext/hr/doctype/holiday_list/test_records.json @@ -0,0 +1,18 @@ +[ + { + "doctype": "Holiday List", + "fiscal_year": "_Test Fiscal Year 2013", + "holiday_list_details": [ + { + "description": "New Year", + "doctype": "Holiday", + "holiday_date": "2013-01-01", + "parent": "_Test Holiday List", + "parentfield": "holiday_list_details", + "parenttype": "Holiday List" + } + ], + "holiday_list_name": "_Test Holiday List", + "is_default": 1 + } +] \ No newline at end of file diff --git a/erpnext/hr/doctype/leave_application/test_records.json b/erpnext/hr/doctype/leave_application/test_records.json new file mode 100644 index 0000000000..aac41fb235 --- /dev/null +++ b/erpnext/hr/doctype/leave_application/test_records.json @@ -0,0 +1,48 @@ +[ + { + "docstatus": 1, + "doctype": "Leave Allocation", + "employee": "_T-Employee-0001", + "fiscal_year": "_Test Fiscal Year 2013", + "leave_type": "_Test Leave Type", + "new_leaves_allocated": 15 + }, + { + "company": "_Test Company", + "doctype": "Leave Application", + "employee": "_T-Employee-0001", + "fiscal_year": "_Test Fiscal Year 2013", + "from_date": "2013-05-01", + "leave_type": "_Test Leave Type", + "posting_date": "2013-01-02", + "to_date": "2013-05-05" + }, + { + "docstatus": 1, + "doctype": "Leave Allocation", + "employee": "_T-Employee-0002", + "fiscal_year": "_Test Fiscal Year 2013", + "leave_type": "_Test Leave Type", + "new_leaves_allocated": 15 + }, + { + "company": "_Test Company", + "doctype": "Leave Application", + "employee": "_T-Employee-0002", + "fiscal_year": "_Test Fiscal Year 2013", + "from_date": "2013-05-01", + "leave_type": "_Test Leave Type", + "posting_date": "2013-01-02", + "to_date": "2013-05-05" + }, + { + "company": "_Test Company", + "doctype": "Leave Application", + "employee": "_T-Employee-0001", + "fiscal_year": "_Test Fiscal Year 2013", + "from_date": "2013-01-15", + "leave_type": "_Test Leave Type LWP", + "posting_date": "2013-01-02", + "to_date": "2013-01-15" + } +] \ No newline at end of file diff --git a/erpnext/hr/doctype/leave_block_list/test_records.json b/erpnext/hr/doctype/leave_block_list/test_records.json new file mode 100644 index 0000000000..04565116d1 --- /dev/null +++ b/erpnext/hr/doctype/leave_block_list/test_records.json @@ -0,0 +1,27 @@ +[ + { + "company": "_Test Company", + "doctype": "Leave Block List", + "leave_block_list_allowed": [ + { + "allow_user": "test1@example.com", + "doctype": "Leave Block List Allow", + "parent": "_Test Leave Block List", + "parentfield": "leave_block_list_allowed", + "parenttype": "Leave Block List" + } + ], + "leave_block_list_dates": [ + { + "block_date": "2013-01-02", + "doctype": "Leave Block List Date", + "parent": "_Test Leave Block List", + "parentfield": "leave_block_list_dates", + "parenttype": "Leave Block List", + "reason": "First work day" + } + ], + "leave_block_list_name": "_Test Leave Block List", + "year": "_Test Fiscal Year 2013" + } +] \ No newline at end of file diff --git a/erpnext/hr/doctype/leave_type/test_records.json b/erpnext/hr/doctype/leave_type/test_records.json new file mode 100644 index 0000000000..8042e30f52 --- /dev/null +++ b/erpnext/hr/doctype/leave_type/test_records.json @@ -0,0 +1,11 @@ +[ + { + "doctype": "Leave Type", + "leave_type_name": "_Test Leave Type" + }, + { + "doctype": "Leave Type", + "is_lwp": 1, + "leave_type_name": "_Test Leave Type LWP" + } +] \ No newline at end of file diff --git a/erpnext/hr/doctype/salary_slip/test_records.json b/erpnext/hr/doctype/salary_slip/test_records.json new file mode 100644 index 0000000000..3e750cf462 --- /dev/null +++ b/erpnext/hr/doctype/salary_slip/test_records.json @@ -0,0 +1,44 @@ +[ + { + "company": "_Test Company", + "deduction_details": [ + { + "d_amount": 100, + "d_depends_on_lwp": 0, + "d_type": "_Test Professional Tax", + "doctype": "Salary Slip Deduction", + "parentfield": "deduction_details" + }, + { + "d_amount": 50, + "d_depends_on_lwp": 1, + "d_type": "_Test TDS", + "doctype": "Salary Slip Deduction", + "parentfield": "deduction_details" + } + ], + "doctype": "Salary Slip", + "earning_details": [ + { + "doctype": "Salary Slip Earning", + "e_amount": 15000, + "e_depends_on_lwp": 1, + "e_type": "_Test Basic Salary", + "parentfield": "earning_details" + }, + { + "doctype": "Salary Slip Earning", + "e_amount": 500, + "e_depends_on_lwp": 0, + "e_type": "_Test Allowance", + "parentfield": "earning_details" + } + ], + "employee": "_T-Employee-0001", + "employee_name": "_Test Employee", + "fiscal_year": "_Test Fiscal Year 2013", + "month": "01", + "payment_days": 31, + "total_days_in_month": 31 + } +] \ No newline at end of file diff --git a/erpnext/manufacturing/doctype/bom/test_records.json b/erpnext/manufacturing/doctype/bom/test_records.json new file mode 100644 index 0000000000..efd26c243f --- /dev/null +++ b/erpnext/manufacturing/doctype/bom/test_records.json @@ -0,0 +1,87 @@ +[ + { + "bom_materials": [ + { + "amount": 5000.0, + "doctype": "BOM Item", + "item_code": "_Test Serialized Item With Series", + "parentfield": "bom_materials", + "qty": 1.0, + "rate": 5000.0, + "stock_uom": "_Test UOM" + }, + { + "amount": 2000.0, + "doctype": "BOM Item", + "item_code": "_Test Item 2", + "parentfield": "bom_materials", + "qty": 2.0, + "rate": 1000.0, + "stock_uom": "_Test UOM" + } + ], + "docstatus": 1, + "doctype": "BOM", + "is_active": 1, + "is_default": 1, + "item": "_Test Item Home Desktop Manufactured", + "quantity": 1.0 + }, + { + "bom_materials": [ + { + "amount": 5000.0, + "doctype": "BOM Item", + "item_code": "_Test Item", + "parentfield": "bom_materials", + "qty": 1.0, + "rate": 5000.0, + "stock_uom": "_Test UOM" + }, + { + "amount": 2000.0, + "doctype": "BOM Item", + "item_code": "_Test Item Home Desktop 100", + "parentfield": "bom_materials", + "qty": 2.0, + "rate": 1000.0, + "stock_uom": "_Test UOM" + } + ], + "docstatus": 1, + "doctype": "BOM", + "is_active": 1, + "is_default": 1, + "item": "_Test FG Item", + "quantity": 1.0 + }, + { + "bom_materials": [ + { + "amount": 5000.0, + "doctype": "BOM Item", + "item_code": "_Test Item", + "parentfield": "bom_materials", + "qty": 1.0, + "rate": 5000.0, + "stock_uom": "_Test UOM" + }, + { + "amount": 2000.0, + "bom_no": "BOM/_Test Item Home Desktop Manufactured/001", + "doctype": "BOM Item", + "item_code": "_Test Item Home Desktop Manufactured", + "parentfield": "bom_materials", + "qty": 2.0, + "rate": 1000.0, + "stock_uom": "_Test UOM" + } + ], + "docstatus": 1, + "doctype": "BOM", + "is_active": 1, + "is_default": 1, + "item": "_Test FG Item 2", + "quantity": 1.0 + } +] \ No newline at end of file diff --git a/erpnext/manufacturing/doctype/production_order/test_records.json b/erpnext/manufacturing/doctype/production_order/test_records.json new file mode 100644 index 0000000000..d6afc065f1 --- /dev/null +++ b/erpnext/manufacturing/doctype/production_order/test_records.json @@ -0,0 +1,12 @@ +[ + { + "bom_no": "BOM/_Test FG Item/001", + "company": "_Test Company", + "doctype": "Production Order", + "fg_warehouse": "_Test Warehouse 1 - _TC", + "production_item": "_Test FG Item", + "qty": 10.0, + "stock_uom": "Nos", + "wip_warehouse": "_Test Warehouse - _TC" + } +] \ No newline at end of file diff --git a/erpnext/projects/doctype/activity_type/test_records.json b/erpnext/projects/doctype/activity_type/test_records.json new file mode 100644 index 0000000000..45fc1496fb --- /dev/null +++ b/erpnext/projects/doctype/activity_type/test_records.json @@ -0,0 +1,11 @@ +[ + { + "activity_type": "_Test Activity Type" + }, + { + "activity_type": "_Test Activity Type 1" + }, + { + "activity_type": "_Test Activity Type 2" + } +] \ No newline at end of file diff --git a/erpnext/projects/doctype/project/test_records.json b/erpnext/projects/doctype/project/test_records.json new file mode 100644 index 0000000000..69226f0cc9 --- /dev/null +++ b/erpnext/projects/doctype/project/test_records.json @@ -0,0 +1,10 @@ +[ + { + "project_name": "_Test Project", + "status": "Open" + }, + { + "project_name": "_Test Project 1", + "status": "Open" + } +] \ No newline at end of file diff --git a/erpnext/projects/doctype/task/test_records.json b/erpnext/projects/doctype/task/test_records.json new file mode 100644 index 0000000000..1f98172b70 --- /dev/null +++ b/erpnext/projects/doctype/task/test_records.json @@ -0,0 +1,15 @@ +[ + { + "project": "_Test Project", + "status": "Open", + "subject": "_Test Task" + }, + { + "status": "Open", + "subject": "_Test Task 1" + }, + { + "status": "Open", + "subject": "_Test Task 2" + } +] \ No newline at end of file diff --git a/erpnext/projects/doctype/time_log/test_records.json b/erpnext/projects/doctype/time_log/test_records.json new file mode 100644 index 0000000000..0ef276ecbe --- /dev/null +++ b/erpnext/projects/doctype/time_log/test_records.json @@ -0,0 +1,10 @@ +[ + { + "activity_type": "_Test Activity Type", + "docstatus": 1, + "doctype": "Time Log", + "from_time": "2013-01-01 10:00:00.000000", + "note": "_Test Note", + "to_time": "2013-01-01 11:00:00.000000" + } +] \ No newline at end of file diff --git a/erpnext/projects/doctype/time_log_batch/test_records.json b/erpnext/projects/doctype/time_log_batch/test_records.json new file mode 100644 index 0000000000..d386000e34 --- /dev/null +++ b/erpnext/projects/doctype/time_log_batch/test_records.json @@ -0,0 +1,14 @@ +[ + { + "doctype": "Time Log Batch", + "rate": "500", + "time_log_batch_details": [ + { + "doctype": "Time Log Batch Detail", + "parentfield": "time_log_batch_details", + "parenttype": "Time Log Batch", + "time_log": "_T-Time Log-00001" + } + ] + } +] \ No newline at end of file diff --git a/erpnext/selling/doctype/campaign/test_records.json b/erpnext/selling/doctype/campaign/test_records.json new file mode 100644 index 0000000000..625d3b377b --- /dev/null +++ b/erpnext/selling/doctype/campaign/test_records.json @@ -0,0 +1,10 @@ +[ + { + "campaign_name": "_Test Campaign", + "doctype": "Campaign" + }, + { + "campaign_name": "_Test Campaign 1", + "doctype": "Campaign" + } +] \ No newline at end of file diff --git a/erpnext/selling/doctype/customer/test_records.json b/erpnext/selling/doctype/customer/test_records.json new file mode 100644 index 0000000000..b4fb6e5944 --- /dev/null +++ b/erpnext/selling/doctype/customer/test_records.json @@ -0,0 +1,26 @@ +[ + { + "company": "_Test Company", + "customer_group": "_Test Customer Group", + "customer_name": "_Test Customer", + "customer_type": "Individual", + "doctype": "Customer", + "territory": "_Test Territory" + }, + { + "company": "_Test Company", + "customer_group": "_Test Customer Group", + "customer_name": "_Test Customer 1", + "customer_type": "Individual", + "doctype": "Customer", + "territory": "_Test Territory" + }, + { + "company": "_Test Company", + "customer_group": "_Test Customer Group", + "customer_name": "_Test Customer 2", + "customer_type": "Individual", + "doctype": "Customer", + "territory": "_Test Territory" + } +] \ No newline at end of file diff --git a/erpnext/selling/doctype/industry_type/test_records.json b/erpnext/selling/doctype/industry_type/test_records.json new file mode 100644 index 0000000000..2b593bb3ac --- /dev/null +++ b/erpnext/selling/doctype/industry_type/test_records.json @@ -0,0 +1,10 @@ +[ + { + "doctype": "Industry Type", + "industry": "_Test Industry" + }, + { + "doctype": "Industry Type", + "industry": "_Test Industry 1" + } +] \ No newline at end of file diff --git a/erpnext/selling/doctype/lead/test_records.json b/erpnext/selling/doctype/lead/test_records.json new file mode 100644 index 0000000000..89eeab7a9c --- /dev/null +++ b/erpnext/selling/doctype/lead/test_records.json @@ -0,0 +1,27 @@ +[ + { + "doctype": "Lead", + "email_id": "test_lead@example.com", + "lead_name": "_Test Lead", + "status": "Open", + "territory": "_Test Territory" + }, + { + "doctype": "Lead", + "email_id": "test_lead1@example.com", + "lead_name": "_Test Lead 1", + "status": "Open" + }, + { + "doctype": "Lead", + "email_id": "test_lead2@example.com", + "lead_name": "_Test Lead 2", + "status": "Contacted" + }, + { + "doctype": "Lead", + "email_id": "test_lead3@example.com", + "lead_name": "_Test Lead 3", + "status": "Converted" + } +] \ No newline at end of file diff --git a/erpnext/selling/doctype/quotation/test_records.json b/erpnext/selling/doctype/quotation/test_records.json new file mode 100644 index 0000000000..054144ebf4 --- /dev/null +++ b/erpnext/selling/doctype/quotation/test_records.json @@ -0,0 +1,34 @@ +[ + { + "company": "_Test Company", + "conversion_rate": 1.0, + "currency": "INR", + "customer": "_Test Customer", + "customer_group": "_Test Customer Group", + "customer_name": "_Test Customer", + "doctype": "Quotation", + "fiscal_year": "_Test Fiscal Year 2013", + "grand_total": 1000.0, + "grand_total_export": 1000.0, + "order_type": "Sales", + "plc_conversion_rate": 1.0, + "price_list_currency": "INR", + "quotation_details": [ + { + "base_amount": 1000.0, + "base_rate": 100.0, + "description": "CPU", + "doctype": "Quotation Item", + "item_code": "_Test Item Home Desktop 100", + "item_name": "CPU", + "parentfield": "quotation_details", + "qty": 10.0, + "rate": 100.0 + } + ], + "quotation_to": "Customer", + "selling_price_list": "_Test Price List", + "territory": "_Test Territory", + "transaction_date": "2013-02-21" + } +] \ No newline at end of file diff --git a/erpnext/selling/doctype/sales_bom/test_records.json b/erpnext/selling/doctype/sales_bom/test_records.json new file mode 100644 index 0000000000..beb8289f77 --- /dev/null +++ b/erpnext/selling/doctype/sales_bom/test_records.json @@ -0,0 +1,20 @@ +[ + { + "doctype": "Sales BOM", + "new_item_code": "_Test Sales BOM Item", + "sales_bom_items": [ + { + "doctype": "Sales BOM Item", + "item_code": "_Test Item", + "parentfield": "sales_bom_items", + "qty": 5.0 + }, + { + "doctype": "Sales BOM Item", + "item_code": "_Test Item Home Desktop 100", + "parentfield": "sales_bom_items", + "qty": 2.0 + } + ] + } +] \ No newline at end of file diff --git a/erpnext/selling/doctype/sales_order/test_records.json b/erpnext/selling/doctype/sales_order/test_records.json new file mode 100644 index 0000000000..88af30c1f9 --- /dev/null +++ b/erpnext/selling/doctype/sales_order/test_records.json @@ -0,0 +1,36 @@ +[ + { + "company": "_Test Company", + "conversion_rate": 1.0, + "currency": "INR", + "customer": "_Test Customer", + "customer_group": "_Test Customer Group", + "customer_name": "_Test Customer", + "delivery_date": "2013-02-23", + "doctype": "Sales Order", + "fiscal_year": "_Test Fiscal Year 2013", + "grand_total": 1000.0, + "grand_total_export": 1000.0, + "naming_series": "_T-Sales Order-", + "order_type": "Sales", + "plc_conversion_rate": 1.0, + "price_list_currency": "INR", + "sales_order_details": [ + { + "base_amount": 1000.0, + "base_rate": 100.0, + "description": "CPU", + "doctype": "Sales Order Item", + "item_code": "_Test Item Home Desktop 100", + "item_name": "CPU", + "parentfield": "sales_order_details", + "qty": 10.0, + "rate": 100.0, + "warehouse": "_Test Warehouse - _TC" + } + ], + "selling_price_list": "_Test Price List", + "territory": "_Test Territory", + "transaction_date": "2013-02-21" + } +] \ No newline at end of file diff --git a/erpnext/setup/doctype/brand/test_records.json b/erpnext/setup/doctype/brand/test_records.json new file mode 100644 index 0000000000..d2a4ad4e23 --- /dev/null +++ b/erpnext/setup/doctype/brand/test_records.json @@ -0,0 +1,6 @@ +[ + { + "brand": "_Test Brand", + "doctype": "Brand" + } +] \ No newline at end of file diff --git a/erpnext/setup/doctype/company/test_records.json b/erpnext/setup/doctype/company/test_records.json new file mode 100644 index 0000000000..ad6558558f --- /dev/null +++ b/erpnext/setup/doctype/company/test_records.json @@ -0,0 +1,16 @@ +[ + { + "abbr": "_TC", + "company_name": "_Test Company", + "default_currency": "INR", + "doctype": "Company", + "domain": "Manufacturing" + }, + { + "abbr": "_TC1", + "company_name": "_Test Company 1", + "default_currency": "USD", + "doctype": "Company", + "domain": "Retail" + } +] \ No newline at end of file diff --git a/erpnext/setup/doctype/country/test_records.json b/erpnext/setup/doctype/country/test_records.json new file mode 100644 index 0000000000..5a7c8a5568 --- /dev/null +++ b/erpnext/setup/doctype/country/test_records.json @@ -0,0 +1,6 @@ +[ + { + "country_name": "_Test Country", + "doctype": "Country" + } +] \ No newline at end of file diff --git a/erpnext/setup/doctype/currency/test_records.json b/erpnext/setup/doctype/currency/test_records.json new file mode 100644 index 0000000000..0637a088a0 --- /dev/null +++ b/erpnext/setup/doctype/currency/test_records.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/erpnext/setup/doctype/currency_exchange/test_records.json b/erpnext/setup/doctype/currency_exchange/test_records.json new file mode 100644 index 0000000000..784bf262c0 --- /dev/null +++ b/erpnext/setup/doctype/currency_exchange/test_records.json @@ -0,0 +1,20 @@ +[ + { + "doctype": "Currency Exchange", + "exchange_rate": 60.0, + "from_currency": "USD", + "to_currency": "INR" + }, + { + "doctype": "Currency Exchange", + "exchange_rate": 0.773, + "from_currency": "USD", + "to_currency": "EUR" + }, + { + "doctype": "Currency Exchange", + "exchange_rate": 0.0167, + "from_currency": "INR", + "to_currency": "USD" + } +] \ No newline at end of file diff --git a/erpnext/setup/doctype/customer_group/test_records.json b/erpnext/setup/doctype/customer_group/test_records.json new file mode 100644 index 0000000000..a2dfba07d8 --- /dev/null +++ b/erpnext/setup/doctype/customer_group/test_records.json @@ -0,0 +1,8 @@ +[ + { + "customer_group_name": "_Test Customer Group", + "doctype": "Customer Group", + "is_group": "No", + "parent_customer_group": "All Customer Groups" + } +] \ No newline at end of file diff --git a/erpnext/setup/doctype/item_group/test_records.json b/erpnext/setup/doctype/item_group/test_records.json new file mode 100644 index 0000000000..d85fa2266b --- /dev/null +++ b/erpnext/setup/doctype/item_group/test_records.json @@ -0,0 +1,68 @@ +[ + { + "doctype": "Item Group", + "is_group": "No", + "item_group_name": "_Test Item Group", + "parent_item_group": "All Item Groups" + }, + { + "doctype": "Item Group", + "is_group": "No", + "item_group_name": "_Test Item Group Desktops", + "parent_item_group": "All Item Groups" + }, + { + "doctype": "Item Group", + "is_group": "Yes", + "item_group_name": "_Test Item Group A", + "parent_item_group": "All Item Groups" + }, + { + "doctype": "Item Group", + "is_group": "Yes", + "item_group_name": "_Test Item Group B", + "parent_item_group": "All Item Groups" + }, + { + "doctype": "Item Group", + "is_group": "Yes", + "item_group_name": "_Test Item Group B - 1", + "parent_item_group": "_Test Item Group B" + }, + { + "doctype": "Item Group", + "is_group": "Yes", + "item_group_name": "_Test Item Group B - 2", + "parent_item_group": "_Test Item Group B" + }, + { + "doctype": "Item Group", + "is_group": "No", + "item_group_name": "_Test Item Group B - 3", + "parent_item_group": "_Test Item Group B" + }, + { + "doctype": "Item Group", + "is_group": "Yes", + "item_group_name": "_Test Item Group C", + "parent_item_group": "All Item Groups" + }, + { + "doctype": "Item Group", + "is_group": "Yes", + "item_group_name": "_Test Item Group C - 1", + "parent_item_group": "_Test Item Group C" + }, + { + "doctype": "Item Group", + "is_group": "Yes", + "item_group_name": "_Test Item Group C - 2", + "parent_item_group": "_Test Item Group C" + }, + { + "doctype": "Item Group", + "is_group": "Yes", + "item_group_name": "_Test Item Group D", + "parent_item_group": "All Item Groups" + } +] \ No newline at end of file diff --git a/erpnext/setup/doctype/print_heading/test_records.json b/erpnext/setup/doctype/print_heading/test_records.json new file mode 100644 index 0000000000..479c38ad98 --- /dev/null +++ b/erpnext/setup/doctype/print_heading/test_records.json @@ -0,0 +1,5 @@ +[ + { + "print_heading": "_Test Print Heading" + } +] \ No newline at end of file diff --git a/erpnext/setup/doctype/quotation_lost_reason/test_records.json b/erpnext/setup/doctype/quotation_lost_reason/test_records.json new file mode 100644 index 0000000000..29f04de008 --- /dev/null +++ b/erpnext/setup/doctype/quotation_lost_reason/test_records.json @@ -0,0 +1,6 @@ +[ + { + "doctype": "Quotation Lost Reason", + "order_lost_reason": "_Test Quotation Lost Reason" + } +] \ No newline at end of file diff --git a/erpnext/setup/doctype/sales_partner/test_records.json b/erpnext/setup/doctype/sales_partner/test_records.json new file mode 100644 index 0000000000..0637a088a0 --- /dev/null +++ b/erpnext/setup/doctype/sales_partner/test_records.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/erpnext/setup/doctype/sales_person/test_records.json b/erpnext/setup/doctype/sales_person/test_records.json new file mode 100644 index 0000000000..cd29d40b1a --- /dev/null +++ b/erpnext/setup/doctype/sales_person/test_records.json @@ -0,0 +1,23 @@ +[ + { + "doctype": "Sales Person", + "employee": "_T-Employee-0001", + "is_group": "No", + "parent_sales_person": "Sales Team", + "sales_person_name": "_Test Sales Person" + }, + { + "doctype": "Sales Person", + "employee": "_T-Employee-0002", + "is_group": "No", + "parent_sales_person": "Sales Team", + "sales_person_name": "_Test Sales Person 1" + }, + { + "doctype": "Sales Person", + "employee": "_T-Employee-0003", + "is_group": "No", + "parent_sales_person": "Sales Team", + "sales_person_name": "_Test Sales Person 2" + } +] \ No newline at end of file diff --git a/erpnext/setup/doctype/supplier_type/test_records.json b/erpnext/setup/doctype/supplier_type/test_records.json new file mode 100644 index 0000000000..a74c564551 --- /dev/null +++ b/erpnext/setup/doctype/supplier_type/test_records.json @@ -0,0 +1,6 @@ +[ + { + "doctype": "Supplier Type", + "supplier_type": "_Test Supplier Type" + } +] \ No newline at end of file diff --git a/erpnext/setup/doctype/terms_and_conditions/test_records.json b/erpnext/setup/doctype/terms_and_conditions/test_records.json new file mode 100644 index 0000000000..9ba107706c --- /dev/null +++ b/erpnext/setup/doctype/terms_and_conditions/test_records.json @@ -0,0 +1,6 @@ +[ + { + "terms": "_Test Terms", + "title": "_Test Terms and Conditions" + } +] \ No newline at end of file diff --git a/erpnext/setup/doctype/territory/test_records.json b/erpnext/setup/doctype/territory/test_records.json new file mode 100644 index 0000000000..251861942b --- /dev/null +++ b/erpnext/setup/doctype/territory/test_records.json @@ -0,0 +1,32 @@ +[ + { + "doctype": "Territory", + "is_group": "No", + "parent_territory": "All Territories", + "territory_name": "_Test Territory" + }, + { + "doctype": "Territory", + "is_group": "Yes", + "parent_territory": "All Territories", + "territory_name": "_Test Territory India" + }, + { + "doctype": "Territory", + "is_group": "No", + "parent_territory": "_Test Territory India", + "territory_name": "_Test Territory Maharashtra" + }, + { + "doctype": "Territory", + "is_group": "No", + "parent_territory": "All Territories", + "territory_name": "_Test Territory Rest Of The World" + }, + { + "doctype": "Territory", + "is_group": "No", + "parent_territory": "All Territories", + "territory_name": "_Test Territory United States" + } +] \ No newline at end of file diff --git a/erpnext/setup/doctype/uom/test_records.json b/erpnext/setup/doctype/uom/test_records.json new file mode 100644 index 0000000000..ddca542315 --- /dev/null +++ b/erpnext/setup/doctype/uom/test_records.json @@ -0,0 +1,11 @@ +[ + { + "doctype": "UOM", + "must_be_whole_number": 1, + "uom_name": "_Test UOM" + }, + { + "doctype": "UOM", + "uom_name": "_Test UOM 1" + } +] \ No newline at end of file diff --git a/erpnext/stock/doctype/delivery_note/test_records.json b/erpnext/stock/doctype/delivery_note/test_records.json new file mode 100644 index 0000000000..3127a08008 --- /dev/null +++ b/erpnext/stock/doctype/delivery_note/test_records.json @@ -0,0 +1,39 @@ +[ + { + "company": "_Test Company", + "conversion_rate": 1.0, + "currency": "INR", + "customer": "_Test Customer", + "customer_name": "_Test Customer", + "delivery_note_details": [ + { + "base_amount": 500.0, + "base_rate": 100.0, + "cost_center": "Main - _TC", + "description": "CPU", + "doctype": "Delivery Note Item", + "expense_account": "Cost of Goods Sold - _TC", + "item_code": "_Test Item", + "item_name": "_Test Item", + "parentfield": "delivery_note_details", + "qty": 5.0, + "rate": 100.0, + "stock_uom": "_Test UOM", + "warehouse": "_Test Warehouse - _TC" + } + ], + "doctype": "Delivery Note", + "fiscal_year": "_Test Fiscal Year 2013", + "grand_total": 500.0, + "grand_total_export": 500.0, + "naming_series": "_T-Delivery Note-", + "net_total": 500.0, + "plc_conversion_rate": 1.0, + "posting_date": "2013-02-21", + "posting_time": "9:00:00", + "price_list_currency": "INR", + "selling_price_list": "_Test Price List", + "status": "Draft", + "territory": "_Test Territory" + } +] \ No newline at end of file diff --git a/erpnext/stock/doctype/item/test_records.json b/erpnext/stock/doctype/item/test_records.json new file mode 100644 index 0000000000..bc407e0c59 --- /dev/null +++ b/erpnext/stock/doctype/item/test_records.json @@ -0,0 +1,248 @@ +[ + { + "default_warehouse": "_Test Warehouse - _TC", + "description": "_Test Item", + "doctype": "Item", + "expense_account": "_Test Account Cost for Goods Sold - _TC", + "has_batch_no": "No", + "has_serial_no": "No", + "income_account": "Sales - _TC", + "inspection_required": "No", + "is_asset_item": "No", + "is_pro_applicable": "Yes", + "is_purchase_item": "Yes", + "is_sales_item": "Yes", + "is_service_item": "No", + "is_stock_item": "Yes", + "is_sub_contracted_item": "No", + "item_code": "_Test Item", + "item_group": "_Test Item Group", + "item_name": "_Test Item", + "item_reorder": [ + { + "doctype": "Item Reorder", + "material_request_type": "Purchase", + "parentfield": "item_reorder", + "warehouse": "_Test Warehouse - _TC", + "warehouse_reorder_level": 20, + "warehouse_reorder_qty": 20 + } + ], + "selling_cost_center": "_Test Cost Center - _TC", + "stock_uom": "_Test UOM" + }, + { + "default_warehouse": "_Test Warehouse - _TC", + "description": "_Test Item 2", + "doctype": "Item", + "expense_account": "_Test Account Cost for Goods Sold - _TC", + "has_batch_no": "No", + "has_serial_no": "No", + "income_account": "Sales - _TC", + "inspection_required": "No", + "is_asset_item": "No", + "is_pro_applicable": "Yes", + "is_purchase_item": "Yes", + "is_sales_item": "Yes", + "is_service_item": "No", + "is_stock_item": "Yes", + "is_sub_contracted_item": "No", + "item_code": "_Test Item 2", + "item_group": "_Test Item Group", + "item_name": "_Test Item 2", + "stock_uom": "_Test UOM" + }, + { + "default_warehouse": "_Test Warehouse - _TC", + "description": "_Test Item Home Desktop 100", + "doctype": "Item", + "expense_account": "_Test Account Cost for Goods Sold - _TC", + "has_batch_no": "No", + "has_serial_no": "No", + "income_account": "Sales - _TC", + "inspection_required": "No", + "is_asset_item": "No", + "is_manufactured_item": "No", + "is_pro_applicable": "No", + "is_purchase_item": "Yes", + "is_sales_item": "Yes", + "is_service_item": "No", + "is_stock_item": "Yes", + "is_sub_contracted_item": "No", + "item_code": "_Test Item Home Desktop 100", + "item_group": "_Test Item Group Desktops", + "item_name": "_Test Item Home Desktop 100", + "item_tax": [ + { + "doctype": "Item Tax", + "parentfield": "item_tax", + "tax_rate": 10, + "tax_type": "_Test Account Excise Duty - _TC" + } + ], + "stock_uom": "_Test UOM" + }, + { + "default_warehouse": "_Test Warehouse - _TC", + "description": "_Test Item Home Desktop 200", + "doctype": "Item", + "expense_account": "_Test Account Cost for Goods Sold - _TC", + "has_batch_no": "No", + "has_serial_no": "No", + "income_account": "Sales - _TC", + "inspection_required": "No", + "is_asset_item": "No", + "is_manufactured_item": "No", + "is_pro_applicable": "No", + "is_purchase_item": "Yes", + "is_sales_item": "Yes", + "is_service_item": "No", + "is_stock_item": "Yes", + "is_sub_contracted_item": "No", + "item_code": "_Test Item Home Desktop 200", + "item_group": "_Test Item Group Desktops", + "item_name": "_Test Item Home Desktop 200", + "stock_uom": "_Test UOM" + }, + { + "description": "_Test Sales BOM Item", + "doctype": "Item", + "expense_account": "_Test Account Cost for Goods Sold - _TC", + "has_batch_no": "No", + "has_serial_no": "No", + "income_account": "Sales - _TC", + "inspection_required": "No", + "is_asset_item": "No", + "is_pro_applicable": "No", + "is_purchase_item": "Yes", + "is_sales_item": "Yes", + "is_service_item": "No", + "is_stock_item": "No", + "is_sub_contracted_item": "No", + "item_code": "_Test Sales BOM Item", + "item_group": "_Test Item Group Desktops", + "item_name": "_Test Sales BOM Item", + "stock_uom": "_Test UOM" + }, + { + "default_warehouse": "_Test Warehouse - _TC", + "description": "_Test FG Item", + "doctype": "Item", + "expense_account": "_Test Account Cost for Goods Sold - _TC", + "has_batch_no": "No", + "has_serial_no": "No", + "income_account": "Sales - _TC", + "inspection_required": "No", + "is_asset_item": "No", + "is_pro_applicable": "Yes", + "is_purchase_item": "Yes", + "is_sales_item": "Yes", + "is_service_item": "No", + "is_stock_item": "Yes", + "is_sub_contracted_item": "Yes", + "item_code": "_Test FG Item", + "item_group": "_Test Item Group Desktops", + "item_name": "_Test FG Item", + "stock_uom": "_Test UOM" + }, + { + "description": "_Test Non Stock Item", + "doctype": "Item", + "has_batch_no": "No", + "has_serial_no": "No", + "inspection_required": "No", + "is_asset_item": "No", + "is_pro_applicable": "No", + "is_purchase_item": "Yes", + "is_sales_item": "Yes", + "is_service_item": "No", + "is_stock_item": "No", + "is_sub_contracted_item": "No", + "item_code": "_Test Non Stock Item", + "item_group": "_Test Item Group Desktops", + "item_name": "_Test Non Stock Item", + "stock_uom": "_Test UOM" + }, + { + "default_warehouse": "_Test Warehouse - _TC", + "description": "_Test Serialized Item", + "doctype": "Item", + "has_batch_no": "No", + "has_serial_no": "Yes", + "inspection_required": "No", + "is_asset_item": "No", + "is_pro_applicable": "No", + "is_purchase_item": "Yes", + "is_sales_item": "Yes", + "is_service_item": "No", + "is_stock_item": "Yes", + "is_sub_contracted_item": "No", + "item_code": "_Test Serialized Item", + "item_group": "_Test Item Group Desktops", + "item_name": "_Test Serialized Item", + "stock_uom": "_Test UOM" + }, + { + "default_warehouse": "_Test Warehouse - _TC", + "description": "_Test Serialized Item", + "doctype": "Item", + "has_batch_no": "No", + "has_serial_no": "Yes", + "inspection_required": "No", + "is_asset_item": "No", + "is_pro_applicable": "Yes", + "is_purchase_item": "Yes", + "is_sales_item": "Yes", + "is_service_item": "No", + "is_stock_item": "Yes", + "is_sub_contracted_item": "No", + "item_code": "_Test Serialized Item With Series", + "item_group": "_Test Item Group Desktops", + "item_name": "_Test Serialized Item With Series", + "serial_no_series": "ABCD.#####", + "stock_uom": "_Test UOM" + }, + { + "default_warehouse": "_Test Warehouse - _TC", + "description": "_Test Item Home Desktop Manufactured", + "doctype": "Item", + "expense_account": "_Test Account Cost for Goods Sold - _TC", + "has_batch_no": "No", + "has_serial_no": "No", + "income_account": "Sales - _TC", + "inspection_required": "No", + "is_asset_item": "No", + "is_manufactured_item": "Yes", + "is_pro_applicable": "Yes", + "is_purchase_item": "Yes", + "is_sales_item": "Yes", + "is_service_item": "No", + "is_stock_item": "Yes", + "is_sub_contracted_item": "No", + "item_code": "_Test Item Home Desktop Manufactured", + "item_group": "_Test Item Group Desktops", + "item_name": "_Test Item Home Desktop Manufactured", + "stock_uom": "_Test UOM" + }, + { + "default_warehouse": "_Test Warehouse - _TC", + "description": "_Test FG Item 2", + "doctype": "Item", + "expense_account": "_Test Account Cost for Goods Sold - _TC", + "has_batch_no": "No", + "has_serial_no": "No", + "income_account": "Sales - _TC", + "inspection_required": "No", + "is_asset_item": "No", + "is_pro_applicable": "Yes", + "is_purchase_item": "Yes", + "is_sales_item": "Yes", + "is_service_item": "No", + "is_stock_item": "Yes", + "is_sub_contracted_item": "Yes", + "item_code": "_Test FG Item 2", + "item_group": "_Test Item Group Desktops", + "item_name": "_Test FG Item 2", + "stock_uom": "_Test UOM" + } +] \ No newline at end of file diff --git a/erpnext/stock/doctype/item_price/test_records.json b/erpnext/stock/doctype/item_price/test_records.json new file mode 100644 index 0000000000..72d5582c65 --- /dev/null +++ b/erpnext/stock/doctype/item_price/test_records.json @@ -0,0 +1,8 @@ +[ + { + "doctype": "Item Price", + "item_code": "_Test Item", + "price_list": "_Test Price List", + "price_list_rate": 100 + } +] \ No newline at end of file diff --git a/erpnext/stock/doctype/material_request/test_records.json b/erpnext/stock/doctype/material_request/test_records.json new file mode 100644 index 0000000000..0337ac273d --- /dev/null +++ b/erpnext/stock/doctype/material_request/test_records.json @@ -0,0 +1,34 @@ +[ + { + "company": "_Test Company", + "doctype": "Material Request", + "fiscal_year": "_Test Fiscal Year 2013", + "indent_details": [ + { + "description": "_Test Item Home Desktop 100", + "doctype": "Material Request Item", + "item_code": "_Test Item Home Desktop 100", + "item_name": "_Test Item Home Desktop 100", + "parentfield": "indent_details", + "qty": 54.0, + "schedule_date": "2013-02-18", + "uom": "_Test UOM 1", + "warehouse": "_Test Warehouse - _TC" + }, + { + "description": "_Test Item Home Desktop 200", + "doctype": "Material Request Item", + "item_code": "_Test Item Home Desktop 200", + "item_name": "_Test Item Home Desktop 200", + "parentfield": "indent_details", + "qty": 3.0, + "schedule_date": "2013-02-19", + "uom": "_Test UOM 1", + "warehouse": "_Test Warehouse - _TC" + } + ], + "material_request_type": "Purchase", + "naming_series": "_T-Material Request-", + "transaction_date": "2013-02-18" + } +] \ No newline at end of file diff --git a/erpnext/stock/doctype/price_list/test_records.json b/erpnext/stock/doctype/price_list/test_records.json new file mode 100644 index 0000000000..86d650cb2a --- /dev/null +++ b/erpnext/stock/doctype/price_list/test_records.json @@ -0,0 +1,67 @@ +[ + { + "buying": 1, + "currency": "INR", + "doctype": "Price List", + "enabled": 1, + "price_list_name": "_Test Price List", + "selling": 1, + "valid_for_territories": [ + { + "doctype": "Applicable Territory", + "parentfield": "valid_for_territories", + "territory": "All Territories" + } + ] + }, + { + "buying": 1, + "currency": "INR", + "doctype": "Price List", + "enabled": 1, + "price_list_name": "_Test Price List 2", + "selling": 1, + "valid_for_territories": [ + { + "doctype": "Applicable Territory", + "parentfield": "valid_for_territories", + "territory": "_Test Territory Rest Of The World" + } + ] + }, + { + "buying": 1, + "currency": "INR", + "doctype": "Price List", + "enabled": 1, + "price_list_name": "_Test Price List India", + "selling": 1, + "valid_for_territories": [ + { + "doctype": "Applicable Territory", + "parentfield": "valid_for_territories", + "territory": "_Test Territory India" + } + ] + }, + { + "buying": 1, + "currency": "USD", + "doctype": "Price List", + "enabled": 1, + "price_list_name": "_Test Price List Rest of the World", + "selling": 1, + "valid_for_territories": [ + { + "doctype": "Applicable Territory", + "parentfield": "valid_for_territories", + "territory": "_Test Territory Rest Of The World" + }, + { + "doctype": "Applicable Territory", + "parentfield": "valid_for_territories", + "territory": "_Test Territory United States" + } + ] + } +] \ No newline at end of file diff --git a/erpnext/stock/doctype/purchase_receipt/test_records.json b/erpnext/stock/doctype/purchase_receipt/test_records.json new file mode 100644 index 0000000000..7dd4f7f739 --- /dev/null +++ b/erpnext/stock/doctype/purchase_receipt/test_records.json @@ -0,0 +1,118 @@ +[ + { + "buying_price_list": "_Test Price List", + "company": "_Test Company", + "conversion_rate": 1.0, + "currency": "INR", + "doctype": "Purchase Receipt", + "fiscal_year": "_Test Fiscal Year 2013", + "grand_total": 720.0, + "naming_series": "_T-Purchase Receipt-", + "net_total": 500.0, + "other_charges": [ + { + "account_head": "_Test Account Shipping Charges - _TC", + "add_deduct_tax": "Add", + "category": "Valuation and Total", + "charge_type": "Actual", + "description": "Shipping Charges", + "doctype": "Purchase Taxes and Charges", + "parentfield": "other_charges", + "rate": 100.0, + "tax_amount": 100.0 + }, + { + "account_head": "_Test Account VAT - _TC", + "add_deduct_tax": "Add", + "category": "Total", + "charge_type": "Actual", + "description": "VAT", + "doctype": "Purchase Taxes and Charges", + "parentfield": "other_charges", + "rate": 120.0, + "tax_amount": 120.0 + }, + { + "account_head": "_Test Account Customs Duty - _TC", + "add_deduct_tax": "Add", + "category": "Valuation", + "charge_type": "Actual", + "description": "Customs Duty", + "doctype": "Purchase Taxes and Charges", + "parentfield": "other_charges", + "rate": 150.0, + "tax_amount": 150.0 + } + ], + "posting_date": "2013-02-12", + "posting_time": "15:33:30", + "purchase_receipt_details": [ + { + "base_amount": 250.0, + "conversion_factor": 1.0, + "description": "_Test Item", + "doctype": "Purchase Receipt Item", + "item_code": "_Test Item", + "item_name": "_Test Item", + "parentfield": "purchase_receipt_details", + "qty": 5.0, + "rate": 50.0, + "received_qty": 5.0, + "rejected_qty": 0.0, + "stock_uom": "Nos", + "uom": "_Test UOM", + "warehouse": "_Test Warehouse - _TC" + }, + { + "base_amount": 250.0, + "conversion_factor": 1.0, + "description": "_Test Item", + "doctype": "Purchase Receipt Item", + "item_code": "_Test Item", + "item_name": "_Test Item", + "parentfield": "purchase_receipt_details", + "qty": 5.0, + "rate": 50.0, + "received_qty": 5.0, + "rejected_qty": 0.0, + "stock_uom": "Nos", + "uom": "_Test UOM", + "warehouse": "_Test Warehouse 1 - _TC" + } + ], + "supplier": "_Test Supplier" + }, + { + "buying_price_list": "_Test Price List", + "company": "_Test Company", + "conversion_rate": 1.0, + "currency": "INR", + "doctype": "Purchase Receipt", + "fiscal_year": "_Test Fiscal Year 2013", + "grand_total": 5000.0, + "is_subcontracted": "Yes", + "net_total": 5000.0, + "posting_date": "2013-02-12", + "posting_time": "15:33:30", + "purchase_receipt_details": [ + { + "base_amount": 5000.0, + "conversion_factor": 1.0, + "description": "_Test FG Item", + "doctype": "Purchase Receipt Item", + "item_code": "_Test FG Item", + "item_name": "_Test FG Item", + "parentfield": "purchase_receipt_details", + "qty": 10.0, + "rate": 500.0, + "received_qty": 10.0, + "rejected_qty": 0.0, + "stock_uom": "Nos", + "uom": "_Test UOM", + "warehouse": "_Test Warehouse - _TC" + } + ], + "supplier": "_Test Supplier", + "supplier_warehouse": "_Test Warehouse - _TC" + } +] \ No newline at end of file diff --git a/erpnext/stock/doctype/serial_no/test_records.json b/erpnext/stock/doctype/serial_no/test_records.json new file mode 100644 index 0000000000..0637a088a0 --- /dev/null +++ b/erpnext/stock/doctype/serial_no/test_records.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/erpnext/stock/doctype/stock_entry/test_records.json b/erpnext/stock/doctype/stock_entry/test_records.json new file mode 100644 index 0000000000..a87b635bd7 --- /dev/null +++ b/erpnext/stock/doctype/stock_entry/test_records.json @@ -0,0 +1,113 @@ +[ + { + "company": "_Test Company", + "doctype": "Stock Entry", + "fiscal_year": "_Test Fiscal Year 2013", + "mtn_details": [ + { + "conversion_factor": 1.0, + "cost_center": "_Test Cost Center - _TC", + "doctype": "Stock Entry Detail", + "expense_account": "Stock Adjustment - _TC", + "incoming_rate": 100, + "item_code": "_Test Item", + "parentfield": "mtn_details", + "qty": 50.0, + "stock_uom": "_Test UOM", + "t_warehouse": "_Test Warehouse - _TC", + "transfer_qty": 50.0, + "uom": "_Test UOM" + } + ], + "posting_date": "2013-01-01", + "posting_time": "17:14:24", + "purpose": "Material Receipt" + }, + { + "company": "_Test Company", + "doctype": "Stock Entry", + "fiscal_year": "_Test Fiscal Year 2013", + "mtn_details": [ + { + "conversion_factor": 1.0, + "cost_center": "_Test Cost Center - _TC", + "doctype": "Stock Entry Detail", + "expense_account": "Stock Adjustment - _TC", + "incoming_rate": 100, + "item_code": "_Test Item", + "parentfield": "mtn_details", + "qty": 40.0, + "s_warehouse": "_Test Warehouse - _TC", + "stock_uom": "_Test UOM", + "transfer_qty": 40.0, + "uom": "_Test UOM" + } + ], + "posting_date": "2013-01-25", + "posting_time": "17:15", + "purpose": "Material Issue" + }, + { + "company": "_Test Company", + "doctype": "Stock Entry", + "fiscal_year": "_Test Fiscal Year 2013", + "mtn_details": [ + { + "conversion_factor": 1.0, + "cost_center": "_Test Cost Center - _TC", + "doctype": "Stock Entry Detail", + "expense_account": "Stock Adjustment - _TC", + "incoming_rate": 100, + "item_code": "_Test Item", + "parentfield": "mtn_details", + "qty": 45.0, + "s_warehouse": "_Test Warehouse - _TC", + "stock_uom": "_Test UOM", + "t_warehouse": "_Test Warehouse 1 - _TC", + "transfer_qty": 45.0, + "uom": "_Test UOM" + } + ], + "posting_date": "2013-01-25", + "posting_time": "17:14:24", + "purpose": "Material Transfer" + }, + { + "company": "_Test Company", + "doctype": "Stock Entry", + "fiscal_year": "_Test Fiscal Year 2013", + "mtn_details": [ + { + "conversion_factor": 1.0, + "cost_center": "_Test Cost Center - _TC", + "doctype": "Stock Entry Detail", + "expense_account": "Stock Adjustment - _TC", + "incoming_rate": 100, + "item_code": "_Test Item", + "parentfield": "mtn_details", + "qty": 50.0, + "s_warehouse": "_Test Warehouse - _TC", + "stock_uom": "_Test UOM", + "transfer_qty": 50.0, + "uom": "_Test UOM" + }, + { + "conversion_factor": 1.0, + "cost_center": "_Test Cost Center - _TC", + "doctype": "Stock Entry Detail", + "expense_account": "Stock Adjustment - _TC", + "incoming_rate": 5000, + "item_code": "_Test Item Home Desktop 100", + "parentfield": "mtn_details", + "qty": 1, + "stock_uom": "_Test UOM", + "t_warehouse": "_Test Warehouse - _TC", + "transfer_qty": 1, + "uom": "_Test UOM" + } + ], + "posting_date": "2013-01-25", + "posting_time": "17:14:24", + "purpose": "Manufacture/Repack" + } +] \ No newline at end of file diff --git a/erpnext/stock/doctype/warehouse/test_records.json b/erpnext/stock/doctype/warehouse/test_records.json new file mode 100644 index 0000000000..05d30d6eab --- /dev/null +++ b/erpnext/stock/doctype/warehouse/test_records.json @@ -0,0 +1,25 @@ +[ + { + "company": "_Test Company", + "create_account_under": "Stock Assets - _TC", + "doctype": "Warehouse", + "warehouse_name": "_Test Warehouse" + }, + { + "company": "_Test Company", + "create_account_under": "Fixed Assets - _TC", + "doctype": "Warehouse", + "warehouse_name": "_Test Warehouse 1" + }, + { + "company": "_Test Company 1", + "create_account_under": "Stock Assets - _TC", + "doctype": "Warehouse", + "warehouse_name": "_Test Warehouse 2" + }, + { + "company": "_Test Company", + "doctype": "Warehouse", + "warehouse_name": "_Test Warehouse No Account" + } +] \ No newline at end of file diff --git a/erpnext/support/doctype/newsletter/test_records.json b/erpnext/support/doctype/newsletter/test_records.json new file mode 100644 index 0000000000..cceabca355 --- /dev/null +++ b/erpnext/support/doctype/newsletter/test_records.json @@ -0,0 +1,26 @@ +[ + { + "doctype": "Newsletter", + "lead_source": "All", + "message": "This is a test newsletter", + "send_from": "admin@example.com", + "send_to_type": "Lead", + "subject": "_Test Newsletter to Lead" + }, + { + "contact_type": "Customer", + "doctype": "Newsletter", + "message": "This is a test newsletter", + "send_from": "admin@example.com", + "send_to_type": "Contact", + "subject": "_Test Newsletter to Contact" + }, + { + "doctype": "Newsletter", + "email_list": "test_custom@example.com, test_custom1@example.com, test_custom2@example.com", + "message": "This is a test newsletter", + "send_from": "admin@example.com", + "send_to_type": "Custom", + "subject": "_Test Newsletter to Custom" + } +] \ No newline at end of file diff --git a/erpnext/utilities/doctype/address/test_records.json b/erpnext/utilities/doctype/address/test_records.json new file mode 100644 index 0000000000..41a6abcd09 --- /dev/null +++ b/erpnext/utilities/doctype/address/test_records.json @@ -0,0 +1,14 @@ +[ + { + "address_line1": "_Test Address Line 1", + "address_title": "_Test Address", + "address_type": "Office", + "city": "_Test City", + "country": "India", + "customer": "_Test Customer", + "customer_name": "_Test Customer", + "doctype": "Address", + "is_primary_address": 1, + "phone": "+91 0000000000" + } +] \ No newline at end of file diff --git a/erpnext/utilities/doctype/contact/test_records.json b/erpnext/utilities/doctype/contact/test_records.json new file mode 100644 index 0000000000..133a7b6883 --- /dev/null +++ b/erpnext/utilities/doctype/contact/test_records.json @@ -0,0 +1,22 @@ +[ + { + "customer": "_Test Customer", + "customer_name": "_Test Customer", + "doctype": "Contact", + "email_id": "test_contact_customer@example.com", + "first_name": "_Test Contact For _Test Customer", + "is_primary_contact": 1, + "phone": "+91 0000000000", + "status": "Open" + }, + { + "doctype": "Contact", + "email_id": "test_contact_supplier@example.com", + "first_name": "_Test Contact For _Test Supplier", + "is_primary_contact": 1, + "phone": "+91 0000000000", + "status": "Open", + "supplier": "_Test Supplier", + "supplier_name": "_Test Supplier" + } +] \ No newline at end of file From f2227d033c874878fd5f5edeec08a55050ef5f3e Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Mon, 31 Mar 2014 23:37:40 +0530 Subject: [PATCH 14/42] frappe/frappe#478, removed instances of .fields --- MANIFEST.in | 2 -- .../journal_voucher/journal_voucher.py | 4 ++-- .../doctype/sales_invoice/sales_invoice.py | 4 ++-- .../sales_invoice/test_sales_invoice.py | 2 +- .../purchase_common/purchase_common.py | 8 ++++---- .../doctype/purchase_order/purchase_order.py | 6 +++--- .../supplier_quotation/supplier_quotation.py | 2 +- erpnext/controllers/accounts_controller.py | 20 +++++++++---------- erpnext/controllers/buying_controller.py | 4 ++-- erpnext/controllers/selling_controller.py | 4 ++-- erpnext/controllers/status_updater.py | 4 ++-- erpnext/controllers/stock_controller.py | 4 ++-- .../doctype/salary_manager/salary_manager.py | 2 +- .../salary_structure/salary_structure.py | 2 +- .../production_order/production_order.py | 2 +- .../doctype/time_log_batch/time_log_batch.py | 2 +- erpnext/selling/doctype/lead/lead.py | 2 +- .../doctype/opportunity/opportunity.py | 2 +- .../selling/doctype/quotation/quotation.py | 2 +- .../doctype/sales_order/sales_order.py | 8 ++++---- .../doctype/features_setup/features_setup.py | 2 +- erpnext/startup/boot.py | 2 +- erpnext/stock/doctype/bin/bin.py | 2 +- .../doctype/delivery_note/delivery_note.py | 4 ++-- erpnext/stock/doctype/item/item.py | 2 +- .../material_request/material_request.py | 8 ++++---- .../stock/doctype/price_list/price_list.py | 2 +- .../purchase_receipt/purchase_receipt.py | 4 ++-- .../doctype/customer_issue/customer_issue.py | 2 +- .../maintenance_schedule.py | 2 +- erpnext/utilities/doctype/address/address.py | 4 ++-- erpnext/utilities/transaction_base.py | 4 ++-- 32 files changed, 61 insertions(+), 63 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 7bf6b4dc44..1414d502cc 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,7 +3,6 @@ include requirements.txt include *.json include *.md include *.py -include *.txt recursive-include erpnext *.css recursive-include erpnext *.csv recursive-include erpnext *.html @@ -14,5 +13,4 @@ recursive-include erpnext *.md recursive-include erpnext *.png recursive-include erpnext *.py recursive-include erpnext *.svg -recursive-include erpnext *.txt recursive-exclude * *.pyc \ No newline at end of file diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher.py b/erpnext/accounts/doctype/journal_voucher/journal_voucher.py index cbb8fd95a9..a2fbec1da8 100644 --- a/erpnext/accounts/doctype/journal_voucher/journal_voucher.py +++ b/erpnext/accounts/doctype/journal_voucher/journal_voucher.py @@ -360,7 +360,7 @@ def get_payment_entry_from_sales_invoice(sales_invoice): # debit bank jv.doclist[2].debit = si.outstanding_amount - return [d.fields for d in jv.doclist] + return jv.as_dict() @frappe.whitelist() def get_payment_entry_from_purchase_invoice(purchase_invoice): @@ -378,7 +378,7 @@ def get_payment_entry_from_purchase_invoice(purchase_invoice): # credit bank jv.doclist[2].credit = pi.outstanding_amount - return [d.fields for d in jv.doclist] + return jv.as_dict() def get_payment_entry(doc): bank_account = get_default_bank_cash_account(doc.company, "Bank Voucher") diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index d55d3a5676..b3e9a11e87 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -326,7 +326,7 @@ class SalesInvoice(SellingController): if frappe.db.get_value('Selling Settings', None, dic[i]) == 'Yes': for d in self.get('entries'): if frappe.db.get_value('Item', d.item_code, 'is_stock_item') == 'Yes' \ - and not d.fields[i.lower().replace(' ','_')]: + and not d.get(i.lower().replace(' ','_')): msgprint("%s is mandatory for stock item which is not mentioed against item: %s"%(i,d.item_code), raise_exception=1) @@ -836,4 +836,4 @@ def make_delivery_note(source_name, target_doc=None): } }, target_doc, set_missing_values) - return [d.fields for d in doclist] \ No newline at end of file + return doclist.as_dict() \ No newline at end of file diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index 4e366b3e5f..7879dcb93d 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -32,7 +32,7 @@ class TestSalesInvoice(unittest.TestCase): w.docstatus = '0' w.insert() - w2 = frappe.get_doc([d.fields.copy() for d in w.doclist]) + w2 = frappe.copy_doc(w) import time time.sleep(1) diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.py b/erpnext/buying/doctype/purchase_common/purchase_common.py index ec8c281eea..a57114446c 100644 --- a/erpnext/buying/doctype/purchase_common/purchase_common.py +++ b/erpnext/buying/doctype/purchase_common/purchase_common.py @@ -82,7 +82,7 @@ class PurchaseCommon(BuyingController): if d.doctype == 'Purchase Receipt Item': f_lst.pop('received_qty') for x in f_lst : - if d.fields.has_key(x): + if d.meta.has_field(x): d.set(x, f_lst[x]) item = frappe.db.sql("""select is_stock_item, is_purchase_item, @@ -103,9 +103,9 @@ class PurchaseCommon(BuyingController): # list criteria that should not repeat if item is stock item e = [d.schedule_date, d.item_code, d.description, d.warehouse, d.uom, - d.fields.has_key('prevdoc_docname') and d.prevdoc_docname or d.fields.has_key('sales_order_no') and d.sales_order_no or '', - d.fields.has_key('prevdoc_detail_docname') and d.prevdoc_detail_docname or '', - d.fields.has_key('batch_no') and d.batch_no or ''] + d.meta.has_field('prevdoc_docname') and d.prevdoc_docname or d.meta.has_field('sales_order_no') and d.sales_order_no or '', + d.meta.has_field('prevdoc_detail_docname') and d.prevdoc_detail_docname or '', + d.meta.has_field('batch_no') and d.batch_no or ''] # if is not stock item f = [d.schedule_date, d.item_code, d.description] diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index b8504977f6..ca68e2b515 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -73,7 +73,7 @@ class PurchaseOrder(BuyingController): def check_for_stopped_status(self, pc_obj): check_list =[] for d in self.get('po_details'): - if d.fields.has_key('prevdoc_docname') and d.prevdoc_docname and d.prevdoc_docname not in check_list: + if d.meta.has_field('prevdoc_docname') and d.prevdoc_docname and d.prevdoc_docname not in check_list: check_list.append(d.prevdoc_docname) pc_obj.check_for_stopped_status( d.prevdoc_doctype, d.prevdoc_docname) @@ -216,7 +216,7 @@ def make_purchase_receipt(source_name, target_doc=None): } }, target_doc, set_missing_values) - return [d.fields for d in doclist] + return doclist.as_dict() @frappe.whitelist() def make_purchase_invoice(source_name, target_doc=None): @@ -254,4 +254,4 @@ def make_purchase_invoice(source_name, target_doc=None): } }, target_doc, set_missing_values) - return [d.fields for d in doclist] \ No newline at end of file + return doclist.as_dict() \ No newline at end of file diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py index 004954f2bc..dbca9b5500 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py @@ -88,4 +88,4 @@ def make_purchase_order(source_name, target_doc=None): }, }, target_doc, set_missing_values) - return [d.fields for d in doclist] \ No newline at end of file + return doclist.as_dict() \ No newline at end of file diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 2d54b74d07..777150e7b3 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -26,7 +26,7 @@ class AccountsController(TransactionBase): if not self.get(fieldname) and self.meta.get_field(fieldname): self.set(fieldname, today()) if not self.fiscal_year: - self.fiscal_year = get_fiscal_year(self.fields[fieldname])[0] + self.fiscal_year = get_fiscal_year(self.get(fieldname))[0] def validate_date_with_fiscal_year(self): if self.meta.get_field("fiscal_year") : @@ -36,15 +36,15 @@ class AccountsController(TransactionBase): elif self.meta.get_field("transaction_date"): date_field = "transaction_date" - if date_field and self.fields[date_field]: - validate_fiscal_year(self.fields[date_field], self.fiscal_year, + if date_field and self.get(date_field): + validate_fiscal_year(self.get(date_field), self.fiscal_year, label=self.meta.get_label(date_field)) def validate_for_freezed_account(self): for fieldname in ["customer", "supplier"]: if self.meta.get_field(fieldname) and self.get(fieldname): accounts = frappe.db.get_values("Account", - {"master_type": fieldname.title(), "master_name": self.fields[fieldname], + {"master_type": fieldname.title(), "master_name": self.get(fieldname), "company": self.company}, "name") if accounts: from erpnext.accounts.doctype.gl_entry.gl_entry import validate_frozen_account @@ -347,13 +347,13 @@ class AccountsController(TransactionBase): "tax_fraction_for_current_item", "grand_total_fraction_for_current_item"): if fieldname in tax.fields: - del tax.fields[fieldname] + del tax.get(fieldname) tax.item_wise_tax_detail = json.dumps(tax.item_wise_tax_detail) def _set_in_company_currency(self, item, print_field, base_field): """set values in base currency""" - item.set(base_field, flt((flt(item.fields[print_field],) + item.set(base_field, flt((flt(item.get(print_field),) self.precision(print_field, item)) * self.conversion_rate), self.precision(base_field, item)) @@ -419,7 +419,7 @@ class AccountsController(TransactionBase): for item in self.get("entries"): if item.get(item_ref_dn): ref_amt = flt(frappe.db.get_value(ref_dt + " Item", - item.fields[item_ref_dn], based_on), self.precision(based_on, item)) + item.get(item_ref_dn), based_on), self.precision(based_on, item)) if not ref_amt: frappe.msgprint(_("As amount for item") + ": " + item.item_code + _(" in ") + ref_dt + _(" is zero, system will not check for over-billed")) @@ -427,9 +427,9 @@ class AccountsController(TransactionBase): already_billed = frappe.db.sql("""select sum(%s) from `tab%s` where %s=%s and docstatus=1 and parent != %s""" % (based_on, self.tname, item_ref_dn, '%s', '%s'), - (item.fields[item_ref_dn], self.name))[0][0] + (item.get(item_ref_dn), self.name))[0][0] - total_billed_amt = flt(flt(already_billed) + flt(item.fields[based_on]), + total_billed_amt = flt(flt(already_billed) + flt(item.get(based_on)), self.precision(based_on, item)) tolerance, item_tolerance, global_tolerance = get_tolerance_for(item.item_code, @@ -443,7 +443,7 @@ class AccountsController(TransactionBase): frappe.throw(_("Row #") + cstr(item.idx) + ": " + _(" Max amount allowed for Item ") + cstr(item.item_code) + _(" against ") + ref_dt + " " + - cstr(item.fields[ref_dt.lower().replace(" ", "_")]) + _(" is ") + + cstr(item.get(ref_dt.lower().replace(" ", "_"))) + _(" is ") + cstr(max_allowed_amt) + ". \n" + _("""If you want to increase your overflow tolerance, please increase \ tolerance % in Global Defaults or Item master. diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index d0e482e522..b186e5c665 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -152,12 +152,12 @@ class BuyingController(StockController): if not self.meta.get_field("item_tax_amount", parentfield=self.fname): for item in self.item_doclist: - del item.fields["item_tax_amount"] + del item.get("item_tax_amount") if not self.meta.get_field("tax_amount_after_discount_amount", parentfield=self.other_fname): for tax in self.tax_doclist: - del tax.fields["tax_amount_after_discount_amount"] + del tax.get("tax_amount_after_discount_amount") # update valuation rate def update_valuation_rate(self, parentfield): diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index da4d939f60..f2e1c08c1d 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -363,11 +363,11 @@ class SellingController(StockController): def check_stop_sales_order(self, ref_fieldname): for d in self.get(self.fname): if d.get(ref_fieldname): - status = frappe.db.get_value("Sales Order", d.fields[ref_fieldname], "status") + status = frappe.db.get_value("Sales Order", d.get(ref_fieldname), "status") if status == "Stopped": frappe.throw(self.doctype + _(" can not be created/modified against stopped Sales Order ") + - d.fields[ref_fieldname]) + d.get(ref_fieldname)) def check_active_sales_items(obj): for d in obj.doclist.get({"parentfield": obj.fname}): diff --git a/erpnext/controllers/status_updater.py b/erpnext/controllers/status_updater.py index 24c5db17d8..ba8118ec17 100644 --- a/erpnext/controllers/status_updater.py +++ b/erpnext/controllers/status_updater.py @@ -115,7 +115,7 @@ class StatusUpdater(DocListController): # get unique transactions to update for d in self.doclist: if d.doctype == args['source_dt'] and d.get(args["join_field"]): - args['name'] = d.fields[args['join_field']] + args['name'] = d.get(args['join_field']) # get all qty where qty > target_field item = frappe.db.sql("""select item_code, `{target_ref_field}`, @@ -244,7 +244,7 @@ class StatusUpdater(DocListController): if item.get(ref_fieldname) \ and item.get(ref_fieldname) in all_zero_amount_refdoc \ and item.get(ref_fieldname) not in zero_amount_refdoc: - zero_amount_refdoc.append(item.fields[ref_fieldname]) + zero_amount_refdoc.append(item.get(ref_fieldname)) if zero_amount_refdoc: self.update_biling_status(zero_amount_refdoc, ref_dt, ref_fieldname) diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py index a24834ea75..33b7fdb26b 100644 --- a/erpnext/controllers/stock_controller.py +++ b/erpnext/controllers/stock_controller.py @@ -223,11 +223,11 @@ class StockController(AccountsController): make_gl_entries(gl_entries) def check_expense_account(self, item): - if item.fields.has_key("expense_account") and not item.expense_account: + if item.meta.has_field("expense_account") and not item.expense_account: msgprint(_("""Expense/Difference account is mandatory for item: """) + item.item_code, raise_exception=1) - if item.fields.has_key("expense_account") and not item.cost_center: + if item.meta.has_field("expense_account") and not item.cost_center: msgprint(_("""Cost Center is mandatory for item: """) + item.item_code, raise_exception=1) diff --git a/erpnext/hr/doctype/salary_manager/salary_manager.py b/erpnext/hr/doctype/salary_manager/salary_manager.py index ac64963bbc..5bb0be56da 100644 --- a/erpnext/hr/doctype/salary_manager/salary_manager.py +++ b/erpnext/hr/doctype/salary_manager/salary_manager.py @@ -51,7 +51,7 @@ class SalaryManager(Document): def check_mandatory(self): for f in ['company', 'month', 'fiscal_year']: - if not self.fields[f]: + if not self.get(f): msgprint("Please select %s to proceed" % f, raise_exception=1) diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.py b/erpnext/hr/doctype/salary_structure/salary_structure.py index 09956d136c..05e3268558 100644 --- a/erpnext/hr/doctype/salary_structure/salary_structure.py +++ b/erpnext/hr/doctype/salary_structure/salary_structure.py @@ -71,7 +71,7 @@ class SalaryStructure(Document): @frappe.whitelist() def make_salary_slip(source_name, target_doc=None): - return [d.fields for d in get_mapped_doc(source_name, target_doc)] + return get_mapped_doc(source_name, target_doc).as_dict() def get_mapped_doc(source_name, target_doc=None): from frappe.model.mapper import get_mapped_doc diff --git a/erpnext/manufacturing/doctype/production_order/production_order.py b/erpnext/manufacturing/doctype/production_order/production_order.py index fd979805a2..efdf2c4f49 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.py +++ b/erpnext/manufacturing/doctype/production_order/production_order.py @@ -168,4 +168,4 @@ def make_stock_entry(production_order_id, purpose): stock_entry.to_warehouse = production_order.fg_warehouse stock_entry.run_method("get_items") - return [d.fields for d in stock_entry.doclist] + return stock_entry.as_dict() diff --git a/erpnext/projects/doctype/time_log_batch/time_log_batch.py b/erpnext/projects/doctype/time_log_batch/time_log_batch.py index a8e9be8eb7..9405e46c38 100644 --- a/erpnext/projects/doctype/time_log_batch/time_log_batch.py +++ b/erpnext/projects/doctype/time_log_batch/time_log_batch.py @@ -21,7 +21,7 @@ class TimeLogBatch(Document): self.total_hours += float(tl.hours or 0.0) def update_time_log_values(self, d, tl): - d.fields.update({ + d.update({ "hours": tl.hours, "activity_type": tl.activity_type, "created_by": tl.owner diff --git a/erpnext/selling/doctype/lead/lead.py b/erpnext/selling/doctype/lead/lead.py index 9e4ead86f4..4fdb8c0bd5 100644 --- a/erpnext/selling/doctype/lead/lead.py +++ b/erpnext/selling/doctype/lead/lead.py @@ -98,7 +98,7 @@ def _make_customer(source_name, target_doc=None, ignore_permissions=False): } }}, target_doc, set_missing_values, ignore_permissions=ignore_permissions) - return [d.fields for d in doclist] + return doclist.as_dict() @frappe.whitelist() def make_opportunity(source_name, target_doc=None): diff --git a/erpnext/selling/doctype/opportunity/opportunity.py b/erpnext/selling/doctype/opportunity/opportunity.py index 5dd7b8f22d..0ded247cb2 100644 --- a/erpnext/selling/doctype/opportunity/opportunity.py +++ b/erpnext/selling/doctype/opportunity/opportunity.py @@ -161,4 +161,4 @@ def make_quotation(source_name, target_doc=None): } }, target_doc, set_missing_values) - return [d.fields for d in doclist] \ No newline at end of file + return doclist.as_dict() \ No newline at end of file diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py index 900d764afe..0f64880999 100644 --- a/erpnext/selling/doctype/quotation/quotation.py +++ b/erpnext/selling/doctype/quotation/quotation.py @@ -136,7 +136,7 @@ def _make_sales_order(source_name, target_doc=None, ignore_permissions=False): # postprocess: fetch shipping address, set missing values - return [d.fields for d in doclist] + return doclist.as_dict() def _make_customer(source_name, ignore_permissions=False): quotation = frappe.db.get_value("Quotation", source_name, ["lead", "order_type"]) diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index 0dbb78ac26..6db638b2a8 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -316,7 +316,7 @@ def make_delivery_note(source_name, target_doc=None): } }, target_doc, set_missing_values) - return [d.fields for d in doclist] + return doclist.as_dict() @frappe.whitelist() def make_sales_invoice(source_name, target_doc=None): @@ -356,7 +356,7 @@ def make_sales_invoice(source_name, target_doc=None): } }, target_doc, set_missing_values) - return [d.fields for d in doclist] + return doclist.as_dict() @frappe.whitelist() def make_maintenance_schedule(source_name, target_doc=None): @@ -384,7 +384,7 @@ def make_maintenance_schedule(source_name, target_doc=None): } }, target_doc) - return [d.fields for d in doclist] + return doclist.as_dict() @frappe.whitelist() def make_maintenance_visit(source_name, target_doc=None): @@ -414,4 +414,4 @@ def make_maintenance_visit(source_name, target_doc=None): } }, target_doc) - return [d.fields for d in doclist] + return doclist.as_dict() diff --git a/erpnext/setup/doctype/features_setup/features_setup.py b/erpnext/setup/doctype/features_setup/features_setup.py index 55c155238b..1009b27f5a 100644 --- a/erpnext/setup/doctype/features_setup/features_setup.py +++ b/erpnext/setup/doctype/features_setup/features_setup.py @@ -14,4 +14,4 @@ class FeaturesSetup(Document): from frappe.utils import set_default for key in self.fields: if key not in default_fields: - set_default(key, self.fields[key]) + set_default(key, self.get(key)) diff --git a/erpnext/startup/boot.py b/erpnext/startup/boot.py index 6624b1d91e..973b742a48 100644 --- a/erpnext/startup/boot.py +++ b/erpnext/startup/boot.py @@ -10,7 +10,7 @@ def boot_session(bootinfo): import frappe bootinfo['custom_css'] = frappe.db.get_value('Style Settings', None, 'custom_css') or '' - bootinfo['website_settings'] = frappe.model.getsingle('Website Settings') + bootinfo['website_settings'] = frappe.get_doc('Website Settings') if frappe.session['user']!='Guest': bootinfo['letter_heads'] = get_letter_heads() diff --git a/erpnext/stock/doctype/bin/bin.py b/erpnext/stock/doctype/bin/bin.py index 4cc02ab853..a5fd8ecfe6 100644 --- a/erpnext/stock/doctype/bin/bin.py +++ b/erpnext/stock/doctype/bin/bin.py @@ -25,7 +25,7 @@ class Bin(Document): def validate_mandatory(self): qf = ['actual_qty', 'reserved_qty', 'ordered_qty', 'indented_qty'] for f in qf: - if (not self.has_key(f)) or (not self.fields[f]): + if (not self.has_key(f)) or (not self.get(f)): self.set(f, 0.0) def update_stock(self, args): diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index c0302446e6..1489590424 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -335,7 +335,7 @@ def make_sales_invoice(source_name, target_doc=None): } }, target_doc, update_accounts) - return [d.fields for d in doclist] + return doclist.as_dict() @frappe.whitelist() def make_installation_note(source_name, target_doc=None): @@ -362,4 +362,4 @@ def make_installation_note(source_name, target_doc=None): } }, target_doc) - return [d.fields for d in doclist] \ No newline at end of file + return doclist.as_dict() \ No newline at end of file diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index ea43b167fc..4741bde11a 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -233,7 +233,7 @@ class Item(DocListController): field_list = ["stock_uom", "is_stock_item", "has_serial_no", "has_batch_no"] new_properties = [cstr(d) for d in frappe.db.get_value("Item", newdn, field_list)] - if new_properties != [cstr(self.fields[fld]) for fld in field_list]: + if new_properties != [cstr(self.get(fld)) for fld in field_list]: frappe.throw(_("To merge, following properties must be same for both items") + ": \n" + ", ".join([self.meta.get_label(fld) for fld in field_list])) diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py index 42c6f23ae2..3dd406f229 100644 --- a/erpnext/stock/doctype/material_request/material_request.py +++ b/erpnext/stock/doctype/material_request/material_request.py @@ -249,7 +249,7 @@ def make_purchase_order(source_name, target_doc=None): } }, target_doc, set_missing_values) - return [d.fields for d in doclist] + return doclist.as_dict() @frappe.whitelist() def make_purchase_order_based_on_supplier(source_name, target_doc=None): @@ -291,7 +291,7 @@ def make_purchase_order_based_on_supplier(source_name, target_doc=None): } }, target_doc, postprocess) - return [d.fields for d in target_doc] + return target_doc.as_dict() def get_material_requests_based_on_supplier(supplier): supplier_items = [d[0] for d in frappe.db.get_values("Item", @@ -329,7 +329,7 @@ def make_supplier_quotation(source_name, target_doc=None): } }, target_doc, set_missing_values) - return [d.fields for d in doclist] + return doclist.as_dict() @frappe.whitelist() def make_stock_entry(source_name, target_doc=None): @@ -365,4 +365,4 @@ def make_stock_entry(source_name, target_doc=None): } }, target_doc, set_missing_values) - return [d.fields for d in doclist] + return doclist.as_dict() diff --git a/erpnext/stock/doctype/price_list/price_list.py b/erpnext/stock/doctype/price_list/price_list.py index 7f5d7e7506..fa53aba342 100644 --- a/erpnext/stock/doctype/price_list/price_list.py +++ b/erpnext/stock/doctype/price_list/price_list.py @@ -47,7 +47,7 @@ class PriceList(DocListController): b = frappe.get_doc(module + " Settings") price_list_fieldname = module.lower() + "_price_list" - if self.name == b.fields[price_list_fieldname]: + if self.name == b.get(price_list_fieldname): b.set(price_list_fieldname, None) b.save() diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py index 950db93a56..9d363d3fb8 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py @@ -216,7 +216,7 @@ class PurchaseReceipt(BuyingController): def check_for_stopped_status(self, pc_obj): check_list =[] for d in self.get('purchase_receipt_details'): - if d.fields.has_key('prevdoc_docname') and d.prevdoc_docname and d.prevdoc_docname not in check_list: + if d.meta.has_field('prevdoc_docname') and d.prevdoc_docname and d.prevdoc_docname not in check_list: check_list.append(d.prevdoc_docname) pc_obj.check_for_stopped_status( d.prevdoc_doctype, d.prevdoc_docname) @@ -323,4 +323,4 @@ def make_purchase_invoice(source_name, target_doc=None): } }, target_doc, set_missing_values) - return [d.fields for d in doclist] \ No newline at end of file + return doclist.as_dict() \ No newline at end of file diff --git a/erpnext/support/doctype/customer_issue/customer_issue.py b/erpnext/support/doctype/customer_issue/customer_issue.py index 7e69382d0d..f82488a903 100644 --- a/erpnext/support/doctype/customer_issue/customer_issue.py +++ b/erpnext/support/doctype/customer_issue/customer_issue.py @@ -59,4 +59,4 @@ def make_maintenance_visit(source_name, target_doc=None): } }, target_doc) - return [d.fields for d in doclist] \ No newline at end of file + return doclist.as_dict() \ No newline at end of file diff --git a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py index 1aa22b7c97..1002aba52a 100644 --- a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py +++ b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py @@ -295,4 +295,4 @@ def make_maintenance_visit(source_name, target_doc=None): } }, target_doc) - return [d.fields for d in doclist] \ No newline at end of file + return doclist.as_dict() \ No newline at end of file diff --git a/erpnext/utilities/doctype/address/address.py b/erpnext/utilities/doctype/address/address.py index 9c9316c9f4..04d54f2378 100644 --- a/erpnext/utilities/doctype/address/address.py +++ b/erpnext/utilities/doctype/address/address.py @@ -35,7 +35,7 @@ class Address(Document): if self.get(fieldname): if not frappe.db.sql("""select name from `tabAddress` where is_primary_address=1 and `%s`=%s and name!=%s""" % (fieldname, "%s", "%s"), - (self.fields[fieldname], self.name)): + (self.get(fieldname), self.name)): self.is_primary_address = 1 break @@ -48,7 +48,7 @@ class Address(Document): for fieldname in ["customer", "supplier", "sales_partner", "lead"]: if self.get(fieldname): frappe.db.sql("""update `tabAddress` set `%s`=0 where `%s`=%s and name!=%s""" % - (is_address_type, fieldname, "%s", "%s"), (self.fields[fieldname], self.name)) + (is_address_type, fieldname, "%s", "%s"), (self.get(fieldname), self.name)) break @frappe.whitelist() diff --git a/erpnext/utilities/transaction_base.py b/erpnext/utilities/transaction_base.py index 57a07a76c2..66a1a0320f 100644 --- a/erpnext/utilities/transaction_base.py +++ b/erpnext/utilities/transaction_base.py @@ -110,8 +110,8 @@ def validate_uom_is_integer(doclist, uom_field, qty_fields): if d.get(uom_field) in integer_uoms: for f in qty_fields: if d.get(f): - if cint(d.fields[f])!=d.fields[f]: - frappe.msgprint(_("For UOM") + " '" + d.fields[uom_field] \ + if cint(d.get(f))!=d.get(f): + frappe.msgprint(_("For UOM") + " '" + d.get(uom_field) \ + "': " + _("Quantity cannot be a fraction.") \ + " " + _("In Row") + ": " + str(d.idx), raise_exception=UOMMustBeIntegerError) From dd32d6eb1f6a6e424a3bf69ffe9dbbbb0e029d92 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 1 Apr 2014 12:21:06 +0530 Subject: [PATCH 15/42] frappe/frappe#478 --- erpnext/home/__init__.py | 59 +++++++++---------- erpnext/startup/boot.py | 2 +- erpnext/startup/event_handlers.py | 4 +- .../material_request/material_request.py | 2 +- 4 files changed, 33 insertions(+), 34 deletions(-) diff --git a/erpnext/home/__init__.py b/erpnext/home/__init__.py index 75fab1c9ea..25e92aa5f9 100644 --- a/erpnext/home/__init__.py +++ b/erpnext/home/__init__.py @@ -20,36 +20,36 @@ from frappe import msgprint feed_dict = { # Project - 'Project': ['[%(status)s]', '#000080'], - 'Task': ['[%(status)s] %(subject)s', '#000080'], - + 'Project': ['[%(status)s]', '#000080'], + 'Task': ['[%(status)s] %(subject)s', '#000080'], + # Sales - 'Lead': ['%(lead_name)s', '#000080'], - 'Quotation': ['[%(status)s] To %(customer_name)s worth %(currency)s %(grand_total_export)s', '#4169E1'], - 'Sales Order': ['[%(status)s] To %(customer_name)s worth %(currency)s %(grand_total_export)s', '#4169E1'], - + 'Lead': ['%(lead_name)s', '#000080'], + 'Quotation': ['[%(status)s] To %(customer_name)s worth %(currency)s %(grand_total_export)s', '#4169E1'], + 'Sales Order': ['[%(status)s] To %(customer_name)s worth %(currency)s %(grand_total_export)s', '#4169E1'], + # Purchase - 'Supplier': ['%(supplier_name)s, %(supplier_type)s', '#6495ED'], - 'Purchase Order': ['[%(status)s] %(name)s To %(supplier_name)s for %(currency)s %(grand_total_import)s', '#4169E1'], - + 'Supplier': ['%(supplier_name)s, %(supplier_type)s', '#6495ED'], + 'Purchase Order': ['[%(status)s] %(name)s To %(supplier_name)s for %(currency)s %(grand_total_import)s', '#4169E1'], + # Stock - 'Delivery Note': ['[%(status)s] To %(customer_name)s', '#4169E1'], + 'Delivery Note': ['[%(status)s] To %(customer_name)s', '#4169E1'], 'Purchase Receipt': ['[%(status)s] From %(supplier)s', '#4169E1'], - + # Accounts - 'Journal Voucher': ['[%(voucher_type)s] %(name)s', '#4169E1'], - 'Purchase Invoice': ['To %(supplier_name)s for %(currency)s %(grand_total_import)s', '#4169E1'], - 'Sales Invoice':['To %(customer_name)s for %(currency)s %(grand_total_export)s', '#4169E1'], - + 'Journal Voucher': ['[%(voucher_type)s] %(name)s', '#4169E1'], + 'Purchase Invoice': ['To %(supplier_name)s for %(currency)s %(grand_total_import)s', '#4169E1'], + 'Sales Invoice': ['To %(customer_name)s for %(currency)s %(grand_total_export)s', '#4169E1'], + # HR - 'Expense Claim': ['[%(approval_status)s] %(name)s by %(employee_name)s', '#4169E1'], - 'Salary Slip': ['%(employee_name)s for %(month)s %(fiscal_year)s', '#4169E1'], - 'Leave Transaction':['%(leave_type)s for %(employee)s', '#4169E1'], - + 'Expense Claim': ['[%(approval_status)s] %(name)s by %(employee_name)s', '#4169E1'], + 'Salary Slip': ['%(employee_name)s for %(month)s %(fiscal_year)s', '#4169E1'], + 'Leave Transaction': ['%(leave_type)s for %(employee)s', '#4169E1'], + # Support - 'Customer Issue': ['[%(status)s] %(description)s by %(customer_name)s', '#000080'], - 'Maintenance Visit':['To %(customer_name)s', '#4169E1'], - 'Support Ticket': ["[%(status)s] %(subject)s", '#000080'], + 'Customer Issue': ['[%(status)s] %(description)s by %(customer_name)s', '#000080'], + 'Maintenance Visit': ['To %(customer_name)s', '#4169E1'], + 'Support Ticket': ["[%(status)s] %(subject)s", '#000080'], # Website 'Web Page': ['%(title)s', '#000080'], @@ -59,7 +59,7 @@ feed_dict = { def make_feed(feedtype, doctype, name, owner, subject, color): "makes a new Feed record" #msgprint(subject) - from frappe.utils import get_fullname + from frappe.utils import get_fullname if feedtype in ('Login', 'Comment', 'Assignment'): # delete old login, comment feed @@ -71,7 +71,7 @@ def make_feed(feedtype, doctype, name, owner, subject, color): where doc_type=%s and doc_name=%s and ifnull(feed_type,'') != 'Comment'""", (doctype, name)) - f = frappe.get_doc('Feed') + f = frappe.new_doc('Feed') f.owner = owner f.feed_type = feedtype f.doc_type = doctype @@ -81,16 +81,15 @@ def make_feed(feedtype, doctype, name, owner, subject, color): f.full_name = get_fullname(owner) f.save() -def update_feed(bean, method=None): +def update_feed(doc, method=None): "adds a new feed" - doc = bean.doc if method in ['on_update', 'on_submit']: subject, color = feed_dict.get(doc.doctype, [None, None]) if subject: make_feed('', doc.doctype, doc.name, doc.owner, subject % doc.fields, color) -def make_comment_feed(bean, method): +def make_comment_feed(doc, method): """add comment to feed""" - doc = bean.doc make_feed('Comment', doc.comment_doctype, doc.comment_docname, doc.comment_by, - '"' + doc.comment + '"', '#6B24B3') \ No newline at end of file + '"' + doc.comment + '"', '#6B24B3') + diff --git a/erpnext/startup/boot.py b/erpnext/startup/boot.py index 973b742a48..9cf2020909 100644 --- a/erpnext/startup/boot.py +++ b/erpnext/startup/boot.py @@ -18,7 +18,7 @@ def boot_session(bootinfo): load_country_and_currency(bootinfo) bootinfo['notification_settings'] = frappe.get_doc("Notification Control", - "Notification Control").get_values() + "Notification Control") # if no company, show a dialog box to create a new company bootinfo["customer_count"] = frappe.db.sql("""select count(*) from tabCustomer""")[0][0] diff --git a/erpnext/startup/event_handlers.py b/erpnext/startup/event_handlers.py index 448cbf0de3..0fea0ea55b 100644 --- a/erpnext/startup/event_handlers.py +++ b/erpnext/startup/event_handlers.py @@ -4,14 +4,14 @@ from __future__ import unicode_literals import frappe +from frappe.utils import nowtime +from frappe.utils.user import get_user_fullname from erpnext.home import make_feed def on_session_creation(login_manager): """make feed""" if frappe.session['user'] not in ('Guest'): # create feed - from frappe.utils import nowtime - from frappe.utils.user import get_user_fullname make_feed('Login', 'User', login_manager.user, login_manager.user, '%s logged in at %s' % (get_user_fullname(login_manager.user), nowtime()), login_manager.user=='Administrator' and '#8CA2B3' or '#1B750D') diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py index 3dd406f229..fc7f64eb6f 100644 --- a/erpnext/stock/doctype/material_request/material_request.py +++ b/erpnext/stock/doctype/material_request/material_request.py @@ -257,7 +257,7 @@ def make_purchase_order_based_on_supplier(source_name, target_doc=None): if target_doc: if isinstance(target_doc, basestring): import json - target_doc = frappe.doclist(json.loads(target_doc)) + target_doc = frappe.get_doc(json.loads(target_doc)) target_doc = target_doc.get({"parentfield": ["!=", "po_details"]}) material_requests, supplier_items = get_material_requests_based_on_supplier(source_name) From 732825cb2384936468d30b9a15065a3016806feb Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 2 Apr 2014 12:08:03 +0530 Subject: [PATCH 16/42] frappe/frappe#478 fixed todo and renamed hooks --- erpnext/hooks.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/erpnext/hooks.txt b/erpnext/hooks.txt index f07def6692..d84b369fef 100644 --- a/erpnext/hooks.txt +++ b/erpnext/hooks.txt @@ -25,12 +25,12 @@ on_session_creation = erpnext.startup.event_handlers.on_session_creation # Bean Events # ------------------------- -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 +doc_event:*:on_update = erpnext.home.update_feed +doc_event:*:on_submit = erpnext.home.update_feed +doc_event:Comment:on_update = erpnext.home.make_comment_feed -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 +doc_event:Stock Entry:on_submit = erpnext.stock.doctype.material_request.material_request.update_completed_qty +doc_event:Stock Entry:on_cancel = erpnext.stock.doctype.material_request.material_request.update_completed_qty standard_queries = Customer:erpnext.selling.doctype.customer.customer.get_customer_list From 5b552b51f1359002b498a69747acbc434a248ccf Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 2 Apr 2014 15:03:35 +0530 Subject: [PATCH 17/42] frappe/frappe#478 --- .../journal_voucher/journal_voucher.py | 3 +- .../period_closing_voucher.py | 4 +-- .../purchase_common/purchase_common.py | 7 ++--- .../doctype/purchase_order/purchase_order.py | 26 ++++++++-------- erpnext/controllers/accounts_controller.py | 12 ++------ erpnext/controllers/buying_controller.py | 12 -------- .../production_planning_tool.py | 2 ++ .../installation_note/installation_note.py | 30 +++++++++---------- erpnext/selling/doctype/lead/lead.py | 15 +++++----- .../authorization_control.py | 4 +-- .../setup/doctype/item_group/item_group.py | 2 +- .../material_request/material_request.py | 1 - .../stock/doctype/packed_item/packed_item.py | 2 +- .../doctype/sms_control/sms_control.py | 2 +- erpnext/utilities/transaction_base.py | 4 +-- 15 files changed, 53 insertions(+), 73 deletions(-) diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher.py b/erpnext/accounts/doctype/journal_voucher/journal_voucher.py index a2fbec1da8..02bca17732 100644 --- a/erpnext/accounts/doctype/journal_voucher/journal_voucher.py +++ b/erpnext/accounts/doctype/journal_voucher/journal_voucher.py @@ -11,7 +11,8 @@ from erpnext.setup.utils import get_company_currency from erpnext.controllers.accounts_controller import AccountsController class JournalVoucher(AccountsController): - + def __init__(self, arg1, arg2=None): + super(JournalVoucher, self).__init__(arg1, arg2) self.master_type = {} self.credit_days_for = {} self.credit_days_global = -1 diff --git a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py index a07ed2f3a5..d8661e19d8 100644 --- a/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py +++ b/erpnext/accounts/doctype/period_closing_voucher/period_closing_voucher.py @@ -8,8 +8,6 @@ from frappe import _ from erpnext.controllers.accounts_controller import AccountsController class PeriodClosingVoucher(AccountsController): - self.year_start_date = '' - def validate(self): self.validate_account_head() self.validate_posting_date() @@ -47,7 +45,7 @@ class PeriodClosingVoucher(AccountsController): and t2.docstatus < 2 and t2.company = %s and t1.posting_date between %s and %s group by t1.account - """, (self.company, self.year_start_date, self.posting_date), as_dict=1) + """, (self.company, self.get("year_start_date"), self.posting_date), as_dict=1) def make_gl_entries(self): gl_entries = [] diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.py b/erpnext/buying/doctype/purchase_common/purchase_common.py index a57114446c..80af450654 100644 --- a/erpnext/buying/doctype/purchase_common/purchase_common.py +++ b/erpnext/buying/doctype/purchase_common/purchase_common.py @@ -5,7 +5,6 @@ from __future__ import unicode_literals import frappe from frappe.utils import cstr, flt -from frappe.model.utils import getlist from frappe import msgprint, _ from erpnext.stock.doctype.item.item import get_last_purchase_details @@ -19,7 +18,7 @@ class PurchaseCommon(BuyingController): import frappe.utils this_purchase_date = frappe.utils.getdate(obj.get('posting_date') or obj.get('transaction_date')) - for d in getlist(obj.doclist,obj.fname): + for d in obj.get(obj.fname): # get last purchase details last_purchase_details = get_last_purchase_details(d.item_code, obj.name) @@ -47,7 +46,7 @@ class PurchaseCommon(BuyingController): doc_name = obj.name conversion_rate = flt(obj.get('conversion_rate')) or 1.0 - for d in getlist(obj.doclist, obj.fname): + for d in obj.get(obj.fname): if d.item_code: last_purchase_details = get_last_purchase_details(d.item_code, doc_name) @@ -69,7 +68,7 @@ class PurchaseCommon(BuyingController): def validate_for_items(self, obj): check_list, chk_dupl_itm=[],[] - for d in getlist( obj.doclist, obj.fname): + for d in obj.get(obj.fname): # validation for valid qty if flt(d.qty) < 0 or (d.parenttype != 'Purchase Receipt' and not flt(d.qty)): frappe.throw("Please enter valid qty for item %s" % cstr(d.item_code)) diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index ca68e2b515..81c7dfb9d0 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -11,19 +11,19 @@ from frappe import msgprint from erpnext.controllers.buying_controller import BuyingController class PurchaseOrder(BuyingController): - self.tname = 'Purchase Order Item' - self.fname = 'po_details' - self.status_updater = [{ - 'source_dt': 'Purchase Order Item', - 'target_dt': 'Material Request Item', - 'join_field': 'prevdoc_detail_docname', - 'target_field': 'ordered_qty', - 'target_parent_dt': 'Material Request', - 'target_parent_field': 'per_ordered', - 'target_ref_field': 'qty', - 'source_field': 'qty', - 'percent_join_field': 'prevdoc_docname', - }] + tname = 'Purchase Order Item' + fname = 'po_details' + status_updater = [{ + 'source_dt': 'Purchase Order Item', + 'target_dt': 'Material Request Item', + 'join_field': 'prevdoc_detail_docname', + 'target_field': 'ordered_qty', + 'target_parent_dt': 'Material Request', + 'target_parent_field': 'per_ordered', + 'target_ref_field': 'qty', + 'source_field': 'qty', + 'percent_join_field': 'prevdoc_docname', + }] def validate(self): super(DocType, self).validate() diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 777150e7b3..b3155fd79f 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -342,20 +342,14 @@ class AccountsController(TransactionBase): def _cleanup(self): for tax in self.tax_doclist: - for fieldname in ("grand_total_for_current_item", - "tax_amount_for_current_item", - "tax_fraction_for_current_item", - "grand_total_fraction_for_current_item"): - if fieldname in tax.fields: - del tax.get(fieldname) - tax.item_wise_tax_detail = json.dumps(tax.item_wise_tax_detail) def _set_in_company_currency(self, item, print_field, base_field): """set values in base currency""" - item.set(base_field, flt((flt(item.get(print_field),) - self.precision(print_field, item)) * self.conversion_rate), + value_in_company_currency = flt(self.conversion_rate * + flt(item.get(print_field), self.precision(print_field, item)), self.precision(base_field, item)) + item.set(base_field, value_in_company_currency) def calculate_total_advance(self, parenttype, advance_parentfield): if self.doctype == parenttype and self.docstatus < 2: diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index b186e5c665..b37213c0e8 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -147,18 +147,6 @@ class BuyingController(StockController): self.outstanding_amount = flt(self.total_amount_to_pay - self.total_advance, self.precision("outstanding_amount")) - def _cleanup(self): - super(BuyingController, self)._cleanup() - - if not self.meta.get_field("item_tax_amount", parentfield=self.fname): - for item in self.item_doclist: - del item.get("item_tax_amount") - - if not self.meta.get_field("tax_amount_after_discount_amount", - parentfield=self.other_fname): - for tax in self.tax_doclist: - del tax.get("tax_amount_after_discount_amount") - # update valuation rate def update_valuation_rate(self, parentfield): """ diff --git a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py index 8c9c3cdb9f..cec6471bb2 100644 --- a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py +++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py @@ -10,6 +10,8 @@ from frappe import msgprint, _ from frappe.model.document import Document class ProductionPlanningTool(Document): + def __init__(self, arg1, arg2=None): + super(ProductionPlanningTool, self).__init__(arg1, arg2) self.item_dict = {} def get_so_details(self, so): diff --git a/erpnext/selling/doctype/installation_note/installation_note.py b/erpnext/selling/doctype/installation_note/installation_note.py index 91f1a07e93..b69e319001 100644 --- a/erpnext/selling/doctype/installation_note/installation_note.py +++ b/erpnext/selling/doctype/installation_note/installation_note.py @@ -12,21 +12,21 @@ from erpnext.stock.utils import get_valid_serial_nos from erpnext.utilities.transaction_base import TransactionBase class InstallationNote(TransactionBase): - self.tname = 'Installation Note Item' - self.fname = 'installed_item_details' - self.status_updater = [{ - 'source_dt': 'Installation Note Item', - 'target_dt': 'Delivery Note Item', - 'target_field': 'installed_qty', - 'target_ref_field': 'qty', - 'join_field': 'prevdoc_detail_docname', - 'target_parent_dt': 'Delivery Note', - 'target_parent_field': 'per_installed', - 'source_field': 'qty', - 'percent_join_field': 'prevdoc_docname', - 'status_field': 'installation_status', - 'keyword': 'Installed' - }] + tname = 'Installation Note Item' + fname = 'installed_item_details' + status_updater = [{ + 'source_dt': 'Installation Note Item', + 'target_dt': 'Delivery Note Item', + 'target_field': 'installed_qty', + 'target_ref_field': 'qty', + 'join_field': 'prevdoc_detail_docname', + 'target_parent_dt': 'Delivery Note', + 'target_parent_field': 'per_installed', + 'source_field': 'qty', + 'percent_join_field': 'prevdoc_docname', + 'status_field': 'installation_status', + 'keyword': 'Installed' + }] def validate(self): self.validate_fiscal_year() diff --git a/erpnext/selling/doctype/lead/lead.py b/erpnext/selling/doctype/lead/lead.py index 4fdb8c0bd5..743dc04c6f 100644 --- a/erpnext/selling/doctype/lead/lead.py +++ b/erpnext/selling/doctype/lead/lead.py @@ -11,20 +11,19 @@ from frappe import session from erpnext.controllers.selling_controller import SellingController class Lead(SellingController): - - self._prev = frappe._dict({ - "contact_date": frappe.db.get_value("Lead", self.name, "contact_date") if \ - (not cint(self.get("__islocal"))) else None, - "contact_by": frappe.db.get_value("Lead", self.name, "contact_by") if \ - (not cint(self.get("__islocal"))) else None, - }) - def onload(self): customer = frappe.db.get_value("Customer", {"lead_name": self.name}) if customer: self.set("__is_customer", customer) def validate(self): + self._prev = frappe._dict({ + "contact_date": frappe.db.get_value("Lead", self.name, "contact_date") if \ + (not cint(self.get("__islocal"))) else None, + "contact_by": frappe.db.get_value("Lead", self.name, "contact_by") if \ + (not cint(self.get("__islocal"))) else None, + }) + self.set_status() if self.source == 'Campaign' and not self.campaign_name and session['user'] != 'Guest': diff --git a/erpnext/setup/doctype/authorization_control/authorization_control.py b/erpnext/setup/doctype/authorization_control/authorization_control.py index a50eb2f8c6..8a401f07be 100644 --- a/erpnext/setup/doctype/authorization_control/authorization_control.py +++ b/erpnext/setup/doctype/authorization_control/authorization_control.py @@ -86,7 +86,7 @@ class AuthorizationControl(TransactionBase): add_cond = " and master_name = '"+make_esc("'")(cstr(customer))+"'" if based_on == 'Itemwise Discount': if doc_obj: - for t in getlist(doc_obj.doclist, doc_obj.fname): + for t in doc_obj.get(doc_obj.fname): self.validate_auth_rule(doctype_name, t.discount_percentage, based_on, add_cond, company,t.item_code ) else: self.validate_auth_rule(doctype_name, auth_value, based_on, add_cond, company) @@ -98,7 +98,7 @@ class AuthorizationControl(TransactionBase): av_dis = 0 if doc_obj: price_list_rate, base_rate = 0, 0 - for d in getlist(doc_obj.doclist, doc_obj.fname): + for d in doc_obj.get(doc_obj.fname): if d.base_price_list_rate and d.base_rate: price_list_rate += flt(d.base_price_list_rate) base_rate += flt(d.base_rate) diff --git a/erpnext/setup/doctype/item_group/item_group.py b/erpnext/setup/doctype/item_group/item_group.py index 52880fc8d5..e1f79a570b 100644 --- a/erpnext/setup/doctype/item_group/item_group.py +++ b/erpnext/setup/doctype/item_group/item_group.py @@ -7,7 +7,7 @@ import frappe from frappe.utils.nestedset import DocTypeNestedSet class ItemGroup(DocTypeNestedSet): - self.nsm_parent_field = 'parent_item_group' + nsm_parent_field = 'parent_item_group' def validate(self): if not self.parent_website_route: diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py index fc7f64eb6f..f9ba9b527f 100644 --- a/erpnext/stock/doctype/material_request/material_request.py +++ b/erpnext/stock/doctype/material_request/material_request.py @@ -8,7 +8,6 @@ from __future__ import unicode_literals import frappe from frappe.utils import cstr, flt -from frappe.model.utils import getlist from frappe import msgprint, _ from erpnext.controllers.buying_controller import BuyingController diff --git a/erpnext/stock/doctype/packed_item/packed_item.py b/erpnext/stock/doctype/packed_item/packed_item.py index 232e60149d..755c110875 100644 --- a/erpnext/stock/doctype/packed_item/packed_item.py +++ b/erpnext/stock/doctype/packed_item/packed_item.py @@ -32,7 +32,7 @@ def update_packing_list_item(obj, packing_item_code, qty, warehouse, line, packi # check if exists exists = 0 - for d in getlist(obj.doclist, 'packing_details'): + for d in obj.get("packing_details"): if d.parent_item == line.item_code and d.item_code == packing_item_code and d.parent_detail_docname == line.name: pi, exists = d, 1 break diff --git a/erpnext/utilities/doctype/sms_control/sms_control.py b/erpnext/utilities/doctype/sms_control/sms_control.py index c0a46471fc..6b8c684ec6 100644 --- a/erpnext/utilities/doctype/sms_control/sms_control.py +++ b/erpnext/utilities/doctype/sms_control/sms_control.py @@ -70,7 +70,7 @@ class SmsControl(Document): def send_via_gateway(self, arg): ss = frappe.get_doc('SMS Settings', 'SMS Settings') args = {ss.message_parameter : arg.get('message')} - for d in getlist(ss.doclist, 'static_parameter_details'): + for d in ss.get("static_parameter_details"): args[d.parameter] = d.value resp = [] diff --git a/erpnext/utilities/transaction_base.py b/erpnext/utilities/transaction_base.py index 66a1a0320f..4be3d6fb24 100644 --- a/erpnext/utilities/transaction_base.py +++ b/erpnext/utilities/transaction_base.py @@ -13,8 +13,8 @@ class TransactionBase(StatusUpdater): def load_notification_message(self): dt = self.doctype.lower().replace(" ", "_") if int(frappe.db.get_value("Notification Control", None, dt) or 0): - self.set("__notification_message", \) - frappe.db.get_value("Notification Control", None, dt + "_message") + self.set("__notification_message", + frappe.db.get_value("Notification Control", None, dt + "_message")) def validate_posting_time(self): if not self.posting_time: From 943e6148103d482fa97b83849b97bc5a8178ef05 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 2 Apr 2014 16:37:35 +0530 Subject: [PATCH 18/42] frappe/frappe#478 --- .../setup/doctype/notification_control/notification_control.py | 2 -- erpnext/stock/doctype/stock_entry/stock_entry.js | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/erpnext/setup/doctype/notification_control/notification_control.py b/erpnext/setup/doctype/notification_control/notification_control.py index 8594856a08..87674ecd11 100644 --- a/erpnext/setup/doctype/notification_control/notification_control.py +++ b/erpnext/setup/doctype/notification_control/notification_control.py @@ -10,8 +10,6 @@ from frappe import msgprint from frappe.model.document import Document class NotificationControl(Document): - - def get_message(self, arg): fn = arg.lower().replace(' ', '_') + '_message' v = frappe.db.sql("select value from tabSingles where field=%s and doctype=%s", (fn, 'Notification Control')) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js index 6ee3922327..0ae7e18387 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry.js @@ -350,7 +350,7 @@ cur_frm.cscript.item_code = function(doc, cdt, cdn) { 'cost_center' : d.cost_center, 'company' : cur_frm.doc.company }; - return get_server_fields('get_item_details', JSON.stringify(args), + return get_server_fields('get_item_details', {arg: JSON.stringify(args)}, 'mtn_details', doc, cdt, cdn, 1); } From f191f854cd8fbf0558506bbefea7b99e0a1b7c8d Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Wed, 2 Apr 2014 18:09:34 +0530 Subject: [PATCH 19/42] frappe/frappe#478 erpnext install works --- .../chart_of_accounts/chart_of_accounts.py | 2 +- .../journal_voucher/journal_voucher.py | 4 +- .../payment_to_invoice_matching_tool.py | 2 +- .../purchase_invoice/purchase_invoice.py | 10 ++--- .../doctype/sales_invoice/sales_invoice.py | 16 ++++---- .../doctype/purchase_order/purchase_order.py | 4 +- .../supplier_quotation/supplier_quotation.py | 4 +- erpnext/controllers/accounts_controller.py | 4 +- erpnext/controllers/buying_controller.py | 4 +- erpnext/controllers/status_updater.py | 11 +++-- erpnext/controllers/stock_controller.py | 2 +- .../hr/doctype/holiday_list/holiday_list.py | 3 +- erpnext/hr/doctype/hr_settings/hr_settings.py | 2 +- .../leave_block_list/leave_block_list.py | 2 +- erpnext/hr/doctype/salary_slip/salary_slip.py | 2 +- .../salary_structure/salary_structure.py | 4 +- erpnext/manufacturing/doctype/bom/bom.py | 8 ++-- .../doctype/bom_item/bom_item.py | 2 +- .../doctype/bom_operation/bom_operation.py | 2 +- .../bom_replace_tool/bom_replace_tool.py | 2 +- .../production_order/production_order.py | 2 +- .../production_planning_tool.py | 2 +- .../doctype/time_log_batch/time_log_batch.py | 4 +- erpnext/selling/doctype/lead/lead.py | 2 +- .../doctype/opportunity/opportunity.py | 2 +- .../selling/doctype/quotation/quotation.py | 13 +++--- .../selling/doctype/sales_bom/sales_bom.py | 4 +- .../doctype/sales_order/sales_order.py | 21 +++++----- .../selling/doctype/sms_center/sms_center.py | 2 +- .../doctype/backup_manager/backup_manager.py | 1 + erpnext/setup/doctype/currency/currency.py | 3 +- .../doctype/customer_group/customer_group.py | 6 +-- .../doctype/email_digest/email_digest.py | 1 - .../doctype/features_setup/features_setup.py | 2 +- .../doctype/naming_series/naming_series.py | 2 +- .../doctype/sales_person/sales_person.py | 4 +- .../doctype/sms_parameter/sms_parameter.py | 2 +- .../doctype/sms_settings/sms_settings.py | 2 +- erpnext/setup/doctype/territory/territory.py | 2 +- erpnext/setup/doctype/uom/uom.py | 2 +- erpnext/setup/install.py | 18 ++++----- .../doctype/delivery_note/delivery_note.py | 40 +++++++++---------- erpnext/stock/doctype/item/item.py | 3 +- .../material_request/material_request.py | 6 +-- .../stock/doctype/packed_item/packed_item.py | 24 +++++------ .../purchase_receipt/purchase_receipt.py | 36 ++++++++--------- .../stock/doctype/stock_entry/stock_entry.py | 5 +-- .../stock_reconciliation.py | 3 +- .../stock_uom_replace_utility.py | 2 +- .../support/doctype/newsletter/newsletter.py | 5 +-- .../support_email_settings.py | 7 ++-- .../doctype/rename_tool/rename_tool.py | 1 + .../doctype/sms_control/sms_control.py | 2 +- erpnext/utilities/doctype/sms_log/sms_log.py | 2 +- erpnext/utilities/transaction_base.py | 9 +++-- 55 files changed, 165 insertions(+), 167 deletions(-) diff --git a/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.py b/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.py index 52cf5299ef..d69ae73180 100644 --- a/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.py +++ b/erpnext/accounts/doctype/chart_of_accounts/chart_of_accounts.py @@ -7,7 +7,7 @@ from frappe.utils import cstr from unidecode import unidecode from frappe.model.document import Document -class ChartOfAccounts(Document): +class ChartofAccounts(Document): no_report_type = False def create_accounts(self, company): diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher.py b/erpnext/accounts/doctype/journal_voucher/journal_voucher.py index 02bca17732..3af9a03766 100644 --- a/erpnext/accounts/doctype/journal_voucher/journal_voucher.py +++ b/erpnext/accounts/doctype/journal_voucher/journal_voucher.py @@ -24,7 +24,7 @@ class JournalVoucher(AccountsController): self.clearance_date = None - super(DocType, self).validate_date_with_fiscal_year() + super(JournalVoucher, self).validate_date_with_fiscal_year() self.validate_debit_credit() self.validate_cheque_info() @@ -268,7 +268,7 @@ class JournalVoucher(AccountsController): master_type, master_name = frappe.db.get_value("Account", d.account, ["master_type", "master_name"]) if master_type == "Customer" and master_name: - super(DocType, self).check_credit_limit(d.account) + super(JournalVoucher, self).check_credit_limit(d.account) def get_balance(self): if not self.get('entries'): diff --git a/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py b/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py index 36b4e95213..cff24e14e8 100644 --- a/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py +++ b/erpnext/accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py @@ -10,7 +10,7 @@ from frappe import msgprint, _ from frappe.model.document import Document -class PaymentToInvoiceMatchingTool(Document): +class PaymenttoInvoiceMatchingTool(Document): def get_voucher_details(self): total_amount = frappe.db.sql("""select sum(ifnull(debit, 0)) - sum(ifnull(credit, 0)) from `tabGL Entry` diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index b37479614f..88df6bdce5 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -33,7 +33,7 @@ class PurchaseInvoice(BuyingController): if not self.is_opening: self.is_opening = 'No' - super(DocType, self).validate() + super(PurchaseInvoice, self).validate() self.po_required() self.pr_required() @@ -61,10 +61,10 @@ class PurchaseInvoice(BuyingController): self.due_date = get_due_date(self.posting_date, self.supplier, "Supplier", self.credit_to, self.company) - super(DocType, self).set_missing_values(for_validate) + super(PurchaseInvoice, self).set_missing_values(for_validate) def get_advances(self): - super(DocType, self).get_advances(self.credit_to, + super(PurchaseInvoice, self).get_advances(self.credit_to, "Purchase Invoice Advance", "advance_allocation_details", "debit") def check_active_purchase_items(self): @@ -131,7 +131,7 @@ class PurchaseInvoice(BuyingController): raise Exception def validate_with_previous_doc(self): - super(DocType, self).validate_with_previous_doc(self.tname, { + super(PurchaseInvoice, self).validate_with_previous_doc(self.tname, { "Purchase Order": { "ref_dn_field": "purchase_order", "compare_fields": [["supplier", "="], ["company", "="], ["currency", "="]], @@ -154,7 +154,7 @@ class PurchaseInvoice(BuyingController): }) if cint(frappe.defaults.get_global_default('maintain_same_rate')): - super(DocType, self).validate_with_previous_doc(self.tname, { + super(PurchaseInvoice, self).validate_with_previous_doc(self.tname, { "Purchase Order Item": { "ref_dn_field": "po_detail", "compare_fields": [["rate", "="]], diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index b3e9a11e87..ef17f66851 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -38,7 +38,7 @@ class SalesInvoice(SellingController): }] def validate(self): - super(DocType, self).validate() + super(SalesInvoice, self).validate() self.validate_posting_time() self.so_dn_required() self.validate_proj_cust() @@ -150,17 +150,17 @@ class SalesInvoice(SellingController): self.due_date = get_due_date(self.posting_date, self.customer, "Customer", self.debit_to, self.company) - super(DocType, self).set_missing_values(for_validate) + super(SalesInvoice, self).set_missing_values(for_validate) def update_time_log_batch(self, sales_invoice): - for d in self.doclist.get({"doctype":"Sales Invoice Item"}): + for d in self.get(self.fname): if d.time_log_batch: tlb = frappe.get_doc("Time Log Batch", d.time_log_batch) tlb.sales_invoice = sales_invoice tlb.update_after_submit() def validate_time_logs_are_submitted(self): - for d in self.doclist.get({"doctype":"Sales Invoice Item"}): + for d in self.get(self.fname): if d.time_log_batch: status = frappe.db.get_value("Time Log Batch", d.time_log_batch, "status") if status!="Submitted": @@ -206,7 +206,7 @@ class SalesInvoice(SellingController): self.set_taxes("other_charges", "taxes_and_charges") def get_advances(self): - super(DocType, self).get_advances(self.debit_to, + super(SalesInvoice, self).get_advances(self.debit_to, "Sales Invoice Advance", "advance_adjustment_details", "credit") def get_company_abbr(self): @@ -269,7 +269,7 @@ class SalesInvoice(SellingController): msgprint("Please select income head with account type 'Fixed Asset' as Item %s is an asset item" % d.item_code, raise_exception=True) def validate_with_previous_doc(self): - super(DocType, self).validate_with_previous_doc(self.tname, { + super(SalesInvoice, self).validate_with_previous_doc(self.tname, { "Sales Order": { "ref_dn_field": "sales_order", "compare_fields": [["customer", "="], ["company", "="], ["project_name", "="], @@ -283,7 +283,7 @@ class SalesInvoice(SellingController): }) if cint(frappe.defaults.get_global_default('maintain_same_sales_rate')): - super(DocType, self).validate_with_previous_doc(self.tname, { + super(SalesInvoice, self).validate_with_previous_doc(self.tname, { "Sales Order Item": { "ref_dn_field": "so_detail", "compare_fields": [["rate", "="]], @@ -537,7 +537,7 @@ class SalesInvoice(SellingController): # expense account gl entries if cint(frappe.defaults.get_global_default("auto_accounting_for_stock")) \ and cint(self.update_stock): - gl_entries += super(DocType, self).get_gl_entries() + gl_entries += super(SalesInvoice, self).get_gl_entries() def make_pos_gl_entries(self, gl_entries): if cint(self.is_pos) and self.cash_bank_account and self.paid_amount: diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index 81c7dfb9d0..9458ecc9ce 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -26,7 +26,7 @@ class PurchaseOrder(BuyingController): }] def validate(self): - super(DocType, self).validate() + super(PurchaseOrder, self).validate() if not self.status: self.status = "Draft" @@ -47,7 +47,7 @@ class PurchaseOrder(BuyingController): self.update_raw_materials_supplied("po_raw_material_details") def validate_with_previous_doc(self): - super(DocType, self).validate_with_previous_doc(self.tname, { + super(PurchaseOrder, self).validate_with_previous_doc(self.tname, { "Supplier Quotation": { "ref_dn_field": "supplier_quotation", "compare_fields": [["supplier", "="], ["company", "="], ["currency", "="]], diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py index dbca9b5500..ff7e6df6ec 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py @@ -10,7 +10,7 @@ class SupplierQuotation(BuyingController): fname = "quotation_items" def validate(self): - super(DocType, self).validate() + super(SupplierQuotation, self).validate() if not self.status: self.status = "Draft" @@ -33,7 +33,7 @@ class SupplierQuotation(BuyingController): pass def validate_with_previous_doc(self): - super(DocType, self).validate_with_previous_doc(self.tname, { + super(SupplierQuotation, self).validate_with_previous_doc(self.tname, { "Material Request": { "ref_dn_field": "prevdoc_docname", "compare_fields": [["company", "="]], diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index b3155fd79f..083f0a6aaa 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -378,8 +378,8 @@ class AccountsController(TransactionBase): return gl_dict def clear_unallocated_advances(self, childtype, parentfield): - self.doclist.remove_items({"parentfield": parentfield, "allocated_amount": ["in", [0, None, ""]]}) - + self.set(parentfield, self.get(parentfield, {"allocated_amount": ["not in", [0, None, ""]]})) + frappe.db.sql("""delete from `tab%s` where parentfield=%s and parent = %s and ifnull(allocated_amount, 0) = 0""" % (childtype, '%s', '%s'), (parentfield, self.name)) diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index b37213c0e8..24dce4b876 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -40,7 +40,7 @@ class BuyingController(StockController): def set_supplier_from_item_default(self): if self.meta.get_field("supplier") and not self.supplier: - for d in self.doclist.get({"doctype": self.tname}): + for d in self.get(self.fname): supplier = frappe.db.get_value("Item", d.item_code, "default_supplier") if supplier: self.supplier = supplier @@ -50,7 +50,7 @@ class BuyingController(StockController): from erpnext.stock.utils import validate_warehouse_company warehouses = list(set([d.warehouse for d in - self.doclist.get({"doctype": self.tname}) if d.warehouse])) + self.get(self.fname) if d.warehouse])) for w in warehouses: validate_warehouse_company(w, self.company) diff --git a/erpnext/controllers/status_updater.py b/erpnext/controllers/status_updater.py index ba8118ec17..7228100c95 100644 --- a/erpnext/controllers/status_updater.py +++ b/erpnext/controllers/status_updater.py @@ -94,13 +94,13 @@ class StatusUpdater(DocListController): def communication_received(self): if getattr(self, "communication_set", False): - last_comm = self.doclist.get({"doctype":"Communication"}) + last_comm = self.get("communications") if last_comm: return last_comm[-1].sent_or_received == "Received" def communication_sent(self): if getattr(self, "communication_set", False): - last_comm = self.doclist.get({"doctype":"Communication"}) + last_comm = self.get("communications") if last_comm: return last_comm[-1].sent_or_received == "Sent" @@ -113,7 +113,7 @@ class StatusUpdater(DocListController): for args in self.status_updater: # get unique transactions to update - for d in self.doclist: + for d in self.get_all_children(): if d.doctype == args['source_dt'] and d.get(args["join_field"]): args['name'] = d.get(args['join_field']) @@ -191,7 +191,7 @@ class StatusUpdater(DocListController): args['modified_cond'] = ', modified = now()' # update quantities in child table - for d in self.doclist: + for d in self.get_all_children(): if d.doctype == args['source_dt']: # updates qty in the child table args['detail_id'] = d.get(args['join_field']) @@ -212,8 +212,7 @@ class StatusUpdater(DocListController): where name='%(detail_id)s'""" % args) # get unique transactions to update - for name in set([d.get(args['percent_join_field']) for d in self.doclist - if d.doctype == args['source_dt']]): + for name in set([d.get(args['percent_join_field']) for d in self.get_all_children(args['source_dt'])]): if name: args['name'] = name diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py index 33b7fdb26b..e00449dad8 100644 --- a/erpnext/controllers/stock_controller.py +++ b/erpnext/controllers/stock_controller.py @@ -90,7 +90,7 @@ class StockController(AccountsController): warehouse_account = get_warehouse_account() if hasattr(self, "fname"): - item_doclist = self.doclist.get({"parentfield": self.fname}) + item_doclist = self.get(self.fname) elif self.doctype == "Stock Reconciliation": import json item_doclist = [] diff --git a/erpnext/hr/doctype/holiday_list/holiday_list.py b/erpnext/hr/doctype/holiday_list/holiday_list.py index 92cc9f026d..ec15604a30 100644 --- a/erpnext/hr/doctype/holiday_list/holiday_list.py +++ b/erpnext/hr/doctype/holiday_list/holiday_list.py @@ -22,8 +22,7 @@ class HolidayList(Document): self.validate_values() yr_start_date, yr_end_date = self.get_fy_start_end_dates() date_list = self.get_weekly_off_date_list(yr_start_date, yr_end_date) - last_idx = max([cint(d.idx) for d in self.doclist.get( - {"parentfield": "holiday_list_details"})] or [0,]) + last_idx = max([cint(d.idx) for d in self.get("holiday_list_details")] or [0,]) for i, d in enumerate(date_list): ch = self.append('holiday_list_details', {}) ch.description = self.weekly_off diff --git a/erpnext/hr/doctype/hr_settings/hr_settings.py b/erpnext/hr/doctype/hr_settings/hr_settings.py index 861408d064..5cafbdaaa7 100644 --- a/erpnext/hr/doctype/hr_settings/hr_settings.py +++ b/erpnext/hr/doctype/hr_settings/hr_settings.py @@ -10,7 +10,7 @@ from frappe.utils import cint from frappe.model.document import Document -class HrSettings(Document): +class HRSettings(Document): def validate(self): self.update_birthday_reminders() diff --git a/erpnext/hr/doctype/leave_block_list/leave_block_list.py b/erpnext/hr/doctype/leave_block_list/leave_block_list.py index 868b990c54..e9bc6ab7f9 100644 --- a/erpnext/hr/doctype/leave_block_list/leave_block_list.py +++ b/erpnext/hr/doctype/leave_block_list/leave_block_list.py @@ -14,7 +14,7 @@ class LeaveBlockList(Document): def validate(self): dates = [] - for d in self.doclist.get({"doctype":"Leave Block List Date"}): + for d in self.get("leave_block_list_dates"): # validate fiscal year validate_fiscal_year(d.block_date, self.year, _("Block Date")) diff --git a/erpnext/hr/doctype/salary_slip/salary_slip.py b/erpnext/hr/doctype/salary_slip/salary_slip.py index 981935f35c..8c34037516 100644 --- a/erpnext/hr/doctype/salary_slip/salary_slip.py +++ b/erpnext/hr/doctype/salary_slip/salary_slip.py @@ -34,7 +34,7 @@ class SalarySlip(TransactionBase): def pull_sal_struct(self, struct): from erpnext.hr.doctype.salary_structure.salary_structure import get_mapped_doc - self.doclist = get_mapped_doc(struct, self.doclist) + self.update(get_mapped_doc(struct, self)) def pull_emp_details(self): emp = frappe.db.get_value("Employee", self.employee, diff --git a/erpnext/hr/doctype/salary_structure/salary_structure.py b/erpnext/hr/doctype/salary_structure/salary_structure.py index 05e3268558..2bbc99bf6b 100644 --- a/erpnext/hr/doctype/salary_structure/salary_structure.py +++ b/erpnext/hr/doctype/salary_structure/salary_structure.py @@ -82,7 +82,7 @@ def get_mapped_doc(source_name, target_doc=None): sal_slip.run_method("get_leave_details") sal_slip.run_method("calculate_net_pay") - doclist = get_mapped_doc("Salary Structure", source_name, { + doc = get_mapped_doc("Salary Structure", source_name, { "Salary Structure": { "doctype": "Salary Slip", "field_map": { @@ -109,4 +109,4 @@ def get_mapped_doc(source_name, target_doc=None): } }, target_doc, postprocess) - return doclist + return doc diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index 6fdf6414e2..b5072267d4 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -11,7 +11,7 @@ from frappe import msgprint, _ from frappe.model.document import Document -class Bom(Document): +class BOM(Document): def autoname(self): last_name = frappe.db.sql("""select max(name) from `tabBOM` @@ -28,7 +28,7 @@ class Bom(Document): self.validate_main_item() from erpnext.utilities.transaction_base import validate_uom_is_integer - validate_uom_is_integer(self.doclist, "stock_uom", "qty") + validate_uom_is_integer(self, "stock_uom", "qty") self.validate_operations() self.validate_materials() @@ -133,11 +133,11 @@ class Bom(Document): })["rate"] if self.docstatus == 0: - frappe.get_doc(self.doclist).save() + self.save() elif self.docstatus == 1: self.calculate_cost() self.update_exploded_items() - frappe.get_doc(self.doclist).update_after_submit() + self.update_after_submit() def get_bom_unitcost(self, bom_no): bom = frappe.db.sql("""select name, total_cost/quantity as unit_cost from `tabBOM` diff --git a/erpnext/manufacturing/doctype/bom_item/bom_item.py b/erpnext/manufacturing/doctype/bom_item/bom_item.py index f2bef2c7c4..ff3a06f2d8 100644 --- a/erpnext/manufacturing/doctype/bom_item/bom_item.py +++ b/erpnext/manufacturing/doctype/bom_item/bom_item.py @@ -6,5 +6,5 @@ import frappe from frappe.model.document import Document -class BomItem(Document): +class BOMItem(Document): pass \ No newline at end of file diff --git a/erpnext/manufacturing/doctype/bom_operation/bom_operation.py b/erpnext/manufacturing/doctype/bom_operation/bom_operation.py index df55159e1c..8c03fafcb1 100644 --- a/erpnext/manufacturing/doctype/bom_operation/bom_operation.py +++ b/erpnext/manufacturing/doctype/bom_operation/bom_operation.py @@ -6,5 +6,5 @@ import frappe from frappe.model.document import Document -class BomOperation(Document): +class BOMOperation(Document): pass \ No newline at end of file diff --git a/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.py b/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.py index 34f45bdbf9..b772fcb3d3 100644 --- a/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.py +++ b/erpnext/manufacturing/doctype/bom_replace_tool/bom_replace_tool.py @@ -8,7 +8,7 @@ from frappe import msgprint, _ from frappe.model.document import Document -class BomReplaceTool(Document): +class BOMReplaceTool(Document): def replace_bom(self): self.validate_bom() self.update_new_bom() diff --git a/erpnext/manufacturing/doctype/production_order/production_order.py b/erpnext/manufacturing/doctype/production_order/production_order.py index efdf2c4f49..75f40fa1ef 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.py +++ b/erpnext/manufacturing/doctype/production_order/production_order.py @@ -26,7 +26,7 @@ class ProductionOrder(Document): self.validate_warehouse() from erpnext.utilities.transaction_base import validate_uom_is_integer - validate_uom_is_integer(self.doclist, "stock_uom", ["qty", "produced_qty"]) + validate_uom_is_integer(self, "stock_uom", ["qty", "produced_qty"]) def validate_bom_no(self): if self.bom_no: diff --git a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py index cec6471bb2..c94a72ca43 100644 --- a/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py +++ b/erpnext/manufacturing/doctype/production_planning_tool/production_planning_tool.py @@ -173,7 +173,7 @@ class ProductionPlanningTool(Document): self.validate_data() from erpnext.utilities.transaction_base import validate_uom_is_integer - validate_uom_is_integer(self.doclist, "stock_uom", "planned_qty") + validate_uom_is_integer(self, "stock_uom", "planned_qty") items = self.get_distinct_items_and_boms()[1] pro = self.create_production_order(items) diff --git a/erpnext/projects/doctype/time_log_batch/time_log_batch.py b/erpnext/projects/doctype/time_log_batch/time_log_batch.py index 9405e46c38..4ad8130d8d 100644 --- a/erpnext/projects/doctype/time_log_batch/time_log_batch.py +++ b/erpnext/projects/doctype/time_log_batch/time_log_batch.py @@ -14,7 +14,7 @@ class TimeLogBatch(Document): def validate(self): self.set_status() self.total_hours = 0.0 - for d in self.doclist.get({"doctype":"Time Log Batch Detail"}): + for d in self.get("time_log_batch_details"): tl = frappe.get_doc("Time Log", d.time_log) self.update_time_log_values(d, tl) self.validate_time_log_is_submitted(tl) @@ -53,7 +53,7 @@ class TimeLogBatch(Document): def update_status(self, time_log_batch): self.set_status() - for d in self.doclist.get({"doctype":"Time Log Batch Detail"}): + for d in self.get("time_log_batch_details"): tl = frappe.get_doc("Time Log", d.time_log) tl.time_log_batch = time_log_batch tl.sales_invoice = self.sales_invoice diff --git a/erpnext/selling/doctype/lead/lead.py b/erpnext/selling/doctype/lead/lead.py index 743dc04c6f..df57cf5bc1 100644 --- a/erpnext/selling/doctype/lead/lead.py +++ b/erpnext/selling/doctype/lead/lead.py @@ -38,7 +38,7 @@ class Lead(SellingController): self.add_calendar_event() def add_calendar_event(self, opts=None, force=False): - super(DocType, self).add_calendar_event({ + super(Lead, self).add_calendar_event({ "owner": self.lead_owner, "subject": ('Contact ' + cstr(self.lead_name)), "description": ('Contact ' + cstr(self.lead_name)) + \ diff --git a/erpnext/selling/doctype/opportunity/opportunity.py b/erpnext/selling/doctype/opportunity/opportunity.py index 0ded247cb2..a2358a3250 100644 --- a/erpnext/selling/doctype/opportunity/opportunity.py +++ b/erpnext/selling/doctype/opportunity/opportunity.py @@ -78,7 +78,7 @@ class Opportunity(TransactionBase): if self.to_discuss: opts.description += ' To Discuss : ' + cstr(self.to_discuss) - super(DocType, self).add_calendar_event(opts, force) + super(Opportunity, self).add_calendar_event(opts, force) def validate_item_details(self): if not self.get('enquiry_details'): diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py index 0f64880999..45a9d0bf32 100644 --- a/erpnext/selling/doctype/quotation/quotation.py +++ b/erpnext/selling/doctype/quotation/quotation.py @@ -10,8 +10,8 @@ from frappe import _, msgprint from erpnext.controllers.selling_controller import SellingController class Quotation(SellingController): - self.tname = 'Quotation Item' - self.fname = 'quotation_details' + tname = 'Quotation Item' + fname = 'quotation_details' def has_sales_order(self): return frappe.db.get_value("Sales Order Item", {"prevdoc_docname": self.name, "docstatus": 1}) @@ -26,7 +26,7 @@ class Quotation(SellingController): chk_dupl_itm.append([cstr(d.item_code),cstr(d.description)]) def validate_order_type(self): - super(DocType, self).validate_order_type() + super(Quotation, self).validate_order_type() if self.order_type in ['Maintenance', 'Service']: for d in self.get('quotation_details'): @@ -46,15 +46,16 @@ class Quotation(SellingController): raise Exception def validate(self): - super(DocType, self).validate() + super(Quotation, self).validate() self.set_status() self.validate_order_type() self.validate_for_items() self.validate_uom_is_integer("stock_uom", "qty") def update_opportunity(self): - for opportunity in self.doclist.get_distinct_values("prevdoc_docname"): - frappe.get_doc("Opportunity", opportunity).set_status(update=True) + for opportunity in list(set([d.prevdoc_docname for d in self.get("quotation_details")])): + if opportunity: + frappe.get_doc("Opportunity", opportunity).set_status(update=True) def declare_order_lost(self, arg): if not self.has_sales_order(): diff --git a/erpnext/selling/doctype/sales_bom/sales_bom.py b/erpnext/selling/doctype/sales_bom/sales_bom.py index 207bdcbe6e..5601d7ff67 100644 --- a/erpnext/selling/doctype/sales_bom/sales_bom.py +++ b/erpnext/selling/doctype/sales_bom/sales_bom.py @@ -6,7 +6,7 @@ import frappe from frappe.model.document import Document -class SalesBom(Document): +class SalesBOM(Document): def autoname(self): @@ -16,7 +16,7 @@ class SalesBom(Document): self.validate_main_item() from erpnext.utilities.transaction_base import validate_uom_is_integer - validate_uom_is_integer(self.doclist, "uom", "qty") + validate_uom_is_integer(self, "uom", "qty") def validate_main_item(self): """main item must have Is Stock Item as No and Is Sales Item as Yes""" diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index 6db638b2a8..42b3596f3e 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -78,7 +78,7 @@ class SalesOrder(SellingController): and current Sales Order""" % (self.order_type, d.prevdoc_docname)) def validate_order_type(self): - super(DocType, self).validate_order_type() + super(SalesOrder, self).validate_order_type() def validate_delivery_date(self): if self.order_type == 'Sales' and not self.delivery_date: @@ -97,7 +97,7 @@ class SalesOrder(SellingController): raise Exception def validate(self): - super(DocType, self).validate() + super(SalesOrder, self).validate() self.validate_order_type() self.validate_delivery_date() @@ -110,7 +110,7 @@ class SalesOrder(SellingController): from erpnext.stock.doctype.packed_item.packed_item import make_packing_list - self.doclist = make_packing_list(self,'sales_order_details') + make_packing_list(self,'sales_order_details') self.validate_with_previous_doc() @@ -128,13 +128,13 @@ class SalesOrder(SellingController): from erpnext.stock.utils import validate_warehouse_company warehouses = list(set([d.warehouse for d in - self.doclist.get({"doctype": self.tname}) if d.warehouse])) + self.get(self.fname) if d.warehouse])) for w in warehouses: validate_warehouse_company(w, self.company) def validate_with_previous_doc(self): - super(DocType, self).validate_with_previous_doc(self.tname, { + super(SalesOrder, self).validate_with_previous_doc(self.tname, { "Quotation": { "ref_dn_field": "prevdoc_docname", "compare_fields": [["company", "="], ["currency", "="]] @@ -148,12 +148,13 @@ class SalesOrder(SellingController): frappe.db.sql("update `tabOpportunity` set status = %s where name=%s",(flag,enq[0][0])) def update_prevdoc_status(self, flag): - for quotation in self.doclist.get_distinct_values("prevdoc_docname"): - bean = frappe.get_doc("Quotation", quotation) - if bean.docstatus==2: - frappe.throw(quotation + ": " + frappe._("Quotation is cancelled.")) + for quotation in list(set([d.prevdoc_docname for d in self.get(self.fname)])): + if quotation: + doc = frappe.get_doc("Quotation", quotation) + if doc.docstatus==2: + frappe.throw(quotation + ": " + frappe._("Quotation is cancelled.")) - bean.set_status(update=True) + doc.set_status(update=True) def on_submit(self): self.update_stock_ledger(update_stock = 1) diff --git a/erpnext/selling/doctype/sms_center/sms_center.py b/erpnext/selling/doctype/sms_center/sms_center.py index 487df38644..209d1b4c38 100644 --- a/erpnext/selling/doctype/sms_center/sms_center.py +++ b/erpnext/selling/doctype/sms_center/sms_center.py @@ -9,7 +9,7 @@ from frappe import msgprint, _ from frappe.model.document import Document -class SmsCenter(Document): +class SMSCenter(Document): def create_receiver_list(self): rec, where_clause = '', '' diff --git a/erpnext/setup/doctype/backup_manager/backup_manager.py b/erpnext/setup/doctype/backup_manager/backup_manager.py index 8f7e891ad3..ff4e115077 100644 --- a/erpnext/setup/doctype/backup_manager/backup_manager.py +++ b/erpnext/setup/doctype/backup_manager/backup_manager.py @@ -10,6 +10,7 @@ from frappe import _ from frappe.model.document import Document class BackupManager(Document): + pass def take_backups_daily(): take_backups_if("Daily") diff --git a/erpnext/setup/doctype/currency/currency.py b/erpnext/setup/doctype/currency/currency.py index 5541065437..9dc6e3b229 100644 --- a/erpnext/setup/doctype/currency/currency.py +++ b/erpnext/setup/doctype/currency/currency.py @@ -8,7 +8,8 @@ from frappe import throw, _ from frappe.model.document import Document class Currency(Document): - + pass + def validate_conversion_rate(currency, conversion_rate, conversion_rate_label, company): """common validation for currency and price list currency""" diff --git a/erpnext/setup/doctype/customer_group/customer_group.py b/erpnext/setup/doctype/customer_group/customer_group.py index 425741b169..444356752d 100644 --- a/erpnext/setup/doctype/customer_group/customer_group.py +++ b/erpnext/setup/doctype/customer_group/customer_group.py @@ -8,7 +8,7 @@ from frappe import msgprint from frappe.utils.nestedset import DocTypeNestedSet class CustomerGroup(DocTypeNestedSet): - self.nsm_parent_field = 'parent_customer_group'; + nsm_parent_field = 'parent_customer_group'; def validate(self): if frappe.db.sql("select name from `tabCustomer Group` where name = %s and docstatus = 2", @@ -19,7 +19,7 @@ class CustomerGroup(DocTypeNestedSet): def on_update(self): self.validate_name_with_customer() - super(DocType, self).on_update() + super(CustomerGroup, self).on_update() self.validate_one_root() def validate_name_with_customer(self): @@ -44,4 +44,4 @@ class CustomerGroup(DocTypeNestedSet): You can not trash/cancel/delete this customer group.", raise_exception=1) # rebuild tree - super(DocType, self).on_trash() + super(CustomerGroup, self).on_trash() diff --git a/erpnext/setup/doctype/email_digest/email_digest.py b/erpnext/setup/doctype/email_digest/email_digest.py index e077c95715..a61955562c 100644 --- a/erpnext/setup/doctype/email_digest/email_digest.py +++ b/erpnext/setup/doctype/email_digest/email_digest.py @@ -471,7 +471,6 @@ class EmailDigest(DocListController): self.get_next_sending() def send(): - from frappe.utils import getdate now_date = now_datetime().date() for ed in frappe.db.sql("""select name from `tabEmail Digest` diff --git a/erpnext/setup/doctype/features_setup/features_setup.py b/erpnext/setup/doctype/features_setup/features_setup.py index 1009b27f5a..3d3367a4eb 100644 --- a/erpnext/setup/doctype/features_setup/features_setup.py +++ b/erpnext/setup/doctype/features_setup/features_setup.py @@ -12,6 +12,6 @@ class FeaturesSetup(Document): """ from frappe.model import default_fields from frappe.utils import set_default - for key in self.fields: + for key in self.meta.get_valid_columns(): if key not in default_fields: set_default(key, self.get(key)) diff --git a/erpnext/setup/doctype/naming_series/naming_series.py b/erpnext/setup/doctype/naming_series/naming_series.py index 8fc596e05f..cf2c29fe1f 100644 --- a/erpnext/setup/doctype/naming_series/naming_series.py +++ b/erpnext/setup/doctype/naming_series/naming_series.py @@ -55,7 +55,7 @@ class NamingSeries(Document): default = options[0] # update in property setter - prop_dict = {'options': "\n".join(options), 'default': default} + prop_dict = {'options': "\n".join(options), 'default': default} for prop in prop_dict: ps_exists = frappe.db.sql("""SELECT name FROM `tabProperty Setter` WHERE doc_type = %s AND field_name = 'naming_series' diff --git a/erpnext/setup/doctype/sales_person/sales_person.py b/erpnext/setup/doctype/sales_person/sales_person.py index db2057db10..7f87210651 100644 --- a/erpnext/setup/doctype/sales_person/sales_person.py +++ b/erpnext/setup/doctype/sales_person/sales_person.py @@ -8,7 +8,7 @@ from frappe.utils import flt from frappe.utils.nestedset import DocTypeNestedSet class SalesPerson(DocTypeNestedSet): - self.nsm_parent_field = 'parent_sales_person'; + nsm_parent_field = 'parent_sales_person'; def validate(self): for d in self.get('target_details'): @@ -16,7 +16,7 @@ class SalesPerson(DocTypeNestedSet): frappe.throw(_("Either target qty or target amount is mandatory.")) def on_update(self): - super(DocType, self).on_update() + super(SalesPerson, self).on_update() self.validate_one_root() def get_email_id(self): diff --git a/erpnext/setup/doctype/sms_parameter/sms_parameter.py b/erpnext/setup/doctype/sms_parameter/sms_parameter.py index 4c54a4f404..a62da69f69 100644 --- a/erpnext/setup/doctype/sms_parameter/sms_parameter.py +++ b/erpnext/setup/doctype/sms_parameter/sms_parameter.py @@ -6,5 +6,5 @@ import frappe from frappe.model.document import Document -class SmsParameter(Document): +class SMSParameter(Document): pass \ No newline at end of file diff --git a/erpnext/setup/doctype/sms_settings/sms_settings.py b/erpnext/setup/doctype/sms_settings/sms_settings.py index 9361d3b620..281ae7672c 100644 --- a/erpnext/setup/doctype/sms_settings/sms_settings.py +++ b/erpnext/setup/doctype/sms_settings/sms_settings.py @@ -6,5 +6,5 @@ import frappe from frappe.model.document import Document -class SmsSettings(Document): +class SMSSettings(Document): pass \ No newline at end of file diff --git a/erpnext/setup/doctype/territory/territory.py b/erpnext/setup/doctype/territory/territory.py index ed2d5f1de8..a015644e64 100644 --- a/erpnext/setup/doctype/territory/territory.py +++ b/erpnext/setup/doctype/territory/territory.py @@ -19,5 +19,5 @@ class Territory(DocTypeNestedSet): raise Exception def on_update(self): - super(DocType, self).on_update() + super(Territory, self).on_update() self.validate_one_root() diff --git a/erpnext/setup/doctype/uom/uom.py b/erpnext/setup/doctype/uom/uom.py index 2d076f6584..882226348a 100644 --- a/erpnext/setup/doctype/uom/uom.py +++ b/erpnext/setup/doctype/uom/uom.py @@ -6,5 +6,5 @@ import frappe from frappe.model.document import Document -class Uom(Document): +class UOM(Document): pass \ No newline at end of file diff --git a/erpnext/setup/install.py b/erpnext/setup/install.py index c7955d90e2..a7e91d1605 100644 --- a/erpnext/setup/install.py +++ b/erpnext/setup/install.py @@ -111,19 +111,19 @@ def import_defaults(): from frappe.modules import scrub for r in records: - bean = frappe.get_doc(r) + doc = frappe.get_doc(r) # ignore mandatory for root - parent_link_field = ("parent_" + scrub(bean.doctype)) - if parent_link_field in bean.fields and not bean.get(parent_link_field): - bean.ignore_mandatory = True + parent_link_field = ("parent_" + scrub(doc.doctype)) + if doc.meta.get_field(parent_link_field) and not doc.get(parent_link_field): + doc.ignore_mandatory = True - bean.insert() + doc.insert() def feature_setup(): """save global defaults and features setup""" - bean = frappe.get_doc("Features Setup", "Features Setup") - bean.ignore_permissions = True + doc = frappe.get_doc("Features Setup", "Features Setup") + doc.ignore_permissions = True # store value as 1 for all these fields flds = ['fs_item_serial_nos', 'fs_item_batch_nos', 'fs_brands', 'fs_item_barcode', @@ -133,8 +133,8 @@ def feature_setup(): 'fs_recurring_invoice', 'fs_pos', 'fs_manufacturing', 'fs_quality', 'fs_page_break', 'fs_more_info', 'fs_pos_view' ] - bean.update(dict(zip(flds, [1]*len(flds)))) - bean.save() + doc.update(dict(zip(flds, [1]*len(flds)))) + doc.save() def set_single_defaults(): for dt in frappe.db.sql_list("""select name from `tabDocType` where issingle=1"""): diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index 1489590424..12ecb0961b 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -13,21 +13,21 @@ from erpnext.stock.utils import update_bin from erpnext.controllers.selling_controller import SellingController class DeliveryNote(SellingController): - self.tname = 'Delivery Note Item' - self.fname = 'delivery_note_details' - self.status_updater = [{ - 'source_dt': 'Delivery Note Item', - 'target_dt': 'Sales Order Item', - 'join_field': 'prevdoc_detail_docname', - 'target_field': 'delivered_qty', - 'target_parent_dt': 'Sales Order', - 'target_parent_field': 'per_delivered', - 'target_ref_field': 'qty', - 'source_field': 'qty', - 'percent_join_field': 'against_sales_order', - 'status_field': 'delivery_status', - 'keyword': 'Delivered' - }] + tname = 'Delivery Note Item' + fname = 'delivery_note_details' + status_updater = [{ + 'source_dt': 'Delivery Note Item', + 'target_dt': 'Sales Order Item', + 'join_field': 'prevdoc_detail_docname', + 'target_field': 'delivered_qty', + 'target_parent_dt': 'Sales Order', + 'target_parent_field': 'per_delivered', + 'target_ref_field': 'qty', + 'source_field': 'qty', + 'percent_join_field': 'against_sales_order', + 'status_field': 'delivery_status', + 'keyword': 'Delivered' + }] def onload(self): billed_qty = frappe.db.sql("""select sum(ifnull(qty, 0)) from `tabSales Invoice Item` @@ -56,7 +56,7 @@ class DeliveryNote(SellingController): def validate(self): - super(DocType, self).validate() + super(DeliveryNote, self).validate() from erpnext.utilities import validate_status validate_status(self.status, ["Draft", "Submitted", "Cancelled"]) @@ -71,7 +71,7 @@ class DeliveryNote(SellingController): self.validate_with_previous_doc() from erpnext.stock.doctype.packed_item.packed_item import make_packing_list - self.doclist = make_packing_list(self, 'delivery_note_details') + make_packing_list(self, 'delivery_note_details') self.status = 'Draft' if not self.installation_status: self.installation_status = 'Not Installed' @@ -80,8 +80,8 @@ class DeliveryNote(SellingController): items = self.get("delivery_note_details") for fn in (("Sales Order", "against_sales_order"), ("Sales Invoice", "against_sales_invoice")): - if items.get_distinct_values(fn[1]): - super(DocType, self).validate_with_previous_doc(self.tname, { + if filter(None, [(d[fn[1]] or None) for d in self.get(self.fname)]): + super(DeliveryNote, self).validate_with_previous_doc(self.tname, { fn[0]: { "ref_dn_field": fn[1], "compare_fields": [["customer", "="], ["company", "="], ["project_name", "="], @@ -90,7 +90,7 @@ class DeliveryNote(SellingController): }) if cint(frappe.defaults.get_global_default('maintain_same_sales_rate')): - super(DocType, self).validate_with_previous_doc(self.tname, { + super(DeliveryNote, self).validate_with_previous_doc(self.tname, { fn[0] + " Item": { "ref_dn_field": "prevdoc_detail_docname", "compare_fields": [["rate", "="]], diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index 4741bde11a..f10b33827e 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -179,8 +179,7 @@ class Item(DocListController): frappe.throw(_("As there are existing stock transactions for this item, you can not change the values of 'Has Serial No', 'Is Stock Item' and 'Valuation Method'")) def validate_item_type_for_reorder(self): - if self.re_order_level or len(self.doclist.get({"parentfield": "item_reorder", - "material_request_type": "Purchase"})): + if self.re_order_level or len(self.get("item_reorder", {"material_request_type": "Purchase"})): if not self.is_purchase_item: frappe.msgprint(_("""To set reorder level, item must be Purchase Item"""), raise_exception=1) diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py index f9ba9b527f..312a5a371b 100644 --- a/erpnext/stock/doctype/material_request/material_request.py +++ b/erpnext/stock/doctype/material_request/material_request.py @@ -12,8 +12,8 @@ from frappe import msgprint, _ from erpnext.controllers.buying_controller import BuyingController class MaterialRequest(BuyingController): - self.tname = 'Material Request Item' - self.fname = 'indent_details' + tname = 'Material Request Item' + fname = 'indent_details' def check_if_already_pulled(self): pass#if self.[d.sales_order_no for d in self.get('indent_details')] @@ -55,7 +55,7 @@ class MaterialRequest(BuyingController): # Validate # --------------------- def validate(self): - super(DocType, self).validate() + super(MaterialRequest, self).validate() self.validate_schedule_date() self.validate_uom_is_integer("uom", "qty") diff --git a/erpnext/stock/doctype/packed_item/packed_item.py b/erpnext/stock/doctype/packed_item/packed_item.py index 755c110875..5a09121b4f 100644 --- a/erpnext/stock/doctype/packed_item/packed_item.py +++ b/erpnext/stock/doctype/packed_item/packed_item.py @@ -11,6 +11,7 @@ from frappe.utils import cstr, flt from frappe.model.document import Document class PackedItem(Document): + pass def get_sales_bom_items(item_code): return frappe.db.sql("""select t1.item_code, t1.qty, t1.uom @@ -62,7 +63,7 @@ def make_packing_list(obj, item_table_fieldname): """make packing list for sales bom item""" packing_list_idx = 0 parent_items = [] - for d in obj.doclist.get({"parentfield": item_table_fieldname}): + for d in obj.get(item_table_fieldname): warehouse = (item_table_fieldname == "sales_order_details") \ and d.warehouse or d.warehouse if frappe.db.get_value("Sales BOM", {"new_item_code": d.item_code}): @@ -73,23 +74,22 @@ def make_packing_list(obj, item_table_fieldname): if [d.item_code, d.name] not in parent_items: parent_items.append([d.item_code, d.name]) - obj.doclist = cleanup_packing_list(obj, parent_items) - - return obj.doclist - + cleanup_packing_list(obj, parent_items) + def cleanup_packing_list(obj, parent_items): """Remove all those child items which are no longer present in main item table""" delete_list = [] for d in obj.get("packing_details"): if [d.parent_item, d.parent_detail_docname] not in parent_items: # mark for deletion from doclist - delete_list.append([d.parent_item, d.parent_detail_docname]) + delete_list.append(d) if not delete_list: - return obj.doclist + return obj - # delete from doclist - obj.doclist = frappe.doclist(filter(lambda d: [d.parent_item, d.parent_detail_docname] - not in delete_list, obj.doclist)) - - return obj.doclist \ No newline at end of file + packing_details = obj.get("packing_details") + obj.set("packing_details", []) + for d in packing_details: + if d not in delete_list: + obj.append("packing_details", d) + \ No newline at end of file diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py index 9d363d3fb8..8dde16b32c 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py @@ -12,20 +12,20 @@ from erpnext.stock.utils import update_bin from erpnext.controllers.buying_controller import BuyingController class PurchaseReceipt(BuyingController): - self.tname = 'Purchase Receipt Item' - self.fname = 'purchase_receipt_details' - self.count = 0 - self.status_updater = [{ - 'source_dt': 'Purchase Receipt Item', - 'target_dt': 'Purchase Order Item', - 'join_field': 'prevdoc_detail_docname', - 'target_field': 'received_qty', - 'target_parent_dt': 'Purchase Order', - 'target_parent_field': 'per_received', - 'target_ref_field': 'qty', - 'source_field': 'qty', - 'percent_join_field': 'prevdoc_docname', - }] + tname = 'Purchase Receipt Item' + fname = 'purchase_receipt_details' + count = 0 + status_updater = [{ + 'source_dt': 'Purchase Receipt Item', + 'target_dt': 'Purchase Order Item', + 'join_field': 'prevdoc_detail_docname', + 'target_field': 'received_qty', + 'target_parent_dt': 'Purchase Order', + 'target_parent_field': 'per_received', + 'target_ref_field': 'qty', + 'source_field': 'qty', + 'percent_join_field': 'prevdoc_docname', + }] def onload(self): billed_qty = frappe.db.sql("""select sum(ifnull(qty, 0)) from `tabPurchase Invoice Item` @@ -35,7 +35,7 @@ class PurchaseReceipt(BuyingController): self.set("__billing_complete", billed_qty[0][0] == total_qty) def validate(self): - super(DocType, self).validate() + super(PurchaseReceipt, self).validate() self.po_required() @@ -101,7 +101,7 @@ class PurchaseReceipt(BuyingController): Please enter a valid Challan No.", raise_exception=1) def validate_with_previous_doc(self): - super(DocType, self).validate_with_previous_doc(self.tname, { + super(PurchaseReceipt, self).validate_with_previous_doc(self.tname, { "Purchase Order": { "ref_dn_field": "prevdoc_docname", "compare_fields": [["supplier", "="], ["company", "="], ["currency", "="]], @@ -114,7 +114,7 @@ class PurchaseReceipt(BuyingController): }) if cint(frappe.defaults.get_global_default('maintain_same_rate')): - super(DocType, self).validate_with_previous_doc(self.tname, { + super(PurchaseReceipt, self).validate_with_previous_doc(self.tname, { "Purchase Order Item": { "ref_dn_field": "prevdoc_detail_docname", "compare_fields": [["rate", "="]], @@ -289,7 +289,7 @@ class PurchaseReceipt(BuyingController): def get_gl_entries(self, warehouse_account=None): against_stock_account = self.get_company_default("stock_received_but_not_billed") - gl_entries = super(DocType, self).get_gl_entries(warehouse_account, against_stock_account) + gl_entries = super(PurchaseReceipt, self).get_gl_entries(warehouse_account, against_stock_account) return gl_entries diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index 6191811a9c..0999da0f95 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -23,7 +23,7 @@ class StockOverProductionError(frappe.ValidationError): pass from erpnext.controllers.stock_controller import StockController class StockEntry(StockController): - self.fname = 'mtn_details' + fname = 'mtn_details' def validate(self): self.validate_posting_time() @@ -83,8 +83,7 @@ class StockEntry(StockController): source_mandatory = ["Material Issue", "Material Transfer", "Purchase Return"] target_mandatory = ["Material Receipt", "Material Transfer", "Sales Return"] - validate_for_manufacture_repack = any([d.bom_no for d in self.doclist.get( - {"parentfield": "mtn_details"})]) + validate_for_manufacture_repack = any([d.bom_no for d in self.get("mtn_details")]) if self.purpose in source_mandatory and self.purpose not in target_mandatory: self.to_warehouse = None diff --git a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py index 2ddf8318e3..1cc9c178c8 100644 --- a/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/stock_reconciliation.py @@ -279,10 +279,9 @@ class StockReconciliation(StockController): if not self.cost_center: msgprint(_("Please enter Cost Center"), raise_exception=1) - return super(DocType, self).get_gl_entries(warehouse_account, + return super(StockReconciliation, self).get_gl_entries(warehouse_account, self.expense_account, self.cost_center) - def validate_expense_account(self): if not cint(frappe.defaults.get_global_default("auto_accounting_for_stock")): return diff --git a/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.py b/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.py index 48f5a3dfad..770c6df2ad 100644 --- a/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.py +++ b/erpnext/stock/doctype/stock_uom_replace_utility/stock_uom_replace_utility.py @@ -9,7 +9,7 @@ from frappe import msgprint, _ from frappe.model.document import Document -class StockUomReplaceUtility(Document): +class StockUOMReplaceUtility(Document): def validate_mandatory(self): if not cstr(self.item_code): msgprint("Please Enter an Item.") diff --git a/erpnext/support/doctype/newsletter/newsletter.py b/erpnext/support/doctype/newsletter/newsletter.py index 8518a377ad..2dce58a440 100644 --- a/erpnext/support/doctype/newsletter/newsletter.py +++ b/erpnext/support/doctype/newsletter/newsletter.py @@ -10,12 +10,11 @@ from frappe import msgprint, throw, _ from frappe.model.document import Document class Newsletter(Document): - def onload(self): if self.email_sent: - self.set("__status_count", dict(frappe.db.sql("""select status, count(*)) + self.set("__status_count", dict(frappe.db.sql("""select status, count(*) from `tabBulk Email` where ref_doctype=%s and ref_docname=%s - group by status""", (self.doctype, self.name))) or None + group by status""", (self.doctype, self.name))) or None) def test_send(self, doctype="Lead"): self.recipients = self.test_email_id.split(",") diff --git a/erpnext/support/doctype/support_email_settings/support_email_settings.py b/erpnext/support/doctype/support_email_settings/support_email_settings.py index e4e33f8636..1efa628a1b 100644 --- a/erpnext/support/doctype/support_email_settings/support_email_settings.py +++ b/erpnext/support/doctype/support_email_settings/support_email_settings.py @@ -7,6 +7,8 @@ from __future__ import unicode_literals import frappe from frappe.model.document import Document +from frappe.utils.email_lib.receive import POP3Mailbox +import _socket, poplib class SupportEmailSettings(Document): @@ -14,10 +16,7 @@ class SupportEmailSettings(Document): """ Checks support ticket email settings """ - if self.sync_support_mails and self.mail_server: - from frappe.utils.email_lib.receive import POP3Mailbox - import _socket, poplib - + if self.sync_support_mails and self.mail_server: inc_email = frappe.get_doc('Incoming Email Settings') # inc_email.encode() inc_email.host = self.mail_server diff --git a/erpnext/utilities/doctype/rename_tool/rename_tool.py b/erpnext/utilities/doctype/rename_tool/rename_tool.py index 7ee46df645..42c69f624c 100644 --- a/erpnext/utilities/doctype/rename_tool/rename_tool.py +++ b/erpnext/utilities/doctype/rename_tool/rename_tool.py @@ -10,6 +10,7 @@ from frappe import _ from frappe.model.document import Document class RenameTool(Document): + pass @frappe.whitelist() def get_doctypes(): diff --git a/erpnext/utilities/doctype/sms_control/sms_control.py b/erpnext/utilities/doctype/sms_control/sms_control.py index 6b8c684ec6..4408212bde 100644 --- a/erpnext/utilities/doctype/sms_control/sms_control.py +++ b/erpnext/utilities/doctype/sms_control/sms_control.py @@ -10,7 +10,7 @@ from frappe import msgprint, throw, _ from frappe.model.document import Document -class SmsControl(Document): +class SMSControl(Document): def validate_receiver_nos(self,receiver_list): validated_receiver_list = [] diff --git a/erpnext/utilities/doctype/sms_log/sms_log.py b/erpnext/utilities/doctype/sms_log/sms_log.py index 573054e66e..771cb699b3 100644 --- a/erpnext/utilities/doctype/sms_log/sms_log.py +++ b/erpnext/utilities/doctype/sms_log/sms_log.py @@ -6,5 +6,5 @@ import frappe from frappe.model.document import Document -class SmsLog(Document): +class SMSLog(Document): pass diff --git a/erpnext/utilities/transaction_base.py b/erpnext/utilities/transaction_base.py index 4be3d6fb24..aa30b68fa3 100644 --- a/erpnext/utilities/transaction_base.py +++ b/erpnext/utilities/transaction_base.py @@ -63,7 +63,7 @@ class TransactionBase(StatusUpdater): is_child = val.get("is_child_table") ref_doc = {} item_ref_dn = [] - for d in self.doclist.get({"doctype": source_dt}): + for d in self.get_all_children(source_dt): ref_dn = d.get(val["ref_dn_field"]) if ref_dn: if is_child: @@ -96,17 +96,18 @@ def delete_events(ref_type, ref_name): class UOMMustBeIntegerError(frappe.ValidationError): pass -def validate_uom_is_integer(doclist, uom_field, qty_fields): +def validate_uom_is_integer(doc, uom_field, qty_fields): if isinstance(qty_fields, basestring): qty_fields = [qty_fields] + distinct_uoms = list(set([d.get(uom_field) for d in doc.get_all_children()])) integer_uoms = filter(lambda uom: frappe.db.get_value("UOM", uom, - "must_be_whole_number") or None, doclist.get_distinct_values(uom_field)) + "must_be_whole_number") or None, distinct_uoms) if not integer_uoms: return - for d in doclist: + for d in doc.get_all_children(): if d.get(uom_field) in integer_uoms: for f in qty_fields: if d.get(f): From cfb6ccfe5147ecd75baf0aee3442cdca12258448 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 3 Apr 2014 11:46:52 +0530 Subject: [PATCH 20/42] frappe/frappe#478 removed self.doclist --- erpnext/stock/doctype/delivery_note/delivery_note.py | 6 ++---- erpnext/stock/doctype/item/item.py | 7 +++++-- erpnext/stock/doctype/packing_slip/packing_slip.py | 6 +++--- erpnext/stock/doctype/stock_entry/stock_entry.py | 5 +---- erpnext/utilities/doctype/note/note.py | 2 +- erpnext/utilities/transaction_base.py | 2 +- 6 files changed, 13 insertions(+), 15 deletions(-) diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index 12ecb0961b..59ce41f9dc 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -182,12 +182,10 @@ class DeliveryNote(SellingController): """ Validate that if packed qty exists, it should be equal to qty """ - if not any([flt(d.get('packed_qty')) for d in self.doclist if - d.doctype=='Delivery Note Item']): + if not any([flt(d.get('packed_qty')) for d in self.get(self.fname)]): return packing_error_list = [] - for d in self.doclist: - if d.doctype != 'Delivery Note Item': continue + for d in self.get(self.fname): if flt(d.get('qty')) != flt(d.get('packed_qty')): packing_error_list.append([ d.get('item_code', ''), diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index f10b33827e..54ac383a42 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -62,10 +62,13 @@ class Item(DocListController): ch = self.append('uom_conversion_details', {}) ch.uom = self.stock_uom ch.conversion_factor = 1 - + + to_remove = [] for d in self.get("uom_conversion_details"): if d.conversion_factor == 1 and d.uom != self.stock_uom: - self.doclist.remove(d) + to_remove.append(d) + + [self.remove(d) for d in to_remove] def check_stock_uom_with_bin(self): diff --git a/erpnext/stock/doctype/packing_slip/packing_slip.py b/erpnext/stock/doctype/packing_slip/packing_slip.py index c4f69acc41..18609831fe 100644 --- a/erpnext/stock/doctype/packing_slip/packing_slip.py +++ b/erpnext/stock/doctype/packing_slip/packing_slip.py @@ -24,8 +24,8 @@ class PackingSlip(Document): self.validate_qty() from erpnext.utilities.transaction_base import validate_uom_is_integer - validate_uom_is_integer(self.doclist, "stock_uom", "qty") - validate_uom_is_integer(self.doclist, "weight_uom", "net_weight") + validate_uom_is_integer(self, "stock_uom", "qty") + validate_uom_is_integer(self, "weight_uom", "net_weight") def validate_delivery_note(self): """ @@ -104,7 +104,7 @@ class PackingSlip(Document): group by item_code""" % ("%s", condition), tuple([self.delivery_note] + rows), as_dict=1) - ps_item_qty = dict([[d.item_code, d.qty] for d in self.doclist]) + ps_item_qty = dict([[d.item_code, d.qty] for d in self.get("item_details")]) no_of_cases = cint(self.to_case_no) - cint(self.from_case_no) + 1 return res, ps_item_qty, no_of_cases diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index 0999da0f95..1bcceaf01c 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -423,10 +423,7 @@ class StockEntry(StockController): } return ret - def get_items(self): - self.doclist = filter(lambda d: d.parentfield!="mtn_details", self.doclist) - # self.set('mtn_details', []) - + def get_items(self): pro_obj = None if self.production_order: # common validations diff --git a/erpnext/utilities/doctype/note/note.py b/erpnext/utilities/doctype/note/note.py index a53313bb6d..f0c7f0e922 100644 --- a/erpnext/utilities/doctype/note/note.py +++ b/erpnext/utilities/doctype/note/note.py @@ -17,7 +17,7 @@ class Note(Document): def onload(self): if not self.public and frappe.session.user != self.owner: - if frappe.session.user not in [d.user for d in self.doclist if d.doctype=="Note User"]: + if frappe.session.user not in [d.user for d in self.get("share_with")]: frappe.msgprint("You are not authorized to read this record.", raise_exception=True) def validate(self): diff --git a/erpnext/utilities/transaction_base.py b/erpnext/utilities/transaction_base.py index aa30b68fa3..1934f4c95f 100644 --- a/erpnext/utilities/transaction_base.py +++ b/erpnext/utilities/transaction_base.py @@ -56,7 +56,7 @@ class TransactionBase(StatusUpdater): event_doclist.insert() def validate_uom_is_integer(self, uom_field, qty_fields): - validate_uom_is_integer(self.doclist, uom_field, qty_fields) + validate_uom_is_integer(self, uom_field, qty_fields) def validate_with_previous_doc(self, source_dt, ref): for key, val in ref.items(): From d36cb5c812bfad37403354b557880bc2fd34303d Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 3 Apr 2014 12:38:42 +0530 Subject: [PATCH 21/42] frappe/frappe#478 removed more instances of doclist --- .../doctype/sales_invoice/sales_invoice.py | 2 +- erpnext/accounts/party.py | 2 +- erpnext/controllers/selling_controller.py | 2 +- .../doctype/delivery_note/delivery_note.py | 18 ++-- .../landed_cost_wizard/landed_cost_wizard.py | 7 +- .../material_request/material_request.py | 43 ++++----- erpnext/stock/doctype/serial_no/serial_no.py | 2 +- .../stock/doctype/stock_entry/stock_entry.py | 87 +++++++++---------- erpnext/stock/get_item_details.py | 6 +- 9 files changed, 82 insertions(+), 87 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index ef17f66851..e9e9869864 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -736,7 +736,7 @@ def send_notification(new_rv): from frappe.core.doctype.print_format.print_format import get_html frappe.sendmail(new_rv.notification_email_address, subject="New Invoice : " + new_rv.name, - message = get_html(new_rv.doc, new_rv.doclist, "SalesInvoice")) + message = get_html(new_rv.doc, new_rv, "SalesInvoice")) def notify_errors(inv, customer, owner): from frappe.utils.user import get_system_managers diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py index 7804734d25..e86d6a9edb 100644 --- a/erpnext/accounts/party.py +++ b/erpnext/accounts/party.py @@ -41,7 +41,7 @@ def _get_party_details(party=None, account=None, party_type="Customer", company= out["sales_team"] = [{ "sales_person": d.sales_person, "sales_designation": d.sales_designation - } for d in party_bean.doclist.get({"doctype":"Sales Team"})] + } for d in party_bean.get("sales_team")] return out diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index f2e1c08c1d..77b62caf8a 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -370,7 +370,7 @@ class SellingController(StockController): d.get(ref_fieldname)) def check_active_sales_items(obj): - for d in obj.doclist.get({"parentfield": obj.fname}): + for d in obj.get(obj.fname): if d.item_code: item = frappe.db.sql("""select docstatus, is_sales_item, is_service_item, income_account from tabItem where name = %s""", diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index 59ce41f9dc..9b3095dd1d 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -289,20 +289,15 @@ def make_sales_invoice(source_name, target_doc=None): si = frappe.get_doc(target) si.is_pos = 0 si.run_method("onload_post_render") - - si.set_doclist(si.doclist.get({"parentfield": ["!=", "entries"]}) + - si.doclist.get({"parentfield": "entries", "qty": [">", 0]})) - - if len(si.get("entries")) == 0: - frappe.msgprint(_("Hey! All these items have already been invoiced."), - raise_exception=True) - return si.doclist + if len(si.get("entries")) == 0: + frappe.msgprint(_("All these items have already been invoiced."), + raise_exception=True) def update_item(source_doc, target_doc, source_parent): target_doc.qty = source_doc.qty - invoiced_qty_map.get(source_doc.name, 0) - doclist = get_mapped_doc("Delivery Note", source_name, { + doc = get_mapped_doc("Delivery Note", source_name, { "Delivery Note": { "doctype": "Sales Invoice", "validation": { @@ -318,7 +313,8 @@ def make_sales_invoice(source_name, target_doc=None): "against_sales_order": "sales_order", "serial_no": "serial_no" }, - "postprocess": update_item + "postprocess": update_item, + "filter": lambda d: d.qty - invoiced_qty_map.get(d.name, 0)==0 }, "Sales Taxes and Charges": { "doctype": "Sales Taxes and Charges", @@ -333,7 +329,7 @@ def make_sales_invoice(source_name, target_doc=None): } }, target_doc, update_accounts) - return doclist.as_dict() + return doc.as_dict() @frappe.whitelist() def make_installation_note(source_name, target_doc=None): diff --git a/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.py b/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.py index 3850cec385..968969d267 100644 --- a/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.py +++ b/erpnext/stock/doctype/landed_cost_wizard/landed_cost_wizard.py @@ -40,8 +40,7 @@ class LandedCostWizard(Document): for lc in self.get("landed_cost_details"): amt = flt(lc.amount) * flt(pr_bean.net_total)/ flt(total_amt) - matched_row = pr_bean.doclist.get({ - "parentfield": "other_charges", + matched_row = pr_bean.get("other_charges", { "category": "Valuation", "add_deduct_tax": "Add", "charge_type": "Actual", @@ -66,8 +65,8 @@ class LandedCostWizard(Document): matched_row[0].cost_center = lc.cost_center pr_bean.run_method("validate") - for d in pr_bean.doclist: - d.save() + for d in pr_bean.get_all_children(): + d.db_update() def get_total_pr_amt(self, purchase_receipts): return frappe.db.sql("""SELECT SUM(net_total) FROM `tabPurchase Receipt` diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py index 312a5a371b..296dda9714 100644 --- a/erpnext/stock/doctype/material_request/material_request.py +++ b/erpnext/stock/doctype/material_request/material_request.py @@ -191,29 +191,32 @@ def _update_requested_qty(bean, mr_obj, mr_items): """update requested qty (before ordered_qty is updated)""" from erpnext.stock.utils import update_bin for mr_item_name in mr_items: - mr_item = mr_obj.doclist.getone({"parentfield": "indent_details", "name": mr_item_name}) - se_detail = bean.doclist.getone({"parentfield": "mtn_details", - "material_request": mr_obj.name, "material_request_item": mr_item_name}) + mr_item = mr_obj.get("indent_details", {"name": mr_item_name}) + se_detail = bean.get("mtn_details", {"material_request": mr_obj.name, + "material_request_item": mr_item_name}) - mr_item.ordered_qty = flt(mr_item.ordered_qty) - mr_item.qty = flt(mr_item.qty) - se_detail.transfer_qty = flt(se_detail.transfer_qty) + if mr_item and se_detail: + mr_item = mr_item[0] + se_detail = se_detail[0] + mr_item.ordered_qty = flt(mr_item.ordered_qty) + mr_item.qty = flt(mr_item.qty) + se_detail.transfer_qty = flt(se_detail.transfer_qty) - if se_detail.docstatus == 2 and mr_item.ordered_qty > mr_item.qty \ - and se_detail.transfer_qty == mr_item.ordered_qty: - add_indented_qty = mr_item.qty - elif se_detail.docstatus == 1 and \ - mr_item.ordered_qty + se_detail.transfer_qty > mr_item.qty: - add_indented_qty = mr_item.qty - mr_item.ordered_qty - else: - add_indented_qty = se_detail.transfer_qty + if se_detail.docstatus == 2 and mr_item.ordered_qty > mr_item.qty \ + and se_detail.transfer_qty == mr_item.ordered_qty: + add_indented_qty = mr_item.qty + elif se_detail.docstatus == 1 and \ + mr_item.ordered_qty + se_detail.transfer_qty > mr_item.qty: + add_indented_qty = mr_item.qty - mr_item.ordered_qty + else: + add_indented_qty = se_detail.transfer_qty - update_bin({ - "item_code": se_detail.item_code, - "warehouse": se_detail.t_warehouse, - "indented_qty": (se_detail.docstatus==2 and 1 or -1) * add_indented_qty, - "posting_date": bean.posting_date, - }) + update_bin({ + "item_code": se_detail.item_code, + "warehouse": se_detail.t_warehouse, + "indented_qty": (se_detail.docstatus==2 and 1 or -1) * add_indented_qty, + "posting_date": bean.posting_date, + }) def set_missing_values(source, target_doc): po = frappe.get_doc(target_doc) diff --git a/erpnext/stock/doctype/serial_no/serial_no.py b/erpnext/stock/doctype/serial_no/serial_no.py index 7f4c4380b5..cab1424cba 100644 --- a/erpnext/stock/doctype/serial_no/serial_no.py +++ b/erpnext/stock/doctype/serial_no/serial_no.py @@ -299,7 +299,7 @@ def update_serial_nos_after_submit(controller, parentfield): if not stock_ledger_entries: return - for d in controller.doclist.get({"parentfield": parentfield}): + for d in controller.get(parentfield): serial_no = None for sle in stock_ledger_entries: if sle.voucher_detail_no==d.name: diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index 1bcceaf01c..8841b96e88 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -241,23 +241,23 @@ class StockEntry(StockController): def validate_return_reference_doc(self): """validate item with reference doc""" - ref = get_return_doclist_and_details(self.fields) + ref = get_return_doc_and_details(self) - if ref.doclist: + if ref.doc: # validate docstatus - if ref.doclist[0].docstatus != 1: - frappe.msgprint(_(ref.doclist[0].doctype) + ' "' + ref.doclist[0].name + '": ' + if ref.doc.docstatus != 1: + frappe.msgprint(_(ref.doc.doctype) + ' "' + ref.doc.name + '": ' + _("Status should be Submitted"), raise_exception=frappe.InvalidStatusError) # update stock check - if ref.doclist[0].doctype == "Sales Invoice" and cint(ref.doclist[0].update_stock) != 1: - frappe.msgprint(_(ref.doclist[0].doctype) + ' "' + ref.doclist[0].name + '": ' + if ref.doc.doctype == "Sales Invoice" and cint(ref.doc.update_stock) != 1: + frappe.msgprint(_(ref.doc.doctype) + ' "' + ref.doc.name + '": ' + _("Update Stock should be checked."), raise_exception=NotUpdateStockError) # posting date check - ref_posting_datetime = "%s %s" % (cstr(ref.doclist[0].posting_date), - cstr(ref.doclist[0].posting_time) or "00:00:00") + ref_posting_datetime = "%s %s" % (cstr(ref.doc.posting_date), + cstr(ref.doc.posting_time) or "00:00:00") this_posting_datetime = "%s %s" % (cstr(self.posting_date), cstr(self.posting_time)) if this_posting_datetime < ref_posting_datetime: @@ -266,18 +266,18 @@ class StockEntry(StockController): + ": " + datetime_in_user_format(ref_posting_datetime), raise_exception=True) - stock_items = get_stock_items_for_return(ref.doclist, ref.parentfields) + stock_items = get_stock_items_for_return(ref.doc, ref.parentfields) already_returned_item_qty = self.get_already_returned_item_qty(ref.fieldname) for item in self.get("mtn_details"): - # validate if item exists in the ref doclist and that it is a stock item + # validate if item exists in the ref doc and that it is a stock item if item.item_code not in stock_items: msgprint(_("Item") + ': "' + item.item_code + _("\" does not exist in ") + - ref.doclist[0].doctype + ": " + ref.doclist[0].name, + ref.doc.doctype + ": " + ref.doc.name, raise_exception=frappe.DoesNotExistError) # validate quantity <= ref item's qty - qty already returned - ref_item = ref.doclist.getone({"item_code": item.item_code}) + ref_item = ref.getone({"item_code": item.item_code}) returnable_qty = ref_item.qty - flt(already_returned_item_qty.get(item.item_code)) if not returnable_qty: frappe.throw("{item}: {item_code} {returned}".format( @@ -638,13 +638,13 @@ def query_purchase_return_doc(doctype, txt, searchfield, start, page_len, filter def query_return_item(doctype, txt, searchfield, start, page_len, filters): txt = txt.replace("%", "") - ref = get_return_doclist_and_details(filters) + ref = get_return_doc_and_details(filters) - stock_items = get_stock_items_for_return(ref.doclist, ref.parentfields) + stock_items = get_stock_items_for_return(ref.doc, ref.parentfields) result = [] - for item in ref.doclist.get({"parentfield": ["in", ref.parentfields]}): - if item.item_code in stock_items: + for item in ref.doc.get_all_children(): + if getattr(item, "item_code", None) in stock_items: item.item_name = cstr(item.item_name) item.description = cstr(item.description) if (txt in item.item_code) or (txt in item.item_name) or (txt in item.description): @@ -704,28 +704,28 @@ def get_batch_no(doctype, txt, searchfield, start, page_len, filters): limit %(start)s, %(page_len)s """ % args) -def get_stock_items_for_return(ref_doclist, parentfields): - """return item codes filtered from doclist, which are stock items""" +def get_stock_items_for_return(ref_doc, parentfields): + """return item codes filtered from doc, which are stock items""" if isinstance(parentfields, basestring): parentfields = [parentfields] all_items = list(set([d.item_code for d in - ref_doclist.get({"parentfield": ["in", parentfields]})])) + ref_doc.get_all_children() if d.item_code])) stock_items = frappe.db.sql_list("""select name from `tabItem` where is_stock_item='Yes' and name in (%s)""" % (", ".join(["%s"] * len(all_items))), tuple(all_items)) return stock_items -def get_return_doclist_and_details(args): +def get_return_doc_and_details(args): ref = frappe._dict() - # get ref_doclist + # get ref_doc if args["purpose"] in return_map: for fieldname, val in return_map[args["purpose"]].items(): if args.get(fieldname): ref.fieldname = fieldname - ref.doclist = frappe.get_doclist(val[0], args[fieldname]) + ref.doc = frappe.get_doc(val[0], args[fieldname]) ref.parentfields = val[1] break @@ -748,16 +748,16 @@ def make_return_jv(stock_entry): if not se.purpose in ["Sales Return", "Purchase Return"]: return - ref = get_return_doclist_and_details(se.fields) + ref = get_return_doc_and_details(se.fields) - if ref.doclist[0].doctype == "Delivery Note": + if ref.doc.doctype == "Delivery Note": result = make_return_jv_from_delivery_note(se, ref) - elif ref.doclist[0].doctype == "Sales Invoice": + elif ref.doc.doctype == "Sales Invoice": result = make_return_jv_from_sales_invoice(se, ref) - elif ref.doclist[0].doctype == "Purchase Receipt": + elif ref.doc.doctype == "Purchase Receipt": result = make_return_jv_from_purchase_receipt(se, ref) - # create jv doclist and fetch balance for each unique row item + # create jv doc and fetch balance for each unique row item jv_list = [{ "__islocal": 1, "doctype": "Journal Voucher", @@ -785,28 +785,28 @@ def make_return_jv(stock_entry): def make_return_jv_from_sales_invoice(se, ref): # customer account entry parent = { - "account": ref.doclist[0].debit_to, - "against_invoice": ref.doclist[0].name, + "account": ref.doc.debit_to, + "against_invoice": ref.doc.name, } # income account entries children = [] for se_item in se.get("mtn_details"): - # find item in ref.doclist - ref_item = ref.doclist.getone({"item_code": se_item.item_code}) + # find item in ref.doc + ref_item = ref.doc.get({"item_code": se_item.item_code})[0] - account = get_sales_account_from_item(ref.doclist, ref_item) + account = get_sales_account_from_item(ref.doc, ref_item) if account not in children: children.append(account) return [parent] + [{"account": account} for account in children] -def get_sales_account_from_item(doclist, ref_item): +def get_sales_account_from_item(doc, ref_item): account = None if not ref_item.income_account: if ref_item.parent_item: - parent_item = doclist.getone({"item_code": ref_item.parent_item}) + parent_item = doc.get({"item_code": ref_item.parent_item})[0] account = parent_item.income_account else: account = ref_item.income_account @@ -815,10 +815,10 @@ def get_sales_account_from_item(doclist, ref_item): def make_return_jv_from_delivery_note(se, ref): invoices_against_delivery = get_invoice_list("Sales Invoice Item", "delivery_note", - ref.doclist[0].name) + ref.doc.name) if not invoices_against_delivery: - sales_orders_against_delivery = [d.against_sales_order for d in ref.doclist if d.against_sales_order] + sales_orders_against_delivery = [d.against_sales_order for d in ref.doc.get_all_children() if d.against_sales_order] if sales_orders_against_delivery: invoices_against_delivery = get_invoice_list("Sales Invoice Item", "sales_order", @@ -827,8 +827,7 @@ def make_return_jv_from_delivery_note(se, ref): if not invoices_against_delivery: return [] - packing_item_parent_map = dict([[d.item_code, d.parent_item] for d in ref.doclist.get( - {"parentfield": ref.parentfields[1]})]) + packing_item_parent_map = dict([[d.item_code, d.parent_item] for d in ref.doc.get(ref.parentfields[1])]) parent = {} children = [] @@ -838,16 +837,16 @@ def make_return_jv_from_delivery_note(se, ref): si = frappe.get_doc("Sales Invoice", sales_invoice) if se_item.item_code in packing_item_parent_map: - ref_item = si.doclist.get({"item_code": packing_item_parent_map[se_item.item_code]}) + ref_item = si.get({"item_code": packing_item_parent_map[se_item.item_code]}) else: - ref_item = si.doclist.get({"item_code": se_item.item_code}) + ref_item = si.get({"item_code": se_item.item_code}) if not ref_item: continue ref_item = ref_item[0] - account = get_sales_account_from_item(si.doclist, ref_item) + account = get_sales_account_from_item(si, ref_item) if account not in children: children.append(account) @@ -874,11 +873,11 @@ def get_invoice_list(doctype, link_field, value): def make_return_jv_from_purchase_receipt(se, ref): invoice_against_receipt = get_invoice_list("Purchase Invoice Item", "purchase_receipt", - ref.doclist[0].name) + ref.doc.name) if not invoice_against_receipt: purchase_orders_against_receipt = [d.prevdoc_docname for d in - ref.doclist.get({"prevdoc_doctype": "Purchase Order"}) if d.prevdoc_docname] + ref.get({"prevdoc_doctype": "Purchase Order"}) if d.prevdoc_docname] if purchase_orders_against_receipt: invoice_against_receipt = get_invoice_list("Purchase Invoice Item", "purchase_order", @@ -893,7 +892,7 @@ def make_return_jv_from_purchase_receipt(se, ref): for se_item in se.get("mtn_details"): for purchase_invoice in invoice_against_receipt: pi = frappe.get_doc("Purchase Invoice", purchase_invoice) - ref_item = pi.doclist.get({"item_code": se_item.item_code}) + ref_item = pi.get({"item_code": se_item.item_code}) if not ref_item: continue diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index 57b2c2eda5..ed23cf7595 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -209,12 +209,10 @@ def validate_conversion_rate(args, meta): def get_party_item_code(args, item_bean, out): if args.transaction_type == "selling": - customer_item_code = item_bean.doclist.get({"parentfield": "item_customer_details", - "customer_name": args.customer}) + customer_item_code = item_bean.get("item_customer_details", {"customer_name": args.customer}) out.customer_item_code = customer_item_code[0].ref_code if customer_item_code else None else: - item_supplier = item_bean.doclist.get({"parentfield": "item_supplier_details", - "supplier": args.supplier}) + item_supplier = item_bean.get({"item_supplier_details", {"supplier": args.supplier}) out.supplier_part_no = item_supplier[0].supplier_part_no if item_supplier else None From f14b809ab55f793acee330d0f6258d994c43cefd Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 3 Apr 2014 14:30:42 +0530 Subject: [PATCH 22/42] frappe/frappe#478, more changes, removed bean --- .../SalesInvoice/SalesInvoice.html | 4 +- erpnext/accounts/doctype/account/account.py | 8 ++-- .../accounts_settings/accounts_settings.py | 4 +- .../budget_distribution/test_records.json | 45 ++++++++++++++++++- .../chart_of_accounts/import_charts.py | 4 +- .../doctype/cost_center/cost_center.py | 2 +- .../doctype/fiscal_year/test_fiscal_year.py | 2 + .../journal_voucher/journal_voucher.py | 10 ++--- .../purchase_taxes_and_charges.py | 2 +- .../purchase_taxes_and_charges_master.py | 2 +- .../doctype/sales_invoice/sales_invoice.py | 10 ++--- .../sales_invoice/test_sales_invoice.py | 2 +- .../sales_taxes_and_charges.py | 2 +- .../sales_taxes_and_charges_master.py | 2 +- .../doctype/shipping_rule/shipping_rule.py | 2 +- erpnext/accounts/party.py | 6 +-- .../doctype/purchase_order/purchase_order.py | 8 ++-- .../purchase_order/test_purchase_order.py | 16 +++---- .../supplier_quotation/supplier_quotation.py | 6 +-- erpnext/controllers/accounts_controller.py | 19 ++++---- erpnext/controllers/selling_controller.py | 4 +- erpnext/home/__init__.py | 2 +- .../hr/doctype/department/test_records.json | 5 ++- .../hr/doctype/hr_settings/hr_settings.json | 2 +- .../job_applicant/get_job_applications.py | 2 +- .../leave_application/leave_application.py | 2 +- .../doctype/salary_manager/salary_manager.py | 4 +- .../production_order/production_order.py | 2 +- .../production_order/test_production_order.py | 12 ++--- .../production_planning_tool.py | 2 +- erpnext/selling/doctype/lead/get_leads.py | 4 +- erpnext/selling/doctype/lead/lead.py | 9 ++-- erpnext/selling/doctype/lead/test_lead.py | 4 +- .../doctype/sales_order/sales_order.py | 12 ++--- .../doctype/sales_order/test_sales_order.py | 7 ++- erpnext/setup/doctype/company/company.py | 10 ++--- erpnext/setup/doctype/company/test_company.py | 4 +- .../global_defaults/global_defaults.py | 10 ++--- .../doctype/item_group/test_item_group.py | 6 +-- .../doctype/naming_series/naming_series.py | 2 +- erpnext/setup/install.py | 2 +- .../setup/page/setup_wizard/setup_wizard.py | 2 +- .../doctype/delivery_note/delivery_note.py | 3 +- .../doctype/item_price/test_item_price.py | 4 +- .../landed_cost_wizard/landed_cost_wizard.py | 26 +++++------ .../material_request/material_request.py | 14 +++--- .../doctype/packing_slip/packing_slip.py | 4 +- .../purchase_receipt/purchase_receipt.py | 4 +- erpnext/stock/doctype/serial_no/serial_no.py | 2 +- .../stock/doctype/serial_no/test_serial_no.py | 2 +- .../stock/doctype/stock_entry/stock_entry.py | 34 +++++++------- .../doctype/stock_entry/test_stock_entry.py | 9 ++-- .../stock_ledger_entry/stock_ledger_entry.py | 2 +- .../stock_uom_replace_utility.py | 6 +-- erpnext/stock/doctype/warehouse/warehouse.py | 16 +++---- erpnext/stock/get_item_details.py | 32 ++++++------- erpnext/stock/utils.py | 8 ++-- .../maintenance_schedule.py | 6 +-- .../support_ticket/get_support_mails.py | 4 +- 59 files changed, 243 insertions(+), 198 deletions(-) diff --git a/erpnext/accounts/Print Format/SalesInvoice/SalesInvoice.html b/erpnext/accounts/Print Format/SalesInvoice/SalesInvoice.html index d4a49ef503..8dc39f9482 100644 --- a/erpnext/accounts/Print Format/SalesInvoice/SalesInvoice.html +++ b/erpnext/accounts/Print Format/SalesInvoice/SalesInvoice.html @@ -65,7 +65,7 @@ Basic Rate Amount
{{ row.idx }} {{ row.item_name }}
{{ charge.description }}" + cstr(item.uom) + "
" sendmail(email_list, subject='Auto Material Request Generation Notification', msg = msg) - + def notify_errors(exceptions_list): subject = "[Important] [ERPNext] Error(s) while creating Material Requests based on Re-order Levels" msg = """Dear System Manager, An error occured for certain Items while creating Material Requests based on Re-order level. - + Please rectify these issues: --- From cd71e1d8abd8c2bfc4ba0e8b45a0e3e9a94826e9 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 8 Apr 2014 13:53:35 +0530 Subject: [PATCH 38/42] Test Cases - Journal Voucher, Purchase Invoice, Period Closing Voucher frappe/frappe#478 --- .../journal_voucher/test_journal_voucher.py | 72 +++---- .../doctype/journal_voucher/test_records.json | 116 +++++------ .../test_period_closing_voucher.py | 28 +-- .../period_closing_voucher/test_records.json | 8 + .../doctype/pricing_rule/test_pricing_rule.py | 46 ++--- .../purchase_invoice/test_purchase_invoice.py | 66 +++---- erpnext/accounts/utils.py | 181 +++++++++--------- erpnext/selling/doctype/lead/test_lead.py | 5 +- 8 files changed, 263 insertions(+), 259 deletions(-) create mode 100644 erpnext/accounts/doctype/period_closing_voucher/test_records.json diff --git a/erpnext/accounts/doctype/journal_voucher/test_journal_voucher.py b/erpnext/accounts/doctype/journal_voucher/test_journal_voucher.py index 962d9a09db..425baf16f4 100644 --- a/erpnext/accounts/doctype/journal_voucher/test_journal_voucher.py +++ b/erpnext/accounts/doctype/journal_voucher/test_journal_voucher.py @@ -9,47 +9,51 @@ import frappe class TestJournalVoucher(unittest.TestCase): def test_journal_voucher_with_against_jv(self): self.clear_account_balance() - jv_invoice = frappe.copy_doc(test_records[1]) + jv_invoice = frappe.copy_doc(test_records[2]) jv_invoice.insert() jv_invoice.submit() - + + self.assertTrue(frappe.db.sql("""select name from `tabJournal Voucher Detail` + where account = %s and docstatus = 1 and parent = %s""", + ("_Test Customer - _TC", jv_invoice.name))) + self.assertTrue(not frappe.db.sql("""select name from `tabJournal Voucher Detail` where against_jv=%s""", jv_invoice.name)) - + jv_payment = frappe.copy_doc(test_records[0]) jv_payment.get("entries")[0].against_jv = jv_invoice.name jv_payment.insert() jv_payment.submit() - + self.assertTrue(frappe.db.sql("""select name from `tabJournal Voucher Detail` where against_jv=%s""", jv_invoice.name)) - + self.assertTrue(frappe.db.sql("""select name from `tabJournal Voucher Detail` where against_jv=%s and credit=400""", jv_invoice.name)) - + # cancel jv_invoice jv_invoice.cancel() - + self.assertTrue(not frappe.db.sql("""select name from `tabJournal Voucher Detail` where against_jv=%s""", jv_invoice.name)) - + def test_jv_against_stock_account(self): from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory set_perpetual_inventory() - + jv = frappe.copy_doc(test_records[0]) jv.get("entries")[0].account = "_Test Warehouse - _TC" jv.insert() - + from erpnext.accounts.general_ledger import StockAccountInvalidTransaction self.assertRaises(StockAccountInvalidTransaction, jv.submit) set_perpetual_inventory(0) - + def test_monthly_budget_crossed_ignore(self): frappe.db.set_value("Company", "_Test Company", "monthly_bgt_flag", "Ignore") self.clear_account_balance() - + jv = frappe.copy_doc(test_records[0]) jv.get("entries")[1].account = "_Test Account Cost for Goods Sold - _TC" jv.get("entries")[1].cost_center = "_Test Cost Center - _TC" @@ -57,32 +61,32 @@ class TestJournalVoucher(unittest.TestCase): jv.get("entries")[0].credit = 20000.0 jv.insert() jv.submit() - self.assertTrue(frappe.db.get_value("GL Entry", + self.assertTrue(frappe.db.get_value("GL Entry", {"voucher_type": "Journal Voucher", "voucher_no": jv.name})) - + def test_monthly_budget_crossed_stop(self): from erpnext.accounts.utils import BudgetError frappe.db.set_value("Company", "_Test Company", "monthly_bgt_flag", "Stop") self.clear_account_balance() - + jv = frappe.copy_doc(test_records[0]) jv.get("entries")[1].account = "_Test Account Cost for Goods Sold - _TC" jv.get("entries")[1].cost_center = "_Test Cost Center - _TC" jv.get("entries")[1].debit = 20000.0 jv.get("entries")[0].credit = 20000.0 jv.insert() - + self.assertRaises(BudgetError, jv.submit) - + frappe.db.set_value("Company", "_Test Company", "monthly_bgt_flag", "Ignore") - + def test_yearly_budget_crossed_stop(self): from erpnext.accounts.utils import BudgetError self.clear_account_balance() self.test_monthly_budget_crossed_ignore() - + frappe.db.set_value("Company", "_Test Company", "yearly_bgt_flag", "Stop") - + jv = frappe.copy_doc(test_records[0]) jv.posting_date = "2013-08-12" jv.get("entries")[1].account = "_Test Account Cost for Goods Sold - _TC" @@ -90,42 +94,42 @@ class TestJournalVoucher(unittest.TestCase): jv.get("entries")[1].debit = 150000.0 jv.get("entries")[0].credit = 150000.0 jv.insert() - + self.assertRaises(BudgetError, jv.submit) - + frappe.db.set_value("Company", "_Test Company", "yearly_bgt_flag", "Ignore") - + def test_monthly_budget_on_cancellation(self): from erpnext.accounts.utils import BudgetError frappe.db.set_value("Company", "_Test Company", "monthly_bgt_flag", "Stop") self.clear_account_balance() - + jv = frappe.copy_doc(test_records[0]) jv.get("entries")[0].account = "_Test Account Cost for Goods Sold - _TC" jv.get("entries")[0].cost_center = "_Test Cost Center - _TC" jv.get("entries")[0].credit = 30000.0 jv.get("entries")[1].debit = 30000.0 jv.submit() - - self.assertTrue(frappe.db.get_value("GL Entry", + + self.assertTrue(frappe.db.get_value("GL Entry", {"voucher_type": "Journal Voucher", "voucher_no": jv.name})) - + jv1 = frappe.copy_doc(test_records[0]) jv1.get("entries")[1].account = "_Test Account Cost for Goods Sold - _TC" jv1.get("entries")[1].cost_center = "_Test Cost Center - _TC" jv1.get("entries")[1].debit = 40000.0 jv1.get("entries")[0].credit = 40000.0 jv1.submit() - - self.assertTrue(frappe.db.get_value("GL Entry", + + self.assertTrue(frappe.db.get_value("GL Entry", {"voucher_type": "Journal Voucher", "voucher_no": jv1.name})) - + self.assertRaises(BudgetError, jv.cancel) - + frappe.db.set_value("Company", "_Test Company", "monthly_bgt_flag", "Ignore") - + def clear_account_balance(self): frappe.db.sql("""delete from `tabGL Entry`""") - -test_records = frappe.get_test_records('Journal Voucher') \ No newline at end of file + +test_records = frappe.get_test_records('Journal Voucher') diff --git a/erpnext/accounts/doctype/journal_voucher/test_records.json b/erpnext/accounts/doctype/journal_voucher/test_records.json index 78ec10cdd0..9355c50a18 100644 --- a/erpnext/accounts/doctype/journal_voucher/test_records.json +++ b/erpnext/accounts/doctype/journal_voucher/test_records.json @@ -1,84 +1,84 @@ [ { - "cheque_date": "2013-02-14", - "cheque_no": "33", - "company": "_Test Company", - "doctype": "Journal Voucher", + "cheque_date": "2013-02-14", + "cheque_no": "33", + "company": "_Test Company", + "doctype": "Journal Voucher", "entries": [ { - "account": "_Test Customer - _TC", - "credit": 400.0, - "debit": 0.0, - "doctype": "Journal Voucher Detail", + "account": "_Test Customer - _TC", + "credit": 400.0, + "debit": 0.0, + "doctype": "Journal Voucher Detail", "parentfield": "entries" - }, + }, { - "account": "_Test Account Bank Account - _TC", - "credit": 0.0, - "debit": 400.0, - "doctype": "Journal Voucher Detail", + "account": "_Test Account Bank Account - _TC", + "credit": 0.0, + "debit": 400.0, + "doctype": "Journal Voucher Detail", "parentfield": "entries" } - ], - "fiscal_year": "_Test Fiscal Year 2013", - "naming_series": "_T-Journal Voucher-", - "posting_date": "2013-02-14", - "user_remark": "test", + ], + "fiscal_year": "_Test Fiscal Year 2013", + "naming_series": "_T-Journal Voucher-", + "posting_date": "2013-02-14", + "user_remark": "test", "voucher_type": "Bank Voucher" - }, + }, { - "cheque_date": "2013-02-14", - "cheque_no": "33", - "company": "_Test Company", - "doctype": "Journal Voucher", + "cheque_date": "2013-02-14", + "cheque_no": "33", + "company": "_Test Company", + "doctype": "Journal Voucher", "entries": [ { - "account": "_Test Supplier - _TC", - "credit": 0.0, - "debit": 400.0, - "doctype": "Journal Voucher Detail", + "account": "_Test Supplier - _TC", + "credit": 0.0, + "debit": 400.0, + "doctype": "Journal Voucher Detail", "parentfield": "entries" - }, + }, { - "account": "_Test Account Bank Account - _TC", - "credit": 400.0, - "debit": 0.0, - "doctype": "Journal Voucher Detail", + "account": "_Test Account Bank Account - _TC", + "credit": 400.0, + "debit": 0.0, + "doctype": "Journal Voucher Detail", "parentfield": "entries" } - ], - "fiscal_year": "_Test Fiscal Year 2013", - "naming_series": "_T-Journal Voucher-", - "posting_date": "2013-02-14", - "user_remark": "test", + ], + "fiscal_year": "_Test Fiscal Year 2013", + "naming_series": "_T-Journal Voucher-", + "posting_date": "2013-02-14", + "user_remark": "test", "voucher_type": "Bank Voucher" - }, + }, { - "cheque_date": "2013-02-14", - "cheque_no": "33", - "company": "_Test Company", - "doctype": "Journal Voucher", + "cheque_date": "2013-02-14", + "cheque_no": "33", + "company": "_Test Company", + "doctype": "Journal Voucher", "entries": [ { - "account": "_Test Customer - _TC", - "credit": 0.0, - "debit": 400.0, - "doctype": "Journal Voucher Detail", + "account": "_Test Customer - _TC", + "credit": 0.0, + "debit": 400.0, + "doctype": "Journal Voucher Detail", "parentfield": "entries" - }, + }, { - "account": "Sales - _TC", - "cost_center": "_Test Cost Center - _TC", - "credit": 400.0, - "debit": 0.0, - "doctype": "Journal Voucher Detail", + "account": "Sales - _TC", + "cost_center": "_Test Cost Center - _TC", + "credit": 400.0, + "debit": 0.0, + "doctype": "Journal Voucher Detail", "parentfield": "entries" } - ], - "fiscal_year": "_Test Fiscal Year 2013", - "naming_series": "_T-Journal Voucher-", - "posting_date": "2013-02-14", - "user_remark": "test", + ], + "fiscal_year": "_Test Fiscal Year 2013", + "naming_series": "_T-Journal Voucher-", + "posting_date": "2013-02-14", + "user_remark": "test", "voucher_type": "Bank Voucher" } -] \ No newline at end of file +] diff --git a/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py b/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py index ad58efc869..146764dcbf 100644 --- a/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py +++ b/erpnext/accounts/doctype/period_closing_voucher/test_period_closing_voucher.py @@ -5,34 +5,34 @@ from __future__ import unicode_literals import unittest import frappe +from erpnext.accounts.doctype.journal_voucher.test_journal_voucher import test_records as jv_records class TestPeriodClosingVoucher(unittest.TestCase): def test_closing_entry(self): # clear GL Entries frappe.db.sql("""delete from `tabGL Entry`""") - - from erpnext.accounts.doctype.journal_voucher.test_journal_voucher import test_records as jv_records jv = frappe.copy_doc(jv_records[2]) jv.insert() jv.submit() - + jv1 = frappe.copy_doc(jv_records[0]) jv1.get("entries")[1].account = "_Test Account Cost for Goods Sold - _TC" + jv1.get("entries")[1].cost_center = "_Test Cost Center - _TC" jv1.get("entries")[1].debit = 600.0 jv1.get("entries")[0].credit = 600.0 jv1.insert() jv1.submit() - - pcv = frappe.copy_doc(test_record) + + pcv = frappe.copy_doc(test_records[0]) pcv.insert() pcv.submit() - + gl_entries = frappe.db.sql("""select account, debit, credit from `tabGL Entry` where voucher_type='Period Closing Voucher' and voucher_no=%s order by account asc, debit asc""", pcv.name, as_dict=1) self.assertTrue(gl_entries) - + expected_gl_entries = sorted([ ["_Test Account Reserves and Surplus - _TC", 200.0, 0.0], ["_Test Account Cost for Goods Sold - _TC", 0.0, 600.0], @@ -42,15 +42,7 @@ class TestPeriodClosingVoucher(unittest.TestCase): self.assertEquals(expected_gl_entries[i][0], gle.account) self.assertEquals(expected_gl_entries[i][1], gle.debit) self.assertEquals(expected_gl_entries[i][2], gle.credit) - - + + test_dependencies = ["Customer", "Cost Center"] - -test_record = [{ - "doctype": "Period Closing Voucher", - "closing_account_head": "_Test Account Reserves and Surplus - _TC", - "company": "_Test Company", - "fiscal_year": "_Test Fiscal Year 2013", - "posting_date": "2013-03-31", - "remarks": "test" -}] +test_records = frappe.get_test_records("Period Closing Voucher") diff --git a/erpnext/accounts/doctype/period_closing_voucher/test_records.json b/erpnext/accounts/doctype/period_closing_voucher/test_records.json new file mode 100644 index 0000000000..d21948f674 --- /dev/null +++ b/erpnext/accounts/doctype/period_closing_voucher/test_records.json @@ -0,0 +1,8 @@ +[{ + "doctype": "Period Closing Voucher", + "closing_account_head": "_Test Account Reserves and Surplus - _TC", + "company": "_Test Company", + "fiscal_year": "_Test Fiscal Year 2013", + "posting_date": "2013-03-31", + "remarks": "test" +}] diff --git a/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py b/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py index 5e427971e5..e3d79f161e 100644 --- a/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py +++ b/erpnext/accounts/doctype/pricing_rule/test_pricing_rule.py @@ -11,16 +11,16 @@ class TestPricingRule(unittest.TestCase): from erpnext.stock.get_item_details import get_item_details from frappe import MandatoryError - test_record = [{ - "doctype": "Pricing Rule", - "apply_on": "Item Code", - "item_code": "_Test Item", - "price_or_discount": "Discount Percentage", - "price": 0, - "discount_percentage": 10, - }] - frappe.copy_doc(test_record).insert() - + test_record = { + "doctype": "Pricing Rule", + "apply_on": "Item Code", + "item_code": "_Test Item", + "price_or_discount": "Discount Percentage", + "price": 0, + "discount_percentage": 10, + } + frappe.get_doc(test_record.copy()).insert() + args = frappe._dict({ "item_code": "_Test Item", "company": "_Test Company", @@ -34,11 +34,11 @@ class TestPricingRule(unittest.TestCase): "transaction_type": "selling", "customer": "_Test Customer", }) - + details = get_item_details(args) self.assertEquals(details.get("discount_percentage"), 10) - - prule = frappe.copy_doc(test_record) + + prule = frappe.get_doc(test_record.copy()) prule.applicable_for = "Customer" self.assertRaises(MandatoryError, prule.insert) prule.customer = "_Test Customer" @@ -46,34 +46,34 @@ class TestPricingRule(unittest.TestCase): prule.insert() details = get_item_details(args) self.assertEquals(details.get("discount_percentage"), 20) - - prule = frappe.copy_doc(test_record) + + prule = frappe.get_doc(test_record.copy()) prule.apply_on = "Item Group" prule.item_group = "All Item Groups" prule.discount_percentage = 15 prule.insert() - + args.customer = None details = get_item_details(args) self.assertEquals(details.get("discount_percentage"), 10) - - prule = frappe.copy_doc(test_record) + + prule = frappe.get_doc(test_record.copy()) prule.applicable_for = "Campaign" prule.campaign = "_Test Campaign" prule.discount_percentage = 5 prule.priority = 8 prule.insert() - + args.campaign = "_Test Campaign" details = get_item_details(args) self.assertEquals(details.get("discount_percentage"), 5) - + frappe.db.sql("update `tabPricing Rule` set priority=NULL where campaign='_Test Campaign'") details = get_item_details(args) self.assertEquals(details.get("discount_percentage"), 15) - + args.item_code = "_Test Item 2" details = get_item_details(args) self.assertEquals(details.get("discount_percentage"), 15) - - frappe.db.sql("delete from `tabPricing Rule`") \ No newline at end of file + + frappe.db.sql("delete from `tabPricing Rule`") diff --git a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py index 885ef4690a..c4ef3e7ec0 100644 --- a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py @@ -6,7 +6,7 @@ from __future__ import unicode_literals import unittest import frappe import frappe.model -import json +import json from frappe.utils import cint import frappe.defaults from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory @@ -18,13 +18,13 @@ class TestPurchaseInvoice(unittest.TestCase): def test_gl_entries_without_auto_accounting_for_stock(self): set_perpetual_inventory(0) self.assertTrue(not cint(frappe.defaults.get_global_default("auto_accounting_for_stock"))) - + wrapper = frappe.copy_doc(test_records[0]) wrapper.insert() wrapper.submit() wrapper.load_from_db() dl = wrapper - + expected_gl_entries = { "_Test Supplier - _TC": [0, 1512.30], "_Test Account Cost for Goods Sold - _TC": [1250, 0], @@ -40,20 +40,20 @@ class TestPurchaseInvoice(unittest.TestCase): where voucher_type = 'Purchase Invoice' and voucher_no = %s""", dl.name, as_dict=1) for d in gl_entries: self.assertEqual([d.debit, d.credit], expected_gl_entries.get(d.account)) - + def test_gl_entries_with_auto_accounting_for_stock(self): set_perpetual_inventory(1) self.assertEqual(cint(frappe.defaults.get_global_default("auto_accounting_for_stock")), 1) - + pi = frappe.copy_doc(test_records[1]) pi.insert() pi.submit() - + gl_entries = frappe.db.sql("""select account, debit, credit from `tabGL Entry` where voucher_type='Purchase Invoice' and voucher_no=%s order by account asc""", pi.name, as_dict=1) self.assertTrue(gl_entries) - + expected_values = sorted([ ["_Test Supplier - _TC", 0, 720], ["Stock Received But Not Billed - _TC", 750.0, 0], @@ -61,48 +61,48 @@ class TestPurchaseInvoice(unittest.TestCase): ["_Test Account VAT - _TC", 120.0, 0], ["Expenses Included In Valuation - _TC", 0, 250.0], ]) - + for i, gle in enumerate(gl_entries): self.assertEquals(expected_values[i][0], gle.account) self.assertEquals(expected_values[i][1], gle.debit) self.assertEquals(expected_values[i][2], gle.credit) - + set_perpetual_inventory(0) def test_gl_entries_with_aia_for_non_stock_items(self): set_perpetual_inventory() self.assertEqual(cint(frappe.defaults.get_global_default("auto_accounting_for_stock")), 1) - + pi = frappe.copy_doc(test_records[1]) pi.get("entries")[0].item_code = "_Test Non Stock Item" pi.get("entries")[0].expense_account = "_Test Account Cost for Goods Sold - _TC" - pi.get("entries").pop(2) - pi.get("entries").pop(1) + pi.get("other_charges").pop(0) + pi.get("other_charges").pop(1) pi.insert() pi.submit() - + gl_entries = frappe.db.sql("""select account, debit, credit from `tabGL Entry` where voucher_type='Purchase Invoice' and voucher_no=%s order by account asc""", pi.name, as_dict=1) self.assertTrue(gl_entries) - + expected_values = sorted([ ["_Test Supplier - _TC", 0, 620], ["_Test Account Cost for Goods Sold - _TC", 500.0, 0], ["_Test Account VAT - _TC", 120.0, 0], ]) - + for i, gle in enumerate(gl_entries): self.assertEquals(expected_values[i][0], gle.account) self.assertEquals(expected_values[i][1], gle.debit) self.assertEquals(expected_values[i][2], gle.credit) set_perpetual_inventory(0) - + def test_purchase_invoice_calculation(self): wrapper = frappe.copy_doc(test_records[0]) wrapper.insert() wrapper.load_from_db() - + expected_values = [ ["_Test Item Home Desktop 100", 90, 59], ["_Test Item Home Desktop 200", 135, 177] @@ -111,9 +111,9 @@ class TestPurchaseInvoice(unittest.TestCase): self.assertEqual(item.item_code, expected_values[i][0]) self.assertEqual(item.item_tax_amount, expected_values[i][1]) self.assertEqual(item.valuation_rate, expected_values[i][2]) - + self.assertEqual(wrapper.net_total, 1250) - + # tax amounts expected_values = [ ["_Test Account Shipping Charges - _TC", 100, 1350], @@ -125,18 +125,18 @@ class TestPurchaseInvoice(unittest.TestCase): ["_Test Account VAT - _TC", 156.25, 1680.33], ["_Test Account Discount - _TC", 168.03, 1512.30], ] - + for i, tax in enumerate(wrapper.get("other_charges")): self.assertEqual(tax.account_head, expected_values[i][0]) self.assertEqual(tax.tax_amount, expected_values[i][1]) self.assertEqual(tax.total, expected_values[i][2]) - + def test_purchase_invoice_with_subcontracted_item(self): wrapper = frappe.copy_doc(test_records[0]) wrapper.get("entries")[0].item_code = "_Test FG Item" wrapper.insert() wrapper.load_from_db() - + expected_values = [ ["_Test FG Item", 90, 7059], ["_Test Item Home Desktop 200", 135, 177] @@ -145,7 +145,7 @@ class TestPurchaseInvoice(unittest.TestCase): self.assertEqual(item.item_code, expected_values[i][0]) self.assertEqual(item.item_tax_amount, expected_values[i][1]) self.assertEqual(item.valuation_rate, expected_values[i][2]) - + self.assertEqual(wrapper.net_total, 1250) # tax amounts @@ -164,15 +164,15 @@ class TestPurchaseInvoice(unittest.TestCase): self.assertEqual(tax.account_head, expected_values[i][0]) self.assertEqual(tax.tax_amount, expected_values[i][1]) self.assertEqual(tax.total, expected_values[i][2]) - + def test_purchase_invoice_with_advance(self): from erpnext.accounts.doctype.journal_voucher.test_journal_voucher \ import test_records as jv_test_records - + jv = frappe.copy_doc(jv_test_records[1]) jv.insert() jv.submit() - + pi = frappe.copy_doc(test_records[0]) pi.append("advance_allocation_details", { "journal_voucher": jv.name, @@ -184,18 +184,18 @@ class TestPurchaseInvoice(unittest.TestCase): pi.insert() pi.submit() pi.load_from_db() - + self.assertTrue(frappe.db.sql("""select name from `tabJournal Voucher Detail` where against_voucher=%s""", pi.name)) - + self.assertTrue(frappe.db.sql("""select name from `tabJournal Voucher Detail` where against_voucher=%s and debit=300""", pi.name)) - + self.assertEqual(pi.outstanding_amount, 1212.30) - + pi.cancel() - + self.assertTrue(not frappe.db.sql("""select name from `tabJournal Voucher Detail` where against_voucher=%s""", pi.name)) - -test_records = frappe.get_test_records('Purchase Invoice') \ No newline at end of file + +test_records = frappe.get_test_records('Purchase Invoice') diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index b096cbf0c2..e317e1141b 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -16,7 +16,7 @@ class BudgetError(frappe.ValidationError): pass def get_fiscal_year(date=None, fiscal_year=None, label="Date", verbose=1): return get_fiscal_years(date, fiscal_year, label, verbose)[0] - + def get_fiscal_years(date=None, fiscal_year=None, label="Date", verbose=1): # if year start date is 2012-04-01, year end date should be 2013-03-31 (hence subdate) cond = "" @@ -27,16 +27,16 @@ def get_fiscal_years(date=None, fiscal_year=None, label="Date", verbose=1): (date, date) fy = frappe.db.sql("""select name, year_start_date, year_end_date from `tabFiscal Year` where %s order by year_start_date desc""" % cond) - + if not fy: error_msg = """%s %s not in any Fiscal Year""" % (label, formatdate(date)) - error_msg = """{msg}: {date}""".format(msg=_("Fiscal Year does not exist for date"), + error_msg = """{msg}: {date}""".format(msg=_("Fiscal Year does not exist for date"), date=formatdate(date)) if verbose: frappe.msgprint(error_msg) raise FiscalYearError, error_msg - + return fy - + def validate_fiscal_year(date, fiscal_year, label="Date"): years = [f[0] for f in get_fiscal_years(date, label=label)] if fiscal_year not in years: @@ -52,14 +52,14 @@ def get_balance_on(account=None, date=None): if not account and frappe.form_dict.get("account"): account = frappe.form_dict.get("account") date = frappe.form_dict.get("date") - + cond = [] if date: cond.append("posting_date <= '%s'" % date) else: # get balance of all entries that exist date = nowdate() - + try: year_start_date = get_fiscal_year(date, verbose=0)[1] except FiscalYearError, e: @@ -71,15 +71,15 @@ def get_balance_on(account=None, date=None): # this indicates that it is a date older than any existing fiscal year. # hence, assuming balance as 0.0 return 0.0 - + acc = frappe.db.get_value('Account', account, \ ['lft', 'rgt', 'report_type', 'group_or_ledger'], as_dict=1) - + # for pl accounts, get balance within a fiscal year if acc.report_type == 'Profit and Loss': cond.append("posting_date >= '%s' and voucher_type != 'Period Closing Voucher'" \ % year_start_date) - + # different filter for group and ledger - improved performance if acc.group_or_ledger=="Group": cond.append("""exists ( @@ -88,9 +88,9 @@ def get_balance_on(account=None, date=None): )""" % (acc.lft, acc.rgt)) else: cond.append("""gle.account = "%s" """ % (account.replace('"', '\"'), )) - + bal = frappe.db.sql(""" - SELECT sum(ifnull(debit, 0)) - sum(ifnull(credit, 0)) + SELECT sum(ifnull(debit, 0)) - sum(ifnull(credit, 0)) FROM `tabGL Entry` gle WHERE %s""" % " and ".join(cond))[0][0] @@ -102,7 +102,7 @@ def add_ac(args=None): if not args: args = frappe.local.form_dict args.pop("cmd") - + ac = frappe.get_doc(args) ac.doctype = "Account" ac.old_parent = "" @@ -115,7 +115,7 @@ def add_cc(args=None): if not args: args = frappe.local.form_dict args.pop("cmd") - + cc = frappe.get_doc(args) cc.doctype = "Cost Center" cc.old_parent = "" @@ -134,13 +134,14 @@ def reconcile_against_document(args): 'Sales Invoice' : 'against_invoice', 'Purchase Invoice' : 'against_voucher' } - + d['against_fld'] = against_fld[d['against_voucher_type']] # cancel JV jv_obj = frappe.get_doc('Journal Voucher', d['voucher_no']) + jv_obj.make_gl_entries(cancel=1, adv_adj=1) - + # update ref in JV Detail update_against_doc(d, jv_obj) @@ -156,13 +157,13 @@ def check_if_jv_modified(args): check if jv is submitted """ ret = frappe.db.sql(""" - select t2.%(dr_or_cr)s from `tabJournal Voucher` t1, `tabJournal Voucher Detail` t2 - where t1.name = t2.parent and t2.account = '%(account)s' - and ifnull(t2.against_voucher, '')='' + select t2.%(dr_or_cr)s from `tabJournal Voucher` t1, `tabJournal Voucher Detail` t2 + where t1.name = t2.parent and t2.account = '%(account)s' + and ifnull(t2.against_voucher, '')='' and ifnull(t2.against_invoice, '')='' and ifnull(t2.against_jv, '')='' and t1.name = '%(voucher_no)s' and t2.name = '%(voucher_detail_no)s' and t1.docstatus=1 and t2.%(dr_or_cr)s = %(unadjusted_amt)s""" % args) - + if not ret: throw(_("""Payment Entry has been modified after you pulled it. Please pull it again.""")) @@ -170,15 +171,12 @@ def update_against_doc(d, jv_obj): """ Updates against document, if partial amount splits into rows """ + jv_detail = jv_obj.get("entries", {"name": d["voucher_detail_no"]})[0] + jv_detail.set(d["dr_or_cr"], d["allocated_amt"]) + jv_detail.set(d["against_fld"], d["against_voucher"]) - frappe.db.sql(""" - update `tabJournal Voucher Detail` t1, `tabJournal Voucher` t2 - set t1.%(dr_or_cr)s = '%(allocated_amt)s', - t1.%(against_fld)s = '%(against_voucher)s', t2.modified = now() - where t1.name = '%(voucher_detail_no)s' and t1.parent = t2.name""" % d) - if d['allocated_amt'] < d['unadjusted_amt']: - jvd = frappe.db.sql("""select cost_center, balance, against_account, is_advance + jvd = frappe.db.sql("""select cost_center, balance, against_account, is_advance from `tabJournal Voucher Detail` where name = %s""", d['voucher_detail_no']) # new entry with balance amount ch = jv_obj.append("entries") @@ -190,90 +188,93 @@ def update_against_doc(d, jv_obj): ch.against_account = cstr(jvd[0][2]) ch.is_advance = cstr(jvd[0][3]) ch.docstatus = 1 - ch.save(1) - + + # will work as update after submit + jv_obj.ignore_validate_update_after_submit = True + jv_obj.save() + def get_account_list(doctype, txt, searchfield, start, page_len, filters): if not filters.get("group_or_ledger"): filters["group_or_ledger"] = "Ledger" conditions, filter_values = build_filter_conditions(filters) - - return frappe.db.sql("""select name, parent_account from `tabAccount` - where docstatus < 2 %s and %s like %s order by name limit %s, %s""" % - (conditions, searchfield, "%s", "%s", "%s"), + + return frappe.db.sql("""select name, parent_account from `tabAccount` + where docstatus < 2 %s and %s like %s order by name limit %s, %s""" % + (conditions, searchfield, "%s", "%s", "%s"), tuple(filter_values + ["%%%s%%" % txt, start, page_len])) - + def get_cost_center_list(doctype, txt, searchfield, start, page_len, filters): if not filters.get("group_or_ledger"): filters["group_or_ledger"] = "Ledger" conditions, filter_values = build_filter_conditions(filters) - - return frappe.db.sql("""select name, parent_cost_center from `tabCost Center` - where docstatus < 2 %s and %s like %s order by name limit %s, %s""" % - (conditions, searchfield, "%s", "%s", "%s"), + + return frappe.db.sql("""select name, parent_cost_center from `tabCost Center` + where docstatus < 2 %s and %s like %s order by name limit %s, %s""" % + (conditions, searchfield, "%s", "%s", "%s"), tuple(filter_values + ["%%%s%%" % txt, start, page_len])) - + def remove_against_link_from_jv(ref_type, ref_no, against_field): - linked_jv = frappe.db.sql_list("""select parent from `tabJournal Voucher Detail` + linked_jv = frappe.db.sql_list("""select parent from `tabJournal Voucher Detail` where `%s`=%s and docstatus < 2""" % (against_field, "%s"), (ref_no)) - - if linked_jv: + + if linked_jv: frappe.db.sql("""update `tabJournal Voucher Detail` set `%s`=null, modified=%s, modified_by=%s - where `%s`=%s and docstatus < 2""" % (against_field, "%s", "%s", against_field, "%s"), + where `%s`=%s and docstatus < 2""" % (against_field, "%s", "%s", against_field, "%s"), (now(), frappe.session.user, ref_no)) - + frappe.db.sql("""update `tabGL Entry` set against_voucher_type=null, against_voucher=null, modified=%s, modified_by=%s where against_voucher_type=%s and against_voucher=%s and voucher_no != ifnull(against_voucher, '')""", (now(), frappe.session.user, ref_type, ref_no)) - + frappe.msgprint("{msg} {linked_jv}".format(msg = _("""Following linked Journal Vouchers \ made against this transaction has been unlinked. You can link them again with other \ transactions via Payment Reconciliation Tool."""), linked_jv="\n".join(linked_jv))) - + @frappe.whitelist() def get_company_default(company, fieldname): value = frappe.db.get_value("Company", company, fieldname) - + if not value: - throw(_("Please mention default value for '") + - _(frappe.get_meta("Company").get_label(fieldname) + + throw(_("Please mention default value for '") + + _(frappe.get_meta("Company").get_label(fieldname) + _("' in Company: ") + company)) - + return value def fix_total_debit_credit(): - vouchers = frappe.db.sql("""select voucher_type, voucher_no, - sum(debit) - sum(credit) as diff - from `tabGL Entry` + vouchers = frappe.db.sql("""select voucher_type, voucher_no, + sum(debit) - sum(credit) as diff + from `tabGL Entry` group by voucher_type, voucher_no having sum(ifnull(debit, 0)) != sum(ifnull(credit, 0))""", as_dict=1) - + for d in vouchers: if abs(d.diff) > 0: dr_or_cr = d.voucher_type == "Sales Invoice" and "credit" or "debit" - + frappe.db.sql("""update `tabGL Entry` set %s = %s + %s where voucher_type = %s and voucher_no = %s and %s > 0 limit 1""" % - (dr_or_cr, dr_or_cr, '%s', '%s', '%s', dr_or_cr), + (dr_or_cr, dr_or_cr, '%s', '%s', '%s', dr_or_cr), (d.diff, d.voucher_type, d.voucher_no)) - + def get_stock_and_account_difference(account_list=None, posting_date=None): from erpnext.stock.utils import get_stock_balance_on - + if not posting_date: posting_date = nowdate() - + difference = {} - - account_warehouse = dict(frappe.db.sql("""select name, master_name from tabAccount - where account_type = 'Warehouse' and ifnull(master_name, '') != '' + + account_warehouse = dict(frappe.db.sql("""select name, master_name from tabAccount + where account_type = 'Warehouse' and ifnull(master_name, '') != '' and name in (%s)""" % ', '.join(['%s']*len(account_list)), account_list)) - + for account, warehouse in account_warehouse.items(): account_balance = get_balance_on(account, posting_date) stock_value = get_stock_balance_on(warehouse, posting_date) @@ -286,24 +287,24 @@ def validate_expense_against_budget(args): args = frappe._dict(args) if frappe.db.get_value("Account", {"name": args.account, "report_type": "Profit and Loss"}): budget = frappe.db.sql(""" - select bd.budget_allocated, cc.distribution_id + select bd.budget_allocated, cc.distribution_id from `tabCost Center` cc, `tabBudget Detail` bd where cc.name=bd.parent and cc.name=%s and account=%s and bd.fiscal_year=%s """, (args.cost_center, args.account, args.fiscal_year), as_dict=True) - + if budget and budget[0].budget_allocated: - yearly_action, monthly_action = frappe.db.get_value("Company", args.company, + yearly_action, monthly_action = frappe.db.get_value("Company", args.company, ["yearly_bgt_flag", "monthly_bgt_flag"]) action_for = action = "" if monthly_action in ["Stop", "Warn"]: - budget_amount = get_allocated_budget(budget[0].distribution_id, + budget_amount = get_allocated_budget(budget[0].distribution_id, args.posting_date, args.fiscal_year, budget[0].budget_allocated) - - args["month_end_date"] = frappe.db.sql("select LAST_DAY(%s)", + + args["month_end_date"] = frappe.db.sql("select LAST_DAY(%s)", args.posting_date)[0][0] action_for, action = "Monthly", monthly_action - + elif yearly_action in ["Stop", "Warn"]: budget_amount = budget[0].budget_allocated action_for, action = "Monthly", yearly_action @@ -311,44 +312,44 @@ def validate_expense_against_budget(args): if action_for: actual_expense = get_actual_expense(args) if actual_expense > budget_amount: - throw(action_for + _(" budget ") + cstr(budget_amount) + - _(" for account ") + args.account + _(" against cost center ") + - args.cost_center + _(" will exceed by ") + + throw(action_for + _(" budget ") + cstr(budget_amount) + + _(" for account ") + args.account + _(" against cost center ") + + args.cost_center + _(" will exceed by ") + cstr(actual_expense - budget_amount) + _(" after this transaction.") , exc=BudgetError if action=="Stop" else False) - + def get_allocated_budget(distribution_id, posting_date, fiscal_year, yearly_budget): if distribution_id: distribution = {} - for d in frappe.db.sql("""select bdd.month, bdd.percentage_allocation + for d in frappe.db.sql("""select bdd.month, bdd.percentage_allocation from `tabBudget Distribution Detail` bdd, `tabBudget Distribution` bd where bdd.parent=bd.name and bd.fiscal_year=%s""", fiscal_year, as_dict=1): distribution.setdefault(d.month, d.percentage_allocation) dt = frappe.db.get_value("Fiscal Year", fiscal_year, "year_start_date") budget_percentage = 0.0 - + while(dt <= getdate(posting_date)): if distribution_id: budget_percentage += distribution.get(getdate(dt).strftime("%B"), 0) else: budget_percentage += 100.0/12 - + dt = add_months(dt, 1) - + return yearly_budget * budget_percentage / 100 - + def get_actual_expense(args): args["condition"] = " and posting_date<='%s'" % args.month_end_date \ if args.get("month_end_date") else "" - + return frappe.db.sql(""" select sum(ifnull(debit, 0)) - sum(ifnull(credit, 0)) from `tabGL Entry` - where account='%(account)s' and cost_center='%(cost_center)s' + where account='%(account)s' and cost_center='%(cost_center)s' and fiscal_year='%(fiscal_year)s' and company='%(company)s' %(condition)s """ % (args))[0][0] - + def rename_account_for(dt, olddn, newdn, merge, company): old_account = get_account_for(dt, olddn) if old_account: @@ -358,29 +359,29 @@ def rename_account_for(dt, olddn, newdn, merge, company): new_account = frappe.rename_doc("Account", old_account, newdn) else: existing_new_account = get_account_for(dt, newdn) - new_account = frappe.rename_doc("Account", old_account, + new_account = frappe.rename_doc("Account", old_account, existing_new_account or newdn, merge=True if existing_new_account else False) frappe.db.set_value("Account", new_account or old_account, "master_name", newdn) - + def add_abbr_if_missing(dn, company): from erpnext.setup.doctype.company.company import get_name_with_abbr return get_name_with_abbr(dn, company) - + def get_account_for(account_for_doctype, account_for): if account_for_doctype in ["Customer", "Supplier"]: account_for_field = "master_type" elif account_for_doctype == "Warehouse": account_for_field = "account_type" - - return frappe.db.get_value("Account", {account_for_field: account_for_doctype, + + return frappe.db.get_value("Account", {account_for_field: account_for_doctype, "master_name": account_for}) - + def get_currency_precision(currency=None): if not currency: - currency = frappe.db.get_value("Company", + currency = frappe.db.get_value("Company", frappe.db.get_default("company"), "default_currency") currency_format = frappe.db.get_value("Currency", currency, "number_format") - + from frappe.utils import get_number_format_info return get_number_format_info(currency_format)[2] diff --git a/erpnext/selling/doctype/lead/test_lead.py b/erpnext/selling/doctype/lead/test_lead.py index b2533e0819..504f8398b7 100644 --- a/erpnext/selling/doctype/lead/test_lead.py +++ b/erpnext/selling/doctype/lead/test_lead.py @@ -10,13 +10,12 @@ test_records = frappe.get_test_records('Lead') class TestLead(unittest.TestCase): def test_make_customer(self): - print "test_make_customer" from erpnext.selling.doctype.lead.lead import make_customer customer = make_customer("_T-Lead-00001") self.assertEquals(customer[0]["doctype"], "Customer") self.assertEquals(customer[0]["lead_name"], "_T-Lead-00001") - + customer[0]["company"] = "_Test Company" customer[0]["customer_group"] = "_Test Customer Group" - frappe.get_doc(customer).insert() \ No newline at end of file + frappe.get_doc(customer).insert() From d29465029d9d756b4d6ed021d4821a9e6e0d646a Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 8 Apr 2014 20:10:03 +0530 Subject: [PATCH 39/42] Fixed Test Cases frappe/frappe#478 --- .../doctype/sales_invoice/sales_invoice.py | 290 ++++++------ .../sales_invoice/test_sales_invoice.py | 415 +++++++++--------- .../doctype/purchase_order/purchase_order.py | 114 ++--- .../purchase_order/test_purchase_order.py | 91 ++-- .../supplier_quotation/supplier_quotation.py | 2 +- .../test_supplier_quotation.py | 22 +- erpnext/controllers/accounts_controller.py | 197 ++++----- erpnext/controllers/selling_controller.py | 166 +++---- erpnext/manufacturing/doctype/bom/bom.py | 156 ++++--- erpnext/manufacturing/doctype/bom/test_bom.py | 18 +- .../production_order/test_production_order.py | 32 +- .../doctype/time_log/test_time_log.py | 5 +- .../time_log_batch/test_time_log_batch.py | 8 +- .../doctype/time_log_batch/time_log_batch.py | 8 +- erpnext/selling/doctype/customer/customer.py | 67 ++- erpnext/selling/doctype/lead/lead.py | 2 +- erpnext/selling/doctype/lead/test_lead.py | 10 +- .../doctype/opportunity/opportunity.py | 2 +- .../selling/doctype/quotation/quotation.py | 2 +- .../doctype/quotation/test_quotation.py | 30 +- .../doctype/sales_order/sales_order.py | 216 ++++----- .../doctype/sales_order/test_sales_order.py | 219 ++++----- .../doctype/delivery_note/delivery_note.py | 126 +++--- .../material_request/material_request.py | 6 +- .../purchase_receipt/purchase_receipt.py | 2 +- .../stock/doctype/stock_entry/stock_entry.py | 1 + .../doctype/customer_issue/customer_issue.py | 2 +- .../maintenance_schedule.py | 2 +- 28 files changed, 1095 insertions(+), 1116 deletions(-) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 41be553710..04a9959cfb 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -6,14 +6,12 @@ import frappe import frappe.defaults from frappe.utils import add_days, cint, cstr, date_diff, flt, getdate, nowdate, \ - get_first_day, get_last_day - -from frappe.utils import comma_and + get_first_day, get_last_day, comma_and from frappe.model.naming import make_autoname - from frappe import _, msgprint from erpnext.accounts.party import get_party_account, get_due_date +from erpnext.controllers.stock_controller import update_gl_entries_after month_map = {'Monthly': 1, 'Quarterly': 3, 'Half-yearly': 6, 'Yearly': 12} @@ -68,24 +66,24 @@ class SalesInvoice(SellingController): self.validate_c_form() self.validate_time_logs_are_submitted() self.validate_recurring_invoice() - self.validate_multiple_billing("Delivery Note", "dn_detail", "amount", + self.validate_multiple_billing("Delivery Note", "dn_detail", "amount", "delivery_note_details") def on_submit(self): - if cint(self.update_stock) == 1: + if cint(self.update_stock) == 1: self.update_stock_ledger() else: # Check for Approving Authority if not self.recurring_id: - frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype, + frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype, self.company, self.grand_total, self) - + self.check_prev_docstatus() - + self.update_status_updater_args() self.update_prevdoc_status() self.update_billing_status_for_zero_amount_refdoc("Sales Order") - + # this sequence because outstanding may get -ve self.make_gl_entries() self.check_credit_limit(self.debit_to) @@ -103,18 +101,18 @@ class SalesInvoice(SellingController): def on_cancel(self): if cint(self.update_stock) == 1: self.update_stock_ledger() - + self.check_stop_sales_order("sales_order") - + from erpnext.accounts.utils import remove_against_link_from_jv remove_against_link_from_jv(self.doctype, self.name, "against_invoice") self.update_status_updater_args() self.update_prevdoc_status() self.update_billing_status_for_zero_amount_refdoc("Sales Order") - + self.make_cancel_gl_entries() - + def update_status_updater_args(self): if cint(self.update_stock): self.status_updater.append({ @@ -133,31 +131,31 @@ class SalesInvoice(SellingController): 'second_source_field': 'qty', 'second_join_field': 'prevdoc_detail_docname' }) - + def on_update_after_submit(self): self.validate_recurring_invoice() self.convert_to_recurring() - + def get_portal_page(self): return "invoice" if self.docstatus==1 else None - + def set_missing_values(self, for_validate=False): self.set_pos_fields(for_validate) - + if not self.debit_to: self.debit_to = get_party_account(self.company, self.customer, "Customer") if not self.due_date: self.due_date = get_due_date(self.posting_date, self.customer, "Customer", self.debit_to, self.company) - + super(SalesInvoice, self).set_missing_values(for_validate) - + def update_time_log_batch(self, sales_invoice): for d in self.get(self.fname): if d.time_log_batch: tlb = frappe.get_doc("Time Log Batch", d.time_log_batch) tlb.sales_invoice = sales_invoice - tlb.update_after_submit() + tlb.save() def validate_time_logs_are_submitted(self): for d in self.get(self.fname): @@ -171,10 +169,10 @@ class SalesInvoice(SellingController): """Set retail related fields from pos settings""" if cint(self.is_pos) != 1: return - - from erpnext.stock.get_item_details import get_pos_settings_item_details, get_pos_settings + + from erpnext.stock.get_item_details import get_pos_settings_item_details, get_pos_settings pos = get_pos_settings(self.company) - + if pos: if not for_validate and not self.customer: self.customer = pos.customer @@ -184,31 +182,31 @@ class SalesInvoice(SellingController): 'selling_price_list', 'company', 'select_print_heading', 'cash_bank_account'): if (not for_validate) or (for_validate and not self.get(fieldname)): self.set(fieldname, pos.get(fieldname)) - + if not for_validate: self.update_stock = cint(pos.get("update_stock")) # set pos values in items for item in self.get("entries"): if item.get('item_code'): - for fname, val in get_pos_settings_item_details(pos, + for fname, val in get_pos_settings_item_details(pos, frappe._dict(item.as_dict()), pos).items(): - + if (not for_validate) or (for_validate and not item.get(fname)): item.set(fname, val) - # fetch terms + # fetch terms if self.tc_name and not self.terms: self.terms = frappe.db.get_value("Terms and Conditions", self.tc_name, "terms") - + # fetch charges if self.taxes_and_charges and not len(self.get("other_charges")): self.set_taxes("other_charges", "taxes_and_charges") - + def get_advances(self): - super(SalesInvoice, self).get_advances(self.debit_to, + super(SalesInvoice, self).get_advances(self.debit_to, "Sales Invoice Advance", "advance_adjustment_details", "credit") - + def get_company_abbr(self): return frappe.db.sql("select abbr from tabCompany where name=%s", self.company)[0][0] @@ -219,32 +217,32 @@ class SalesInvoice(SellingController): 2. split into multiple rows if partially adjusted, assign against voucher 3. submit advance voucher """ - + lst = [] for d in self.get('advance_adjustment_details'): if flt(d.allocated_amount) > 0: args = { - 'voucher_no' : d.journal_voucher, - 'voucher_detail_no' : d.jv_detail_no, - 'against_voucher_type' : 'Sales Invoice', + 'voucher_no' : d.journal_voucher, + 'voucher_detail_no' : d.jv_detail_no, + 'against_voucher_type' : 'Sales Invoice', 'against_voucher' : self.name, - 'account' : self.debit_to, - 'is_advance' : 'Yes', - 'dr_or_cr' : 'credit', + 'account' : self.debit_to, + 'is_advance' : 'Yes', + 'dr_or_cr' : 'credit', 'unadjusted_amt' : flt(d.advance_amount), 'allocated_amt' : flt(d.allocated_amount) } lst.append(args) - + if lst: from erpnext.accounts.utils import reconcile_against_document reconcile_against_document(lst) - + def validate_customer_account(self): """Validates Debit To Account and Customer Matches""" if self.customer and self.debit_to and not cint(self.is_pos): acc_head = frappe.db.sql("select master_name from `tabAccount` where name = %s and docstatus != 2", self.debit_to) - + if (acc_head and cstr(acc_head[0][0]) != cstr(self.customer)) or \ (not acc_head and (self.debit_to != cstr(self.customer) + " - " + self.get_company_abbr())): msgprint("Debit To: %s do not match with Customer: %s for Company: %s.\n If both correctly entered, please select Master Type \ @@ -254,20 +252,20 @@ class SalesInvoice(SellingController): def validate_debit_acc(self): if frappe.db.get_value("Account", self.debit_to, "report_type") != "Balance Sheet": frappe.throw(_("Account must be a balance sheet account")) - + def validate_fixed_asset_account(self): """Validate Fixed Asset and whether Income Account Entered Exists""" for d in self.get('entries'): - item = frappe.db.sql("""select name,is_asset_item,is_sales_item from `tabItem` - where name = %s and (ifnull(end_of_life,'')='' or end_of_life = '0000-00-00' + item = frappe.db.sql("""select name,is_asset_item,is_sales_item from `tabItem` + where name = %s and (ifnull(end_of_life,'')='' or end_of_life = '0000-00-00' or end_of_life > now())""", d.item_code) - acc = frappe.db.sql("""select account_type from `tabAccount` + acc = frappe.db.sql("""select account_type from `tabAccount` where name = %s and docstatus != 2""", d.income_account) if not acc: msgprint("Account: "+d.income_account+" does not exist in the system", raise_exception=True) elif item and item[0][1] == 'Yes' and not acc[0][0] == 'Fixed Asset': - msgprint("Please select income head with account type 'Fixed Asset' as Item %s is an asset item" % d.item_code, raise_exception=True) - + msgprint("Please select income head with account type 'Fixed Asset' as Item %s is an asset item" % d.item_code, raise_exception=True) + def validate_with_previous_doc(self): super(SalesInvoice, self).validate_with_previous_doc(self.tname, { "Sales Order": { @@ -281,7 +279,7 @@ class SalesInvoice(SellingController): ["currency", "="]], }, }) - + if cint(frappe.defaults.get_global_default('maintain_same_sales_rate')): super(SalesInvoice, self).validate_with_previous_doc(self.tname, { "Sales Order Item": { @@ -296,7 +294,7 @@ class SalesInvoice(SellingController): "is_child_table": True } }) - + def set_aging_date(self): if self.is_opening != 'Yes': @@ -304,7 +302,7 @@ class SalesInvoice(SellingController): elif not self.aging_date: msgprint("Aging Date is mandatory for opening entry") raise Exception - + def set_against_income_account(self): """Set against account for debit to account""" @@ -333,8 +331,8 @@ class SalesInvoice(SellingController): def validate_proj_cust(self): """check for does customer belong to same project as entered..""" if self.project_name and self.customer: - res = frappe.db.sql("""select name from `tabProject` - where name = %s and (customer = %s or + res = frappe.db.sql("""select name from `tabProject` + where name = %s and (customer = %s or ifnull(customer,'')='')""", (self.project_name, self.customer)) if not res: msgprint("Customer - %s does not belong to project - %s. \n\nIf you want to use project for multiple customers then please make customer details blank in that project."%(self.customer,self.project_name)) @@ -355,7 +353,7 @@ class SalesInvoice(SellingController): if not d.item_code: msgprint("Please enter Item Code at line no : %s to update stock or remove check from Update Stock in Basic Info Tab." % (d.idx), raise_exception=True) - + def validate_delivery_note(self): for d in self.get("entries"): if d.delivery_note: @@ -374,7 +372,7 @@ class SalesInvoice(SellingController): and parent = %s""", (self.amended_from, self.c_form_no)) frappe.db.set(self, 'c_form_no', '') - + def update_current_stock(self): for d in self.get('entries'): if d.item_code and d.warehouse: @@ -385,15 +383,15 @@ class SalesInvoice(SellingController): bin = frappe.db.sql("select actual_qty, projected_qty from `tabBin` where item_code = %s and warehouse = %s", (d.item_code, d.warehouse), as_dict = 1) d.actual_qty = bin and flt(bin[0]['actual_qty']) or 0 d.projected_qty = bin and flt(bin[0]['projected_qty']) or 0 - - + + def get_warehouse(self): - w = frappe.db.sql("""select warehouse from `tabPOS Setting` - where ifnull(user,'') = %s and company = %s""", + w = frappe.db.sql("""select warehouse from `tabPOS Setting` + where ifnull(user,'') = %s and company = %s""", (frappe.session['user'], self.company)) w = w and w[0][0] or '' if not w: - ps = frappe.db.sql("""select name, warehouse from `tabPOS Setting` + ps = frappe.db.sql("""select name, warehouse from `tabPOS Setting` where ifnull(user,'') = '' and company = %s""", self.company) if not ps: msgprint("To make POS entry, please create POS Setting from Accounts --> POS Setting page and refresh the system.", raise_exception=True) @@ -417,11 +415,11 @@ class SalesInvoice(SellingController): make_packing_list(self, 'entries') else: self.set('packing_details', []) - + if cint(self.is_pos) == 1: if flt(self.paid_amount) == 0: - if self.cash_bank_account: - frappe.db.set(self, 'paid_amount', + if self.cash_bank_account: + frappe.db.set(self, 'paid_amount', (flt(self.grand_total) - flt(self.write_off_amount))) else: # show message that the amount is not paid @@ -429,18 +427,18 @@ class SalesInvoice(SellingController): frappe.msgprint("Note: Payment Entry will not be created since 'Cash/Bank Account' was not specified.") else: frappe.db.set(self,'paid_amount',0) - + def check_prev_docstatus(self): for d in self.get('entries'): if d.sales_order: - submitted = frappe.db.sql("""select name from `tabSales Order` + submitted = frappe.db.sql("""select name from `tabSales Order` where docstatus = 1 and name = %s""", d.sales_order) if not submitted: msgprint("Sales Order : "+ cstr(d.sales_order) +" is not submitted") raise Exception , "Validation Error." if d.delivery_note: - submitted = frappe.db.sql("""select name from `tabDelivery Note` + submitted = frappe.db.sql("""select name from `tabDelivery Note` where docstatus = 1 and name = %s""", d.delivery_note) if not submitted: msgprint("Delivery Note : "+ cstr(d.delivery_note) +" is not submitted") @@ -455,45 +453,44 @@ class SalesInvoice(SellingController): "actual_qty": -1*flt(d.qty), "stock_uom": frappe.db.get_value("Item", d.item_code, "stock_uom") })) - + self.make_sl_entries(sl_entries) - + def make_gl_entries(self, repost_future_gle=True): gl_entries = self.get_gl_entries() - + if gl_entries: from erpnext.accounts.general_ledger import make_gl_entries - + update_outstanding = cint(self.is_pos) and self.write_off_account \ and 'No' or 'Yes' - make_gl_entries(gl_entries, cancel=(self.docstatus == 2), + make_gl_entries(gl_entries, cancel=(self.docstatus == 2), update_outstanding=update_outstanding, merge_entries=False) if repost_future_gle and cint(self.update_stock) \ and cint(frappe.defaults.get_global_default("auto_accounting_for_stock")): items, warehouse_account = self.get_items_and_warehouse_accounts() - from controllers.stock_controller import update_gl_entries_after - update_gl_entries_after(self.posting_date, self.posting_time, + update_gl_entries_after(self.posting_date, self.posting_time, warehouse_account, items) - + def get_gl_entries(self, warehouse_account=None): from erpnext.accounts.general_ledger import merge_similar_entries - + gl_entries = [] - + self.make_customer_gl_entry(gl_entries) - + self.make_tax_gl_entries(gl_entries) - + self.make_item_gl_entries(gl_entries) - + # merge gl entries before adding pos entries gl_entries = merge_similar_entries(gl_entries) - + self.make_pos_gl_entries(gl_entries) - + return gl_entries - + def make_customer_gl_entry(self, gl_entries): if self.grand_total: gl_entries.append( @@ -506,7 +503,7 @@ class SalesInvoice(SellingController): "against_voucher_type": self.doctype, }) ) - + def make_tax_gl_entries(self, gl_entries): for tax in self.get("other_charges"): if flt(tax.tax_amount_after_discount_amount): @@ -519,9 +516,9 @@ class SalesInvoice(SellingController): "cost_center": tax.cost_center }) ) - - def make_item_gl_entries(self, gl_entries): - # income account gl entries + + def make_item_gl_entries(self, gl_entries): + # income account gl entries for item in self.get("entries"): if flt(item.base_amount): gl_entries.append( @@ -533,12 +530,12 @@ class SalesInvoice(SellingController): "cost_center": item.cost_center }) ) - + # expense account gl entries if cint(frappe.defaults.get_global_default("auto_accounting_for_stock")) \ and cint(self.update_stock): gl_entries += super(SalesInvoice, self).get_gl_entries() - + def make_pos_gl_entries(self, gl_entries): if cint(self.is_pos) and self.cash_bank_account and self.paid_amount: # POS, make payment entries @@ -581,81 +578,81 @@ class SalesInvoice(SellingController): "cost_center": self.write_off_cost_center }) ) - + def update_c_form(self): """Update amended id in C-form""" if self.c_form_no and self.amended_from: frappe.db.sql("""update `tabC-Form Invoice Detail` set invoice_no = %s, invoice_date = %s, territory = %s, net_total = %s, - grand_total = %s where invoice_no = %s and parent = %s""", + grand_total = %s where invoice_no = %s and parent = %s""", (self.name, self.amended_from, self.c_form_no)) - + def validate_recurring_invoice(self): if self.convert_into_recurring_invoice: self.validate_notification_email_id() - + if not self.recurring_type: msgprint(_("Please select: ") + self.meta.get_label("recurring_type"), raise_exception=1) - + elif not (self.invoice_period_from_date and \ self.invoice_period_to_date): msgprint(comma_and([self.meta.get_label("invoice_period_from_date"), self.meta.get_label("invoice_period_to_date")]) + _(": Mandatory for a Recurring Invoice."), raise_exception=True) - + def convert_to_recurring(self): if self.convert_into_recurring_invoice: if not self.recurring_id: frappe.db.set(self, "recurring_id", make_autoname("RECINV/.#####")) - + self.set_next_date() elif self.recurring_id: frappe.db.sql("""update `tabSales Invoice` set convert_into_recurring_invoice = 0 where recurring_id = %s""", (self.recurring_id,)) - + def validate_notification_email_id(self): if self.notification_email_address: email_list = filter(None, [cstr(email).strip() for email in self.notification_email_address.replace("\n", "").split(",")]) - + from frappe.utils import validate_email_add for email in email_list: if not validate_email_add(email): msgprint(self.meta.get_label("notification_email_address") \ + " - " + _("Invalid Email Address") + ": \"%s\"" % email, raise_exception=1) - + else: msgprint("Notification Email Addresses not specified for recurring invoice", raise_exception=1) - + def set_next_date(self): """ Set next date on which auto invoice will be created""" if not self.repeat_on_day_of_month: - msgprint("""Please enter 'Repeat on Day of Month' field value. - The day of the month on which auto invoice + msgprint("""Please enter 'Repeat on Day of Month' field value. + The day of the month on which auto invoice will be generated e.g. 05, 28 etc.""", raise_exception=1) - + next_date = get_next_date(self.posting_date, month_map[self.recurring_type], cint(self.repeat_on_day_of_month)) - + frappe.db.set(self, 'next_date', next_date) - + def get_next_date(dt, mcount, day=None): dt = getdate(dt) - + from dateutil.relativedelta import relativedelta dt += relativedelta(months=mcount, day=day) - + return dt - + def manage_recurring_invoices(next_date=None, commit=True): - """ + """ Create recurring invoices on specific date by copying the original one and notify the concerned people """ @@ -664,7 +661,7 @@ def manage_recurring_invoices(next_date=None, commit=True): from `tabSales Invoice` where ifnull(convert_into_recurring_invoice, 0)=1 and docstatus=1 and next_date=%s and next_date <= ifnull(end_date, '2199-12-31')""", next_date) - + exception_list = [] for ref_invoice, recurring_id in recurring_invoices: if not frappe.db.sql("""select name from `tabSales Invoice` @@ -690,21 +687,20 @@ def manage_recurring_invoices(next_date=None, commit=True): finally: if commit: frappe.db.begin() - + if exception_list: exception_message = "\n\n".join([cstr(d) for d in exception_list]) raise Exception, exception_message def make_new_invoice(ref_wrapper, posting_date): - from frappe.model.doc import clone from erpnext.accounts.utils import get_fiscal_year - new_invoice = clone(ref_wrapper) - + new_invoice = frappe.copy_doc(ref_wrapper) + mcount = month_map[ref_wrapper.recurring_type] - + invoice_period_from_date = get_next_date(ref_wrapper.invoice_period_from_date, mcount) - - # get last day of the month to maintain period if the from date is first day of its own month + + # get last day of the month to maintain period if the from date is first day of its own month # and to date is the last day of its own month if (cstr(get_first_day(ref_wrapper.invoice_period_from_date)) == \ cstr(ref_wrapper.invoice_period_from_date)) and \ @@ -714,7 +710,7 @@ def make_new_invoice(ref_wrapper, posting_date): mcount)) else: invoice_period_to_date = get_next_date(ref_wrapper.invoice_period_to_date, mcount) - + new_invoice.update({ "posting_date": posting_date, "aging_date": posting_date, @@ -725,30 +721,30 @@ def make_new_invoice(ref_wrapper, posting_date): "fiscal_year": get_fiscal_year(posting_date)[0], "owner": ref_wrapper.owner, }) - + new_invoice.submit() - + return new_invoice - + def send_notification(new_rv): """Notify concerned persons about recurring invoice generation""" - + from frappe.core.doctype.print_format.print_format import get_html - frappe.sendmail(new_rv.notification_email_address, - subject="New Invoice : " + new_rv.name, + frappe.sendmail(new_rv.notification_email_address, + subject="New Invoice : " + new_rv.name, message = get_html(new_rv, new_rv, "SalesInvoice")) - + def notify_errors(inv, customer, owner): from frappe.utils.user import get_system_managers recipients=get_system_managers() - + frappe.sendmail(recipients + [frappe.db.get_value("User", owner, "email")], subject="[Urgent] Error while creating recurring invoice for %s" % inv, message = frappe.get_template("template/emails/recurring_invoice_failed.html").render({ "name": inv, "customer": customer })) - + assign_task_to_owner(inv, "Recurring Invoice Failed", recipients) def assign_task_to_owner(inv, msg, users): @@ -776,64 +772,64 @@ def get_bank_cash_account(mode_of_payment): def get_income_account(doctype, txt, searchfield, start, page_len, filters): from erpnext.controllers.queries import get_match_cond - # income account can be any Credit account, - # but can also be a Asset account with account_type='Income Account' in special circumstances. + # income account can be any Credit account, + # but can also be a Asset account with account_type='Income Account' in special circumstances. # Hence the first condition is an "OR" - return frappe.db.sql("""select tabAccount.name from `tabAccount` + return frappe.db.sql("""select tabAccount.name from `tabAccount` where (tabAccount.report_type = "Profit and Loss" - or tabAccount.account_type = "Income Account") - and tabAccount.group_or_ledger="Ledger" + or tabAccount.account_type = "Income Account") + and tabAccount.group_or_ledger="Ledger" and tabAccount.docstatus!=2 and ifnull(tabAccount.master_type, "")="" and ifnull(tabAccount.master_name, "")="" - and tabAccount.company = '%(company)s' + and tabAccount.company = '%(company)s' and tabAccount.%(key)s LIKE '%(txt)s' - %(mcond)s""" % {'company': filters['company'], 'key': searchfield, + %(mcond)s""" % {'company': filters['company'], 'key': searchfield, 'txt': "%%%s%%" % txt, 'mcond':get_match_cond(doctype)}) @frappe.whitelist() def make_delivery_note(source_name, target_doc=None): from frappe.model.mapper import get_mapped_doc - + def set_missing_values(source, target): doc = frappe.get_doc(target) doc.run_method("onload_post_render") - + def update_item(source_doc, target_doc, source_parent): target_doc.base_amount = (flt(source_doc.qty) - flt(source_doc.delivered_qty)) * \ flt(source_doc.base_rate) target_doc.amount = (flt(source_doc.qty) - flt(source_doc.delivered_qty)) * \ flt(source_doc.rate) target_doc.qty = flt(source_doc.qty) - flt(source_doc.delivered_qty) - + doclist = get_mapped_doc("Sales Invoice", source_name, { "Sales Invoice": { - "doctype": "Delivery Note", + "doctype": "Delivery Note", "validation": { "docstatus": ["=", 1] } - }, + }, "Sales Invoice Item": { - "doctype": "Delivery Note Item", + "doctype": "Delivery Note Item", "field_map": { - "name": "prevdoc_detail_docname", - "parent": "against_sales_invoice", + "name": "prevdoc_detail_docname", + "parent": "against_sales_invoice", "serial_no": "serial_no" }, "postprocess": update_item - }, + }, "Sales Taxes and Charges": { - "doctype": "Sales Taxes and Charges", + "doctype": "Sales Taxes and Charges", "add_if_empty": True - }, + }, "Sales Team": { - "doctype": "Sales Team", + "doctype": "Sales Team", "field_map": { "incentives": "incentives" }, "add_if_empty": True } }, target_doc, set_missing_values) - - return doclist.as_dict() \ No newline at end of file + + return doclist diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index 8baeb76d99..2a0bc248a0 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -2,7 +2,7 @@ # License: GNU General Public License v3. See license.txt import frappe -import unittest, json +import unittest, json, copy from frappe.utils import flt from erpnext.accounts.utils import get_stock_and_account_difference from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import set_perpetual_inventory @@ -14,57 +14,46 @@ class TestSalesInvoice(unittest.TestCase): w.insert() w.submit() return w - - def test_double_submission(self): - w = frappe.copy_doc(test_records[0]) - w.docstatus = '0' - w.insert() - - w2 = frappe.copy_doc(test_records[0]) - w.submit() - - w = frappe.get_doc(w2) - self.assertRaises(frappe.DocstatusTransitionError, w.submit) - + def test_timestamp_change(self): w = frappe.copy_doc(test_records[0]) - w.docstatus = '0' + w.docstatus = 0 w.insert() - w2 = frappe.copy_doc(w) - + w2 = frappe.get_doc(w.doctype, w.name) + import time time.sleep(1) w.save() - + import time time.sleep(1) self.assertRaises(frappe.TimestampMismatchError, w2.save) - + def test_sales_invoice_calculation_base_currency(self): si = frappe.copy_doc(test_records[2]) si.insert() - + expected_values = { - "keys": ["price_list_rate", "discount_percentage", "rate", "amount", + "keys": ["price_list_rate", "discount_percentage", "rate", "amount", "base_price_list_rate", "base_rate", "base_amount"], "_Test Item Home Desktop 100": [50, 0, 50, 500, 50, 50, 500], "_Test Item Home Desktop 200": [150, 0, 150, 750, 150, 150, 750], } - + # check if children are saved self.assertEquals(len(si.get("entries")), len(expected_values)-1) - + # check if item values are calculated for d in si.get("entries"): for i, k in enumerate(expected_values["keys"]): self.assertEquals(d.get(k), expected_values[d.item_code][i]) - + # check net total self.assertEquals(si.net_total, 1250) self.assertEquals(si.net_total_export, 1250) - + # check tax calculation expected_values = { "keys": ["tax_amount", "total"], @@ -77,14 +66,14 @@ class TestSalesInvoice(unittest.TestCase): "_Test Account VAT - _TC": [156.25, 1807.83], "_Test Account Discount - _TC": [-180.78, 1627.05] } - + for d in si.get("other_charges"): for i, k in enumerate(expected_values["keys"]): self.assertEquals(d.get(k), expected_values[d.account_head][i]) - + self.assertEquals(si.grand_total, 1627.05) self.assertEquals(si.grand_total_export, 1627.05) - + def test_sales_invoice_calculation_export_currency(self): si = frappe.copy_doc(test_records[2]) si.currency = "USD" @@ -94,27 +83,27 @@ class TestSalesInvoice(unittest.TestCase): si.get("entries")[1].rate = 3 si.get("entries")[1].price_list_rate = 3 si.insert() - + expected_values = { - "keys": ["price_list_rate", "discount_percentage", "rate", "amount", + "keys": ["price_list_rate", "discount_percentage", "rate", "amount", "base_price_list_rate", "base_rate", "base_amount"], "_Test Item Home Desktop 100": [1, 0, 1, 10, 50, 50, 500], "_Test Item Home Desktop 200": [3, 0, 3, 15, 150, 150, 750], } - + # check if children are saved self.assertEquals(len(si.get("entries")), len(expected_values)-1) - + # check if item values are calculated for d in si.get("entries"): for i, k in enumerate(expected_values["keys"]): self.assertEquals(d.get(k), expected_values[d.item_code][i]) - + # check net total self.assertEquals(si.net_total, 1250) self.assertEquals(si.net_total_export, 25) - + # check tax calculation expected_values = { "keys": ["tax_amount", "total"], @@ -127,11 +116,11 @@ class TestSalesInvoice(unittest.TestCase): "_Test Account VAT - _TC": [156.25, 1807.83], "_Test Account Discount - _TC": [-180.78, 1627.05] } - + for d in si.get("other_charges"): for i, k in enumerate(expected_values["keys"]): self.assertEquals(d.get(k), expected_values[d.account_head][i]) - + self.assertEquals(si.grand_total, 1627.05) self.assertEquals(si.grand_total_export, 32.54) @@ -148,27 +137,27 @@ class TestSalesInvoice(unittest.TestCase): "row_id": 8, }) si.insert() - + expected_values = { - "keys": ["price_list_rate", "discount_percentage", "rate", "amount", + "keys": ["price_list_rate", "discount_percentage", "rate", "amount", "base_price_list_rate", "base_rate", "base_amount"], "_Test Item Home Desktop 100": [62.5, 0, 62.5, 625.0, 50, 50, 465.37], "_Test Item Home Desktop 200": [190.66, 0, 190.66, 953.3, 150, 150, 698.08], } - + # check if children are saved self.assertEquals(len(si.get("entries")), len(expected_values)-1) - + # check if item values are calculated for d in si.get("entries"): for i, k in enumerate(expected_values["keys"]): self.assertEquals(d.get(k), expected_values[d.item_code][i]) - + # check net total self.assertEquals(si.net_total, 1163.45) self.assertEquals(si.net_total_export, 1578.3) - + # check tax calculation expected_values = { "keys": ["tax_amount", "tax_amount_after_discount_amount", "total"], @@ -182,11 +171,11 @@ class TestSalesInvoice(unittest.TestCase): "_Test Account Discount - _TC": [-180.33, -168.54, 1516.88], "_Test Account Service Tax - _TC": [-18.03, -16.88, 1500] } - + for d in si.get("other_charges"): for i, k in enumerate(expected_values["keys"]): self.assertEquals(d.get(k), expected_values[d.account_head][i]) - + self.assertEquals(si.grand_total, 1500) self.assertEquals(si.grand_total_export, 1500) @@ -213,15 +202,15 @@ class TestSalesInvoice(unittest.TestCase): expected_values = sorted([ [si.debit_to, 1500, 0.0], - [test_records[3][1]["income_account"], 0.0, 1163.45], - [test_records[3][3]["account_head"], 0.0, 130.31], - [test_records[3][4]["account_head"], 0.0, 2.61], - [test_records[3][5]["account_head"], 0.0, 1.31], - [test_records[3][6]["account_head"], 0.0, 25.96], - [test_records[3][7]["account_head"], 0.0, 145.43], - [test_records[3][8]["account_head"], 0.0, 116.35], - [test_records[3][9]["account_head"], 0.0, 100], - [test_records[3][10]["account_head"], 168.54, 0.0], + [test_records[3]["entries"][0]["income_account"], 0.0, 1163.45], + [test_records[3]["other_charges"][0]["account_head"], 0.0, 130.31], + [test_records[3]["other_charges"][1]["account_head"], 0.0, 2.61], + [test_records[3]["other_charges"][2]["account_head"], 0.0, 1.31], + [test_records[3]["other_charges"][3]["account_head"], 0.0, 25.96], + [test_records[3]["other_charges"][4]["account_head"], 0.0, 145.43], + [test_records[3]["other_charges"][5]["account_head"], 0.0, 116.35], + [test_records[3]["other_charges"][6]["account_head"], 0.0, 100], + [test_records[3]["other_charges"][7]["account_head"], 168.54, 0.0], ["_Test Account Service Tax - _TC", 16.88, 0.0], ]) @@ -233,7 +222,7 @@ class TestSalesInvoice(unittest.TestCase): # cancel si.cancel() - gle = frappe.db.sql("""select * from `tabGL Entry` + gle = frappe.db.sql("""select * from `tabGL Entry` where voucher_type='Sales Invoice' and voucher_no=%s""", si.name) self.assertFalse(gle) @@ -242,44 +231,44 @@ class TestSalesInvoice(unittest.TestCase): si = frappe.copy_doc(test_records[2]) for i, tax in enumerate(si.get("other_charges")): tax.idx = i+1 - + si.get("entries")[0].price_list_rate = 62.5 si.get("entries")[0].price_list_rate = 191 - for i in [2, 4, 5, 6, 7, 8]: + for i in xrange(6): si.get("other_charges")[i].included_in_print_rate = 1 - + # tax type "Actual" cannot be inclusive self.assertRaises(frappe.ValidationError, si.insert) - + # taxes above included type 'On Previous Row Total' should also be included si.get("other_charges")[0].included_in_print_rate = 0 self.assertRaises(frappe.ValidationError, si.insert) - + def test_sales_invoice_calculation_base_currency_with_tax_inclusive_price(self): # prepare si = frappe.copy_doc(test_records[3]) si.insert() - + expected_values = { - "keys": ["price_list_rate", "discount_percentage", "rate", "amount", + "keys": ["price_list_rate", "discount_percentage", "rate", "amount", "base_price_list_rate", "base_rate", "base_amount"], "_Test Item Home Desktop 100": [62.5, 0, 62.5, 625.0, 50, 50, 499.98], "_Test Item Home Desktop 200": [190.66, 0, 190.66, 953.3, 150, 150, 750], } - + # check if children are saved self.assertEquals(len(si.get("entries")), len(expected_values)-1) - + # check if item values are calculated for d in si.get("entries"): for i, k in enumerate(expected_values["keys"]): self.assertEquals(d.get(k), expected_values[d.item_code][i]) - + # check net total self.assertEquals(si.net_total, 1249.98) self.assertEquals(si.net_total_export, 1578.3) - + # check tax calculation expected_values = { "keys": ["tax_amount", "total"], @@ -292,14 +281,14 @@ class TestSalesInvoice(unittest.TestCase): "_Test Account Shipping Charges - _TC": [100, 1803.31], "_Test Account Discount - _TC": [-180.33, 1622.98] } - + for d in si.get("other_charges"): for i, k in enumerate(expected_values["keys"]): self.assertEquals(d.get(k), expected_values[d.account_head][i]) - + self.assertEquals(si.grand_total, 1622.98) self.assertEquals(si.grand_total_export, 1622.98) - + def test_sales_invoice_calculation_export_currency_with_tax_inclusive_price(self): # prepare si = frappe.copy_doc(test_records[3]) @@ -309,30 +298,29 @@ class TestSalesInvoice(unittest.TestCase): si.get("entries")[0].discount_percentage = 10 si.get("entries")[1].price_list_rate = 187.5 si.get("entries")[1].discount_percentage = 20 - si.get("other_charges")[5].rate = 5000 - + si.get("other_charges")[6].rate = 5000 + si.insert() - + expected_values = { - "keys": ["price_list_rate", "discount_percentage", "rate", "amount", + "keys": ["price_list_rate", "discount_percentage", "rate", "amount", "base_price_list_rate", "base_rate", "base_amount"], "_Test Item Home Desktop 100": [55.56, 10, 50, 500, 2222.11, 1999.9, 19999.04], "_Test Item Home Desktop 200": [187.5, 20, 150, 750, 7375.66, 5900.53, 29502.66], } - + # check if children are saved - self.assertEquals(len(si.get("entries")), - len(expected_values)-1) - + self.assertEquals(len(si.get("entries")), len(expected_values)-1) + # check if item values are calculated for d in si.get("entries"): for i, k in enumerate(expected_values["keys"]): self.assertEquals(d.get(k), expected_values[d.item_code][i]) - + # check net total self.assertEquals(si.net_total, 49501.7) self.assertEquals(si.net_total_export, 1250) - + # check tax calculation expected_values = { "keys": ["tax_amount", "total"], @@ -345,134 +333,134 @@ class TestSalesInvoice(unittest.TestCase): "_Test Account Shipping Charges - _TC": [5000, 72450.17], "_Test Account Discount - _TC": [-7245.01, 65205.16] } - + for d in si.get("other_charges"): for i, k in enumerate(expected_values["keys"]): self.assertEquals(d.get(k), expected_values[d.account_head][i]) - + self.assertEquals(si.grand_total, 65205.16) self.assertEquals(si.grand_total_export, 1304.1) def test_outstanding(self): w = self.make() self.assertEquals(w.outstanding_amount, w.grand_total) - + def test_payment(self): frappe.db.sql("""delete from `tabGL Entry`""") w = self.make() - + from erpnext.accounts.doctype.journal_voucher.test_journal_voucher \ import test_records as jv_test_records - + jv = frappe.get_doc(frappe.copy_doc(jv_test_records[0])) jv.get("entries")[0].against_invoice = w.name jv.insert() jv.submit() - + self.assertEquals(frappe.db.get_value("Sales Invoice", w.name, "outstanding_amount"), 161.8) - + jv.cancel() self.assertEquals(frappe.db.get_value("Sales Invoice", w.name, "outstanding_amount"), 561.8) - + def test_time_log_batch(self): tlb = frappe.get_doc("Time Log Batch", "_T-Time Log Batch-00001") tlb.submit() - + si = frappe.get_doc(frappe.copy_doc(test_records[0])) si.get("entries")[0].time_log_batch = "_T-Time Log Batch-00001" si.insert() si.submit() - + self.assertEquals(frappe.db.get_value("Time Log Batch", "_T-Time Log Batch-00001", "status"), "Billed") - self.assertEquals(frappe.db.get_value("Time Log", "_T-Time Log-00001", "status"), + self.assertEquals(frappe.db.get_value("Time Log", "_T-Time Log-00001", "status"), "Billed") si.cancel() - self.assertEquals(frappe.db.get_value("Time Log Batch", "_T-Time Log Batch-00001", + self.assertEquals(frappe.db.get_value("Time Log Batch", "_T-Time Log Batch-00001", "status"), "Submitted") - self.assertEquals(frappe.db.get_value("Time Log", "_T-Time Log-00001", "status"), + self.assertEquals(frappe.db.get_value("Time Log", "_T-Time Log-00001", "status"), "Batched for Billing") - + def test_sales_invoice_gl_entry_without_aii(self): self.clear_stock_account_balance() set_perpetual_inventory(0) si = frappe.copy_doc(test_records[1]) si.insert() si.submit() - + gl_entries = frappe.db.sql("""select account, debit, credit from `tabGL Entry` where voucher_type='Sales Invoice' and voucher_no=%s order by account asc""", si.name, as_dict=1) - + self.assertTrue(gl_entries) - + expected_values = sorted([ [si.debit_to, 630.0, 0.0], - [test_records[1][1]["income_account"], 0.0, 500.0], - [test_records[1][2]["account_head"], 0.0, 80.0], - [test_records[1][3]["account_head"], 0.0, 50.0], + [test_records[1]["entries"][0]["income_account"], 0.0, 500.0], + [test_records[1]["other_charges"][0]["account_head"], 0.0, 80.0], + [test_records[1]["other_charges"][1]["account_head"], 0.0, 50.0], ]) - + for i, gle in enumerate(gl_entries): self.assertEquals(expected_values[i][0], gle.account) self.assertEquals(expected_values[i][1], gle.debit) self.assertEquals(expected_values[i][2], gle.credit) - + # cancel si.cancel() - - gle = frappe.db.sql("""select * from `tabGL Entry` + + gle = frappe.db.sql("""select * from `tabGL Entry` where voucher_type='Sales Invoice' and voucher_no=%s""", si.name) - + self.assertFalse(gle) - + def test_pos_gl_entry_with_aii(self): self.clear_stock_account_balance() set_perpetual_inventory() - + self._insert_purchase_receipt() self._insert_pos_settings() - - pos = frappe.copy_doc(test_records[1]) - pos[0]["is_pos"] = 1 - pos[0]["update_stock"] = 1 - pos[0]["posting_time"] = "12:05" - pos[0]["cash_bank_account"] = "_Test Account Bank Account - _TC" - pos[0]["paid_amount"] = 600.0 + + pos = copy.deepcopy(test_records[1]) + pos["is_pos"] = 1 + pos["update_stock"] = 1 + pos["posting_time"] = "12:05" + pos["cash_bank_account"] = "_Test Account Bank Account - _TC" + pos["paid_amount"] = 600.0 si = frappe.copy_doc(pos) si.insert() si.submit() - + # check stock ledger entries - sle = frappe.db.sql("""select * from `tabStock Ledger Entry` - where voucher_type = 'Sales Invoice' and voucher_no = %s""", + sle = frappe.db.sql("""select * from `tabStock Ledger Entry` + where voucher_type = 'Sales Invoice' and voucher_no = %s""", si.name, as_dict=1)[0] self.assertTrue(sle) - self.assertEquals([sle.item_code, sle.warehouse, sle.actual_qty], + self.assertEquals([sle.item_code, sle.warehouse, sle.actual_qty], ["_Test Item", "_Test Warehouse - _TC", -1.0]) - + # check gl entries gl_entries = frappe.db.sql("""select account, debit, credit from `tabGL Entry` where voucher_type='Sales Invoice' and voucher_no=%s order by account asc, debit asc""", si.name, as_dict=1) self.assertTrue(gl_entries) - + stock_in_hand = frappe.db.get_value("Account", {"master_name": "_Test Warehouse - _TC"}) - + expected_gl_entries = sorted([ [si.debit_to, 630.0, 0.0], - [pos[1]["income_account"], 0.0, 500.0], - [pos[2]["account_head"], 0.0, 80.0], - [pos[3]["account_head"], 0.0, 50.0], + [pos["entries"][0]["income_account"], 0.0, 500.0], + [pos["other_charges"][0]["account_head"], 0.0, 80.0], + [pos["other_charges"][1]["account_head"], 0.0, 50.0], [stock_in_hand, 0.0, 75.0], - [pos[1]["expense_account"], 75.0, 0.0], + [pos["entries"][0]["expense_account"], 75.0, 0.0], [si.debit_to, 0.0, 600.0], ["_Test Account Bank Account - _TC", 600.0, 0.0] ]) @@ -480,57 +468,57 @@ class TestSalesInvoice(unittest.TestCase): self.assertEquals(expected_gl_entries[i][0], gle.account) self.assertEquals(expected_gl_entries[i][1], gle.debit) self.assertEquals(expected_gl_entries[i][2], gle.credit) - + si.cancel() - gle = frappe.db.sql("""select * from `tabGL Entry` + gle = frappe.db.sql("""select * from `tabGL Entry` where voucher_type='Sales Invoice' and voucher_no=%s""", si.name) - + self.assertFalse(gle) - + self.assertFalse(get_stock_and_account_difference([stock_in_hand])) - + set_perpetual_inventory(0) - + def test_si_gl_entry_with_aii_and_update_stock_with_warehouse_but_no_account(self): self.clear_stock_account_balance() set_perpetual_inventory() frappe.delete_doc("Account", "_Test Warehouse No Account - _TC") - + # insert purchase receipt from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import test_records \ as pr_test_records pr = frappe.copy_doc(pr_test_records[0]) pr.naming_series = "_T-Purchase Receipt-" - pr.get("entries")[0].warehouse = "_Test Warehouse No Account - _TC" + pr.get("purchase_receipt_details")[0].warehouse = "_Test Warehouse No Account - _TC" pr.insert() pr.submit() - - si_doc = frappe.copy_doc(test_records[1]) + + si_doc = copy.deepcopy(test_records[1]) si_doc["update_stock"] = 1 si_doc["posting_time"] = "12:05" - si_doc.get("entries")["warehouse"] = "_Test Warehouse No Account - _TC" + si_doc.get("entries")[0]["warehouse"] = "_Test Warehouse No Account - _TC" si = frappe.copy_doc(si_doc) si.insert() si.submit() - + # check stock ledger entries - sle = frappe.db.sql("""select * from `tabStock Ledger Entry` - where voucher_type = 'Sales Invoice' and voucher_no = %s""", + sle = frappe.db.sql("""select * from `tabStock Ledger Entry` + where voucher_type = 'Sales Invoice' and voucher_no = %s""", si.name, as_dict=1)[0] self.assertTrue(sle) - self.assertEquals([sle.item_code, sle.warehouse, sle.actual_qty], + self.assertEquals([sle.item_code, sle.warehouse, sle.actual_qty], ["_Test Item", "_Test Warehouse No Account - _TC", -1.0]) - + # check gl entries gl_entries = frappe.db.sql("""select account, debit, credit from `tabGL Entry` where voucher_type='Sales Invoice' and voucher_no=%s order by account asc, debit asc""", si.name, as_dict=1) self.assertTrue(gl_entries) - + expected_gl_entries = sorted([ [si.debit_to, 630.0, 0.0], - [si_doc.get("entries")["income_account"], 0.0, 500.0], + [si_doc.get("entries")[0]["income_account"], 0.0, 500.0], [si_doc.get("other_charges")[0]["account_head"], 0.0, 80.0], [si_doc.get("other_charges")[1]["account_head"], 0.0, 50.0], ]) @@ -538,69 +526,67 @@ class TestSalesInvoice(unittest.TestCase): self.assertEquals(expected_gl_entries[i][0], gle.account) self.assertEquals(expected_gl_entries[i][1], gle.debit) self.assertEquals(expected_gl_entries[i][2], gle.credit) - + si.cancel() - gle = frappe.db.sql("""select * from `tabGL Entry` + gle = frappe.db.sql("""select * from `tabGL Entry` where voucher_type='Sales Invoice' and voucher_no=%s""", si.name) - + self.assertFalse(gle) set_perpetual_inventory(0) - + def test_sales_invoice_gl_entry_with_aii_no_item_code(self): self.clear_stock_account_balance() set_perpetual_inventory() - - si_copy = frappe.copy_doc(test_records[1]) - si_copy[1]["item_code"] = None - si = frappe.get_doc(si_copy) + + si = frappe.get_doc(test_records[1]) + si.get("entries")[0].item_code = None si.insert() si.submit() - + gl_entries = frappe.db.sql("""select account, debit, credit from `tabGL Entry` where voucher_type='Sales Invoice' and voucher_no=%s order by account asc""", si.name, as_dict=1) self.assertTrue(gl_entries) - + expected_values = sorted([ [si.debit_to, 630.0, 0.0], - [test_records[1][1]["income_account"], 0.0, 500.0], - [test_records[1][2]["account_head"], 0.0, 80.0], - [test_records[1][3]["account_head"], 0.0, 50.0], + [test_records[1]["entries"][0]["income_account"], 0.0, 500.0], + [test_records[1]["other_charges"][0]["account_head"], 0.0, 80.0], + [test_records[1]["other_charges"][1]["account_head"], 0.0, 50.0], ]) for i, gle in enumerate(gl_entries): self.assertEquals(expected_values[i][0], gle.account) self.assertEquals(expected_values[i][1], gle.debit) self.assertEquals(expected_values[i][2], gle.credit) - + set_perpetual_inventory(0) - + def test_sales_invoice_gl_entry_with_aii_non_stock_item(self): self.clear_stock_account_balance() set_perpetual_inventory() - si_copy = frappe.copy_doc(test_records[1]) - si_copy[1]["item_code"] = "_Test Non Stock Item" - si = frappe.get_doc(si_copy) + si = frappe.get_doc(test_records[1]) + si.get("entries")[0].item_code = "_Test Non Stock Item" si.insert() si.submit() - + gl_entries = frappe.db.sql("""select account, debit, credit from `tabGL Entry` where voucher_type='Sales Invoice' and voucher_no=%s order by account asc""", si.name, as_dict=1) self.assertTrue(gl_entries) - + expected_values = sorted([ [si.debit_to, 630.0, 0.0], - [test_records[1][1]["income_account"], 0.0, 500.0], - [test_records[1][2]["account_head"], 0.0, 80.0], - [test_records[1][3]["account_head"], 0.0, 50.0], + [test_records[1]["entries"][0]["income_account"], 0.0, 500.0], + [test_records[1]["other_charges"][0]["account_head"], 0.0, 80.0], + [test_records[1]["other_charges"][1]["account_head"], 0.0, 50.0], ]) for i, gle in enumerate(gl_entries): self.assertEquals(expected_values[i][0], gle.account) self.assertEquals(expected_values[i][1], gle.debit) self.assertEquals(expected_values[i][2], gle.credit) - + set_perpetual_inventory(0) - + def _insert_purchase_receipt(self): from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import test_records \ as pr_test_records @@ -608,7 +594,7 @@ class TestSalesInvoice(unittest.TestCase): pr.naming_series = "_T-Purchase Receipt-" pr.insert() pr.submit() - + def _insert_delivery_note(self): from erpnext.stock.doctype.delivery_note.test_delivery_note import test_records \ as dn_test_records @@ -617,23 +603,23 @@ class TestSalesInvoice(unittest.TestCase): dn.insert() dn.submit() return dn - + def _insert_pos_settings(self): from erpnext.accounts.doctype.pos_setting.test_pos_setting \ import test_records as pos_setting_test_records frappe.db.sql("""delete from `tabPOS Setting`""") - + ps = frappe.copy_doc(pos_setting_test_records[0]) ps.insert() - + def test_sales_invoice_with_advance(self): from erpnext.accounts.doctype.journal_voucher.test_journal_voucher \ import test_records as jv_test_records - + jv = frappe.copy_doc(jv_test_records[0]) jv.insert() jv.submit() - + si = frappe.copy_doc(test_records[0]) si.append("advance_adjustment_details", { "doctype": "Sales Invoice Advance", @@ -646,20 +632,20 @@ class TestSalesInvoice(unittest.TestCase): si.insert() si.submit() si.load_from_db() - + self.assertTrue(frappe.db.sql("""select name from `tabJournal Voucher Detail` where against_invoice=%s""", si.name)) - + self.assertTrue(frappe.db.sql("""select name from `tabJournal Voucher Detail` where against_invoice=%s and credit=300""", si.name)) - + self.assertEqual(si.outstanding_amount, 261.8) - + si.cancel() - + self.assertTrue(not frappe.db.sql("""select name from `tabJournal Voucher Detail` where against_invoice=%s""", si.name)) - + def test_recurring_invoice(self): from frappe.utils import get_first_day, get_last_day, add_to_date, nowdate, getdate from erpnext.accounts.utils import get_fiscal_year @@ -675,13 +661,13 @@ class TestSalesInvoice(unittest.TestCase): "invoice_period_from_date": get_first_day(today), "invoice_period_to_date": get_last_day(today) }) - + # monthly si1 = frappe.copy_doc(base_si) si1.insert() si1.submit() self._test_recurring_invoice(si1, True) - + # monthly without a first and last day period si2 = frappe.copy_doc(base_si) si2.update({ @@ -691,7 +677,7 @@ class TestSalesInvoice(unittest.TestCase): si2.insert() si2.submit() self._test_recurring_invoice(si2, False) - + # quarterly si3 = frappe.copy_doc(base_si) si3.update({ @@ -702,7 +688,7 @@ class TestSalesInvoice(unittest.TestCase): si3.insert() si3.submit() self._test_recurring_invoice(si3, True) - + # quarterly without a first and last day period si4 = frappe.copy_doc(base_si) si4.update({ @@ -713,7 +699,7 @@ class TestSalesInvoice(unittest.TestCase): si4.insert() si4.submit() self._test_recurring_invoice(si4, False) - + # yearly si5 = frappe.copy_doc(base_si) si5.update({ @@ -724,7 +710,7 @@ class TestSalesInvoice(unittest.TestCase): si5.insert() si5.submit() self._test_recurring_invoice(si5, True) - + # yearly without a first and last day period si6 = frappe.copy_doc(base_si) si6.update({ @@ -735,7 +721,7 @@ class TestSalesInvoice(unittest.TestCase): si6.insert() si6.submit() self._test_recurring_invoice(si6, False) - + # change posting date but keep recuring day to be today si7 = frappe.copy_doc(base_si) si7.update({ @@ -743,7 +729,7 @@ class TestSalesInvoice(unittest.TestCase): }) si7.insert() si7.submit() - + # setting so that _test function works si7.posting_date = today self._test_recurring_invoice(si7, True) @@ -752,52 +738,52 @@ class TestSalesInvoice(unittest.TestCase): from frappe.utils import add_months, get_last_day from erpnext.accounts.doctype.sales_invoice.sales_invoice \ import manage_recurring_invoices, get_next_date - + no_of_months = ({"Monthly": 1, "Quarterly": 3, "Yearly": 12})[base_si.recurring_type] - + def _test(i): self.assertEquals(i+1, frappe.db.sql("""select count(*) from `tabSales Invoice` where recurring_id=%s and docstatus=1""", base_si.recurring_id)[0][0]) - - next_date = get_next_date(base_si.posting_date, no_of_months, + + next_date = get_next_date(base_si.posting_date, no_of_months, base_si.repeat_on_day_of_month) manage_recurring_invoices(next_date=next_date, commit=False) - + recurred_invoices = frappe.db.sql("""select name from `tabSales Invoice` where recurring_id=%s and docstatus=1 order by name desc""", base_si.recurring_id) - + self.assertEquals(i+2, len(recurred_invoices)) - + new_si = frappe.get_doc("Sales Invoice", recurred_invoices[0][0]) - + for fieldname in ["convert_into_recurring_invoice", "recurring_type", "repeat_on_day_of_month", "notification_email_address"]: self.assertEquals(base_si.get(fieldname), new_si.get(fieldname)) self.assertEquals(new_si.posting_date, unicode(next_date)) - + self.assertEquals(new_si.invoice_period_from_date, unicode(add_months(base_si.invoice_period_from_date, no_of_months))) - + if first_and_last_day: - self.assertEquals(new_si.invoice_period_to_date, + self.assertEquals(new_si.invoice_period_to_date, unicode(get_last_day(add_months(base_si.invoice_period_to_date, no_of_months)))) else: - self.assertEquals(new_si.invoice_period_to_date, + self.assertEquals(new_si.invoice_period_to_date, unicode(add_months(base_si.invoice_period_to_date, no_of_months))) - - + + return new_si - + # if yearly, test 1 repetition, else test 5 repetitions count = 1 if (no_of_months == 12) else 5 for i in xrange(count): base_si = _test(i) - + def clear_stock_account_balance(self): frappe.db.sql("delete from `tabStock Ledger Entry`") frappe.db.sql("delete from tabBin") @@ -806,10 +792,10 @@ class TestSalesInvoice(unittest.TestCase): def test_serialized(self): from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos - + se = make_serialized_item() - serial_nos = get_serial_nos(se.get("entries")[0].serial_no) - + serial_nos = get_serial_nos(se.get("mtn_details")[0].serial_no) + si = frappe.copy_doc(test_records[0]) si.update_stock = 1 si.get("entries")[0].item_code = "_Test Serialized Item With Series" @@ -817,14 +803,14 @@ class TestSalesInvoice(unittest.TestCase): si.get("entries")[0].serial_no = serial_nos[0] si.insert() si.submit() - + self.assertEquals(frappe.db.get_value("Serial No", serial_nos[0], "status"), "Delivered") self.assertFalse(frappe.db.get_value("Serial No", serial_nos[0], "warehouse")) - self.assertEquals(frappe.db.get_value("Serial No", serial_nos[0], + self.assertEquals(frappe.db.get_value("Serial No", serial_nos[0], "delivery_document_no"), si.name) - + return si - + def test_serialized_cancel(self): from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos si = self.test_serialized() @@ -834,20 +820,20 @@ class TestSalesInvoice(unittest.TestCase): self.assertEquals(frappe.db.get_value("Serial No", serial_nos[0], "status"), "Available") self.assertEquals(frappe.db.get_value("Serial No", serial_nos[0], "warehouse"), "_Test Warehouse - _TC") - self.assertFalse(frappe.db.get_value("Serial No", serial_nos[0], + self.assertFalse(frappe.db.get_value("Serial No", serial_nos[0], "delivery_document_no")) def test_serialize_status(self): from erpnext.stock.doctype.serial_no.serial_no import SerialNoStatusError, get_serial_nos from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item - + se = make_serialized_item() - serial_nos = get_serial_nos(se.get("entries")[0].serial_no) - + serial_nos = get_serial_nos(se.get("mtn_details")[0].serial_no) + sr = frappe.get_doc("Serial No", serial_nos[0]) sr.status = "Not Available" sr.save() - + si = frappe.copy_doc(test_records[0]) si.update_stock = 1 si.get("entries")[0].item_code = "_Test Serialized Item With Series" @@ -858,5 +844,4 @@ class TestSalesInvoice(unittest.TestCase): self.assertRaises(SerialNoStatusError, si.submit) test_dependencies = ["Journal Voucher", "POS Setting", "Contact", "Address"] - -test_records = frappe.get_test_records('Sales Invoice') \ No newline at end of file +test_records = frappe.get_test_records('Sales Invoice') diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index 25bdfa97a5..720a1d5c17 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -8,7 +8,7 @@ from frappe.utils import cstr, flt from frappe import msgprint - + from erpnext.controllers.buying_controller import BuyingController class PurchaseOrder(BuyingController): tname = 'Purchase Order Item' @@ -24,15 +24,15 @@ class PurchaseOrder(BuyingController): 'source_field': 'qty', 'percent_join_field': 'prevdoc_docname', }] - + def validate(self): super(PurchaseOrder, self).validate() - + if not self.status: self.status = "Draft" from erpnext.utilities import validate_status - validate_status(self.status, ["Draft", "Submitted", "Stopped", + validate_status(self.status, ["Draft", "Submitted", "Stopped", "Cancelled"]) pc_obj = frappe.get_doc('Purchase Common') @@ -45,7 +45,7 @@ class PurchaseOrder(BuyingController): self.validate_with_previous_doc() self.validate_for_subcontracting() self.update_raw_materials_supplied("po_raw_material_details") - + def validate_with_previous_doc(self): super(PurchaseOrder, self).validate_with_previous_doc(self.tname, { "Supplier Quotation": { @@ -54,7 +54,7 @@ class PurchaseOrder(BuyingController): }, "Supplier Quotation Item": { "ref_dn_field": "supplier_quotation_item", - "compare_fields": [["rate", "="], ["project_name", "="], ["item_code", "="], + "compare_fields": [["rate", "="], ["project_name", "="], ["item_code", "="], ["uom", "="]], "is_child_table": True } @@ -65,11 +65,11 @@ class PurchaseOrder(BuyingController): if d.prevdoc_detail_docname and not d.schedule_date: d.schedule_date = frappe.db.get_value("Material Request Item", d.prevdoc_detail_docname, "schedule_date") - + def get_last_purchase_rate(self): frappe.get_doc('Purchase Common').get_last_purchase_rate(self) - # Check for Stopped status + # Check for Stopped status def check_for_stopped_status(self, pc_obj): check_list =[] for d in self.get('po_details'): @@ -77,7 +77,7 @@ class PurchaseOrder(BuyingController): check_list.append(d.prevdoc_docname) pc_obj.check_for_stopped_status( d.prevdoc_doctype, d.prevdoc_docname) - + def update_bin(self, is_submit, is_stopped = 0): from erpnext.stock.utils import update_bin pc_obj = frappe.get_doc('Purchase Common') @@ -87,29 +87,29 @@ class PurchaseOrder(BuyingController): # this happens when item is changed from non-stock to stock item if not d.warehouse: continue - + ind_qty, po_qty = 0, flt(d.qty) * flt(d.conversion_factor) if is_stopped: po_qty = flt(d.qty) > flt(d.received_qty) and \ - flt( flt(flt(d.qty) - flt(d.received_qty))*flt(d.conversion_factor)) or 0 - + flt( flt(flt(d.qty) - flt(d.received_qty))*flt(d.conversion_factor)) or 0 + # No updates in Material Request on Stop / Unstop if cstr(d.prevdoc_doctype) == 'Material Request' and not is_stopped: - # get qty and pending_qty of prevdoc + # get qty and pending_qty of prevdoc curr_ref_qty = pc_obj.get_qty(d.doctype, 'prevdoc_detail_docname', - d.prevdoc_detail_docname, 'Material Request Item', + d.prevdoc_detail_docname, 'Material Request Item', 'Material Request - Purchase Order', self.name) max_qty, qty, curr_qty = flt(curr_ref_qty.split('~~~')[1]), \ flt(curr_ref_qty.split('~~~')[0]), 0 - + if flt(qty) + flt(po_qty) > flt(max_qty): curr_qty = flt(max_qty) - flt(qty) - # special case as there is no restriction - # for Material Request - Purchase Order + # special case as there is no restriction + # for Material Request - Purchase Order curr_qty = curr_qty > 0 and curr_qty or 0 else: curr_qty = flt(po_qty) - + ind_qty = -flt(curr_qty) # Update ordered_qty and indented_qty in bin @@ -121,12 +121,12 @@ class PurchaseOrder(BuyingController): "posting_date": self.transaction_date } update_bin(args) - + def check_modified_date(self): - mod_db = frappe.db.sql("select modified from `tabPurchase Order` where name = %s", + mod_db = frappe.db.sql("select modified from `tabPurchase Order` where name = %s", self.name) date_diff = frappe.db.sql("select TIMEDIFF('%s', '%s')" % ( mod_db[0][0],cstr(self.modified))) - + if date_diff and date_diff[0][0]: msgprint(cstr(self.doctype) +" => "+ cstr(self.name) +" has been modified. Please Refresh. ") raise Exception @@ -144,28 +144,28 @@ class PurchaseOrder(BuyingController): def on_submit(self): purchase_controller = frappe.get_doc("Purchase Common") - + self.update_prevdoc_status() self.update_bin(is_submit = 1, is_stopped = 0) - - frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype, + + frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype, self.company, self.grand_total) - + purchase_controller.update_last_purchase_rate(self, is_submit = 1) - + frappe.db.set(self,'status','Submitted') - + def on_cancel(self): - pc_obj = frappe.get_doc(dt = 'Purchase Common') + pc_obj = frappe.get_doc(dt = 'Purchase Common') self.check_for_stopped_status(pc_obj) - + # Check if Purchase Receipt has been submitted against current Purchase Order pc_obj.check_docstatus(check = 'Next', doctype = 'Purchase Receipt', docname = self.name, detail_doctype = 'Purchase Receipt Item') # Check if Purchase Invoice has been submitted against current Purchase Order - submitted = frappe.db.sql("""select t1.name - from `tabPurchase Invoice` t1,`tabPurchase Invoice Item` t2 - where t1.name = t2.parent and t2.purchase_order = %s and t1.docstatus = 1""", + submitted = frappe.db.sql("""select t1.name + from `tabPurchase Invoice` t1,`tabPurchase Invoice Item` t2 + where t1.name = t2.parent and t2.purchase_order = %s and t1.docstatus = 1""", self.name) if submitted: msgprint("Purchase Invoice : " + cstr(submitted[0][0]) + " has already been submitted !") @@ -175,14 +175,14 @@ class PurchaseOrder(BuyingController): self.update_prevdoc_status() self.update_bin( is_submit = 0, is_stopped = 0) pc_obj.update_last_purchase_rate(self, is_submit = 0) - + def on_update(self): pass - + @frappe.whitelist() def make_purchase_receipt(source_name, target_doc=None): from frappe.model.mapper import get_mapped_doc - + def set_missing_values(source, target): doc = frappe.get_doc(target) doc.run_method("set_missing_values") @@ -193,35 +193,35 @@ def make_purchase_receipt(source_name, target_doc=None): target.amount = (flt(obj.qty) - flt(obj.received_qty)) * flt(obj.rate) target.base_amount = (flt(obj.qty) - flt(obj.received_qty)) * flt(obj.base_rate) - doclist = get_mapped_doc("Purchase Order", source_name, { + doc = get_mapped_doc("Purchase Order", source_name, { "Purchase Order": { - "doctype": "Purchase Receipt", + "doctype": "Purchase Receipt", "validation": { "docstatus": ["=", 1], } - }, + }, "Purchase Order Item": { - "doctype": "Purchase Receipt Item", + "doctype": "Purchase Receipt Item", "field_map": { - "name": "prevdoc_detail_docname", - "parent": "prevdoc_docname", - "parenttype": "prevdoc_doctype", + "name": "prevdoc_detail_docname", + "parent": "prevdoc_docname", + "parenttype": "prevdoc_doctype", }, "postprocess": update_item, "condition": lambda doc: doc.received_qty < doc.qty - }, + }, "Purchase Taxes and Charges": { - "doctype": "Purchase Taxes and Charges", + "doctype": "Purchase Taxes and Charges", "add_if_empty": True } }, target_doc, set_missing_values) - return doclist.as_dict() - + return doc + @frappe.whitelist() def make_purchase_invoice(source_name, target_doc=None): from frappe.model.mapper import get_mapped_doc - + def set_missing_values(source, target): doc = frappe.get_doc(target) doc.run_method("set_missing_values") @@ -232,26 +232,26 @@ def make_purchase_invoice(source_name, target_doc=None): if flt(obj.base_rate): target.qty = target.base_amount / flt(obj.base_rate) - doclist = get_mapped_doc("Purchase Order", source_name, { + doc = get_mapped_doc("Purchase Order", source_name, { "Purchase Order": { - "doctype": "Purchase Invoice", + "doctype": "Purchase Invoice", "validation": { "docstatus": ["=", 1], } - }, + }, "Purchase Order Item": { - "doctype": "Purchase Invoice Item", + "doctype": "Purchase Invoice Item", "field_map": { - "name": "po_detail", - "parent": "purchase_order", + "name": "po_detail", + "parent": "purchase_order", }, "postprocess": update_item, - "condition": lambda doc: doc.base_amount==0 or doc.billed_amt < doc.amount - }, + "condition": lambda doc: doc.base_amount==0 or doc.billed_amt < doc.amount + }, "Purchase Taxes and Charges": { - "doctype": "Purchase Taxes and Charges", + "doctype": "Purchase Taxes and Charges", "add_if_empty": True } }, target_doc, set_missing_values) - return doclist.as_dict() \ No newline at end of file + return doc diff --git a/erpnext/buying/doctype/purchase_order/test_purchase_order.py b/erpnext/buying/doctype/purchase_order/test_purchase_order.py index f8b03f040b..d1d183a7a1 100644 --- a/erpnext/buying/doctype/purchase_order/test_purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/test_purchase_order.py @@ -8,90 +8,87 @@ import frappe.defaults from frappe.utils import flt class TestPurchaseOrder(unittest.TestCase): - def test_make_purchase_receipt(self): + def test_make_purchase_receipt(self): from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_receipt po = frappe.copy_doc(test_records[0]).insert() - self.assertRaises(frappe.ValidationError, make_purchase_receipt, + self.assertRaises(frappe.ValidationError, make_purchase_receipt, po.name) po = frappe.get_doc("Purchase Order", po.name) po.submit() - + pr = make_purchase_receipt(po.name) - pr[0]["supplier_warehouse"] = "_Test Warehouse 1 - _TC" - pr[0]["posting_date"] = "2013-05-12" - self.assertEquals(pr[0]["doctype"], "Purchase Receipt") - self.assertEquals(len(pr), len(test_records[0])) - - pr[0]["naming_series"] = "_T-Purchase Receipt-" - pr_doc = frappe.get_doc(pr) - pr_doc.insert() - + pr.supplier_warehouse = "_Test Warehouse 1 - _TC" + pr.posting_date = "2013-05-12" + self.assertEquals(pr.doctype, "Purchase Receipt") + self.assertEquals(len(pr.get("purchase_receipt_details")), len(test_records[0]["po_details"])) + + pr.naming_series = "_T-Purchase Receipt-" + frappe.get_doc(pr).insert() + def test_ordered_qty(self): frappe.db.sql("delete from tabBin") - + from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_receipt po = frappe.copy_doc(test_records[0]).insert() - self.assertRaises(frappe.ValidationError, make_purchase_receipt, + self.assertRaises(frappe.ValidationError, make_purchase_receipt, po.name) po = frappe.get_doc("Purchase Order", po.name) po.is_subcontracted = "No" po.get("po_details")[0].item_code = "_Test Item" po.submit() - - self.assertEquals(frappe.db.get_value("Bin", {"item_code": "_Test Item", + + self.assertEquals(frappe.db.get_value("Bin", {"item_code": "_Test Item", "warehouse": "_Test Warehouse - _TC"}, "ordered_qty"), 10) - + pr = make_purchase_receipt(po.name) - - self.assertEquals(pr[0]["doctype"], "Purchase Receipt") - self.assertEquals(len(pr), len(test_records[0])) - pr[0]["posting_date"] = "2013-05-12" - pr[0]["naming_series"] = "_T-Purchase Receipt-" - pr[1]["qty"] = 4.0 - pr_doc = frappe.get_doc(pr) - pr_doc.insert() - pr_doc.submit() - - self.assertEquals(flt(frappe.db.get_value("Bin", {"item_code": "_Test Item", + + self.assertEquals(pr.doctype, "Purchase Receipt") + self.assertEquals(len(pr.get("purchase_receipt_details", [])), len(test_records[0]["po_details"])) + pr.posting_date = "2013-05-12" + pr.naming_series = "_T-Purchase Receipt-" + pr.purchase_receipt_details[0].qty = 4.0 + pr.insert() + pr.submit() + + self.assertEquals(flt(frappe.db.get_value("Bin", {"item_code": "_Test Item", "warehouse": "_Test Warehouse - _TC"}, "ordered_qty")), 6.0) - + frappe.db.set_value('Item', '_Test Item', 'tolerance', 50) - + pr1 = make_purchase_receipt(po.name) - pr1[0]["naming_series"] = "_T-Purchase Receipt-" - pr1[0]["posting_date"] = "2013-05-12" - pr1[1]["qty"] = 8 - pr1_doc = frappe.get_doc(pr1) - pr1_doc.insert() - pr1_doc.submit() - - self.assertEquals(flt(frappe.db.get_value("Bin", {"item_code": "_Test Item", + pr1.naming_series = "_T-Purchase Receipt-" + pr1.posting_date = "2013-05-12" + pr1.get("purchase_receipt_details")[0].qty = 8 + pr1.insert() + pr1.submit() + + self.assertEquals(flt(frappe.db.get_value("Bin", {"item_code": "_Test Item", "warehouse": "_Test Warehouse - _TC"}, "ordered_qty")), 0.0) - + def test_make_purchase_invoice(self): from erpnext.buying.doctype.purchase_order.purchase_order import make_purchase_invoice po = frappe.copy_doc(test_records[0]).insert() - self.assertRaises(frappe.ValidationError, make_purchase_invoice, + self.assertRaises(frappe.ValidationError, make_purchase_invoice, po.name) po = frappe.get_doc("Purchase Order", po.name) po.submit() pi = make_purchase_invoice(po.name) - - self.assertEquals(pi[0]["doctype"], "Purchase Invoice") - self.assertEquals(len(pi), len(test_records[0])) - pi[0]["posting_date"] = "2013-05-12" - pi[0]["bill_no"] = "NA" + + self.assertEquals(pi.doctype, "Purchase Invoice") + self.assertEquals(len(pi.get("entries", [])), len(test_records[0]["po_details"])) + pi.posting_date = "2013-05-12" + pi.bill_no = "NA" frappe.get_doc(pi).insert() - + def test_subcontracting(self): po = frappe.copy_doc(test_records[0]) po.insert() @@ -113,4 +110,4 @@ class TestPurchaseOrder(unittest.TestCase): test_dependencies = ["BOM"] -test_records = frappe.get_test_records('Purchase Order') \ No newline at end of file +test_records = frappe.get_test_records('Purchase Order') diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py index e937735111..fa48488766 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py @@ -88,4 +88,4 @@ def make_purchase_order(source_name, target_doc=None): }, }, target_doc, set_missing_values) - return doclist.as_dict() \ No newline at end of file + return doclist \ No newline at end of file diff --git a/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py b/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py index 708b5e7f7a..3f22fd50a4 100644 --- a/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py +++ b/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py @@ -13,22 +13,22 @@ class TestPurchaseOrder(unittest.TestCase): sq = frappe.copy_doc(test_records[0]).insert() - self.assertRaises(frappe.ValidationError, make_purchase_order, + self.assertRaises(frappe.ValidationError, make_purchase_order, sq.name) sq = frappe.get_doc("Supplier Quotation", sq.name) sq.submit() po = make_purchase_order(sq.name) - - self.assertEquals(po[0]["doctype"], "Purchase Order") - self.assertEquals(len(po), len(sq)) - - po[0]["naming_series"] = "_T-Purchase Order-" - for doc in po: + self.assertEquals(po.doctype, "Purchase Order") + self.assertEquals(len(po.get("po_details")), len(sq.get("quotation_items"))) + + po.naming_series = "_T-Purchase Order-" + + for doc in po.get("po_details"): if doc.get("item_code"): - doc["schedule_date"] = "2013-04-12" + doc.set("schedule_date", "2013-04-12") - frappe.get_doc(po).insert() - -test_records = frappe.get_test_records('Supplier Quotation') \ No newline at end of file + po.insert() + +test_records = frappe.get_test_records('Supplier Quotation') diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index ffe6a6a43b..ec6fe1fa41 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -18,16 +18,16 @@ class AccountsController(TransactionBase): self.calculate_taxes_and_totals() self.validate_value("grand_total", ">=", 0) self.set_total_in_words() - + self.validate_for_freezed_account() - + def set_missing_values(self, for_validate=False): for fieldname in ["posting_date", "transaction_date"]: if not self.get(fieldname) and self.meta.get_field(fieldname): self.set(fieldname, today()) if not self.fiscal_year: self.fiscal_year = get_fiscal_year(self.get(fieldname))[0] - + def validate_date_with_fiscal_year(self): if self.meta.get_field("fiscal_year") : date_field = "" @@ -35,40 +35,40 @@ class AccountsController(TransactionBase): date_field = "posting_date" elif self.meta.get_field("transaction_date"): date_field = "transaction_date" - + if date_field and self.get(date_field): - validate_fiscal_year(self.get(date_field), self.fiscal_year, + validate_fiscal_year(self.get(date_field), self.fiscal_year, label=self.meta.get_label(date_field)) - + def validate_for_freezed_account(self): for fieldname in ["customer", "supplier"]: if self.meta.get_field(fieldname) and self.get(fieldname): - accounts = frappe.db.get_values("Account", - {"master_type": fieldname.title(), "master_name": self.get(fieldname), + accounts = frappe.db.get_values("Account", + {"master_type": fieldname.title(), "master_name": self.get(fieldname), "company": self.company}, "name") if accounts: from erpnext.accounts.doctype.gl_entry.gl_entry import validate_frozen_account - for account in accounts: + for account in accounts: validate_frozen_account(account[0]) - + def set_price_list_currency(self, buying_or_selling): if self.meta.get_field("currency"): company_currency = get_company_currency(self.company) - + # price list part fieldname = "selling_price_list" if buying_or_selling.lower() == "selling" \ else "buying_price_list" if self.meta.get_field(fieldname) and self.get(fieldname): self.price_list_currency = frappe.db.get_value("Price List", self.get(fieldname), "currency") - + if self.price_list_currency == company_currency: self.plc_conversion_rate = 1.0 elif not self.plc_conversion_rate: self.plc_conversion_rate = self.get_exchange_rate( self.price_list_currency, company_currency) - + # currency if not self.currency: self.currency = self.price_list_currency @@ -96,44 +96,44 @@ class AccountsController(TransactionBase): if item.meta.get_field(fieldname) and \ item.get(fieldname) is None and value is not None: item.set(fieldname, value) - + def set_taxes(self, tax_parentfield, tax_master_field): if not self.meta.get_field(tax_parentfield): return - + tax_master_doctype = self.meta.get_field(tax_master_field).options - + if not self.get(tax_parentfield): if not self.get(tax_master_field): # get the default tax master self.set(tax_master_field, frappe.db.get_value(tax_master_doctype, {"is_default": 1})) - + self.append_taxes_from_master(tax_parentfield, tax_master_field, tax_master_doctype) - + def append_taxes_from_master(self, tax_parentfield, tax_master_field, tax_master_doctype=None): if self.get(tax_master_field): if not tax_master_doctype: tax_master_doctype = self.meta.get_field(tax_master_field).options - + tax_doctype = self.meta.get_field(tax_parentfield).options - + from frappe.model import default_fields tax_master = frappe.get_doc(tax_master_doctype, self.get(tax_master_field)) - + for i, tax in enumerate(tax_master.get(tax_parentfield)): for fieldname in default_fields: tax.set(fieldname, None) - + self.append(tax_parentfield, tax) def get_other_charges(self): self.set("other_charges", []) self.set_taxes("other_charges", "taxes_and_charges") - + def calculate_taxes_and_totals(self): self.discount_amount_applied = False self._calculate_taxes_and_totals() - + if self.meta.get_field("discount_amount"): self.apply_discount_amount() @@ -151,23 +151,23 @@ class AccountsController(TransactionBase): self.conversion_rate = flt(self.conversion_rate) self.item_doclist = self.get(self.fname) self.tax_doclist = self.get(self.other_fname) - + self.calculate_item_values() self.initialize_taxes() - + if hasattr(self, "determine_exclusive_rate"): self.determine_exclusive_rate() - + self.calculate_net_total() self.calculate_taxes() self.calculate_totals() self._cleanup() - + def initialize_taxes(self): for tax in self.tax_doclist: tax.item_wise_tax_detail = {} - tax_fields = ["total", "tax_amount_after_discount_amount", - "tax_amount_for_current_item", "grand_total_for_current_item", + tax_fields = ["total", "tax_amount_after_discount_amount", + "tax_amount_for_current_item", "grand_total_for_current_item", "tax_fraction_for_current_item", "grand_total_fraction_for_current_item"] if not self.discount_amount_applied: @@ -179,7 +179,7 @@ class AccountsController(TransactionBase): self.validate_on_previous_row(tax) self.validate_inclusive_tax(tax) self.round_floats_in(tax) - + def validate_on_previous_row(self, tax): """ validate if a valid row id is mentioned in case of @@ -194,7 +194,7 @@ class AccountsController(TransactionBase): "row_id_label": self.meta.get_label("row_id", parentfield=self.other_fname) }) - + def validate_inclusive_tax(self, tax): def _on_previous_row_error(row_range): throw((_("Row") + " # %(idx)s [%(doctype)s]: " + @@ -202,24 +202,21 @@ class AccountsController(TransactionBase): " [" + _("Row") + " # %(row_range)s] " + _("also be included in Item's rate")) % { "idx": tax.idx, "doctype": tax.doctype, - "inclusive_label": self.meta.get_label("included_in_print_rate", - parentfield=self.other_fname), - "charge_type_label": self.meta.get_label("charge_type", - parentfield=self.other_fname), + "inclusive_label": frappe.get_meta(tax.doctype).get_label("included_in_print_rate"), + "charge_type_label": frappe.get_meta(tax.doctype).get_label("charge_type"), "charge_type": tax.charge_type, "row_range": row_range }) - + if cint(getattr(tax, "included_in_print_rate", None)): if tax.charge_type == "Actual": # inclusive tax cannot be of type Actual - throw((_("Row") - + " # %(idx)s [%(doctype)s]: %(charge_type_label)s = \"%(charge_type)s\" " + throw((_("Row") + + " # %(idx)s [%(doctype)s]: %(charge_type_label)s = \"%(charge_type)s\" " + "cannot be included in Item's rate") % { "idx": tax.idx, "doctype": tax.doctype, - "charge_type_label": self.meta.get_label("charge_type", - parentfield=self.other_fname), + "charge_type_label": frappe.get_meta(tax.doctype).get_label("charge_type"), "charge_type": tax.charge_type, }) elif tax.charge_type == "On Previous Row Amount" and \ @@ -230,10 +227,10 @@ class AccountsController(TransactionBase): not all([cint(t.included_in_print_rate) for t in self.tax_doclist[:cint(tax.row_id) - 1]]): # all rows about the reffered tax should be inclusive _on_previous_row_error("1 - %d" % (tax.row_id,)) - + def calculate_taxes(self): # maintain actual tax rate based on idx - actual_tax_dict = dict([[tax.idx, tax.rate] for tax in self.tax_doclist + actual_tax_dict = dict([[tax.idx, tax.rate] for tax in self.tax_doclist if tax.charge_type == "Actual"]) for n, item in enumerate(self.item_doclist): @@ -258,26 +255,26 @@ class AccountsController(TransactionBase): tax.tax_amount += current_tax_amount tax.tax_amount_after_discount_amount += current_tax_amount - + if getattr(tax, "category", None): # if just for valuation, do not add the tax amount in total # hence, setting it as 0 for further steps current_tax_amount = 0.0 if (tax.category == "Valuation") \ else current_tax_amount - + current_tax_amount *= -1.0 if (tax.add_deduct_tax == "Deduct") else 1.0 - + # Calculate tax.total viz. grand total till that step - # note: grand_total_for_current_item contains the contribution of + # note: grand_total_for_current_item contains the contribution of # item's amount, previously applied tax and the current tax on that item if i==0: tax.grand_total_for_current_item = flt(item.base_amount + current_tax_amount, self.precision("total", tax)) else: tax.grand_total_for_current_item = \ - flt(self.tax_doclist[i-1].grand_total_for_current_item + + flt(self.tax_doclist[i-1].grand_total_for_current_item + current_tax_amount, self.precision("total", tax)) - + # in tax.total, accumulate grand total of each item tax.total += tax.grand_total_for_current_item @@ -292,12 +289,12 @@ class AccountsController(TransactionBase): def round_off_totals(self, tax): tax.total = flt(tax.total, self.precision("total", tax)) tax.tax_amount = flt(tax.tax_amount, self.precision("tax_amount", tax)) - tax.tax_amount_after_discount_amount = flt(tax.tax_amount_after_discount_amount, + tax.tax_amount_after_discount_amount = flt(tax.tax_amount_after_discount_amount, self.precision("tax_amount", tax)) def adjust_discount_amount_loss(self, tax): discount_amount_loss = self.grand_total - flt(self.discount_amount) - tax.total - tax.tax_amount_after_discount_amount = flt(tax.tax_amount_after_discount_amount + + tax.tax_amount_after_discount_amount = flt(tax.tax_amount_after_discount_amount + discount_amount_loss, self.precision("tax_amount", tax)) tax.total = flt(tax.total + discount_amount_loss, self.precision("total", tax)) @@ -331,40 +328,40 @@ class AccountsController(TransactionBase): tax.item_wise_tax_detail[key] = [tax_rate, current_tax_amount] return current_tax_amount - + def _load_item_tax_rate(self, item_tax_rate): return json.loads(item_tax_rate) if item_tax_rate else {} - + def _get_tax_rate(self, tax, item_tax_map): if item_tax_map.has_key(tax.account_head): return flt(item_tax_map.get(tax.account_head), self.precision("rate", tax)) else: return tax.rate - + def _cleanup(self): for tax in self.tax_doclist: tax.item_wise_tax_detail = json.dumps(tax.item_wise_tax_detail) - + def _set_in_company_currency(self, item, print_field, base_field): """set values in base currency""" - value_in_company_currency = flt(self.conversion_rate * + value_in_company_currency = flt(self.conversion_rate * flt(item.get(print_field), self.precision(print_field, item)), self.precision(base_field, item)) item.set(base_field, value_in_company_currency) - + def calculate_total_advance(self, parenttype, advance_parentfield): if self.doctype == parenttype and self.docstatus < 2: - sum_of_allocated_amount = sum([flt(adv.allocated_amount, self.precision("allocated_amount", adv)) + sum_of_allocated_amount = sum([flt(adv.allocated_amount, self.precision("allocated_amount", adv)) for adv in self.get(advance_parentfield)]) self.total_advance = flt(sum_of_allocated_amount, self.precision("total_advance")) - + self.calculate_outstanding_amount() def get_gl_dict(self, args): """this method populates the common properties of a gl entry record""" gl_dict = frappe._dict({ - 'company': self.company, + 'company': self.company, 'posting_date': self.posting_date, 'voucher_type': self.doctype, 'voucher_no': self.name, @@ -377,24 +374,24 @@ class AccountsController(TransactionBase): }) gl_dict.update(args) return gl_dict - + def clear_unallocated_advances(self, childtype, parentfield): self.set(parentfield, self.get(parentfield, {"allocated_amount": ["not in", [0, None, ""]]})) - frappe.db.sql("""delete from `tab%s` where parentfield=%s and parent = %s + frappe.db.sql("""delete from `tab%s` where parentfield=%s and parent = %s and ifnull(allocated_amount, 0) = 0""" % (childtype, '%s', '%s'), (parentfield, self.name)) - + def get_advances(self, account_head, child_doctype, parentfield, dr_or_cr): - res = frappe.db.sql("""select t1.name as jv_no, t1.remark, + res = frappe.db.sql("""select t1.name as jv_no, t1.remark, t2.%s as amount, t2.name as jv_detail_no - from `tabJournal Voucher` t1, `tabJournal Voucher Detail` t2 - where t1.name = t2.parent and t2.account = %s and t2.is_advance = 'Yes' + from `tabJournal Voucher` t1, `tabJournal Voucher Detail` t2 + where t1.name = t2.parent and t2.account = %s and t2.is_advance = 'Yes' and (t2.against_voucher is null or t2.against_voucher = '') - and (t2.against_invoice is null or t2.against_invoice = '') - and (t2.against_jv is null or t2.against_jv = '') - and t1.docstatus = 1 order by t1.posting_date""" % + and (t2.against_invoice is null or t2.against_invoice = '') + and (t2.against_jv is null or t2.against_jv = '') + and t1.docstatus = 1 order by t1.posting_date""" % (dr_or_cr, '%s'), account_head, as_dict=1) - + self.set(parentfield, []) for d in res: self.append(parentfield, { @@ -405,74 +402,74 @@ class AccountsController(TransactionBase): "advance_amount": flt(d.amount), "allocate_amount": 0 }) - + def validate_multiple_billing(self, ref_dt, item_ref_dn, based_on, parentfield): from erpnext.controllers.status_updater import get_tolerance_for item_tolerance = {} global_tolerance = None - + for item in self.get("entries"): if item.get(item_ref_dn): - ref_amt = flt(frappe.db.get_value(ref_dt + " Item", + ref_amt = flt(frappe.db.get_value(ref_dt + " Item", item.get(item_ref_dn), based_on), self.precision(based_on, item)) if not ref_amt: - frappe.msgprint(_("As amount for item") + ": " + item.item_code + _(" in ") + + frappe.msgprint(_("As amount for item") + ": " + item.item_code + _(" in ") + ref_dt + _(" is zero, system will not check for over-billed")) else: - already_billed = frappe.db.sql("""select sum(%s) from `tab%s` - where %s=%s and docstatus=1 and parent != %s""" % - (based_on, self.tname, item_ref_dn, '%s', '%s'), + already_billed = frappe.db.sql("""select sum(%s) from `tab%s` + where %s=%s and docstatus=1 and parent != %s""" % + (based_on, self.tname, item_ref_dn, '%s', '%s'), (item.get(item_ref_dn), self.name))[0][0] - - total_billed_amt = flt(flt(already_billed) + flt(item.get(based_on)), + + total_billed_amt = flt(flt(already_billed) + flt(item.get(based_on)), self.precision(based_on, item)) - - tolerance, item_tolerance, global_tolerance = get_tolerance_for(item.item_code, + + tolerance, item_tolerance, global_tolerance = get_tolerance_for(item.item_code, item_tolerance, global_tolerance) - + max_allowed_amt = flt(ref_amt * (100 + tolerance) / 100) - + if total_billed_amt - max_allowed_amt > 0.01: reduce_by = total_billed_amt - max_allowed_amt - - frappe.throw(_("Row #") + cstr(item.idx) + ": " + - _(" Max amount allowed for Item ") + cstr(item.item_code) + - _(" against ") + ref_dt + " " + - cstr(item.get(ref_dt.lower().replace(" ", "_"))) + _(" is ") + - cstr(max_allowed_amt) + ". \n" + + + frappe.throw(_("Row #") + cstr(item.idx) + ": " + + _(" Max amount allowed for Item ") + cstr(item.item_code) + + _(" against ") + ref_dt + " " + + cstr(item.get(ref_dt.lower().replace(" ", "_"))) + _(" is ") + + cstr(max_allowed_amt) + ". \n" + _("""If you want to increase your overflow tolerance, please increase \ - tolerance % in Global Defaults or Item master. - Or, you must reduce the amount by """) + cstr(reduce_by) + "\n" + + tolerance % in Global Defaults or Item master. + Or, you must reduce the amount by """) + cstr(reduce_by) + "\n" + _("""Also, please check if the order item has already been billed \ in the Sales Order""")) - + def get_company_default(self, fieldname): from erpnext.accounts.utils import get_company_default return get_company_default(self.company, fieldname) - + def get_stock_items(self): stock_items = [] - item_codes = list(set(item.item_code for item in + item_codes = list(set(item.item_code for item in self.get(self.fname))) if item_codes: stock_items = [r[0] for r in frappe.db.sql("""select name from `tabItem` where name in (%s) and is_stock_item='Yes'""" % \ (", ".join((["%s"]*len(item_codes))),), item_codes)] - + return stock_items - + @property def company_abbr(self): if not hasattr(self, "_abbr"): self._abbr = frappe.db.get_value("Company", self.company, "abbr") - + return self._abbr def check_credit_limit(self, account): total_outstanding = frappe.db.sql(""" - select sum(ifnull(debit, 0)) - sum(ifnull(credit, 0)) + select sum(ifnull(debit, 0)) - sum(ifnull(credit, 0)) from `tabGL Entry` where account = %s""", account) - + total_outstanding = total_outstanding[0][0] if total_outstanding else 0 if total_outstanding: frappe.get_doc('Account', account).check_credit_limit(total_outstanding) @@ -480,4 +477,4 @@ class AccountsController(TransactionBase): @frappe.whitelist() def get_tax_rate(account_head): - return frappe.db.get_value("Account", account_head, "tax_rate") \ No newline at end of file + return frappe.db.get_value("Account", account_head, "tax_rate") diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index 027bfd2ad8..3f78fe69cb 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -13,52 +13,52 @@ class SellingController(StockController): def onload_post_render(self): # contact, address, item details and pos details (if applicable) self.set_missing_values() - + def validate(self): super(SellingController, self).validate() self.validate_max_discount() check_active_sales_items(self) - + def get_sender(self, comm): return frappe.db.get_value('Sales Email Settings', None, 'email_id') - + def set_missing_values(self, for_validate=False): super(SellingController, self).set_missing_values(for_validate) - + # set contact and address details for customer, if they are not mentioned self.set_missing_lead_customer_details() self.set_price_list_and_item_details() if self.get("__islocal"): self.set_taxes("other_charges", "taxes_and_charges") - + def set_missing_lead_customer_details(self): if getattr(self, "customer", None): from erpnext.accounts.party import _get_party_details self.update_if_missing(_get_party_details(self.customer, ignore_permissions=getattr(self, "ignore_permissions", None))) - + elif getattr(self, "lead", None): from erpnext.selling.doctype.lead.lead import get_lead_details self.update_if_missing(get_lead_details(self.lead)) - + def set_price_list_and_item_details(self): self.set_price_list_currency("Selling") self.set_missing_item_details() - + def apply_shipping_rule(self): if self.shipping_rule: shipping_rule = frappe.get_doc("Shipping Rule", self.shipping_rule) value = self.net_total - + # TODO # shipping rule calculation based on item's net weight - + shipping_amount = 0.0 for condition in shipping_rule.get("shipping_rule_conditions"): if not condition.to_value or (flt(condition.from_value) <= value <= flt(condition.to_value)): shipping_amount = condition.shipping_amount break - + self.append("other_charges", { "doctype": "Sales Taxes and Charges", "charge_type": "Actual", @@ -67,86 +67,86 @@ class SellingController(StockController): "description": shipping_rule.label, "rate": shipping_amount }) - + def set_total_in_words(self): from frappe.utils import money_in_words company_currency = get_company_currency(self.company) - - disable_rounded_total = cint(frappe.db.get_value("Global Defaults", None, + + disable_rounded_total = cint(frappe.db.get_value("Global Defaults", None, "disable_rounded_total")) - + if self.meta.get_field("in_words"): - self.in_words = money_in_words(disable_rounded_total and + self.in_words = money_in_words(disable_rounded_total and self.grand_total or self.rounded_total, company_currency) if self.meta.get_field("in_words_export"): - self.in_words_export = money_in_words(disable_rounded_total and + self.in_words_export = money_in_words(disable_rounded_total and self.grand_total_export or self.rounded_total_export, self.currency) - + def calculate_taxes_and_totals(self): self.other_fname = "other_charges" - + super(SellingController, self).calculate_taxes_and_totals() - + self.calculate_total_advance("Sales Invoice", "advance_adjustment_details") self.calculate_commission() self.calculate_contribution() - + def determine_exclusive_rate(self): if not any((cint(tax.included_in_print_rate) for tax in self.tax_doclist)): # no inclusive tax return - + for item in self.item_doclist: item_tax_map = self._load_item_tax_rate(item.item_tax_rate) cumulated_tax_fraction = 0 for i, tax in enumerate(self.tax_doclist): tax.tax_fraction_for_current_item = self.get_current_tax_fraction(tax, item_tax_map) - + if i==0: tax.grand_total_fraction_for_current_item = 1 + tax.tax_fraction_for_current_item else: tax.grand_total_fraction_for_current_item = \ self.tax_doclist[i-1].grand_total_fraction_for_current_item \ + tax.tax_fraction_for_current_item - + cumulated_tax_fraction += tax.tax_fraction_for_current_item - + if cumulated_tax_fraction and not self.discount_amount_applied: item.base_amount = flt((item.amount * self.conversion_rate) / (1 + cumulated_tax_fraction), self.precision("base_amount", item)) - + item.base_rate = flt(item.base_amount / item.qty, self.precision("base_rate", item)) - + if item.discount_percentage == 100: item.base_price_list_rate = item.base_rate item.base_rate = 0.0 else: item.base_price_list_rate = flt(item.base_rate / (1 - (item.discount_percentage / 100.0)), self.precision("base_price_list_rate", item)) - + def get_current_tax_fraction(self, tax, item_tax_map): """ Get tax fraction for calculating tax exclusive amount from tax inclusive amount """ current_tax_fraction = 0 - + if cint(tax.included_in_print_rate): tax_rate = self._get_tax_rate(tax, item_tax_map) - + if tax.charge_type == "On Net Total": current_tax_fraction = tax_rate / 100.0 - + elif tax.charge_type == "On Previous Row Amount": current_tax_fraction = (tax_rate / 100.0) * \ self.tax_doclist[cint(tax.row_id) - 1].tax_fraction_for_current_item - + elif tax.charge_type == "On Previous Row Total": current_tax_fraction = (tax_rate / 100.0) * \ self.tax_doclist[cint(tax.row_id) - 1].grand_total_fraction_for_current_item - + return current_tax_fraction - + def calculate_item_values(self): if not self.discount_amount_applied: for item in self.item_doclist: @@ -171,22 +171,22 @@ class SellingController(StockController): for item in self.item_doclist: self.net_total += item.base_amount self.net_total_export += item.amount - + self.round_floats_in(self, ["net_total", "net_total_export"]) - + def calculate_totals(self): self.grand_total = flt(self.tax_doclist and \ self.tax_doclist[-1].total or self.net_total, self.precision("grand_total")) - self.grand_total_export = flt(self.grand_total / self.conversion_rate, + self.grand_total_export = flt(self.grand_total / self.conversion_rate, self.precision("grand_total_export")) - + self.other_charges_total = flt(self.grand_total - self.net_total, self.precision("other_charges_total")) - self.other_charges_total_export = flt(self.grand_total_export - - self.net_total_export + flt(self.discount_amount), + self.other_charges_total_export = flt(self.grand_total_export - + self.net_total_export + flt(self.discount_amount), self.precision("other_charges_total_export")) - + self.rounded_total = _round(self.grand_total) self.rounded_total_export = _round(self.grand_total_export) @@ -214,12 +214,12 @@ class SellingController(StockController): flt(tax.rate) / 100 actual_taxes_dict.setdefault(tax.idx, actual_tax_amount) - grand_total_for_discount_amount = flt(self.grand_total - sum(actual_taxes_dict.values()), + grand_total_for_discount_amount = flt(self.grand_total - sum(actual_taxes_dict.values()), self.precision("grand_total")) return grand_total_for_discount_amount def calculate_outstanding_amount(self): - # NOTE: + # NOTE: # write_off_amount is only for POS Invoice # total_advance is only for non POS Invoice if self.doctype == "Sales Invoice" and self.docstatus == 0: @@ -228,14 +228,14 @@ class SellingController(StockController): total_amount_to_pay = self.grand_total - self.write_off_amount self.outstanding_amount = flt(total_amount_to_pay - self.total_advance \ - self.paid_amount, self.precision("outstanding_amount")) - + def calculate_commission(self): if self.meta.get_field("commission_rate"): self.round_floats_in(self, ["net_total", "commission_rate"]) if self.commission_rate > 100.0: - msgprint(_(self.meta.get_label("commission_rate")) + " " + + msgprint(_(self.meta.get_label("commission_rate")) + " " + _("cannot be greater than 100"), raise_exception=True) - + self.total_commission = flt(self.net_total * self.commission_rate / 100.0, self.precision("total_commission")) @@ -248,66 +248,66 @@ class SellingController(StockController): sales_person.allocated_amount = flt( self.net_total * sales_person.allocated_percentage / 100.0, self.precision("allocated_amount", sales_person)) - + total += sales_person.allocated_percentage - + if sales_team and total != 100.0: - msgprint(_("Total") + " " + - _(self.meta.get_label("allocated_percentage", parentfield="sales_team")) + + msgprint(_("Total") + " " + + _(self.meta.get_label("allocated_percentage", parentfield="sales_team")) + " " + _("should be 100%"), raise_exception=True) - + def validate_order_type(self): valid_types = ["Sales", "Maintenance", "Shopping Cart"] if not self.order_type: self.order_type = "Sales" elif self.order_type not in valid_types: - msgprint(_(self.meta.get_label("order_type")) + " " + + msgprint(_(self.meta.get_label("order_type")) + " " + _("must be one of") + ": " + comma_or(valid_types), raise_exception=True) - + def check_credit(self, grand_total): - customer_account = frappe.db.get_value("Account", {"company": self.company, + customer_account = frappe.db.get_value("Account", {"company": self.company, "master_name": self.customer}, "name") if customer_account: - total_outstanding = frappe.db.sql("""select - sum(ifnull(debit, 0)) - sum(ifnull(credit, 0)) + total_outstanding = frappe.db.sql("""select + sum(ifnull(debit, 0)) - sum(ifnull(credit, 0)) from `tabGL Entry` where account = %s""", customer_account) total_outstanding = total_outstanding[0][0] if total_outstanding else 0 - + outstanding_including_current = flt(total_outstanding) + flt(grand_total) - frappe.get_doc('Account', customer_account).run_method("check_credit_limit", + frappe.get_doc('Account', customer_account).run_method("check_credit_limit", outstanding_including_current) - + def validate_max_discount(self): for d in self.get(self.fname): discount = flt(frappe.db.get_value("Item", d.item_code, "max_discount")) - + if discount and flt(d.discount_percentage) > discount: - frappe.throw(_("You cannot give more than ") + cstr(discount) + "% " + + frappe.throw(_("You cannot give more than ") + cstr(discount) + "% " + _("discount on Item Code") + ": " + cstr(d.item_code)) - + def get_item_list(self): il = [] for d in self.get(self.fname): reserved_warehouse = "" reserved_qty_for_main_item = 0 - + if self.doctype == "Sales Order": - if (frappe.db.get_value("Item", d.item_code, "is_stock_item") == 'Yes' or + if (frappe.db.get_value("Item", d.item_code, "is_stock_item") == 'Yes' or self.has_sales_bom(d.item_code)) and not d.warehouse: - frappe.throw(_("Please enter Reserved Warehouse for item ") + + frappe.throw(_("Please enter Reserved Warehouse for item ") + d.item_code + _(" as it is stock Item or packing item")) reserved_warehouse = d.warehouse if flt(d.qty) > flt(d.delivered_qty): reserved_qty_for_main_item = flt(d.qty) - flt(d.delivered_qty) - - if self.doctype == "Delivery Note" and d.against_sales_order: + + elif self.doctype == "Delivery Note" and d.against_sales_order: # if SO qty is 10 and there is tolerance of 20%, then it will allow DN of 12. # But in this case reserved qty should only be reduced by 10 and not 12 - - already_delivered_qty = self.get_already_delivered_qty(self.name, + + already_delivered_qty = self.get_already_delivered_qty(self.name, d.against_sales_order, d.prevdoc_detail_docname) so_qty, reserved_warehouse = self.get_so_qty_and_warehouse(d.prevdoc_detail_docname) - + if already_delivered_qty + d.qty > so_qty: reserved_qty_for_main_item = -(so_qty - already_delivered_qty) else: @@ -341,15 +341,15 @@ class SellingController(StockController): 'name': d.name })) return il - + def has_sales_bom(self, item_code): - return frappe.db.sql("""select name from `tabSales BOM` + return frappe.db.sql("""select name from `tabSales BOM` where new_item_code=%s and docstatus != 2""", item_code) - + def get_already_delivered_qty(self, dn, so, so_detail): - qty = frappe.db.sql("""select sum(qty) from `tabDelivery Note Item` - where prevdoc_detail_docname = %s and docstatus = 1 - and against_sales_order = %s + qty = frappe.db.sql("""select sum(qty) from `tabDelivery Note Item` + where prevdoc_detail_docname = %s and docstatus = 1 + and against_sales_order = %s and parent != %s""", (so_detail, so, dn)) return qty and flt(qty[0][0]) or 0.0 @@ -359,24 +359,24 @@ class SellingController(StockController): so_qty = so_item and flt(so_item[0]["qty"]) or 0.0 so_warehouse = so_item and so_item[0]["warehouse"] or "" return so_qty, so_warehouse - + def check_stop_sales_order(self, ref_fieldname): for d in self.get(self.fname): if d.get(ref_fieldname): status = frappe.db.get_value("Sales Order", d.get(ref_fieldname), "status") if status == "Stopped": - frappe.throw(self.doctype + - _(" can not be created/modified against stopped Sales Order ") + + frappe.throw(self.doctype + + _(" can not be created/modified against stopped Sales Order ") + d.get(ref_fieldname)) - + def check_active_sales_items(obj): for d in obj.get(obj.fname): if d.item_code: - item = frappe.db.sql("""select docstatus, is_sales_item, - is_service_item, income_account from tabItem where name = %s""", + item = frappe.db.sql("""select docstatus, is_sales_item, + is_service_item, income_account from tabItem where name = %s""", d.item_code, as_dict=True)[0] if item.is_sales_item == 'No' and item.is_service_item == 'No': frappe.throw(_("Item is neither Sales nor Service Item") + ": " + d.item_code) if getattr(d, "income_account", None) and not item.income_account: - frappe.db.set_value("Item", d.item_code, "income_account", + frappe.db.set_value("Item", d.item_code, "income_account", d.income_account) diff --git a/erpnext/manufacturing/doctype/bom/bom.py b/erpnext/manufacturing/doctype/bom/bom.py index aa96b7c399..206c963046 100644 --- a/erpnext/manufacturing/doctype/bom/bom.py +++ b/erpnext/manufacturing/doctype/bom/bom.py @@ -14,15 +14,15 @@ from frappe.model.document import Document class BOM(Document): def autoname(self): - last_name = frappe.db.sql("""select max(name) from `tabBOM` + last_name = frappe.db.sql("""select max(name) from `tabBOM` where name like "BOM/%s/%%" """ % cstr(self.item).replace('"', '\\"')) if last_name: idx = cint(cstr(last_name[0][0]).split('/')[-1].split('-')[0]) + 1 - + else: idx = 1 self.name = 'BOM/' + self.item + ('/%.3i' % idx) - + def validate(self): self.clear_operations() self.validate_main_item() @@ -34,12 +34,11 @@ class BOM(Document): self.validate_materials() self.set_bom_material_details() self.calculate_cost() - + def on_update(self): self.check_recursion() self.update_exploded_items() - self.db_update() - + def on_submit(self): self.manage_default_bom() @@ -50,48 +49,48 @@ class BOM(Document): # check if used in any other bom self.validate_bom_links() self.manage_default_bom() - + def on_update_after_submit(self): self.validate_bom_links() self.manage_default_bom() def get_item_det(self, item_code): - item = frappe.db.sql("""select name, is_asset_item, is_purchase_item, - docstatus, description, is_sub_contracted_item, stock_uom, default_bom, - last_purchase_rate, standard_rate, is_manufactured_item + item = frappe.db.sql("""select name, is_asset_item, is_purchase_item, + docstatus, description, is_sub_contracted_item, stock_uom, default_bom, + last_purchase_rate, standard_rate, is_manufactured_item from `tabItem` where name=%s""", item_code, as_dict = 1) return item - + def validate_rm_item(self, item): if item[0]['name'] == self.item: - msgprint("Item_code: %s in materials tab cannot be same as FG Item", + msgprint("Item_code: %s in materials tab cannot be same as FG Item", item[0]['name'], raise_exception=1) - + if not item or item[0]['docstatus'] == 2: msgprint("Item %s does not exist in system" % item[0]['item_code'], raise_exception = 1) - + def set_bom_material_details(self): for item in self.get("bom_materials"): - ret = self.get_bom_material_detail({"item_code": item.item_code, "bom_no": item.bom_no, + ret = self.get_bom_material_detail({"item_code": item.item_code, "bom_no": item.bom_no, "qty": item.qty}) for r in ret: if not item.get(r): item.set(r, ret[r]) - + def get_bom_material_detail(self, args=None): """ Get raw material details like uom, desc and rate""" if not args: args = frappe.form_dict.get('args') - + if isinstance(args, basestring): import json args = json.loads(args) - + item = self.get_item_det(args['item_code']) self.validate_rm_item(item) - + args['bom_no'] = args['bom_no'] or item and cstr(item[0]['default_bom']) or '' args.update(item[0]) @@ -117,27 +116,23 @@ class BOM(Document): elif self.rm_cost_as_per == "Price List": if not self.buying_price_list: frappe.throw(_("Please select Price List")) - rate = frappe.db.get_value("Item Price", {"price_list": self.buying_price_list, + rate = frappe.db.get_value("Item Price", {"price_list": self.buying_price_list, "item_code": arg["item_code"]}, "price_list_rate") or 0 elif self.rm_cost_as_per == 'Standard Rate': rate = arg['standard_rate'] return rate - + def update_cost(self): for d in self.get("bom_materials"): d.rate = self.get_bom_material_detail({ - 'item_code': d.item_code, + 'item_code': d.item_code, 'bom_no': d.bom_no, 'qty': d.qty })["rate"] - - if self.docstatus == 0: + + if self.docstatus in (0, 1): self.save() - elif self.docstatus == 1: - self.calculate_cost() - self.update_exploded_items() - self.update_after_submit() def get_bom_unitcost(self, bom_no): bom = frappe.db.sql("""select name, total_cost/quantity as unit_cost from `tabBOM` @@ -145,9 +140,9 @@ class BOM(Document): return bom and bom[0]['unit_cost'] or 0 def get_valuation_rate(self, args): - """ Get average valuation rate of relevant warehouses - as per valuation method (MAR/FIFO) - as on costing date + """ Get average valuation rate of relevant warehouses + as per valuation method (MAR/FIFO) + as on costing date """ from erpnext.stock.utils import get_incoming_rate dt = self.costing_date or nowdate() @@ -168,19 +163,19 @@ class BOM(Document): return rate and flt(sum(rate))/len(rate) or 0 def manage_default_bom(self): - """ Uncheck others if current one is selected as default, + """ Uncheck others if current one is selected as default, update default bom in item master """ if self.is_default and self.is_active: from frappe.model.utils import set_default set_default(self, "item") frappe.db.set_value("Item", self.item, "default_bom", self.name) - + else: if not self.is_active: frappe.db.set(self, "is_default", 0) - - frappe.db.sql("update `tabItem` set default_bom = null where name = %s and default_bom = %s", + + frappe.db.sql("update `tabItem` set default_bom = null where name = %s and default_bom = %s", (self.item, self.name)) def clear_operations(self): @@ -193,7 +188,7 @@ class BOM(Document): """ Validate main FG item""" item = self.get_item_det(self.item) if not item: - msgprint("Item %s does not exists in the system or expired." % + msgprint("Item %s does not exists in the system or expired." % self.item, raise_exception = 1) elif item[0]['is_manufactured_item'] != 'Yes' \ and item[0]['is_sub_contracted_item'] != 'Yes': @@ -209,7 +204,7 @@ class BOM(Document): self.op = [] for d in self.get('bom_operations'): if cstr(d.operation_no) in self.op: - msgprint("Operation no: %s is repeated in Operations Table" % + msgprint("Operation no: %s is repeated in Operations Table" % d.operation_no, raise_exception=1) else: # add operation in op list @@ -222,36 +217,36 @@ class BOM(Document): # check if operation no not in op table if self.with_operations and cstr(m.operation_no) not in self.op: msgprint("""Operation no: %s against item: %s at row no: %s \ - is not present at Operations table""" % + is not present at Operations table""" % (m.operation_no, m.item_code, m.idx), raise_exception = 1) - + item = self.get_item_det(m.item_code) if item[0]['is_manufactured_item'] == 'Yes': if not m.bom_no: - msgprint("Please enter BOM No aginst item: %s at row no: %s" % + msgprint("Please enter BOM No aginst item: %s at row no: %s" % (m.item_code, m.idx), raise_exception=1) else: self.validate_bom_no(m.item_code, m.bom_no, m.idx) elif m.bom_no: msgprint("""As Item %s is not a manufactured / sub-contracted item, \ - you can not enter BOM against it (Row No: %s).""" % + you can not enter BOM against it (Row No: %s).""" % (m.item_code, m.idx), raise_exception = 1) if flt(m.qty) <= 0: - msgprint("Please enter qty against raw material: %s at row no: %s" % + msgprint("Please enter qty against raw material: %s at row no: %s" % (m.item_code, m.idx), raise_exception = 1) self.check_if_item_repeated(m.item_code, m.operation_no, check_list) def validate_bom_no(self, item, bom_no, idx): """Validate BOM No of sub-contracted items""" - bom = frappe.db.sql("""select name from `tabBOM` where name = %s and item = %s - and is_active=1 and docstatus=1""", + bom = frappe.db.sql("""select name from `tabBOM` where name = %s and item = %s + and is_active=1 and docstatus=1""", (bom_no, item), as_dict =1) if not bom: msgprint("""Incorrect BOM No: %s against item: %s at row no: %s. - It may be inactive or not submitted or does not belong to this item.""" % + It may be inactive or not submitted or does not belong to this item.""" % (bom_no, item, idx), raise_exception = 1) def check_if_item_repeated(self, item, op, check_list): @@ -268,7 +263,7 @@ class BOM(Document): for d in check_list: bom_list, count = [self.name], 0 while (len(bom_list) > count ): - boms = frappe.db.sql(" select %s from `tabBOM Item` where %s = %s " % + boms = frappe.db.sql(" select %s from `tabBOM Item` where %s = %s " % (d[0], d[1], '%s'), cstr(bom_list[count])) count = count + 1 for b in boms: @@ -277,24 +272,24 @@ class BOM(Document): """ % (cstr(b[0]), cstr(d[2]), self.name), raise_exception = 1) if b[0]: bom_list.append(b[0]) - + def update_cost_and_exploded_items(self, bom_list=[]): bom_list = self.traverse_tree(bom_list) for bom in bom_list: bom_obj = frappe.get_doc("BOM", bom) bom_obj.on_update() - + return bom_list - + def traverse_tree(self, bom_list=[]): def _get_children(bom_no): - return [cstr(d[0]) for d in frappe.db.sql("""select bom_no from `tabBOM Item` + return [cstr(d[0]) for d in frappe.db.sql("""select bom_no from `tabBOM Item` where parent = %s and ifnull(bom_no, '') != ''""", bom_no)] - + count = 0 if self.name not in bom_list: bom_list.append(self.name) - + while(count < len(bom_list)): for child_bom in _get_children(bom_list[count]): if child_bom not in bom_list: @@ -302,7 +297,7 @@ class BOM(Document): count += 1 bom_list.reverse() return bom_list - + def calculate_cost(self): """Calculate bom totals""" self.calculate_op_cost() @@ -319,7 +314,7 @@ class BOM(Document): d.operating_cost = flt(d.hour_rate) * flt(d.time_in_mins) / 60.0 total_op_cost += flt(d.operating_cost) self.operating_cost = total_op_cost - + def calculate_rm_cost(self): """Fetch RM rate as per today's valuation rate and calculate totals""" total_rm_cost = 0 @@ -329,7 +324,7 @@ class BOM(Document): d.amount = flt(d.rate) * flt(d.qty) d.qty_consumed_per_unit = flt(d.qty) / flt(self.quantity) total_rm_cost += d.amount - + self.raw_material_cost = total_rm_cost def update_exploded_items(self): @@ -345,38 +340,38 @@ class BOM(Document): self.get_child_exploded_items(d.bom_no, d.qty) else: self.add_to_cur_exploded_items(frappe._dict({ - 'item_code' : d.item_code, - 'description' : d.description, - 'stock_uom' : d.stock_uom, + 'item_code' : d.item_code, + 'description' : d.description, + 'stock_uom' : d.stock_uom, 'qty' : flt(d.qty), 'rate' : flt(d.rate), })) - + def add_to_cur_exploded_items(self, args): if self.cur_exploded_items.get(args.item_code): self.cur_exploded_items[args.item_code]["qty"] += args.qty else: self.cur_exploded_items[args.item_code] = args - + def get_child_exploded_items(self, bom_no, qty): """ Add all items from Flat BOM of child BOM""" - - child_fb_items = frappe.db.sql("""select item_code, description, stock_uom, qty, rate, - qty_consumed_per_unit from `tabBOM Explosion Item` + + child_fb_items = frappe.db.sql("""select item_code, description, stock_uom, qty, rate, + qty_consumed_per_unit from `tabBOM Explosion Item` where parent = %s and docstatus = 1""", bom_no, as_dict = 1) - + for d in child_fb_items: self.add_to_cur_exploded_items(frappe._dict({ - 'item_code' : d['item_code'], - 'description' : d['description'], - 'stock_uom' : d['stock_uom'], + 'item_code' : d['item_code'], + 'description' : d['description'], + 'stock_uom' : d['stock_uom'], 'qty' : flt(d['qty_consumed_per_unit'])*qty, 'rate' : flt(d['rate']), })) def add_exploded_items(self): "Add items to Flat BOM table" - self.set('flat_bom_details', []) + frappe.db.sql("""delete from `tabBOM Explosion Item` where parent=%s""", self.name) for d in self.cur_exploded_items: ch = self.append('flat_bom_details', {}) for i in self.cur_exploded_items[d].keys(): @@ -384,7 +379,7 @@ class BOM(Document): ch.amount = flt(ch.qty) * flt(ch.rate) ch.qty_consumed_per_unit = flt(ch.qty) / flt(self.quantity) ch.docstatus = self.docstatus - ch.db_update() + ch.db_insert() def validate_bom_links(self): if not self.is_active: @@ -399,26 +394,27 @@ class BOM(Document): raise_exception=1) def get_bom_items_as_dict(bom, qty=1, fetch_exploded=1): + import json item_dict = {} - - query = """select + + query = """select bom_item.item_code, item.item_name, - ifnull(sum(bom_item.qty_consumed_per_unit),0) * %(qty)s as qty, - item.description, + ifnull(sum(bom_item.qty_consumed_per_unit),0) * %(qty)s as qty, + item.description, item.stock_uom, item.default_warehouse, item.expense_account as expense_account, item.buying_cost_center as cost_center - from - `tab%(table)s` bom_item, `tabItem` item - where - bom_item.docstatus < 2 + from + `tab%(table)s` bom_item, `tabItem` item + where + bom_item.docstatus < 2 and bom_item.parent = "%(bom)s" - and item.name = bom_item.item_code + and item.name = bom_item.item_code %(conditions)s group by item_code, stock_uom""" - + if fetch_exploded: items = frappe.db.sql(query % { "qty": qty, @@ -441,7 +437,7 @@ def get_bom_items_as_dict(bom, qty=1, fetch_exploded=1): item_dict[item.item_code]["qty"] += flt(item.qty) else: item_dict[item.item_code] = item - + return item_dict @frappe.whitelist() diff --git a/erpnext/manufacturing/doctype/bom/test_bom.py b/erpnext/manufacturing/doctype/bom/test_bom.py index 074daa4eb9..28ee49acbc 100644 --- a/erpnext/manufacturing/doctype/bom/test_bom.py +++ b/erpnext/manufacturing/doctype/bom/test_bom.py @@ -12,19 +12,19 @@ class TestBOM(unittest.TestCase): def test_get_items(self): from erpnext.manufacturing.doctype.bom.bom import get_bom_items_as_dict items_dict = get_bom_items_as_dict(bom="BOM/_Test FG Item 2/001", qty=1, fetch_exploded=0) - self.assertTrue(test_records[2][1]["item_code"] in items_dict) - self.assertTrue(test_records[2][2]["item_code"] in items_dict) + self.assertTrue(test_records[2]["bom_materials"][0]["item_code"] in items_dict) + self.assertTrue(test_records[2]["bom_materials"][1]["item_code"] in items_dict) self.assertEquals(len(items_dict.values()), 2) - + def test_get_items_exploded(self): from erpnext.manufacturing.doctype.bom.bom import get_bom_items_as_dict items_dict = get_bom_items_as_dict(bom="BOM/_Test FG Item 2/001", qty=1, fetch_exploded=1) - self.assertTrue(test_records[2][1]["item_code"] in items_dict) - self.assertFalse(test_records[2][2]["item_code"] in items_dict) - self.assertTrue(test_records[0][1]["item_code"] in items_dict) - self.assertTrue(test_records[0][2]["item_code"] in items_dict) + self.assertTrue(test_records[2]["bom_materials"][0]["item_code"] in items_dict) + self.assertFalse(test_records[2]["bom_materials"][1]["item_code"] in items_dict) + self.assertTrue(test_records[0]["bom_materials"][0]["item_code"] in items_dict) + self.assertTrue(test_records[0]["bom_materials"][1]["item_code"] in items_dict) self.assertEquals(len(items_dict.values()), 3) - + def test_get_items_list(self): from erpnext.manufacturing.doctype.bom.bom import get_bom_items - self.assertEquals(len(get_bom_items(bom="BOM/_Test FG Item 2/001", qty=1, fetch_exploded=1)), 3) \ No newline at end of file + self.assertEquals(len(get_bom_items(bom="BOM/_Test FG Item 2/001", qty=1, fetch_exploded=1)), 3) diff --git a/erpnext/manufacturing/doctype/production_order/test_production_order.py b/erpnext/manufacturing/doctype/production_order/test_production_order.py index 81fc61661f..9bc001d9b4 100644 --- a/erpnext/manufacturing/doctype/production_order/test_production_order.py +++ b/erpnext/manufacturing/doctype/production_order/test_production_order.py @@ -16,51 +16,53 @@ class TestProductionOrder(unittest.TestCase): frappe.db.sql("delete from `tabStock Ledger Entry`") frappe.db.sql("""delete from `tabBin`""") frappe.db.sql("""delete from `tabGL Entry`""") - + pro_doc = frappe.copy_doc(test_records[0]) pro_doc.insert() pro_doc.submit() - + from erpnext.stock.doctype.stock_entry.test_stock_entry import test_records as se_test_records mr1 = frappe.copy_doc(se_test_records[0]) mr1.insert() mr1.submit() - + mr2 = frappe.copy_doc(se_test_records[0]) mr2.get("mtn_details")[0].item_code = "_Test Item Home Desktop 100" mr2.insert() mr2.submit() - + stock_entry = make_stock_entry(pro_doc.name, "Manufacture/Repack") stock_entry = frappe.get_doc(stock_entry) stock_entry.fiscal_year = "_Test Fiscal Year 2013" stock_entry.fg_completed_qty = 4 stock_entry.posting_date = "2013-05-12" stock_entry.fiscal_year = "_Test Fiscal Year 2013" + stock_entry.set("mtn_details", []) stock_entry.run_method("get_items") stock_entry.submit() - - self.assertEqual(frappe.db.get_value("Production Order", pro_doc.name, + + self.assertEqual(frappe.db.get_value("Production Order", pro_doc.name, "produced_qty"), 4) - self.assertEqual(frappe.db.get_value("Bin", {"item_code": "_Test FG Item", + self.assertEqual(frappe.db.get_value("Bin", {"item_code": "_Test FG Item", "warehouse": "_Test Warehouse 1 - _TC"}, "planned_qty"), 6) - + return pro_doc.name - + def test_over_production(self): from erpnext.stock.doctype.stock_entry.stock_entry import StockOverProductionError pro_order = self.test_planned_qty() - + stock_entry = make_stock_entry(pro_order, "Manufacture/Repack") stock_entry = frappe.get_doc(stock_entry) stock_entry.posting_date = "2013-05-12" stock_entry.fiscal_year = "_Test Fiscal Year 2013" stock_entry.fg_completed_qty = 15 + stock_entry.set("mtn_details", []) stock_entry.run_method("get_items") stock_entry.insert() - - self.assertRaises(StockOverProductionError, stock_entry.submit) - - -test_records = frappe.get_test_records('Production Order') \ No newline at end of file + self.assertRaises(StockOverProductionError, stock_entry.submit) + + + +test_records = frappe.get_test_records('Production Order') diff --git a/erpnext/projects/doctype/time_log/test_time_log.py b/erpnext/projects/doctype/time_log/test_time_log.py index eedad0b387..7aadf5c286 100644 --- a/erpnext/projects/doctype/time_log/test_time_log.py +++ b/erpnext/projects/doctype/time_log/test_time_log.py @@ -7,8 +7,9 @@ import unittest from erpnext.projects.doctype.time_log.time_log import OverlapError class TestTimeLog(unittest.TestCase): - def test_duplication(self): + def test_duplication(self): ts = frappe.get_doc(frappe.copy_doc(test_records[0])) self.assertRaises(OverlapError, ts.insert) -test_records = frappe.get_test_records('Time Log') \ No newline at end of file +test_records = frappe.get_test_records('Time Log') +test_ignore = ["Time Log Batch", "Sales Invoice"] diff --git a/erpnext/projects/doctype/time_log_batch/test_time_log_batch.py b/erpnext/projects/doctype/time_log_batch/test_time_log_batch.py index 004c3643ac..fdbc2102c2 100644 --- a/erpnext/projects/doctype/time_log_batch/test_time_log_batch.py +++ b/erpnext/projects/doctype/time_log_batch/test_time_log_batch.py @@ -14,10 +14,10 @@ class TimeLogBatchTest(unittest.TestCase): }) time_log.insert() time_log.submit() - + self.assertEquals(frappe.db.get_value("Time Log", time_log.name, "status"), "Submitted") tlb = frappe.copy_doc(test_records[0]) - tlb["time_log_batch_details"][0].time_log = time_log.name + tlb.get("time_log_batch_details")[0].time_log = time_log.name tlb.insert() tlb.submit() @@ -25,4 +25,6 @@ class TimeLogBatchTest(unittest.TestCase): tlb.cancel() self.assertEquals(frappe.db.get_value("Time Log", time_log.name, "status"), "Submitted") -test_records = frappe.get_test_records('Time Log Batch') \ No newline at end of file +test_records = frappe.get_test_records('Time Log Batch') +test_dependencies = ["Time Log"] +test_ignore = ["Sales Invoice"] diff --git a/erpnext/projects/doctype/time_log_batch/time_log_batch.py b/erpnext/projects/doctype/time_log_batch/time_log_batch.py index 4ad8130d8d..b8204e4855 100644 --- a/erpnext/projects/doctype/time_log_batch/time_log_batch.py +++ b/erpnext/projects/doctype/time_log_batch/time_log_batch.py @@ -31,17 +31,17 @@ class TimeLogBatch(Document): if tl.status != "Submitted" and self.docstatus == 0: frappe.msgprint(_("Time Log must have status 'Submitted'") + \ " :" + tl.name + " (" + _(tl.status) + ")", raise_exception=True) - + def set_status(self): self.status = { "0": "Draft", "1": "Submitted", "2": "Cancelled" }[str(self.docstatus or 0)] - + if self.sales_invoice: self.status = "Billed" - + def on_submit(self): self.update_status(self.name) @@ -57,4 +57,4 @@ class TimeLogBatch(Document): tl = frappe.get_doc("Time Log", d.time_log) tl.time_log_batch = time_log_batch tl.sales_invoice = self.sales_invoice - tl.update_after_submit() \ No newline at end of file + tl.save() diff --git a/erpnext/selling/doctype/customer/customer.py b/erpnext/selling/doctype/customer/customer.py index e5364d0871..361f4fa4ff 100644 --- a/erpnext/selling/doctype/customer/customer.py +++ b/erpnext/selling/doctype/customer/customer.py @@ -12,7 +12,7 @@ from erpnext.utilities.transaction_base import TransactionBase from erpnext.accounts.party import create_party_account class Customer(TransactionBase): - + def autoname(self): cust_master_name = frappe.defaults.get_global_default('cust_master_name') if cust_master_name == 'Customer Name': @@ -24,7 +24,7 @@ class Customer(TransactionBase): def get_company_abbr(self): return frappe.db.get_value('Company', self.company, 'abbr') - + def validate_values(self): if frappe.defaults.get_global_default('cust_master_name') == 'Naming Series' and not self.naming_series: frappe.throw("Series is Mandatory.", frappe.MandatoryError) @@ -37,28 +37,27 @@ class Customer(TransactionBase): frappe.db.sql("update `tabLead` set status='Converted' where name = %s", self.lead_name) def update_address(self): - frappe.db.sql("""update `tabAddress` set customer_name=%s, modified=NOW() + frappe.db.sql("""update `tabAddress` set customer_name=%s, modified=NOW() where customer=%s""", (self.customer_name, self.name)) def update_contact(self): - frappe.db.sql("""update `tabContact` set customer_name=%s, modified=NOW() + frappe.db.sql("""update `tabContact` set customer_name=%s, modified=NOW() where customer=%s""", (self.customer_name, self.name)) def update_credit_days_limit(self): - frappe.db.sql("""update tabAccount set credit_days = %s, credit_limit = %s - where master_type='Customer' and master_name = %s""", + frappe.db.sql("""update tabAccount set credit_days = %s, credit_limit = %s + where master_type='Customer' and master_name = %s""", (self.credit_days or 0, self.credit_limit or 0, self.name)) def create_lead_address_contact(self): if self.lead_name: - if not frappe.db.get_value("Address", {"lead": self.lead_name, "customer": self.customer}): - frappe.db.sql("""update `tabAddress` set customer=%s, customer_name=%s where lead=%s""", + if not frappe.db.get_value("Address", {"lead": self.lead_name, "customer": self.name}): + frappe.db.sql("""update `tabAddress` set customer=%s, customer_name=%s where lead=%s""", (self.name, self.customer_name, self.lead_name)) lead = frappe.db.get_value("Lead", self.lead_name, ["lead_name", "email_id", "phone", "mobile_no"], as_dict=True) - c = frappe.get_doc('Contact') - c.set("__islocal", 1) - c.first_name = lead.lead_name + c = frappe.new_doc('Contact') + c.first_name = lead.lead_name c.email_id = lead.email_id c.phone = lead.phone c.mobile_no = lead.mobile_no @@ -72,7 +71,7 @@ class Customer(TransactionBase): def on_update(self): self.validate_name_with_customer_group() - + self.update_lead_status() self.update_address() self.update_contact() @@ -84,29 +83,29 @@ class Customer(TransactionBase): self.update_credit_days_limit() #create address and contact from lead self.create_lead_address_contact() - + def validate_name_with_customer_group(self): if frappe.db.exists("Customer Group", self.name): frappe.msgprint("An Customer Group exists with same name (%s), \ - please change the Customer name or rename the Customer Group" % + please change the Customer name or rename the Customer Group" % self.name, raise_exception=1) def delete_customer_address(self): addresses = frappe.db.sql("""select name, lead from `tabAddress` where customer=%s""", (self.name,)) - + for name, lead in addresses: if lead: frappe.db.sql("""update `tabAddress` set customer=null, customer_name=null where name=%s""", name) else: frappe.db.sql("""delete from `tabAddress` where name=%s""", name) - + def delete_customer_contact(self): - for contact in frappe.db.sql_list("""select name from `tabContact` + for contact in frappe.db.sql_list("""select name from `tabContact` where customer=%s""", self.name): frappe.delete_doc("Contact", contact) - + def delete_customer_account(self): """delete customer's ledger if exist and check balance before deletion""" acc = frappe.db.sql("select name from `tabAccount` where master_type = 'Customer' \ @@ -120,7 +119,7 @@ class Customer(TransactionBase): self.delete_customer_account() if self.lead_name: frappe.db.sql("update `tabLead` set status='Interested' where name=%s",self.lead_name) - + def before_rename(self, olddn, newdn, merge=False): from erpnext.accounts.utils import rename_account_for rename_account_for("Customer", olddn, newdn, merge, self.company) @@ -134,7 +133,7 @@ class Customer(TransactionBase): self.update_customer_address(newdn, set_field) def update_customer_address(self, newdn, set_field): - frappe.db.sql("""update `tabAddress` set address_title=%(newdn)s + frappe.db.sql("""update `tabAddress` set address_title=%(newdn)s {set_field} where customer=%(newdn)s"""\ .format(set_field=set_field), ({"newdn": newdn})) @@ -142,21 +141,21 @@ class Customer(TransactionBase): def get_dashboard_info(customer): if not frappe.has_permission("Customer", "read", customer): frappe.msgprint("No Permission", raise_exception=True) - + out = {} for doctype in ["Opportunity", "Quotation", "Sales Order", "Delivery Note", "Sales Invoice"]: - out[doctype] = frappe.db.get_value(doctype, + out[doctype] = frappe.db.get_value(doctype, {"customer": customer, "docstatus": ["!=", 2] }, "count(*)") - - billing = frappe.db.sql("""select sum(grand_total), sum(outstanding_amount) - from `tabSales Invoice` - where customer=%s + + billing = frappe.db.sql("""select sum(grand_total), sum(outstanding_amount) + from `tabSales Invoice` + where customer=%s and docstatus = 1 and fiscal_year = %s""", (customer, frappe.db.get_default("fiscal_year"))) - + out["total_billing"] = billing[0][0] out["total_unpaid"] = billing[0][1] - + return out @@ -165,11 +164,11 @@ def get_customer_list(doctype, txt, searchfield, start, page_len, filters): fields = ["name", "customer_group", "territory"] else: fields = ["name", "customer_name", "customer_group", "territory"] - - return frappe.db.sql("""select %s from `tabCustomer` where docstatus < 2 - and (%s like %s or customer_name like %s) order by + + return frappe.db.sql("""select %s from `tabCustomer` where docstatus < 2 + and (%s like %s or customer_name like %s) order by case when name like %s then 0 else 1 end, case when customer_name like %s then 0 else 1 end, - name, customer_name limit %s, %s""" % - (", ".join(fields), searchfield, "%s", "%s", "%s", "%s", "%s", "%s"), - ("%%%s%%" % txt, "%%%s%%" % txt, "%%%s%%" % txt, "%%%s%%" % txt, start, page_len)) \ No newline at end of file + name, customer_name limit %s, %s""" % + (", ".join(fields), searchfield, "%s", "%s", "%s", "%s", "%s", "%s"), + ("%%%s%%" % txt, "%%%s%%" % txt, "%%%s%%" % txt, "%%%s%%" % txt, start, page_len)) diff --git a/erpnext/selling/doctype/lead/lead.py b/erpnext/selling/doctype/lead/lead.py index 57e73d09b4..8163be3111 100644 --- a/erpnext/selling/doctype/lead/lead.py +++ b/erpnext/selling/doctype/lead/lead.py @@ -96,7 +96,7 @@ def _make_customer(source_name, target_doc=None, ignore_permissions=False): } }}, target_doc, set_missing_values, ignore_permissions=ignore_permissions) - return doclist.as_dict() + return doclist @frappe.whitelist() def make_opportunity(source_name, target_doc=None): diff --git a/erpnext/selling/doctype/lead/test_lead.py b/erpnext/selling/doctype/lead/test_lead.py index 504f8398b7..606e328a62 100644 --- a/erpnext/selling/doctype/lead/test_lead.py +++ b/erpnext/selling/doctype/lead/test_lead.py @@ -13,9 +13,9 @@ class TestLead(unittest.TestCase): from erpnext.selling.doctype.lead.lead import make_customer customer = make_customer("_T-Lead-00001") - self.assertEquals(customer[0]["doctype"], "Customer") - self.assertEquals(customer[0]["lead_name"], "_T-Lead-00001") + self.assertEquals(customer.doctype, "Customer") + self.assertEquals(customer.lead_name, "_T-Lead-00001") - customer[0]["company"] = "_Test Company" - customer[0]["customer_group"] = "_Test Customer Group" - frappe.get_doc(customer).insert() + customer.company = "_Test Company" + customer.customer_group = "_Test Customer Group" + customer.insert() diff --git a/erpnext/selling/doctype/opportunity/opportunity.py b/erpnext/selling/doctype/opportunity/opportunity.py index a2358a3250..c87c9836fe 100644 --- a/erpnext/selling/doctype/opportunity/opportunity.py +++ b/erpnext/selling/doctype/opportunity/opportunity.py @@ -161,4 +161,4 @@ def make_quotation(source_name, target_doc=None): } }, target_doc, set_missing_values) - return doclist.as_dict() \ No newline at end of file + return doclist \ No newline at end of file diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py index f5c2050e64..d6ade9e0cb 100644 --- a/erpnext/selling/doctype/quotation/quotation.py +++ b/erpnext/selling/doctype/quotation/quotation.py @@ -137,7 +137,7 @@ def _make_sales_order(source_name, target_doc=None, ignore_permissions=False): # postprocess: fetch shipping address, set missing values - return doclist.as_dict() + return doclist def _make_customer(source_name, ignore_permissions=False): quotation = frappe.db.get_value("Quotation", source_name, ["lead", "order_type"]) diff --git a/erpnext/selling/doctype/quotation/test_quotation.py b/erpnext/selling/doctype/quotation/test_quotation.py index 54aa1c4eb0..d393a3d9e2 100644 --- a/erpnext/selling/doctype/quotation/test_quotation.py +++ b/erpnext/selling/doctype/quotation/test_quotation.py @@ -10,26 +10,26 @@ test_dependencies = ["Sales BOM"] class TestQuotation(unittest.TestCase): def test_make_sales_order(self): from erpnext.selling.doctype.quotation.quotation import make_sales_order - + quotation = frappe.copy_doc(test_records[0]) quotation.insert() - + self.assertRaises(frappe.ValidationError, make_sales_order, quotation.name) - + quotation.submit() sales_order = make_sales_order(quotation.name) - - self.assertEquals(sales_order[0]["doctype"], "Sales Order") - self.assertEquals(len(sales_order), 2) - self.assertEquals(sales_order[1]["doctype"], "Sales Order Item") - self.assertEquals(sales_order[1]["prevdoc_docname"], quotation.name) - self.assertEquals(sales_order[0]["customer"], "_Test Customer") - - sales_order[0]["delivery_date"] = "2014-01-01" - sales_order[0]["naming_series"] = "_T-Quotation-" - sales_order[0]["transaction_date"] = "2013-05-12" - frappe.get_doc(sales_order).insert() + + self.assertEquals(sales_order.doctype, "Sales Order") + self.assertEquals(len(sales_order.get("sales_order_details")), 2) + self.assertEquals(sales_order.get("sales_order_details")[0]["doctype"], "Sales Order Item") + self.assertEquals(sales_order.get("sales_order_details")[0]["prevdoc_docname"], quotation.name) + self.assertEquals(sales_order.customer, "_Test Customer") + + sales_order.delivery_date = "2014-01-01" + sales_order.naming_series = "_T-Quotation-" + sales_order.transaction_date = "2013-05-12" + sales_order.insert() -test_records = frappe.get_test_records('Quotation') \ No newline at end of file +test_records = frappe.get_test_records('Quotation') diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index d420e967b2..f4b6833d41 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -18,28 +18,28 @@ class SalesOrder(SellingController): person_tname = 'Target Detail' partner_tname = 'Partner Target Detail' territory_tname = 'Territory Target Detail' - + def validate_mandatory(self): # validate transaction date v/s delivery date if self.delivery_date: if getdate(self.transaction_date) > getdate(self.delivery_date): msgprint("Expected Delivery Date cannot be before Sales Order Date") raise Exception - + def validate_po(self): # validate p.o date v/s delivery date if self.po_date and self.delivery_date and getdate(self.po_date) > getdate(self.delivery_date): msgprint("Expected Delivery Date cannot be before Purchase Order Date") - raise Exception - + raise Exception + if self.po_no and self.customer: so = frappe.db.sql("select name from `tabSales Order` \ where ifnull(po_no, '') = %s and name != %s and docstatus < 2\ and customer = %s", (self.po_no, self.name, self.customer)) if so and so[0][0]: - msgprint("""Another Sales Order (%s) exists against same PO No and Customer. + msgprint("""Another Sales Order (%s) exists against same PO No and Customer. Please be sure, you are not making duplicate entry.""" % so[0][0]) - + def validate_for_items(self): check_list, flag = [], 0 chk_dupl_itm = [] @@ -49,9 +49,9 @@ class SalesOrder(SellingController): if frappe.db.get_value("Item", d.item_code, "is_stock_item") == 'Yes': if not d.warehouse: - msgprint("""Please enter Reserved Warehouse for item %s + msgprint("""Please enter Reserved Warehouse for item %s as it is stock Item""" % d.item_code, raise_exception=1) - + if e in check_list: msgprint("Item %s has been entered twice." % d.item_code) else: @@ -64,7 +64,7 @@ class SalesOrder(SellingController): # used for production plan d.transaction_date = self.transaction_date - + tot_avail_qty = frappe.db.sql("select projected_qty from `tabBin` \ where item_code = %s and warehouse = %s", (d.item_code,d.warehouse)) d.projected_qty = tot_avail_qty and flt(tot_avail_qty[0][0]) or 0 @@ -79,26 +79,26 @@ class SalesOrder(SellingController): def validate_order_type(self): super(SalesOrder, self).validate_order_type() - + def validate_delivery_date(self): if self.order_type == 'Sales' and not self.delivery_date: msgprint("Please enter 'Expected Delivery Date'") raise Exception - + self.validate_sales_mntc_quotation() def validate_proj_cust(self): if self.project_name and self.customer_name: - res = frappe.db.sql("""select name from `tabProject` where name = %s - and (customer = %s or ifnull(customer,'')='')""", + res = frappe.db.sql("""select name from `tabProject` where name = %s + and (customer = %s or ifnull(customer,'')='')""", (self.project_name, self.customer)) if not res: msgprint("Customer - %s does not belong to project - %s. \n\nIf you want to use project for multiple customers then please make customer details blank in project - %s."%(self.customer,self.project_name,self.project_name)) raise Exception - + def validate(self): super(SalesOrder, self).validate() - + self.validate_order_type() self.validate_delivery_date() self.validate_mandatory() @@ -111,28 +111,28 @@ class SalesOrder(SellingController): from erpnext.stock.doctype.packed_item.packed_item import make_packing_list make_packing_list(self,'sales_order_details') - + self.validate_with_previous_doc() - + if not self.status: self.status = "Draft" from erpnext.utilities import validate_status - validate_status(self.status, ["Draft", "Submitted", "Stopped", + validate_status(self.status, ["Draft", "Submitted", "Stopped", "Cancelled"]) if not self.billing_status: self.billing_status = 'Not Billed' - if not self.delivery_status: self.delivery_status = 'Not Delivered' - + if not self.delivery_status: self.delivery_status = 'Not Delivered' + def validate_warehouse(self): from erpnext.stock.utils import validate_warehouse_company - - warehouses = list(set([d.warehouse for d in + + warehouses = list(set([d.warehouse for d in self.get(self.fname) if d.warehouse])) - + for w in warehouses: validate_warehouse_company(w, self.company) - + def validate_with_previous_doc(self): super(SalesOrder, self).validate_with_previous_doc(self.tname, { "Quotation": { @@ -141,31 +141,31 @@ class SalesOrder(SellingController): } }) - + def update_enquiry_status(self, prevdoc, flag): enq = frappe.db.sql("select t2.prevdoc_docname from `tabQuotation` t1, `tabQuotation Item` t2 where t2.parent = t1.name and t1.name=%s", prevdoc) if enq: frappe.db.sql("update `tabOpportunity` set status = %s where name=%s",(flag,enq[0][0])) - def update_prevdoc_status(self, flag): + def update_prevdoc_status(self, flag): for quotation in list(set([d.prevdoc_docname for d in self.get(self.fname)])): if quotation: doc = frappe.get_doc("Quotation", quotation) if doc.docstatus==2: frappe.throw(quotation + ": " + frappe._("Quotation is cancelled.")) - + doc.set_status(update=True) def on_submit(self): self.update_stock_ledger(update_stock = 1) self.check_credit(self.grand_total) - + frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype, self.grand_total, self) - + self.update_prevdoc_status('submit') frappe.db.set(self, 'status', 'Submitted') - + def on_cancel(self): # Cannot cancel stopped SO if self.status == 'Stopped': @@ -173,45 +173,45 @@ class SalesOrder(SellingController): raise Exception self.check_nextdoc_docstatus() self.update_stock_ledger(update_stock = -1) - + self.update_prevdoc_status('cancel') - + frappe.db.set(self, 'status', 'Cancelled') - + def check_nextdoc_docstatus(self): # Checks Delivery Note submit_dn = frappe.db.sql("select t1.name from `tabDelivery Note` t1,`tabDelivery Note Item` t2 where t1.name = t2.parent and t2.against_sales_order = %s and t1.docstatus = 1", self.name) if submit_dn: msgprint("Delivery Note : " + cstr(submit_dn[0][0]) + " has been submitted against " + cstr(self.doctype) + ". Please cancel Delivery Note : " + cstr(submit_dn[0][0]) + " first and then cancel "+ cstr(self.doctype), raise_exception = 1) - + # Checks Sales Invoice - submit_rv = frappe.db.sql("""select t1.name - from `tabSales Invoice` t1,`tabSales Invoice Item` t2 - where t1.name = t2.parent and t2.sales_order = %s and t1.docstatus = 1""", + submit_rv = frappe.db.sql("""select t1.name + from `tabSales Invoice` t1,`tabSales Invoice Item` t2 + where t1.name = t2.parent and t2.sales_order = %s and t1.docstatus = 1""", self.name) if submit_rv: msgprint("Sales Invoice : " + cstr(submit_rv[0][0]) + " has already been submitted against " +cstr(self.doctype)+ ". Please cancel Sales Invoice : "+ cstr(submit_rv[0][0]) + " first and then cancel "+ cstr(self.doctype), raise_exception = 1) - + #check maintenance schedule submit_ms = frappe.db.sql("select t1.name from `tabMaintenance Schedule` t1, `tabMaintenance Schedule Item` t2 where t2.parent=t1.name and t2.prevdoc_docname = %s and t1.docstatus = 1",self.name) if submit_ms: msgprint("Maintenance Schedule : " + cstr(submit_ms[0][0]) + " has already been submitted against " +cstr(self.doctype)+ ". Please cancel Maintenance Schedule : "+ cstr(submit_ms[0][0]) + " first and then cancel "+ cstr(self.doctype), raise_exception = 1) - + # check maintenance visit submit_mv = frappe.db.sql("select t1.name from `tabMaintenance Visit` t1, `tabMaintenance Visit Purpose` t2 where t2.parent=t1.name and t2.prevdoc_docname = %s and t1.docstatus = 1",self.name) if submit_mv: msgprint("Maintenance Visit : " + cstr(submit_mv[0][0]) + " has already been submitted against " +cstr(self.doctype)+ ". Please cancel Maintenance Visit : " + cstr(submit_mv[0][0]) + " first and then cancel "+ cstr(self.doctype), raise_exception = 1) - + # check production order pro_order = frappe.db.sql("""select name from `tabProduction Order` where sales_order = %s and docstatus = 1""", self.name) if pro_order: - msgprint("""Production Order: %s exists against this sales order. - Please cancel production order first and then cancel this sales order""" % + msgprint("""Production Order: %s exists against this sales order. + Please cancel production order first and then cancel this sales order""" % pro_order[0][0], raise_exception=1) def check_modified_date(self): mod_db = frappe.db.get_value("Sales Order", self.name, "modified") - date_diff = frappe.db.sql("select TIMEDIFF('%s', '%s')" % + date_diff = frappe.db.sql("select TIMEDIFF('%s', '%s')" % ( mod_db, cstr(self.modified))) if date_diff and date_diff[0][0]: msgprint("%s: %s has been modified after you have opened. Please Refresh" @@ -221,7 +221,7 @@ class SalesOrder(SellingController): self.check_modified_date() self.update_stock_ledger(-1) frappe.db.set(self, 'status', 'Stopped') - msgprint("""%s: %s has been Stopped. To make transactions against this Sales Order + msgprint("""%s: %s has been Stopped. To make transactions against this Sales Order you need to Unstop it.""" % (self.doctype, self.name)) def unstop_sales_order(self): @@ -237,7 +237,7 @@ class SalesOrder(SellingController): if frappe.db.get_value("Item", d['item_code'], "is_stock_item") == "Yes": args = { "item_code": d['item_code'], - "warehouse": d['reserved_warehouse'], + "warehouse": d['reserved_warehouse'], "reserved_qty": flt(update_stock) * flt(d['reserved_qty']), "posting_date": self.transaction_date, "voucher_type": self.doctype, @@ -248,76 +248,76 @@ class SalesOrder(SellingController): def on_update(self): pass - + def get_portal_page(self): return "order" if self.docstatus==1 else None - + def set_missing_values(source, target): doc = frappe.get_doc(target) doc.run_method("onload_post_render") - + @frappe.whitelist() -def make_material_request(source_name, target_doc=None): - def postprocess(source, doclist): - doclist[0].material_request_type = "Purchase" - - doclist = get_mapped_doc("Sales Order", source_name, { +def make_material_request(source_name, target_doc=None): + def postprocess(source, doc): + doc.material_request_type = "Purchase" + + doc = get_mapped_doc("Sales Order", source_name, { "Sales Order": { - "doctype": "Material Request", + "doctype": "Material Request", "validation": { "docstatus": ["=", 1] } - }, + }, "Sales Order Item": { - "doctype": "Material Request Item", + "doctype": "Material Request Item", "field_map": { - "parent": "sales_order_no", + "parent": "sales_order_no", "stock_uom": "uom" } } }, target_doc, postprocess) - - return doclist + + return doc @frappe.whitelist() -def make_delivery_note(source_name, target_doc=None): +def make_delivery_note(source_name, target_doc=None): def update_item(obj, target, source_parent): target.base_amount = (flt(obj.qty) - flt(obj.delivered_qty)) * flt(obj.base_rate) target.amount = (flt(obj.qty) - flt(obj.delivered_qty)) * flt(obj.rate) target.qty = flt(obj.qty) - flt(obj.delivered_qty) - + doclist = get_mapped_doc("Sales Order", source_name, { "Sales Order": { - "doctype": "Delivery Note", + "doctype": "Delivery Note", "field_map": { - "shipping_address": "address_display", - "shipping_address_name": "customer_address", + "shipping_address": "address_display", + "shipping_address_name": "customer_address", }, "validation": { "docstatus": ["=", 1] } - }, + }, "Sales Order Item": { - "doctype": "Delivery Note Item", + "doctype": "Delivery Note Item", "field_map": { - "rate": "rate", - "name": "prevdoc_detail_docname", - "parent": "against_sales_order", + "rate": "rate", + "name": "prevdoc_detail_docname", + "parent": "against_sales_order", }, "postprocess": update_item, "condition": lambda doc: doc.delivered_qty < doc.qty - }, + }, "Sales Taxes and Charges": { - "doctype": "Sales Taxes and Charges", + "doctype": "Sales Taxes and Charges", "add_if_empty": True - }, + }, "Sales Team": { "doctype": "Sales Team", "add_if_empty": True } }, target_doc, set_missing_values) - - return doclist.as_dict() + + return doclist @frappe.whitelist() def make_sales_invoice(source_name, target_doc=None): @@ -325,94 +325,94 @@ def make_sales_invoice(source_name, target_doc=None): doc = frappe.get_doc(target) doc.is_pos = 0 doc.run_method("onload_post_render") - + def update_item(obj, target, source_parent): target.amount = flt(obj.amount) - flt(obj.billed_amt) target.base_amount = target.amount * flt(source_parent.conversion_rate) target.qty = obj.rate and target.amount / flt(obj.rate) or obj.qty - + doclist = get_mapped_doc("Sales Order", source_name, { "Sales Order": { - "doctype": "Sales Invoice", + "doctype": "Sales Invoice", "validation": { "docstatus": ["=", 1] } - }, + }, "Sales Order Item": { - "doctype": "Sales Invoice Item", + "doctype": "Sales Invoice Item", "field_map": { - "name": "so_detail", - "parent": "sales_order", + "name": "so_detail", + "parent": "sales_order", }, "postprocess": update_item, "condition": lambda doc: doc.base_amount==0 or doc.billed_amt < doc.amount - }, + }, "Sales Taxes and Charges": { - "doctype": "Sales Taxes and Charges", + "doctype": "Sales Taxes and Charges", "add_if_empty": True - }, + }, "Sales Team": { - "doctype": "Sales Team", + "doctype": "Sales Team", "add_if_empty": True } }, target_doc, set_missing_values) - - return doclist.as_dict() - + + return doclist + @frappe.whitelist() def make_maintenance_schedule(source_name, target_doc=None): - maint_schedule = frappe.db.sql("""select t1.name - from `tabMaintenance Schedule` t1, `tabMaintenance Schedule Item` t2 + maint_schedule = frappe.db.sql("""select t1.name + from `tabMaintenance Schedule` t1, `tabMaintenance Schedule Item` t2 where t2.parent=t1.name and t2.prevdoc_docname=%s and t1.docstatus=1""", source_name) - + if not maint_schedule: doclist = get_mapped_doc("Sales Order", source_name, { "Sales Order": { - "doctype": "Maintenance Schedule", + "doctype": "Maintenance Schedule", "field_map": { "name": "sales_order_no" - }, + }, "validation": { "docstatus": ["=", 1] } - }, + }, "Sales Order Item": { - "doctype": "Maintenance Schedule Item", + "doctype": "Maintenance Schedule Item", "field_map": { "parent": "prevdoc_docname" }, "add_if_empty": True } }, target_doc) - - return doclist.as_dict() - + + return doclist + @frappe.whitelist() def make_maintenance_visit(source_name, target_doc=None): - visit = frappe.db.sql("""select t1.name - from `tabMaintenance Visit` t1, `tabMaintenance Visit Purpose` t2 - where t2.parent=t1.name and t2.prevdoc_docname=%s + visit = frappe.db.sql("""select t1.name + from `tabMaintenance Visit` t1, `tabMaintenance Visit Purpose` t2 + where t2.parent=t1.name and t2.prevdoc_docname=%s and t1.docstatus=1 and t1.completion_status='Fully Completed'""", source_name) - + if not visit: doclist = get_mapped_doc("Sales Order", source_name, { "Sales Order": { - "doctype": "Maintenance Visit", + "doctype": "Maintenance Visit", "field_map": { "name": "sales_order_no" }, "validation": { "docstatus": ["=", 1] } - }, + }, "Sales Order Item": { - "doctype": "Maintenance Visit Purpose", + "doctype": "Maintenance Visit Purpose", "field_map": { - "parent": "prevdoc_docname", + "parent": "prevdoc_docname", "parenttype": "prevdoc_doctype" }, "add_if_empty": True } }, target_doc) - - return doclist.as_dict() + + return doclist diff --git a/erpnext/selling/doctype/sales_order/test_sales_order.py b/erpnext/selling/doctype/sales_order/test_sales_order.py index af52028461..b41027bcfd 100644 --- a/erpnext/selling/doctype/sales_order/test_sales_order.py +++ b/erpnext/selling/doctype/sales_order/test_sales_order.py @@ -4,82 +4,82 @@ import frappe from frappe.utils import flt import unittest +import copy class TestSalesOrder(unittest.TestCase): def tearDown(self): frappe.set_user("Administrator") - + def test_make_material_request(self): from erpnext.selling.doctype.sales_order.sales_order import make_material_request - + so = frappe.copy_doc(test_records[0]).insert() - - self.assertRaises(frappe.ValidationError, make_material_request, + + self.assertRaises(frappe.ValidationError, make_material_request, so.name) sales_order = frappe.get_doc("Sales Order", so.name) sales_order.submit() mr = make_material_request(so.name) - - self.assertEquals(mr[0]["material_request_type"], "Purchase") - self.assertEquals(len(mr), len(sales_order)) + + self.assertEquals(mr.material_request_type, "Purchase") + self.assertEquals(len(mr.get("indent_details")), len(sales_order.get("sales_order_details"))) def test_make_delivery_note(self): from erpnext.selling.doctype.sales_order.sales_order import make_delivery_note so = frappe.copy_doc(test_records[0]).insert() - self.assertRaises(frappe.ValidationError, make_delivery_note, + self.assertRaises(frappe.ValidationError, make_delivery_note, so.name) sales_order = frappe.get_doc("Sales Order", so.name) sales_order.submit() dn = make_delivery_note(so.name) - - self.assertEquals(dn[0]["doctype"], "Delivery Note") - self.assertEquals(len(dn), len(sales_order)) + + self.assertEquals(dn.doctype, "Delivery Note") + self.assertEquals(len(dn.get("delivery_note_details")), len(sales_order.get("sales_order_details"))) def test_make_sales_invoice(self): from erpnext.selling.doctype.sales_order.sales_order import make_sales_invoice so = frappe.copy_doc(test_records[0]).insert() - self.assertRaises(frappe.ValidationError, make_sales_invoice, + self.assertRaises(frappe.ValidationError, make_sales_invoice, so.name) sales_order = frappe.get_doc("Sales Order", so.name) sales_order.submit() si = make_sales_invoice(so.name) - - self.assertEquals(si[0]["doctype"], "Sales Invoice") - self.assertEquals(len(si), len(sales_order)) - self.assertEquals(len([d for d in si if d["doctype"]=="Sales Invoice Item"]), 1) - - si = frappe.get_doc(si) + + self.assertEquals(si.doctype, "Sales Invoice") + self.assertEquals(len(si.get("entries")), len(sales_order.get("sales_order_details"))) + self.assertEquals(len(si.get("entries")), 1) + si.posting_date = "2013-10-10" si.insert() si.submit() si1 = make_sales_invoice(so.name) - self.assertEquals(len([d for d in si1 if d["doctype"]=="Sales Invoice Item"]), 0) - + self.assertEquals(len(si1.get("entries")), 0) + def create_so(self, so_doc = None): if not so_doc: so_doc = test_records[0] - + w = frappe.copy_doc(so_doc) w.insert() w.submit() return w - + def create_dn_against_so(self, so, delivered_qty=0): from erpnext.stock.doctype.delivery_note.test_delivery_note import test_records as dn_test_records from erpnext.stock.doctype.delivery_note.test_delivery_note import _insert_purchase_receipt _insert_purchase_receipt(so.get("sales_order_details")[0].item_code) - + dn = frappe.get_doc(frappe.copy_doc(dn_test_records[0])) dn.get("delivery_note_details")[0].item_code = so.get("sales_order_details")[0].item_code dn.get("delivery_note_details")[0].against_sales_order = so.name @@ -89,76 +89,79 @@ class TestSalesOrder(unittest.TestCase): dn.insert() dn.submit() return dn - + def get_bin_reserved_qty(self, item_code, warehouse): - return flt(frappe.db.get_value("Bin", {"item_code": item_code, "warehouse": warehouse}, + return flt(frappe.db.get_value("Bin", {"item_code": item_code, "warehouse": warehouse}, "reserved_qty")) - + def delete_bin(self, item_code, warehouse): - bin = frappe.db.exists({"doctype": "Bin", "item_code": item_code, + bin = frappe.db.exists({"doctype": "Bin", "item_code": item_code, "warehouse": warehouse}) if bin: frappe.delete_doc("Bin", bin[0][0]) - + def check_reserved_qty(self, item_code, warehouse, qty): bin_reserved_qty = self.get_bin_reserved_qty(item_code, warehouse) self.assertEqual(bin_reserved_qty, qty) - + def test_reserved_qty_for_so(self): # reset bin - self.delete_bin(test_records[0][1]["item_code"], test_records[0][1]["warehouse"]) - + so_item = test_records[0]["sales_order_details"][0] + self.delete_bin(so_item["item_code"], so_item["warehouse"]) + # submit so = self.create_so() self.check_reserved_qty(so.get("sales_order_details")[0].item_code, so.get("sales_order_details")[0].warehouse, 10.0) - + # cancel so.cancel() self.check_reserved_qty(so.get("sales_order_details")[0].item_code, so.get("sales_order_details")[0].warehouse, 0.0) - - + + def test_reserved_qty_for_partial_delivery(self): # reset bin - self.delete_bin(test_records[0][1]["item_code"], test_records[0][1]["warehouse"]) - + so_item = test_records[0]["sales_order_details"][0] + self.delete_bin(so_item["item_code"], so_item["warehouse"]) + # submit so so = self.create_so() - + # allow negative stock frappe.db.set_default("allow_negative_stock", 1) - + # submit dn dn = self.create_dn_against_so(so) - + self.check_reserved_qty(so.get("sales_order_details")[0].item_code, so.get("sales_order_details")[0].warehouse, 5.0) - + # stop so so.load_from_db() - so.obj.stop_sales_order() + so.stop_sales_order() self.check_reserved_qty(so.get("sales_order_details")[0].item_code, so.get("sales_order_details")[0].warehouse, 0.0) - + # unstop so so.load_from_db() - so.obj.unstop_sales_order() + so.unstop_sales_order() self.check_reserved_qty(so.get("sales_order_details")[0].item_code, so.get("sales_order_details")[0].warehouse, 5.0) - + # cancel dn dn.cancel() self.check_reserved_qty(so.get("sales_order_details")[0].item_code, so.get("sales_order_details")[0].warehouse, 10.0) - + def test_reserved_qty_for_over_delivery(self): # reset bin - self.delete_bin(test_records[0][1]["item_code"], test_records[0][1]["warehouse"]) - + so_item = test_records[0]["sales_order_details"][0] + self.delete_bin(so_item["item_code"], so_item["warehouse"]) + # submit so so = self.create_so() - + # allow negative stock frappe.db.set_default("allow_negative_stock", 1) - + # set over-delivery tolerance frappe.db.set_value('Item', so.get("sales_order_details")[0].item_code, 'tolerance', 50) - + # submit dn dn = self.create_dn_against_so(so, 15) self.check_reserved_qty(so.get("sales_order_details")[0].item_code, so.get("sales_order_details")[0].warehouse, 0.0) @@ -166,127 +169,127 @@ class TestSalesOrder(unittest.TestCase): # cancel dn dn.cancel() self.check_reserved_qty(so.get("sales_order_details")[0].item_code, so.get("sales_order_details")[0].warehouse, 10.0) - + def test_reserved_qty_for_so_with_packing_list(self): from erpnext.selling.doctype.sales_bom.test_sales_bom import test_records as sbom_test_records - + # change item in test so record - test_record = test_records[0][:] - test_record[1]["item_code"] = "_Test Sales BOM Item" - + test_record = copy.deepcopy(test_records[0]) + test_record["sales_order_details"][0]["item_code"] = "_Test Sales BOM Item" + # reset bin - self.delete_bin(sbom_test_records[0][1]["item_code"], test_record[1]["warehouse"]) - self.delete_bin(sbom_test_records[0][2]["item_code"], test_record[1]["warehouse"]) - + self.delete_bin(sbom_test_records[0]["sales_bom_items"][0]["item_code"], test_record.get("sales_order_details")[0]["warehouse"]) + self.delete_bin(sbom_test_records[0]["sales_bom_items"][1]["item_code"], test_record.get("sales_order_details")[0]["warehouse"]) + # submit so = self.create_so(test_record) - - - self.check_reserved_qty(sbom_test_records[0][1]["item_code"], + + + self.check_reserved_qty(sbom_test_records[0]["sales_bom_items"][0]["item_code"], so.get("sales_order_details")[0].warehouse, 50.0) - self.check_reserved_qty(sbom_test_records[0][2]["item_code"], + self.check_reserved_qty(sbom_test_records[0]["sales_bom_items"][1]["item_code"], so.get("sales_order_details")[0].warehouse, 20.0) - + # cancel so.cancel() - self.check_reserved_qty(sbom_test_records[0][1]["item_code"], + self.check_reserved_qty(sbom_test_records[0]["sales_bom_items"][0]["item_code"], so.get("sales_order_details")[0].warehouse, 0.0) - self.check_reserved_qty(sbom_test_records[0][2]["item_code"], + self.check_reserved_qty(sbom_test_records[0]["sales_bom_items"][1]["item_code"], so.get("sales_order_details")[0].warehouse, 0.0) - + def test_reserved_qty_for_partial_delivery_with_packing_list(self): from erpnext.selling.doctype.sales_bom.test_sales_bom import test_records as sbom_test_records - + # change item in test so record - + test_record = frappe.copy_doc(test_records[0]) - test_record[1]["item_code"] = "_Test Sales BOM Item" + test_record.get("sales_order_details")[0].item_code = "_Test Sales BOM Item" # reset bin - self.delete_bin(sbom_test_records[0][1]["item_code"], test_record[1]["warehouse"]) - self.delete_bin(sbom_test_records[0][2]["item_code"], test_record[1]["warehouse"]) - + self.delete_bin(sbom_test_records[0]["sales_bom_items"][0]["item_code"], test_record.get("sales_order_details")[0].warehouse) + self.delete_bin(sbom_test_records[0]["sales_bom_items"][1]["item_code"], test_record.get("sales_order_details")[0].warehouse) + # submit so = self.create_so(test_record) - + # allow negative stock frappe.db.set_default("allow_negative_stock", 1) - + # submit dn dn = self.create_dn_against_so(so) - - self.check_reserved_qty(sbom_test_records[0][1]["item_code"], + + self.check_reserved_qty(sbom_test_records[0]["sales_bom_items"][0]["item_code"], so.get("sales_order_details")[0].warehouse, 25.0) - self.check_reserved_qty(sbom_test_records[0][2]["item_code"], + self.check_reserved_qty(sbom_test_records[0]["sales_bom_items"][1]["item_code"], so.get("sales_order_details")[0].warehouse, 10.0) - + # stop so so.load_from_db() - so.obj.stop_sales_order() - - self.check_reserved_qty(sbom_test_records[0][1]["item_code"], + so.stop_sales_order() + + self.check_reserved_qty(sbom_test_records[0]["sales_bom_items"][0]["item_code"], so.get("sales_order_details")[0].warehouse, 0.0) - self.check_reserved_qty(sbom_test_records[0][2]["item_code"], + self.check_reserved_qty(sbom_test_records[0]["sales_bom_items"][1]["item_code"], so.get("sales_order_details")[0].warehouse, 0.0) - + # unstop so so.load_from_db() - so.obj.unstop_sales_order() - self.check_reserved_qty(sbom_test_records[0][1]["item_code"], + so.unstop_sales_order() + self.check_reserved_qty(sbom_test_records[0]["sales_bom_items"][0]["item_code"], so.get("sales_order_details")[0].warehouse, 25.0) - self.check_reserved_qty(sbom_test_records[0][2]["item_code"], + self.check_reserved_qty(sbom_test_records[0]["sales_bom_items"][1]["item_code"], so.get("sales_order_details")[0].warehouse, 10.0) - + # cancel dn dn.cancel() - self.check_reserved_qty(sbom_test_records[0][1]["item_code"], + self.check_reserved_qty(sbom_test_records[0]["sales_bom_items"][0]["item_code"], so.get("sales_order_details")[0].warehouse, 50.0) - self.check_reserved_qty(sbom_test_records[0][2]["item_code"], + self.check_reserved_qty(sbom_test_records[0]["sales_bom_items"][1]["item_code"], so.get("sales_order_details")[0].warehouse, 20.0) - + def test_reserved_qty_for_over_delivery_with_packing_list(self): from erpnext.selling.doctype.sales_bom.test_sales_bom import test_records as sbom_test_records - + # change item in test so record test_record = frappe.copy_doc(test_records[0]) - test_record[1]["item_code"] = "_Test Sales BOM Item" + test_record.get("sales_order_details")[0].item_code = "_Test Sales BOM Item" # reset bin - self.delete_bin(sbom_test_records[0][1]["item_code"], test_record[1]["warehouse"]) - self.delete_bin(sbom_test_records[0][2]["item_code"], test_record[1]["warehouse"]) - + self.delete_bin(sbom_test_records[0]["sales_bom_items"][0]["item_code"], test_record.get("sales_order_details")[0].warehouse) + self.delete_bin(sbom_test_records[0]["sales_bom_items"][1]["item_code"], test_record.get("sales_order_details")[0].warehouse) + # submit so = self.create_so(test_record) - + # allow negative stock frappe.db.set_default("allow_negative_stock", 1) - + # set over-delivery tolerance frappe.db.set_value('Item', so.get("sales_order_details")[0].item_code, 'tolerance', 50) - + # submit dn dn = self.create_dn_against_so(so, 15) - - self.check_reserved_qty(sbom_test_records[0][1]["item_code"], + + self.check_reserved_qty(sbom_test_records[0]["sales_bom_items"][0]["item_code"], so.get("sales_order_details")[0].warehouse, 0.0) - self.check_reserved_qty(sbom_test_records[0][2]["item_code"], + self.check_reserved_qty(sbom_test_records[0]["sales_bom_items"][1]["item_code"], so.get("sales_order_details")[0].warehouse, 0.0) # cancel dn dn.cancel() - self.check_reserved_qty(sbom_test_records[0][1]["item_code"], + self.check_reserved_qty(sbom_test_records[0]["sales_bom_items"][0]["item_code"], so.get("sales_order_details")[0].warehouse, 50.0) - self.check_reserved_qty(sbom_test_records[0][2]["item_code"], + self.check_reserved_qty(sbom_test_records[0]["sales_bom_items"][1]["item_code"], so.get("sales_order_details")[0].warehouse, 20.0) def test_warehouse_user(self): frappe.defaults.add_default("Warehouse", "_Test Warehouse 1 - _TC1", "test@example.com", "Restriction") frappe.get_doc("User", "test@example.com")\ .add_roles("Sales User", "Sales Manager", "Material User", "Material Manager") - + frappe.get_doc("User", "test2@example.com")\ .add_roles("Sales User", "Sales Manager", "Material User", "Material Manager") - + frappe.set_user("test@example.com") so = frappe.copy_doc(test_records[0]) @@ -298,9 +301,9 @@ class TestSalesOrder(unittest.TestCase): frappe.set_user("test2@example.com") so.insert() - + frappe.defaults.clear_default("Warehouse", "_Test Warehouse 1 - _TC1", "test@example.com", parenttype="Restriction") test_dependencies = ["Sales BOM", "Currency Exchange"] - -test_records = frappe.get_test_records('Sales Order') \ No newline at end of file + +test_records = frappe.get_test_records('Sales Order') diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index 347b1f4d81..ba1509fb5d 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -28,21 +28,21 @@ class DeliveryNote(SellingController): 'status_field': 'delivery_status', 'keyword': 'Delivered' }] - + def onload(self): billed_qty = frappe.db.sql("""select sum(ifnull(qty, 0)) from `tabSales Invoice Item` where docstatus=1 and delivery_note=%s""", self.name) if billed_qty: total_qty = sum((item.qty for item in self.get("delivery_note_details"))) self.set("__billing_complete", billed_qty[0][0] == total_qty) - + def get_portal_page(self): return "shipment" if self.docstatus==1 else None def set_actual_qty(self): for d in self.get('delivery_note_details'): if d.item_code and d.warehouse: - actual_qty = frappe.db.sql("""select actual_qty from `tabBin` + actual_qty = frappe.db.sql("""select actual_qty from `tabBin` where item_code = %s and warehouse = %s""", (d.item_code, d.warehouse)) d.actual_qty = actual_qty and flt(actual_qty[0][0]) or 0 @@ -57,7 +57,7 @@ class DeliveryNote(SellingController): def validate(self): super(DeliveryNote, self).validate() - + from erpnext.utilities import validate_status validate_status(self.status, ["Draft", "Submitted", "Cancelled"]) @@ -67,18 +67,18 @@ class DeliveryNote(SellingController): self.validate_for_items() self.validate_warehouse() self.validate_uom_is_integer("stock_uom", "qty") - self.update_current_stock() + self.update_current_stock() self.validate_with_previous_doc() - + from erpnext.stock.doctype.packed_item.packed_item import make_packing_list make_packing_list(self, 'delivery_note_details') - + self.status = 'Draft' - if not self.installation_status: self.installation_status = 'Not Installed' - + if not self.installation_status: self.installation_status = 'Not Installed' + def validate_with_previous_doc(self): items = self.get("delivery_note_details") - + for fn in (("Sales Order", "against_sales_order"), ("Sales Invoice", "against_sales_invoice")): if filter(None, [getattr(d, fn[1], None) for d in items]): super(DeliveryNote, self).validate_with_previous_doc(self.tname, { @@ -97,12 +97,12 @@ class DeliveryNote(SellingController): "is_child_table": True } }) - + def validate_proj_cust(self): """check for does customer belong to same project as entered..""" if self.project_name and self.customer: - res = frappe.db.sql("""select name from `tabProject` - where name = %s and (customer = %s or + res = frappe.db.sql("""select name from `tabProject` + where name = %s and (customer = %s or ifnull(customer,'')='')""", (self.project_name, self.customer)) if not res: msgprint("Customer - %s does not belong to project - %s. \n\nIf you want to use project for multiple customers then please make customer details blank in project - %s."%(self.customer,self.project_name,self.project_name)) @@ -116,13 +116,13 @@ class DeliveryNote(SellingController): if frappe.db.get_value("Item", d.item_code, "is_stock_item") == 'Yes': if e in check_list: - msgprint("Please check whether item %s has been entered twice wrongly." + msgprint("Please check whether item %s has been entered twice wrongly." % d.item_code) else: check_list.append(e) else: if f in chk_dupl_itm: - msgprint("Please check whether item %s has been entered twice wrongly." + msgprint("Please check whether item %s has been entered twice wrongly." % d.item_code) else: chk_dupl_itm.append(f) @@ -133,7 +133,7 @@ class DeliveryNote(SellingController): if not d['warehouse']: msgprint("Please enter Warehouse for item %s as it is stock item" % d['item_code'], raise_exception=1) - + def update_current_stock(self): for d in self.get('delivery_note_details'): @@ -150,15 +150,15 @@ class DeliveryNote(SellingController): # Check for Approving Authority frappe.get_doc('Authorization Control').validate_approving_authority(self.doctype, self.company, self.grand_total, self) - - # update delivered qty in sales order + + # update delivered qty in sales order self.update_prevdoc_status() - + # create stock ledger entry self.update_stock_ledger() self.credit_limit() - + self.make_gl_entries() # set DN status @@ -168,14 +168,14 @@ class DeliveryNote(SellingController): def on_cancel(self): self.check_stop_sales_order("against_sales_order") self.check_next_docstatus() - + self.update_prevdoc_status() - + self.update_stock_ledger() frappe.db.set(self, 'status', 'Cancelled') self.cancel_packing_slips() - + self.make_cancel_gl_entries() def validate_packed_qty(self): @@ -198,17 +198,17 @@ class DeliveryNote(SellingController): frappe.msgprint("Packing Error:\n" + err_msg, raise_exception=1) def check_next_docstatus(self): - submit_rv = frappe.db.sql("""select t1.name - from `tabSales Invoice` t1,`tabSales Invoice Item` t2 - where t1.name = t2.parent and t2.delivery_note = %s and t1.docstatus = 1""", + submit_rv = frappe.db.sql("""select t1.name + from `tabSales Invoice` t1,`tabSales Invoice Item` t2 + where t1.name = t2.parent and t2.delivery_note = %s and t1.docstatus = 1""", (self.name)) if submit_rv: msgprint("Sales Invoice : " + cstr(submit_rv[0][0]) + " has already been submitted !") raise Exception , "Validation Error." - submit_in = frappe.db.sql("""select t1.name - from `tabInstallation Note` t1, `tabInstallation Note Item` t2 - where t1.name = t2.parent and t2.prevdoc_docname = %s and t1.docstatus = 1""", + submit_in = frappe.db.sql("""select t1.name + from `tabInstallation Note` t1, `tabInstallation Note Item` t2 + where t1.name = t2.parent and t2.prevdoc_docname = %s and t1.docstatus = 1""", (self.name)) if submit_in: msgprint("Installation Note : "+cstr(submit_in[0][0]) +" has already been submitted !") @@ -218,7 +218,7 @@ class DeliveryNote(SellingController): """ Cancel submitted packing slips related to this delivery note """ - res = frappe.db.sql("""SELECT name FROM `tabPacking Slip` WHERE delivery_note = %s + res = frappe.db.sql("""SELECT name FROM `tabPacking Slip` WHERE delivery_note = %s AND docstatus = 1""", self.name) if res: @@ -234,19 +234,19 @@ class DeliveryNote(SellingController): if frappe.db.get_value("Item", d.item_code, "is_stock_item") == "Yes" \ and d.warehouse: self.update_reserved_qty(d) - + sl_entries.append(self.get_sl_entries(d, { "actual_qty": -1*flt(d['qty']), })) - + self.make_sl_entries(sl_entries) - + def update_reserved_qty(self, d): if d['reserved_qty'] < 0 : # Reduce reserved qty from reserved warehouse mentioned in so if not d["reserved_warehouse"]: frappe.throw(_("Reserved Warehouse is missing in Sales Order")) - + args = { "item_code": d['item_code'], "warehouse": d["reserved_warehouse"], @@ -271,88 +271,88 @@ class DeliveryNote(SellingController): def get_invoiced_qty_map(delivery_note): """returns a map: {dn_detail: invoiced_qty}""" invoiced_qty_map = {} - + for dn_detail, qty in frappe.db.sql("""select dn_detail, qty from `tabSales Invoice Item` where delivery_note=%s and docstatus=1""", delivery_note): if not invoiced_qty_map.get(dn_detail): invoiced_qty_map[dn_detail] = 0 invoiced_qty_map[dn_detail] += qty - + return invoiced_qty_map @frappe.whitelist() def make_sales_invoice(source_name, target_doc=None): invoiced_qty_map = get_invoiced_qty_map(source_name) - + def update_accounts(source, target): si = frappe.get_doc(target) si.is_pos = 0 si.run_method("onload_post_render") - + if len(si.get("entries")) == 0: frappe.msgprint(_("All these items have already been invoiced."), raise_exception=True) - + def update_item(source_doc, target_doc, source_parent): target_doc.qty = source_doc.qty - invoiced_qty_map.get(source_doc.name, 0) - + doc = get_mapped_doc("Delivery Note", source_name, { "Delivery Note": { - "doctype": "Sales Invoice", + "doctype": "Sales Invoice", "validation": { "docstatus": ["=", 1] } - }, + }, "Delivery Note Item": { - "doctype": "Sales Invoice Item", + "doctype": "Sales Invoice Item", "field_map": { - "name": "dn_detail", - "parent": "delivery_note", - "prevdoc_detail_docname": "so_detail", - "against_sales_order": "sales_order", + "name": "dn_detail", + "parent": "delivery_note", + "prevdoc_detail_docname": "so_detail", + "against_sales_order": "sales_order", "serial_no": "serial_no" }, "postprocess": update_item, - "filter": lambda d: d.qty - invoiced_qty_map.get(d.name, 0)<=0 - }, + "filter": lambda d: d.qty - invoiced_qty_map.get(d.name, 0)<=0 + }, "Sales Taxes and Charges": { - "doctype": "Sales Taxes and Charges", + "doctype": "Sales Taxes and Charges", "add_if_empty": True - }, + }, "Sales Team": { - "doctype": "Sales Team", + "doctype": "Sales Team", "field_map": { "incentives": "incentives" }, "add_if_empty": True } }, target_doc, update_accounts) - - return doc.as_dict() - + + return doc + @frappe.whitelist() def make_installation_note(source_name, target_doc=None): def update_item(obj, target, source_parent): target.qty = flt(obj.qty) - flt(obj.installed_qty) target.serial_no = obj.serial_no - + doclist = get_mapped_doc("Delivery Note", source_name, { "Delivery Note": { - "doctype": "Installation Note", + "doctype": "Installation Note", "validation": { "docstatus": ["=", 1] } - }, + }, "Delivery Note Item": { - "doctype": "Installation Note Item", + "doctype": "Installation Note Item", "field_map": { - "name": "prevdoc_detail_docname", - "parent": "prevdoc_docname", - "parenttype": "prevdoc_doctype", + "name": "prevdoc_detail_docname", + "parent": "prevdoc_docname", + "parenttype": "prevdoc_doctype", }, "postprocess": update_item, "condition": lambda doc: doc.installed_qty < doc.qty } }, target_doc) - return doclist.as_dict() \ No newline at end of file + return doclist diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py index bd14784076..3f67cd2fcc 100644 --- a/erpnext/stock/doctype/material_request/material_request.py +++ b/erpnext/stock/doctype/material_request/material_request.py @@ -245,7 +245,7 @@ def make_purchase_order(source_name, target_doc=None): } }, target_doc, set_missing_values) - return doclist.as_dict() + return doclist @frappe.whitelist() def make_purchase_order_based_on_supplier(source_name, target_doc=None): @@ -325,7 +325,7 @@ def make_supplier_quotation(source_name, target_doc=None): } }, target_doc, set_missing_values) - return doclist.as_dict() + return doclist @frappe.whitelist() def make_stock_entry(source_name, target_doc=None): @@ -361,4 +361,4 @@ def make_stock_entry(source_name, target_doc=None): } }, target_doc, set_missing_values) - return doclist.as_dict() + return doclist diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py index 9a137a1bfd..03250a6263 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py @@ -323,4 +323,4 @@ def make_purchase_invoice(source_name, target_doc=None): } }, target_doc, set_missing_values) - return doclist.as_dict() \ No newline at end of file + return doclist \ No newline at end of file diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index 9a28033912..b6ffb83227 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -234,6 +234,7 @@ class StockEntry(StockController): def validate_finished_goods(self): """validation: finished good quantity should be same as manufacturing quantity""" + import json for d in self.get('mtn_details'): if d.bom_no and flt(d.transfer_qty) != flt(self.fg_completed_qty): msgprint(_("Row #") + " %s: " % d.idx diff --git a/erpnext/support/doctype/customer_issue/customer_issue.py b/erpnext/support/doctype/customer_issue/customer_issue.py index f82488a903..7c6e1b256c 100644 --- a/erpnext/support/doctype/customer_issue/customer_issue.py +++ b/erpnext/support/doctype/customer_issue/customer_issue.py @@ -59,4 +59,4 @@ def make_maintenance_visit(source_name, target_doc=None): } }, target_doc) - return doclist.as_dict() \ No newline at end of file + return doclist \ No newline at end of file diff --git a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py index 7178fa21c3..afc08e8f06 100644 --- a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py +++ b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py @@ -295,4 +295,4 @@ def make_maintenance_visit(source_name, target_doc=None): } }, target_doc) - return doclist.as_dict() \ No newline at end of file + return doclist \ No newline at end of file From 9fd50bcfb631da44bd73f61bd517f52c9c65a056 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 9 Apr 2014 19:20:01 +0530 Subject: [PATCH 40/42] Fixed rest of the test cases frappe/frapp#478 --- .../purchase_invoice/purchase_invoice.py | 25 ++- .../doctype/sales_invoice/sales_invoice.py | 31 +-- .../purchase_common/purchase_common.py | 88 ++++---- .../doctype/purchase_order/purchase_order.py | 32 +-- erpnext/controllers/status_updater.py | 125 ++++++------ erpnext/home/__init__.py | 28 +-- .../installation_note/installation_note.py | 69 ++++--- .../doctype/quotation/test_quotation.py | 6 +- .../doctype/sales_order/sales_order.py | 14 +- .../doctype/sales_order/test_sales_order.py | 6 +- .../setup/doctype/item_group/item_group.py | 25 ++- .../doctype/item_group/test_item_group.py | 99 +++++---- .../doctype/sales_partner/sales_partner.py | 11 +- .../doctype/delivery_note/delivery_note.py | 29 +-- .../delivery_note/test_delivery_note.py | 108 +++++----- erpnext/stock/doctype/item/item.py | 148 +++++++------- .../material_request/material_request.py | 3 +- .../material_request/test_material_request.py | 84 +++++--- .../purchase_receipt/purchase_receipt.py | 132 ++++++------ .../purchase_receipt/test_purchase_receipt.py | 84 ++++---- .../doctype/stock_entry/test_stock_entry.py | 8 +- .../test_stock_reconciliation.py | 190 +++++++++--------- .../doctype/newsletter/test_newsletter.py | 16 +- 23 files changed, 705 insertions(+), 656 deletions(-) diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index e178d03b57..8860a78e27 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -17,17 +17,20 @@ from erpnext.accounts.party import get_party_account, get_due_date class PurchaseInvoice(BuyingController): tname = 'Purchase Invoice Item' fname = 'entries' - status_updater = [{ - 'source_dt': 'Purchase Invoice Item', - 'target_dt': 'Purchase Order Item', - 'join_field': 'po_detail', - 'target_field': 'billed_amt', - 'target_parent_dt': 'Purchase Order', - 'target_parent_field': 'per_billed', - 'target_ref_field': 'amount', - 'source_field': 'amount', - 'percent_join_field': 'purchase_order', - }] + + def __init__(self, arg1, arg2=None): + super(PurchaseInvoice, self).__init__(arg1, arg2) + self.status_updater = [{ + 'source_dt': 'Purchase Invoice Item', + 'target_dt': 'Purchase Order Item', + 'join_field': 'po_detail', + 'target_field': 'billed_amt', + 'target_parent_dt': 'Purchase Order', + 'target_parent_field': 'per_billed', + 'target_ref_field': 'amount', + 'source_field': 'amount', + 'percent_join_field': 'purchase_order', + }] def validate(self): if not self.is_opening: diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 04a9959cfb..fb36484c71 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -20,20 +20,23 @@ from erpnext.controllers.selling_controller import SellingController class SalesInvoice(SellingController): tname = 'Sales Invoice Item' fname = 'entries' - status_updater = [{ - 'source_dt': 'Sales Invoice Item', - 'target_field': 'billed_amt', - 'target_ref_field': 'amount', - 'target_dt': 'Sales Order Item', - 'join_field': 'so_detail', - 'target_parent_dt': 'Sales Order', - 'target_parent_field': 'per_billed', - 'source_field': 'amount', - 'join_field': 'so_detail', - 'percent_join_field': 'sales_order', - 'status_field': 'billing_status', - 'keyword': 'Billed' - }] + + def __init__(self, arg1, arg2=None): + super(SalesInvoice, self).__init__(arg1, arg2) + self.status_updater = [{ + 'source_dt': 'Sales Invoice Item', + 'target_field': 'billed_amt', + 'target_ref_field': 'amount', + 'target_dt': 'Sales Order Item', + 'join_field': 'so_detail', + 'target_parent_dt': 'Sales Order', + 'target_parent_field': 'per_billed', + 'source_field': 'amount', + 'join_field': 'so_detail', + 'percent_join_field': 'sales_order', + 'status_field': 'billing_status', + 'keyword': 'Billed' + }] def validate(self): super(SalesInvoice, self).validate() diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.py b/erpnext/buying/doctype/purchase_common/purchase_common.py index ffbbb45940..6009c1854b 100644 --- a/erpnext/buying/doctype/purchase_common/purchase_common.py +++ b/erpnext/buying/doctype/purchase_common/purchase_common.py @@ -11,13 +11,13 @@ from erpnext.stock.doctype.item.item import get_last_purchase_details from erpnext.controllers.buying_controller import BuyingController class PurchaseCommon(BuyingController): - + def update_last_purchase_rate(self, obj, is_submit): """updates last_purchase_rate in item table for each item""" - + import frappe.utils this_purchase_date = frappe.utils.getdate(obj.get('posting_date') or obj.get('transaction_date')) - + for d in obj.get(obj.fname): # get last purchase details last_purchase_details = get_last_purchase_details(d.item_code, obj.name) @@ -33,19 +33,19 @@ class PurchaseCommon(BuyingController): if flt(d.conversion_factor): last_purchase_rate = flt(d.base_rate) / flt(d.conversion_factor) else: - frappe.throw(_("Row ") + cstr(d.idx) + ": " + + frappe.throw(_("Row ") + cstr(d.idx) + ": " + _("UOM Conversion Factor is mandatory")) # update last purchsae rate if last_purchase_rate: frappe.db.sql("""update `tabItem` set last_purchase_rate = %s where name = %s""", (flt(last_purchase_rate), d.item_code)) - + def get_last_purchase_rate(self, obj): """get last purchase rates for all items""" doc_name = obj.name conversion_rate = flt(obj.get('conversion_rate')) or 1.0 - + for d in obj.get(obj.fname): if d.item_code: last_purchase_details = get_last_purchase_details(d.item_code, doc_name) @@ -59,113 +59,113 @@ class PurchaseCommon(BuyingController): else: # if no last purchase found, reset all values to 0 d.base_price_list_rate = d.base_rate = d.price_list_rate = d.rate = d.discount_percentage = 0 - + item_last_purchase_rate = frappe.db.get_value("Item", d.item_code, "last_purchase_rate") if item_last_purchase_rate: d.base_price_list_rate = d.base_rate = d.price_list_rate \ = d.rate = item_last_purchase_rate - + def validate_for_items(self, obj): check_list, chk_dupl_itm=[],[] for d in obj.get(obj.fname): - # validation for valid qty + # validation for valid qty if flt(d.qty) < 0 or (d.parenttype != 'Purchase Receipt' and not flt(d.qty)): frappe.throw("Please enter valid qty for item %s" % cstr(d.item_code)) - + # udpate with latest quantities - bin = frappe.db.sql("""select projected_qty from `tabBin` where + bin = frappe.db.sql("""select projected_qty from `tabBin` where item_code = %s and warehouse = %s""", (d.item_code, d.warehouse), as_dict=1) - + f_lst ={'projected_qty': bin and flt(bin[0]['projected_qty']) or 0, 'ordered_qty': 0, 'received_qty' : 0} if d.doctype == 'Purchase Receipt Item': f_lst.pop('received_qty') for x in f_lst : if d.meta.get_field(x): d.set(x, f_lst[x]) - - item = frappe.db.sql("""select is_stock_item, is_purchase_item, + + item = frappe.db.sql("""select is_stock_item, is_purchase_item, is_sub_contracted_item, end_of_life from `tabItem` where name=%s""", d.item_code) if not item: frappe.throw("Item %s does not exist in Item Master." % cstr(d.item_code)) - + from erpnext.stock.doctype.item.item import validate_end_of_life validate_end_of_life(d.item_code, item[0][3]) - + # validate stock item if item[0][0]=='Yes' and d.qty and not d.warehouse: frappe.throw("Warehouse is mandatory for %s, since it is a stock item" % d.item_code) - + # validate purchase item if item[0][1] != 'Yes' and item[0][2] != 'Yes': frappe.throw("Item %s is not a purchase item or sub-contracted item. Please check" % (d.item_code)) - + # list criteria that should not repeat if item is stock item - e = [getattr(d, "schedule_date", None), d.item_code, d.description, d.warehouse, d.uom, - d.meta.get_field('prevdoc_docname') and d.prevdoc_docname or d.meta.get_field('sales_order_no') and d.sales_order_no or '', - d.meta.get_field('prevdoc_detail_docname') and d.prevdoc_detail_docname or '', + e = [getattr(d, "schedule_date", None), d.item_code, d.description, d.warehouse, d.uom, + d.meta.get_field('prevdoc_docname') and d.prevdoc_docname or d.meta.get_field('sales_order_no') and d.sales_order_no or '', + d.meta.get_field('prevdoc_detail_docname') and d.prevdoc_detail_docname or '', d.meta.get_field('batch_no') and d.batch_no or ''] - + # if is not stock item f = [getattr(d, "schedule_date", None), d.item_code, d.description] - + ch = frappe.db.sql("""select is_stock_item from `tabItem` where name = %s""", d.item_code) - - if ch and ch[0][0] == 'Yes': + + if ch and ch[0][0] == 'Yes': # check for same items if e in check_list: - frappe.throw("""Item %s has been entered more than once with same description, schedule date, warehouse and uom.\n + frappe.throw("""Item %s has been entered more than once with same description, schedule date, warehouse and uom.\n Please change any of the field value to enter the item twice""" % d.item_code) else: check_list.append(e) - + elif ch and ch[0][0] == 'No': # check for same items if f in chk_dupl_itm: - frappe.throw("""Item %s has been entered more than once with same description, schedule date.\n + frappe.throw("""Item %s has been entered more than once with same description, schedule date.\n Please change any of the field value to enter the item twice.""" % d.item_code) else: chk_dupl_itm.append(f) - + def get_qty(self, curr_doctype, ref_tab_fname, ref_tab_dn, ref_doc_tname, transaction, curr_parent_name): # Get total Quantities of current doctype (eg. PR) except for qty of this transaction #------------------------------ # please check as UOM changes from Material Request - Purchase Order ,so doing following else uom should be same . # i.e. in PO uom is NOS then in PR uom should be NOS # but if in Material Request uom KG it can change in PO - + get_qty = (transaction == 'Material Request - Purchase Order') and 'qty * conversion_factor' or 'qty' - qty = frappe.db.sql("""select sum(%s) from `tab%s` where %s = %s and - docstatus = 1 and parent != %s""" % (get_qty, curr_doctype, ref_tab_fname, '%s', '%s'), + qty = frappe.db.sql("""select sum(%s) from `tab%s` where %s = %s and + docstatus = 1 and parent != %s""" % (get_qty, curr_doctype, ref_tab_fname, '%s', '%s'), (ref_tab_dn, curr_parent_name)) - qty = qty and flt(qty[0][0]) or 0 - + qty = qty and flt(qty[0][0]) or 0 + # get total qty of ref doctype #-------------------- - max_qty = frappe.db.sql("""select qty from `tab%s` where name = %s + max_qty = frappe.db.sql("""select qty from `tab%s` where name = %s and docstatus = 1""" % (ref_doc_tname, '%s'), ref_tab_dn) max_qty = max_qty and flt(max_qty[0][0]) or 0 - + return cstr(qty)+'~~~'+cstr(max_qty) def check_for_stopped_status(self, doctype, docname): - stopped = frappe.db.sql("""select name from `tab%s` where name = %s and + stopped = frappe.db.sql("""select name from `tab%s` where name = %s and status = 'Stopped'""" % (doctype, '%s'), docname) if stopped: - frappe.throw("One cannot do any transaction against %s : %s, it's status is 'Stopped'" % - (doctype, docname)) - + frappe.throw("One cannot do any transaction against %s : %s, it's status is 'Stopped'" % + (doctype, docname), exc=frappe.InvalidStatusError) + def check_docstatus(self, check, doctype, docname, detail_doctype = ''): if check == 'Next': - submitted = frappe.db.sql("""select t1.name from `tab%s` t1,`tab%s` t2 - where t1.name = t2.parent and t2.prevdoc_docname = %s and t1.docstatus = 1""" + submitted = frappe.db.sql("""select t1.name from `tab%s` t1,`tab%s` t2 + where t1.name = t2.parent and t2.prevdoc_docname = %s and t1.docstatus = 1""" % (doctype, detail_doctype, '%s'), docname) if submitted: - frappe.throw(cstr(doctype) + ": " + cstr(submitted[0][0]) + frappe.throw(cstr(doctype) + ": " + cstr(submitted[0][0]) + _("has already been submitted.")) if check == 'Previous': - submitted = frappe.db.sql("""select name from `tab%s` + submitted = frappe.db.sql("""select name from `tab%s` where docstatus = 1 and name = %s""" % (doctype, '%s'), docname) if not submitted: frappe.throw(cstr(doctype) + ": " + cstr(submitted[0][0]) + _("not submitted")) diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index 720a1d5c17..d39f6b6725 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -3,27 +3,27 @@ from __future__ import unicode_literals import frappe - from frappe.utils import cstr, flt - from frappe import msgprint - - from erpnext.controllers.buying_controller import BuyingController + class PurchaseOrder(BuyingController): tname = 'Purchase Order Item' fname = 'po_details' - status_updater = [{ - 'source_dt': 'Purchase Order Item', - 'target_dt': 'Material Request Item', - 'join_field': 'prevdoc_detail_docname', - 'target_field': 'ordered_qty', - 'target_parent_dt': 'Material Request', - 'target_parent_field': 'per_ordered', - 'target_ref_field': 'qty', - 'source_field': 'qty', - 'percent_join_field': 'prevdoc_docname', - }] + + def __init__(self, arg1, arg2=None): + super(PurchaseOrder, self).__init__(arg1, arg2) + self.status_updater = [{ + 'source_dt': 'Purchase Order Item', + 'target_dt': 'Material Request Item', + 'join_field': 'prevdoc_detail_docname', + 'target_field': 'ordered_qty', + 'target_parent_dt': 'Material Request', + 'target_parent_field': 'per_ordered', + 'target_ref_field': 'qty', + 'source_field': 'qty', + 'percent_join_field': 'prevdoc_docname', + }] def validate(self): super(PurchaseOrder, self).validate() @@ -156,7 +156,7 @@ class PurchaseOrder(BuyingController): frappe.db.set(self,'status','Submitted') def on_cancel(self): - pc_obj = frappe.get_doc(dt = 'Purchase Common') + pc_obj = frappe.get_doc('Purchase Common') self.check_for_stopped_status(pc_obj) # Check if Purchase Receipt has been submitted against current Purchase Order diff --git a/erpnext/controllers/status_updater.py b/erpnext/controllers/status_updater.py index 7228100c95..0fceebf84b 100644 --- a/erpnext/controllers/status_updater.py +++ b/erpnext/controllers/status_updater.py @@ -64,11 +64,11 @@ class StatusUpdater(DocListController): def update_prevdoc_status(self): self.update_qty() self.validate_qty() - + def set_status(self, update=False): if self.get("__islocal"): return - + if self.doctype in status_map: sl = status_map[self.doctype][:] sl.reverse() @@ -83,15 +83,15 @@ class StatusUpdater(DocListController): elif getattr(self, s[1])(): self.status = s[0] break - + if update: frappe.db.set_value(self.doctype, self.name, "status", self.status) - + def on_communication(self): self.communication_set = True self.set_status(update=True) del self.communication_set - + def communication_received(self): if getattr(self, "communication_set", False): last_comm = self.get("communications") @@ -103,14 +103,14 @@ class StatusUpdater(DocListController): last_comm = self.get("communications") if last_comm: return last_comm[-1].sent_or_received == "Sent" - + def validate_qty(self): """ Validates qty at row level """ self.tolerance = {} self.global_tolerance = None - + for args in self.status_updater: # get unique transactions to update for d in self.get_all_children(): @@ -118,10 +118,10 @@ class StatusUpdater(DocListController): args['name'] = d.get(args['join_field']) # get all qty where qty > target_field - item = frappe.db.sql("""select item_code, `{target_ref_field}`, - `{target_field}`, parenttype, parent from `tab{target_dt}` - where `{target_ref_field}` < `{target_field}` - and name=%s and docstatus=1""".format(**args), + item = frappe.db.sql("""select item_code, `{target_ref_field}`, + `{target_field}`, parenttype, parent from `tab{target_dt}` + where `{target_ref_field}` < `{target_field}` + and name=%s and docstatus=1""".format(**args), args['name'], as_dict=1) if item: item = item[0] @@ -142,38 +142,37 @@ class StatusUpdater(DocListController): is """ % item + cstr(item[args['target_ref_field']]) + """.
You must reduce the %(target_ref_field)s by \ %(reduce_by)s""" % item, raise_exception=1) - + else: self.check_overflow_with_tolerance(item, args) - + def check_overflow_with_tolerance(self, item, args): """ Checks if there is overflow condering a relaxation tolerance """ - # check if overflow is within tolerance - tolerance, self.tolerance, self.global_tolerance = get_tolerance_for(item['item_code'], + tolerance, self.tolerance, self.global_tolerance = get_tolerance_for(item['item_code'], self.tolerance, self.global_tolerance) - - overflow_percent = ((item[args['target_field']] - item[args['target_ref_field']]) / + + overflow_percent = ((item[args['target_field']] - item[args['target_ref_field']]) / item[args['target_ref_field']]) * 100 - + if overflow_percent - tolerance > 0.01: item['max_allowed'] = flt(item[args['target_ref_field']] * (100+tolerance)/100) item['reduce_by'] = item[args['target_field']] - item['max_allowed'] - + msgprint(""" Row #%(idx)s: Max %(target_ref_field)s allowed for Item %(item_code)s \ - against %(parenttype)s %(parent)s is %(max_allowed)s. - + against %(parenttype)s %(parent)s is %(max_allowed)s. + If you want to increase your overflow tolerance, please increase tolerance %% in \ - Global Defaults or Item master. - + Global Defaults or Item master. + Or, you must reduce the %(target_ref_field)s by %(reduce_by)s - - Also, please check if the order item has already been billed in the Sales Order""" % + + Also, please check if the order item has already been billed in the Sales Order""" % item, raise_exception=1) - + def update_qty(self, change_modified=True): """ @@ -185,103 +184,103 @@ class StatusUpdater(DocListController): args['cond'] = ' or parent="%s"' % self.name.replace('"', '\"') else: args['cond'] = ' and parent!="%s"' % self.name.replace('"', '\"') - + args['modified_cond'] = '' if change_modified: args['modified_cond'] = ', modified = now()' - + # update quantities in child table for d in self.get_all_children(): if d.doctype == args['source_dt']: # updates qty in the child table args['detail_id'] = d.get(args['join_field']) - + args['second_source_condition'] = "" if args.get('second_source_dt') and args.get('second_source_field') \ and args.get('second_join_field'): - args['second_source_condition'] = """ + (select sum(%(second_source_field)s) - from `tab%(second_source_dt)s` - where `%(second_join_field)s`="%(detail_id)s" + args['second_source_condition'] = """ + (select sum(%(second_source_field)s) + from `tab%(second_source_dt)s` + where `%(second_join_field)s`="%(detail_id)s" and (docstatus=1))""" % args - + if args['detail_id']: - frappe.db.sql("""update `tab%(target_dt)s` - set %(target_field)s = (select sum(%(source_field)s) - from `tab%(source_dt)s` where `%(join_field)s`="%(detail_id)s" + frappe.db.sql("""update `tab%(target_dt)s` + set %(target_field)s = (select sum(%(source_field)s) + from `tab%(source_dt)s` where `%(join_field)s`="%(detail_id)s" and (docstatus=1 %(cond)s)) %(second_source_condition)s where name='%(detail_id)s'""" % args) - + # get unique transactions to update for name in set([d.get(args['percent_join_field']) for d in self.get_all_children(args['source_dt'])]): if name: args['name'] = name - + # update percent complete in the parent table - frappe.db.sql("""update `tab%(target_parent_dt)s` - set %(target_parent_field)s = (select sum(if(%(target_ref_field)s > - ifnull(%(target_field)s, 0), %(target_field)s, - %(target_ref_field)s))/sum(%(target_ref_field)s)*100 + frappe.db.sql("""update `tab%(target_parent_dt)s` + set %(target_parent_field)s = (select sum(if(%(target_ref_field)s > + ifnull(%(target_field)s, 0), %(target_field)s, + %(target_ref_field)s))/sum(%(target_ref_field)s)*100 from `tab%(target_dt)s` where parent="%(name)s") %(modified_cond)s where name='%(name)s'""" % args) # update field if args.get('status_field'): - frappe.db.sql("""update `tab%(target_parent_dt)s` - set %(status_field)s = if(ifnull(%(target_parent_field)s,0)<0.001, - 'Not %(keyword)s', if(%(target_parent_field)s>=99.99, + frappe.db.sql("""update `tab%(target_parent_dt)s` + set %(status_field)s = if(ifnull(%(target_parent_field)s,0)<0.001, + 'Not %(keyword)s', if(%(target_parent_field)s>=99.99, 'Fully %(keyword)s', 'Partly %(keyword)s')) where name='%(name)s'""" % args) - - + + def update_billing_status_for_zero_amount_refdoc(self, ref_dt): ref_fieldname = ref_dt.lower().replace(" ", "_") zero_amount_refdoc = [] - all_zero_amount_refdoc = frappe.db.sql_list("""select name from `tab%s` + all_zero_amount_refdoc = frappe.db.sql_list("""select name from `tab%s` where docstatus=1 and net_total = 0""" % ref_dt) - + for item in self.get("entries"): if item.get(ref_fieldname) \ and item.get(ref_fieldname) in all_zero_amount_refdoc \ and item.get(ref_fieldname) not in zero_amount_refdoc: zero_amount_refdoc.append(item.get(ref_fieldname)) - + if zero_amount_refdoc: self.update_biling_status(zero_amount_refdoc, ref_dt, ref_fieldname) - + def update_biling_status(self, zero_amount_refdoc, ref_dt, ref_fieldname): for ref_dn in zero_amount_refdoc: - ref_doc_qty = flt(frappe.db.sql("""select sum(ifnull(qty, 0)) from `tab%s Item` + ref_doc_qty = flt(frappe.db.sql("""select sum(ifnull(qty, 0)) from `tab%s Item` where parent=%s""" % (ref_dt, '%s'), (ref_dn))[0][0]) - - billed_qty = flt(frappe.db.sql("""select sum(ifnull(qty, 0)) - from `tab%s Item` where %s=%s and docstatus=1""" % + + billed_qty = flt(frappe.db.sql("""select sum(ifnull(qty, 0)) + from `tab%s Item` where %s=%s and docstatus=1""" % (self.doctype, ref_fieldname, '%s'), (ref_dn))[0][0]) - + per_billed = ((ref_doc_qty if billed_qty > ref_doc_qty else billed_qty)\ / ref_doc_qty)*100 frappe.db.set_value(ref_dt, ref_dn, "per_billed", per_billed) - + if frappe.get_meta(ref_dt).get_field("billing_status"): if per_billed < 0.001: billing_status = "Not Billed" elif per_billed >= 99.99: billing_status = "Fully Billed" else: billing_status = "Partly Billed" - + frappe.db.set_value(ref_dt, ref_dn, "billing_status", billing_status) - + def get_tolerance_for(item_code, item_tolerance={}, global_tolerance=None): """ Returns the tolerance for the item, if not set, returns global tolerance """ if item_tolerance.get(item_code): return item_tolerance[item_code], item_tolerance, global_tolerance - + tolerance = flt(frappe.db.get_value('Item',item_code,'tolerance') or 0) if not tolerance: if global_tolerance == None: - global_tolerance = flt(frappe.db.get_value('Global Defaults', None, + global_tolerance = flt(frappe.db.get_value('Global Defaults', None, 'tolerance')) tolerance = global_tolerance - + item_tolerance[item_code] = tolerance - return tolerance, item_tolerance, global_tolerance \ No newline at end of file + return tolerance, item_tolerance, global_tolerance diff --git a/erpnext/home/__init__.py b/erpnext/home/__init__.py index ea8997a814..15c98190da 100644 --- a/erpnext/home/__init__.py +++ b/erpnext/home/__init__.py @@ -1,16 +1,16 @@ # ERPNext - web based ERP (http://erpnext.com) # Copyright (C) 2012 Web Notes Technologies Pvt Ltd -# +# # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. -# +# # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. -# +# # You should have received a copy of the GNU General Public License # along with this program. If not, see . @@ -22,35 +22,35 @@ feed_dict = { # Project 'Project': ['[%(status)s]', '#000080'], 'Task': ['[%(status)s] %(subject)s', '#000080'], - + # Sales 'Lead': ['%(lead_name)s', '#000080'], 'Quotation': ['[%(status)s] To %(customer_name)s worth %(currency)s %(grand_total_export)s', '#4169E1'], 'Sales Order': ['[%(status)s] To %(customer_name)s worth %(currency)s %(grand_total_export)s', '#4169E1'], - + # Purchase 'Supplier': ['%(supplier_name)s, %(supplier_type)s', '#6495ED'], 'Purchase Order': ['[%(status)s] %(name)s To %(supplier_name)s for %(currency)s %(grand_total_import)s', '#4169E1'], - + # Stock 'Delivery Note': ['[%(status)s] To %(customer_name)s', '#4169E1'], 'Purchase Receipt': ['[%(status)s] From %(supplier)s', '#4169E1'], - + # Accounts 'Journal Voucher': ['[%(voucher_type)s] %(name)s', '#4169E1'], 'Purchase Invoice': ['To %(supplier_name)s for %(currency)s %(grand_total_import)s', '#4169E1'], 'Sales Invoice': ['To %(customer_name)s for %(currency)s %(grand_total_export)s', '#4169E1'], - + # HR 'Expense Claim': ['[%(approval_status)s] %(name)s by %(employee_name)s', '#4169E1'], 'Salary Slip': ['%(employee_name)s for %(month)s %(fiscal_year)s', '#4169E1'], 'Leave Transaction': ['%(leave_type)s for %(employee)s', '#4169E1'], - + # Support 'Customer Issue': ['[%(status)s] %(description)s by %(customer_name)s', '#000080'], 'Maintenance Visit': ['To %(customer_name)s', '#4169E1'], 'Support Ticket': ["[%(status)s] %(subject)s", '#000080'], - + # Website 'Web Page': ['%(title)s', '#000080'], 'Blog': ['%(title)s', '#000080'] @@ -63,12 +63,12 @@ def make_feed(feedtype, doctype, name, owner, subject, color): if feedtype in ('Login', 'Comment', 'Assignment'): # delete old login, comment feed - frappe.db.sql("""delete from tabFeed where + frappe.db.sql("""delete from tabFeed where datediff(curdate(), creation) > 7 and doc_type in ('Comment', 'Login', 'Assignment')""") else: # one feed per item frappe.db.sql("""delete from tabFeed - where doc_type=%s and doc_name=%s + where doc_type=%s and doc_name=%s and ifnull(feed_type,'') != 'Comment'""", (doctype, name)) f = frappe.new_doc('Feed') @@ -79,9 +79,9 @@ def make_feed(feedtype, doctype, name, owner, subject, color): f.subject = subject f.color = color f.full_name = get_fullname(owner) - f.save() + f.save(ignore_permissions=True) -def update_feed(doc, method=None): +def update_feed(doc, method=None): "adds a new feed" if method in ['on_update', 'on_submit']: subject, color = feed_dict.get(doc.doctype, [None, None]) diff --git a/erpnext/selling/doctype/installation_note/installation_note.py b/erpnext/selling/doctype/installation_note/installation_note.py index b69e319001..1fa91ccc7c 100644 --- a/erpnext/selling/doctype/installation_note/installation_note.py +++ b/erpnext/selling/doctype/installation_note/installation_note.py @@ -7,70 +7,73 @@ import frappe from frappe.utils import cstr, getdate from frappe import msgprint -from erpnext.stock.utils import get_valid_serial_nos +from erpnext.stock.utils import get_valid_serial_nos from erpnext.utilities.transaction_base import TransactionBase class InstallationNote(TransactionBase): tname = 'Installation Note Item' fname = 'installed_item_details' - status_updater = [{ - 'source_dt': 'Installation Note Item', - 'target_dt': 'Delivery Note Item', - 'target_field': 'installed_qty', - 'target_ref_field': 'qty', - 'join_field': 'prevdoc_detail_docname', - 'target_parent_dt': 'Delivery Note', - 'target_parent_field': 'per_installed', - 'source_field': 'qty', - 'percent_join_field': 'prevdoc_docname', - 'status_field': 'installation_status', - 'keyword': 'Installed' - }] + + def __init__(self, arg1, arg2=None): + super(InstallationNote, self).__init__(arg1, arg2) + self.status_updater = [{ + 'source_dt': 'Installation Note Item', + 'target_dt': 'Delivery Note Item', + 'target_field': 'installed_qty', + 'target_ref_field': 'qty', + 'join_field': 'prevdoc_detail_docname', + 'target_parent_dt': 'Delivery Note', + 'target_parent_field': 'per_installed', + 'source_field': 'qty', + 'percent_join_field': 'prevdoc_docname', + 'status_field': 'installation_status', + 'keyword': 'Installed' + }] def validate(self): self.validate_fiscal_year() self.validate_installation_date() self.check_item_table() - + from erpnext.controllers.selling_controller import check_active_sales_items check_active_sales_items(self) def validate_fiscal_year(self): from erpnext.accounts.utils import validate_fiscal_year validate_fiscal_year(self.inst_date, self.fiscal_year, "Installation Date") - + def is_serial_no_added(self, item_code, serial_no): ar_required = frappe.db.get_value("Item", item_code, "has_serial_no") if ar_required == 'Yes' and not serial_no: msgprint("Serial No is mandatory for item: " + item_code, raise_exception=1) elif ar_required != 'Yes' and cstr(serial_no).strip(): - msgprint("If serial no required, please select 'Yes' in 'Has Serial No' in Item :" + + msgprint("If serial no required, please select 'Yes' in 'Has Serial No' in Item :" + item_code, raise_exception=1) - + def is_serial_no_exist(self, item_code, serial_no): for x in serial_no: if not frappe.db.exists("Serial No", x): msgprint("Serial No " + x + " does not exist in the system", raise_exception=1) - + def is_serial_no_installed(self,cur_s_no,item_code): for x in cur_s_no: status = frappe.db.sql("select status from `tabSerial No` where name = %s", x) status = status and status[0][0] or '' - + if status == 'Installed': - msgprint("Item "+item_code+" with serial no. " + x + " already installed", + msgprint("Item "+item_code+" with serial no. " + x + " already installed", raise_exception=1) - + def get_prevdoc_serial_no(self, prevdoc_detail_docname): - serial_nos = frappe.db.get_value("Delivery Note Item", + serial_nos = frappe.db.get_value("Delivery Note Item", prevdoc_detail_docname, "serial_no") return get_valid_serial_nos(serial_nos) - + def is_serial_no_match(self, cur_s_no, prevdoc_s_no, prevdoc_docname): for sr in cur_s_no: if sr not in prevdoc_s_no: - msgprint("Serial No. " + sr + " is not matching with the Delivery Note " + + msgprint("Serial No. " + sr + " is not matching with the Delivery Note " + prevdoc_docname, raise_exception = 1) def validate_serial_no(self): @@ -80,33 +83,33 @@ class InstallationNote(TransactionBase): if d.serial_no: sr_list = get_valid_serial_nos(d.serial_no, d.qty, d.item_code) self.is_serial_no_exist(d.item_code, sr_list) - + prevdoc_s_no = self.get_prevdoc_serial_no(d.prevdoc_detail_docname) if prevdoc_s_no: self.is_serial_no_match(sr_list, prevdoc_s_no, d.prevdoc_docname) - + self.is_serial_no_installed(sr_list, d.item_code) def validate_installation_date(self): for d in self.get('installed_item_details'): if d.prevdoc_docname: - d_date = frappe.db.get_value("Delivery Note", d.prevdoc_docname, "posting_date") + d_date = frappe.db.get_value("Delivery Note", d.prevdoc_docname, "posting_date") if d_date > getdate(self.inst_date): - msgprint("Installation Date can not be before Delivery Date " + cstr(d_date) + + msgprint("Installation Date can not be before Delivery Date " + cstr(d_date) + " for item "+d.item_code, raise_exception=1) - + def check_item_table(self): if not(self.get('installed_item_details')): msgprint("Please fetch items from Delivery Note selected", raise_exception=1) - + def on_update(self): frappe.db.set(self, 'status', 'Draft') - + def on_submit(self): self.validate_serial_no() self.update_prevdoc_status() frappe.db.set(self, 'status', 'Submitted') - + def on_cancel(self): for d in self.get('installed_item_details'): if d.serial_no: diff --git a/erpnext/selling/doctype/quotation/test_quotation.py b/erpnext/selling/doctype/quotation/test_quotation.py index d393a3d9e2..97d41107a0 100644 --- a/erpnext/selling/doctype/quotation/test_quotation.py +++ b/erpnext/selling/doctype/quotation/test_quotation.py @@ -21,9 +21,9 @@ class TestQuotation(unittest.TestCase): sales_order = make_sales_order(quotation.name) self.assertEquals(sales_order.doctype, "Sales Order") - self.assertEquals(len(sales_order.get("sales_order_details")), 2) - self.assertEquals(sales_order.get("sales_order_details")[0]["doctype"], "Sales Order Item") - self.assertEquals(sales_order.get("sales_order_details")[0]["prevdoc_docname"], quotation.name) + self.assertEquals(len(sales_order.get("sales_order_details")), 1) + self.assertEquals(sales_order.get("sales_order_details")[0].doctype, "Sales Order Item") + self.assertEquals(sales_order.get("sales_order_details")[0].prevdoc_docname, quotation.name) self.assertEquals(sales_order.customer, "_Test Customer") sales_order.delivery_date = "2014-01-01" diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index f4b6833d41..b302c7c218 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -281,10 +281,10 @@ def make_material_request(source_name, target_doc=None): @frappe.whitelist() def make_delivery_note(source_name, target_doc=None): - def update_item(obj, target, source_parent): - target.base_amount = (flt(obj.qty) - flt(obj.delivered_qty)) * flt(obj.base_rate) - target.amount = (flt(obj.qty) - flt(obj.delivered_qty)) * flt(obj.rate) - target.qty = flt(obj.qty) - flt(obj.delivered_qty) + def update_item(source, target, source_parent): + target.base_amount = (flt(source.qty) - flt(source.delivered_qty)) * flt(source.base_rate) + target.amount = (flt(source.qty) - flt(source.delivered_qty)) * flt(source.rate) + target.qty = flt(source.qty) - flt(source.delivered_qty) doclist = get_mapped_doc("Sales Order", source_name, { "Sales Order": { @@ -326,10 +326,10 @@ def make_sales_invoice(source_name, target_doc=None): doc.is_pos = 0 doc.run_method("onload_post_render") - def update_item(obj, target, source_parent): - target.amount = flt(obj.amount) - flt(obj.billed_amt) + def update_item(source, target, source_parent): + target.amount = flt(source.amount) - flt(source.billed_amt) target.base_amount = target.amount * flt(source_parent.conversion_rate) - target.qty = obj.rate and target.amount / flt(obj.rate) or obj.qty + target.qty = source.rate and target.amount / flt(source.rate) or obj.qty doclist = get_mapped_doc("Sales Order", source_name, { "Sales Order": { diff --git a/erpnext/selling/doctype/sales_order/test_sales_order.py b/erpnext/selling/doctype/sales_order/test_sales_order.py index b41027bcfd..52bde1e880 100644 --- a/erpnext/selling/doctype/sales_order/test_sales_order.py +++ b/erpnext/selling/doctype/sales_order/test_sales_order.py @@ -106,7 +106,7 @@ class TestSalesOrder(unittest.TestCase): def test_reserved_qty_for_so(self): # reset bin - so_item = test_records[0]["sales_order_details"][0] + so_item = test_records[0]["sales_order_details"][0].copy() self.delete_bin(so_item["item_code"], so_item["warehouse"]) # submit @@ -120,7 +120,7 @@ class TestSalesOrder(unittest.TestCase): def test_reserved_qty_for_partial_delivery(self): # reset bin - so_item = test_records[0]["sales_order_details"][0] + so_item = test_records[0]["sales_order_details"][0].copy() self.delete_bin(so_item["item_code"], so_item["warehouse"]) # submit so @@ -150,7 +150,7 @@ class TestSalesOrder(unittest.TestCase): def test_reserved_qty_for_over_delivery(self): # reset bin - so_item = test_records[0]["sales_order_details"][0] + so_item = test_records[0]["sales_order_details"][0].copy() self.delete_bin(so_item["item_code"], so_item["warehouse"]) # submit so diff --git a/erpnext/setup/doctype/item_group/item_group.py b/erpnext/setup/doctype/item_group/item_group.py index e744ae2418..4b0dc117c8 100644 --- a/erpnext/setup/doctype/item_group/item_group.py +++ b/erpnext/setup/doctype/item_group/item_group.py @@ -5,22 +5,33 @@ from __future__ import unicode_literals import frappe from frappe.utils.nestedset import NestedSet +from frappe.website.website_generator import WebsiteGenerator -class ItemGroup(NestedSet): +class ItemGroup(NestedSet, WebsiteGenerator): nsm_parent_field = 'parent_item_group' - + + def autoname(self): + self.name = self.item_group_name + def validate(self): if not self.parent_website_route: - self.parent_website_route = frappe.get_website_route("Item Group", + self.parent_website_route = frappe.get_website_route("Item Group", self.parent_item_group) - + def on_update(self): NestedSet.on_update(self) - + WebsiteGenerator.on_update(self) self.validate_name_with_item() - self.validate_one_root() - + + def after_rename(self, olddn, newdn, merge=False): + NestedSet.after_rename(self, olddn, newdn, merge) + WebsiteGenerator.after_rename(self, olddn, newdn, merge) + + def on_trash(self): + NestedSet.on_trash(self) + WebsiteGenerator.on_trash(self) + def validate_name_with_item(self): if frappe.db.exists("Item", self.name): frappe.msgprint("An item exists with same name (%s), please change the \ diff --git a/erpnext/setup/doctype/item_group/test_item_group.py b/erpnext/setup/doctype/item_group/test_item_group.py index 6f1d4dbd71..3eac0aae6e 100644 --- a/erpnext/setup/doctype/item_group/test_item_group.py +++ b/erpnext/setup/doctype/item_group/test_item_group.py @@ -13,15 +13,14 @@ class TestItem(unittest.TestCase): def test_basic_tree(self, records=None): min_lft = 1 max_rgt = frappe.db.sql("select max(rgt) from `tabItem Group`")[0][0] - + if not records: records = test_records[2:] - + for item_group in records: - item_group = item_group[0] - lft, rgt, parent_item_group = frappe.db.get_value("Item Group", item_group["item_group_name"], + lft, rgt, parent_item_group = frappe.db.get_value("Item Group", item_group["item_group_name"], ["lft", "rgt", "parent_item_group"]) - + if parent_item_group: parent_lft, parent_rgt = frappe.db.get_value("Item Group", parent_item_group, ["lft", "rgt"]) @@ -29,7 +28,7 @@ class TestItem(unittest.TestCase): # root parent_lft = min_lft - 1 parent_rgt = max_rgt + 1 - + self.assertTrue(lft) self.assertTrue(rgt) self.assertTrue(lft < rgt) @@ -38,69 +37,69 @@ class TestItem(unittest.TestCase): self.assertTrue(rgt < parent_rgt) self.assertTrue(lft >= min_lft) self.assertTrue(rgt <= max_rgt) - + no_of_children = self.get_no_of_children(item_group["item_group_name"]) self.assertTrue(rgt == (lft + 1 + (2 * no_of_children))) - + no_of_children = self.get_no_of_children(parent_item_group) self.assertTrue(parent_rgt == (parent_lft + 1 + (2 * no_of_children))) - + def get_no_of_children(self, item_group): def get_no_of_children(item_groups, no_of_children): children = [] for ig in item_groups: children += frappe.db.sql_list("""select name from `tabItem Group` where ifnull(parent_item_group, '')=%s""", ig or '') - + if len(children): return get_no_of_children(children, no_of_children + len(children)) else: return no_of_children - + return get_no_of_children([item_group], 0) - + def test_recursion(self): group_b = frappe.get_doc("Item Group", "_Test Item Group B") group_b.parent_item_group = "_Test Item Group B - 3" self.assertRaises(NestedSetRecursionError, group_b.save) - + # cleanup group_b.parent_item_group = "All Item Groups" group_b.save() - + def test_rebuild_tree(self): rebuild_tree("Item Group", "parent_item_group") self.test_basic_tree() - + def move_it_back(self): group_b = frappe.get_doc("Item Group", "_Test Item Group B") group_b.parent_item_group = "All Item Groups" group_b.save() self.test_basic_tree() - + def test_move_group_into_another(self): # before move old_lft, old_rgt = frappe.db.get_value("Item Group", "_Test Item Group C", ["lft", "rgt"]) - + # put B under C group_b = frappe.get_doc("Item Group", "_Test Item Group B") lft, rgt = group_b.lft, group_b.rgt - + group_b.parent_item_group = "_Test Item Group C" group_b.save() self.test_basic_tree() - + # after move new_lft, new_rgt = frappe.db.get_value("Item Group", "_Test Item Group C", ["lft", "rgt"]) - + # lft should reduce self.assertEquals(old_lft - new_lft, rgt - lft + 1) - + # adjacent siblings, hence rgt diff will be 0 self.assertEquals(new_rgt - old_rgt, 0) - + self.move_it_back() - + def test_move_group_into_root(self): group_b = frappe.get_doc("Item Group", "_Test Item Group B") group_b.parent_item_group = "" @@ -108,101 +107,101 @@ class TestItem(unittest.TestCase): # trick! works because it hasn't been rolled back :D self.test_basic_tree() - + self.move_it_back() - + def print_tree(self): import json print json.dumps(frappe.db.sql("select name, lft, rgt from `tabItem Group` order by lft"), indent=1) - + def test_move_leaf_into_another_group(self): # before move old_lft, old_rgt = frappe.db.get_value("Item Group", "_Test Item Group C", ["lft", "rgt"]) - + group_b_3 = frappe.get_doc("Item Group", "_Test Item Group B - 3") lft, rgt = group_b_3.lft, group_b_3.rgt - + # child of right sibling is moved into it group_b_3.parent_item_group = "_Test Item Group C" group_b_3.save() self.test_basic_tree() - + new_lft, new_rgt = frappe.db.get_value("Item Group", "_Test Item Group C", ["lft", "rgt"]) - + # lft should remain the same self.assertEquals(old_lft - new_lft, 0) - + # rgt should increase self.assertEquals(new_rgt - old_rgt, rgt - lft + 1) - + # move it back group_b_3 = frappe.get_doc("Item Group", "_Test Item Group B - 3") group_b_3.parent_item_group = "_Test Item Group B" group_b_3.save() self.test_basic_tree() - + def test_delete_leaf(self): # for checking later parent_item_group = frappe.db.get_value("Item Group", "_Test Item Group B - 3", "parent_item_group") rgt = frappe.db.get_value("Item Group", parent_item_group, "rgt") - + ancestors = get_ancestors_of("Item Group", "_Test Item Group B - 3") ancestors = frappe.db.sql("""select name, rgt from `tabItem Group` where name in ({})""".format(", ".join(["%s"]*len(ancestors))), tuple(ancestors), as_dict=True) - + frappe.delete_doc("Item Group", "_Test Item Group B - 3") records_to_test = test_records[2:] del records_to_test[4] self.test_basic_tree(records=records_to_test) - + # rgt of each ancestor would reduce by 2 for item_group in ancestors: new_lft, new_rgt = frappe.db.get_value("Item Group", item_group.name, ["lft", "rgt"]) self.assertEquals(new_rgt, item_group.rgt - 2) - + # insert it back frappe.copy_doc(test_records[6]).insert() - + self.test_basic_tree() - + def test_delete_group(self): # cannot delete group with child, but can delete leaf self.assertRaises(NestedSetChildExistsError, frappe.delete_doc, "Item Group", "_Test Item Group B") - + def test_merge_groups(self): frappe.rename_doc("Item Group", "_Test Item Group B", "_Test Item Group C", merge=True) records_to_test = test_records[2:] del records_to_test[1] self.test_basic_tree(records=records_to_test) - + # insert Group B back frappe.copy_doc(test_records[3]).insert() self.test_basic_tree() - + # move its children back for name in frappe.db.sql_list("""select name from `tabItem Group` where parent_item_group='_Test Item Group C'"""): - + doc = frappe.get_doc("Item Group", name) doc.parent_item_group = "_Test Item Group B" doc.save() self.test_basic_tree() - + def test_merge_leaves(self): frappe.rename_doc("Item Group", "_Test Item Group B - 2", "_Test Item Group B - 1", merge=True) records_to_test = test_records[2:] del records_to_test[3] self.test_basic_tree(records=records_to_test) - + # insert Group B - 2back frappe.copy_doc(test_records[5]).insert() self.test_basic_tree() - + def test_merge_leaf_into_group(self): - self.assertRaises(NestedSetInvalidMergeError, frappe.rename_doc, "Item Group", "_Test Item Group B - 3", + self.assertRaises(NestedSetInvalidMergeError, frappe.rename_doc, "Item Group", "_Test Item Group B - 3", "_Test Item Group B", merge=True) - + def test_merge_group_into_leaf(self): - self.assertRaises(NestedSetInvalidMergeError, frappe.rename_doc, "Item Group", "_Test Item Group B", - "_Test Item Group B - 3", merge=True) \ No newline at end of file + self.assertRaises(NestedSetInvalidMergeError, frappe.rename_doc, "Item Group", "_Test Item Group B", + "_Test Item Group B - 3", merge=True) diff --git a/erpnext/setup/doctype/sales_partner/sales_partner.py b/erpnext/setup/doctype/sales_partner/sales_partner.py index a7449abaab..b90b65e868 100644 --- a/erpnext/setup/doctype/sales_partner/sales_partner.py +++ b/erpnext/setup/doctype/sales_partner/sales_partner.py @@ -4,9 +4,12 @@ from __future__ import unicode_literals import frappe from frappe.utils import cint, cstr, filter_strip_join -from frappe.model.document import Document +from frappe.website.website_generator import WebsiteGenerator + +class SalesPartner(WebsiteGenerator): + def autoname(self): + self.name = self.partner_name -class SalesPartner(Document): def validate(self): if self.partner_website and not self.partner_website.startswith("http"): self.partner_website = "http://" + self.partner_website @@ -14,8 +17,8 @@ class SalesPartner(Document): def get_contacts(self, nm): if nm: return frappe.db.convert_to_lists(frappe.db.sql(""" - select name, CONCAT(IFNULL(first_name,''), - ' ',IFNULL(last_name,'')),contact_no,email_id + select name, CONCAT(IFNULL(first_name,''), + ' ',IFNULL(last_name,'')),contact_no,email_id from `tabContact` where sales_partner = %s""", nm)) else: return '' diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index ba1509fb5d..e91c36dd74 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -15,19 +15,22 @@ from erpnext.controllers.selling_controller import SellingController class DeliveryNote(SellingController): tname = 'Delivery Note Item' fname = 'delivery_note_details' - status_updater = [{ - 'source_dt': 'Delivery Note Item', - 'target_dt': 'Sales Order Item', - 'join_field': 'prevdoc_detail_docname', - 'target_field': 'delivered_qty', - 'target_parent_dt': 'Sales Order', - 'target_parent_field': 'per_delivered', - 'target_ref_field': 'qty', - 'source_field': 'qty', - 'percent_join_field': 'against_sales_order', - 'status_field': 'delivery_status', - 'keyword': 'Delivered' - }] + + def __init__(self, arg1, arg2=None): + super(DeliveryNote, self).__init__(arg1, arg2) + self.status_updater = [{ + 'source_dt': 'Delivery Note Item', + 'target_dt': 'Sales Order Item', + 'join_field': 'prevdoc_detail_docname', + 'target_field': 'delivered_qty', + 'target_parent_dt': 'Sales Order', + 'target_parent_field': 'per_delivered', + 'target_ref_field': 'qty', + 'source_field': 'qty', + 'percent_join_field': 'against_sales_order', + 'status_field': 'delivery_status', + 'keyword': 'Delivered' + }] def onload(self): billed_qty = frappe.db.sql("""select sum(ifnull(qty, 0)) from `tabSales Invoice Item` diff --git a/erpnext/stock/doctype/delivery_note/test_delivery_note.py b/erpnext/stock/doctype/delivery_note/test_delivery_note.py index 0260232c4c..6e82ae92cc 100644 --- a/erpnext/stock/doctype/delivery_note/test_delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/test_delivery_note.py @@ -11,76 +11,76 @@ from erpnext.stock.doctype.purchase_receipt.test_purchase_receipt import get_gl_ def _insert_purchase_receipt(item_code=None): if not item_code: - item_code = pr_test_records[0][1]["item_code"] - + item_code = pr_test_records[0]["purchase_receipt_details"][0]["item_code"] + pr = frappe.copy_doc(pr_test_records[0]) pr.get("purchase_receipt_details")[0].item_code = item_code pr.insert() pr.submit() - + class TestDeliveryNote(unittest.TestCase): def test_over_billing_against_dn(self): self.clear_stock_account_balance() _insert_purchase_receipt() - + from erpnext.stock.doctype.delivery_note.delivery_note import make_sales_invoice _insert_purchase_receipt() dn = frappe.copy_doc(test_records[0]).insert() - - self.assertRaises(frappe.ValidationError, make_sales_invoice, + + self.assertRaises(frappe.ValidationError, make_sales_invoice, dn.name) dn = frappe.get_doc("Delivery Note", dn.name) dn.submit() si = make_sales_invoice(dn.name) - - self.assertEquals(len(si), len(dn)) - + + self.assertEquals(len(si.get("entries")), len(dn.get("delivery_note_details"))) + # modify amount - si[1]["rate"] = 200 + si.get("entries")[0].rate = 200 self.assertRaises(frappe.ValidationError, frappe.get_doc(si).insert) - - + + def test_delivery_note_no_gl_entry(self): self.clear_stock_account_balance() set_perpetual_inventory(0) self.assertEqual(cint(frappe.defaults.get_global_default("auto_accounting_for_stock")), 0) - + _insert_purchase_receipt() - + dn = frappe.copy_doc(test_records[0]) dn.insert() dn.submit() - - stock_value, stock_value_difference = frappe.db.get_value("Stock Ledger Entry", - {"voucher_type": "Delivery Note", "voucher_no": dn.name, + + stock_value, stock_value_difference = frappe.db.get_value("Stock Ledger Entry", + {"voucher_type": "Delivery Note", "voucher_no": dn.name, "item_code": "_Test Item"}, ["stock_value", "stock_value_difference"]) self.assertEqual(stock_value, 0) self.assertEqual(stock_value_difference, -375) - + self.assertFalse(get_gl_entries("Delivery Note", dn.name)) - + def test_delivery_note_gl_entry(self): self.clear_stock_account_balance() set_perpetual_inventory() self.assertEqual(cint(frappe.defaults.get_global_default("auto_accounting_for_stock")), 1) frappe.db.set_value("Item", "_Test Item", "valuation_method", "FIFO") - + _insert_purchase_receipt() - + dn = frappe.copy_doc(test_records[0]) dn.get("delivery_note_details")[0].expense_account = "Cost of Goods Sold - _TC" dn.get("delivery_note_details")[0].cost_center = "Main - _TC" - stock_in_hand_account = frappe.db.get_value("Account", + stock_in_hand_account = frappe.db.get_value("Account", {"master_name": dn.get("delivery_note_details")[0].warehouse}) - + from erpnext.accounts.utils import get_balance_on prev_bal = get_balance_on(stock_in_hand_account, dn.posting_date) dn.insert() dn.submit() - + gl_entries = get_gl_entries("Delivery Note", dn.name) self.assertTrue(gl_entries) expected_values = { @@ -89,20 +89,20 @@ class TestDeliveryNote(unittest.TestCase): } for i, gle in enumerate(gl_entries): self.assertEquals([gle.debit, gle.credit], expected_values.get(gle.account)) - + # check stock in hand balance bal = get_balance_on(stock_in_hand_account, dn.posting_date) self.assertEquals(bal, prev_bal - 375.0) - + # back dated purchase receipt pr = frappe.copy_doc(pr_test_records[0]) pr.posting_date = "2013-01-01" pr.get("purchase_receipt_details")[0].rate = 100 pr.get("purchase_receipt_details")[0].base_amount = 100 - + pr.insert() pr.submit() - + gl_entries = get_gl_entries("Delivery Note", dn.name) self.assertTrue(gl_entries) expected_values = { @@ -111,71 +111,71 @@ class TestDeliveryNote(unittest.TestCase): } for i, gle in enumerate(gl_entries): self.assertEquals([gle.debit, gle.credit], expected_values.get(gle.account)) - + dn.cancel() self.assertFalse(get_gl_entries("Delivery Note", dn.name)) set_perpetual_inventory(0) - + def test_delivery_note_gl_entry_packing_item(self): self.clear_stock_account_balance() set_perpetual_inventory() - + _insert_purchase_receipt() _insert_purchase_receipt("_Test Item Home Desktop 100") - + dn = frappe.copy_doc(test_records[0]) dn.get("delivery_note_details")[0].item_code = "_Test Sales BOM Item" dn.get("delivery_note_details")[0].qty = 1 - - stock_in_hand_account = frappe.db.get_value("Account", + + stock_in_hand_account = frappe.db.get_value("Account", {"master_name": dn.get("delivery_note_details")[0].warehouse}) - + from erpnext.accounts.utils import get_balance_on prev_bal = get_balance_on(stock_in_hand_account, dn.posting_date) - + dn.insert() dn.submit() - + gl_entries = get_gl_entries("Delivery Note", dn.name) self.assertTrue(gl_entries) - + expected_values = { stock_in_hand_account: [0.0, 525], "Cost of Goods Sold - _TC": [525.0, 0.0] } for i, gle in enumerate(gl_entries): self.assertEquals([gle.debit, gle.credit], expected_values.get(gle.account)) - + # check stock in hand balance bal = get_balance_on(stock_in_hand_account, dn.posting_date) self.assertEquals(bal, prev_bal - 525.0) - + dn.cancel() self.assertFalse(get_gl_entries("Delivery Note", dn.name)) - + set_perpetual_inventory(0) - + def test_serialized(self): from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos - + se = make_serialized_item() serial_nos = get_serial_nos(se.get("mtn_details")[0].serial_no) - + dn = frappe.copy_doc(test_records[0]) dn.get("delivery_note_details")[0].item_code = "_Test Serialized Item With Series" dn.get("delivery_note_details")[0].qty = 1 dn.get("delivery_note_details")[0].serial_no = serial_nos[0] dn.insert() dn.submit() - + self.assertEquals(frappe.db.get_value("Serial No", serial_nos[0], "status"), "Delivered") self.assertFalse(frappe.db.get_value("Serial No", serial_nos[0], "warehouse")) - self.assertEquals(frappe.db.get_value("Serial No", serial_nos[0], + self.assertEquals(frappe.db.get_value("Serial No", serial_nos[0], "delivery_document_no"), dn.name) - + return dn - + def test_serialized_cancel(self): from erpnext.stock.doctype.serial_no.serial_no import get_serial_nos dn = self.test_serialized() @@ -185,20 +185,20 @@ class TestDeliveryNote(unittest.TestCase): self.assertEquals(frappe.db.get_value("Serial No", serial_nos[0], "status"), "Available") self.assertEquals(frappe.db.get_value("Serial No", serial_nos[0], "warehouse"), "_Test Warehouse - _TC") - self.assertFalse(frappe.db.get_value("Serial No", serial_nos[0], + self.assertFalse(frappe.db.get_value("Serial No", serial_nos[0], "delivery_document_no")) def test_serialize_status(self): from erpnext.stock.doctype.serial_no.serial_no import SerialNoStatusError, get_serial_nos from erpnext.stock.doctype.stock_entry.test_stock_entry import make_serialized_item - + se = make_serialized_item() serial_nos = get_serial_nos(se.get("mtn_details")[0].serial_no) - + sr = frappe.get_doc("Serial No", serial_nos[0]) sr.status = "Not Available" sr.save() - + dn = frappe.copy_doc(test_records[0]) dn.get("delivery_note_details")[0].item_code = "_Test Serialized Item With Series" dn.get("delivery_note_details")[0].qty = 1 @@ -206,7 +206,7 @@ class TestDeliveryNote(unittest.TestCase): dn.insert() self.assertRaises(SerialNoStatusError, dn.submit) - + def clear_stock_account_balance(self): frappe.db.sql("""delete from `tabBin`""") frappe.db.sql("delete from `tabStock Ledger Entry`") @@ -214,4 +214,4 @@ class TestDeliveryNote(unittest.TestCase): test_dependencies = ["Sales BOM"] -test_records = frappe.get_test_records('Delivery Note') \ No newline at end of file +test_records = frappe.get_test_records('Delivery Note') diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index 54ac383a42..dd364ff518 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -3,32 +3,29 @@ from __future__ import unicode_literals import frappe - -from frappe.utils import cstr, flt, getdate, now_datetime, formatdate - from frappe import msgprint, _ - -from frappe.model.controller import DocListController +from frappe.utils import cstr, flt, getdate, now_datetime, formatdate +from frappe.website.website_generator import WebsiteGenerator class WarehouseNotSet(Exception): pass -class Item(DocListController): +class Item(WebsiteGenerator): def onload(self): self.set("__sle_exists", self.check_if_sle_exists()) - + def autoname(self): if frappe.db.get_default("item_naming_by")=="Naming Series": from frappe.model.naming import make_autoname self.item_code = make_autoname(self.naming_series+'.#####') elif not self.item_code: msgprint(_("Item Code (item_code) is mandatory because Item naming is not sequential."), raise_exception=1) - + self.name = self.item_code - + def validate(self): if not self.stock_uom: msgprint(_("Please enter Default Unit of Measure"), raise_exception=1) - + self.check_warehouse_is_set_for_stock_item() self.check_stock_uom_with_bin() self.add_default_uom_in_conversion_factor_table() @@ -40,14 +37,15 @@ class Item(DocListController): self.validate_barcode() self.cant_change() self.validate_item_type_for_reorder() - + if not self.parent_website_route: self.parent_website_route = frappe.get_website_route("Item Group", self.item_group) if self.name: self.old_page_name = frappe.db.get_value('Item', self.name, 'page_name') - + def on_update(self): + super(Item, self).on_update() self.validate_name_with_item_group() self.update_item_price() @@ -55,46 +53,46 @@ class Item(DocListController): if self.is_stock_item=="Yes" and not self.default_warehouse: frappe.msgprint(_("Default Warehouse is mandatory for Stock Item."), raise_exception=WarehouseNotSet) - + def add_default_uom_in_conversion_factor_table(self): uom_conv_list = [d.uom for d in self.get("uom_conversion_details")] if self.stock_uom not in uom_conv_list: ch = self.append('uom_conversion_details', {}) ch.uom = self.stock_uom ch.conversion_factor = 1 - + to_remove = [] for d in self.get("uom_conversion_details"): if d.conversion_factor == 1 and d.uom != self.stock_uom: to_remove.append(d) - + [self.remove(d) for d in to_remove] - + def check_stock_uom_with_bin(self): if not self.get("__islocal"): matched=True - ref_uom = frappe.db.get_value("Stock Ledger Entry", + ref_uom = frappe.db.get_value("Stock Ledger Entry", {"item_code": self.name}, "stock_uom") if ref_uom: if cstr(ref_uom) != cstr(self.stock_uom): matched = False else: - bin_list = frappe.db.sql("select * from tabBin where item_code=%s", + bin_list = frappe.db.sql("select * from tabBin where item_code=%s", self.item_code, as_dict=1) for bin in bin_list: if (bin.reserved_qty > 0 or bin.ordered_qty > 0 or bin.indented_qty > 0 \ or bin.planned_qty > 0) and cstr(bin.stock_uom) != cstr(self.stock_uom): matched = False break - + if matched and bin_list: frappe.db.sql("""update tabBin set stock_uom=%s where item_code=%s""", (self.stock_uom, self.name)) - + if not matched: frappe.throw(_("Default Unit of Measure can not be changed directly because you have already made some transaction(s) with another UOM. To change default UOM, use 'UOM Replace Utility' tool under Stock module.")) - + def validate_conversion_factor(self): check_list = [] for d in self.get('uom_conversion_details'): @@ -105,12 +103,12 @@ class Item(DocListController): check_list.append(cstr(d.uom)) if d.uom and cstr(d.uom) == cstr(self.stock_uom) and flt(d.conversion_factor) != 1: - msgprint(_("""Conversion Factor of UOM: %s should be equal to 1. As UOM: %s is Stock UOM of Item: %s.""" % + msgprint(_("""Conversion Factor of UOM: %s should be equal to 1. As UOM: %s is Stock UOM of Item: %s.""" % (d.uom, d.uom, self.name)), raise_exception=1) elif d.uom and cstr(d.uom)!= self.stock_uom and flt(d.conversion_factor) == 1: - msgprint(_("""Conversion Factor of UOM: %s should not be equal to 1. As UOM: %s is not Stock UOM of Item: %s""" % + msgprint(_("""Conversion Factor of UOM: %s should not be equal to 1. As UOM: %s is not Stock UOM of Item: %s""" % (d.uom, d.uom, self.name)), raise_exception=1) - + def validate_item_type(self): if cstr(self.is_manufactured_item) == "No": self.is_pro_applicable = "No" @@ -121,25 +119,25 @@ class Item(DocListController): if self.has_serial_no == 'Yes' and self.is_stock_item == 'No': msgprint("'Has Serial No' can not be 'Yes' for non-stock item", raise_exception=1) - + def check_for_active_boms(self): if self.is_purchase_item != "Yes": - bom_mat = frappe.db.sql("""select distinct t1.parent - from `tabBOM Item` t1, `tabBOM` t2 where t2.name = t1.parent - and t1.item_code =%s and ifnull(t1.bom_no, '') = '' and t2.is_active = 1 + bom_mat = frappe.db.sql("""select distinct t1.parent + from `tabBOM Item` t1, `tabBOM` t2 where t2.name = t1.parent + and t1.item_code =%s and ifnull(t1.bom_no, '') = '' and t2.is_active = 1 and t2.docstatus = 1 and t1.docstatus =1 """, self.name) - + if bom_mat and bom_mat[0][0]: frappe.throw(_("Item must be a purchase item, \ as it is present in one or many Active BOMs")) - + if self.is_manufactured_item != "Yes": - bom = frappe.db.sql("""select name from `tabBOM` where item = %s + bom = frappe.db.sql("""select name from `tabBOM` where item = %s and is_active = 1""", (self.name,)) if bom and bom[0][0]: frappe.throw(_("""Allow Bill of Materials should be 'Yes'. Because one or many \ active BOMs present for this item""")) - + def fill_customer_code(self): """ Append all the customer codes and insert into "customer_code" field of item table """ cust_code=[] @@ -153,7 +151,7 @@ class Item(DocListController): for d in self.get('item_tax'): if d.tax_type: account_type = frappe.db.get_value("Account", d.tax_type, "account_type") - + if account_type not in ['Tax', 'Chargeable', 'Income Account', 'Expense Account']: msgprint("'%s' is not Tax / Chargeable / Income / Expense Account" % d.tax_type, raise_exception=1) else: @@ -161,34 +159,34 @@ class Item(DocListController): msgprint("Rate is entered twice for: '%s'" % d.tax_type, raise_exception=1) else: check_list.append(d.tax_type) - + def validate_barcode(self): if self.barcode: - duplicate = frappe.db.sql("""select name from tabItem where barcode = %s + duplicate = frappe.db.sql("""select name from tabItem where barcode = %s and name != %s""", (self.barcode, self.name)) if duplicate: - msgprint("Barcode: %s already used in item: %s" % + msgprint("Barcode: %s already used in item: %s" % (self.barcode, cstr(duplicate[0][0])), raise_exception = 1) def cant_change(self): if not self.get("__islocal"): - vals = frappe.db.get_value("Item", self.name, + vals = frappe.db.get_value("Item", self.name, ["has_serial_no", "is_stock_item", "valuation_method"], as_dict=True) - - if vals and ((self.is_stock_item == "No" and vals.is_stock_item == "Yes") or - vals.has_serial_no != self.has_serial_no or + + if vals and ((self.is_stock_item == "No" and vals.is_stock_item == "Yes") or + vals.has_serial_no != self.has_serial_no or cstr(vals.valuation_method) != cstr(self.valuation_method)): if self.check_if_sle_exists() == "exists": frappe.throw(_("As there are existing stock transactions for this item, you can not change the values of 'Has Serial No', 'Is Stock Item' and 'Valuation Method'")) - + def validate_item_type_for_reorder(self): if self.re_order_level or len(self.get("item_reorder", {"material_request_type": "Purchase"})): if not self.is_purchase_item: - frappe.msgprint(_("""To set reorder level, item must be Purchase Item"""), + frappe.msgprint(_("""To set reorder level, item must be Purchase Item"""), raise_exception=1) - + def check_if_sle_exists(self): - sle = frappe.db.sql("""select name from `tabStock Ledger Entry` + sle = frappe.db.sql("""select name from `tabStock Ledger Entry` where item_code = %s""", self.name) return sle and 'exists' or 'not exists' @@ -196,11 +194,11 @@ class Item(DocListController): # causes problem with tree build if frappe.db.exists("Item Group", self.name): frappe.msgprint("An item group exists with same name (%s), \ - please change the item name or rename the item group" % + please change the item name or rename the item group" % self.name, raise_exception=1) def update_item_price(self): - frappe.db.sql("""update `tabItem Price` set item_name=%s, + frappe.db.sql("""update `tabItem Price` set item_name=%s, item_description=%s, modified=NOW() where item_code=%s""", (self.item_name, self.description, self.name)) @@ -209,9 +207,9 @@ class Item(DocListController): page_name_from = self.name else: page_name_from = self.name + " " + self.item_name - + return page_name_from - + def get_tax_rate(self, tax_type): return { "tax_rate": frappe.db.get_value("Account", tax_type, "tax_rate") } @@ -223,8 +221,9 @@ class Item(DocListController): 'description' : file and file[0]['description'] or '' } return ret - + def on_trash(self): + super(Item, self).on_trash() frappe.db.sql("""delete from tabBin where item_code=%s""", self.item_code) def before_rename(self, olddn, newdn, merge=False): @@ -232,7 +231,7 @@ class Item(DocListController): # Validate properties before merging if not frappe.db.exists("Item", newdn): frappe.throw(_("Item ") + newdn +_(" does not exists")) - + field_list = ["stock_uom", "is_stock_item", "has_serial_no", "has_batch_no"] new_properties = [cstr(d) for d in frappe.db.get_value("Item", newdn, field_list)] if new_properties != [cstr(self.get(fld)) for fld in field_list]: @@ -242,32 +241,33 @@ class Item(DocListController): frappe.db.sql("delete from `tabBin` where item_code=%s", olddn) def after_rename(self, olddn, newdn, merge): + super(Item, self).after_rename(olddn, newdn, merge) + frappe.db.set_value("Item", newdn, "item_code", newdn) - if merge: self.set_last_purchase_rate(newdn) self.recalculate_bin_qty(newdn) - + def set_last_purchase_rate(self, newdn): last_purchase_rate = get_last_purchase_details(newdn).get("base_rate", 0) frappe.db.set_value("Item", newdn, "last_purchase_rate", last_purchase_rate) - + def recalculate_bin_qty(self, newdn): from erpnext.utilities.repost_stock import repost_stock frappe.db.auto_commit_on_many_writes = 1 frappe.db.set_default("allow_negative_stock", 1) - + for warehouse in frappe.db.sql("select name from `tabWarehouse`"): repost_stock(newdn, warehouse[0]) - - frappe.db.set_default("allow_negative_stock", + + frappe.db.set_default("allow_negative_stock", frappe.db.get_value("Stock Settings", None, "allow_negative_stock")) frappe.db.auto_commit_on_many_writes = 0 def validate_end_of_life(item_code, end_of_life=None, verbose=1): if not end_of_life: end_of_life = frappe.db.get_value("Item", item_code, "end_of_life") - + if end_of_life and getdate(end_of_life) <= now_datetime().date(): msg = (_("Item") + " %(item_code)s: " + _("reached its end of life on") + \ " %(date)s. " + _("Please check") + ": %(end_of_life_label)s " + \ @@ -276,29 +276,29 @@ def validate_end_of_life(item_code, end_of_life=None, verbose=1): "date": formatdate(end_of_life), "end_of_life_label": frappe.get_meta("Item").get_label("end_of_life") } - + _msgprint(msg, verbose) - + def validate_is_stock_item(item_code, is_stock_item=None, verbose=1): if not is_stock_item: is_stock_item = frappe.db.get_value("Item", item_code, "is_stock_item") - + if is_stock_item != "Yes": msg = (_("Item") + " %(item_code)s: " + _("is not a Stock Item")) % { "item_code": item_code, } - + _msgprint(msg, verbose) - + def validate_cancelled_item(item_code, docstatus=None, verbose=1): if docstatus is None: docstatus = frappe.db.get_value("Item", item_code, "docstatus") - + if docstatus == 2: msg = (_("Item") + " %(item_code)s: " + _("is a cancelled Item")) % { "item_code": item_code, } - + _msgprint(msg, verbose) def _msgprint(msg, verbose): @@ -306,22 +306,22 @@ def _msgprint(msg, verbose): msgprint(msg, raise_exception=True) else: raise frappe.ValidationError, msg - - + + def get_last_purchase_details(item_code, doc_name=None, conversion_rate=1.0): """returns last purchase details in stock uom""" # get last purchase order item details last_purchase_order = frappe.db.sql("""\ select po.name, po.transaction_date, po.conversion_rate, - po_item.conversion_factor, po_item.base_price_list_rate, + po_item.conversion_factor, po_item.base_price_list_rate, po_item.discount_percentage, po_item.base_rate from `tabPurchase Order` po, `tabPurchase Order Item` po_item - where po.docstatus = 1 and po_item.item_code = %s and po.name != %s and + where po.docstatus = 1 and po_item.item_code = %s and po.name != %s and po.name = po_item.parent order by po.transaction_date desc, po.name desc limit 1""", (item_code, cstr(doc_name)), as_dict=1) - # get last purchase receipt item details + # get last purchase receipt item details last_purchase_receipt = frappe.db.sql("""\ select pr.name, pr.posting_date, pr.posting_time, pr.conversion_rate, pr_item.conversion_factor, pr_item.base_price_list_rate, pr_item.discount_percentage, @@ -342,16 +342,16 @@ def get_last_purchase_details(item_code, doc_name=None, conversion_rate=1.0): # use purchase order last_purchase = last_purchase_order[0] purchase_date = purchase_order_date - + elif (purchase_receipt_date > purchase_order_date) or \ (last_purchase_receipt and not last_purchase_order): # use purchase receipt last_purchase = last_purchase_receipt[0] purchase_date = purchase_receipt_date - + else: return frappe._dict() - + conversion_factor = flt(last_purchase.conversion_factor) out = frappe._dict({ "base_price_list_rate": flt(last_purchase.base_price_list_rate) / conversion_factor, @@ -366,5 +366,5 @@ def get_last_purchase_details(item_code, doc_name=None, conversion_rate=1.0): "rate": out.base_rate / conversion_rate, "base_rate": out.base_rate }) - - return out \ No newline at end of file + + return out diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py index 3f67cd2fcc..156751e89c 100644 --- a/erpnext/stock/doctype/material_request/material_request.py +++ b/erpnext/stock/doctype/material_request/material_request.py @@ -169,11 +169,10 @@ def update_completed_qty(doc, method): for mr_name, mr_items in material_request_map.items(): mr_obj = frappe.get_doc("Material Request", mr_name) - mr_doctype = frappe.get_meta("Material Request") if mr_obj.status in ["Stopped", "Cancelled"]: frappe.throw(_("Material Request") + ": %s, " % mr_obj.name - + _(mr_doctype.get_label("status")) + " = %s. " % _(mr_obj.status) + + _(mr_obj.meta.get_label("status")) + " = %s. " % _(mr_obj.status) + _("Cannot continue."), exc=frappe.InvalidStatusError) _update_requested_qty(doc, mr_obj, mr_items) diff --git a/erpnext/stock/doctype/material_request/test_material_request.py b/erpnext/stock/doctype/material_request/test_material_request.py index a799c3b6dd..7719dfd90a 100644 --- a/erpnext/stock/doctype/material_request/test_material_request.py +++ b/erpnext/stock/doctype/material_request/test_material_request.py @@ -24,7 +24,7 @@ class TestMaterialRequest(unittest.TestCase): mr.submit() po = make_purchase_order(mr.name) - self.assertEquals(po["doctype"], "Purchase Order") + self.assertEquals(po.doctype, "Purchase Order") self.assertEquals(len(po.get("po_details")), len(mr.get("indent_details"))) def test_make_supplier_quotation(self): @@ -38,7 +38,7 @@ class TestMaterialRequest(unittest.TestCase): mr.submit() sq = make_supplier_quotation(mr.name) - self.assertEquals(sq["doctype"], "Supplier Quotation") + self.assertEquals(sq.doctype, "Supplier Quotation") self.assertEquals(len(sq.get("quotation_items")), len(mr.get("indent_details"))) @@ -55,14 +55,9 @@ class TestMaterialRequest(unittest.TestCase): mr.submit() se = make_stock_entry(mr.name) - self.assertEquals(se["doctype"], "Stock Entry") + self.assertEquals(se.doctype, "Stock Entry") self.assertEquals(len(se.get("mtn_details")), len(mr.get("indent_details"))) - def _test_expected(self, doc, expected_values): - for i, expected in enumerate(expected_values): - for fieldname, val in expected.items(): - self.assertEquals(val, doc.get(fieldname)) - def _test_requested_qty(self, qty1, qty2): self.assertEqual(flt(frappe.db.get_value("Bin", {"item_code": "_Test Item Home Desktop 100", "warehouse": "_Test Warehouse - _TC"}, "indented_qty")), qty1) @@ -116,28 +111,34 @@ class TestMaterialRequest(unittest.TestCase): mr.submit() # check if per complete is None - self._test_expected(mr, [{"per_ordered": None}, {"ordered_qty": None}, {"ordered_qty": None}]) + self.assertEquals(mr.per_ordered, None) + self.assertEquals(mr.get("indent_details")[0].ordered_qty, 0) + self.assertEquals(mr.get("indent_details")[1].ordered_qty, 0) self._test_requested_qty(54.0, 3.0) # map a purchase order from erpnext.stock.doctype.material_request.material_request import make_purchase_order po_doc = make_purchase_order(mr.name) - po_doc["supplier"] = "_Test Supplier" - po_doc["transaction_date"] = "2013-07-07" - po_doc.get("po_details")[0]["qty"] = 27.0 - po_doc.get("po_details")[1]["qty"] = 1.5 - po_doc.get("po_details")[0]["schedule_date"] = "2013-07-09" - po_doc.get("po_details")[1]["schedule_date"] = "2013-07-09" + po_doc.supplier = "_Test Supplier" + po_doc.transaction_date = "2013-07-07" + po_doc.get("po_details")[0].qty = 27.0 + po_doc.get("po_details")[1].qty = 1.5 + po_doc.get("po_details")[0].schedule_date = "2013-07-09" + po_doc.get("po_details")[1].schedule_date = "2013-07-09" # check for stopped status of Material Request po = frappe.copy_doc(po_doc) po.insert() + po.load_from_db() mr.update_status('Stopped') - self.assertRaises(frappe.ValidationError, po.submit) - self.assertRaises(frappe.ValidationError, po.cancel) + self.assertRaises(frappe.InvalidStatusError, po.submit) + frappe.db.set(po, "docstatus", 1) + self.assertRaises(frappe.InvalidStatusError, po.cancel) + # resubmit and check for per complete + mr.load_from_db() mr.update_status('Submitted') po = frappe.copy_doc(po_doc) po.insert() @@ -145,13 +146,18 @@ class TestMaterialRequest(unittest.TestCase): # check if per complete is as expected mr.load_from_db() - self._test_expected(mr, [{"per_ordered": 50}, {"ordered_qty": 27.0}, {"ordered_qty": 1.5}]) + self.assertEquals(mr.per_ordered, 50) + self.assertEquals(mr.get("indent_details")[0].ordered_qty, 27.0) + self.assertEquals(mr.get("indent_details")[1].ordered_qty, 1.5) self._test_requested_qty(27.0, 1.5) po.cancel() # check if per complete is as expected mr.load_from_db() - self._test_expected(mr, [{"per_ordered": None}, {"ordered_qty": None}, {"ordered_qty": None}]) + self.assertEquals(mr.per_ordered, None) + self.assertEquals(mr.get("indent_details")[0].ordered_qty, None) + self.assertEquals(mr.get("indent_details")[1].ordered_qty, None) + self._test_requested_qty(54.0, 3.0) def test_completed_qty_for_transfer(self): @@ -165,7 +171,9 @@ class TestMaterialRequest(unittest.TestCase): mr.submit() # check if per complete is None - self._test_expected(mr, [{"per_ordered": None}, {"ordered_qty": None}, {"ordered_qty": None}]) + self.assertEquals(mr.per_ordered, None) + self.assertEquals(mr.get("indent_details")[0].ordered_qty, 0) + self.assertEquals(mr.get("indent_details")[1].ordered_qty, 0) self._test_requested_qty(54.0, 3.0) @@ -198,8 +206,12 @@ class TestMaterialRequest(unittest.TestCase): se = frappe.copy_doc(se_doc) se.insert() mr.update_status('Stopped') - self.assertRaises(frappe.ValidationError, se.submit) - self.assertRaises(frappe.ValidationError, se.cancel) + self.assertRaises(frappe.InvalidStatusError, se.submit) + + mr.update_status('Submitted') + se.submit() + mr.update_status('Stopped') + self.assertRaises(frappe.InvalidStatusError, se.cancel) mr.update_status('Submitted') se = frappe.copy_doc(se_doc) @@ -208,13 +220,19 @@ class TestMaterialRequest(unittest.TestCase): # check if per complete is as expected mr.load_from_db() - self._test_expected(mr, [{"per_ordered": 50}, {"ordered_qty": 27.0}, {"ordered_qty": 1.5}]) + self.assertEquals(mr.per_ordered, 50) + self.assertEquals(mr.get("indent_details")[0].ordered_qty, 27.0) + self.assertEquals(mr.get("indent_details")[1].ordered_qty, 1.5) + self._test_requested_qty(27.0, 1.5) # check if per complete is as expected for Stock Entry cancelled se.cancel() mr.load_from_db() - self._test_expected(mr, [{"per_ordered": 0}, {"ordered_qty": 0}, {"ordered_qty": 0}]) + self.assertEquals(mr.per_ordered, 0) + self.assertEquals(mr.get("indent_details")[0].ordered_qty, 0) + self.assertEquals(mr.get("indent_details")[1].ordered_qty, 0) + self._test_requested_qty(54.0, 3.0) def test_completed_qty_for_over_transfer(self): @@ -228,7 +246,9 @@ class TestMaterialRequest(unittest.TestCase): mr.submit() # check if per complete is None - self._test_expected(mr, [{"per_ordered": None}, {"ordered_qty": None}, {"ordered_qty": None}]) + self.assertEquals(mr.per_ordered, None) + self.assertEquals(mr.get("indent_details")[0].ordered_qty, 0) + self.assertEquals(mr.get("indent_details")[1].ordered_qty, 0) self._test_requested_qty(54.0, 3.0) @@ -261,8 +281,8 @@ class TestMaterialRequest(unittest.TestCase): se = frappe.copy_doc(se_doc) se.insert() mr.update_status('Stopped') - self.assertRaises(frappe.ValidationError, se.submit) - self.assertRaises(frappe.ValidationError, se.cancel) + self.assertRaises(frappe.InvalidStatusError, se.submit) + self.assertRaises(frappe.InvalidStatusError, se.cancel) mr.update_status('Submitted') se = frappe.copy_doc(se_doc) @@ -271,13 +291,19 @@ class TestMaterialRequest(unittest.TestCase): # check if per complete is as expected mr.load_from_db() - self._test_expected(mr, [{"per_ordered": 100}, {"ordered_qty": 60.0}, {"ordered_qty": 3.0}]) + + self.assertEquals(mr.per_ordered, 100) + self.assertEquals(mr.get("indent_details")[0].ordered_qty, 60.0) + self.assertEquals(mr.get("indent_details")[1].ordered_qty, 3.0) self._test_requested_qty(0.0, 0.0) # check if per complete is as expected for Stock Entry cancelled se.cancel() mr.load_from_db() - self._test_expected(mr, [{"per_ordered": 0}, {"ordered_qty": 0}, {"ordered_qty": 0}]) + self.assertEquals(mr.per_ordered, 0) + self.assertEquals(mr.get("indent_details")[0].ordered_qty, 0) + self.assertEquals(mr.get("indent_details")[1].ordered_qty, 0) + self._test_requested_qty(54.0, 3.0) def test_incorrect_mapping_of_stock_entry(self): diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py index 03250a6263..7626112f52 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py @@ -14,19 +14,21 @@ from erpnext.controllers.buying_controller import BuyingController class PurchaseReceipt(BuyingController): tname = 'Purchase Receipt Item' fname = 'purchase_receipt_details' - count = 0 - status_updater = [{ - 'source_dt': 'Purchase Receipt Item', - 'target_dt': 'Purchase Order Item', - 'join_field': 'prevdoc_detail_docname', - 'target_field': 'received_qty', - 'target_parent_dt': 'Purchase Order', - 'target_parent_field': 'per_received', - 'target_ref_field': 'qty', - 'source_field': 'qty', - 'percent_join_field': 'prevdoc_docname', - }] - + + def __init__(self, arg1, arg2=None): + super(PurchaseReceipt, self).__init__(arg1, arg2) + self.status_updater = [{ + 'source_dt': 'Purchase Receipt Item', + 'target_dt': 'Purchase Order Item', + 'join_field': 'prevdoc_detail_docname', + 'target_field': 'received_qty', + 'target_parent_dt': 'Purchase Order', + 'target_parent_field': 'per_received', + 'target_ref_field': 'qty', + 'source_field': 'qty', + 'percent_join_field': 'prevdoc_docname', + }] + def onload(self): billed_qty = frappe.db.sql("""select sum(ifnull(qty, 0)) from `tabPurchase Invoice Item` where purchase_receipt=%s""", self.name) @@ -36,7 +38,7 @@ class PurchaseReceipt(BuyingController): def validate(self): super(PurchaseReceipt, self).validate() - + self.po_required() if not self.status: @@ -60,7 +62,7 @@ class PurchaseReceipt(BuyingController): # sub-contracting self.validate_for_subcontracting() self.update_raw_materials_supplied("pr_raw_material_details") - + self.update_valuation_rate("purchase_receipt_details") def validate_rejected_warehouse(self): @@ -68,7 +70,7 @@ class PurchaseReceipt(BuyingController): if flt(d.rejected_qty) and not d.rejected_warehouse: d.rejected_warehouse = self.rejected_warehouse if not d.rejected_warehouse: - frappe.throw(_("Rejected Warehouse is mandatory against regected item")) + frappe.throw(_("Rejected Warehouse is mandatory against regected item")) # validate accepted and rejected qty def validate_accepted_rejected_qty(self): @@ -99,7 +101,7 @@ class PurchaseReceipt(BuyingController): if exists: frappe.msgprint("Another Purchase Receipt using the same Challan No. already exists.\ Please enter a valid Challan No.", raise_exception=1) - + def validate_with_previous_doc(self): super(PurchaseReceipt, self).validate_with_previous_doc(self.tname, { "Purchase Order": { @@ -112,7 +114,7 @@ class PurchaseReceipt(BuyingController): "is_child_table": True } }) - + if cint(frappe.defaults.get_global_default('maintain_same_rate')): super(PurchaseReceipt, self).validate_with_previous_doc(self.tname, { "Purchase Order Item": { @@ -121,7 +123,7 @@ class PurchaseReceipt(BuyingController): "is_child_table": True } }) - + def po_required(self): if frappe.db.get_value("Buying Settings", None, "po_required") == 'Yes': @@ -133,18 +135,18 @@ class PurchaseReceipt(BuyingController): def update_stock(self): sl_entries = [] stock_items = self.get_stock_items() - + for d in self.get('purchase_receipt_details'): if d.item_code in stock_items and d.warehouse: pr_qty = flt(d.qty) * flt(d.conversion_factor) - + if pr_qty: sl_entries.append(self.get_sl_entries(d, { "actual_qty": flt(pr_qty), "serial_no": cstr(d.serial_no).strip(), "incoming_rate": d.valuation_rate })) - + if flt(d.rejected_qty) > 0: sl_entries.append(self.get_sl_entries(d, { "warehouse": d.rejected_warehouse, @@ -152,28 +154,28 @@ class PurchaseReceipt(BuyingController): "serial_no": cstr(d.rejected_serial_no).strip(), "incoming_rate": d.valuation_rate })) - + self.bk_flush_supp_wh(sl_entries) self.make_sl_entries(sl_entries) - + def update_ordered_qty(self): stock_items = self.get_stock_items() for d in self.get("purchase_receipt_details"): if d.item_code in stock_items and d.warehouse \ and cstr(d.prevdoc_doctype) == 'Purchase Order': - - already_received_qty = self.get_already_received_qty(d.prevdoc_docname, + + already_received_qty = self.get_already_received_qty(d.prevdoc_docname, d.prevdoc_detail_docname) po_qty, ordered_warehouse = self.get_po_qty_and_warehouse(d.prevdoc_detail_docname) - + if not ordered_warehouse: frappe.throw(_("Warehouse is missing in Purchase Order")) - + if already_received_qty + d.qty > po_qty: ordered_qty = - (po_qty - already_received_qty) * flt(d.conversion_factor) else: ordered_qty = - flt(d.qty) * flt(d.conversion_factor) - + update_bin({ "item_code": d.item_code, "warehouse": ordered_warehouse, @@ -182,20 +184,20 @@ class PurchaseReceipt(BuyingController): }) def get_already_received_qty(self, po, po_detail): - qty = frappe.db.sql("""select sum(qty) from `tabPurchase Receipt Item` - where prevdoc_detail_docname = %s and docstatus = 1 - and prevdoc_doctype='Purchase Order' and prevdoc_docname=%s + qty = frappe.db.sql("""select sum(qty) from `tabPurchase Receipt Item` + where prevdoc_detail_docname = %s and docstatus = 1 + and prevdoc_doctype='Purchase Order' and prevdoc_docname=%s and parent != %s""", (po_detail, po, self.name)) return qty and flt(qty[0][0]) or 0.0 - + def get_po_qty_and_warehouse(self, po_detail): - po_qty, po_warehouse = frappe.db.get_value("Purchase Order Item", po_detail, + po_qty, po_warehouse = frappe.db.get_value("Purchase Order Item", po_detail, ["qty", "warehouse"]) return po_qty, po_warehouse - + def bk_flush_supp_wh(self, sl_entries): for d in self.get('pr_raw_material_details'): - # negative quantity is passed as raw material qty has to be decreased + # negative quantity is passed as raw material qty has to be decreased # when PR is submitted and it has to be increased when PR is cancelled sl_entries.append(self.get_sl_entries(d, { "item_code": d.rm_item_code, @@ -231,22 +233,22 @@ class PurchaseReceipt(BuyingController): frappe.db.set(self, 'status', 'Submitted') self.update_prevdoc_status() - + self.update_ordered_qty() - + self.update_stock() from erpnext.stock.doctype.serial_no.serial_no import update_serial_nos_after_submit update_serial_nos_after_submit(self, "purchase_receipt_details") purchase_controller.update_last_purchase_rate(self, 1) - + self.make_gl_entries() def check_next_docstatus(self): - submit_rv = frappe.db.sql("""select t1.name - from `tabPurchase Invoice` t1,`tabPurchase Invoice Item` t2 - where t1.name = t2.parent and t2.purchase_receipt = %s and t1.docstatus = 1""", + submit_rv = frappe.db.sql("""select t1.name + from `tabPurchase Invoice` t1,`tabPurchase Invoice Item` t2 + where t1.name = t2.parent and t2.purchase_receipt = %s and t1.docstatus = 1""", (self.name)) if submit_rv: msgprint("Purchase Invoice : " + cstr(self.submit_rv[0][0]) + " has already been submitted !") @@ -258,25 +260,25 @@ class PurchaseReceipt(BuyingController): self.check_for_stopped_status(pc_obj) # Check if Purchase Invoice has been submitted against current Purchase Order - submitted = frappe.db.sql("""select t1.name - from `tabPurchase Invoice` t1,`tabPurchase Invoice Item` t2 - where t1.name = t2.parent and t2.purchase_receipt = %s and t1.docstatus = 1""", + submitted = frappe.db.sql("""select t1.name + from `tabPurchase Invoice` t1,`tabPurchase Invoice Item` t2 + where t1.name = t2.parent and t2.purchase_receipt = %s and t1.docstatus = 1""", self.name) if submitted: - frappe.throw("Purchase Invoice : " + cstr(submitted[0][0]) + + frappe.throw("Purchase Invoice : " + cstr(submitted[0][0]) + " has already been submitted !") - + frappe.db.set(self,'status','Cancelled') self.update_ordered_qty() - + self.update_stock() self.update_prevdoc_status() pc_obj.update_last_purchase_rate(self, 0) - + self.make_cancel_gl_entries() - + def get_current_stock(self): for d in self.get('pr_raw_material_details'): if self.supplier_warehouse: @@ -285,42 +287,42 @@ class PurchaseReceipt(BuyingController): def get_rate(self,arg): return frappe.get_doc('Purchase Common').get_rate(arg,self) - + def get_gl_entries(self, warehouse_account=None): against_stock_account = self.get_company_default("stock_received_but_not_billed") - + gl_entries = super(PurchaseReceipt, self).get_gl_entries(warehouse_account, against_stock_account) return gl_entries - - + + @frappe.whitelist() def make_purchase_invoice(source_name, target_doc=None): from frappe.model.mapper import get_mapped_doc - + def set_missing_values(source, target): doc = frappe.get_doc(target) doc.run_method("set_missing_values") doclist = get_mapped_doc("Purchase Receipt", source_name, { "Purchase Receipt": { - "doctype": "Purchase Invoice", + "doctype": "Purchase Invoice", "validation": { "docstatus": ["=", 1], } - }, + }, "Purchase Receipt Item": { - "doctype": "Purchase Invoice Item", + "doctype": "Purchase Invoice Item", "field_map": { - "name": "pr_detail", - "parent": "purchase_receipt", - "prevdoc_detail_docname": "po_detail", - "prevdoc_docname": "purchase_order", + "name": "pr_detail", + "parent": "purchase_receipt", + "prevdoc_detail_docname": "po_detail", + "prevdoc_docname": "purchase_order", }, - }, + }, "Purchase Taxes and Charges": { - "doctype": "Purchase Taxes and Charges", + "doctype": "Purchase Taxes and Charges", "add_if_empty": True } }, target_doc, set_missing_values) - return doclist \ No newline at end of file + return doclist diff --git a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py index f0de633ca6..0aa3accd4a 100644 --- a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py @@ -15,88 +15,88 @@ class TestPurchaseReceipt(unittest.TestCase): from erpnext.stock.doctype.purchase_receipt.purchase_receipt import make_purchase_invoice pr = frappe.copy_doc(test_records[0]).insert() - - self.assertRaises(frappe.ValidationError, make_purchase_invoice, + + self.assertRaises(frappe.ValidationError, make_purchase_invoice, pr.name) pr = frappe.get_doc("Purchase Receipt", pr.name) pr.submit() pi = make_purchase_invoice(pr.name) - - self.assertEquals(pi["doctype"], "Purchase Invoice") + + self.assertEquals(pi.doctype, "Purchase Invoice") self.assertEquals(len(pi.get("entries")), len(pr.get("purchase_receipt_details"))) - + # modify rate - pi.get("entries")[0]["rate"] = 200 + pi.get("entries")[0].rate = 200 self.assertRaises(frappe.ValidationError, frappe.get_doc(pi).submit) - + def test_purchase_receipt_no_gl_entry(self): self._clear_stock_account_balance() set_perpetual_inventory(0) pr = frappe.copy_doc(test_records[0]) pr.insert() pr.submit() - - stock_value, stock_value_difference = frappe.db.get_value("Stock Ledger Entry", - {"voucher_type": "Purchase Receipt", "voucher_no": pr.name, - "item_code": "_Test Item", "warehouse": "_Test Warehouse - _TC"}, + + stock_value, stock_value_difference = frappe.db.get_value("Stock Ledger Entry", + {"voucher_type": "Purchase Receipt", "voucher_no": pr.name, + "item_code": "_Test Item", "warehouse": "_Test Warehouse - _TC"}, ["stock_value", "stock_value_difference"]) self.assertEqual(stock_value, 375) self.assertEqual(stock_value_difference, 375) - - bin_stock_value = frappe.db.get_value("Bin", {"item_code": "_Test Item", + + bin_stock_value = frappe.db.get_value("Bin", {"item_code": "_Test Item", "warehouse": "_Test Warehouse - _TC"}, "stock_value") self.assertEqual(bin_stock_value, 375) - + self.assertFalse(get_gl_entries("Purchase Receipt", pr.name)) - + def test_purchase_receipt_gl_entry(self): self._clear_stock_account_balance() - + set_perpetual_inventory() self.assertEqual(cint(frappe.defaults.get_global_default("auto_accounting_for_stock")), 1) - + pr = frappe.copy_doc(test_records[0]) pr.insert() pr.submit() - + gl_entries = get_gl_entries("Purchase Receipt", pr.name) - + self.assertTrue(gl_entries) - - stock_in_hand_account = frappe.db.get_value("Account", - {"master_name": pr.get("purchase_receipt_details")[0].warehouse}) - fixed_asset_account = frappe.db.get_value("Account", + + stock_in_hand_account = frappe.db.get_value("Account", + {"master_name": pr.get("purchase_receipt_details")[0].warehouse}) + fixed_asset_account = frappe.db.get_value("Account", {"master_name": pr.get("purchase_receipt_details")[1].warehouse}) - + expected_values = { stock_in_hand_account: [375.0, 0.0], fixed_asset_account: [375.0, 0.0], "Stock Received But Not Billed - _TC": [0.0, 750.0] } - + for gle in gl_entries: self.assertEquals(expected_values[gle.account][0], gle.debit) self.assertEquals(expected_values[gle.account][1], gle.credit) - + pr.cancel() self.assertFalse(get_gl_entries("Purchase Receipt", pr.name)) - + set_perpetual_inventory(0) - + def _clear_stock_account_balance(self): frappe.db.sql("delete from `tabStock Ledger Entry`") frappe.db.sql("""delete from `tabBin`""") frappe.db.sql("""delete from `tabGL Entry`""") - + def test_subcontracting(self): pr = frappe.copy_doc(test_records[1]) pr.run_method("calculate_taxes_and_totals") pr.insert() - + self.assertEquals(pr.get("purchase_receipt_details")[0].rm_supp_cost, 70000.0) self.assertEquals(len(pr.get("pr_raw_material_details")), 2) - + def test_serial_no_supplier(self): pr = frappe.copy_doc(test_records[0]) pr.get("purchase_receipt_details")[0].item_code = "_Test Serialized Item With Series" @@ -104,30 +104,30 @@ class TestPurchaseReceipt(unittest.TestCase): pr.get("purchase_receipt_details")[0].received_qty = 1 pr.insert() pr.submit() - - self.assertEquals(frappe.db.get_value("Serial No", pr.get("purchase_receipt_details")[0].serial_no, + + self.assertEquals(frappe.db.get_value("Serial No", pr.get("purchase_receipt_details")[0].serial_no, "supplier"), pr.supplier) - + return pr - + def test_serial_no_cancel(self): pr = self.test_serial_no_supplier() pr.cancel() - - self.assertFalse(frappe.db.get_value("Serial No", pr.get("purchase_receipt_details")[0].serial_no, + + self.assertFalse(frappe.db.get_value("Serial No", pr.get("purchase_receipt_details")[0].serial_no, "warehouse")) - + def get_gl_entries(voucher_type, voucher_no): return frappe.db.sql("""select account, debit, credit from `tabGL Entry` where voucher_type=%s and voucher_no=%s order by account desc""", (voucher_type, voucher_no), as_dict=1) - + def set_perpetual_inventory(enable=1): accounts_settings = frappe.get_doc("Accounts Settings") accounts_settings.auto_accounting_for_stock = enable accounts_settings.save() - - + + test_dependencies = ["BOM"] -test_records = frappe.get_test_records('Purchase Receipt') \ No newline at end of file +test_records = frappe.get_test_records('Purchase Receipt') diff --git a/erpnext/stock/doctype/stock_entry/test_stock_entry.py b/erpnext/stock/doctype/stock_entry/test_stock_entry.py index f8cdeb79d1..f5fd08cfb4 100644 --- a/erpnext/stock/doctype/stock_entry/test_stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/test_stock_entry.py @@ -407,14 +407,14 @@ class TestStockEntry(unittest.TestCase): from erpnext.selling.doctype.sales_order.sales_order import make_sales_invoice, make_delivery_note actual_qty_0 = self._get_actual_qty() + so = frappe.copy_doc(sales_order_test_records[0]) so.get("sales_order_details")[0].item_code = item_code so.get("sales_order_details")[0].qty = 5.0 so.insert() so.submit() - dn_doc = make_delivery_note(so.name) - dn = frappe.get_doc(dn_doc) + dn = make_delivery_note(so.name) dn.status = "Draft" dn.posting_date = so.delivery_date dn.insert() @@ -423,9 +423,7 @@ class TestStockEntry(unittest.TestCase): actual_qty_1 = self._get_actual_qty() self.assertEquals(actual_qty_0 - delivered_qty, actual_qty_1) - si_doc = make_sales_invoice(so.name) - - si = frappe.get_doc(si_doc) + si = make_sales_invoice(so.name) si.posting_date = dn.posting_date si.debit_to = "_Test Customer - _TC" for d in si.get("entries"): diff --git a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py index c1ffd02b51..37886ce1a1 100644 --- a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py @@ -14,15 +14,15 @@ from erpnext.accounts.utils import get_fiscal_year, get_stock_and_account_differ class TestStockReconciliation(unittest.TestCase): def test_reco_for_fifo(self): frappe.defaults.set_global_default("auto_accounting_for_stock", 0) - # [[qty, valuation_rate, posting_date, + # [[qty, valuation_rate, posting_date, # posting_time, expected_stock_value, bin_qty, bin_valuation]] input_data = [ - [50, 1000, "2012-12-26", "12:00", 50000, 45, 48000], - [5, 1000, "2012-12-26", "12:00", 5000, 0, 0], - [15, 1000, "2012-12-26", "12:00", 15000, 10, 12000], - [25, 900, "2012-12-26", "12:00", 22500, 20, 22500], - [20, 500, "2012-12-26", "12:00", 10000, 15, 18000], - [50, 1000, "2013-01-01", "12:00", 50000, 65, 68000], + [50, 1000, "2012-12-26", "12:00", 50000, 45, 48000], + [5, 1000, "2012-12-26", "12:00", 5000, 0, 0], + [15, 1000, "2012-12-26", "12:00", 15000, 10, 12000], + [25, 900, "2012-12-26", "12:00", 22500, 20, 22500], + [20, 500, "2012-12-26", "12:00", 10000, 15, 18000], + [50, 1000, "2013-01-01", "12:00", 50000, 65, 68000], [5, 1000, "2013-01-01", "12:00", 5000, 20, 23000], ["", 1000, "2012-12-26", "12:05", 15000, 10, 12000], [20, "", "2012-12-26", "12:05", 16000, 15, 18000], @@ -30,142 +30,142 @@ class TestStockReconciliation(unittest.TestCase): [1, 1000, "2012-12-01", "00:00", 1000, 11, 13200], [0, "", "2012-12-26", "12:10", 0, -5, 0] ] - + for d in input_data: self.cleanup_data() self.insert_existing_sle("FIFO") stock_reco = self.submit_stock_reconciliation(d[0], d[1], d[2], d[3]) - + # check stock value res = frappe.db.sql("""select stock_value from `tabStock Ledger Entry` where item_code = '_Test Item' and warehouse = '_Test Warehouse - _TC' - and posting_date = %s and posting_time = %s order by name desc limit 1""", + and posting_date = %s and posting_time = %s order by name desc limit 1""", (d[2], d[3])) self.assertEqual(res and flt(res[0][0]) or 0, d[4]) - + # check bin qty and stock value bin = frappe.db.sql("""select actual_qty, stock_value from `tabBin` where item_code = '_Test Item' and warehouse = '_Test Warehouse - _TC'""") - + self.assertEqual(bin and [flt(bin[0][0]), flt(bin[0][1])] or [], [d[5], d[6]]) - + # no gl entries - gl_entries = frappe.db.sql("""select name from `tabGL Entry` + gl_entries = frappe.db.sql("""select name from `tabGL Entry` where voucher_type = 'Stock Reconciliation' and voucher_no = %s""", stock_reco.name) self.assertFalse(gl_entries) - - + + def test_reco_for_moving_average(self): frappe.defaults.set_global_default("auto_accounting_for_stock", 0) - # [[qty, valuation_rate, posting_date, + # [[qty, valuation_rate, posting_date, # posting_time, expected_stock_value, bin_qty, bin_valuation]] input_data = [ - [50, 1000, "2012-12-26", "12:00", 50000, 45, 48000], - [5, 1000, "2012-12-26", "12:00", 5000, 0, 0], - [15, 1000, "2012-12-26", "12:00", 15000, 10, 12000], - [25, 900, "2012-12-26", "12:00", 22500, 20, 22500], - [20, 500, "2012-12-26", "12:00", 10000, 15, 18000], - [50, 1000, "2013-01-01", "12:00", 50000, 65, 68000], + [50, 1000, "2012-12-26", "12:00", 50000, 45, 48000], + [5, 1000, "2012-12-26", "12:00", 5000, 0, 0], + [15, 1000, "2012-12-26", "12:00", 15000, 10, 12000], + [25, 900, "2012-12-26", "12:00", 22500, 20, 22500], + [20, 500, "2012-12-26", "12:00", 10000, 15, 18000], + [50, 1000, "2013-01-01", "12:00", 50000, 65, 68000], [5, 1000, "2013-01-01", "12:00", 5000, 20, 23000], ["", 1000, "2012-12-26", "12:05", 15000, 10, 12000], [20, "", "2012-12-26", "12:05", 18000, 15, 18000], [10, 2000, "2012-12-26", "12:10", 20000, 5, 6000], [1, 1000, "2012-12-01", "00:00", 1000, 11, 13200], [0, "", "2012-12-26", "12:10", 0, -5, 0] - + ] - + for d in input_data: self.cleanup_data() self.insert_existing_sle("Moving Average") stock_reco = self.submit_stock_reconciliation(d[0], d[1], d[2], d[3]) - + # check stock value in sle res = frappe.db.sql("""select stock_value from `tabStock Ledger Entry` where item_code = '_Test Item' and warehouse = '_Test Warehouse - _TC' - and posting_date = %s and posting_time = %s order by name desc limit 1""", + and posting_date = %s and posting_time = %s order by name desc limit 1""", (d[2], d[3])) - + self.assertEqual(res and flt(res[0][0], 4) or 0, d[4]) - + # bin qty and stock value bin = frappe.db.sql("""select actual_qty, stock_value from `tabBin` where item_code = '_Test Item' and warehouse = '_Test Warehouse - _TC'""") - - self.assertEqual(bin and [flt(bin[0][0]), flt(bin[0][1], 4)] or [], + + self.assertEqual(bin and [flt(bin[0][0]), flt(bin[0][1], 4)] or [], [flt(d[5]), flt(d[6])]) - + # no gl entries - gl_entries = frappe.db.sql("""select name from `tabGL Entry` - where voucher_type = 'Stock Reconciliation' and voucher_no = %s""", + gl_entries = frappe.db.sql("""select name from `tabGL Entry` + where voucher_type = 'Stock Reconciliation' and voucher_no = %s""", stock_reco.name) self.assertFalse(gl_entries) - + def test_reco_fifo_gl_entries(self): frappe.defaults.set_global_default("auto_accounting_for_stock", 1) - + # [[qty, valuation_rate, posting_date, posting_time, stock_in_hand_debit]] input_data = [ - [50, 1000, "2012-12-26", "12:00"], - [5, 1000, "2012-12-26", "12:00"], - [15, 1000, "2012-12-26", "12:00"], - [25, 900, "2012-12-26", "12:00"], - [20, 500, "2012-12-26", "12:00"], + [50, 1000, "2012-12-26", "12:00"], + [5, 1000, "2012-12-26", "12:00"], + [15, 1000, "2012-12-26", "12:00"], + [25, 900, "2012-12-26", "12:00"], + [20, 500, "2012-12-26", "12:00"], ["", 1000, "2012-12-26", "12:05"], [20, "", "2012-12-26", "12:05"], [10, 2000, "2012-12-26", "12:10"], [0, "", "2012-12-26", "12:10"], - [50, 1000, "2013-01-01", "12:00"], + [50, 1000, "2013-01-01", "12:00"], [5, 1000, "2013-01-01", "12:00"], [1, 1000, "2012-12-01", "00:00"], ] - + for d in input_data: self.cleanup_data() self.insert_existing_sle("FIFO") self.assertFalse(get_stock_and_account_difference(["_Test Account Stock In Hand - _TC"])) stock_reco = self.submit_stock_reconciliation(d[0], d[1], d[2], d[3]) - - + + self.assertFalse(get_stock_and_account_difference(["_Test Account Stock In Hand - _TC"])) stock_reco.cancel() self.assertFalse(get_stock_and_account_difference(["_Test Account Stock In Hand - _TC"])) - + frappe.defaults.set_global_default("auto_accounting_for_stock", 0) - + def test_reco_moving_average_gl_entries(self): frappe.defaults.set_global_default("auto_accounting_for_stock", 1) - - # [[qty, valuation_rate, posting_date, + + # [[qty, valuation_rate, posting_date, # posting_time, stock_in_hand_debit]] input_data = [ - [50, 1000, "2012-12-26", "12:00", 36500], - [5, 1000, "2012-12-26", "12:00", -8500], - [15, 1000, "2012-12-26", "12:00", 1500], - [25, 900, "2012-12-26", "12:00", 9000], - [20, 500, "2012-12-26", "12:00", -3500], + [50, 1000, "2012-12-26", "12:00", 36500], + [5, 1000, "2012-12-26", "12:00", -8500], + [15, 1000, "2012-12-26", "12:00", 1500], + [25, 900, "2012-12-26", "12:00", 9000], + [20, 500, "2012-12-26", "12:00", -3500], ["", 1000, "2012-12-26", "12:05", 1500], [20, "", "2012-12-26", "12:05", 4500], [10, 2000, "2012-12-26", "12:10", 6500], [0, "", "2012-12-26", "12:10", -13500], - [50, 1000, "2013-01-01", "12:00", 50000], + [50, 1000, "2013-01-01", "12:00", 50000], [5, 1000, "2013-01-01", "12:00", 5000], [1, 1000, "2012-12-01", "00:00", 1000], - + ] - + for d in input_data: self.cleanup_data() self.insert_existing_sle("Moving Average") stock_reco = self.submit_stock_reconciliation(d[0], d[1], d[2], d[3]) self.assertFalse(get_stock_and_account_difference(["_Test Warehouse - _TC"])) - + # cancel stock_reco.cancel() self.assertFalse(get_stock_and_account_difference(["_Test Warehouse - _TC"])) - + frappe.defaults.set_global_default("auto_accounting_for_stock", 0) @@ -173,7 +173,7 @@ class TestStockReconciliation(unittest.TestCase): frappe.db.sql("delete from `tabStock Ledger Entry`") frappe.db.sql("delete from tabBin") frappe.db.sql("delete from `tabGL Entry`") - + def submit_stock_reconciliation(self, qty, rate, posting_date, posting_time): stock_reco = frappe.get_doc({ "doctype": "Stock Reconciliation", @@ -191,40 +191,40 @@ class TestStockReconciliation(unittest.TestCase): stock_reco.insert() stock_reco.submit() return stock_reco - + def insert_existing_sle(self, valuation_method): frappe.db.set_value("Item", "_Test Item", "valuation_method", valuation_method) frappe.db.set_default("allow_negative_stock", 1) - - stock_entry = [ - { - "company": "_Test Company", - "doctype": "Stock Entry", - "posting_date": "2012-12-12", - "posting_time": "01:00", - "purpose": "Material Receipt", - "fiscal_year": "_Test Fiscal Year 2012", - }, - { - "conversion_factor": 1.0, - "doctype": "Stock Entry Detail", - "item_code": "_Test Item", - "parentfield": "mtn_details", - "incoming_rate": 1000, - "qty": 20.0, - "stock_uom": "_Test UOM", - "transfer_qty": 20.0, - "uom": "_Test UOM", - "t_warehouse": "_Test Warehouse - _TC", - "expense_account": "Stock Adjustment - _TC", - "cost_center": "_Test Cost Center - _TC" - }, - ] - + + stock_entry = { + "company": "_Test Company", + "doctype": "Stock Entry", + "posting_date": "2012-12-12", + "posting_time": "01:00", + "purpose": "Material Receipt", + "fiscal_year": "_Test Fiscal Year 2012", + "mtn_details": [ + { + "conversion_factor": 1.0, + "doctype": "Stock Entry Detail", + "item_code": "_Test Item", + "parentfield": "mtn_details", + "incoming_rate": 1000, + "qty": 20.0, + "stock_uom": "_Test UOM", + "transfer_qty": 20.0, + "uom": "_Test UOM", + "t_warehouse": "_Test Warehouse - _TC", + "expense_account": "Stock Adjustment - _TC", + "cost_center": "_Test Cost Center - _TC" + } + ] + } + pr = frappe.copy_doc(stock_entry) pr.insert() pr.submit() - + pr1 = frappe.copy_doc(stock_entry) pr1.posting_date = "2012-12-15" pr1.posting_time = "02:00" @@ -233,7 +233,7 @@ class TestStockReconciliation(unittest.TestCase): pr1.get("mtn_details")[0].incoming_rate = 700 pr1.insert() pr1.submit() - + pr2 = frappe.copy_doc(stock_entry) pr2.posting_date = "2012-12-25" pr2.posting_time = "03:00" @@ -245,7 +245,7 @@ class TestStockReconciliation(unittest.TestCase): pr2.get("mtn_details")[0].incoming_rate = 0 pr2.insert() pr2.submit() - + pr3 = frappe.copy_doc(stock_entry) pr3.posting_date = "2012-12-31" pr3.posting_time = "08:00" @@ -257,8 +257,8 @@ class TestStockReconciliation(unittest.TestCase): pr3.get("mtn_details")[0].incoming_rate = 0 pr3.insert() pr3.submit() - - + + pr4 = frappe.copy_doc(stock_entry) pr4.posting_date = "2013-01-05" pr4.fiscal_year = "_Test Fiscal Year 2013" @@ -268,6 +268,6 @@ class TestStockReconciliation(unittest.TestCase): pr4.get("mtn_details")[0].incoming_rate = 1200 pr4.insert() pr4.submit() - - -test_dependencies = ["Item", "Warehouse"] \ No newline at end of file + + +test_dependencies = ["Item", "Warehouse"] diff --git a/erpnext/support/doctype/newsletter/test_newsletter.py b/erpnext/support/doctype/newsletter/test_newsletter.py index 3d89b9a136..a8ff683fd5 100644 --- a/erpnext/support/doctype/newsletter/test_newsletter.py +++ b/erpnext/support/doctype/newsletter/test_newsletter.py @@ -7,36 +7,36 @@ class TestNewsletter(unittest.TestCase): def test_get_recipients_lead(self): w = frappe.get_doc(test_records[0]) w.insert() - self.assertTrue("test_lead@example.com" in w.controller.get_recipients()) + self.assertTrue("test_lead@example.com" in w.get_recipients()) frappe.db.sql("""delete from `tabBulk Email`""") - w.controller.send_emails() + w.send_emails() self.assertTrue(frappe.db.get_value("Bulk Email", {"recipient": "test_lead@example.com"})) def test_get_recipients_lead_by_status(self): w = frappe.get_doc(test_records[0]) w.lead_status="Converted" w.insert() - self.assertTrue("test_lead3@example.com" in w.controller.get_recipients()) + self.assertTrue("test_lead3@example.com" in w.get_recipients()) def test_get_recipients_contact_customer(self): w = frappe.get_doc(test_records[1]) w.insert() - self.assertTrue("test_contact_customer@example.com" in w.controller.get_recipients()) + self.assertTrue("test_contact_customer@example.com" in w.get_recipients()) def test_get_recipients_contact_supplier(self): w = frappe.get_doc(test_records[1]) w.contact_type="Supplier" w.insert() - self.assertTrue("test_contact_supplier@example.com" in w.controller.get_recipients()) + self.assertTrue("test_contact_supplier@example.com" in w.get_recipients()) def test_get_recipients_custom(self): w = frappe.get_doc(test_records[2]) w.insert() - self.assertTrue("test_custom2@example.com" in w.controller.get_recipients()) - self.assertTrue(frappe.db.get("Lead", + self.assertTrue("test_custom2@example.com" in w.get_recipients()) + self.assertTrue(frappe.db.get("Lead", {"email_id": "test_custom2@example.com"})) test_dependencies = ["Lead", "Contact"] -test_records = frappe.get_test_records('Newsletter') \ No newline at end of file +test_records = frappe.get_test_records('Newsletter') From 20771621e71872231d2b5d9fecc8d3e7f65eea61 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 9 Apr 2014 20:03:27 +0530 Subject: [PATCH 41/42] Verbose app install in travis --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 73b758f72b..39e366c94d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,10 +17,10 @@ install: - CFLAGS=-O0 pip install git+https://github.com/frappe/frappe.git@develop && - pip install --editable . -script: +script: cd ./test_sites/ && frappe --reinstall test_site && - frappe --install_app erpnext test_site && + frappe --install_app erpnext test_site --verbose && frappe --request '?cmd=erpnext.setup.page.setup_wizard.setup_wizard.setup_account¤cy=USD&first_name=Test&last_name=User&company_name=Wind+Power+LLC&timezone=America/New_York&company_abbr=WP&industry=Manufacturing&country=United states&fy_start_date=2014-01-01&fy_end_date=2014-12-31' test_site && frappe --run_tests test_site --app erpnext From 8c45d4ce3cbbaf01b8912e3aea5e587d947373de Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 10 Apr 2014 11:38:11 +0530 Subject: [PATCH 42/42] Fixed travis frappe/frappe#478 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 39e366c94d..4c5b1714a3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,7 @@ install: script: cd ./test_sites/ && frappe --reinstall test_site && - frappe --install_app erpnext test_site --verbose && + frappe --install_app erpnext test_site && frappe --request '?cmd=erpnext.setup.page.setup_wizard.setup_wizard.setup_account¤cy=USD&first_name=Test&last_name=User&company_name=Wind+Power+LLC&timezone=America/New_York&company_abbr=WP&industry=Manufacturing&country=United states&fy_start_date=2014-01-01&fy_end_date=2014-12-31' test_site && frappe --run_tests test_site --app erpnext