From e7d153624f2f26c3d24e215d5568272d019d6b21 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 25 Dec 2014 16:01:55 +0530 Subject: [PATCH] Table Field Renaming: code replace, JV and budget distribution renamed --- .../bank_reconciliation.json | 6 +- .../bank_reconciliation.py | 2 +- .../doctype/budget_distribution/__init__.py | 1 - .../test_budget_distribution.py | 6 - .../budget_distribution_detail/README.md | 1 - .../budget_distribution_detail/__init__.py | 1 - erpnext/accounts/doctype/c_form/c_form.js | 4 +- erpnext/accounts/doctype/c_form/c_form.py | 6 +- .../doctype/cost_center/cost_center.js | 4 +- .../doctype/cost_center/cost_center.json | 4 +- .../doctype/cost_center/cost_center.py | 2 +- .../doctype/cost_center/test_records.json | 4 +- .../README.md | 0 .../doctype/journal_entry/__init__.py | 0 .../journal_entry.js} | 8 +- .../journal_entry.json} | 20 +- .../journal_entry.py} | 20 +- .../journal_entry_list.html} | 0 .../journal_entry_list.js} | 0 .../test_journal_entry.py} | 12 +- .../test_records.json | 12 +- .../README.md | 0 .../doctype/journal_entry_account/__init__.py | 0 .../journal_entry_account.json} | 6 +- .../journal_entry_account.py} | 8 +- .../doctype/journal_voucher/__init__.py | 1 - .../journal_voucher_detail/__init__.py | 1 - .../README.md | 0 .../doctype/monthly_distribution/__init__.py | 0 .../monthly_distribution.js} | 0 .../monthly_distribution.json} | 10 +- .../monthly_distribution.py} | 2 +- .../test_monthly_distribution.py | 10 + .../test_records.json | 2 +- .../__init__.py | 0 .../monthly_distribution_percentage.json} | 9 +- .../monthly_distribution_percentage.py} | 9 +- .../payment_reconciliation.js | 6 +- .../payment_reconciliation.py | 24 +- .../doctype/payment_tool/payment_tool.js | 16 +- .../doctype/payment_tool/payment_tool.py | 2 +- .../doctype/payment_tool/test_payment_tool.py | 2 +- .../purchase_invoice/purchase_invoice.js | 26 +- .../purchase_invoice/purchase_invoice.py | 12 +- .../purchase_invoice/test_purchase_invoice.py | 16 +- .../purchase_invoice/test_records.json | 36 +- .../purchase_taxes_and_charges_master.js | 16 +- .../purchase_taxes_and_charges_master.json | 4 +- .../test_purchase_taxes_and_charges_master.py | 10 + .../test_records.json | 6 + .../doctype/sales_invoice/sales_invoice.js | 26 +- .../doctype/sales_invoice/sales_invoice.py | 20 +- .../doctype/sales_invoice/test_records.json | 68 +-- .../sales_invoice/test_sales_invoice.py | 72 ++-- .../sales_taxes_and_charges_master.js | 16 +- .../sales_taxes_and_charges_master.py | 2 +- .../test_records.json | 44 +- .../doctype/shipping_rule/shipping_rule.py | 14 +- .../doctype/shipping_rule/test_records.json | 36 +- .../shipping_rule/test_shipping_rule.py | 12 +- .../print_format/pos_invoice/pos_invoice.json | 26 +- .../bank_clearance_summary.py | 2 +- .../bank_reconciliation_statement.py | 4 +- .../payment_period_based_on_invoice_date.py | 2 +- erpnext/accounts/utils.py | 8 +- .../purchase_common/purchase_common.js | 6 +- .../doctype/purchase_order/purchase_order.js | 14 +- .../doctype/purchase_order/purchase_order.py | 16 +- .../purchase_order/test_purchase_order.py | 22 +- .../doctype/purchase_order/test_records.json | 8 +- .../quality_inspection/quality_inspection.py | 4 +- erpnext/buying/doctype/supplier/supplier.js | 2 +- .../supplier_quotation/supplier_quotation.js | 6 +- .../supplier_quotation/supplier_quotation.py | 4 +- .../supplier_quotation/test_records.json | 4 +- .../test_supplier_quotation.py | 4 +- erpnext/controllers/accounts_controller.py | 10 +- erpnext/controllers/buying_controller.py | 14 +- erpnext/controllers/selling_controller.py | 20 +- erpnext/hr/doctype/appraisal/appraisal.js | 10 +- erpnext/hr/doctype/appraisal/appraisal.py | 2 +- .../appraisal_template/appraisal_template.py | 2 +- erpnext/hr/doctype/employee/employee.js | 2 +- erpnext/hr/doctype/employee/employee.py | 4 +- .../hr/doctype/expense_claim/expense_claim.js | 8 +- .../hr/doctype/expense_claim/expense_claim.py | 2 +- .../hr/doctype/holiday_list/holiday_list.py | 6 +- .../hr/doctype/holiday_list/test_records.json | 2 +- .../leave_application/leave_application.py | 2 +- .../test_leave_application.py | 6 +- .../doctype/salary_manager/salary_manager.js | 4 +- erpnext/hr/doctype/salary_slip/salary_slip.js | 8 +- erpnext/hr/doctype/salary_slip/salary_slip.py | 8 +- .../hr/doctype/salary_slip/test_records.json | 12 +- .../doctype/salary_slip/test_salary_slip.py | 16 +- .../salary_structure/salary_structure.js | 10 +- .../salary_structure/salary_structure.py | 8 +- erpnext/manufacturing/doctype/bom/bom.js | 24 +- erpnext/manufacturing/doctype/bom/bom.py | 20 +- erpnext/manufacturing/doctype/bom/test_bom.py | 12 +- .../doctype/bom/test_records.json | 26 +- .../production_order/production_order.js | 2 +- .../production_order/production_order.py | 14 +- .../production_order/test_production_order.py | 26 +- .../production_planning_tool.js | 12 +- .../production_planning_tool.py | 18 +- .../doctype/workstation/test_records.json | 2 +- .../doctype/workstation/workstation.py | 2 +- .../v4_0/create_price_list_if_missing.py | 2 +- ...to_sales_person_in_maintenance_schedule.py | 2 +- ...harges_in_custom_purchase_print_formats.py | 2 +- erpnext/patches/v4_2/party_model.py | 2 +- .../patches/v5_0/rename_table_fieldnames.py | 389 +++++++++--------- erpnext/projects/doctype/project/project.py | 8 +- erpnext/projects/doctype/time_log/time_log.js | 2 +- .../doctype/time_log/time_log_list.js | 2 +- .../time_log_batch/test_time_log_batch.py | 4 +- .../doctype/time_log_batch/time_log_batch.js | 2 +- .../doctype/time_log_batch/time_log_batch.py | 4 +- erpnext/public/js/feature_setup.js | 124 +++--- erpnext/public/js/utils.js | 4 +- erpnext/selling/doctype/customer/customer.js | 2 +- .../installation_note/installation_note.js | 2 +- .../installation_note/installation_note.py | 10 +- .../doctype/opportunity/opportunity.js | 4 +- .../doctype/opportunity/opportunity.py | 2 +- .../doctype/opportunity/test_records.json | 2 +- .../selling/doctype/quotation/quotation.js | 6 +- .../selling/doctype/quotation/quotation.py | 16 +- .../doctype/quotation/test_quotation.py | 6 +- .../doctype/quotation/test_records.json | 4 +- .../selling/doctype/sales_bom/sales_bom.js | 2 +- .../doctype/sales_bom/test_records.json | 6 +- .../doctype/sales_order/sales_order.js | 6 +- .../doctype/sales_order/sales_order.py | 10 +- .../doctype/sales_order/test_records.json | 4 +- .../doctype/sales_order/test_sales_order.py | 138 +++---- erpnext/selling/sales_common.js | 16 +- .../doctype/customer_group/customer_group.js | 2 +- .../customer_group/customer_group.json | 8 +- .../setup/doctype/item_group/item_group.json | 8 +- .../doctype/sales_partner/sales_partner.js | 2 +- .../doctype/sales_partner/sales_partner.json | 4 +- .../doctype/sales_person/sales_person.js | 2 +- .../doctype/sales_person/sales_person.json | 4 +- .../doctype/sales_person/sales_person.py | 2 +- .../doctype/sms_settings/sms_settings.py | 2 +- .../doctype/supplier_type/supplier_type.js | 2 +- .../doctype/supplier_type/supplier_type.json | 6 +- erpnext/setup/doctype/territory/territory.js | 2 +- .../setup/doctype/territory/territory.json | 4 +- erpnext/setup/doctype/territory/territory.py | 2 +- .../setup/page/setup_wizard/setup_wizard.py | 2 +- erpnext/shopping_cart/__init__.py | 6 +- erpnext/shopping_cart/cart.py | 22 +- .../shopping_cart_settings.py | 2 +- erpnext/shopping_cart/test_shopping_cart.py | 32 +- .../doctype/delivery_note/delivery_note.js | 14 +- .../doctype/delivery_note/delivery_note.py | 20 +- .../delivery_note/test_delivery_note.py | 40 +- .../doctype/delivery_note/test_records.json | 4 +- erpnext/stock/doctype/item/item.js | 8 +- erpnext/stock/doctype/item/item.py | 42 +- erpnext/stock/doctype/item/test_item.py | 12 +- erpnext/stock/doctype/item/test_records.json | 10 +- .../landed_cost_voucher.js | 16 +- .../landed_cost_voucher.json | 8 +- .../landed_cost_voucher.py | 28 +- .../test_landed_cost_voucher.py | 12 +- .../landed_cost_voucher/test_records.json | 6 + .../material_request/material_request.js | 10 +- .../material_request/material_request.py | 20 +- .../material_request/test_material_request.py | 78 ++-- .../material_request/test_records.json | 6 +- .../stock/doctype/packed_item/packed_item.py | 14 +- .../doctype/packing_slip/packing_slip.js | 4 +- .../doctype/packing_slip/packing_slip.py | 14 +- .../stock/doctype/price_list/price_list.py | 4 +- .../doctype/price_list/test_records.json | 18 +- .../purchase_receipt/purchase_receipt.js | 12 +- .../purchase_receipt/purchase_receipt.py | 36 +- .../purchase_receipt/test_purchase_receipt.py | 38 +- .../purchase_receipt/test_records.json | 18 +- .../stock/doctype/stock_entry/stock_entry.js | 36 +- .../stock/doctype/stock_entry/stock_entry.py | 60 +-- .../doctype/stock_entry/test_records.json | 18 +- .../doctype/stock_entry/test_stock_entry.py | 192 ++++----- .../test_stock_reconciliation.py | 36 +- erpnext/stock/get_item_details.py | 6 +- erpnext/stock/reorder_item.py | 10 +- .../maintenance_schedule.js | 6 +- .../maintenance_schedule.json | 2 +- .../maintenance_schedule.py | 28 +- .../maintenance_visit/maintenance_visit.js | 4 +- .../maintenance_visit/maintenance_visit.py | 6 +- erpnext/templates/includes/cart.js | 6 +- erpnext/translations/ar.csv | 4 +- erpnext/translations/de.csv | 4 +- erpnext/translations/el.csv | 4 +- erpnext/translations/es.csv | 4 +- erpnext/translations/fr.csv | 4 +- erpnext/translations/hi.csv | 4 +- erpnext/translations/hr.csv | 4 +- erpnext/translations/id.csv | 6 +- erpnext/translations/it.csv | 4 +- erpnext/translations/ja.csv | 4 +- erpnext/translations/kn.csv | 4 +- erpnext/translations/ko.csv | 4 +- erpnext/translations/nl.csv | 4 +- erpnext/translations/pl.csv | 4 +- erpnext/translations/pt-BR.csv | 4 +- erpnext/translations/pt.csv | 4 +- erpnext/translations/ro.csv | 4 +- erpnext/translations/ru.csv | 4 +- erpnext/translations/sr.csv | 4 +- erpnext/translations/ta.csv | 4 +- erpnext/translations/th.csv | 4 +- erpnext/translations/tr.csv | 4 +- erpnext/translations/vi.csv | 4 +- erpnext/translations/zh-cn.csv | 4 +- erpnext/translations/zh-tw.csv | 4 +- erpnext/utilities/transaction_base.py | 2 +- 222 files changed, 1523 insertions(+), 1483 deletions(-) delete mode 100644 erpnext/accounts/doctype/budget_distribution/__init__.py delete mode 100644 erpnext/accounts/doctype/budget_distribution/test_budget_distribution.py delete mode 100644 erpnext/accounts/doctype/budget_distribution_detail/README.md delete mode 100644 erpnext/accounts/doctype/budget_distribution_detail/__init__.py rename erpnext/accounts/doctype/{journal_voucher => journal_entry}/README.md (100%) create mode 100644 erpnext/accounts/doctype/journal_entry/__init__.py rename erpnext/accounts/doctype/{journal_voucher/journal_voucher.js => journal_entry/journal_entry.js} (95%) rename erpnext/accounts/doctype/{journal_voucher/journal_voucher.json => journal_entry/journal_entry.json} (94%) rename erpnext/accounts/doctype/{journal_voucher/journal_voucher.py => journal_entry/journal_entry.py} (98%) rename erpnext/accounts/doctype/{journal_voucher/journal_voucher_list.html => journal_entry/journal_entry_list.html} (100%) rename erpnext/accounts/doctype/{journal_voucher/journal_voucher_list.js => journal_entry/journal_entry_list.js} (100%) rename erpnext/accounts/doctype/{journal_voucher/test_journal_voucher.py => journal_entry/test_journal_entry.py} (98%) rename erpnext/accounts/doctype/{journal_voucher => journal_entry}/test_records.json (88%) rename erpnext/accounts/doctype/{journal_voucher_detail => journal_entry_account}/README.md (100%) create mode 100644 erpnext/accounts/doctype/journal_entry_account/__init__.py rename erpnext/accounts/doctype/{journal_voucher_detail/journal_voucher_detail.json => journal_entry_account/journal_entry_account.json} (97%) rename erpnext/accounts/doctype/{budget_distribution_detail/budget_distribution_detail.py => journal_entry_account/journal_entry_account.py} (58%) delete mode 100644 erpnext/accounts/doctype/journal_voucher/__init__.py delete mode 100644 erpnext/accounts/doctype/journal_voucher_detail/__init__.py rename erpnext/accounts/doctype/{budget_distribution => monthly_distribution}/README.md (100%) create mode 100644 erpnext/accounts/doctype/monthly_distribution/__init__.py rename erpnext/accounts/doctype/{budget_distribution/budget_distribution.js => monthly_distribution/monthly_distribution.js} (100%) rename erpnext/accounts/doctype/{budget_distribution/budget_distribution.json => monthly_distribution/monthly_distribution.json} (88%) rename erpnext/accounts/doctype/{budget_distribution/budget_distribution.py => monthly_distribution/monthly_distribution.py} (95%) create mode 100644 erpnext/accounts/doctype/monthly_distribution/test_monthly_distribution.py rename erpnext/accounts/doctype/{budget_distribution => monthly_distribution}/test_records.json (99%) create mode 100644 erpnext/accounts/doctype/monthly_distribution_percentage/__init__.py rename erpnext/accounts/doctype/{budget_distribution_detail/budget_distribution_detail.json => monthly_distribution_percentage/monthly_distribution_percentage.json} (78%) rename erpnext/accounts/doctype/{journal_voucher_detail/journal_voucher_detail.py => monthly_distribution_percentage/monthly_distribution_percentage.py} (56%) create mode 100644 erpnext/accounts/doctype/purchase_taxes_and_charges_master/test_purchase_taxes_and_charges_master.py create mode 100644 erpnext/accounts/doctype/purchase_taxes_and_charges_master/test_records.json create mode 100644 erpnext/stock/doctype/landed_cost_voucher/test_records.json diff --git a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.json b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.json index 6af86edb4d..81315afcd2 100644 --- a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.json +++ b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.json @@ -58,9 +58,9 @@ "permlevel": 0 }, { - "fieldname": "entries", + "fieldname": "journal_entries", "fieldtype": "Table", - "label": "Entries", + "label": "Journal Entries", "options": "Bank Reconciliation Detail", "permlevel": 0 }, @@ -85,7 +85,7 @@ "icon": "icon-check", "idx": 1, "issingle": 1, - "modified": "2014-05-27 03:37:21.783216", + "modified": "2014-12-25 13:16:16.711609", "modified_by": "Administrator", "module": "Accounts", "name": "Bank Reconciliation", diff --git a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py index 2838afab88..63f54a776e 100644 --- a/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py +++ b/erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py @@ -21,7 +21,7 @@ class BankReconciliation(Document): dl = frappe.db.sql("""select t1.name, t1.cheque_no, t1.cheque_date, t2.debit, t2.credit, t1.posting_date, t2.against_account, t1.clearance_date from - `tabJournal Voucher` t1, `tabJournal Voucher Detail` t2 + `tabJournal Voucher` t1, `tabJournal Entry Account` t2 where t2.parent = t1.name and t2.account = %s and t1.posting_date >= %s and t1.posting_date <= %s and t1.docstatus=1 diff --git a/erpnext/accounts/doctype/budget_distribution/__init__.py b/erpnext/accounts/doctype/budget_distribution/__init__.py deleted file mode 100644 index baffc48825..0000000000 --- a/erpnext/accounts/doctype/budget_distribution/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from __future__ import unicode_literals diff --git a/erpnext/accounts/doctype/budget_distribution/test_budget_distribution.py b/erpnext/accounts/doctype/budget_distribution/test_budget_distribution.py deleted file mode 100644 index 4626bae4db..0000000000 --- a/erpnext/accounts/doctype/budget_distribution/test_budget_distribution.py +++ /dev/null @@ -1,6 +0,0 @@ -# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors -# License: GNU General Public License v3. See license.txt - - -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/README.md b/erpnext/accounts/doctype/budget_distribution_detail/README.md deleted file mode 100644 index daa462a7f4..0000000000 --- a/erpnext/accounts/doctype/budget_distribution_detail/README.md +++ /dev/null @@ -1 +0,0 @@ -Percent allocation for month for parent Budget Distribution. \ No newline at end of file diff --git a/erpnext/accounts/doctype/budget_distribution_detail/__init__.py b/erpnext/accounts/doctype/budget_distribution_detail/__init__.py deleted file mode 100644 index baffc48825..0000000000 --- a/erpnext/accounts/doctype/budget_distribution_detail/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from __future__ import unicode_literals diff --git a/erpnext/accounts/doctype/c_form/c_form.js b/erpnext/accounts/doctype/c_form/c_form.js index e4046d5518..1e9ff0b062 100644 --- a/erpnext/accounts/doctype/c_form/c_form.js +++ b/erpnext/accounts/doctype/c_form/c_form.js @@ -5,7 +5,7 @@ // ----------------------------- frappe.require("assets/erpnext/js/utils.js"); -cur_frm.fields_dict.invoice_details.grid.get_field("invoice_no").get_query = function(doc) { +cur_frm.fields_dict.invoices.grid.get_field("invoice_no").get_query = function(doc) { return { filters: { "docstatus": 1, @@ -23,7 +23,7 @@ cur_frm.fields_dict.state.get_query = function(doc) { cur_frm.cscript.invoice_no = function(doc, cdt, cdn) { var d = locals[cdt][cdn]; - return get_server_fields('get_invoice_details', d.invoice_no, 'invoice_details', doc, cdt, cdn, 1); + return get_server_fields('get_invoice_details', d.invoice_no, 'invoices', doc, cdt, cdn, 1); } cur_frm.cscript.company = function(doc, cdt, cdn) { diff --git a/erpnext/accounts/doctype/c_form/c_form.py b/erpnext/accounts/doctype/c_form/c_form.py index c18d28ad84..c04e7c257d 100644 --- a/erpnext/accounts/doctype/c_form/c_form.py +++ b/erpnext/accounts/doctype/c_form/c_form.py @@ -12,7 +12,7 @@ class CForm(Document): """Validate invoice that c-form is applicable and no other c-form is received for that""" - for d in self.get('invoice_details'): + for d in self.get('invoices'): 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) @@ -42,7 +42,7 @@ class CForm(Document): 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')] + inv = [d.invoice_no for d in self.get('invoices')] 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)) @@ -54,7 +54,7 @@ class CForm(Document): 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')]) + total = sum([flt(d.grand_total) for d in self.get('invoices')]) frappe.db.set(self, 'total_invoiced_amount', total) def get_invoice_details(self, invoice_no): diff --git a/erpnext/accounts/doctype/cost_center/cost_center.js b/erpnext/accounts/doctype/cost_center/cost_center.js index d9e71d98ed..de287d14c8 100644 --- a/erpnext/accounts/doctype/cost_center/cost_center.js +++ b/erpnext/accounts/doctype/cost_center/cost_center.js @@ -12,8 +12,8 @@ erpnext.accounts.CostCenterController = frappe.ui.form.Controller.extend({ setup_queries: function() { var me = this; - if(this.frm.fields_dict["budget_details"].grid.get_field("account")) { - this.frm.set_query("account", "budget_details", function() { + if(this.frm.fields_dict["budgets"].grid.get_field("account")) { + this.frm.set_query("account", "budgets", function() { return { filters:[ ['Account', 'company', '=', me.frm.doc.company], diff --git a/erpnext/accounts/doctype/cost_center/cost_center.json b/erpnext/accounts/doctype/cost_center/cost_center.json index 9582bd6aff..f8d59f80a1 100644 --- a/erpnext/accounts/doctype/cost_center/cost_center.json +++ b/erpnext/accounts/doctype/cost_center/cost_center.json @@ -85,7 +85,7 @@ "label": "Distribution Id", "oldfieldname": "distribution_id", "oldfieldtype": "Link", - "options": "Budget Distribution", + "options": "Monthly Distribution", "permlevel": 0 }, { @@ -145,7 +145,7 @@ "icon": "icon-money", "idx": 1, "in_create": 0, - "modified": "2014-12-24 15:18:16.937207", + "modified": "2014-12-25 15:35:09.968578", "modified_by": "Administrator", "module": "Accounts", "name": "Cost Center", diff --git a/erpnext/accounts/doctype/cost_center/cost_center.py b/erpnext/accounts/doctype/cost_center/cost_center.py index 0cc99188a3..d75e6901e7 100644 --- a/erpnext/accounts/doctype/cost_center/cost_center.py +++ b/erpnext/accounts/doctype/cost_center/cost_center.py @@ -51,7 +51,7 @@ class CostCenter(NestedSet): def validate_budget_details(self): check_acc_list = [] - for d in self.get('budget_details'): + for d in self.get('budgets'): if self.group_or_ledger=="Group": msgprint(_("Budget cannot be set for Group Cost Centers"), raise_exception=1) diff --git a/erpnext/accounts/doctype/cost_center/test_records.json b/erpnext/accounts/doctype/cost_center/test_records.json index 7ffc687a9c..13e0ea9972 100644 --- a/erpnext/accounts/doctype/cost_center/test_records.json +++ b/erpnext/accounts/doctype/cost_center/test_records.json @@ -1,12 +1,12 @@ [ { - "budget_details": [ + "budgets": [ { "account": "_Test Account Cost for Goods Sold - _TC", "budget_allocated": 100000, "doctype": "Budget Detail", "fiscal_year": "_Test Fiscal Year 2013", - "parentfield": "budget_details" + "parentfield": "budgets" } ], "company": "_Test Company", diff --git a/erpnext/accounts/doctype/journal_voucher/README.md b/erpnext/accounts/doctype/journal_entry/README.md similarity index 100% rename from erpnext/accounts/doctype/journal_voucher/README.md rename to erpnext/accounts/doctype/journal_entry/README.md diff --git a/erpnext/accounts/doctype/journal_entry/__init__.py b/erpnext/accounts/doctype/journal_entry/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher.js b/erpnext/accounts/doctype/journal_entry/journal_entry.js similarity index 95% rename from erpnext/accounts/doctype/journal_voucher/journal_voucher.js rename to erpnext/accounts/doctype/journal_entry/journal_entry.js index b1d4af0d10..bf694b097d 100644 --- a/erpnext/accounts/doctype/journal_voucher/journal_voucher.js +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.js @@ -80,7 +80,7 @@ erpnext.accounts.JournalVoucher = frappe.ui.form.Controller.extend({ setup_balance_formatter: function() { var me = this; $.each(["balance", "party_balance"], function(i, field) { - var df = frappe.meta.get_docfield("Journal Voucher Detail", field, me.frm.doc.name); + var df = frappe.meta.get_docfield("Journal Entry Account", field, me.frm.doc.name); df.formatter = function(value, df, options, doc) { var currency = frappe.meta.get_field_currency(df, doc); var dr_or_cr = value ? ('') : ""; @@ -227,9 +227,9 @@ cur_frm.cscript.voucher_type = function(doc, cdt, cdn) { return; var update_jv_details = function(doc, r) { - var jvdetail = frappe.model.add_child(doc, "Journal Voucher Detail", "entries"); + var jvdetail = frappe.model.add_child(doc, "Journal Entry Account", "entries"); $.each(r, function(i, d) { - var row = frappe.model.add_child(doc, "Journal Voucher Detail", "entries"); + var row = frappe.model.add_child(doc, "Journal Entry Account", "entries"); row.account = d.account; row.balance = d.balance; }); @@ -268,7 +268,7 @@ cur_frm.cscript.voucher_type = function(doc, cdt, cdn) { } } -frappe.ui.form.on("Journal Voucher Detail", "party", function(frm, cdt, cdn) { +frappe.ui.form.on("Journal Entry Account", "party", function(frm, cdt, cdn) { var d = frappe.get_doc(cdt, cdn); if(!d.account && d.party_type && d.party) { return frm.call({ diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher.json b/erpnext/accounts/doctype/journal_entry/journal_entry.json similarity index 94% rename from erpnext/accounts/doctype/journal_voucher/journal_voucher.json rename to erpnext/accounts/doctype/journal_entry/journal_entry.json index cfad59c73d..62368e382c 100644 --- a/erpnext/accounts/doctype/journal_voucher/journal_voucher.json +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.json @@ -6,9 +6,9 @@ "doctype": "DocType", "fields": [ { - "fieldname": "voucher_type_and_date", + "fieldname": "entry_type_and_date", "fieldtype": "Section Break", - "label": "Voucher Type and Date", + "label": "Entry Type and Date", "options": "icon-flag", "permlevel": 0 }, @@ -42,7 +42,7 @@ "label": "Voucher Type", "oldfieldname": "voucher_type", "oldfieldtype": "Select", - "options": "Journal Entry\nBank Voucher\nCash Voucher\nCredit Card Voucher\nDebit Note\nCredit Note\nContra Voucher\nExcise Voucher\nWrite Off Voucher\nOpening Entry", + "options": "Journal Entry\nBank Entry\nCash Entry\nCredit Card Entry\nDebit Note\nCredit Note\nContra Entry\nExcise Entry\nWrite Off Entry\nOpening Entry", "permlevel": 0, "print_hide": 0, "read_only": 0, @@ -87,7 +87,7 @@ "label": "Entries", "oldfieldname": "entries", "oldfieldtype": "Table", - "options": "Journal Voucher Detail", + "options": "Journal Entry Account", "permlevel": 0, "print_hide": 0, "read_only": 0 @@ -307,7 +307,7 @@ }, { "default": "Accounts Receivable", - "depends_on": "eval:doc.voucher_type == 'Write Off Voucher'", + "depends_on": "eval:doc.voucher_type == 'Write Off Entry'", "fieldname": "write_off_based_on", "fieldtype": "Select", "label": "Write Off Based On", @@ -318,7 +318,7 @@ "report_hide": 1 }, { - "depends_on": "eval:doc.voucher_type == 'Write Off Voucher'", + "depends_on": "eval:doc.voucher_type == 'Write Off Entry'", "fieldname": "write_off_amount", "fieldtype": "Currency", "label": "Write Off Amount <=", @@ -329,7 +329,7 @@ "report_hide": 1 }, { - "depends_on": "eval:doc.voucher_type == 'Write Off Voucher'", + "depends_on": "eval:doc.voucher_type == 'Write Off Entry'", "fieldname": "get_outstanding_invoices", "fieldtype": "Button", "label": "Get Outstanding Invoices", @@ -439,7 +439,7 @@ "no_copy": 1, "oldfieldname": "amended_from", "oldfieldtype": "Link", - "options": "Journal Voucher", + "options": "Journal Entry", "permlevel": 0, "print_hide": 1, "read_only": 1 @@ -448,10 +448,10 @@ "icon": "icon-file-text", "idx": 1, "is_submittable": 1, - "modified": "2014-12-12 16:48:57.294150", + "modified": "2014-12-25 15:29:26.441984", "modified_by": "Administrator", "module": "Accounts", - "name": "Journal Voucher", + "name": "Journal Entry", "owner": "Administrator", "permissions": [ { diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher.py b/erpnext/accounts/doctype/journal_entry/journal_entry.py similarity index 98% rename from erpnext/accounts/doctype/journal_voucher/journal_voucher.py rename to erpnext/accounts/doctype/journal_entry/journal_entry.py index 599950f750..172c315535 100644 --- a/erpnext/accounts/doctype/journal_voucher/journal_voucher.py +++ b/erpnext/accounts/doctype/journal_entry/journal_entry.py @@ -10,9 +10,9 @@ from erpnext.controllers.accounts_controller import AccountsController from erpnext.accounts.utils import get_balance_on -class JournalVoucher(AccountsController): +class JournalEntry(AccountsController): def __init__(self, arg1, arg2=None): - super(JournalVoucher, self).__init__(arg1, arg2) + super(JournalEntry, self).__init__(arg1, arg2) def get_feed(self): return self.voucher_type @@ -22,7 +22,7 @@ class JournalVoucher(AccountsController): self.is_opening='No' self.clearance_date = None - super(JournalVoucher, self).validate_date_with_fiscal_year() + super(JournalEntry, self).validate_date_with_fiscal_year() self.validate_party() self.validate_cheque_info() self.validate_entries_for_advance() @@ -133,7 +133,7 @@ class JournalVoucher(AccountsController): if d.against_jv == self.name: frappe.throw(_("You can not enter current voucher in 'Against Journal Voucher' column")) - against_entries = frappe.db.sql("""select * from `tabJournal Voucher Detail` + against_entries = frappe.db.sql("""select * from `tabJournal Entry Account` where account = %s and docstatus = 1 and parent = %s and ifnull(against_jv, '') = '' and ifnull(against_invoice, '') = '' and ifnull(against_voucher, '') = ''""", (d.account, d.against_jv), as_dict=True) @@ -423,18 +423,18 @@ class JournalVoucher(AccountsController): return frappe.db.sql("""select name, credit_to as account, supplier as party, outstanding_amount from `tabPurchase Invoice` where docstatus = 1 and company = %s and outstanding_amount > 0 %s""" % ('%s', cond), self.company, as_dict=True) - + def update_expense_claim(self): for d in self.entries: if d.against_expense_claim: - amt = frappe.db.sql("""select sum(debit) as amt from `tabJournal Voucher Detail` + amt = frappe.db.sql("""select sum(debit) as amt from `tabJournal Entry Account` where against_expense_claim = %s and docstatus = 1""", d.against_expense_claim ,as_dict=1)[0].amt frappe.db.set_value("Expense Claim", d.against_expense_claim , "total_amount_reimbursed", amt) - + def validate_expense_claim(self): for d in self.entries: if d.against_expense_claim: - sanctioned_amount, reimbursed_amount = frappe.db.get_value("Expense Claim", d.against_expense_claim, + sanctioned_amount, reimbursed_amount = frappe.db.get_value("Expense Claim", d.against_expense_claim, ("total_sanctioned_amount", "total_amount_reimbursed")) pending_amount = cint(sanctioned_amount) - cint(reimbursed_amount) if d.debit > pending_amount: @@ -520,7 +520,7 @@ def get_opening_accounts(company): 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 + from `tabJournal Voucher` jv, `tabJournal Entry Account` jv_detail where jv_detail.parent = jv.name and jv_detail.account = %s and jv_detail.party = %s and (ifnull(jvd.against_invoice, '') = '' and ifnull(jvd.against_voucher, '') = '' and ifnull(jvd.against_jv, '') = '' ) and jv.docstatus = 1 and jv.{0} like %s order by jv.name desc limit %s, %s""".format(searchfield), @@ -532,7 +532,7 @@ def get_outstanding(args): if args.get("doctype") == "Journal Voucher" and args.get("party"): against_jv_amount = frappe.db.sql(""" select sum(ifnull(debit, 0)) - sum(ifnull(credit, 0)) - from `tabJournal Voucher Detail` where parent=%s and party=%s + from `tabJournal Entry Account` where parent=%s and party=%s and ifnull(against_invoice, '')='' and ifnull(against_voucher, '')='' and ifnull(against_jv, '')=''""", (args['docname'], args['party'])) diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher_list.html b/erpnext/accounts/doctype/journal_entry/journal_entry_list.html similarity index 100% rename from erpnext/accounts/doctype/journal_voucher/journal_voucher_list.html rename to erpnext/accounts/doctype/journal_entry/journal_entry_list.html diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher_list.js b/erpnext/accounts/doctype/journal_entry/journal_entry_list.js similarity index 100% rename from erpnext/accounts/doctype/journal_voucher/journal_voucher_list.js rename to erpnext/accounts/doctype/journal_entry/journal_entry_list.js diff --git a/erpnext/accounts/doctype/journal_voucher/test_journal_voucher.py b/erpnext/accounts/doctype/journal_entry/test_journal_entry.py similarity index 98% rename from erpnext/accounts/doctype/journal_voucher/test_journal_voucher.py rename to erpnext/accounts/doctype/journal_entry/test_journal_entry.py index 32113464d7..410f22fe03 100644 --- a/erpnext/accounts/doctype/journal_voucher/test_journal_voucher.py +++ b/erpnext/accounts/doctype/journal_entry/test_journal_entry.py @@ -5,7 +5,7 @@ from __future__ import unicode_literals import unittest, frappe from frappe.utils import flt -class TestJournalVoucher(unittest.TestCase): +class TestJournalEntry(unittest.TestCase): def test_journal_voucher_with_against_jv(self): jv_invoice = frappe.copy_doc(test_records[2]) @@ -40,11 +40,11 @@ class TestJournalVoucher(unittest.TestCase): test_voucher.submit() if test_voucher.doctype == "Journal Voucher": - self.assertTrue(frappe.db.sql("""select name from `tabJournal Voucher Detail` + self.assertTrue(frappe.db.sql("""select name from `tabJournal Entry Account` where account = %s and docstatus = 1 and parent = %s""", ("_Test Receivable - _TC", test_voucher.name))) - self.assertTrue(not frappe.db.sql("""select name from `tabJournal Voucher Detail` + self.assertTrue(not frappe.db.sql("""select name from `tabJournal Entry Account` where %s=%s""" % (field_dict.get(test_voucher.doctype), '%s'), (test_voucher.name))) base_jv.get("entries")[0].is_advance = "Yes" if (test_voucher.doctype in ["Sales Order", "Purchase Order"]) else "No" @@ -54,10 +54,10 @@ class TestJournalVoucher(unittest.TestCase): submitted_voucher = frappe.get_doc(test_voucher.doctype, test_voucher.name) - self.assertTrue(frappe.db.sql("""select name from `tabJournal Voucher Detail` + self.assertTrue(frappe.db.sql("""select name from `tabJournal Entry Account` where %s=%s""" % (field_dict.get(test_voucher.doctype), '%s'), (submitted_voucher.name))) - self.assertTrue(frappe.db.sql("""select name from `tabJournal Voucher Detail` + self.assertTrue(frappe.db.sql("""select name from `tabJournal Entry Account` where %s=%s and %s=400""" % (field_dict.get(submitted_voucher.doctype), '%s', dr_or_cr), (submitted_voucher.name))) if base_jv.get("entries")[0].is_advance == "Yes": @@ -76,7 +76,7 @@ class TestJournalVoucher(unittest.TestCase): if test_voucher.doctype == "Journal Voucher": # if test_voucher is a Journal Voucher, test cancellation of test_voucher test_voucher.cancel() - self.assertTrue(not frappe.db.sql("""select name from `tabJournal Voucher Detail` + self.assertTrue(not frappe.db.sql("""select name from `tabJournal Entry Account` where against_jv=%s""", test_voucher.name)) elif test_voucher.doctype in ["Sales Order", "Purchase Order"]: diff --git a/erpnext/accounts/doctype/journal_voucher/test_records.json b/erpnext/accounts/doctype/journal_entry/test_records.json similarity index 88% rename from erpnext/accounts/doctype/journal_voucher/test_records.json rename to erpnext/accounts/doctype/journal_entry/test_records.json index 285482f418..bf98745355 100644 --- a/erpnext/accounts/doctype/journal_voucher/test_records.json +++ b/erpnext/accounts/doctype/journal_entry/test_records.json @@ -11,14 +11,14 @@ "party": "_Test Customer", "credit": 400.0, "debit": 0.0, - "doctype": "Journal Voucher Detail", + "doctype": "Journal Entry Account", "parentfield": "entries" }, { "account": "_Test Account Bank Account - _TC", "credit": 0.0, "debit": 400.0, - "doctype": "Journal Voucher Detail", + "doctype": "Journal Entry Account", "parentfield": "entries" } ], @@ -40,14 +40,14 @@ "party": "_Test Supplier", "credit": 0.0, "debit": 400.0, - "doctype": "Journal Voucher Detail", + "doctype": "Journal Entry Account", "parentfield": "entries" }, { "account": "_Test Account Bank Account - _TC", "credit": 400.0, "debit": 0.0, - "doctype": "Journal Voucher Detail", + "doctype": "Journal Entry Account", "parentfield": "entries" } ], @@ -69,7 +69,7 @@ "party": "_Test Customer", "credit": 0.0, "debit": 400.0, - "doctype": "Journal Voucher Detail", + "doctype": "Journal Entry Account", "parentfield": "entries" }, { @@ -77,7 +77,7 @@ "cost_center": "_Test Cost Center - _TC", "credit": 400.0, "debit": 0.0, - "doctype": "Journal Voucher Detail", + "doctype": "Journal Entry Account", "parentfield": "entries" } ], diff --git a/erpnext/accounts/doctype/journal_voucher_detail/README.md b/erpnext/accounts/doctype/journal_entry_account/README.md similarity index 100% rename from erpnext/accounts/doctype/journal_voucher_detail/README.md rename to erpnext/accounts/doctype/journal_entry_account/README.md diff --git a/erpnext/accounts/doctype/journal_entry_account/__init__.py b/erpnext/accounts/doctype/journal_entry_account/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.json b/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json similarity index 97% rename from erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.json rename to erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json index f896b6d133..3a666d449c 100644 --- a/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.json +++ b/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.json @@ -149,7 +149,7 @@ "no_copy": 1, "oldfieldname": "against_jv", "oldfieldtype": "Link", - "options": "Journal Voucher", + "options": "Journal Entry", "permlevel": 0, "print_hide": 0, "search_index": 1 @@ -206,10 +206,10 @@ ], "idx": 1, "istable": 1, - "modified": "2014-12-08 19:32:47.996777", + "modified": "2014-12-25 15:44:03.077639", "modified_by": "Administrator", "module": "Accounts", - "name": "Journal Voucher Detail", + "name": "Journal Entry Account", "owner": "Administrator", "permissions": [] } \ No newline at end of file diff --git a/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.py b/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.py similarity index 58% rename from erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.py rename to erpnext/accounts/doctype/journal_entry_account/journal_entry_account.py index 87d38fd36a..9dc3cf7dcd 100644 --- a/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.py +++ b/erpnext/accounts/doctype/journal_entry_account/journal_entry_account.py @@ -1,9 +1,9 @@ -# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors -# License: GNU General Public License v3. See license.txt +# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and contributors +# For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe.model.document import Document -class BudgetDistributionDetail(Document): - pass \ No newline at end of file +class JournalEntryAccount(Document): + pass diff --git a/erpnext/accounts/doctype/journal_voucher/__init__.py b/erpnext/accounts/doctype/journal_voucher/__init__.py deleted file mode 100644 index baffc48825..0000000000 --- a/erpnext/accounts/doctype/journal_voucher/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from __future__ import unicode_literals diff --git a/erpnext/accounts/doctype/journal_voucher_detail/__init__.py b/erpnext/accounts/doctype/journal_voucher_detail/__init__.py deleted file mode 100644 index baffc48825..0000000000 --- a/erpnext/accounts/doctype/journal_voucher_detail/__init__.py +++ /dev/null @@ -1 +0,0 @@ -from __future__ import unicode_literals diff --git a/erpnext/accounts/doctype/budget_distribution/README.md b/erpnext/accounts/doctype/monthly_distribution/README.md similarity index 100% rename from erpnext/accounts/doctype/budget_distribution/README.md rename to erpnext/accounts/doctype/monthly_distribution/README.md diff --git a/erpnext/accounts/doctype/monthly_distribution/__init__.py b/erpnext/accounts/doctype/monthly_distribution/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/accounts/doctype/budget_distribution/budget_distribution.js b/erpnext/accounts/doctype/monthly_distribution/monthly_distribution.js similarity index 100% rename from erpnext/accounts/doctype/budget_distribution/budget_distribution.js rename to erpnext/accounts/doctype/monthly_distribution/monthly_distribution.js diff --git a/erpnext/accounts/doctype/budget_distribution/budget_distribution.json b/erpnext/accounts/doctype/monthly_distribution/monthly_distribution.json similarity index 88% rename from erpnext/accounts/doctype/budget_distribution/budget_distribution.json rename to erpnext/accounts/doctype/monthly_distribution/monthly_distribution.json index f710249b01..095c64a505 100644 --- a/erpnext/accounts/doctype/budget_distribution/budget_distribution.json +++ b/erpnext/accounts/doctype/monthly_distribution/monthly_distribution.json @@ -29,21 +29,21 @@ "search_index": 1 }, { - "fieldname": "budget_distribution_details", + "fieldname": "percentages", "fieldtype": "Table", - "label": "Budget Distribution Details", + "label": "Monthly Distribution Percentages", "oldfieldname": "budget_distribution_details", "oldfieldtype": "Table", - "options": "Budget Distribution Detail", + "options": "Monthly Distribution Percentage", "permlevel": 0 } ], "icon": "icon-bar-chart", "idx": 1, - "modified": "2014-05-09 02:16:47.567367", + "modified": "2014-12-25 15:45:04.729489", "modified_by": "Administrator", "module": "Accounts", - "name": "Budget Distribution", + "name": "Monthly Distribution", "name_case": "Title Case", "owner": "Administrator", "permissions": [ diff --git a/erpnext/accounts/doctype/budget_distribution/budget_distribution.py b/erpnext/accounts/doctype/monthly_distribution/monthly_distribution.py similarity index 95% rename from erpnext/accounts/doctype/budget_distribution/budget_distribution.py rename to erpnext/accounts/doctype/monthly_distribution/monthly_distribution.py index 1b1a8ecc4c..a0646b7799 100644 --- a/erpnext/accounts/doctype/budget_distribution/budget_distribution.py +++ b/erpnext/accounts/doctype/monthly_distribution/monthly_distribution.py @@ -7,7 +7,7 @@ from frappe.utils import flt from frappe import _ from frappe.model.document import Document -class BudgetDistribution(Document): +class MonthlyDistribution(Document): def get_months(self): month_list = ['January','February','March','April','May','June','July','August','September', 'October','November','December'] diff --git a/erpnext/accounts/doctype/monthly_distribution/test_monthly_distribution.py b/erpnext/accounts/doctype/monthly_distribution/test_monthly_distribution.py new file mode 100644 index 0000000000..6d3101c8c4 --- /dev/null +++ b/erpnext/accounts/doctype/monthly_distribution/test_monthly_distribution.py @@ -0,0 +1,10 @@ +# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and Contributors +# See license.txt + +import frappe +import unittest + +test_records = frappe.get_test_records('Monthly Distribution') + +class TestMonthlyDistribution(unittest.TestCase): + pass diff --git a/erpnext/accounts/doctype/budget_distribution/test_records.json b/erpnext/accounts/doctype/monthly_distribution/test_records.json similarity index 99% rename from erpnext/accounts/doctype/budget_distribution/test_records.json rename to erpnext/accounts/doctype/monthly_distribution/test_records.json index 7e8c640dd7..ffc6c687d2 100644 --- a/erpnext/accounts/doctype/budget_distribution/test_records.json +++ b/erpnext/accounts/doctype/monthly_distribution/test_records.json @@ -39,6 +39,6 @@ }, { "month": "December", "percentage_allocation": "10" - } + } ] }] diff --git a/erpnext/accounts/doctype/monthly_distribution_percentage/__init__.py b/erpnext/accounts/doctype/monthly_distribution_percentage/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.json b/erpnext/accounts/doctype/monthly_distribution_percentage/monthly_distribution_percentage.json similarity index 78% rename from erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.json rename to erpnext/accounts/doctype/monthly_distribution_percentage/monthly_distribution_percentage.json index aa4f2aedc2..aac6a30fa1 100644 --- a/erpnext/accounts/doctype/budget_distribution_detail/budget_distribution_detail.json +++ b/erpnext/accounts/doctype/monthly_distribution_percentage/monthly_distribution_percentage.json @@ -1,6 +1,6 @@ { "autoname": "BDD/.#####", - "creation": "2013-02-22 01:27:38.000000", + "creation": "2013-02-22 01:27:38", "docstatus": 0, "doctype": "DocType", "fields": [ @@ -27,9 +27,10 @@ ], "idx": 1, "istable": 1, - "modified": "2013-12-20 19:22:59.000000", + "modified": "2014-12-25 15:45:11.173204", "modified_by": "Administrator", "module": "Accounts", - "name": "Budget Distribution Detail", - "owner": "Administrator" + "name": "Monthly Distribution Percentage", + "owner": "Administrator", + "permissions": [] } \ No newline at end of file diff --git a/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.py b/erpnext/accounts/doctype/monthly_distribution_percentage/monthly_distribution_percentage.py similarity index 56% rename from erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.py rename to erpnext/accounts/doctype/monthly_distribution_percentage/monthly_distribution_percentage.py index 36700d2dc3..e0c71b81c9 100644 --- a/erpnext/accounts/doctype/journal_voucher_detail/journal_voucher_detail.py +++ b/erpnext/accounts/doctype/monthly_distribution_percentage/monthly_distribution_percentage.py @@ -1,10 +1,9 @@ -# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors -# License: GNU General Public License v3. See license.txt +# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and contributors +# For license information, please see license.txt from __future__ import unicode_literals import frappe - from frappe.model.document import Document -class JournalVoucherDetail(Document): - pass \ No newline at end of file +class MonthlyDistributionPercentage(Document): + pass diff --git a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.js b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.js index 0d786bfae5..b005137d03 100644 --- a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.js +++ b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.js @@ -72,7 +72,7 @@ erpnext.accounts.PaymentReconciliationController = frappe.ui.form.Controller.ext callback: function(r, rt) { var invoices = []; - $.each(me.frm.doc.payment_reconciliation_invoices || [], function(i, row) { + $.each(me.frm.doc.invoices || [], function(i, row) { if (row.invoice_number && !inList(invoices, row.invoice_number)) invoices.push(row.invoice_number); }); @@ -80,11 +80,11 @@ erpnext.accounts.PaymentReconciliationController = frappe.ui.form.Controller.ext frappe.meta.get_docfield("Payment Reconciliation Payment", "invoice_number", me.frm.doc.name).options = invoices.join("\n"); - $.each(me.frm.doc.payment_reconciliation_payments || [], function(i, p) { + $.each(me.frm.doc.payments || [], function(i, p) { if(!inList(invoices, cstr(p.invoice_number))) p.invoice_number = null; }); - refresh_field("payment_reconciliation_payments"); + refresh_field("payments"); } }); diff --git a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py index f4f1b42d67..8186bdff6e 100644 --- a/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py +++ b/erpnext/accounts/doctype/payment_reconciliation/payment_reconciliation.py @@ -29,7 +29,7 @@ class PaymentReconciliation(Document): t1.name as voucher_no, t1.posting_date, t1.remark, t2.name as voucher_detail_no, {dr_or_cr} as payment_amount, t2.is_advance from - `tabJournal Voucher` t1, `tabJournal Voucher Detail` t2 + `tabJournal Voucher` t1, `tabJournal Entry Account` t2 where t1.name = t2.parent and t1.docstatus = 1 and t2.docstatus = 1 and t2.party_type = %(party_type)s and t2.party = %(party)s @@ -55,9 +55,9 @@ class PaymentReconciliation(Document): self.add_payment_entries(jv_entries) def add_payment_entries(self, jv_entries): - self.set('payment_reconciliation_payments', []) + self.set('payments', []) for e in jv_entries: - ent = self.append('payment_reconciliation_payments', {}) + ent = self.append('payments', {}) ent.journal_voucher = e.get('voucher_no') ent.posting_date = e.get('posting_date') ent.amount = flt(e.get('payment_amount')) @@ -66,7 +66,7 @@ class PaymentReconciliation(Document): ent.is_advance = e.get('is_advance') def get_invoice_entries(self): - #Fetch JVs, Sales and Purchase Invoices for 'payment_reconciliation_invoices' to reconcile against + #Fetch JVs, Sales and Purchase Invoices for 'invoices' to reconcile against non_reconciled_invoices = [] dr_or_cr = "debit" if self.party_type == "Customer" else "credit" cond = self.check_condition(dr_or_cr) @@ -123,11 +123,11 @@ class PaymentReconciliation(Document): self.add_invoice_entries(non_reconciled_invoices) def add_invoice_entries(self, non_reconciled_invoices): - #Populate 'payment_reconciliation_invoices' with JVs and Invoices to reconcile against - self.set('payment_reconciliation_invoices', []) + #Populate 'invoices' with JVs and Invoices to reconcile against + self.set('invoices', []) for e in non_reconciled_invoices: - ent = self.append('payment_reconciliation_invoices', {}) + ent = self.append('invoices', {}) ent.invoice_type = e.get('voucher_type') ent.invoice_number = e.get('voucher_no') ent.invoice_date = e.get('posting_date') @@ -139,7 +139,7 @@ class PaymentReconciliation(Document): self.validate_invoice() dr_or_cr = "credit" if self.party_type == "Customer" else "debit" lst = [] - for e in self.get('payment_reconciliation_payments'): + for e in self.get('payments'): if e.invoice_type and e.invoice_number and e.allocated_amount: lst.append({ 'voucher_no' : e.journal_voucher, @@ -168,18 +168,18 @@ class PaymentReconciliation(Document): def validate_invoice(self): - if not self.get("payment_reconciliation_invoices"): + if not self.get("invoices"): frappe.throw(_("No records found in the Invoice table")) - if not self.get("payment_reconciliation_payments"): + if not self.get("payments"): frappe.throw(_("No records found in the Payment table")) unreconciled_invoices = frappe._dict() - for d in self.get("payment_reconciliation_invoices"): + for d in self.get("invoices"): unreconciled_invoices.setdefault(d.invoice_type, {}).setdefault(d.invoice_number, d.outstanding_amount) invoices_to_reconcile = [] - for p in self.get("payment_reconciliation_payments"): + for p in self.get("payments"): if p.invoice_type and p.invoice_number and p.allocated_amount: invoices_to_reconcile.append(p.invoice_number) diff --git a/erpnext/accounts/doctype/payment_tool/payment_tool.js b/erpnext/accounts/doctype/payment_tool/payment_tool.js index 1a0b486f89..b51be9c76d 100644 --- a/erpnext/accounts/doctype/payment_tool/payment_tool.js +++ b/erpnext/accounts/doctype/payment_tool/payment_tool.js @@ -24,7 +24,7 @@ frappe.ui.form.on("Payment Tool", "onload", function(frm) { } }); - frm.set_query("against_voucher_type", "payment_tool_details", function() { + frm.set_query("against_voucher_type", "against_vouchers", function() { return { filters: {"name": ["in", ["Sales Invoice", "Purchase Invoice", "Journal Voucher", "Sales Order", "Purchase Order"]]} }; @@ -75,7 +75,7 @@ erpnext.payment_tool.check_mandatory_to_set_button = function(frm) { frappe.ui.form.on("Payment Tool", "get_outstanding_vouchers", function(frm) { erpnext.payment_tool.check_mandatory_to_fetch(frm.doc); - frm.set_value("payment_tool_details", []); + frm.set_value("against_vouchers", []); return frappe.call({ method: 'erpnext.accounts.doctype.payment_tool.payment_tool.get_outstanding_vouchers', @@ -93,16 +93,16 @@ frappe.ui.form.on("Payment Tool", "get_outstanding_vouchers", function(frm) { frm.fields_dict.get_outstanding_vouchers.$input.removeClass("btn-primary"); frm.fields_dict.make_journal_voucher.$input.addClass("btn-primary"); - frappe.model.clear_table(frm.doc, "payment_tool_details"); + frappe.model.clear_table(frm.doc, "against_vouchers"); $.each(r.message, function(i, d) { - var invoice_detail = frappe.model.add_child(frm.doc, "Payment Tool Detail", "payment_tool_details"); + var invoice_detail = frappe.model.add_child(frm.doc, "Payment Tool Detail", "against_vouchers"); invoice_detail.against_voucher_type = d.voucher_type; invoice_detail.against_voucher_no = d.voucher_no; invoice_detail.total_amount = d.invoice_amount; invoice_detail.outstanding_amount = d.outstanding_amount; }); } - refresh_field("payment_tool_details"); + refresh_field("against_vouchers"); erpnext.payment_tool.set_total_payment_amount(frm); } }); @@ -114,7 +114,7 @@ frappe.ui.form.on("Payment Tool Detail", "against_voucher_type", function(frm) { }); erpnext.payment_tool.validate_against_voucher = function(frm) { - $.each(frm.doc.payment_tool_details || [], function(i, row) { + $.each(frm.doc.against_vouchers || [], function(i, row) { if(frm.doc.party_type=="Customer" && !in_list(["Sales Order", "Sales Invoice", "Journal Voucher"], row.against_voucher_type)) { frappe.model.set_value(row.doctype, row.name, "against_voucher_type", ""); @@ -154,13 +154,13 @@ frappe.ui.form.on("Payment Tool Detail", "payment_amount", function(frm) { erpnext.payment_tool.set_total_payment_amount(frm); }); -frappe.ui.form.on("Payment Tool Detail", "payment_tool_details_remove", function(frm) { +frappe.ui.form.on("Payment Tool Detail", "against_vouchers_remove", function(frm) { erpnext.payment_tool.set_total_payment_amount(frm); }); erpnext.payment_tool.set_total_payment_amount = function(frm) { var total_amount = 0.00; - $.each(frm.doc.payment_tool_details || [], function(i, row) { + $.each(frm.doc.against_vouchers || [], function(i, row) { if (row.payment_amount && (row.payment_amount <= row.outstanding_amount)) { total_amount = total_amount + row.payment_amount; } else { diff --git a/erpnext/accounts/doctype/payment_tool/payment_tool.py b/erpnext/accounts/doctype/payment_tool/payment_tool.py index 9bd51663c0..c57ee25131 100644 --- a/erpnext/accounts/doctype/payment_tool/payment_tool.py +++ b/erpnext/accounts/doctype/payment_tool/payment_tool.py @@ -29,7 +29,7 @@ class PaymentTool(Document): if not self.total_payment_amount: frappe.throw(_("Please enter Payment Amount in atleast one row")) - for v in self.get("payment_tool_details"): + for v in self.get("against_vouchers"): if not frappe.db.get_value(v.against_voucher_type, {"name": v.against_voucher_no}): frappe.throw(_("Row {0}: {1} is not a valid {2}").format(v.idx, v.against_voucher_no, v.against_voucher_type)) diff --git a/erpnext/accounts/doctype/payment_tool/test_payment_tool.py b/erpnext/accounts/doctype/payment_tool/test_payment_tool.py index 579dad3f82..6555e66ce0 100644 --- a/erpnext/accounts/doctype/payment_tool/test_payment_tool.py +++ b/erpnext/accounts/doctype/payment_tool/test_payment_tool.py @@ -154,7 +154,7 @@ class TestPaymentTool(unittest.TestCase): def check_jv_entries(self, paytool, outstanding_entries, expected_outstanding): for e in outstanding_entries: - d1 = paytool.append("payment_tool_details") + d1 = paytool.append("against_vouchers") d1.against_voucher_type = e.get("voucher_type") d1.against_voucher_no = e.get("voucher_no") d1.total_amount = e.get("invoice_amount") diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js index 1f4218e427..6f97794796 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js @@ -2,8 +2,8 @@ // License: GNU General Public License v3. See license.txt cur_frm.cscript.tname = "Purchase Invoice Item"; -cur_frm.cscript.fname = "entries"; -cur_frm.cscript.other_fname = "other_charges"; +cur_frm.cscript.fname = "items"; +cur_frm.cscript.other_fname = "taxes"; frappe.provide("erpnext.accounts"); {% include 'buying/doctype/purchase_common/purchase_common.js' %}; @@ -99,7 +99,7 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({ }, allocated_amount: function() { - this.calculate_total_advance("Purchase Invoice", "advance_allocation_details"); + this.calculate_total_advance("Purchase Invoice", "advances"); this.frm.refresh_fields(); }, @@ -109,12 +109,12 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({ entries_add: function(doc, cdt, cdn) { var row = frappe.get_doc(cdt, cdn); - this.frm.script_manager.copy_from_first_row("entries", row, + this.frm.script_manager.copy_from_first_row("items", row, ["expense_account", "cost_center", "project_name"]); }, on_submit: function() { - $.each(this.frm.doc["entries"], function(i, row) { + $.each(this.frm.doc["items"], function(i, row) { if(row.purchase_receipt) frappe.model.clear_doc("Purchase Receipt", row.purchase_receipt) }) } @@ -153,7 +153,7 @@ cur_frm.fields_dict['contact_person'].get_query = function(doc, cdt, cdn) { } } -cur_frm.fields_dict['entries'].grid.get_field("item_code").get_query = function(doc, cdt, cdn) { +cur_frm.fields_dict['items'].grid.get_field("item_code").get_query = function(doc, cdt, cdn) { return { query: "erpnext.controllers.queries.item_query", filters:{ @@ -182,7 +182,7 @@ return{ } } -cur_frm.set_query("expense_account", "entries", function(doc) { +cur_frm.set_query("expense_account", "items", function(doc) { return{ query: "erpnext.accounts.doctype.purchase_invoice.purchase_invoice.get_expense_account", filters: {'company': doc.company} @@ -192,15 +192,15 @@ 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 = doc.entries || []; + var cl = doc.items || []; for(var i = 0; i < cl.length; i++){ if(!cl[i].expense_account) cl[i].expense_account = d.expense_account; } } - refresh_field('entries'); + refresh_field('items'); } -cur_frm.fields_dict["entries"].grid.get_field("cost_center").get_query = function(doc) { +cur_frm.fields_dict["items"].grid.get_field("cost_center").get_query = function(doc) { return { filters: { 'company': doc.company, @@ -213,15 +213,15 @@ 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 = doc.entries || []; + var cl = doc.items || []; for(var i = 0; i < cl.length; i++){ if(!cl[i].cost_center) cl[i].cost_center = d.cost_center; } } - refresh_field('entries'); + refresh_field('items'); } -cur_frm.fields_dict['entries'].grid.get_field('project_name').get_query = function(doc, cdt, cdn) { +cur_frm.fields_dict['items'].grid.get_field('project_name').get_query = function(doc, cdt, cdn) { return{ filters:[ ['Project', 'status', 'not in', 'Completed, Cancelled'] diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py index 6a612a969b..3ccace478e 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -45,8 +45,8 @@ class PurchaseInvoice(BuyingController): self.check_active_purchase_items() self.check_conversion_rate() self.validate_credit_to_acc() - self.clear_unallocated_advances("Purchase Invoice Advance", "advance_allocation_details") - self.validate_advance_jv("advance_allocation_details", "purchase_order") + self.clear_unallocated_advances("Purchase Invoice Advance", "advances") + self.validate_advance_jv("advances", "purchase_order") self.check_for_stopped_status() self.validate_with_previous_doc() self.validate_uom_is_integer("uom", "qty") @@ -55,7 +55,7 @@ class PurchaseInvoice(BuyingController): self.validate_write_off_account() self.update_valuation_rate("entries") self.validate_multiple_billing("Purchase Receipt", "pr_detail", "amount", - "purchase_receipt_details") + "items") self.create_remarks() def create_remarks(self): @@ -75,7 +75,7 @@ class PurchaseInvoice(BuyingController): def get_advances(self): super(PurchaseInvoice, self).get_advances(self.credit_to, "Supplier", self.supplier, - "Purchase Invoice Advance", "advance_allocation_details", "debit", "purchase_order") + "Purchase Invoice Advance", "advances", "debit", "purchase_order") def check_active_purchase_items(self): for d in self.get('entries'): @@ -216,7 +216,7 @@ class PurchaseInvoice(BuyingController): """ lst = [] - for d in self.get('advance_allocation_details'): + for d in self.get('advances'): if flt(d.allocated_amount) > 0: args = { 'voucher_no' : d.journal_voucher, @@ -277,7 +277,7 @@ class PurchaseInvoice(BuyingController): # tax table gl entries valuation_tax = {} - for tax in self.get("other_charges"): + for tax in self.get("taxes"): if tax.category in ("Total", "Valuation and Total") and flt(tax.tax_amount): gl_entries.append( self.get_gl_dict({ diff --git a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py index 8e70fd631c..a708873a45 100644 --- a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py @@ -109,8 +109,8 @@ class TestPurchaseInvoice(unittest.TestCase): 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("other_charges").pop(0) - pi.get("other_charges").pop(1) + pi.get("taxes").pop(0) + pi.get("taxes").pop(1) pi.insert() pi.submit() @@ -159,7 +159,7 @@ class TestPurchaseInvoice(unittest.TestCase): ["_Test Account Discount - _TC", 168.03, 1512.30], ] - for i, tax in enumerate(wrapper.get("other_charges")): + for i, tax in enumerate(wrapper.get("taxes")): 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]) @@ -193,7 +193,7 @@ class TestPurchaseInvoice(unittest.TestCase): ["_Test Account Discount - _TC", 168.03, 1512.30], ] - for i, tax in enumerate(wrapper.get("other_charges")): + for i, tax in enumerate(wrapper.get("taxes")): 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]) @@ -207,7 +207,7 @@ class TestPurchaseInvoice(unittest.TestCase): jv.submit() pi = frappe.copy_doc(test_records[0]) - pi.append("advance_allocation_details", { + pi.append("advances", { "journal_voucher": jv.name, "jv_detail_no": jv.get("entries")[0].name, "advance_amount": 400, @@ -218,17 +218,17 @@ class TestPurchaseInvoice(unittest.TestCase): pi.submit() pi.load_from_db() - self.assertTrue(frappe.db.sql("""select name from `tabJournal Voucher Detail` + self.assertTrue(frappe.db.sql("""select name from `tabJournal Entry Account` where against_voucher=%s""", pi.name)) - self.assertTrue(frappe.db.sql("""select name from `tabJournal Voucher Detail` + self.assertTrue(frappe.db.sql("""select name from `tabJournal Entry Account` 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` + self.assertTrue(not frappe.db.sql("""select name from `tabJournal Entry Account` where against_voucher=%s""", pi.name)) def test_recurring_invoice(self): diff --git a/erpnext/accounts/doctype/purchase_invoice/test_records.json b/erpnext/accounts/doctype/purchase_invoice/test_records.json index 84a544039a..dd5daea276 100644 --- a/erpnext/accounts/doctype/purchase_invoice/test_records.json +++ b/erpnext/accounts/doctype/purchase_invoice/test_records.json @@ -7,7 +7,7 @@ "credit_to": "_Test Payable - _TC", "currency": "INR", "doctype": "Purchase Invoice", - "entries": [ + "items": [ { "amount": 500, "base_amount": 500, @@ -19,7 +19,7 @@ "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", + "parentfield": "items", "qty": 10, "rate": 50, "uom": "_Test UOM" @@ -34,7 +34,7 @@ "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", + "parentfield": "items", "qty": 5, "rate": 150, "uom": "_Test UOM" @@ -43,7 +43,7 @@ "fiscal_year": "_Test Fiscal Year 2013", "grand_total_import": 0, "naming_series": "_T-BILL", - "other_charges": [ + "taxes": [ { "account_head": "_Test Account Shipping Charges - _TC", "add_deduct_tax": "Add", @@ -52,7 +52,7 @@ "cost_center": "_Test Cost Center - _TC", "description": "Shipping Charges", "doctype": "Purchase Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 100 }, { @@ -63,7 +63,7 @@ "cost_center": "_Test Cost Center - _TC", "description": "Customs Duty", "doctype": "Purchase Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 10 }, { @@ -74,7 +74,7 @@ "cost_center": "_Test Cost Center - _TC", "description": "Excise Duty", "doctype": "Purchase Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 12 }, { @@ -85,7 +85,7 @@ "cost_center": "_Test Cost Center - _TC", "description": "Education Cess", "doctype": "Purchase Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 2, "row_id": 3 }, @@ -97,7 +97,7 @@ "cost_center": "_Test Cost Center - _TC", "description": "S&H Education Cess", "doctype": "Purchase Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 1, "row_id": 3 }, @@ -109,7 +109,7 @@ "cost_center": "_Test Cost Center - _TC", "description": "CST", "doctype": "Purchase Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 2, "row_id": 5 }, @@ -121,7 +121,7 @@ "cost_center": "_Test Cost Center - _TC", "description": "VAT", "doctype": "Purchase Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 12.5 }, { @@ -132,7 +132,7 @@ "cost_center": "_Test Cost Center - _TC", "description": "Discount", "doctype": "Purchase Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 10, "row_id": 7 } @@ -149,7 +149,7 @@ "credit_to": "_Test Payable - _TC", "currency": "INR", "doctype": "Purchase Invoice", - "entries": [ + "items": [ { "conversion_factor": 1.0, "cost_center": "_Test Cost Center - _TC", @@ -157,7 +157,7 @@ "expense_account": "_Test Account Cost for Goods Sold - _TC", "item_code": "_Test Item", "item_name": "_Test Item", - "parentfield": "entries", + "parentfield": "items", "qty": 10.0, "rate": 50.0, "uom": "_Test UOM" @@ -166,7 +166,7 @@ "fiscal_year": "_Test Fiscal Year 2013", "grand_total_import": 0, "naming_series": "_T-Purchase Invoice-", - "other_charges": [ + "taxes": [ { "account_head": "_Test Account Shipping Charges - _TC", "add_deduct_tax": "Add", @@ -175,7 +175,7 @@ "cost_center": "_Test Cost Center - _TC", "description": "Shipping Charges", "doctype": "Purchase Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 100.0 }, { @@ -186,7 +186,7 @@ "cost_center": "_Test Cost Center - _TC", "description": "VAT", "doctype": "Purchase Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 120.0 }, { @@ -197,7 +197,7 @@ "cost_center": "_Test Cost Center - _TC", "description": "Customs Duty", "doctype": "Purchase Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 150.0 } ], 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 a8c02e8ff7..b0988b21d9 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 @@ -20,7 +20,7 @@ cur_frm.pformat.in_words_import = function(doc) { return ''; } -cur_frm.pformat.other_charges= function(doc) { +cur_frm.pformat.taxes= function(doc) { //function to make row of table var make_row = function(title, val, bold) { @@ -41,7 +41,7 @@ cur_frm.pformat.other_charges= function(doc) { return doc_field.print_hide; } - var cl = doc.other_charges || []; + var cl = doc.taxes || []; // outer table var out='
\ @@ -104,7 +104,7 @@ cur_frm.cscript.charge_type = function(doc, cdt, cdn) { } validated = false; - refresh_field('charge_type', d.name, 'other_charges'); + refresh_field('charge_type', d.name, 'taxes'); cur_frm.cscript.row_id(doc, cdt, cdn); cur_frm.cscript.rate(doc, cdt, cdn); @@ -130,10 +130,10 @@ cur_frm.cscript.row_id = function(doc, cdt, cdn) { } } validated = false; - refresh_field('row_id', d.name, 'other_charges'); + refresh_field('row_id', d.name, 'taxes'); } -cur_frm.set_query("account_head", "other_charges", function(doc) { +cur_frm.set_query("account_head", "taxes", function(doc) { return { query: "erpnext.controllers.queries.tax_account_query", filters: { @@ -143,7 +143,7 @@ cur_frm.set_query("account_head", "other_charges", function(doc) { } }); -cur_frm.fields_dict['other_charges'].grid.get_field("cost_center").get_query = function(doc) { +cur_frm.fields_dict['taxes'].grid.get_field("cost_center").get_query = function(doc) { return { filters: { 'company': doc.company, @@ -160,7 +160,7 @@ cur_frm.cscript.rate = function(doc, cdt, cdn) { d.rate = ''; } validated = false; - refresh_field('rate', d.name, 'other_charges'); + refresh_field('rate', d.name, 'taxes'); } cur_frm.cscript.tax_amount = function(doc, cdt, cdn) { @@ -176,5 +176,5 @@ cur_frm.cscript.tax_amount = function(doc, cdt, cdn) { } validated = false; - refresh_field('tax_amount', d.name, 'other_charges'); + refresh_field('tax_amount', d.name, 'taxes'); } diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.json b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.json index 178c077806..a80978b866 100644 --- a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.json +++ b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.json @@ -60,7 +60,7 @@ "precision": "" }, { - "fieldname": "other_charges", + "fieldname": "taxes", "fieldtype": "Table", "label": "Purchase Taxes and Charges", "oldfieldname": "purchase_tax_details", @@ -71,7 +71,7 @@ ], "icon": "icon-money", "idx": 1, - "modified": "2014-10-07 12:40:17.165882", + "modified": "2014-12-24 17:19:29.921875", "modified_by": "Administrator", "module": "Accounts", "name": "Purchase Taxes and Charges Master", diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/test_purchase_taxes_and_charges_master.py b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/test_purchase_taxes_and_charges_master.py new file mode 100644 index 0000000000..4f600bd569 --- /dev/null +++ b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/test_purchase_taxes_and_charges_master.py @@ -0,0 +1,10 @@ +# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors and Contributors +# See license.txt + +import frappe +import unittest + +test_records = frappe.get_test_records('Purchase Taxes and Charges Master') + +class TestPurchaseTaxesandChargesMaster(unittest.TestCase): + pass diff --git a/erpnext/accounts/doctype/purchase_taxes_and_charges_master/test_records.json b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/test_records.json new file mode 100644 index 0000000000..e230c20c53 --- /dev/null +++ b/erpnext/accounts/doctype/purchase_taxes_and_charges_master/test_records.json @@ -0,0 +1,6 @@ +[ + { + "doctype": "Purchase Taxes and Charges Master", + "name": "_Test Purchase Taxes and Charges Master 1" + } +] diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index 03d9d03724..82cbb2a77e 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -2,8 +2,8 @@ // License: GNU General Public License v3. See license.txt cur_frm.cscript.tname = "Sales Invoice Item"; -cur_frm.cscript.fname = "entries"; -cur_frm.cscript.other_fname = "other_charges"; +cur_frm.cscript.fname = "items"; +cur_frm.cscript.other_fname = "taxes"; cur_frm.cscript.sales_team_fname = "sales_team"; // print heading @@ -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.doc.entries + from_delivery_note = cur_frm.doc.items .some(function(item) { return item.delivery_note ? true : false; }); @@ -173,7 +173,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte }, allocated_amount: function() { - this.calculate_total_advance("Sales Invoice", "advance_adjustment_details"); + this.calculate_total_advance("Sales Invoice", "advances"); this.frm.refresh_fields(); }, @@ -201,7 +201,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte entries_add: function(doc, cdt, cdn) { var row = frappe.get_doc(cdt, cdn); - this.frm.script_manager.copy_from_first_row("entries", row, ["income_account", "cost_center"]); + this.frm.script_manager.copy_from_first_row("items", row, ["income_account", "cost_center"]); }, set_dynamic_labels: function() { @@ -223,7 +223,7 @@ $.extend(cur_frm.cscript, new erpnext.accounts.SalesInvoiceController({frm: cur_ cur_frm.cscript.hide_fields = function(doc) { par_flds = ['project_name', 'due_date', 'is_opening', 'source', 'total_advance', 'gross_profit', 'gross_profit_percent', 'get_advances_received', - 'advance_adjustment_details', 'sales_partner', 'commission_rate', + 'advances', 'sales_partner', 'commission_rate', 'total_commission', 'advances', 'from_date', 'to_date']; item_flds_normal = ['sales_order', 'delivery_note'] @@ -231,18 +231,18 @@ cur_frm.cscript.hide_fields = function(doc) { if(cint(doc.is_pos) == 1) { hide_field(par_flds); unhide_field('payments_section'); - cur_frm.fields_dict['entries'].grid.set_column_disp(item_flds_normal, false); + cur_frm.fields_dict['items'].grid.set_column_disp(item_flds_normal, false); } else { hide_field('payments_section'); for (i in par_flds) { var docfield = frappe.meta.docfield_map[doc.doctype][par_flds[i]]; if(!docfield.hidden) unhide_field(par_flds[i]); } - cur_frm.fields_dict['entries'].grid.set_column_disp(item_flds_normal, true); + cur_frm.fields_dict['items'].grid.set_column_disp(item_flds_normal, true); } item_flds_stock = ['serial_no', 'batch_no', 'actual_qty', 'expense_account', 'warehouse'] - cur_frm.fields_dict['entries'].grid.set_column_disp(item_flds_stock, + cur_frm.fields_dict['items'].grid.set_column_disp(item_flds_stock, (cint(doc.update_stock)==1 ? true : false)); // India related fields @@ -342,7 +342,7 @@ cur_frm.fields_dict['project_name'].get_query = function(doc, cdt, cdn) { // Income Account in Details Table // -------------------------------- -cur_frm.set_query("income_account", "entries", function(doc) { +cur_frm.set_query("income_account", "items", function(doc) { return{ query: "erpnext.accounts.doctype.sales_invoice.sales_invoice.get_income_account", filters: {'company': doc.company} @@ -351,7 +351,7 @@ cur_frm.set_query("income_account", "entries", function(doc) { // expense account if (sys_defaults.auto_accounting_for_stock) { - cur_frm.fields_dict['entries'].grid.get_field('expense_account').get_query = function(doc) { + cur_frm.fields_dict['items'].grid.get_field('expense_account').get_query = function(doc) { return { filters: { 'report_type': 'Profit and Loss', @@ -365,7 +365,7 @@ if (sys_defaults.auto_accounting_for_stock) { // Cost Center in Details Table // ----------------------------- -cur_frm.fields_dict["entries"].grid.get_field("cost_center").get_query = function(doc) { +cur_frm.fields_dict["items"].grid.get_field("cost_center").get_query = function(doc) { return { filters: { 'company': doc.company, @@ -387,7 +387,7 @@ cur_frm.cscript.cost_center = function(doc, cdt, cdn) { } cur_frm.cscript.on_submit = function(doc, cdt, cdn) { - $.each(doc["entries"], function(i, row) { + $.each(doc["items"], function(i, row) { if(row.delivery_note) frappe.model.clear_doc("Delivery Note", row.delivery_note) }) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 5201e5e80b..0dbf345e86 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -48,8 +48,8 @@ class SalesInvoice(SellingController): self.check_stop_sales_order("sales_order") self.validate_debit_to_acc() self.validate_fixed_asset_account() - self.clear_unallocated_advances("Sales Invoice Advance", "advance_adjustment_details") - self.validate_advance_jv("advance_adjustment_details", "sales_order") + self.clear_unallocated_advances("Sales Invoice Advance", "advances") + self.validate_advance_jv("advances", "sales_order") self.add_remarks() if cint(self.is_pos): @@ -69,7 +69,7 @@ class SalesInvoice(SellingController): self.validate_c_form() self.validate_time_logs_are_submitted() self.validate_multiple_billing("Delivery Note", "dn_detail", "amount", - "delivery_note_details") + "items") def on_submit(self): super(SalesInvoice, self).on_submit() @@ -200,12 +200,12 @@ class SalesInvoice(SellingController): 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") + if self.taxes_and_charges and not len(self.get("taxes")): + self.set_taxes("taxes", "taxes_and_charges") def get_advances(self): super(SalesInvoice, self).get_advances(self.debit_to, "Customer", self.customer, - "Sales Invoice Advance", "advance_adjustment_details", "credit", "sales_order") + "Sales Invoice Advance", "advances", "credit", "sales_order") def get_company_abbr(self): return frappe.db.sql("select abbr from tabCompany where name=%s", self.company)[0][0] @@ -219,7 +219,7 @@ class SalesInvoice(SellingController): """ lst = [] - for d in self.get('advance_adjustment_details'): + for d in self.get('advances'): if flt(d.allocated_amount) > 0: args = { 'voucher_no' : d.journal_voucher, @@ -371,7 +371,7 @@ class SalesInvoice(SellingController): 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 self.get('packing_details'): + for d in self.get('packed_items'): 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 @@ -406,7 +406,7 @@ class SalesInvoice(SellingController): from erpnext.stock.doctype.packed_item.packed_item import make_packing_list make_packing_list(self, 'entries') else: - self.set('packing_details', []) + self.set('packed_items', []) if cint(self.is_pos) == 1: if flt(self.paid_amount) == 0: @@ -500,7 +500,7 @@ class SalesInvoice(SellingController): ) def make_tax_gl_entries(self, gl_entries): - for tax in self.get("other_charges"): + for tax in self.get("taxes"): if flt(tax.tax_amount_after_discount_amount): gl_entries.append( self.get_gl_dict({ diff --git a/erpnext/accounts/doctype/sales_invoice/test_records.json b/erpnext/accounts/doctype/sales_invoice/test_records.json index ec1a774a14..abc360badc 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_records.json +++ b/erpnext/accounts/doctype/sales_invoice/test_records.json @@ -8,7 +8,7 @@ "debit_to": "_Test Receivable - _TC", "doctype": "Sales Invoice", "due_date": "2013-01-23", - "entries": [ + "items": [ { "amount": 500.0, "base_amount": 500.0, @@ -19,7 +19,7 @@ "income_account": "Sales - _TC", "expense_account": "_Test Account Cost for Goods Sold - _TC", "item_name": "138-CMS Shoe", - "parentfield": "entries", + "parentfield": "items", "qty": 1.0, "rate": 500.0 } @@ -30,13 +30,13 @@ "is_pos": 0, "naming_series": "_T-Sales Invoice-", "net_total": 500.0, - "other_charges": [ + "taxes": [ { "account_head": "_Test Account VAT - _TC", "charge_type": "On Net Total", "description": "VAT", "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 6 }, { @@ -44,7 +44,7 @@ "charge_type": "On Net Total", "description": "Service Tax", "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 6.36 } ], @@ -77,7 +77,7 @@ "debit_to": "_Test Receivable - _TC", "doctype": "Sales Invoice", "due_date": "2013-03-07", - "entries": [ + "items": [ { "amount": 500.0, "base_amount": 500.0, @@ -89,7 +89,7 @@ "income_account": "Sales - _TC", "item_code": "_Test Item", "item_name": "_Test Item", - "parentfield": "entries", + "parentfield": "items", "price_list_rate": 500.0, "qty": 1.0 } @@ -100,13 +100,13 @@ "is_pos": 0, "naming_series": "_T-Sales Invoice-", "net_total": 500.0, - "other_charges": [ + "taxes": [ { "account_head": "_Test Account VAT - _TC", "charge_type": "On Net Total", "description": "VAT", "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 16 }, { @@ -114,7 +114,7 @@ "charge_type": "On Net Total", "description": "Service Tax", "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 10 } ], @@ -133,7 +133,7 @@ "debit_to": "_Test Receivable - _TC", "doctype": "Sales Invoice", "due_date": "2013-01-23", - "entries": [ + "items": [ { "cost_center": "_Test Cost Center - _TC", "doctype": "Sales Invoice Item", @@ -142,7 +142,7 @@ "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", + "parentfield": "items", "price_list_rate": 50, "qty": 10, "rate": 50, @@ -155,7 +155,7 @@ "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", + "parentfield": "items", "price_list_rate": 150, "qty": 5, "rate": 150, @@ -166,14 +166,14 @@ "grand_total_export": 0, "is_pos": 0, "naming_series": "_T-Sales Invoice-", - "other_charges": [ + "taxes": [ { "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", + "parentfield": "taxes", "rate": 100 }, { @@ -182,7 +182,7 @@ "cost_center": "_Test Cost Center - _TC", "description": "Customs Duty", "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 10 }, { @@ -191,7 +191,7 @@ "cost_center": "_Test Cost Center - _TC", "description": "Excise Duty", "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 12 }, { @@ -200,7 +200,7 @@ "cost_center": "_Test Cost Center - _TC", "description": "Education Cess", "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 2, "row_id": 3 }, @@ -210,7 +210,7 @@ "cost_center": "_Test Cost Center - _TC", "description": "S&H Education Cess", "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 1, "row_id": 3 }, @@ -220,7 +220,7 @@ "cost_center": "_Test Cost Center - _TC", "description": "CST", "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 2, "row_id": 5 }, @@ -230,7 +230,7 @@ "cost_center": "_Test Cost Center - _TC", "description": "VAT", "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 12.5 }, { @@ -239,7 +239,7 @@ "cost_center": "_Test Cost Center - _TC", "description": "Discount", "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": -10, "row_id": 7 } @@ -259,7 +259,7 @@ "debit_to": "_Test Receivable - _TC", "doctype": "Sales Invoice", "due_date": "2013-01-23", - "entries": [ + "items": [ { "cost_center": "_Test Cost Center - _TC", "doctype": "Sales Invoice Item", @@ -268,7 +268,7 @@ "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", + "parentfield": "items", "price_list_rate": 62.5, "qty": 10, "stock_uom": "_Test UOM" @@ -280,7 +280,7 @@ "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", + "parentfield": "items", "price_list_rate": 190.66, "qty": 5, "stock_uom": "_Test UOM" @@ -290,7 +290,7 @@ "grand_total_export": 0, "is_pos": 0, "naming_series": "_T-Sales Invoice-", - "other_charges": [ + "taxes": [ { "account_head": "_Test Account Excise Duty - _TC", "charge_type": "On Net Total", @@ -299,7 +299,7 @@ "doctype": "Sales Taxes and Charges", "idx": 1, "included_in_print_rate": 1, - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 12 }, { @@ -310,7 +310,7 @@ "doctype": "Sales Taxes and Charges", "idx": 2, "included_in_print_rate": 1, - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 2, "row_id": 1 }, @@ -322,7 +322,7 @@ "doctype": "Sales Taxes and Charges", "idx": 3, "included_in_print_rate": 1, - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 1, "row_id": 1 }, @@ -334,7 +334,7 @@ "doctype": "Sales Taxes and Charges", "idx": 4, "included_in_print_rate": 1, - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 2, "row_id": 3 }, @@ -346,7 +346,7 @@ "doctype": "Sales Taxes and Charges", "idx": 5, "included_in_print_rate": 1, - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 12.5 }, { @@ -356,7 +356,7 @@ "description": "Customs Duty", "doctype": "Sales Taxes and Charges", "idx": 6, - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 10 }, { @@ -366,7 +366,7 @@ "description": "Shipping Charges", "doctype": "Sales Taxes and Charges", "idx": 7, - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 100 }, { @@ -376,7 +376,7 @@ "description": "Discount", "doctype": "Sales Taxes and Charges", "idx": 8, - "parentfield": "other_charges", + "parentfield": "taxes", "rate": -10, "row_id": 7 } diff --git a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py index fa8dbe9d4b..cafdd3a8ff 100644 --- a/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/test_sales_invoice.py @@ -69,7 +69,7 @@ class TestSalesInvoice(unittest.TestCase): "_Test Account Discount - _TC": [-180.78, 1627.05] } - for d in si.get("other_charges"): + for d in si.get("taxes"): for i, k in enumerate(expected_values["keys"]): self.assertEquals(d.get(k), expected_values[d.account_head][i]) @@ -119,7 +119,7 @@ class TestSalesInvoice(unittest.TestCase): "_Test Account Discount - _TC": [-180.78, 1627.05] } - for d in si.get("other_charges"): + for d in si.get("taxes"): for i, k in enumerate(expected_values["keys"]): self.assertEquals(d.get(k), expected_values[d.account_head][i]) @@ -129,7 +129,7 @@ class TestSalesInvoice(unittest.TestCase): def test_sales_invoice_discount_amount(self): si = frappe.copy_doc(test_records[3]) si.discount_amount = 104.95 - si.append("other_charges", { + si.append("taxes", { "doctype": "Sales Taxes and Charges", "charge_type": "On Previous Row Amount", "account_head": "_Test Account Service Tax - _TC", @@ -174,7 +174,7 @@ class TestSalesInvoice(unittest.TestCase): "_Test Account Service Tax - _TC": [-18.03, -16.88, 1500] } - for d in si.get("other_charges"): + for d in si.get("taxes"): for i, k in enumerate(expected_values["keys"]): self.assertEquals(d.get(k), expected_values[d.account_head][i]) @@ -184,7 +184,7 @@ class TestSalesInvoice(unittest.TestCase): def test_discount_amount_gl_entry(self): si = frappe.copy_doc(test_records[3]) si.discount_amount = 104.95 - si.append("other_charges", { + si.append("taxes", { "doctype": "Sales Taxes and Charges", "charge_type": "On Previous Row Amount", "account_head": "_Test Account Service Tax - _TC", @@ -205,14 +205,14 @@ class TestSalesInvoice(unittest.TestCase): expected_values = sorted([ [si.debit_to, 1500, 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_records[3]["taxes"][0]["account_head"], 0.0, 130.31], + [test_records[3]["taxes"][1]["account_head"], 0.0, 2.61], + [test_records[3]["taxes"][2]["account_head"], 0.0, 1.31], + [test_records[3]["taxes"][3]["account_head"], 0.0, 25.96], + [test_records[3]["taxes"][4]["account_head"], 0.0, 145.43], + [test_records[3]["taxes"][5]["account_head"], 0.0, 116.35], + [test_records[3]["taxes"][6]["account_head"], 0.0, 100], + [test_records[3]["taxes"][7]["account_head"], 168.54, 0.0], ["_Test Account Service Tax - _TC", 16.88, 0.0], ]) @@ -231,19 +231,19 @@ class TestSalesInvoice(unittest.TestCase): def test_inclusive_rate_validations(self): si = frappe.copy_doc(test_records[2]) - for i, tax in enumerate(si.get("other_charges")): + for i, tax in enumerate(si.get("taxes")): tax.idx = i+1 si.get("entries")[0].price_list_rate = 62.5 si.get("entries")[0].price_list_rate = 191 for i in xrange(6): - si.get("other_charges")[i].included_in_print_rate = 1 + si.get("taxes")[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 + si.get("taxes")[0].included_in_print_rate = 0 self.assertRaises(frappe.ValidationError, si.insert) def test_sales_invoice_calculation_base_currency_with_tax_inclusive_price(self): @@ -284,7 +284,7 @@ class TestSalesInvoice(unittest.TestCase): "_Test Account Discount - _TC": [-180.33, 1622.98] } - for d in si.get("other_charges"): + for d in si.get("taxes"): for i, k in enumerate(expected_values["keys"]): self.assertEquals(d.get(k), expected_values[d.account_head][i]) @@ -300,7 +300,7 @@ 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")[6].rate = 5000 + si.get("taxes")[6].rate = 5000 si.insert() @@ -336,7 +336,7 @@ class TestSalesInvoice(unittest.TestCase): "_Test Account Discount - _TC": [-7245.01, 65205.16] } - for d in si.get("other_charges"): + for d in si.get("taxes"): for i, k in enumerate(expected_values["keys"]): self.assertEquals(d.get(k), expected_values[d.account_head][i]) @@ -408,8 +408,8 @@ class TestSalesInvoice(unittest.TestCase): expected_values = sorted([ [si.debit_to, 630.0, 0.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], + [test_records[1]["taxes"][0]["account_head"], 0.0, 80.0], + [test_records[1]["taxes"][1]["account_head"], 0.0, 50.0], ]) for i, gle in enumerate(gl_entries): @@ -462,8 +462,8 @@ class TestSalesInvoice(unittest.TestCase): expected_gl_entries = sorted([ [si.debit_to, 630.0, 0.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], + [pos["taxes"][0]["account_head"], 0.0, 80.0], + [pos["taxes"][1]["account_head"], 0.0, 50.0], [stock_in_hand, 0.0, 75.0], [pos["entries"][0]["expense_account"], 75.0, 0.0], [si.debit_to, 0.0, 600.0], @@ -515,7 +515,7 @@ class TestSalesInvoice(unittest.TestCase): as pr_test_records pr = frappe.copy_doc(pr_test_records[0]) pr.naming_series = "_T-Purchase Receipt-" - pr.get("purchase_receipt_details")[0].warehouse = "_Test Warehouse No Account - _TC" + pr.get("items")[0].warehouse = "_Test Warehouse No Account - _TC" pr.insert() pr.submit() @@ -545,8 +545,8 @@ class TestSalesInvoice(unittest.TestCase): expected_gl_entries = sorted([ [si.debit_to, 630.0, 0.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], + [si_doc.get("taxes")[0]["account_head"], 0.0, 80.0], + [si_doc.get("taxes")[1]["account_head"], 0.0, 50.0], ]) for i, gle in enumerate(gl_entries): self.assertEquals(expected_gl_entries[i][0], gle.account) @@ -577,8 +577,8 @@ class TestSalesInvoice(unittest.TestCase): expected_values = sorted([ [si.debit_to, 630.0, 0.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], + [test_records[1]["taxes"][0]["account_head"], 0.0, 80.0], + [test_records[1]["taxes"][1]["account_head"], 0.0, 50.0], ]) for i, gle in enumerate(gl_entries): self.assertEquals(expected_values[i][0], gle.account) @@ -603,8 +603,8 @@ class TestSalesInvoice(unittest.TestCase): expected_values = sorted([ [si.debit_to, 630.0, 0.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], + [test_records[1]["taxes"][0]["account_head"], 0.0, 80.0], + [test_records[1]["taxes"][1]["account_head"], 0.0, 50.0], ]) for i, gle in enumerate(gl_entries): self.assertEquals(expected_values[i][0], gle.account) @@ -639,7 +639,7 @@ class TestSalesInvoice(unittest.TestCase): jv.submit() si = frappe.copy_doc(test_records[0]) - si.append("advance_adjustment_details", { + si.append("advances", { "doctype": "Sales Invoice Advance", "journal_voucher": jv.name, "jv_detail_no": jv.get("entries")[0].name, @@ -651,17 +651,17 @@ class TestSalesInvoice(unittest.TestCase): si.submit() si.load_from_db() - self.assertTrue(frappe.db.sql("""select name from `tabJournal Voucher Detail` + self.assertTrue(frappe.db.sql("""select name from `tabJournal Entry Account` where against_invoice=%s""", si.name)) - self.assertTrue(frappe.db.sql("""select name from `tabJournal Voucher Detail` + self.assertTrue(frappe.db.sql("""select name from `tabJournal Entry Account` 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` + self.assertTrue(not frappe.db.sql("""select name from `tabJournal Entry Account` where against_invoice=%s""", si.name)) def test_recurring_invoice(self): @@ -679,7 +679,7 @@ 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.get("mtn_details")[0].serial_no) + serial_nos = get_serial_nos(se.get("items")[0].serial_no) si = frappe.copy_doc(test_records[0]) si.update_stock = 1 @@ -713,7 +713,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.get("mtn_details")[0].serial_no) + serial_nos = get_serial_nos(se.get("items")[0].serial_no) sr = frappe.get_doc("Serial No", serial_nos[0]) sr.status = "Not Available" 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 d11bf294f8..c373796059 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 @@ -33,7 +33,7 @@ cur_frm.pformat.in_words_export = function(doc) { return ''; } -cur_frm.pformat.other_charges= function(doc){ +cur_frm.pformat.taxes= function(doc){ //function to make row of table var make_row = function(title, val, bold){ var bstart = ''; var bend = ''; @@ -54,7 +54,7 @@ cur_frm.pformat.other_charges= function(doc){ out =''; if (!doc.print_without_amount) { - var cl = doc.other_charges || []; + var cl = doc.taxes || []; // outer table var out='
'; @@ -104,7 +104,7 @@ cur_frm.cscript.charge_type = function(doc, cdt, cdn) { d.charge_type = ''; } validated = false; - refresh_field('charge_type', d.name, 'other_charges'); + refresh_field('charge_type', d.name, 'taxes'); cur_frm.cscript.row_id(doc, cdt, cdn); cur_frm.cscript.rate(doc, cdt, cdn); cur_frm.cscript.tax_amount(doc, cdt, cdn); @@ -127,12 +127,12 @@ cur_frm.cscript.row_id = function(doc, cdt, cdn) { } } validated = false; - refresh_field('row_id', d.name, 'other_charges'); + refresh_field('row_id', d.name, 'taxes'); } /*---------------------- Get rate if account_head has account_type as TAX or CHARGEABLE-------------------------------------*/ -cur_frm.fields_dict['other_charges'].grid.get_field("account_head").get_query = function(doc,cdt,cdn) { +cur_frm.fields_dict['taxes'].grid.get_field("account_head").get_query = function(doc,cdt,cdn) { return{ query: "erpnext.controllers.queries.tax_account_query", filters: { @@ -142,7 +142,7 @@ cur_frm.fields_dict['other_charges'].grid.get_field("account_head").get_query = } } -cur_frm.fields_dict['other_charges'].grid.get_field("cost_center").get_query = function(doc) { +cur_frm.fields_dict['taxes'].grid.get_field("cost_center").get_query = function(doc) { return{ 'company': doc.company, 'group_or_ledger': "Ledger" @@ -156,7 +156,7 @@ cur_frm.cscript.rate = function(doc, cdt, cdn) { d.rate = ''; } validated = false; - refresh_field('rate', d.name, 'other_charges'); + refresh_field('rate', d.name, 'taxes'); } cur_frm.cscript.tax_amount = function(doc, cdt, cdn) { @@ -170,5 +170,5 @@ cur_frm.cscript.tax_amount = function(doc, cdt, cdn) { d.tax_amount = ''; } validated = false; - refresh_field('tax_amount', d.name, 'other_charges'); + refresh_field('tax_amount', d.name, 'taxes'); }; 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 8dd2759221..6ab5ab2745 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 @@ -14,4 +14,4 @@ class SalesTaxesandChargesMaster(Document): (self.name, self.company)) # at least one territory - self.validate_table_has_rows("valid_for_territories") + self.validate_table_has_rows("territories") 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 index dda8a4aa8f..dd9c595fe9 100644 --- a/erpnext/accounts/doctype/sales_taxes_and_charges_master/test_records.json +++ b/erpnext/accounts/doctype/sales_taxes_and_charges_master/test_records.json @@ -2,13 +2,13 @@ { "company": "_Test Company", "doctype": "Sales Taxes and Charges Master", - "other_charges": [ + "taxes": [ { "account_head": "_Test Account VAT - _TC", "charge_type": "On Net Total", "description": "VAT", "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 6 }, { @@ -16,20 +16,20 @@ "charge_type": "On Net Total", "description": "Service Tax", "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 6.36 } ], "title": "_Test Sales Taxes and Charges Master", - "valid_for_territories": [ + "territories": [ { "doctype": "Applicable Territory", - "parentfield": "valid_for_territories", + "parentfield": "territories", "territory": "All Territories" }, { "doctype": "Applicable Territory", - "parentfield": "valid_for_territories", + "parentfield": "territories", "territory": "_Test Territory Rest Of The World" } ] @@ -37,14 +37,14 @@ { "company": "_Test Company", "doctype": "Sales Taxes and Charges Master", - "other_charges": [ + "taxes": [ { "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", + "parentfield": "taxes", "rate": 100 }, { @@ -53,7 +53,7 @@ "cost_center": "_Test Cost Center - _TC", "description": "Customs Duty", "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 10 }, { @@ -62,7 +62,7 @@ "cost_center": "_Test Cost Center - _TC", "description": "Excise Duty", "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 12 }, { @@ -71,7 +71,7 @@ "cost_center": "_Test Cost Center - _TC", "description": "Education Cess", "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 2, "row_id": 3 }, @@ -81,7 +81,7 @@ "cost_center": "_Test Cost Center - _TC", "description": "S&H Education Cess", "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 1, "row_id": 3 }, @@ -91,7 +91,7 @@ "cost_center": "_Test Cost Center - _TC", "description": "CST", "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 2, "row_id": 5 }, @@ -101,7 +101,7 @@ "cost_center": "_Test Cost Center - _TC", "description": "VAT", "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 12.5 }, { @@ -110,16 +110,16 @@ "cost_center": "_Test Cost Center - _TC", "description": "Discount", "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": -10, "row_id": 7 } ], "title": "_Test India Tax Master", - "valid_for_territories": [ + "territories": [ { "doctype": "Applicable Territory", - "parentfield": "valid_for_territories", + "parentfield": "territories", "territory": "_Test Territory India" } ] @@ -127,13 +127,13 @@ { "company": "_Test Company", "doctype": "Sales Taxes and Charges Master", - "other_charges": [ + "taxes": [ { "account_head": "_Test Account VAT - _TC", "charge_type": "On Net Total", "description": "VAT", "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 12 }, { @@ -141,15 +141,15 @@ "charge_type": "On Net Total", "description": "Service Tax", "doctype": "Sales Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 4 } ], "title": "_Test Sales Taxes and Charges Master - Rest of the World", - "valid_for_territories": [ + "territories": [ { "doctype": "Applicable Territory", - "parentfield": "valid_for_territories", + "parentfield": "territories", "territory": "_Test Territory Rest Of The World" } ] diff --git a/erpnext/accounts/doctype/shipping_rule/shipping_rule.py b/erpnext/accounts/doctype/shipping_rule/shipping_rule.py index f9f64e4677..27f49daa2e 100644 --- a/erpnext/accounts/doctype/shipping_rule/shipping_rule.py +++ b/erpnext/accounts/doctype/shipping_rule/shipping_rule.py @@ -17,7 +17,7 @@ class ManyBlankToValuesError(frappe.ValidationError): pass class ShippingRule(Document): def validate(self): self.validate_value("calculate_based_on", "in", ["Net Total", "Net Weight"]) - self.shipping_rule_conditions = self.get("shipping_rule_conditions") + self.conditions = self.get("conditions") self.validate_from_to_values() self.sort_shipping_rule_conditions() self.validate_overlapping_shipping_rule_conditions() @@ -25,7 +25,7 @@ class ShippingRule(Document): def validate_from_to_values(self): zero_to_values = [] - for d in self.get("shipping_rule_conditions"): + for d in self.get("conditions"): self.round_floats_in(d) # values cannot be negative @@ -44,8 +44,8 @@ class ShippingRule(Document): def sort_shipping_rule_conditions(self): """Sort Shipping Rule Conditions based on increasing From Value""" - self.shipping_rules_conditions = sorted(self.shipping_rule_conditions, key=lambda d: flt(d.from_value)) - for i, d in enumerate(self.shipping_rule_conditions): + self.shipping_rules_conditions = sorted(self.conditions, key=lambda d: flt(d.from_value)) + for i, d in enumerate(self.conditions): d.idx = i + 1 def validate_overlapping_shipping_rule_conditions(self): @@ -60,9 +60,9 @@ class ShippingRule(Document): return (not separate) overlaps = [] - 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] + for i in xrange(0, len(self.conditions)): + for j in xrange(i+1, len(self.conditions)): + d1, d2 = self.conditions[i], self.conditions[j] 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) diff --git a/erpnext/accounts/doctype/shipping_rule/test_records.json b/erpnext/accounts/doctype/shipping_rule/test_records.json index 5477c8f957..96e7770d5a 100644 --- a/erpnext/accounts/doctype/shipping_rule/test_records.json +++ b/erpnext/accounts/doctype/shipping_rule/test_records.json @@ -7,32 +7,32 @@ "doctype": "Shipping Rule", "label": "_Test Shipping Rule", "name": "_Test Shipping Rule", - "shipping_rule_conditions": [ + "conditions": [ { "doctype": "Shipping Rule Condition", "from_value": 0, - "parentfield": "shipping_rule_conditions", + "parentfield": "conditions", "shipping_amount": 50.0, "to_value": 100 }, { "doctype": "Shipping Rule Condition", "from_value": 101, - "parentfield": "shipping_rule_conditions", + "parentfield": "conditions", "shipping_amount": 100.0, "to_value": 200 }, { "doctype": "Shipping Rule Condition", "from_value": 201, - "parentfield": "shipping_rule_conditions", + "parentfield": "conditions", "shipping_amount": 0.0 } ], - "valid_for_territories": [ + "territories": [ { "doctype": "Applicable Territory", - "parentfield": "valid_for_territories", + "parentfield": "territories", "territory": "_Test Territory" } ] @@ -45,32 +45,32 @@ "doctype": "Shipping Rule", "label": "_Test Shipping Rule - India", "name": "_Test Shipping Rule - India", - "shipping_rule_conditions": [ + "conditions": [ { "doctype": "Shipping Rule Condition", "from_value": 0, - "parentfield": "shipping_rule_conditions", + "parentfield": "conditions", "shipping_amount": 50.0, "to_value": 100 }, { "doctype": "Shipping Rule Condition", "from_value": 101, - "parentfield": "shipping_rule_conditions", + "parentfield": "conditions", "shipping_amount": 100.0, "to_value": 200 }, { "doctype": "Shipping Rule Condition", "from_value": 201, - "parentfield": "shipping_rule_conditions", + "parentfield": "conditions", "shipping_amount": 0.0 } ], - "valid_for_territories": [ + "territories": [ { "doctype": "Applicable Territory", - "parentfield": "valid_for_territories", + "parentfield": "territories", "territory": "_Test Territory India" } ] @@ -83,32 +83,32 @@ "doctype": "Shipping Rule", "label": "_Test Shipping Rule - Rest of the World", "name": "_Test Shipping Rule - Rest of the World", - "shipping_rule_conditions": [ + "conditions": [ { "doctype": "Shipping Rule Condition", "from_value": 0, - "parentfield": "shipping_rule_conditions", + "parentfield": "conditions", "shipping_amount": 500.0, "to_value": 1000 }, { "doctype": "Shipping Rule Condition", "from_value": 1001, - "parentfield": "shipping_rule_conditions", + "parentfield": "conditions", "shipping_amount": 1000.0, "to_value": 2000 }, { "doctype": "Shipping Rule Condition", "from_value": 2001, - "parentfield": "shipping_rule_conditions", + "parentfield": "conditions", "shipping_amount": 1500.0 } ], - "valid_for_territories": [ + "territories": [ { "doctype": "Applicable Territory", - "parentfield": "valid_for_territories", + "parentfield": "territories", "territory": "_Test Territory Rest Of The World" } ] diff --git a/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py b/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py index d14bcd7447..bcb999312c 100644 --- a/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py +++ b/erpnext/accounts/doctype/shipping_rule/test_shipping_rule.py @@ -11,13 +11,13 @@ class TestShippingRule(unittest.TestCase): def test_from_greater_than_to(self): shipping_rule = frappe.copy_doc(test_records[0]) shipping_rule.name = test_records[0].get('name') - shipping_rule.get("shipping_rule_conditions")[0].from_value = 101 + shipping_rule.get("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.name = test_records[0].get('name') - shipping_rule.get("shipping_rule_conditions")[0].to_value = 0 + shipping_rule.get("conditions")[0].to_value = 0 self.assertRaises(ManyBlankToValuesError, shipping_rule.insert) def test_overlapping_conditions(self): @@ -30,8 +30,8 @@ class TestShippingRule(unittest.TestCase): ]: shipping_rule = frappe.copy_doc(test_records[0]) shipping_rule.name = test_records[0].get('name') - 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] + shipping_rule.get("conditions")[0].from_value = range_a[0] + shipping_rule.get("conditions")[0].to_value = range_a[1] + shipping_rule.get("conditions")[1].from_value = range_b[0] + shipping_rule.get("conditions")[1].to_value = range_b[1] self.assertRaises(OverlappingConditionError, shipping_rule.insert) diff --git a/erpnext/accounts/print_format/pos_invoice/pos_invoice.json b/erpnext/accounts/print_format/pos_invoice/pos_invoice.json index 83174b6c29..51ac7cc541 100644 --- a/erpnext/accounts/print_format/pos_invoice/pos_invoice.json +++ b/erpnext/accounts/print_format/pos_invoice/pos_invoice.json @@ -1,15 +1,15 @@ { - "creation": "2011-12-21 11:08:55", - "doc_type": "Sales Invoice", - "docstatus": 0, - "doctype": "Print Format", - "html": "\n\n

\n\t{{ doc.company }}
\n\t{{ doc.select_print_heading or _(\"Invoice\") }}
\n

\n

\n\t{{ _(\"Receipt No\") }}: {{ doc.name }}
\n\t{{ _(\"Date\") }}: {{ doc.get_formatted(\"posting_date\") }}
\n\t{{ _(\"Customer\") }}: {{ doc.customer_name }}\n

\n\n
\n\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\n\t\n\t\t{%- for item in doc.entries -%}\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t{%- endfor -%}\n\t\n
{{ _(\"Item\") }}{{ _(\"Qty\") }}{{ _(\"Rate\") }}
\n\t\t\t\t{{ item.item_code }}\n\t\t\t\t{%- if item.item_name != item.item_code -%}\n\t\t\t\t\t
{{ item.item_name }}{%- endif -%}\n\t\t\t
{{ item.qty }}{{ item.amount }}
\n\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t{%- for row in doc.other_charges -%}\n\t\t{%- if not row.included_in_print_rate -%}\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t{%- endif -%}\n\t\t{%- endfor -%}\n\t\t{%- if doc.discount_amount -%}\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t{%- endif -%}\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\n
\n\t\t\t\t{{ _(\"Net Total\") }}\n\t\t\t\n\t\t\t\t{{ doc.get_formatted(\"net_total_export\") }}\n\t\t\t
\n\t\t\t\t{{ row.description }}\n\t\t\t\n\t\t\t\t{{ row.get_formatted(\"tax_amount\", doc) }}\n\t\t\t
\n\t\t\t\t{{ _(\"Discount\") }}\n\t\t\t\n\t\t\t\t{{ doc.get_formatted(\"discount_amount\") }}\n\t\t\t
\n\t\t\t\t{{ _(\"Grand Total\") }}\n\t\t\t\n\t\t\t\t{{ doc.get_formatted(\"grand_total_export\") }}\n\t\t\t
\n{% if doc.get(\"other_charges\", filters={\"included_in_print_rate\": 1}) %}\n
\n

Taxes Included:

\n\n\t\n\t\t{%- for row in doc.other_charges -%}\n\t\t{%- if row.included_in_print_rate -%}\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t{%- endif -%}\n\t\t{%- endfor -%}\n\t\n
\n\t\t\t\t{{ row.description }}\n\t\t\t\n\t\t\t\t{{ row.get_formatted(\"tax_amount\", doc) }}\n\t\t\t
\n{%- endif -%}\n
\n

{{ doc.terms or \"\" }}

\n

{{ _(\"Thank you, please visit again.\") }}

", - "idx": 1, - "modified": "2014-07-22 02:08:26.603223", - "modified_by": "Administrator", - "module": "Accounts", - "name": "POS Invoice", - "owner": "Administrator", - "print_format_type": "Server", + "creation": "2011-12-21 11:08:55", + "doc_type": "Sales Invoice", + "docstatus": 0, + "doctype": "Print Format", + "html": "\n\n

\n\t{{ doc.company }}
\n\t{{ doc.select_print_heading or _(\"Invoice\") }}
\n

\n

\n\t{{ _(\"Receipt No\") }}: {{ doc.name }}
\n\t{{ _(\"Date\") }}: {{ doc.get_formatted(\"posting_date\") }}
\n\t{{ _(\"Customer\") }}: {{ doc.customer_name }}\n

\n\n
\n\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\n\t\n\t\t{%- for item in doc.items -%}\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t{%- endfor -%}\n\t\n
{{ _(\"Item\") }}{{ _(\"Qty\") }}{{ _(\"Rate\") }}
\n\t\t\t\t{{ item.item_code }}\n\t\t\t\t{%- if item.item_name != item.item_code -%}\n\t\t\t\t\t
{{ item.item_name }}{%- endif -%}\n\t\t\t
{{ item.qty }}{{ item.amount }}
\n\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t{%- for row in doc.taxes -%}\n\t\t{%- if not row.included_in_print_rate -%}\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t{%- endif -%}\n\t\t{%- endfor -%}\n\t\t{%- if doc.discount_amount -%}\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t{%- endif -%}\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\n
\n\t\t\t\t{{ _(\"Net Total\") }}\n\t\t\t\n\t\t\t\t{{ doc.get_formatted(\"net_total_export\") }}\n\t\t\t
\n\t\t\t\t{{ row.description }}\n\t\t\t\n\t\t\t\t{{ row.get_formatted(\"tax_amount\", doc) }}\n\t\t\t
\n\t\t\t\t{{ _(\"Discount\") }}\n\t\t\t\n\t\t\t\t{{ doc.get_formatted(\"discount_amount\") }}\n\t\t\t
\n\t\t\t\t{{ _(\"Grand Total\") }}\n\t\t\t\n\t\t\t\t{{ doc.get_formatted(\"grand_total_export\") }}\n\t\t\t
\n{% if doc.get(\"taxes\", filters={\"included_in_print_rate\": 1}) %}\n
\n

Taxes Included:

\n\n\t\n\t\t{%- for row in doc.taxes -%}\n\t\t{%- if row.included_in_print_rate -%}\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t{%- endif -%}\n\t\t{%- endfor -%}\n\t\n
\n\t\t\t\t{{ row.description }}\n\t\t\t\n\t\t\t\t{{ row.get_formatted(\"tax_amount\", doc) }}\n\t\t\t
\n{%- endif -%}\n
\n

{{ doc.terms or \"\" }}

\n

{{ _(\"Thank you, please visit again.\") }}

", + "idx": 1, + "modified": "2014-12-25 02:08:26.603223", + "modified_by": "Administrator", + "module": "Accounts", + "name": "POS Invoice", + "owner": "Administrator", + "print_format_type": "Server", "standard": "Yes" -} \ No newline at end of file +} diff --git a/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.py b/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.py index dbf86e352d..98dfdbb842 100644 --- a/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.py +++ b/erpnext/accounts/report/bank_clearance_summary/bank_clearance_summary.py @@ -35,7 +35,7 @@ def get_entries(filters): conditions = get_conditions(filters) entries = frappe.db.sql("""select jv.name, jvd.account, jv.posting_date, jv.clearance_date, jvd.against_account, jvd.debit, jvd.credit - from `tabJournal Voucher Detail` jvd, `tabJournal Voucher` jv + from `tabJournal Entry Account` jvd, `tabJournal Voucher` jv where jvd.parent = jv.name and jv.docstatus=1 %s order by jv.name DESC""" % conditions, filters, as_list=1) return entries \ No newline at end of file diff --git a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py index cbe5988c14..b55d9a42a0 100644 --- a/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py +++ b/erpnext/accounts/report/bank_reconciliation_statement/bank_reconciliation_statement.py @@ -24,7 +24,7 @@ def execute(filters=None): total_credit += flt(d[3]) amounts_not_reflected_in_system = frappe.db.sql("""select sum(ifnull(jvd.debit, 0) - ifnull(jvd.credit, 0)) - from `tabJournal Voucher Detail` jvd, `tabJournal Voucher` jv + from `tabJournal Entry Account` jvd, `tabJournal Voucher` jv where jvd.parent = jv.name and jv.docstatus=1 and jvd.account=%s and jv.posting_date > %s and jv.clearance_date <= %s and ifnull(jv.is_opening, 'No') = 'No' """, (filters["account"], filters["report_date"], filters["report_date"])) @@ -57,7 +57,7 @@ def get_entries(filters): jv.posting_date, jv.name, jvd.debit, jvd.credit, jvd.against_account, jv.cheque_no, jv.cheque_date, jv.clearance_date from - `tabJournal Voucher Detail` jvd, `tabJournal Voucher` jv + `tabJournal Entry Account` jvd, `tabJournal Voucher` jv where jvd.parent = jv.name and jv.docstatus=1 and jvd.account = %(account)s and jv.posting_date <= %(report_date)s and ifnull(jv.clearance_date, '4000-01-01') > %(report_date)s diff --git a/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.py b/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.py index b1d74373fc..434cb86489 100644 --- a/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.py +++ b/erpnext/accounts/report/payment_period_based_on_invoice_date/payment_period_based_on_invoice_date.py @@ -77,7 +77,7 @@ def get_entries(filters): entries = frappe.db.sql("""select jv.name, jvd.account, jv.posting_date, jvd.against_voucher, jvd.against_invoice, jvd.debit, jvd.credit, jv.cheque_no, jv.cheque_date, jv.remark - from `tabJournal Voucher Detail` jvd, `tabJournal Voucher` jv + from `tabJournal Entry Account` jvd, `tabJournal Voucher` jv where jvd.parent = jv.name and jv.docstatus=1 %s order by jv.name DESC""" % (conditions), tuple(party_accounts), as_dict=1) diff --git a/erpnext/accounts/utils.py b/erpnext/accounts/utils.py index 2abc187dab..eb0c86db72 100644 --- a/erpnext/accounts/utils.py +++ b/erpnext/accounts/utils.py @@ -163,7 +163,7 @@ def check_if_jv_modified(args): check if jv is submitted """ ret = frappe.db.sql(""" - select t2.{dr_or_cr} from `tabJournal Voucher` t1, `tabJournal Voucher Detail` t2 + select t2.{dr_or_cr} from `tabJournal Voucher` t1, `tabJournal Entry Account` t2 where t1.name = t2.parent and t2.account = %(account)s and t2.party_type = %(party_type)s and t2.party = %(party)s and ifnull(t2.against_voucher, '')='' @@ -190,7 +190,7 @@ def update_against_doc(d, jv_obj): if d['allocated_amt'] < d['unadjusted_amt']: jvd = frappe.db.sql("""select cost_center, balance, against_account, is_advance - from `tabJournal Voucher Detail` where name = %s""", d['voucher_detail_no']) + from `tabJournal Entry Account` where name = %s""", d['voucher_detail_no']) # new entry with balance amount ch = jv_obj.append("entries") ch.account = d['account'] @@ -209,11 +209,11 @@ def update_against_doc(d, jv_obj): jv_obj.save() 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 Entry Account` where `%s`=%s and docstatus < 2""" % (against_field, "%s"), (ref_no)) if linked_jv: - frappe.db.sql("""update `tabJournal Voucher Detail` set `%s`=null, + frappe.db.sql("""update `tabJournal Entry Account` set `%s`=null, modified=%s, modified_by=%s where `%s`=%s and docstatus < 2""" % (against_field, "%s", "%s", against_field, "%s"), (now(), frappe.session.user, ref_no)) diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.js b/erpnext/buying/doctype/purchase_common/purchase_common.js index 2f7af7196d..1b8c6354a7 100644 --- a/erpnext/buying/doctype/purchase_common/purchase_common.js +++ b/erpnext/buying/doctype/purchase_common/purchase_common.js @@ -178,7 +178,7 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({ calculate_taxes_and_totals: function() { this._super(); - this.calculate_total_advance("Purchase Invoice", "advance_allocation_details"); + this.calculate_total_advance("Purchase Invoice", "advances"); this.frm.refresh_fields(); }, @@ -368,9 +368,9 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({ setup_field_label_map(["tax_amount", "total"], company_currency, this.other_fname); } - if(this.frm.fields_dict["advance_allocation_details"]) { + if(this.frm.fields_dict["advances"]) { setup_field_label_map(["advance_amount", "allocated_amount"], company_currency, - "advance_allocation_details"); + "advances"); } // toggle columns diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js index e712995c55..a8d327a76b 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.js +++ b/erpnext/buying/doctype/purchase_order/purchase_order.js @@ -4,8 +4,8 @@ frappe.provide("erpnext.buying"); cur_frm.cscript.tname = "Purchase Order Item"; -cur_frm.cscript.fname = "po_details"; -cur_frm.cscript.other_fname = "other_charges"; +cur_frm.cscript.fname = "items"; +cur_frm.cscript.other_fname = "taxes"; {% include 'buying/doctype/purchase_common/purchase_common.js' %}; {% include 'accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js' %} @@ -105,9 +105,9 @@ erpnext.buying.PurchaseOrderController = erpnext.buying.BuyingController.extend( this.get_terms(); }, - po_details_add: function(doc, cdt, cdn) { + items_add: function(doc, cdt, cdn) { var row = frappe.get_doc(cdt, cdn); - this.frm.script_manager.copy_from_first_row("po_details", row, ["schedule_date"]); + this.frm.script_manager.copy_from_first_row("items", row, ["schedule_date"]); } }); @@ -126,7 +126,7 @@ cur_frm.fields_dict['contact_person'].get_query = function(doc, cdt, cdn) { } } -cur_frm.fields_dict['po_details'].grid.get_field('project_name').get_query = function(doc, cdt, cdn) { +cur_frm.fields_dict['items'].grid.get_field('project_name').get_query = function(doc, cdt, cdn) { return { filters:[ ['Project', 'status', 'not in', 'Completed, Cancelled'] @@ -134,7 +134,7 @@ cur_frm.fields_dict['po_details'].grid.get_field('project_name').get_query = fun } } -cur_frm.fields_dict['po_details'].grid.get_field('bom').get_query = function(doc, cdt, cdn) { +cur_frm.fields_dict['items'].grid.get_field('bom').get_query = function(doc, cdt, cdn) { var d = locals[cdt][cdn] return { filters: [ @@ -188,7 +188,7 @@ cur_frm.pformat.indent_no = function(doc, cdt, cdn){ out =''; - var cl = doc.po_details || []; + var cl = doc.items || []; // outer table var out='
'; diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index 09f303f6aa..245d46e606 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -9,12 +9,12 @@ from frappe.model.mapper import get_mapped_doc from erpnext.controllers.buying_controller import BuyingController form_grid_templates = { - "po_details": "templates/form_grid/item_grid.html" + "items": "templates/form_grid/item_grid.html" } class PurchaseOrder(BuyingController): tname = 'Purchase Order Item' - fname = 'po_details' + fname = 'items' def __init__(self, arg1, arg2=None): super(PurchaseOrder, self).__init__(arg1, arg2) @@ -51,7 +51,7 @@ class PurchaseOrder(BuyingController): self.validate_with_previous_doc() self.validate_for_subcontracting() self.validate_minimum_order_qty() - self.create_raw_materials_supplied("po_raw_material_details") + self.create_raw_materials_supplied("supplied_items") def validate_with_previous_doc(self): super(PurchaseOrder, self).validate_with_previous_doc(self.tname, { @@ -71,7 +71,7 @@ class PurchaseOrder(BuyingController): itemwise_min_order_qty = frappe._dict(frappe.db.sql("select name, min_order_qty from tabItem")) itemwise_qty = frappe._dict() - for d in self.get("po_details"): + for d in self.get("items"): itemwise_qty.setdefault(d.item_code, 0) itemwise_qty[d.item_code] += flt(d.stock_qty) @@ -80,7 +80,7 @@ class PurchaseOrder(BuyingController): frappe.throw(_("Item #{0}: Ordered qty can not less than item's minimum order qty (defined in item master).").format(item_code)) def get_schedule_dates(self): - for d in self.get('po_details'): + for d in self.get('items'): 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") @@ -91,14 +91,14 @@ class PurchaseOrder(BuyingController): # Check for Stopped status def check_for_stopped_status(self, pc_obj): check_list =[] - for d in self.get('po_details'): + for d in self.get('items'): 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) def update_requested_qty(self): material_request_map = {} - for d in self.get("po_details"): + for d in self.get("items"): if d.prevdoc_doctype and d.prevdoc_doctype == "Material Request" and d.prevdoc_detail_docname: material_request_map.setdefault(d.prevdoc_docname, []).append(d.prevdoc_detail_docname) @@ -128,7 +128,7 @@ class PurchaseOrder(BuyingController): bin_doc.save() item_wh_list = [] - for d in self.get("po_details"): + for d in self.get("items"): if (not po_item_rows or d.name in po_item_rows) and [d.item_code, d.warehouse] not in item_wh_list \ and frappe.db.get_value("Item", d.item_code, "is_stock_item") == "Yes" and d.warehouse: item_wh_list.append([d.item_code, d.warehouse]) diff --git a/erpnext/buying/doctype/purchase_order/test_purchase_order.py b/erpnext/buying/doctype/purchase_order/test_purchase_order.py index e67d320e74..9ff5c4446f 100644 --- a/erpnext/buying/doctype/purchase_order/test_purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/test_purchase_order.py @@ -23,7 +23,7 @@ class TestPurchaseOrder(unittest.TestCase): 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"])) + self.assertEquals(len(pr.get("items")), len(test_records[0]["items"])) pr.naming_series = "_T-Purchase Receipt-" frappe.get_doc(pr).insert() @@ -38,7 +38,7 @@ class TestPurchaseOrder(unittest.TestCase): po = frappe.get_doc("Purchase Order", po.name) po.is_subcontracted = "No" - po.get("po_details")[0].item_code = "_Test Item" + po.get("items")[0].item_code = "_Test Item" po.submit() self.assertEquals(self._get_ordered_qty("_Test Item", "_Test Warehouse - _TC"), existing_ordered_qty + 10) @@ -46,15 +46,15 @@ class TestPurchaseOrder(unittest.TestCase): pr = make_purchase_receipt(po.name) self.assertEquals(pr.doctype, "Purchase Receipt") - self.assertEquals(len(pr.get("purchase_receipt_details", [])), len(test_records[0]["po_details"])) + self.assertEquals(len(pr.get("items", [])), len(test_records[0]["items"])) pr.posting_date = "2013-05-12" pr.naming_series = "_T-Purchase Receipt-" - pr.purchase_receipt_details[0].qty = 4.0 + pr.items[0].qty = 4.0 pr.insert() pr.submit() po.load_from_db() - self.assertEquals(po.get("po_details")[0].received_qty, 4) + self.assertEquals(po.get("items")[0].received_qty, 4) self.assertEquals(self._get_ordered_qty("_Test Item", "_Test Warehouse - _TC"), existing_ordered_qty + 6) frappe.db.set_value('Item', '_Test Item', 'tolerance', 50) @@ -62,19 +62,19 @@ class TestPurchaseOrder(unittest.TestCase): pr1 = make_purchase_receipt(po.name) pr1.naming_series = "_T-Purchase Receipt-" pr1.posting_date = "2013-05-12" - pr1.get("purchase_receipt_details")[0].qty = 8 + pr1.get("items")[0].qty = 8 pr1.insert() pr1.submit() po.load_from_db() - self.assertEquals(po.get("po_details")[0].received_qty, 12) + self.assertEquals(po.get("items")[0].received_qty, 12) self.assertEquals(self._get_ordered_qty("_Test Item", "_Test Warehouse - _TC"), existing_ordered_qty) pr1.load_from_db() pr1.cancel() po.load_from_db() - self.assertEquals(po.get("po_details")[0].received_qty, 4) + self.assertEquals(po.get("items")[0].received_qty, 4) self.assertEquals(self._get_ordered_qty("_Test Item", "_Test Warehouse - _TC"), existing_ordered_qty + 6) def test_make_purchase_invoice(self): @@ -90,7 +90,7 @@ class TestPurchaseOrder(unittest.TestCase): pi = make_purchase_invoice(po.name) self.assertEquals(pi.doctype, "Purchase Invoice") - self.assertEquals(len(pi.get("entries", [])), len(test_records[0]["po_details"])) + self.assertEquals(len(pi.get("entries", [])), len(test_records[0]["items"])) pi.credit_to = "_Test Payable - _TC" pi.posting_date = "2013-05-12" @@ -100,7 +100,7 @@ class TestPurchaseOrder(unittest.TestCase): def test_subcontracting(self): po = frappe.copy_doc(test_records[0]) po.insert() - self.assertEquals(len(po.get("po_raw_material_details")), 2) + self.assertEquals(len(po.get("supplied_items")), 2) def test_warehouse_company_validation(self): from erpnext.stock.utils import InvalidWarehouseCompany @@ -112,7 +112,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.get("po_details")[0].qty = 3.4 + po.get("items")[0].qty = 3.4 self.assertRaises(UOMMustBeIntegerError, po.insert) def test_recurring_order(self): diff --git a/erpnext/buying/doctype/purchase_order/test_records.json b/erpnext/buying/doctype/purchase_order/test_records.json index 6b89bdc3de..2b329af0e3 100644 --- a/erpnext/buying/doctype/purchase_order/test_records.json +++ b/erpnext/buying/doctype/purchase_order/test_records.json @@ -12,7 +12,7 @@ "is_subcontracted": "Yes", "naming_series": "_T-Purchase Order-", "net_total": 5000.0, - "po_details": [ + "items": [ { "base_amount": 5000.0, "conversion_factor": 1.0, @@ -20,7 +20,7 @@ "doctype": "Purchase Order Item", "item_code": "_Test FG Item", "item_name": "_Test FG Item", - "parentfield": "po_details", + "parentfield": "items", "qty": 10.0, "rate": 500.0, "schedule_date": "2013-03-01", @@ -46,7 +46,7 @@ "is_subcontracted": "No", "naming_series": "_T-Purchase Order-", "net_total": 5000.0, - "po_details": [ + "items": [ { "base_amount": 5000.0, "conversion_factor": 1.0, @@ -54,7 +54,7 @@ "doctype": "Purchase Order Item", "item_code": "_Test Item", "item_name": "_Test Item", - "parentfield": "po_details", + "parentfield": "items", "qty": 10.0, "rate": 500.0, "schedule_date": "2013-03-01", diff --git a/erpnext/buying/doctype/quality_inspection/quality_inspection.py b/erpnext/buying/doctype/quality_inspection/quality_inspection.py index 216d1657d0..a9b157c5e3 100644 --- a/erpnext/buying/doctype/quality_inspection/quality_inspection.py +++ b/erpnext/buying/doctype/quality_inspection/quality_inspection.py @@ -9,7 +9,7 @@ from frappe.model.document import Document class QualityInspection(Document): def get_item_specification_details(self): - self.set('qa_specification_details', []) + self.set('readings', []) variant_of = frappe.db.get_query("Item", self.item_code, "variant_of") if variant_of: specification = frappe.db.sql("select specification, value from `tabItem Quality Inspection Parameter` \ @@ -18,7 +18,7 @@ class QualityInspection(Document): specification = frappe.db.sql("select specification, value from `tabItem Quality Inspection Parameter` \ where parent = %s order by idx", self.item_code) for d in specification: - child = self.append('qa_specification_details', {}) + child = self.append('readings', {}) child.specification = d[0] child.value = d[1] child.status = 'Accepted' diff --git a/erpnext/buying/doctype/supplier/supplier.js b/erpnext/buying/doctype/supplier/supplier.js index e9b5812cd3..f233a7949f 100644 --- a/erpnext/buying/doctype/supplier/supplier.js +++ b/erpnext/buying/doctype/supplier/supplier.js @@ -59,7 +59,7 @@ cur_frm.fields_dict['default_price_list'].get_query = function(doc, cdt, cdn) { } } -cur_frm.fields_dict['party_accounts'].grid.get_field('account').get_query = function(doc, cdt, cdn) { +cur_frm.fields_dict['accounts'].grid.get_field('account').get_query = function(doc, cdt, cdn) { var d = locals[cdt][cdn]; return { filters: { diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js index b9286a1c24..72cef3b920 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js @@ -3,8 +3,8 @@ // define defaults for purchase common cur_frm.cscript.tname = "Supplier Quotation Item"; -cur_frm.cscript.fname = "quotation_items"; -cur_frm.cscript.other_fname = "other_charges"; +cur_frm.cscript.fname = "items"; +cur_frm.cscript.other_fname = "taxes"; // attach required files {% include 'buying/doctype/purchase_common/purchase_common.js' %}; @@ -52,7 +52,7 @@ cur_frm.cscript.uom = function(doc, cdt, cdn) { // no need to trigger updation of stock uom, as this field doesn't exist in supplier quotation } -cur_frm.fields_dict['quotation_items'].grid.get_field('project_name').get_query = +cur_frm.fields_dict['items'].grid.get_field('project_name').get_query = function(doc, cdt, cdn) { return{ filters:[ diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py index d009bac241..9eb8649cfc 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.py @@ -8,12 +8,12 @@ from frappe.model.mapper import get_mapped_doc from erpnext.controllers.buying_controller import BuyingController form_grid_templates = { - "quotation_items": "templates/form_grid/item_grid.html" + "items": "templates/form_grid/item_grid.html" } class SupplierQuotation(BuyingController): tname = "Supplier Quotation Item" - fname = "quotation_items" + fname = "items" def validate(self): super(SupplierQuotation, self).validate() diff --git a/erpnext/buying/doctype/supplier_quotation/test_records.json b/erpnext/buying/doctype/supplier_quotation/test_records.json index 90807d4674..70e32fe929 100644 --- a/erpnext/buying/doctype/supplier_quotation/test_records.json +++ b/erpnext/buying/doctype/supplier_quotation/test_records.json @@ -11,14 +11,14 @@ "is_subcontracted": "No", "naming_series": "_T-Supplier Quotation-", "net_total": 5000.0, - "quotation_items": [ + "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", + "parentfield": "items", "qty": 10.0, "rate": 500.0, "uom": "_Test UOM", diff --git a/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py b/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py index 3f22fd50a4..af5db6033f 100644 --- a/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py +++ b/erpnext/buying/doctype/supplier_quotation/test_supplier_quotation.py @@ -21,11 +21,11 @@ class TestPurchaseOrder(unittest.TestCase): po = make_purchase_order(sq.name) self.assertEquals(po.doctype, "Purchase Order") - self.assertEquals(len(po.get("po_details")), len(sq.get("quotation_items"))) + self.assertEquals(len(po.get("items")), len(sq.get("items"))) po.naming_series = "_T-Purchase Order-" - for doc in po.get("po_details"): + for doc in po.get("items"): if doc.get("item_code"): doc.set("schedule_date", "2013-04-12") diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index 2cecdc03bc..276e36addb 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -145,8 +145,8 @@ class AccountsController(TransactionBase): get_taxes_and_charges(tax_master_doctype, self.get(tax_master_field), tax_parentfield)) def set_other_charges(self): - self.set("other_charges", []) - self.set_taxes("other_charges", "taxes_and_charges") + self.set("taxes", []) + self.set_taxes("taxes", "taxes_and_charges") def calculate_taxes_and_totals(self): self.discount_amount_applied = False @@ -394,7 +394,7 @@ class AccountsController(TransactionBase): select t1.name as jv_no, t1.remark, t2.{0} as amount, t2.name as jv_detail_no, `against_{1}` as against_order from - `tabJournal Voucher` t1, `tabJournal Voucher Detail` t2 + `tabJournal Voucher` t1, `tabJournal Entry Account` t2 where t1.name = t2.parent and t2.account = %s and t2.party_type=%s and t2.party=%s @@ -426,7 +426,7 @@ class AccountsController(TransactionBase): account = self.get("debit_to" if self.doctype=="Sales Invoice" else "credit_to") jv_against_order = frappe.db.sql("""select parent, %s as against_order - from `tabJournal Voucher Detail` + from `tabJournal Entry Account` where docstatus=1 and account=%s and ifnull(is_advance, 'No') = 'Yes' and ifnull(against_sales_order, '') in (%s) group by parent, against_sales_order""" % @@ -501,7 +501,7 @@ class AccountsController(TransactionBase): select sum(ifnull({dr_or_cr}, 0)) from - `tabJournal Voucher Detail` + `tabJournal Entry Account` where {against_field} = %s and docstatus = 1 and is_advance = "Yes" """.format(dr_or_cr=dr_or_cr, \ against_field=against_field), self.name) diff --git a/erpnext/controllers/buying_controller.py b/erpnext/controllers/buying_controller.py index 0f7e2ba7b1..af6f728db1 100644 --- a/erpnext/controllers/buying_controller.py +++ b/erpnext/controllers/buying_controller.py @@ -17,7 +17,7 @@ class BuyingController(StockController): if hasattr(self, "fname"): self.table_print_templates = { self.fname: "templates/print_formats/includes/item_grid.html", - "other_charges": "templates/print_formats/includes/taxes.html", + "taxes": "templates/print_formats/includes/taxes.html", } def get_feed(self): @@ -46,7 +46,7 @@ class BuyingController(StockController): self.set_missing_item_details() if self.get("__islocal"): - self.set_taxes("other_charges", "taxes_and_charges") + self.set_taxes("taxes", "taxes_and_charges") def set_supplier_from_item_default(self): if self.meta.get_field("supplier") and not self.supplier: @@ -66,8 +66,8 @@ class BuyingController(StockController): validate_warehouse_company(w, self.company) def validate_stock_or_nonstock_items(self): - if self.meta.get_field("other_charges") and not self.get_stock_items(): - tax_for_valuation = [d.account_head for d in self.get("other_charges") + if self.meta.get_field("taxes") and not self.get_stock_items(): + tax_for_valuation = [d.account_head for d in self.get("taxes") if d.category in ["Valuation", "Valuation and Total"]] if tax_for_valuation: frappe.throw(_("Tax Category can not be 'Valuation' or 'Valuation and Total' as all items are non-stock items")) @@ -82,9 +82,9 @@ class BuyingController(StockController): self.currency) def calculate_taxes_and_totals(self): - self.other_fname = "other_charges" + self.other_fname = "taxes" super(BuyingController, self).calculate_taxes_and_totals() - self.calculate_total_advance("Purchase Invoice", "advance_allocation_details") + self.calculate_total_advance("Purchase Invoice", "advances") def calculate_item_values(self): for item in self.item_doclist: @@ -175,7 +175,7 @@ class BuyingController(StockController): last_stock_item_idx = d.idx total_valuation_amount = sum([flt(d.tax_amount) for d in - self.get("other_charges") + self.get("taxes") if d.category in ["Valuation", "Valuation and Total"]]) diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index 7b4d03e053..513507d883 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -15,7 +15,7 @@ class SellingController(StockController): if hasattr(self, "fname"): self.table_print_templates = { self.fname: "templates/print_formats/includes/item_grid.html", - "other_charges": "templates/print_formats/includes/taxes.html", + "taxes": "templates/print_formats/includes/taxes.html", } def get_feed(self): @@ -44,7 +44,7 @@ class SellingController(StockController): 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") + self.set_taxes("taxes", "taxes_and_charges") def set_missing_lead_customer_details(self): if getattr(self, "customer", None): @@ -73,7 +73,7 @@ class SellingController(StockController): # shipping rule calculation based on item's net weight shipping_amount = 0.0 - for condition in shipping_rule.get("shipping_rule_conditions"): + for condition in shipping_rule.get("conditions"): if not condition.to_value or (flt(condition.from_value) <= value <= flt(condition.to_value)): shipping_amount = condition.shipping_amount break @@ -85,28 +85,28 @@ class SellingController(StockController): "cost_center": shipping_rule.cost_center } - existing_shipping_charge = self.get("other_charges", filters=shipping_charge) + existing_shipping_charge = self.get("taxes", filters=shipping_charge) if existing_shipping_charge: # take the last record found existing_shipping_charge[-1].rate = shipping_amount else: shipping_charge["rate"] = shipping_amount shipping_charge["description"] = shipping_rule.label - self.append("other_charges", shipping_charge) + self.append("taxes", shipping_charge) self.calculate_taxes_and_totals() def remove_shipping_charge(self): if self.shipping_rule: shipping_rule = frappe.get_doc("Shipping Rule", self.shipping_rule) - existing_shipping_charge = self.get("other_charges", { + existing_shipping_charge = self.get("taxes", { "doctype": "Sales Taxes and Charges", "charge_type": "Actual", "account_head": shipping_rule.account, "cost_center": shipping_rule.cost_center }) if existing_shipping_charge: - self.get("other_charges").remove(existing_shipping_charge[-1]) + self.get("taxes").remove(existing_shipping_charge[-1]) self.calculate_taxes_and_totals() def set_total_in_words(self): @@ -124,11 +124,11 @@ class SellingController(StockController): self.grand_total_export or self.rounded_total_export, self.currency) def calculate_taxes_and_totals(self): - self.other_fname = "other_charges" + self.other_fname = "taxes" super(SellingController, self).calculate_taxes_and_totals() - self.calculate_total_advance("Sales Invoice", "advance_adjustment_details") + self.calculate_total_advance("Sales Invoice", "advances") self.calculate_commission() self.calculate_contribution() @@ -343,7 +343,7 @@ class SellingController(StockController): reserved_qty_for_main_item = -flt(d.qty) if self.has_sales_bom(d.item_code): - for p in self.get("packing_details"): + for p in self.get("packed_items"): 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({ diff --git a/erpnext/hr/doctype/appraisal/appraisal.js b/erpnext/hr/doctype/appraisal/appraisal.js index 84ab964b93..17e27090ac 100644 --- a/erpnext/hr/doctype/appraisal/appraisal.js +++ b/erpnext/hr/doctype/appraisal/appraisal.js @@ -33,7 +33,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 = doc.appraisal_details || []; + var val = doc.goals || []; var total =0; for(var i = 0; i 5) { msgprint(__("Score must be less than or equal to 5")); d.score = 0; - refresh_field('score', d.name, 'appraisal_details'); + refresh_field('score', d.name, 'goals'); } total = flt(d.per_weightage*d.score)/100; d.score_earned = total.toPrecision(2); - refresh_field('score_earned', d.name, 'appraisal_details'); + refresh_field('score_earned', d.name, 'goals'); } else{ d.score_earned = 0; - refresh_field('score_earned', d.name, 'appraisal_details'); + refresh_field('score_earned', d.name, 'goals'); } cur_frm.cscript.calculate_total(doc,cdt,cdn); } cur_frm.cscript.calculate_total = function(doc,cdt,cdn){ - var val = doc.appraisal_details || []; + var val = doc.goals || []; var total =0; for(var i = 0; i getdate(self.inst_date): frappe.throw(_("Installation date cannot be before delivery date for Item {0}").format(d.item_code)) def check_item_table(self): - if not(self.get('installed_item_details')): + if not(self.get('items')): frappe.throw(_("Please pull items from Delivery Note")) def on_update(self): @@ -108,7 +108,7 @@ class InstallationNote(TransactionBase): frappe.db.set(self, 'status', 'Submitted') def on_cancel(self): - for d in self.get('installed_item_details'): + for d in self.get('items'): 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/opportunity/opportunity.js b/erpnext/selling/doctype/opportunity/opportunity.js index b29c03ac0b..41986d5d18 100644 --- a/erpnext/selling/doctype/opportunity/opportunity.js +++ b/erpnext/selling/doctype/opportunity/opportunity.js @@ -46,7 +46,7 @@ erpnext.selling.Opportunity = frappe.ui.form.Controller.extend({ else if(me.frm.doc.customer) return {filters: { customer: me.frm.doc.customer } }; }); - this.frm.set_query("item_code", "enquiry_details", function() { + this.frm.set_query("item_code", "items", function() { return { query: "erpnext.controllers.queries.item_query", filters: me.frm.doc.enquiry_type === "Maintenance" ? @@ -97,7 +97,7 @@ cur_frm.cscript.item_code = function(doc, cdt, cdn) { var d = locals[cdt][cdn]; if (d.item_code) { return get_server_fields('get_item_details', d.item_code, - 'enquiry_details', doc, cdt, cdn, 1); + 'items', doc, cdt, cdn, 1); } } diff --git a/erpnext/selling/doctype/opportunity/opportunity.py b/erpnext/selling/doctype/opportunity/opportunity.py index ba331f9052..338d35d3b2 100644 --- a/erpnext/selling/doctype/opportunity/opportunity.py +++ b/erpnext/selling/doctype/opportunity/opportunity.py @@ -78,7 +78,7 @@ class Opportunity(TransactionBase): super(Opportunity, self).add_calendar_event(opts, force) def validate_item_details(self): - if not self.get('enquiry_details'): + if not self.get('items'): frappe.throw(_("Items required")) def validate_lead_cust(self): diff --git a/erpnext/selling/doctype/opportunity/test_records.json b/erpnext/selling/doctype/opportunity/test_records.json index 3970903635..dcda5d58fe 100644 --- a/erpnext/selling/doctype/opportunity/test_records.json +++ b/erpnext/selling/doctype/opportunity/test_records.json @@ -5,7 +5,7 @@ "enquiry_from": "Lead", "enquiry_type": "Sales", "lead": "_T-Lead-00001", - "enquiry_details": [{ + "items": [{ "item_name": "Test Item", "description": "Some description" }] diff --git a/erpnext/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js index 857a259129..c9e7614e14 100644 --- a/erpnext/selling/doctype/quotation/quotation.js +++ b/erpnext/selling/doctype/quotation/quotation.js @@ -4,8 +4,8 @@ // Module CRM // ===================================================================================== cur_frm.cscript.tname = "Quotation Item"; -cur_frm.cscript.fname = "quotation_details"; -cur_frm.cscript.other_fname = "other_charges"; +cur_frm.cscript.fname = "items"; +cur_frm.cscript.other_fname = "taxes"; cur_frm.cscript.sales_team_fname = "sales_team"; {% include 'selling/sales_common.js' %} @@ -169,4 +169,4 @@ cur_frm.cscript.on_submit = function(doc, cdt, cdn) { cur_frm.cscript.send_sms = function() { frappe.require("assets/erpnext/js/sms_manager.js"); var sms_man = new SMSManager(cur_frm.doc); -} \ No newline at end of file +} diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py index f12f396abd..43c31c6972 100644 --- a/erpnext/selling/doctype/quotation/quotation.py +++ b/erpnext/selling/doctype/quotation/quotation.py @@ -10,12 +10,12 @@ from frappe import _ from erpnext.controllers.selling_controller import SellingController form_grid_templates = { - "quotation_details": "templates/form_grid/item_grid.html" + "items": "templates/form_grid/item_grid.html" } class Quotation(SellingController): tname = 'Quotation Item' - fname = 'quotation_details' + fname = 'items' def validate(self): super(Quotation, self).validate() @@ -30,7 +30,7 @@ class Quotation(SellingController): def validate_for_items(self): chk_dupl_itm = [] - for d in self.get('quotation_details'): + for d in self.get('items'): if [cstr(d.item_code),cstr(d.description)] in chk_dupl_itm: frappe.throw(_("Item {0} with same description entered twice").format(d.item_code)) else: @@ -40,14 +40,14 @@ class Quotation(SellingController): super(Quotation, self).validate_order_type() if self.order_type in ['Maintenance', 'Service']: - for d in self.get('quotation_details'): + for d in self.get('items'): 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' if is_service_item == 'No': frappe.throw(_("Item {0} must be Service Item").format(d.item_code)) else: - for d in self.get('quotation_details'): + for d in self.get('items'): 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' @@ -62,7 +62,7 @@ class Quotation(SellingController): self.quotation_to = "Lead" def update_opportunity(self): - for opportunity in list(set([d.prevdoc_docname for d in self.get("quotation_details")])): + for opportunity in list(set([d.prevdoc_docname for d in self.get("items")])): if opportunity: frappe.get_doc("Opportunity", opportunity).set_status(update=True) @@ -75,7 +75,7 @@ class Quotation(SellingController): frappe.throw(_("Cannot set as Lost as Sales Order is made.")) def check_item_table(self): - if not self.get('quotation_details'): + if not self.get('items'): frappe.throw(_("Please enter item details")) def on_submit(self): @@ -94,7 +94,7 @@ class Quotation(SellingController): def print_other_charges(self,docname): print_lst = [] - for d in self.get('other_charges'): + for d in self.get('taxes'): lst1 = [] lst1.append(d.description) lst1.append(d.total) diff --git a/erpnext/selling/doctype/quotation/test_quotation.py b/erpnext/selling/doctype/quotation/test_quotation.py index 97d41107a0..62ed7a87dc 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")), 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(len(sales_order.get("items")), 1) + self.assertEquals(sales_order.get("items")[0].doctype, "Sales Order Item") + self.assertEquals(sales_order.get("items")[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/quotation/test_records.json b/erpnext/selling/doctype/quotation/test_records.json index 054144ebf4..1dc4b07bcc 100644 --- a/erpnext/selling/doctype/quotation/test_records.json +++ b/erpnext/selling/doctype/quotation/test_records.json @@ -13,7 +13,7 @@ "order_type": "Sales", "plc_conversion_rate": 1.0, "price_list_currency": "INR", - "quotation_details": [ + "items": [ { "base_amount": 1000.0, "base_rate": 100.0, @@ -21,7 +21,7 @@ "doctype": "Quotation Item", "item_code": "_Test Item Home Desktop 100", "item_name": "CPU", - "parentfield": "quotation_details", + "parentfield": "items", "qty": 10.0, "rate": 100.0 } diff --git a/erpnext/selling/doctype/sales_bom/sales_bom.js b/erpnext/selling/doctype/sales_bom/sales_bom.js index 2e0e749392..bbc5569fb7 100644 --- a/erpnext/selling/doctype/sales_bom/sales_bom.js +++ b/erpnext/selling/doctype/sales_bom/sales_bom.js @@ -15,6 +15,6 @@ cur_frm.fields_dict.new_item_code.query_description = __('Please select Item whe cur_frm.cscript.item_code = function(doc, dt, dn) { var d = locals[dt][dn]; if (d.item_code){ - return get_server_fields('get_item_details', d.item_code, 'sales_bom_items', doc ,dt, dn, 1); + return get_server_fields('get_item_details', d.item_code, 'items', doc ,dt, dn, 1); } } diff --git a/erpnext/selling/doctype/sales_bom/test_records.json b/erpnext/selling/doctype/sales_bom/test_records.json index beb8289f77..a19bc1a2e4 100644 --- a/erpnext/selling/doctype/sales_bom/test_records.json +++ b/erpnext/selling/doctype/sales_bom/test_records.json @@ -2,17 +2,17 @@ { "doctype": "Sales BOM", "new_item_code": "_Test Sales BOM Item", - "sales_bom_items": [ + "items": [ { "doctype": "Sales BOM Item", "item_code": "_Test Item", - "parentfield": "sales_bom_items", + "parentfield": "items", "qty": 5.0 }, { "doctype": "Sales BOM Item", "item_code": "_Test Item Home Desktop 100", - "parentfield": "sales_bom_items", + "parentfield": "items", "qty": 2.0 } ] diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js index 65b91f4bd7..eff37ca911 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.js +++ b/erpnext/selling/doctype/sales_order/sales_order.js @@ -4,8 +4,8 @@ // Module CRM cur_frm.cscript.tname = "Sales Order Item"; -cur_frm.cscript.fname = "sales_order_details"; -cur_frm.cscript.other_fname = "other_charges"; +cur_frm.cscript.fname = "items"; +cur_frm.cscript.other_fname = "taxes"; cur_frm.cscript.sales_team_fname = "sales_team"; {% include 'selling/sales_common.js' %} @@ -198,4 +198,4 @@ cur_frm.cscript.on_submit = function(doc, cdt, cdn) { cur_frm.cscript.send_sms = function() { frappe.require("assets/erpnext/js/sms_manager.js"); var sms_man = new SMSManager(cur_frm.doc); -}; \ 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 3ee119d438..e0254fa992 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -11,12 +11,12 @@ from frappe.model.mapper import get_mapped_doc from erpnext.controllers.selling_controller import SellingController form_grid_templates = { - "sales_order_details": "templates/form_grid/item_grid.html" + "items": "templates/form_grid/item_grid.html" } class SalesOrder(SellingController): tname = 'Sales Order Item' - fname = 'sales_order_details' + fname = 'items' person_tname = 'Target Detail' partner_tname = 'Partner Target Detail' territory_tname = 'Territory Target Detail' @@ -42,7 +42,7 @@ class SalesOrder(SellingController): def validate_for_items(self): check_list, flag = [], 0 chk_dupl_itm = [] - for d in self.get('sales_order_details'): + for d in self.get('items'): e = [d.item_code, d.description, d.warehouse, d.prevdoc_docname or ''] f = [d.item_code, d.description] @@ -68,7 +68,7 @@ class SalesOrder(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 self.get('sales_order_details'): + for d in self.get('items'): if d.prevdoc_docname: res = frappe.db.sql("select name from `tabQuotation` where name=%s and order_type = %s", (d.prevdoc_docname, self.order_type)) if not res: @@ -104,7 +104,7 @@ class SalesOrder(SellingController): self.validate_warehouse() from erpnext.stock.doctype.packed_item.packed_item import make_packing_list - make_packing_list(self,'sales_order_details') + make_packing_list(self,'items') self.validate_with_previous_doc() diff --git a/erpnext/selling/doctype/sales_order/test_records.json b/erpnext/selling/doctype/sales_order/test_records.json index 8db9915c2d..0154d321a9 100644 --- a/erpnext/selling/doctype/sales_order/test_records.json +++ b/erpnext/selling/doctype/sales_order/test_records.json @@ -16,7 +16,7 @@ "order_type": "Sales", "plc_conversion_rate": 1.0, "price_list_currency": "INR", - "sales_order_details": [ + "items": [ { "base_amount": 1000.0, "base_rate": 100.0, @@ -24,7 +24,7 @@ "doctype": "Sales Order Item", "item_code": "_Test Item Home Desktop 100", "item_name": "CPU", - "parentfield": "sales_order_details", + "parentfield": "items", "qty": 10.0, "rate": 100.0, "warehouse": "_Test Warehouse - _TC" diff --git a/erpnext/selling/doctype/sales_order/test_sales_order.py b/erpnext/selling/doctype/sales_order/test_sales_order.py index 775495ac5f..11cc3afe4b 100644 --- a/erpnext/selling/doctype/sales_order/test_sales_order.py +++ b/erpnext/selling/doctype/sales_order/test_sales_order.py @@ -24,7 +24,7 @@ class TestSalesOrder(unittest.TestCase): mr = make_material_request(so.name) self.assertEquals(mr.material_request_type, "Purchase") - self.assertEquals(len(mr.get("indent_details")), len(sales_order.get("sales_order_details"))) + self.assertEquals(len(mr.get("items")), len(sales_order.get("items"))) 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 = self.make_next_doc_testcase(so, "Delivery Note") self.assertEquals(dn.doctype, "Delivery Note") - self.assertEquals(len(dn.get("delivery_note_details")), len(so.get("sales_order_details"))) + self.assertEquals(len(dn.get("items")), len(so.get("items"))) def test_make_sales_invoice(self): from erpnext.selling.doctype.sales_order.sales_order import make_sales_invoice @@ -50,7 +50,7 @@ class TestSalesOrder(unittest.TestCase): si = self.make_next_doc_testcase(so, "Sales Invoice") self.assertEquals(si.doctype, "Sales Invoice") - self.assertEquals(len(si.get("entries")), len(so.get("sales_order_details"))) + self.assertEquals(len(si.get("entries")), len(so.get("items"))) self.assertEquals(len(si.get("entries")), 1) si.set("debit_to", "_Test Receivable - _TC") @@ -66,7 +66,7 @@ class TestSalesOrder(unittest.TestCase): dn = self.make_next_doc_testcase(so, "Delivery Note") - dn.get("delivery_note_details")[0].qty = 6 + dn.get("items")[0].qty = 6 dn.posting_date = "2013-10-10" dn.insert() @@ -75,7 +75,7 @@ class TestSalesOrder(unittest.TestCase): sales_order = frappe.get_doc("Sales Order", so.name) - self.assertEquals(sales_order.get("sales_order_details")[0].delivered_qty, 6) + self.assertEquals(sales_order.get("items")[0].delivered_qty, 6) #Check delivered_qty after make_sales_invoice without update_stock checked si1 = self.make_next_doc_testcase(sales_order, "Sales Invoice") @@ -88,7 +88,7 @@ class TestSalesOrder(unittest.TestCase): sales_order = frappe.get_doc("Sales Order", sales_order.name) - self.assertEquals(sales_order.get("sales_order_details")[0].delivered_qty, 6) + self.assertEquals(sales_order.get("items")[0].delivered_qty, 6) #Check delivered_qty after make_sales_invoice with update_stock checked si2 = self.make_next_doc_testcase(sales_order, "Sales Invoice") @@ -102,7 +102,7 @@ class TestSalesOrder(unittest.TestCase): sales_order = frappe.get_doc("Sales Order", sales_order.name) - self.assertEquals(sales_order.get("sales_order_details")[0].delivered_qty, 9) + self.assertEquals(sales_order.get("items")[0].delivered_qty, 9) def make_next_doc_testcase(self, so, next_doc = None): @@ -133,14 +133,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.get("sales_order_details")[0].item_code) + _insert_purchase_receipt(so.get("items")[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 - dn.get("delivery_note_details")[0].so_detail = so.get("sales_order_details")[0].name + dn.get("items")[0].item_code = so.get("items")[0].item_code + dn.get("items")[0].against_sales_order = so.name + dn.get("items")[0].so_detail = so.get("items")[0].name if delivered_qty: - dn.get("delivery_note_details")[0].qty = delivered_qty + dn.get("items")[0].qty = delivered_qty dn.insert() dn.submit() return dn @@ -161,21 +161,21 @@ class TestSalesOrder(unittest.TestCase): def test_reserved_qty_for_so(self): # reset bin - so_item = test_records[0]["sales_order_details"][0].copy() + so_item = test_records[0]["items"][0].copy() 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) + self.check_reserved_qty(so.get("items")[0].item_code, so.get("items")[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) + self.check_reserved_qty(so.get("items")[0].item_code, so.get("items")[0].warehouse, 0.0) def test_reserved_qty_for_partial_delivery(self): # reset bin - so_item = test_records[0]["sales_order_details"][0].copy() + so_item = test_records[0]["items"][0].copy() self.delete_bin(so_item["item_code"], so_item["warehouse"]) # submit so @@ -187,25 +187,25 @@ class TestSalesOrder(unittest.TestCase): # 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) + self.check_reserved_qty(so.get("items")[0].item_code, so.get("items")[0].warehouse, 5.0) # stop so so.load_from_db() 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) + self.check_reserved_qty(so.get("items")[0].item_code, so.get("items")[0].warehouse, 0.0) # unstop so so.load_from_db() 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) + self.check_reserved_qty(so.get("items")[0].item_code, so.get("items")[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) + self.check_reserved_qty(so.get("items")[0].item_code, so.get("items")[0].warehouse, 10.0) def test_reserved_qty_for_over_delivery(self): # reset bin - so_item = test_records[0]["sales_order_details"][0].copy() + so_item = test_records[0]["items"][0].copy() self.delete_bin(so_item["item_code"], so_item["warehouse"]) # submit so @@ -215,42 +215,42 @@ class TestSalesOrder(unittest.TestCase): frappe.db.set_value("Stock Settings", None, "allow_negative_stock", 1) # set over-delivery tolerance - frappe.db.set_value('Item', so.get("sales_order_details")[0].item_code, 'tolerance', 50) + frappe.db.set_value('Item', so.get("items")[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) + self.check_reserved_qty(so.get("items")[0].item_code, so.get("items")[0].warehouse, 0.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) + self.check_reserved_qty(so.get("items")[0].item_code, so.get("items")[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 = copy.deepcopy(test_records[0]) - test_record["sales_order_details"][0]["item_code"] = "_Test Sales BOM Item" + test_record["items"][0]["item_code"] = "_Test Sales BOM Item" # reset bin - 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"]) + self.delete_bin(sbom_test_records[0]["items"][0]["item_code"], test_record.get("items")[0]["warehouse"]) + self.delete_bin(sbom_test_records[0]["items"][1]["item_code"], test_record.get("items")[0]["warehouse"]) # submit so = self.create_so(test_record) - 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]["sales_bom_items"][1]["item_code"], - so.get("sales_order_details")[0].warehouse, 20.0) + self.check_reserved_qty(sbom_test_records[0]["items"][0]["item_code"], + so.get("items")[0].warehouse, 50.0) + self.check_reserved_qty(sbom_test_records[0]["items"][1]["item_code"], + so.get("items")[0].warehouse, 20.0) # cancel so.cancel() - 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]["sales_bom_items"][1]["item_code"], - so.get("sales_order_details")[0].warehouse, 0.0) + self.check_reserved_qty(sbom_test_records[0]["items"][0]["item_code"], + so.get("items")[0].warehouse, 0.0) + self.check_reserved_qty(sbom_test_records[0]["items"][1]["item_code"], + so.get("items")[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 @@ -258,11 +258,11 @@ class TestSalesOrder(unittest.TestCase): # change item in test so record test_record = frappe.copy_doc(test_records[0]) - test_record.get("sales_order_details")[0].item_code = "_Test Sales BOM Item" + test_record.get("items")[0].item_code = "_Test Sales BOM Item" # reset bin - 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) + self.delete_bin(sbom_test_records[0]["items"][0]["item_code"], test_record.get("items")[0].warehouse) + self.delete_bin(sbom_test_records[0]["items"][1]["item_code"], test_record.get("items")[0].warehouse) # submit so = self.create_so(test_record) @@ -273,45 +273,45 @@ class TestSalesOrder(unittest.TestCase): # submit dn dn = self.create_dn_against_so(so) - 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]["sales_bom_items"][1]["item_code"], - so.get("sales_order_details")[0].warehouse, 10.0) + self.check_reserved_qty(sbom_test_records[0]["items"][0]["item_code"], + so.get("items")[0].warehouse, 25.0) + self.check_reserved_qty(sbom_test_records[0]["items"][1]["item_code"], + so.get("items")[0].warehouse, 10.0) # stop so so.load_from_db() 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]["sales_bom_items"][1]["item_code"], - so.get("sales_order_details")[0].warehouse, 0.0) + self.check_reserved_qty(sbom_test_records[0]["items"][0]["item_code"], + so.get("items")[0].warehouse, 0.0) + self.check_reserved_qty(sbom_test_records[0]["items"][1]["item_code"], + so.get("items")[0].warehouse, 0.0) # unstop so so.load_from_db() 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]["sales_bom_items"][1]["item_code"], - so.get("sales_order_details")[0].warehouse, 10.0) + self.check_reserved_qty(sbom_test_records[0]["items"][0]["item_code"], + so.get("items")[0].warehouse, 25.0) + self.check_reserved_qty(sbom_test_records[0]["items"][1]["item_code"], + so.get("items")[0].warehouse, 10.0) # cancel dn dn.cancel() - 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]["sales_bom_items"][1]["item_code"], - so.get("sales_order_details")[0].warehouse, 20.0) + self.check_reserved_qty(sbom_test_records[0]["items"][0]["item_code"], + so.get("items")[0].warehouse, 50.0) + self.check_reserved_qty(sbom_test_records[0]["items"][1]["item_code"], + so.get("items")[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.get("sales_order_details")[0].item_code = "_Test Sales BOM Item" + test_record.get("items")[0].item_code = "_Test Sales BOM Item" # reset bin - 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) + self.delete_bin(sbom_test_records[0]["items"][0]["item_code"], test_record.get("items")[0].warehouse) + self.delete_bin(sbom_test_records[0]["items"][1]["item_code"], test_record.get("items")[0].warehouse) # submit so = self.create_so(test_record) @@ -320,22 +320,22 @@ class TestSalesOrder(unittest.TestCase): frappe.db.set_value("Stock Settings", None, "allow_negative_stock", 1) # set over-delivery tolerance - frappe.db.set_value('Item', so.get("sales_order_details")[0].item_code, 'tolerance', 50) + frappe.db.set_value('Item', so.get("items")[0].item_code, 'tolerance', 50) # submit dn dn = self.create_dn_against_so(so, 15) - 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]["sales_bom_items"][1]["item_code"], - so.get("sales_order_details")[0].warehouse, 0.0) + self.check_reserved_qty(sbom_test_records[0]["items"][0]["item_code"], + so.get("items")[0].warehouse, 0.0) + self.check_reserved_qty(sbom_test_records[0]["items"][1]["item_code"], + so.get("items")[0].warehouse, 0.0) # cancel dn dn.cancel() - 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]["sales_bom_items"][1]["item_code"], - so.get("sales_order_details")[0].warehouse, 20.0) + self.check_reserved_qty(sbom_test_records[0]["items"][0]["item_code"], + so.get("items")[0].warehouse, 50.0) + self.check_reserved_qty(sbom_test_records[0]["items"][1]["item_code"], + so.get("items")[0].warehouse, 20.0) def test_warehouse_user(self): frappe.permissions.add_user_permission("Warehouse", "_Test Warehouse 1 - _TC", "test@example.com") @@ -356,7 +356,7 @@ class TestSalesOrder(unittest.TestCase): so.company = "_Test Company 1" so.conversion_rate = 0.02 so.plc_conversion_rate = 0.02 - so.get("sales_order_details")[0].warehouse = "_Test Warehouse 2 - _TC1" + so.get("items")[0].warehouse = "_Test Warehouse 2 - _TC1" self.assertRaises(frappe.PermissionError, so.insert) frappe.set_user("test2@example.com") @@ -371,11 +371,11 @@ class TestSalesOrder(unittest.TestCase): from erpnext.selling.doctype.sales_order.sales_order import make_delivery_note sales_order = frappe.copy_doc(test_records[0]) - sales_order.sales_order_details[0].qty = 5 + sales_order.items[0].qty = 5 sales_order.insert() sales_order.submit() - _insert_purchase_receipt(sales_order.get("sales_order_details")[0].item_code) + _insert_purchase_receipt(sales_order.get("items")[0].item_code) delivery_note = make_delivery_note(sales_order.name) delivery_note.posting_date = sales_order.transaction_date diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js index 05a523cc2f..6df14ea52b 100644 --- a/erpnext/selling/sales_common.js +++ b/erpnext/selling/sales_common.js @@ -102,8 +102,8 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ this._super(); 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.doc.packing_details || []).length; + if(this.frm.fields_dict.packed_items) { + var packing_list_exists = (this.frm.doc.packed_items || []).length; this.frm.toggle_display("packing_list", packing_list_exists ? true : false); } }, @@ -241,7 +241,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ calculate_taxes_and_totals: function(update_paid_amount) { this._super(); - this.calculate_total_advance("Sales Invoice", "advance_adjustment_details", update_paid_amount); + this.calculate_total_advance("Sales Invoice", "advances", update_paid_amount); this.calculate_commission(); this.calculate_contribution(); @@ -477,7 +477,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ set_sales_bom_help: function(doc) { if(!cur_frm.fields_dict.packing_list) return; - if ((doc.packing_details || []).length) { + if ((doc.packed_items || []).length) { $(cur_frm.fields_dict.packing_list.row.wrapper).toggle(true); if (inList(['Delivery Note', 'Sales Invoice'], doc.doctype)) { @@ -560,17 +560,17 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ setup_field_label_map(["rate", "price_list_rate", "amount"], this.frm.doc.currency, this.fname); - setup_field_label_map(["tax_amount", "total"], company_currency, "other_charges"); + setup_field_label_map(["tax_amount", "total"], company_currency, "taxes"); - if(this.frm.fields_dict["advance_allocation_details"]) { + if(this.frm.fields_dict["advances"]) { setup_field_label_map(["advance_amount", "allocated_amount"], company_currency, - "advance_allocation_details"); + "advances"); } // toggle columns var item_grid = this.frm.fields_dict[this.fname].grid; var show = (this.frm.doc.currency != company_currency) || - ((cur_frm.doc.other_charges || []).filter( + ((cur_frm.doc.taxes || []).filter( function(d) { return d.included_in_print_rate===1}).length); $.each(["base_rate", "base_price_list_rate", "base_amount"], function(i, fname) { diff --git a/erpnext/setup/doctype/customer_group/customer_group.js b/erpnext/setup/doctype/customer_group/customer_group.js index 902f4a6288..da1d1b37f0 100644 --- a/erpnext/setup/doctype/customer_group/customer_group.js +++ b/erpnext/setup/doctype/customer_group/customer_group.js @@ -26,7 +26,7 @@ cur_frm.fields_dict['parent_customer_group'].get_query = function(doc,cdt,cdn) { } } -cur_frm.fields_dict['party_accounts'].grid.get_field('account').get_query = function(doc, cdt, cdn) { +cur_frm.fields_dict['accounts'].grid.get_field('account').get_query = function(doc, cdt, cdn) { var d = locals[cdt][cdn]; return { filters: { diff --git a/erpnext/setup/doctype/customer_group/customer_group.json b/erpnext/setup/doctype/customer_group/customer_group.json index 5e1ccab72a..fc3a3d4e29 100644 --- a/erpnext/setup/doctype/customer_group/customer_group.json +++ b/erpnext/setup/doctype/customer_group/customer_group.json @@ -116,9 +116,9 @@ "permlevel": 0 }, { - "fieldname": "party_accounts", + "fieldname": "accounts", "fieldtype": "Table", - "label": "Party Accounts", + "label": "Accounts", "options": "Party Account", "permlevel": 0 } @@ -126,7 +126,7 @@ "icon": "icon-sitemap", "idx": 1, "in_create": 1, - "modified": "2014-08-29 16:37:35.877256", + "modified": "2014-12-25 12:48:13.727656", "modified_by": "Administrator", "module": "Setup", "name": "Customer Group", @@ -191,5 +191,5 @@ } ], "read_only": 1, - "search_fields": "name,parent_customer_group" + "search_fields": "parent_customer_group" } \ No newline at end of file diff --git a/erpnext/setup/doctype/item_group/item_group.json b/erpnext/setup/doctype/item_group/item_group.json index af5a5c36e0..8aa3aa5eb6 100644 --- a/erpnext/setup/doctype/item_group/item_group.json +++ b/erpnext/setup/doctype/item_group/item_group.json @@ -1,5 +1,5 @@ { - "allow_import": 1, + "allow_import": 1, "allow_rename": 1, "autoname": "field:item_group_name", "creation": "2013-03-28 10:35:29", @@ -134,9 +134,9 @@ }, { "depends_on": "show_in_website", - "fieldname": "item_website_specifications", + "fieldname": "website_specifications", "fieldtype": "Table", - "label": "Item Website Specifications", + "label": "Website Specifications", "options": "Item Website Specification", "permlevel": 0 }, @@ -190,7 +190,7 @@ "in_create": 1, "issingle": 0, "max_attachments": 3, - "modified": "2014-08-20 17:48:34.489750", + "modified": "2014-12-25 12:33:43.359081", "modified_by": "Administrator", "module": "Setup", "name": "Item Group", diff --git a/erpnext/setup/doctype/sales_partner/sales_partner.js b/erpnext/setup/doctype/sales_partner/sales_partner.js index 3a03bfe641..0962660224 100644 --- a/erpnext/setup/doctype/sales_partner/sales_partner.js +++ b/erpnext/setup/doctype/sales_partner/sales_partner.js @@ -12,7 +12,7 @@ cur_frm.cscript.refresh = function(doc,dt,dn){ } } -cur_frm.fields_dict['partner_target_details'].grid.get_field("item_group").get_query = function(doc, dt, dn) { +cur_frm.fields_dict['targets'].grid.get_field("item_group").get_query = function(doc, dt, dn) { return{ filters:{ 'is_group': "No" } } diff --git a/erpnext/setup/doctype/sales_partner/sales_partner.json b/erpnext/setup/doctype/sales_partner/sales_partner.json index 30ed9bc391..98debb35f1 100644 --- a/erpnext/setup/doctype/sales_partner/sales_partner.json +++ b/erpnext/setup/doctype/sales_partner/sales_partner.json @@ -124,7 +124,7 @@ "label": "Target Distribution", "oldfieldname": "distribution_id", "oldfieldtype": "Link", - "options": "Budget Distribution", + "options": "Monthly Distribution", "permlevel": 0 }, { @@ -200,7 +200,7 @@ "icon": "icon-user", "idx": 1, "in_create": 0, - "modified": "2014-12-24 16:45:13.652374", + "modified": "2014-12-25 15:37:44.884917", "modified_by": "Administrator", "module": "Setup", "name": "Sales Partner", diff --git a/erpnext/setup/doctype/sales_person/sales_person.js b/erpnext/setup/doctype/sales_person/sales_person.js index b342485ee5..3a12c24ba0 100644 --- a/erpnext/setup/doctype/sales_person/sales_person.js +++ b/erpnext/setup/doctype/sales_person/sales_person.js @@ -27,7 +27,7 @@ cur_frm.fields_dict['parent_sales_person'].get_query = function(doc, cdt, cdn) { } } -cur_frm.fields_dict['target_details'].grid.get_field("item_group").get_query = function(doc, cdt, cdn) { +cur_frm.fields_dict['targets'].grid.get_field("item_group").get_query = function(doc, cdt, cdn) { return { filters: { 'is_group': "No" } } diff --git a/erpnext/setup/doctype/sales_person/sales_person.json b/erpnext/setup/doctype/sales_person/sales_person.json index e8431d8a39..a284b00312 100644 --- a/erpnext/setup/doctype/sales_person/sales_person.json +++ b/erpnext/setup/doctype/sales_person/sales_person.json @@ -126,7 +126,7 @@ "label": "Target Distribution", "oldfieldname": "distribution_id", "oldfieldtype": "Link", - "options": "Budget Distribution", + "options": "Monthly Distribution", "permlevel": 0, "search_index": 0 }, @@ -143,7 +143,7 @@ "icon": "icon-user", "idx": 1, "in_create": 1, - "modified": "2014-12-24 16:46:02.819886", + "modified": "2014-12-25 15:37:37.695495", "modified_by": "Administrator", "module": "Setup", "name": "Sales Person", diff --git a/erpnext/setup/doctype/sales_person/sales_person.py b/erpnext/setup/doctype/sales_person/sales_person.py index f37b139d6c..ce7b572fbe 100644 --- a/erpnext/setup/doctype/sales_person/sales_person.py +++ b/erpnext/setup/doctype/sales_person/sales_person.py @@ -11,7 +11,7 @@ class SalesPerson(NestedSet): nsm_parent_field = 'parent_sales_person'; def validate(self): - for d in self.get('target_details'): + for d in self.get('targets'): 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_settings/sms_settings.py b/erpnext/setup/doctype/sms_settings/sms_settings.py index de1164118e..a9b0bca5c8 100644 --- a/erpnext/setup/doctype/sms_settings/sms_settings.py +++ b/erpnext/setup/doctype/sms_settings/sms_settings.py @@ -71,7 +71,7 @@ def send_sms(receiver_list, msg, sender_name = ''): def send_via_gateway(arg): ss = frappe.get_doc('SMS Settings', 'SMS Settings') args = {ss.message_parameter : arg.get('message')} - for d in ss.get("static_parameter_details"): + for d in ss.get("static_parameters"): args[d.parameter] = d.value resp = [] diff --git a/erpnext/setup/doctype/supplier_type/supplier_type.js b/erpnext/setup/doctype/supplier_type/supplier_type.js index f54edca92c..e78de0a81f 100644 --- a/erpnext/setup/doctype/supplier_type/supplier_type.js +++ b/erpnext/setup/doctype/supplier_type/supplier_type.js @@ -5,7 +5,7 @@ cur_frm.cscript.refresh = function(doc) { cur_frm.set_intro(doc.__islocal ? "" : __("There is nothing to edit.")) } -cur_frm.fields_dict['party_accounts'].grid.get_field('account').get_query = function(doc, cdt, cdn) { +cur_frm.fields_dict['accounts'].grid.get_field('account').get_query = function(doc, cdt, cdn) { var d = locals[cdt][cdn]; return { filters: { diff --git a/erpnext/setup/doctype/supplier_type/supplier_type.json b/erpnext/setup/doctype/supplier_type/supplier_type.json index 51ffb2a24f..827d9e6e77 100644 --- a/erpnext/setup/doctype/supplier_type/supplier_type.json +++ b/erpnext/setup/doctype/supplier_type/supplier_type.json @@ -30,16 +30,16 @@ "permlevel": 0 }, { - "fieldname": "party_accounts", + "fieldname": "accounts", "fieldtype": "Table", - "label": "Party Accounts", + "label": "Accounts", "options": "Party Account", "permlevel": 0 } ], "icon": "icon-flag", "idx": 1, - "modified": "2014-08-29 16:38:22.219286", + "modified": "2014-12-25 12:48:28.195655", "modified_by": "Administrator", "module": "Setup", "name": "Supplier Type", diff --git a/erpnext/setup/doctype/territory/territory.js b/erpnext/setup/doctype/territory/territory.js index f870641662..935845a94c 100644 --- a/erpnext/setup/doctype/territory/territory.js +++ b/erpnext/setup/doctype/territory/territory.js @@ -29,7 +29,7 @@ cur_frm.fields_dict['parent_territory'].get_query = function(doc,cdt,cdn) { // ******************** ITEM Group ******************************** -cur_frm.fields_dict['target_details'].grid.get_field("item_group").get_query = function(doc, cdt, cdn) { +cur_frm.fields_dict['targets'].grid.get_field("item_group").get_query = function(doc, cdt, cdn) { return{ filters:{ 'is_group': "No"} } diff --git a/erpnext/setup/doctype/territory/territory.json b/erpnext/setup/doctype/territory/territory.json index de5d4a442c..6ba8fc6756 100644 --- a/erpnext/setup/doctype/territory/territory.json +++ b/erpnext/setup/doctype/territory/territory.json @@ -129,14 +129,14 @@ "label": "Target Distribution", "oldfieldname": "distribution_id", "oldfieldtype": "Link", - "options": "Budget Distribution", + "options": "Monthly Distribution", "permlevel": 0 } ], "icon": "icon-map-marker", "idx": 1, "in_create": 1, - "modified": "2014-12-24 16:46:36.782166", + "modified": "2014-12-25 15:37:31.563276", "modified_by": "Administrator", "module": "Setup", "name": "Territory", diff --git a/erpnext/setup/doctype/territory/territory.py b/erpnext/setup/doctype/territory/territory.py index d1b8dda336..8eb4dcef1a 100644 --- a/erpnext/setup/doctype/territory/territory.py +++ b/erpnext/setup/doctype/territory/territory.py @@ -14,7 +14,7 @@ class Territory(NestedSet): nsm_parent_field = 'parent_territory' def validate(self): - for d in self.get('target_details'): + for d in self.get('targets'): 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/page/setup_wizard/setup_wizard.py b/erpnext/setup/page/setup_wizard/setup_wizard.py index 52b3f4b849..60c245031a 100644 --- a/erpnext/setup/page/setup_wizard/setup_wizard.py +++ b/erpnext/setup/page/setup_wizard/setup_wizard.py @@ -153,7 +153,7 @@ def create_price_lists(args): "buying": 1 if pl_type == "Buying" else 0, "selling": 1 if pl_type == "Selling" else 0, "currency": args["currency"], - "valid_for_territories": [{ + "territories": [{ "territory": get_root_of("Territory") }] }).insert() diff --git a/erpnext/shopping_cart/__init__.py b/erpnext/shopping_cart/__init__.py index 8660003cb8..ddee6dcbd7 100644 --- a/erpnext/shopping_cart/__init__.py +++ b/erpnext/shopping_cart/__init__.py @@ -42,18 +42,18 @@ def set_item_in_cart(item_code, qty, user=None): validate_item(item_code) quotation = get_quotation(user=user) qty = flt(qty) - quotation_item = quotation.get("quotation_details", {"item_code": item_code}) + quotation_item = quotation.get("items", {"item_code": item_code}) if qty==0: if quotation_item: # remove - quotation.get("quotation_details").remove(quotation_item[0]) + quotation.get("items").remove(quotation_item[0]) else: # add or update if quotation_item: quotation_item[0].qty = qty else: - quotation.append("quotation_details", { + quotation.append("items", { "doctype": "Quotation Item", "item_code": item_code, "qty": qty diff --git a/erpnext/shopping_cart/cart.py b/erpnext/shopping_cart/cart.py index 692f27dde0..3ee089c227 100644 --- a/erpnext/shopping_cart/cart.py +++ b/erpnext/shopping_cart/cart.py @@ -14,7 +14,7 @@ class WebsitePriceListMissingError(frappe.ValidationError): pass def set_cart_count(quotation=None): if not quotation: quotation = _get_cart_quotation() - cart_count = cstr(len(quotation.get("quotation_details"))) + cart_count = cstr(len(quotation.get("items"))) frappe.local.cookie_manager.set_cookie("cart_count", cart_count) @frappe.whitelist() @@ -50,7 +50,7 @@ def place_order(): from erpnext.selling.doctype.quotation.quotation import _make_sales_order sales_order = frappe.get_doc(_make_sales_order(quotation.name, ignore_permissions=True)) - for item in sales_order.get("sales_order_details"): + for item in sales_order.get("items"): item.reserved_warehouse = frappe.db.get_value("Item", item.item_code, "website_warehouse") or None sales_order.ignore_permissions = True @@ -66,15 +66,15 @@ def update_cart(item_code, qty, with_doc): qty = flt(qty) if qty == 0: - quotation.set("quotation_details", quotation.get("quotation_details", {"item_code": ["!=", item_code]})) - if not quotation.get("quotation_details") and \ + quotation.set("items", quotation.get("items", {"item_code": ["!=", item_code]})) + if not quotation.get("items") and \ not quotation.get("__islocal"): quotation.__delete = True else: - quotation_items = quotation.get("quotation_details", {"item_code": item_code}) + quotation_items = quotation.get("items", {"item_code": item_code}) if not quotation_items: - quotation.append("quotation_details", { + quotation.append("items", { "doctype": "Quotation Item", "item_code": item_code, "qty": qty @@ -134,13 +134,13 @@ def guess_territory(): def decorate_quotation_doc(quotation_doc): doc = frappe._dict(quotation_doc.as_dict()) - for d in doc.get("quotation_details", []): + for d in doc.get("items", []): d.update(frappe.db.get_value("Item", d["item_code"], ["website_image", "description", "page_name"], as_dict=True)) d["formatted_rate"] = fmt_money(d.get("rate"), currency=doc.currency) d["formatted_amount"] = fmt_money(d.get("amount"), currency=doc.currency) - for d in doc.get("other_charges", []): + for d in doc.get("taxes", []): d["formatted_tax_amount"] = fmt_money(flt(d.get("tax_amount")) / doc.conversion_rate, currency=doc.currency) @@ -239,7 +239,7 @@ def set_price_list_and_rate(quotation, cart_settings, billing_territory): # reset values quotation.price_list_currency = quotation.currency = \ quotation.plc_conversion_rate = quotation.conversion_rate = None - for item in quotation.get("quotation_details"): + for item in quotation.get("items"): item.price_list_rate = item.discount_percentage = item.rate = item.amount = None # refetch values @@ -253,10 +253,10 @@ def set_taxes(quotation, cart_settings, billing_territory): quotation.taxes_and_charges = cart_settings.get_tax_master(billing_territory) # clear table - quotation.set("other_charges", []) + quotation.set("taxes", []) # append taxes - quotation.append_taxes_from_master("other_charges", "taxes_and_charges") + quotation.append_taxes_from_master("taxes", "taxes_and_charges") def get_lead_or_customer(): customer = frappe.db.get_value("Contact", {"email_id": frappe.session.user}, "customer") diff --git a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py index 48e31f6557..cdbe6c2365 100644 --- a/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py +++ b/erpnext/shopping_cart/doctype/shopping_cart_settings/shopping_cart_settings.py @@ -190,7 +190,7 @@ def set_price_list(quotation): if previous_selling_price_list != quotation.selling_price_list: quotation.price_list_currency = quotation.currency = quotation.plc_conversion_rate = quotation.conversion_rate = None - for d in quotation.get("quotation_details"): + for d in quotation.get("items"): d.price_list_rate = d.discount_percentage = d.rate = d.amount = None quotation.set_price_list_and_item_details() diff --git a/erpnext/shopping_cart/test_shopping_cart.py b/erpnext/shopping_cart/test_shopping_cart.py index bbab3fda5c..9d124b787a 100644 --- a/erpnext/shopping_cart/test_shopping_cart.py +++ b/erpnext/shopping_cart/test_shopping_cart.py @@ -61,18 +61,18 @@ class TestShoppingCart(unittest.TestCase): # add first item set_item_in_cart("_Test Item", 1) quotation = self.test_get_cart_lead() - self.assertEquals(quotation.get("quotation_details")[0].item_code, "_Test Item") - self.assertEquals(quotation.get("quotation_details")[0].qty, 1) - self.assertEquals(quotation.get("quotation_details")[0].amount, 10) + self.assertEquals(quotation.get("items")[0].item_code, "_Test Item") + self.assertEquals(quotation.get("items")[0].qty, 1) + self.assertEquals(quotation.get("items")[0].amount, 10) # add second item set_item_in_cart("_Test Item 2", 1) quotation = self.test_get_cart_lead() - self.assertEquals(quotation.get("quotation_details")[1].item_code, "_Test Item 2") - self.assertEquals(quotation.get("quotation_details")[1].qty, 1) - self.assertEquals(quotation.get("quotation_details")[1].amount, 20) + self.assertEquals(quotation.get("items")[1].item_code, "_Test Item 2") + self.assertEquals(quotation.get("items")[1].qty, 1) + self.assertEquals(quotation.get("items")[1].amount, 20) - self.assertEquals(len(quotation.get("quotation_details")), 2) + self.assertEquals(len(quotation.get("items")), 2) def test_update_cart(self): # first, add to cart @@ -81,11 +81,11 @@ class TestShoppingCart(unittest.TestCase): # update first item set_item_in_cart("_Test Item", 5) quotation = self.test_get_cart_lead() - self.assertEquals(quotation.get("quotation_details")[0].item_code, "_Test Item") - self.assertEquals(quotation.get("quotation_details")[0].qty, 5) - self.assertEquals(quotation.get("quotation_details")[0].amount, 50) + self.assertEquals(quotation.get("items")[0].item_code, "_Test Item") + self.assertEquals(quotation.get("items")[0].qty, 5) + self.assertEquals(quotation.get("items")[0].amount, 50) self.assertEquals(quotation.net_total, 70) - self.assertEquals(len(quotation.get("quotation_details")), 2) + self.assertEquals(len(quotation.get("items")), 2) def test_remove_from_cart(self): # first, add to cart @@ -94,17 +94,17 @@ class TestShoppingCart(unittest.TestCase): # remove first item set_item_in_cart("_Test Item", 0) quotation = self.test_get_cart_lead() - self.assertEquals(quotation.get("quotation_details")[0].item_code, "_Test Item 2") - self.assertEquals(quotation.get("quotation_details")[0].qty, 1) - self.assertEquals(quotation.get("quotation_details")[0].amount, 20) + self.assertEquals(quotation.get("items")[0].item_code, "_Test Item 2") + self.assertEquals(quotation.get("items")[0].qty, 1) + self.assertEquals(quotation.get("items")[0].amount, 20) self.assertEquals(quotation.net_total, 20) - self.assertEquals(len(quotation.get("quotation_details")), 1) + self.assertEquals(len(quotation.get("items")), 1) # remove second item set_item_in_cart("_Test Item 2", 0) quotation = self.test_get_cart_lead() self.assertEquals(quotation.net_total, 0) - self.assertEquals(len(quotation.get("quotation_details")), 0) + self.assertEquals(len(quotation.get("items")), 0) def test_set_billing_address(self): return diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.js b/erpnext/stock/doctype/delivery_note/delivery_note.js index 009ac4c764..bc34bb0b2e 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.js +++ b/erpnext/stock/doctype/delivery_note/delivery_note.js @@ -3,8 +3,8 @@ // Module Material Management cur_frm.cscript.tname = "Delivery Note Item"; -cur_frm.cscript.fname = "delivery_note_details"; -cur_frm.cscript.other_fname = "other_charges"; +cur_frm.cscript.fname = "items"; +cur_frm.cscript.other_fname = "taxes"; cur_frm.cscript.sales_team_fname = "sales_team"; {% include 'selling/sales_common.js' %}; @@ -20,7 +20,7 @@ erpnext.stock.DeliveryNoteController = erpnext.selling.SellingController.extend( if(doc.__onload && !doc.__onload.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.doc.delivery_note_details.some(function(item) { + from_sales_invoice = cur_frm.doc.items.some(function(item) { return item.against_sales_invoice ? true : false; }); @@ -86,7 +86,7 @@ erpnext.stock.DeliveryNoteController = erpnext.selling.SellingController.extend( this.get_terms(); }, - delivery_note_details_on_form_rendered: function(doc, grid_row) { + items_on_form_rendered: function(doc, grid_row) { erpnext.setup_serial_no(grid_row) } @@ -167,7 +167,7 @@ cur_frm.pformat.sales_order_no= function(doc, cdt, cdn){ out =''; - var cl = doc.delivery_note_details || []; + var cl = doc.items || []; // outer table var out='
'; @@ -214,7 +214,7 @@ if (sys_defaults.auto_accounting_for_stock) { } // expense account - cur_frm.fields_dict['delivery_note_details'].grid.get_field('expense_account').get_query = function(doc) { + cur_frm.fields_dict['items'].grid.get_field('expense_account').get_query = function(doc) { return { filters: { "report_type": "Profit and Loss", @@ -236,7 +236,7 @@ if (sys_defaults.auto_accounting_for_stock) { refresh_field(cur_frm.cscript.fname); } - cur_frm.fields_dict.delivery_note_details.grid.get_field("cost_center").get_query = function(doc) { + cur_frm.fields_dict.items.grid.get_field("cost_center").get_query = function(doc) { return { filters: { diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index 5d868d099d..100a866712 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -13,12 +13,12 @@ from erpnext.stock.utils import update_bin from erpnext.controllers.selling_controller import SellingController form_grid_templates = { - "delivery_note_details": "templates/form_grid/item_grid.html" + "items": "templates/form_grid/item_grid.html" } class DeliveryNote(SellingController): tname = 'Delivery Note Item' - fname = 'delivery_note_details' + fname = 'items' def __init__(self, arg1, arg2=None): super(DeliveryNote, self).__init__(arg1, arg2) @@ -57,7 +57,7 @@ class DeliveryNote(SellingController): 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"))) + total_qty = sum((item.qty for item in self.get("items"))) self.get("__onload").billing_complete = (billed_qty[0][0] == total_qty) def before_print(self): @@ -82,7 +82,7 @@ class DeliveryNote(SellingController): return "shipment" if self.docstatus==1 else None def set_actual_qty(self): - for d in self.get('delivery_note_details'): + for d in self.get('items'): 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)) @@ -91,7 +91,7 @@ class DeliveryNote(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 self.get('delivery_note_details'): + for d in self.get('items'): if not d.against_sales_order: frappe.throw(_("Sales Order required for Item {0}").format(d.item_code)) @@ -110,7 +110,7 @@ class DeliveryNote(SellingController): self.validate_with_previous_doc() from erpnext.stock.doctype.packed_item.packed_item import make_packing_list - make_packing_list(self, 'delivery_note_details') + make_packing_list(self, 'items') self.update_current_stock() @@ -118,7 +118,7 @@ class DeliveryNote(SellingController): if not self.installation_status: self.installation_status = 'Not Installed' def validate_with_previous_doc(self): - items = self.get("delivery_note_details") + items = self.get("items") 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]): @@ -150,7 +150,7 @@ class DeliveryNote(SellingController): def validate_for_items(self): check_list, chk_dupl_itm = [], [] - for d in self.get('delivery_note_details'): + for d in self.get('items'): 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] @@ -174,11 +174,11 @@ class DeliveryNote(SellingController): def update_current_stock(self): if self.get("_action") and self._action != "update_after_submit": - for d in self.get('delivery_note_details'): + for d in self.get('items'): d.actual_qty = frappe.db.get_value("Bin", {"item_code": d.item_code, "warehouse": d.warehouse}, "actual_qty") - for d in self.get('packing_details'): + for d in self.get('packed_items'): bin_qty = frappe.db.get_value("Bin", {"item_code": d.item_code, "warehouse": d.warehouse}, ["actual_qty", "projected_qty"], as_dict=True) if bin_qty: diff --git a/erpnext/stock/doctype/delivery_note/test_delivery_note.py b/erpnext/stock/doctype/delivery_note/test_delivery_note.py index d9ade7a69e..8459e1e787 100644 --- a/erpnext/stock/doctype/delivery_note/test_delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/test_delivery_note.py @@ -11,10 +11,10 @@ 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]["purchase_receipt_details"][0]["item_code"] + item_code = pr_test_records[0]["items"][0]["item_code"] pr = frappe.copy_doc(pr_test_records[0]) - pr.get("purchase_receipt_details")[0].item_code = item_code + pr.get("items")[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.get("entries")), len(dn.get("delivery_note_details"))) + self.assertEquals(len(si.get("entries")), len(dn.get("items"))) # modify amount si.get("entries")[0].rate = 200 @@ -69,11 +69,11 @@ class TestDeliveryNote(unittest.TestCase): _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" + dn.get("items")[0].expense_account = "Cost of Goods Sold - _TC" + dn.get("items")[0].cost_center = "Main - _TC" stock_in_hand_account = frappe.db.get_value("Account", - {"warehouse": dn.get("delivery_note_details")[0].warehouse}) + {"warehouse": dn.get("items")[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.get("purchase_receipt_details")[0].rate = 100 - pr.get("purchase_receipt_details")[0].base_amount = 100 + pr.get("items")[0].rate = 100 + pr.get("items")[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.get("delivery_note_details")[0].item_code = "_Test Sales BOM Item" - dn.get("delivery_note_details")[0].qty = 1 + dn.get("items")[0].item_code = "_Test Sales BOM Item" + dn.get("items")[0].qty = 1 stock_in_hand_account = frappe.db.get_value("Account", - {"warehouse": dn.get("delivery_note_details")[0].warehouse}) + {"warehouse": dn.get("items")[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.get("mtn_details")[0].serial_no) + serial_nos = get_serial_nos(se.get("items")[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.get("items")[0].item_code = "_Test Serialized Item With Series" + dn.get("items")[0].qty = 1 + dn.get("items")[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.get("delivery_note_details")[0].serial_no) + serial_nos = get_serial_nos(dn.get("items")[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.get("mtn_details")[0].serial_no) + serial_nos = get_serial_nos(se.get("items")[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 - dn.get("delivery_note_details")[0].serial_no = serial_nos[0] + dn.get("items")[0].item_code = "_Test Serialized Item With Series" + dn.get("items")[0].qty = 1 + dn.get("items")[0].serial_no = serial_nos[0] dn.insert() self.assertRaises(SerialNoStatusError, dn.submit) diff --git a/erpnext/stock/doctype/delivery_note/test_records.json b/erpnext/stock/doctype/delivery_note/test_records.json index 3127a08008..803e86469b 100644 --- a/erpnext/stock/doctype/delivery_note/test_records.json +++ b/erpnext/stock/doctype/delivery_note/test_records.json @@ -5,7 +5,7 @@ "currency": "INR", "customer": "_Test Customer", "customer_name": "_Test Customer", - "delivery_note_details": [ + "items": [ { "base_amount": 500.0, "base_rate": 100.0, @@ -15,7 +15,7 @@ "expense_account": "Cost of Goods Sold - _TC", "item_code": "_Test Item", "item_name": "_Test Item", - "parentfield": "delivery_note_details", + "parentfield": "items", "qty": 5.0, "rate": 100.0, "stock_uom": "_Test UOM", diff --git a/erpnext/stock/doctype/item/item.js b/erpnext/stock/doctype/item/item.js index 096c1e8f94..9c2f9f5553 100644 --- a/erpnext/stock/doctype/item/item.js +++ b/erpnext/stock/doctype/item/item.js @@ -127,7 +127,7 @@ cur_frm.fields_dict['selling_cost_center'].get_query = function(doc) { } -cur_frm.fields_dict['item_tax'].grid.get_field("tax_type").get_query = function(doc, cdt, cdn) { +cur_frm.fields_dict['taxes'].grid.get_field("tax_type").get_query = function(doc, cdt, cdn) { return { filters: [ ['Account', 'account_type', 'in', @@ -139,7 +139,7 @@ cur_frm.fields_dict['item_tax'].grid.get_field("tax_type").get_query = function( cur_frm.cscript.tax_type = function(doc, cdt, cdn){ var d = locals[cdt][cdn]; - return get_server_fields('get_tax_rate', d.tax_type, 'item_tax', doc, cdt, cdn, 1); + return get_server_fields('get_tax_rate', d.tax_type, 'taxes', doc, cdt, cdn, 1); } cur_frm.fields_dict['item_group'].get_query = function(doc,cdt,cdn) { @@ -178,11 +178,11 @@ cur_frm.cscript.validate = function(doc, cdt, cdn){ cur_frm.cscript.weight_to_validate(doc, cdt, cdn); } -cur_frm.fields_dict.item_customer_details.grid.get_field("customer_name").get_query = function(doc, cdt, cdn) { +cur_frm.fields_dict.customer_item_codes.grid.get_field("customer_name").get_query = function(doc, cdt, cdn) { return { query: "erpnext.controllers.queries.customer_query" } } -cur_frm.fields_dict.item_supplier_details.grid.get_field("supplier").get_query = function(doc, cdt, cdn) { +cur_frm.fields_dict.supplier_item_codes.grid.get_field("supplier").get_query = function(doc, cdt, cdn) { return { query: "erpnext.controllers.queries.supplier_query" } } diff --git a/erpnext/stock/doctype/item/item.py b/erpnext/stock/doctype/item/item.py index 34d54284ba..531ec56866 100644 --- a/erpnext/stock/doctype/item/item.py +++ b/erpnext/stock/doctype/item/item.py @@ -84,14 +84,14 @@ class Item(WebsiteGenerator): 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")] + uom_conv_list = [d.uom for d in self.get("uoms")] if self.stock_uom not in uom_conv_list: - ch = self.append('uom_conversion_details', {}) + ch = self.append('uoms', {}) ch.uom = self.stock_uom ch.conversion_factor = 1 to_remove = [] - for d in self.get("uom_conversion_details"): + for d in self.get("uoms"): if d.conversion_factor == 1 and d.uom != self.stock_uom: to_remove.append(d) @@ -136,13 +136,13 @@ class Item(WebsiteGenerator): def validate_variants_are_unique(self): if not self.has_variants: - self.item_variants = [] + self.variants = [] - if self.item_variants and self.variant_of: + if self.variants and self.variant_of: frappe.throw(_("Item cannot be a variant of a variant")) variants = [] - for d in self.item_variants: + for d in self.variants: key = (d.item_attribute, d.item_attribute_value) if key in variants: frappe.throw(_("{0} {1} is entered more than once in Item Variants table").format(d.item_attribute, @@ -181,14 +181,14 @@ class Item(WebsiteGenerator): frappe.msgprint(_("Item Variants {0} deleted").format(", ".join(deleted))) def get_variant_item_codes(self): - if not self.item_variants: + if not self.variants: return [] self.variant_attributes = {} variant_dict = {} variant_item_codes = [] - for d in self.item_variants: + for d in self.variants: variant_dict.setdefault(d.item_attribute, []).append(d.item_attribute_value) all_attributes = [d.name for d in frappe.get_all("Item Attribute", order_by = "priority asc")] @@ -250,21 +250,21 @@ class Item(WebsiteGenerator): template = frappe.get_doc("Item", self.variant_of) # add item taxes from template - for d in template.get("item_tax"): - self.append("item_tax", {"tax_type": d.tax_type, "tax_rate": d.tax_rate}) + for d in template.get("taxes"): + self.append("taxes", {"tax_type": d.tax_type, "tax_rate": d.tax_rate}) # copy re-order table if empty - if not self.get("item_reorder"): - for d in template.get("item_reorder"): + if not self.get("reorder_levels"): + for d in template.get("reorder_levels"): n = {} for k in ("warehouse", "warehouse_reorder_level", "warehouse_reorder_qty", "material_request_type"): n[k] = d.get(k) - self.append("item_reorder", n) + self.append("reorder_levels", n) def validate_conversion_factor(self): check_list = [] - for d in self.get('uom_conversion_details'): + for d in self.get('uoms'): if cstr(d.uom) in check_list: frappe.throw(_("Unit of Measure {0} has been entered more than once in Conversion Factor Table").format(d.uom)) else: @@ -302,14 +302,14 @@ class Item(WebsiteGenerator): def fill_customer_code(self): """ Append all the customer codes and insert into "customer_code" field of item table """ cust_code=[] - for d in self.get('item_customer_details'): + for d in self.get('customer_item_codes'): cust_code.append(d.ref_code) self.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 self.get('item_tax'): + for d in self.get('taxes'): if d.tax_type: account_type = frappe.db.get_value("Account", d.tax_type, "account_type") @@ -344,15 +344,15 @@ class Item(WebsiteGenerator): if cint(self.apply_warehouse_wise_reorder_level): self.re_order_level, self.re_order_qty = 0, 0 else: - self.set("item_reorder", []) + self.set("reorder_levels", []) - if self.re_order_level or len(self.get("item_reorder", {"material_request_type": "Purchase"})): + if self.re_order_level or len(self.get("reorder_levels", {"material_request_type": "Purchase"})): if not self.is_purchase_item: frappe.throw(_("""To set reorder level, item must be a Purchase Item""")) def validate_warehouse_for_reorder(self): warehouse = [] - for i in self.get("item_reorder"): + for i in self.get("reorder_levels"): if i.get("warehouse") and i.get("warehouse") not in warehouse: warehouse += [i.get("warehouse")] else: @@ -426,11 +426,11 @@ class Item(WebsiteGenerator): frappe.db.auto_commit_on_many_writes = 0 def copy_specification_from_item_group(self): - self.set("item_website_specifications", []) + self.set("website_specifications", []) if self.item_group: for label, desc in frappe.db.get_values("Item Website Specification", {"parent": self.item_group}, ["label", "description"]): - row = self.append("item_website_specifications") + row = self.append("website_specifications") row.label = label row.description = desc diff --git a/erpnext/stock/doctype/item/test_item.py b/erpnext/stock/doctype/item/test_item.py index 55cd12f4a9..2d8bdd46bb 100644 --- a/erpnext/stock/doctype/item/test_item.py +++ b/erpnext/stock/doctype/item/test_item.py @@ -24,7 +24,7 @@ class TestItem(unittest.TestCase): def test_duplicate_variant(self): item = frappe.copy_doc(test_records[11]) - item.append("item_variants", {"item_attribute": "Test Size", "item_attribute_value": "Small"}) + item.append("variants", {"item_attribute": "Test Size", "item_attribute_value": "Small"}) self.assertRaises(DuplicateVariant, item.insert) def test_template_cannot_have_stock(self): @@ -32,7 +32,7 @@ class TestItem(unittest.TestCase): se = frappe.new_doc("Stock Entry") se.purpose = "Material Receipt" - se.append("mtn_details", { + se.append("items", { "item_code": item.name, "t_warehouse": "Stores - _TC", "qty": 1, @@ -52,9 +52,9 @@ class TestItem(unittest.TestCase): for v in variants: self.assertTrue(frappe.db.get_value("Item", {"variant_of": item.name, "name": v})) - item.append("item_variants", {"item_attribute": "Test Colour", "item_attribute_value": "Red"}) - item.append("item_variants", {"item_attribute": "Test Colour", "item_attribute_value": "Blue"}) - item.append("item_variants", {"item_attribute": "Test Colour", "item_attribute_value": "Green"}) + item.append("variants", {"item_attribute": "Test Colour", "item_attribute_value": "Red"}) + item.append("variants", {"item_attribute": "Test Colour", "item_attribute_value": "Blue"}) + item.append("variants", {"item_attribute": "Test Colour", "item_attribute_value": "Green"}) self.assertEqual(item.get_variant_item_codes(), ['_Test Variant Item-S-R', '_Test Variant Item-S-G', '_Test Variant Item-S-B', @@ -71,7 +71,7 @@ class TestItem(unittest.TestCase): se = frappe.new_doc("Stock Entry") se.purpose = "Material Receipt" - se.append("mtn_details", { + se.append("items", { "item_code": item.name, "t_warehouse": "Stores - _TC", "qty": 1, diff --git a/erpnext/stock/doctype/item/test_records.json b/erpnext/stock/doctype/item/test_records.json index 7b6130c4e1..7d0f4b0e7e 100644 --- a/erpnext/stock/doctype/item/test_records.json +++ b/erpnext/stock/doctype/item/test_records.json @@ -19,7 +19,7 @@ "item_group": "_Test Item Group", "item_name": "_Test Item", "apply_warehouse_wise_reorder_level": 1, - "item_reorder": [ + "reorder_levels": [ { "material_request_type": "Purchase", "warehouse": "_Test Warehouse - _TC", @@ -74,10 +74,10 @@ "item_code": "_Test Item Home Desktop 100", "item_group": "_Test Item Group Desktops", "item_name": "_Test Item Home Desktop 100", - "item_tax": [ + "taxes": [ { "doctype": "Item Tax", - "parentfield": "item_tax", + "parentfield": "taxes", "tax_rate": 10, "tax_type": "_Test Account Excise Duty - _TC" } @@ -270,13 +270,13 @@ "item_name": "_Test Variant Item", "stock_uom": "_Test UOM", "has_variants": 1, - "item_variants": [ + "variants": [ {"item_attribute": "Test Size", "item_attribute_value": "Small"}, {"item_attribute": "Test Size", "item_attribute_value": "Medium"}, {"item_attribute": "Test Size", "item_attribute_value": "Large"} ], "apply_warehouse_wise_reorder_level": 1, - "item_reorder": [ + "reorder_levels": [ { "material_request_type": "Purchase", "warehouse": "_Test Warehouse - _TC", diff --git a/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.js b/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.js index 042011a991..c1847c507a 100644 --- a/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.js +++ b/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.js @@ -8,7 +8,7 @@ frappe.require("assets/erpnext/js/controllers/stock_controller.js"); erpnext.stock.LandedCostVoucher = erpnext.stock.StockController.extend({ setup: function() { var me = this; - this.frm.fields_dict.landed_cost_purchase_receipts.grid.get_field('purchase_receipt').get_query = + this.frm.fields_dict.purchase_receipts.grid.get_field('purchase_receipt').get_query = function() { if(!me.frm.doc.company) msgprint(__("Please enter company first")); return { @@ -19,7 +19,7 @@ erpnext.stock.LandedCostVoucher = erpnext.stock.StockController.extend({ } }; - this.frm.fields_dict.landed_cost_taxes_and_charges.grid.get_field('account').get_query = function() { + this.frm.fields_dict.taxes.grid.get_field('account').get_query = function() { if(!me.frm.doc.company) msgprint(__("Please enter company first")); return { filters:[ @@ -67,7 +67,7 @@ erpnext.stock.LandedCostVoucher = erpnext.stock.StockController.extend({ get_items_from_purchase_receipts: function() { var me = this; - if(!this.frm.doc.landed_cost_purchase_receipts.length) { + if(!this.frm.doc.purchase_receipts.length) { msgprint(__("Please enter Purchase Receipt first")); } else { return this.frm.call({ @@ -84,7 +84,7 @@ erpnext.stock.LandedCostVoucher = erpnext.stock.StockController.extend({ set_total_taxes_and_charges: function() { total_taxes_and_charges = 0.0; - $.each(this.frm.doc.landed_cost_taxes_and_charges, function(i, d) { + $.each(this.frm.doc.taxes, function(i, d) { total_taxes_and_charges += flt(d.amount) }); cur_frm.set_value("total_taxes_and_charges", total_taxes_and_charges); @@ -92,16 +92,16 @@ erpnext.stock.LandedCostVoucher = erpnext.stock.StockController.extend({ set_applicable_charges_for_item: function() { var me = this; - if(this.frm.doc.landed_cost_taxes_and_charges.length) { + if(this.frm.doc.taxes.length) { var total_item_cost = 0.0; - $.each(this.frm.doc.landed_cost_items, function(i, d) { + $.each(this.frm.doc.items, function(i, d) { total_item_cost += flt(d.amount) }); - $.each(this.frm.doc.landed_cost_items, function(i, item) { + $.each(this.frm.doc.items, function(i, item) { item.applicable_charges = flt(item.amount) * flt(me.frm.doc.total_taxes_and_charges) / flt(total_item_cost) }); - refresh_field("landed_cost_items"); + refresh_field("items"); } } diff --git a/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.json b/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.json index 682a16bfd1..aafc0df2b2 100644 --- a/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.json +++ b/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.json @@ -16,7 +16,7 @@ "reqd": 1 }, { - "fieldname": "landed_cost_purchase_receipts", + "fieldname": "purchase_receipts", "fieldtype": "Table", "label": "Purchase Receipts", "options": "Landed Cost Purchase Receipt", @@ -29,7 +29,7 @@ "permlevel": 0 }, { - "fieldname": "landed_cost_items", + "fieldname": "items", "fieldtype": "Table", "label": "Purchase Receipt Items", "no_copy": 1, @@ -38,7 +38,7 @@ "read_only": 0 }, { - "fieldname": "landed_cost_taxes_and_charges", + "fieldname": "taxes", "fieldtype": "Table", "label": "Taxes and Charges", "options": "Landed Cost Taxes and Charges", @@ -73,7 +73,7 @@ ], "icon": "icon-usd", "is_submittable": 1, - "modified": "2014-09-01 12:05:46.834513", + "modified": "2014-12-25 12:36:24.982094", "modified_by": "Administrator", "module": "Stock", "name": "Landed Cost Voucher", diff --git a/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py b/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py index 3046c5e921..f5b8b5f585 100644 --- a/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py +++ b/erpnext/stock/doctype/landed_cost_voucher/landed_cost_voucher.py @@ -12,8 +12,8 @@ from erpnext.stock.stock_ledger import get_previous_sle class LandedCostVoucher(Document): def get_items_from_purchase_receipts(self): - self.set("landed_cost_items", []) - for pr in self.get("landed_cost_purchase_receipts"): + self.set("items", []) + for pr in self.get("purchase_receipts"): pr_items = frappe.db.sql("""select pr_item.item_code, pr_item.description, pr_item.qty, pr_item.base_rate, pr_item.base_amount, pr_item.name from `tabPurchase Receipt Item` pr_item where parent = %s @@ -21,7 +21,7 @@ class LandedCostVoucher(Document): pr.purchase_receipt, as_dict=True) for d in pr_items: - item = self.append("landed_cost_items") + item = self.append("items") item.item_code = d.item_code item.description = d.description item.qty = d.qty @@ -30,7 +30,7 @@ class LandedCostVoucher(Document): item.purchase_receipt = pr.purchase_receipt item.purchase_receipt_item = d.name - if self.get("landed_cost_taxes_and_charges"): + if self.get("taxes"): self.set_applicable_charges_for_item() @@ -38,27 +38,27 @@ class LandedCostVoucher(Document): self.check_mandatory() self.validate_purchase_receipts() self.set_total_taxes_and_charges() - if not self.get("landed_cost_items"): + if not self.get("items"): self.get_items_from_purchase_receipts() else: self.set_applicable_charges_for_item() def check_mandatory(self): - if not self.get("landed_cost_purchase_receipts"): + if not self.get("purchase_receipts"): frappe.throw(_("Please enter Purchase Receipts")) - if not self.get("landed_cost_taxes_and_charges"): + if not self.get("taxes"): frappe.throw(_("Please enter Taxes and Charges")) def validate_purchase_receipts(self): purchase_receipts = [] - for d in self.get("landed_cost_purchase_receipts"): + for d in self.get("purchase_receipts"): if frappe.db.get_value("Purchase Receipt", d.purchase_receipt, "docstatus") != 1: frappe.throw(_("Purchase Receipt must be submitted")) else: purchase_receipts.append(d.purchase_receipt) - for item in self.get("landed_cost_items"): + for item in self.get("items"): if not item.purchase_receipt: frappe.throw(_("Item must be added using 'Get Items from Purchase Receipts' button")) elif item.purchase_receipt not in purchase_receipts: @@ -66,12 +66,12 @@ class LandedCostVoucher(Document): .format(item.idx, item.purchase_receipt)) def set_total_taxes_and_charges(self): - self.total_taxes_and_charges = sum([flt(d.amount) for d in self.get("landed_cost_taxes_and_charges")]) + self.total_taxes_and_charges = sum([flt(d.amount) for d in self.get("taxes")]) def set_applicable_charges_for_item(self): - total_item_cost = sum([flt(d.amount) for d in self.get("landed_cost_items")]) + total_item_cost = sum([flt(d.amount) for d in self.get("items")]) - for item in self.get("landed_cost_items"): + for item in self.get("items"): item.applicable_charges = flt(item.amount) * flt(self.total_taxes_and_charges) / flt(total_item_cost) def on_submit(self): @@ -81,7 +81,7 @@ class LandedCostVoucher(Document): self.update_landed_cost() def update_landed_cost(self): - purchase_receipts = list(set([d.purchase_receipt for d in self.get("landed_cost_items")])) + purchase_receipts = list(set([d.purchase_receipt for d in self.get("items")])) for purchase_receipt in purchase_receipts: pr = frappe.get_doc("Purchase Receipt", purchase_receipt) @@ -89,7 +89,7 @@ class LandedCostVoucher(Document): pr.set_landed_cost_voucher_amount() # set valuation amount in pr item - pr.update_valuation_rate("purchase_receipt_details") + pr.update_valuation_rate("items") # save will update landed_cost_voucher_amount and voucher_amount in PR, # as those fields are ellowed to edit after submit diff --git a/erpnext/stock/doctype/landed_cost_voucher/test_landed_cost_voucher.py b/erpnext/stock/doctype/landed_cost_voucher/test_landed_cost_voucher.py index d84d63c913..4b0e23ce59 100644 --- a/erpnext/stock/doctype/landed_cost_voucher/test_landed_cost_voucher.py +++ b/erpnext/stock/doctype/landed_cost_voucher/test_landed_cost_voucher.py @@ -34,8 +34,8 @@ class TestLandedCostVoucher(unittest.TestCase): self.assertTrue(gl_entries) - stock_in_hand_account = pr.get("purchase_receipt_details")[0].warehouse - fixed_asset_account = pr.get("purchase_receipt_details")[1].warehouse + stock_in_hand_account = pr.get("items")[0].warehouse + fixed_asset_account = pr.get("items")[1].warehouse expected_values = { @@ -56,8 +56,8 @@ class TestLandedCostVoucher(unittest.TestCase): frappe.db.sql("delete from `tabSerial No` where name in ('SN001', 'SN002', 'SN003', 'SN004', 'SN005')") pr = frappe.copy_doc(pr_test_records[0]) - pr.purchase_receipt_details[0].item_code = "_Test Serialized Item" - pr.purchase_receipt_details[0].serial_no = "SN001\nSN002\nSN003\nSN004\nSN005" + pr.items[0].item_code = "_Test Serialized Item" + pr.items[0].serial_no = "SN001\nSN002\nSN003\nSN004\nSN005" pr.submit() serial_no_rate = frappe.db.get_value("Serial No", "SN001", "purchase_rate") @@ -76,13 +76,13 @@ class TestLandedCostVoucher(unittest.TestCase): def submit_landed_cost_voucher(self, pr): lcv = frappe.new_doc("Landed Cost Voucher") lcv.company = "_Test Company" - lcv.set("landed_cost_purchase_receipts", [{ + lcv.set("purchase_receipts", [{ "purchase_receipt": pr.name, "supplier": pr.supplier, "posting_date": pr.posting_date, "grand_total": pr.grand_total }]) - lcv.set("landed_cost_taxes_and_charges", [{ + lcv.set("taxes", [{ "description": "Insurance Charges", "account": "_Test Account Insurance Charges - _TC", "amount": 50.0 diff --git a/erpnext/stock/doctype/landed_cost_voucher/test_records.json b/erpnext/stock/doctype/landed_cost_voucher/test_records.json new file mode 100644 index 0000000000..4fc0017939 --- /dev/null +++ b/erpnext/stock/doctype/landed_cost_voucher/test_records.json @@ -0,0 +1,6 @@ +[ + { + "doctype": "Landed Cost Voucher", + "name": "_Test Landed Cost Voucher 1" + } +] diff --git a/erpnext/stock/doctype/material_request/material_request.js b/erpnext/stock/doctype/material_request/material_request.js index 54c1d8f3af..13df2e4ce4 100644 --- a/erpnext/stock/doctype/material_request/material_request.js +++ b/erpnext/stock/doctype/material_request/material_request.js @@ -2,7 +2,7 @@ // License: GNU General Public License v3. See license.txt cur_frm.cscript.tname = "Material Request Item"; -cur_frm.cscript.fname = "indent_details"; +cur_frm.cscript.fname = "items"; {% include 'buying/doctype/purchase_common/purchase_common.js' %}; @@ -88,12 +88,12 @@ erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.exten schedule_date: function(doc, cdt, cdn) { var val = locals[cdt][cdn].schedule_date; if(val) { - $.each((doc.indent_details || []), function(i, d) { + $.each((doc.items || []), function(i, d) { if(!d.schedule_date) { d.schedule_date = val; } }); - refresh_field("indent_details"); + refresh_field("items"); } }, @@ -117,7 +117,7 @@ erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.exten args: values, callback: function(r) { $.each(r.message, function(i, item) { - var d = frappe.model.add_child(cur_frm.doc, "Material Request Item", "indent_details"); + var d = frappe.model.add_child(cur_frm.doc, "Material Request Item", "items"); d.item_code = item.item_code; d.description = item.description; d.warehouse = item.default_warehouse; @@ -125,7 +125,7 @@ erpnext.buying.MaterialRequestController = erpnext.buying.BuyingController.exten d.qty = item.qty; }); d.hide(); - refresh_field("indent_details"); + refresh_field("items"); } }); }); diff --git a/erpnext/stock/doctype/material_request/material_request.py b/erpnext/stock/doctype/material_request/material_request.py index d43d027d56..d5e6c8f69a 100644 --- a/erpnext/stock/doctype/material_request/material_request.py +++ b/erpnext/stock/doctype/material_request/material_request.py @@ -14,22 +14,22 @@ from frappe.model.mapper import get_mapped_doc from erpnext.controllers.buying_controller import BuyingController form_grid_templates = { - "indent_details": "templates/form_grid/material_request_grid.html" + "items": "templates/form_grid/material_request_grid.html" } class MaterialRequest(BuyingController): tname = 'Material Request Item' - fname = 'indent_details' + fname = 'items' def get_feed(self): return _("{0}: {1}").format(self.status, self.material_request_type) def check_if_already_pulled(self): - pass#if self.[d.sales_order_no for d in self.get('indent_details')] + pass#if self.[d.sales_order_no for d in self.get('items')] def validate_qty_against_so(self): so_items = {} # Format --> {'SO/00001': {'Item/001': 120, 'Item/002': 24}} - for d in self.get('indent_details'): + for d in self.get('items'): 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)} @@ -55,7 +55,7 @@ class MaterialRequest(BuyingController): frappe.throw(_("Material Request of maximum {0} can be made for Item {1} against Sales Order {2}").format(actual_so_qty - already_indented, item, so_no)) def validate_schedule_date(self): - for d in self.get('indent_details'): + for d in self.get('items'): if d.schedule_date and d.schedule_date < self.transaction_date: frappe.throw(_("Expected Date cannot be before Material Request Date")) @@ -115,7 +115,7 @@ class MaterialRequest(BuyingController): if self.material_request_type == "Purchase": return - item_doclist = self.get("indent_details") + item_doclist = self.get("items") if not mr_items: mr_items = [d.name for d in item_doclist] @@ -155,7 +155,7 @@ class MaterialRequest(BuyingController): bin_doc.save() item_wh_list = [] - for d in self.get("indent_details"): + for d in self.get("items"): if (not mr_item_rows or d.name in mr_item_rows) and [d.item_code, d.warehouse] not in item_wh_list \ and frappe.db.get_value("Item", d.item_code, "is_stock_item") == "Yes" and d.warehouse: item_wh_list.append([d.item_code, d.warehouse]) @@ -167,7 +167,7 @@ def update_completed_and_requested_qty(stock_entry, method): if stock_entry.doctype == "Stock Entry": material_request_map = {} - for d in stock_entry.get("mtn_details"): + for d in stock_entry.get("items"): if d.material_request: material_request_map.setdefault(d.material_request, []).append(d.material_request_item) @@ -221,14 +221,14 @@ def make_purchase_order_based_on_supplier(source_name, target_doc=None): if isinstance(target_doc, basestring): import json target_doc = frappe.get_doc(json.loads(target_doc)) - target_doc.set("po_details", []) + target_doc.set("items", []) material_requests, supplier_items = get_material_requests_based_on_supplier(source_name) def postprocess(source, target_doc): target_doc.supplier = source_name set_missing_values(source, target_doc) - target_doc.set("po_details", [d for d in target_doc.get("po_details") + target_doc.set("items", [d for d in target_doc.get("items") if d.get("item_code") in supplier_items and d.get("qty") > 0]) return target_doc diff --git a/erpnext/stock/doctype/material_request/test_material_request.py b/erpnext/stock/doctype/material_request/test_material_request.py index 48eed27d82..6fe73fc85b 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.doctype, "Purchase Order") - self.assertEquals(len(po.get("po_details")), len(mr.get("indent_details"))) + self.assertEquals(len(po.get("items")), len(mr.get("items"))) def test_make_supplier_quotation(self): from erpnext.stock.doctype.material_request.material_request import make_supplier_quotation @@ -39,7 +39,7 @@ class TestMaterialRequest(unittest.TestCase): sq = make_supplier_quotation(mr.name) self.assertEquals(sq.doctype, "Supplier Quotation") - self.assertEquals(len(sq.get("quotation_items")), len(mr.get("indent_details"))) + self.assertEquals(len(sq.get("items")), len(mr.get("items"))) def test_make_stock_entry(self): @@ -56,7 +56,7 @@ class TestMaterialRequest(unittest.TestCase): se = make_stock_entry(mr.name) self.assertEquals(se.doctype, "Stock Entry") - self.assertEquals(len(se.get("mtn_details")), len(mr.get("indent_details"))) + self.assertEquals(len(se.get("items")), len(mr.get("items"))) def _insert_stock_entry(self, qty1, qty2, warehouse = None ): se = frappe.get_doc({ @@ -66,12 +66,12 @@ class TestMaterialRequest(unittest.TestCase): "posting_time": "00:00:00", "purpose": "Material Receipt", "fiscal_year": "_Test Fiscal Year 2013", - "mtn_details": [ + "items": [ { "conversion_factor": 1.0, "doctype": "Stock Entry Detail", "item_code": "_Test Item Home Desktop 100", - "parentfield": "mtn_details", + "parentfield": "items", "incoming_rate": 100, "qty": qty1, "stock_uom": "_Test UOM 1", @@ -83,7 +83,7 @@ class TestMaterialRequest(unittest.TestCase): "conversion_factor": 1.0, "doctype": "Stock Entry Detail", "item_code": "_Test Item Home Desktop 200", - "parentfield": "mtn_details", + "parentfield": "items", "incoming_rate": 100, "qty": qty2, "stock_uom": "_Test UOM 1", @@ -107,18 +107,18 @@ class TestMaterialRequest(unittest.TestCase): # check if per complete is 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.assertEquals(mr.get("items")[0].ordered_qty, 0) + self.assertEquals(mr.get("items")[1].ordered_qty, 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.get("items")[0].qty = 27.0 + po_doc.get("items")[1].qty = 1.5 + po_doc.get("items")[0].schedule_date = "2013-07-09" + po_doc.get("items")[1].schedule_date = "2013-07-09" # check for stopped status of Material Request @@ -140,8 +140,8 @@ class TestMaterialRequest(unittest.TestCase): # check if per complete is as expected mr.load_from_db() 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.assertEquals(mr.get("items")[0].ordered_qty, 27.0) + self.assertEquals(mr.get("items")[1].ordered_qty, 1.5) current_requested_qty_item1 = self._get_requested_qty("_Test Item Home Desktop 100", "_Test Warehouse - _TC") current_requested_qty_item2 = self._get_requested_qty("_Test Item Home Desktop 200", "_Test Warehouse - _TC") @@ -153,8 +153,8 @@ class TestMaterialRequest(unittest.TestCase): # check if per complete is as expected mr.load_from_db() 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.assertEquals(mr.get("items")[0].ordered_qty, None) + self.assertEquals(mr.get("items")[1].ordered_qty, None) current_requested_qty_item1 = self._get_requested_qty("_Test Item Home Desktop 100", "_Test Warehouse - _TC") current_requested_qty_item2 = self._get_requested_qty("_Test Item Home Desktop 200", "_Test Warehouse - _TC") @@ -174,8 +174,8 @@ class TestMaterialRequest(unittest.TestCase): # check if per complete is 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.assertEquals(mr.get("items")[0].ordered_qty, 0) + self.assertEquals(mr.get("items")[1].ordered_qty, 0) current_requested_qty_item1 = self._get_requested_qty("_Test Item Home Desktop 100", "_Test Warehouse - _TC") current_requested_qty_item2 = self._get_requested_qty("_Test Item Home Desktop 200", "_Test Warehouse - _TC") @@ -192,13 +192,13 @@ class TestMaterialRequest(unittest.TestCase): "posting_time": "01:00", "fiscal_year": "_Test Fiscal Year 2013", }) - se_doc.get("mtn_details")[0].update({ + se_doc.get("items")[0].update({ "qty": 27.0, "transfer_qty": 27.0, "s_warehouse": "_Test Warehouse 1 - _TC", "incoming_rate": 1.0 }) - se_doc.get("mtn_details")[1].update({ + se_doc.get("items")[1].update({ "qty": 1.5, "transfer_qty": 1.5, "s_warehouse": "_Test Warehouse 1 - _TC", @@ -229,8 +229,8 @@ class TestMaterialRequest(unittest.TestCase): # check if per complete is as expected mr.load_from_db() 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.assertEquals(mr.get("items")[0].ordered_qty, 27.0) + self.assertEquals(mr.get("items")[1].ordered_qty, 1.5) current_requested_qty_item1 = self._get_requested_qty("_Test Item Home Desktop 100", "_Test Warehouse - _TC") current_requested_qty_item2 = self._get_requested_qty("_Test Item Home Desktop 200", "_Test Warehouse - _TC") @@ -242,8 +242,8 @@ class TestMaterialRequest(unittest.TestCase): se.cancel() mr.load_from_db() 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.assertEquals(mr.get("items")[0].ordered_qty, 0) + self.assertEquals(mr.get("items")[1].ordered_qty, 0) current_requested_qty_item1 = self._get_requested_qty("_Test Item Home Desktop 100", "_Test Warehouse - _TC") current_requested_qty_item2 = self._get_requested_qty("_Test Item Home Desktop 200", "_Test Warehouse - _TC") @@ -263,8 +263,8 @@ class TestMaterialRequest(unittest.TestCase): # check if per complete is 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.assertEquals(mr.get("items")[0].ordered_qty, 0) + self.assertEquals(mr.get("items")[1].ordered_qty, 0) # map a stock entry from erpnext.stock.doctype.material_request.material_request import make_stock_entry @@ -275,13 +275,13 @@ class TestMaterialRequest(unittest.TestCase): "posting_time": "00:00", "fiscal_year": "_Test Fiscal Year 2013", }) - se_doc.get("mtn_details")[0].update({ + se_doc.get("items")[0].update({ "qty": 60.0, "transfer_qty": 60.0, "s_warehouse": "_Test Warehouse 1 - _TC", "incoming_rate": 1.0 }) - se_doc.get("mtn_details")[1].update({ + se_doc.get("items")[1].update({ "qty": 3.0, "transfer_qty": 3.0, "s_warehouse": "_Test Warehouse 1 - _TC", @@ -307,8 +307,8 @@ class TestMaterialRequest(unittest.TestCase): mr.load_from_db() 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.assertEquals(mr.get("items")[0].ordered_qty, 60.0) + self.assertEquals(mr.get("items")[1].ordered_qty, 3.0) current_requested_qty_item1 = self._get_requested_qty("_Test Item Home Desktop 100", "_Test Warehouse - _TC") current_requested_qty_item2 = self._get_requested_qty("_Test Item Home Desktop 200", "_Test Warehouse - _TC") @@ -320,8 +320,8 @@ class TestMaterialRequest(unittest.TestCase): se.cancel() mr.load_from_db() 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.assertEquals(mr.get("items")[0].ordered_qty, 0) + self.assertEquals(mr.get("items")[1].ordered_qty, 0) current_requested_qty_item1 = self._get_requested_qty("_Test Item Home Desktop 100", "_Test Warehouse - _TC") current_requested_qty_item2 = self._get_requested_qty("_Test Item Home Desktop 200", "_Test Warehouse - _TC") @@ -345,14 +345,14 @@ class TestMaterialRequest(unittest.TestCase): "posting_time": "00:00", "fiscal_year": "_Test Fiscal Year 2013", }) - se_doc.get("mtn_details")[0].update({ + se_doc.get("items")[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_doc.get("mtn_details")[1].update({ + se_doc.get("items")[1].update({ "qty": 3.0, "transfer_qty": 3.0, "s_warehouse": "_Test Warehouse 1 - _TC", @@ -372,7 +372,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) - self.assertEquals(se_doc.get("mtn_details")[0].s_warehouse, "_Test Warehouse - _TC") + self.assertEquals(se_doc.get("items")[0].s_warehouse, "_Test Warehouse - _TC") def test_warehouse_company_validation(self): from erpnext.stock.utils import InvalidWarehouseCompany @@ -397,7 +397,7 @@ class TestMaterialRequest(unittest.TestCase): se = make_stock_entry(mr.name) self.assertEquals(se.doctype, "Stock Entry") - self.assertEquals(len(se.get("mtn_details")), len(mr.get("indent_details"))) + self.assertEquals(len(se.get("items")), len(mr.get("items"))) def test_completed_qty_for_issue(self): def _get_requested_qty(): @@ -422,14 +422,14 @@ class TestMaterialRequest(unittest.TestCase): se_doc = make_stock_entry(mr.name) se_doc.fiscal_year = "_Test Fiscal Year 2014" - se_doc.get("mtn_details")[0].qty = 60.0 + se_doc.get("items")[0].qty = 60.0 se_doc.insert() se_doc.submit() # check if per complete is as expected mr.load_from_db() - self.assertEquals(mr.get("indent_details")[0].ordered_qty, 60.0) - self.assertEquals(mr.get("indent_details")[1].ordered_qty, 3.0) + self.assertEquals(mr.get("items")[0].ordered_qty, 60.0) + self.assertEquals(mr.get("items")[1].ordered_qty, 3.0) #testing bin requested qty after issuing stock against material request self.assertEquals(_get_requested_qty(), existing_requested_qty) diff --git a/erpnext/stock/doctype/material_request/test_records.json b/erpnext/stock/doctype/material_request/test_records.json index 0337ac273d..152d1443a3 100644 --- a/erpnext/stock/doctype/material_request/test_records.json +++ b/erpnext/stock/doctype/material_request/test_records.json @@ -3,13 +3,13 @@ "company": "_Test Company", "doctype": "Material Request", "fiscal_year": "_Test Fiscal Year 2013", - "indent_details": [ + "items": [ { "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", + "parentfield": "items", "qty": 54.0, "schedule_date": "2013-02-18", "uom": "_Test UOM 1", @@ -20,7 +20,7 @@ "doctype": "Material Request Item", "item_code": "_Test Item Home Desktop 200", "item_name": "_Test Item Home Desktop 200", - "parentfield": "indent_details", + "parentfield": "items", "qty": 3.0, "schedule_date": "2013-02-19", "uom": "_Test UOM 1", diff --git a/erpnext/stock/doctype/packed_item/packed_item.py b/erpnext/stock/doctype/packed_item/packed_item.py index 9263907da1..4db77e0767 100644 --- a/erpnext/stock/doctype/packed_item/packed_item.py +++ b/erpnext/stock/doctype/packed_item/packed_item.py @@ -33,13 +33,13 @@ def update_packing_list_item(obj, packing_item_code, qty, warehouse, line, packi # check if exists exists = 0 - for d in obj.get("packing_details"): + for d in obj.get("packed_items"): 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 if not exists: - pi = obj.append('packing_details', {}) + pi = obj.append('packed_items', {}) pi.parent_item = line.item_code pi.item_code = packing_item_code @@ -80,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.get("packing_details"): + for d in obj.get("packed_items"): if [d.parent_item, d.parent_detail_docname] not in parent_items: # mark for deletion from doclist delete_list.append(d) @@ -88,8 +88,8 @@ def cleanup_packing_list(obj, parent_items): if not delete_list: return obj - packing_details = obj.get("packing_details") - obj.set("packing_details", []) - for d in packing_details: + packed_items = obj.get("packed_items") + obj.set("packed_items", []) + for d in packed_items: if d not in delete_list: - obj.append("packing_details", d) + obj.append("packed_items", d) diff --git a/erpnext/stock/doctype/packing_slip/packing_slip.js b/erpnext/stock/doctype/packing_slip/packing_slip.js index 9788290a1b..ff02e84b72 100644 --- a/erpnext/stock/doctype/packing_slip/packing_slip.js +++ b/erpnext/stock/doctype/packing_slip/packing_slip.js @@ -8,7 +8,7 @@ cur_frm.fields_dict['delivery_note'].get_query = function(doc, cdt, cdn) { } -cur_frm.fields_dict['item_details'].grid.get_field('item_code').get_query = +cur_frm.fields_dict['items'].grid.get_field('item_code').get_query = function(doc, cdt, cdn) { return { query: "erpnext.stock.doctype.packing_slip.packing_slip.item_details", @@ -59,7 +59,7 @@ cur_frm.cscript.validate_case_nos = function(doc) { cur_frm.cscript.validate_calculate_item_details = function(doc) { doc = locals[doc.doctype][doc.name]; - var ps_detail = doc.item_details || []; + var ps_detail = doc.items || []; cur_frm.cscript.validate_duplicate_items(doc, ps_detail); cur_frm.cscript.calc_net_total_pkg(doc, ps_detail); diff --git a/erpnext/stock/doctype/packing_slip/packing_slip.py b/erpnext/stock/doctype/packing_slip/packing_slip.py index bd79835d58..7385aae89a 100644 --- a/erpnext/stock/doctype/packing_slip/packing_slip.py +++ b/erpnext/stock/doctype/packing_slip/packing_slip.py @@ -1,4 +1,4 @@ -# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors +items# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals @@ -35,7 +35,7 @@ class PackingSlip(Document): frappe.throw(_("Delivery Note {0} must not be submitted").format(self.delivery_note)) def validate_items_mandatory(self): - rows = [d.item_code for d in self.get("item_details")] + rows = [d.item_code for d in self.get("items")] if not rows: frappe.msgprint(_("No Items to pack"), raise_exception=1) @@ -86,7 +86,7 @@ class PackingSlip(Document): * No. of Cases of this packing slip """ - rows = [d.item_code for d in self.get("item_details")] + rows = [d.item_code for d in self.get("items")] condition = "" if rows: @@ -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.get("item_details")]) + ps_item_qty = dict([[d.item_code, d.qty] for d in self.get("items")]) no_of_cases = cint(self.to_case_no) - cint(self.from_case_no) + 1 return res, ps_item_qty, no_of_cases @@ -127,7 +127,7 @@ class PackingSlip(Document): if not self.from_case_no: self.from_case_no = self.get_recommended_case_no() - for d in self.get("item_details"): + for d in self.get("items"): res = frappe.db.get_value("Item", d.item_code, ["net_weight", "weight_uom"], as_dict=True) @@ -146,12 +146,12 @@ class PackingSlip(Document): return cint(recommended_case_no[0][0]) + 1 def get_items(self): - self.set("item_details", []) + self.set("items", []) dn_details = self.get_details_for_packing()[0] for item in dn_details: if flt(item.qty) > flt(item.packed_qty): - ch = self.append('item_details', {}) + ch = self.append('items', {}) 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 a4ff25044b..5f468695b8 100644 --- a/erpnext/stock/doctype/price_list/price_list.py +++ b/erpnext/stock/doctype/price_list/price_list.py @@ -15,11 +15,11 @@ class PriceList(Document): try: # at least one territory - self.validate_table_has_rows("valid_for_territories") + self.validate_table_has_rows("territories") except frappe.EmptyTableError: # if no territory, set default territory if frappe.defaults.get_user_default("territory"): - self.append("valid_for_territories", { + self.append("territories", { "doctype": "Applicable Territory", "territory": frappe.defaults.get_user_default("territory") }) diff --git a/erpnext/stock/doctype/price_list/test_records.json b/erpnext/stock/doctype/price_list/test_records.json index 86d650cb2a..d91f8872db 100644 --- a/erpnext/stock/doctype/price_list/test_records.json +++ b/erpnext/stock/doctype/price_list/test_records.json @@ -6,10 +6,10 @@ "enabled": 1, "price_list_name": "_Test Price List", "selling": 1, - "valid_for_territories": [ + "territories": [ { "doctype": "Applicable Territory", - "parentfield": "valid_for_territories", + "parentfield": "territories", "territory": "All Territories" } ] @@ -21,10 +21,10 @@ "enabled": 1, "price_list_name": "_Test Price List 2", "selling": 1, - "valid_for_territories": [ + "territories": [ { "doctype": "Applicable Territory", - "parentfield": "valid_for_territories", + "parentfield": "territories", "territory": "_Test Territory Rest Of The World" } ] @@ -36,10 +36,10 @@ "enabled": 1, "price_list_name": "_Test Price List India", "selling": 1, - "valid_for_territories": [ + "territories": [ { "doctype": "Applicable Territory", - "parentfield": "valid_for_territories", + "parentfield": "territories", "territory": "_Test Territory India" } ] @@ -51,15 +51,15 @@ "enabled": 1, "price_list_name": "_Test Price List Rest of the World", "selling": 1, - "valid_for_territories": [ + "territories": [ { "doctype": "Applicable Territory", - "parentfield": "valid_for_territories", + "parentfield": "territories", "territory": "_Test Territory Rest Of The World" }, { "doctype": "Applicable Territory", - "parentfield": "valid_for_territories", + "parentfield": "territories", "territory": "_Test Territory United States" } ] diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js index fc2d1b30f3..616f66ae59 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js @@ -2,8 +2,8 @@ // License: GNU General Public License v3. See license.txt cur_frm.cscript.tname = "Purchase Receipt Item"; -cur_frm.cscript.fname = "purchase_receipt_details"; -cur_frm.cscript.other_fname = "other_charges"; +cur_frm.cscript.fname = "items"; +cur_frm.cscript.other_fname = "taxes"; {% include 'buying/doctype/purchase_common/purchase_common.js' %}; {% include 'accounts/doctype/purchase_taxes_and_charges_master/purchase_taxes_and_charges_master.js' %} @@ -119,7 +119,7 @@ cur_frm.cscript.new_contact = function() { loaddoc('Contact', tn); } -cur_frm.fields_dict['purchase_receipt_details'].grid.get_field('project_name').get_query = function(doc, cdt, cdn) { +cur_frm.fields_dict['items'].grid.get_field('project_name').get_query = function(doc, cdt, cdn) { return { filters: [ ['Project', 'status', 'not in', 'Completed, Cancelled'] @@ -127,7 +127,7 @@ cur_frm.fields_dict['purchase_receipt_details'].grid.get_field('project_name').g } } -cur_frm.fields_dict['purchase_receipt_details'].grid.get_field('batch_no').get_query= function(doc, cdt, cdn) { +cur_frm.fields_dict['items'].grid.get_field('batch_no').get_query= function(doc, cdt, cdn) { var d = locals[cdt][cdn]; if(d.item_code) { return { @@ -153,7 +153,7 @@ cur_frm.fields_dict['select_print_heading'].get_query = function(doc, cdt, cdn) } } -cur_frm.fields_dict.purchase_receipt_details.grid.get_field("qa_no").get_query = function(doc) { +cur_frm.fields_dict.items.grid.get_field("qa_no").get_query = function(doc) { return { filters: { 'docstatus': 1 @@ -161,7 +161,7 @@ cur_frm.fields_dict.purchase_receipt_details.grid.get_field("qa_no").get_query = } } -cur_frm.fields_dict['purchase_receipt_details'].grid.get_field('bom').get_query = function(doc, cdt, cdn) { +cur_frm.fields_dict['items'].grid.get_field('bom').get_query = function(doc, cdt, cdn) { var d = locals[cdt][cdn] return { filters: [ diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py index f38ee5d5de..7013cee307 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py @@ -12,12 +12,12 @@ import frappe.defaults from erpnext.controllers.buying_controller import BuyingController form_grid_templates = { - "purchase_receipt_details": "templates/form_grid/item_grid.html" + "items": "templates/form_grid/item_grid.html" } class PurchaseReceipt(BuyingController): tname = 'Purchase Receipt Item' - fname = 'purchase_receipt_details' + fname = 'items' def __init__(self, arg1, arg2=None): super(PurchaseReceipt, self).__init__(arg1, arg2) @@ -38,7 +38,7 @@ class PurchaseReceipt(BuyingController): billed_qty = frappe.db.sql("""select sum(ifnull(qty, 0)) from `tabPurchase Invoice Item` where purchase_receipt=%s and docstatus=1""", self.name) if billed_qty: - total_qty = sum((item.qty for item in self.get("purchase_receipt_details"))) + total_qty = sum((item.qty for item in self.get("items"))) self.get("__onload").billing_complete = (billed_qty[0][0] == total_qty) def validate(self): @@ -65,19 +65,19 @@ class PurchaseReceipt(BuyingController): # sub-contracting self.validate_for_subcontracting() - self.create_raw_materials_supplied("pr_raw_material_details") + self.create_raw_materials_supplied("supplied_items") self.set_landed_cost_voucher_amount() - self.update_valuation_rate("purchase_receipt_details") + self.update_valuation_rate("items") def set_landed_cost_voucher_amount(self): - for d in self.get("purchase_receipt_details"): + for d in self.get("items"): lc_voucher_amount = frappe.db.sql("""select sum(ifnull(applicable_charges, 0)) from `tabLanded Cost Item` where docstatus = 1 and purchase_receipt_item = %s""", d.name) d.landed_cost_voucher_amount = lc_voucher_amount[0][0] if lc_voucher_amount else 0.0 def validate_rejected_warehouse(self): - for d in self.get("purchase_receipt_details"): + for d in self.get("items"): if flt(d.rejected_qty) and not d.rejected_warehouse: d.rejected_warehouse = self.rejected_warehouse if not d.rejected_warehouse: @@ -85,7 +85,7 @@ class PurchaseReceipt(BuyingController): # validate accepted and rejected qty def validate_accepted_rejected_qty(self): - for d in self.get("purchase_receipt_details"): + for d in self.get("items"): if not flt(d.received_qty) and flt(d.qty): d.received_qty = flt(d.qty) - flt(d.rejected_qty) @@ -125,7 +125,7 @@ class PurchaseReceipt(BuyingController): def po_required(self): if frappe.db.get_value("Buying Settings", None, "po_required") == 'Yes': - for d in self.get('purchase_receipt_details'): + for d in self.get('items'): if not d.prevdoc_docname: frappe.throw(_("Purchase Order number required for Item {0}").format(d.item_code)) @@ -133,7 +133,7 @@ class PurchaseReceipt(BuyingController): sl_entries = [] stock_items = self.get_stock_items() - for d in self.get('purchase_receipt_details'): + for d in self.get('items'): if d.item_code in stock_items and d.warehouse: pr_qty = flt(d.qty) * flt(d.conversion_factor) @@ -157,7 +157,7 @@ class PurchaseReceipt(BuyingController): def update_ordered_qty(self): po_map = {} - for d in self.get("purchase_receipt_details"): + for d in self.get("items"): if d.prevdoc_doctype and d.prevdoc_doctype == "Purchase Order" and d.prevdoc_detail_docname: po_map.setdefault(d.prevdoc_docname, []).append(d.prevdoc_detail_docname) @@ -183,7 +183,7 @@ class PurchaseReceipt(BuyingController): return po_qty, po_warehouse def bk_flush_supp_wh(self, sl_entries): - for d in self.get('pr_raw_material_details'): + for d in self.get('supplied_items'): # 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, { @@ -194,7 +194,7 @@ class PurchaseReceipt(BuyingController): })) def validate_inspection(self): - for d in self.get('purchase_receipt_details'): #Enter inspection date for all items that require inspection + for d in self.get('items'): #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' @@ -204,7 +204,7 @@ class PurchaseReceipt(BuyingController): # Check for Stopped status def check_for_stopped_status(self, pc_obj): check_list =[] - for d in self.get('purchase_receipt_details'): + for d in self.get('items'): 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) @@ -226,7 +226,7 @@ class PurchaseReceipt(BuyingController): self.update_stock_ledger() from erpnext.stock.doctype.serial_no.serial_no import update_serial_nos_after_submit - update_serial_nos_after_submit(self, "purchase_receipt_details") + update_serial_nos_after_submit(self, "items") purchase_controller.update_last_purchase_rate(self, 1) @@ -266,7 +266,7 @@ class PurchaseReceipt(BuyingController): self.make_gl_entries_on_cancel() def get_current_stock(self): - for d in self.get('pr_raw_material_details'): + for d in self.get('supplied_items'): 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 @@ -284,7 +284,7 @@ class PurchaseReceipt(BuyingController): warehouse_with_no_account = [] negative_expense_to_be_booked = 0.0 stock_items = self.get_stock_items() - for d in self.get("purchase_receipt_details"): + for d in self.get("items"): if d.item_code in stock_items and flt(d.valuation_rate) and flt(d.qty): if warehouse_account.get(d.warehouse): @@ -335,7 +335,7 @@ class PurchaseReceipt(BuyingController): # Cost center-wise amount breakup for other charges included for valuation valuation_tax = {} - for tax in self.get("other_charges"): + for tax in self.get("taxes"): if tax.category in ("Valuation", "Valuation and Total") and flt(tax.tax_amount): if not tax.cost_center: frappe.throw(_("Cost Center is required in row {0} in Taxes table for type {1}").format(tax.idx, _(tax.category))) diff --git a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py index 1a6a375afc..fc40299895 100644 --- a/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/test_purchase_receipt.py @@ -24,7 +24,7 @@ class TestPurchaseReceipt(unittest.TestCase): pi = make_purchase_invoice(pr.name) self.assertEquals(pi.doctype, "Purchase Invoice") - self.assertEquals(len(pi.get("entries")), len(pr.get("purchase_receipt_details"))) + self.assertEquals(len(pi.get("entries")), len(pr.get("items"))) # modify rate pi.get("entries")[0].rate = 200 @@ -64,9 +64,9 @@ class TestPurchaseReceipt(unittest.TestCase): self.assertTrue(gl_entries) stock_in_hand_account = frappe.db.get_value("Account", - {"warehouse": pr.get("purchase_receipt_details")[0].warehouse}) + {"warehouse": pr.get("items")[0].warehouse}) fixed_asset_account = frappe.db.get_value("Account", - {"warehouse": pr.get("purchase_receipt_details")[1].warehouse}) + {"warehouse": pr.get("items")[1].warehouse}) expected_values = { stock_in_hand_account: [375.0, 0.0], @@ -94,19 +94,19 @@ class TestPurchaseReceipt(unittest.TestCase): pr.run_method("calculate_taxes_and_totals") pr.insert() - self.assertEquals(len(pr.get("pr_raw_material_details")), 2) - self.assertEquals(pr.get("purchase_receipt_details")[0].rm_supp_cost, 20750.0) + self.assertEquals(len(pr.get("supplied_items")), 2) + self.assertEquals(pr.get("items")[0].rm_supp_cost, 20750.0) 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" - pr.get("purchase_receipt_details")[0].qty = 1 - pr.get("purchase_receipt_details")[0].received_qty = 1 + pr.get("items")[0].item_code = "_Test Serialized Item With Series" + pr.get("items")[0].qty = 1 + pr.get("items")[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("items")[0].serial_no, "supplier"), pr.supplier) return pr @@ -115,30 +115,30 @@ class TestPurchaseReceipt(unittest.TestCase): 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("items")[0].serial_no, "warehouse")) def test_rejected_serial_no(self): pr = frappe.copy_doc(test_records[0]) - pr.get("purchase_receipt_details")[0].item_code = "_Test Serialized Item With Series" - pr.get("purchase_receipt_details")[0].qty = 3 - pr.get("purchase_receipt_details")[0].rejected_qty = 2 - pr.get("purchase_receipt_details")[0].received_qty = 5 - pr.get("purchase_receipt_details")[0].rejected_warehouse = "_Test Rejected Warehouse - _TC" + pr.get("items")[0].item_code = "_Test Serialized Item With Series" + pr.get("items")[0].qty = 3 + pr.get("items")[0].rejected_qty = 2 + pr.get("items")[0].received_qty = 5 + pr.get("items")[0].rejected_warehouse = "_Test Rejected Warehouse - _TC" pr.insert() pr.submit() - accepted_serial_nos = pr.get("purchase_receipt_details")[0].serial_no.split("\n") + accepted_serial_nos = pr.get("items")[0].serial_no.split("\n") self.assertEquals(len(accepted_serial_nos), 3) for serial_no in accepted_serial_nos: self.assertEquals(frappe.db.get_value("Serial No", serial_no, "warehouse"), - pr.get("purchase_receipt_details")[0].warehouse) + pr.get("items")[0].warehouse) - rejected_serial_nos = pr.get("purchase_receipt_details")[0].rejected_serial_no.split("\n") + rejected_serial_nos = pr.get("items")[0].rejected_serial_no.split("\n") self.assertEquals(len(rejected_serial_nos), 2) for serial_no in rejected_serial_nos: self.assertEquals(frappe.db.get_value("Serial No", serial_no, "warehouse"), - pr.get("purchase_receipt_details")[0].rejected_warehouse) + pr.get("items")[0].rejected_warehouse) def get_gl_entries(voucher_type, voucher_no): return frappe.db.sql("""select account, debit, credit diff --git a/erpnext/stock/doctype/purchase_receipt/test_records.json b/erpnext/stock/doctype/purchase_receipt/test_records.json index 4b9b3aecf2..47253ad72f 100644 --- a/erpnext/stock/doctype/purchase_receipt/test_records.json +++ b/erpnext/stock/doctype/purchase_receipt/test_records.json @@ -9,7 +9,7 @@ "grand_total": 720.0, "naming_series": "_T-Purchase Receipt-", "net_total": 500.0, - "other_charges": [ + "taxes": [ { "account_head": "_Test Account Shipping Charges - _TC", "add_deduct_tax": "Add", @@ -17,7 +17,7 @@ "charge_type": "Actual", "description": "Shipping Charges", "doctype": "Purchase Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 100.0, "tax_amount": 100.0, "cost_center": "Main - _TC" @@ -29,7 +29,7 @@ "charge_type": "Actual", "description": "VAT", "doctype": "Purchase Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 120.0, "tax_amount": 120.0, "cost_center": "Main - _TC" @@ -41,7 +41,7 @@ "charge_type": "Actual", "description": "Customs Duty", "doctype": "Purchase Taxes and Charges", - "parentfield": "other_charges", + "parentfield": "taxes", "rate": 150.0, "tax_amount": 150.0, "cost_center": "Main - _TC" @@ -49,7 +49,7 @@ ], "posting_date": "2013-02-12", "posting_time": "15:33:30", - "purchase_receipt_details": [ + "items": [ { "base_amount": 250.0, "conversion_factor": 1.0, @@ -57,7 +57,7 @@ "doctype": "Purchase Receipt Item", "item_code": "_Test Item", "item_name": "_Test Item", - "parentfield": "purchase_receipt_details", + "parentfield": "items", "qty": 5.0, "rate": 50.0, "received_qty": 5.0, @@ -74,7 +74,7 @@ "doctype": "Purchase Receipt Item", "item_code": "_Test Item", "item_name": "_Test Item", - "parentfield": "purchase_receipt_details", + "parentfield": "items", "qty": 5.0, "rate": 50.0, "received_qty": 5.0, @@ -99,7 +99,7 @@ "net_total": 5000.0, "posting_date": "2013-02-12", "posting_time": "15:33:30", - "purchase_receipt_details": [ + "items": [ { "base_amount": 5000.0, "conversion_factor": 1.0, @@ -107,7 +107,7 @@ "doctype": "Purchase Receipt Item", "item_code": "_Test FG Item", "item_name": "_Test FG Item", - "parentfield": "purchase_receipt_details", + "parentfield": "items", "qty": 10.0, "rate": 500.0, "received_qty": 10.0, diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js index b5bd455b09..b513442dc4 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry.js @@ -1,7 +1,7 @@ // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // License: GNU General Public License v3. See license.txt cur_frm.cscript.tname = "Stock Entry Detail"; -cur_frm.cscript.fname = "mtn_details"; +cur_frm.cscript.fname = "items"; frappe.require("assets/erpnext/js/controllers/stock_controller.js"); frappe.require("assets/erpnext/js/utils.js"); @@ -24,7 +24,7 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({ }; }; - this.frm.fields_dict.mtn_details.grid.get_field('item_code').get_query = function() { + this.frm.fields_dict.items.grid.get_field('item_code').get_query = function() { if(in_list(["Sales Return", "Purchase Return"], me.frm.doc.purpose) && me.get_doctype_docname()) { return { @@ -43,7 +43,7 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({ if(cint(frappe.defaults.get_default("auto_accounting_for_stock"))) { this.frm.add_fetch("company", "stock_adjustment_account", "expense_account"); - this.frm.fields_dict.mtn_details.grid.get_field('expense_account').get_query = + this.frm.fields_dict.items.grid.get_field('expense_account').get_query = function() { return { filters: { @@ -108,7 +108,7 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({ }, callback: function(r) { if (!r.exc) { - $.each(me.frm.doc.mtn_details || [], function(i, d) { + $.each(me.frm.doc.items || [], function(i, d) { if(!d.expense_account) d.expense_account = r.message; }); } @@ -133,7 +133,7 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({ doc: this.frm.doc, method: "get_items", callback: function(r) { - if(!r.exc) refresh_field("mtn_details"); + if(!r.exc) refresh_field("items"); } }); } @@ -142,7 +142,7 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({ qty: function(doc, cdt, cdn) { var d = locals[cdt][cdn]; d.transfer_qty = flt(d.qty) * flt(d.conversion_factor); - refresh_field('mtn_details'); + refresh_field('items'); }, production_order: function() { @@ -222,9 +222,9 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({ } }, - mtn_details_add: function(doc, cdt, cdn) { + items_add: function(doc, cdt, cdn) { var row = frappe.get_doc(cdt, cdn); - this.frm.script_manager.copy_from_first_row("mtn_details", row, + this.frm.script_manager.copy_from_first_row("items", row, ["expense_account", "cost_center"]); if(!row.s_warehouse) row.s_warehouse = this.frm.doc.from_warehouse; @@ -249,8 +249,8 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({ }, set_warehouse_if_missing: function(fieldname, value, condition) { - for (var i=0, l=(this.frm.doc.mtn_details || []).length; i flt(d.completed_qty): frappe.throw(_("Row #{0}: Operation {1} is not completed for {2} qty of finished goods in Production Order # {3}. Please update operation status via Time Logs") @@ -210,7 +210,7 @@ class StockEntry(StockController): def validate_valuation_rate(self): if self.purpose in ["Manufacture", "Repack"]: valuation_at_source, valuation_at_target = 0, 0 - for d in self.get("mtn_details"): + for d in self.get("items"): if d.s_warehouse and not d.t_warehouse: valuation_at_source += flt(d.amount) if d.t_warehouse and not d.s_warehouse: @@ -220,7 +220,7 @@ class StockEntry(StockController): frappe.throw(_("Total valuation for manufactured or repacked item(s) can not be less than total valuation of raw materials")) def set_total_amount(self): - self.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("items")]) def get_stock_and_rate(self, force=False): """get stock and incoming rate on posting date""" @@ -232,7 +232,7 @@ class StockEntry(StockController): allow_negative_stock = cint(frappe.db.get_value("Stock Settings", None, "allow_negative_stock")) - for d in self.get('mtn_details'): + for d in self.get('items'): d.transfer_qty = flt(d.transfer_qty) args = frappe._dict({ @@ -264,8 +264,8 @@ class StockEntry(StockController): # set incoming rate for fg item if self.purpose in ("Manufacture", "Repack"): - number_of_fg_items = len([t.t_warehouse for t in self.get("mtn_details") if t.t_warehouse]) - for d in self.get("mtn_details"): + number_of_fg_items = len([t.t_warehouse for t in self.get("items") if t.t_warehouse]) + for d in self.get("items"): if d.bom_no or (d.t_warehouse and number_of_fg_items == 1): if not flt(d.incoming_rate) or force: operation_cost_per_unit = self.get_operation_cost_per_unit(d.bom_no, d.qty) @@ -278,7 +278,7 @@ class StockEntry(StockController): if self.production_order: pro_order = frappe.get_doc("Production Order", self.production_order) - for d in pro_order.get("production_order_operations"): + for d in pro_order.get("operations"): if flt(d.completed_qty): operation_cost_per_unit += flt(d.actual_operating_cost) / flt(d.completed_qty) else: @@ -312,18 +312,18 @@ class StockEntry(StockController): return incoming_rate def validate_incoming_rate(self): - for d in self.get('mtn_details'): + for d in self.get('items'): 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'): + for d in self.get('items'): if d.bom_no: validate_bom_no(d.item_code, d.bom_no) def validate_finished_goods(self): """validation: finished good quantity should be same as manufacturing quantity""" - for d in self.get('mtn_details'): + for d in self.get('items'): if d.bom_no and flt(d.transfer_qty) != flt(self.fg_completed_qty): frappe.throw(_("Quantity in row {0} ({1}) must be same as manufactured quantity {2}").format(d.idx, d.transfer_qty, self.fg_completed_qty)) @@ -353,7 +353,7 @@ class StockEntry(StockController): 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"): + for item in self.get("items"): # validate if item exists in the ref doc and that it is a stock item if item.item_code not in stock_items: frappe.throw(_("Item {0} does not exist in {1} {2}").format(item.item_code, ref.doc.doctype, ref.doc.name), @@ -379,7 +379,7 @@ class StockEntry(StockController): def update_stock_ledger(self): sl_entries = [] - for d in self.get('mtn_details'): + for d in self.get('items'): if cstr(d.s_warehouse) and self.docstatus == 1: sl_entries.append(self.get_sl_entries(d, { "warehouse": cstr(d.s_warehouse), @@ -489,7 +489,7 @@ class StockEntry(StockController): return ret def get_items(self): - self.set('mtn_details', []) + self.set('items', []) self.validate_production_order() pro_obj = None @@ -620,7 +620,7 @@ class StockEntry(StockController): ["default_expense_account", "cost_center"])[0] for d in item_dict: - se_child = self.append('mtn_details') + se_child = self.append('items') se_child.s_warehouse = item_dict[d].get("from_warehouse") se_child.t_warehouse = item_dict[d].get("to_warehouse") se_child.item_code = cstr(d) @@ -645,7 +645,7 @@ class StockEntry(StockController): se_child.bom_no = bom_no def validate_with_material_request(self): - for item in self.get("mtn_details"): + for item in self.get("items"): if item.material_request: mreq_item = frappe.db.get_value("Material Request Item", {"name": item.material_request_item, "parent": item.material_request}, @@ -798,11 +798,11 @@ def get_return_doc_and_details(args): return_map = { "Sales Return": { # [Ref DocType, [Item tables' parentfields]] - "delivery_note_no": ["Delivery Note", ["delivery_note_details", "packing_details"]], - "sales_invoice_no": ["Sales Invoice", ["entries", "packing_details"]] + "delivery_note_no": ["Delivery Note", ["items", "packed_items"]], + "sales_invoice_no": ["Sales Invoice", ["entries", "packed_items"]] }, "Purchase Return": { - "purchase_receipt_no": ["Purchase Receipt", ["purchase_receipt_details"]] + "purchase_receipt_no": ["Purchase Receipt", ["items"]] } } @@ -854,7 +854,7 @@ def make_return_jv_from_sales_invoice(se, ref): # income account entries children = [] - for se_item in se.get("mtn_details"): + for se_item in se.get("items"): # find item in ref.doc ref_item = ref.doc.get({"item_code": se_item.item_code})[0] @@ -895,7 +895,7 @@ def make_return_jv_from_delivery_note(se, ref): parent = {} children = [] - for se_item in se.get("mtn_details"): + for se_item in se.get("items"): for sales_invoice in invoices_against_delivery: si = frappe.get_doc("Sales Invoice", sales_invoice) @@ -957,7 +957,7 @@ def make_return_jv_from_purchase_receipt(se, ref): parent = {} children = [] - for se_item in se.get("mtn_details"): + for se_item in se.get("items"): 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}) diff --git a/erpnext/stock/doctype/stock_entry/test_records.json b/erpnext/stock/doctype/stock_entry/test_records.json index f743991eb7..10df737b4a 100644 --- a/erpnext/stock/doctype/stock_entry/test_records.json +++ b/erpnext/stock/doctype/stock_entry/test_records.json @@ -3,7 +3,7 @@ "company": "_Test Company", "doctype": "Stock Entry", "fiscal_year": "_Test Fiscal Year 2013", - "mtn_details": [ + "items": [ { "conversion_factor": 1.0, "cost_center": "_Test Cost Center - _TC", @@ -11,7 +11,7 @@ "expense_account": "Stock Adjustment - _TC", "incoming_rate": 100, "item_code": "_Test Item", - "parentfield": "mtn_details", + "parentfield": "items", "qty": 50.0, "stock_uom": "_Test UOM", "t_warehouse": "_Test Warehouse - _TC", @@ -27,7 +27,7 @@ "company": "_Test Company", "doctype": "Stock Entry", "fiscal_year": "_Test Fiscal Year 2013", - "mtn_details": [ + "items": [ { "conversion_factor": 1.0, "cost_center": "_Test Cost Center - _TC", @@ -35,7 +35,7 @@ "expense_account": "Stock Adjustment - _TC", "incoming_rate": 100, "item_code": "_Test Item", - "parentfield": "mtn_details", + "parentfield": "items", "qty": 40.0, "s_warehouse": "_Test Warehouse - _TC", "stock_uom": "_Test UOM", @@ -51,7 +51,7 @@ "company": "_Test Company", "doctype": "Stock Entry", "fiscal_year": "_Test Fiscal Year 2013", - "mtn_details": [ + "items": [ { "conversion_factor": 1.0, "cost_center": "_Test Cost Center - _TC", @@ -59,7 +59,7 @@ "expense_account": "Stock Adjustment - _TC", "incoming_rate": 100, "item_code": "_Test Item", - "parentfield": "mtn_details", + "parentfield": "items", "qty": 45.0, "s_warehouse": "_Test Warehouse - _TC", "stock_uom": "_Test UOM", @@ -76,7 +76,7 @@ "company": "_Test Company", "doctype": "Stock Entry", "fiscal_year": "_Test Fiscal Year 2013", - "mtn_details": [ + "items": [ { "conversion_factor": 1.0, "cost_center": "_Test Cost Center - _TC", @@ -84,7 +84,7 @@ "expense_account": "Stock Adjustment - _TC", "incoming_rate": 100, "item_code": "_Test Item", - "parentfield": "mtn_details", + "parentfield": "items", "qty": 50.0, "s_warehouse": "_Test Warehouse - _TC", "stock_uom": "_Test UOM", @@ -98,7 +98,7 @@ "expense_account": "Stock Adjustment - _TC", "incoming_rate": 5000, "item_code": "_Test Item Home Desktop 100", - "parentfield": "mtn_details", + "parentfield": "items", "qty": 1, "stock_uom": "_Test UOM", "t_warehouse": "_Test Warehouse - _TC", diff --git a/erpnext/stock/doctype/stock_entry/test_stock_entry.py b/erpnext/stock/doctype/stock_entry/test_stock_entry.py index cc539f6ef3..f6125f5b84 100644 --- a/erpnext/stock/doctype/stock_entry/test_stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/test_stock_entry.py @@ -91,8 +91,8 @@ class TestStockEntry(unittest.TestCase): "warehouse": warehouse}, "projected_qty") or 0 # update re-level qty so that it is more than projected_qty - if projected_qty > template.item_reorder[0].warehouse_reorder_level: - template.item_reorder[0].warehouse_reorder_level += projected_qty + if projected_qty > template.reorder_levels[0].warehouse_reorder_level: + template.reorder_levels[0].warehouse_reorder_level += projected_qty template.save() from erpnext.stock.reorder_item import reorder_item @@ -102,7 +102,7 @@ class TestStockEntry(unittest.TestCase): items = [] for mr in mr_list: - for d in mr.indent_details: + for d in mr.items: items.append(d.item_code) self.assertTrue(item_code in items) @@ -116,7 +116,7 @@ class TestStockEntry(unittest.TestCase): mr.submit() stock_in_hand_account = frappe.db.get_value("Account", {"account_type": "Warehouse", - "warehouse": mr.get("mtn_details")[0].t_warehouse}) + "warehouse": mr.get("items")[0].t_warehouse}) self.check_stock_ledger_entries("Stock Entry", mr.name, [["_Test Item", "_Test Warehouse - _TC", 50.0]]) @@ -151,7 +151,7 @@ class TestStockEntry(unittest.TestCase): [["_Test Item", "_Test Warehouse - _TC", -40.0]]) stock_in_hand_account = frappe.db.get_value("Account", {"account_type": "Warehouse", - "warehouse": mi.get("mtn_details")[0].s_warehouse}) + "warehouse": mi.get("items")[0].s_warehouse}) self.check_gl_entries("Stock Entry", mi.name, sorted([ @@ -167,11 +167,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.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.get("items")[0].s_warehouse, + "item_code": mi.get("items")[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}, "stock_value"), 5000) + self.assertEquals(frappe.db.get_value("Bin", {"warehouse": mi.get("items")[0].s_warehouse, + "item_code": mi.get("items")[0].item_code}, "stock_value"), 5000) def test_material_transfer_gl_entry(self): self._clear_stock_account_balance() @@ -187,10 +187,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", - "warehouse": mtn.get("mtn_details")[0].s_warehouse}) + "warehouse": mtn.get("items")[0].s_warehouse}) fixed_asset_account = frappe.db.get_value("Account", {"account_type": "Warehouse", - "warehouse": mtn.get("mtn_details")[0].t_warehouse}) + "warehouse": mtn.get("items")[0].t_warehouse}) self.check_gl_entries("Stock Entry", mtn.name, @@ -237,12 +237,12 @@ class TestStockEntry(unittest.TestCase): self._insert_material_receipt() repack = frappe.copy_doc(test_records[3]) - repack.get("mtn_details")[1].incoming_rate = 6000 + repack.get("items")[1].incoming_rate = 6000 repack.insert() repack.submit() stock_in_hand_account = frappe.db.get_value("Account", {"account_type": "Warehouse", - "warehouse": repack.get("mtn_details")[1].t_warehouse}) + "warehouse": repack.get("items")[1].t_warehouse}) self.check_gl_entries("Stock Entry", repack.name, sorted([ @@ -289,7 +289,7 @@ class TestStockEntry(unittest.TestCase): se1.submit() se2 = frappe.copy_doc(test_records[0]) - se2.get("mtn_details")[0].item_code = "_Test Item Home Desktop 100" + se2.get("items")[0].item_code = "_Test Item Home Desktop 100" se2.insert() se2.submit() @@ -313,8 +313,8 @@ class TestStockEntry(unittest.TestCase): se = frappe.copy_doc(test_records[0]) se.purpose = "Sales Return" se.sales_invoice_no = si.name - se.get("mtn_details")[0].qty = returned_qty - se.get("mtn_details")[0].transfer_qty = returned_qty + se.get("items")[0].qty = returned_qty + se.get("items")[0].transfer_qty = returned_qty self.assertRaises(NotUpdateStockError, se.insert) self._insert_material_receipt() @@ -342,9 +342,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.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 + se.get("items")[0].item_code = "_Test Item Home Desktop 200" + se.get("items")[0].qty = returned_qty + se.get("items")[0].transfer_qty = returned_qty # check if stock entry gets submitted self.assertRaises(frappe.DoesNotExistError, se.insert) @@ -355,8 +355,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.get("mtn_details")[0].qty = returned_qty - se.get("mtn_details")[0].transfer_qty = returned_qty + se.get("items")[0].qty = returned_qty + se.get("items")[0].transfer_qty = returned_qty # in both cases item code remains _Test Item when returning se.insert() @@ -388,7 +388,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.get("delivery_note_details")[0].item_code = item_code + dn.get("items")[0].item_code = item_code dn.insert() dn.submit() @@ -413,7 +413,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.get("mtn_details")[0].qty = se.get("mtn_details")[0].transfer_qty = returned_qty + se.get("items")[0].qty = se.get("items")[0].transfer_qty = returned_qty se.insert() se.submit() @@ -479,8 +479,8 @@ class TestStockEntry(unittest.TestCase): 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.get("items")[0].item_code = item_code + so.get("items")[0].qty = 5.0 so.insert() so.submit() @@ -508,7 +508,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.get("mtn_details")[0].qty = se.get("mtn_details")[0].transfer_qty = returned_qty + se.get("items")[0].qty = se.get("items")[0].transfer_qty = returned_qty se.insert() se.submit() @@ -546,7 +546,7 @@ class TestStockEntry(unittest.TestCase): d.expense_account = "_Test Account Cost for Goods Sold - _TC" d.cost_center = "_Test Cost Center - _TC" - for d in pi.get("other_charges"): + for d in pi.get("taxes"): d.cost_center = "_Test Cost Center - _TC" pi.run_method("calculate_taxes_and_totals") @@ -560,8 +560,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.get("mtn_details")[0].qty = se.get("mtn_details")[0].transfer_qty = 5 - se.get("mtn_details")[0].s_warehouse = "_Test Warehouse - _TC" + se.get("items")[0].qty = se.get("items")[0].transfer_qty = 5 + se.get("items")[0].s_warehouse = "_Test Warehouse - _TC" se.insert() se.submit() @@ -586,8 +586,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.get("mtn_details")[0].qty = se.get("mtn_details")[0].transfer_qty = 6 - se.get("mtn_details")[0].s_warehouse = "_Test Warehouse - _TC" + se.get("items")[0].qty = se.get("items")[0].transfer_qty = 6 + se.get("items")[0].s_warehouse = "_Test Warehouse - _TC" self.assertRaises(StockOverReturnError, se.insert) @@ -625,8 +625,8 @@ class TestStockEntry(unittest.TestCase): # submit purchase receipt po = frappe.copy_doc(purchase_order_test_records[0]) po.is_subcontracted = None - po.get("po_details")[0].item_code = "_Test Item" - po.get("po_details")[0].rate = 50 + po.get("items")[0].item_code = "_Test Item" + po.get("items")[0].rate = 50 po.insert() po.submit() @@ -649,7 +649,7 @@ class TestStockEntry(unittest.TestCase): 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.get("other_charges"): + for d in pi.get("taxes"): d.cost_center = "_Test Cost Center - _TC" pi.run_method("calculate_taxes_and_totals") @@ -663,8 +663,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.get("mtn_details")[0].qty = se.get("mtn_details")[0].transfer_qty = 5 - se.get("mtn_details")[0].s_warehouse = "_Test Warehouse - _TC" + se.get("items")[0].qty = se.get("items")[0].transfer_qty = 5 + se.get("items")[0].s_warehouse = "_Test Warehouse - _TC" se.insert() se.submit() @@ -686,43 +686,43 @@ class TestStockEntry(unittest.TestCase): def test_serial_no_not_reqd(self): se = frappe.copy_doc(test_records[0]) - se.get("mtn_details")[0].serial_no = "ABCD" + se.get("items")[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.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.get("items")[0].item_code = "_Test Serialized Item" + se.get("items")[0].qty = 2 + se.get("items")[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.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.get("items")[0].item_code = "_Test Serialized Item" + se.get("items")[0].qty = 2 + se.get("items")[0].serial_no = "ABCD\nEFGH\nXYZ" + se.get("items")[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.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.get("items")[0].item_code = "_Test Serialized Item" + se.get("items")[0].qty = 2 + se.get("items")[0].serial_no = "ABCD" + se.get("items")[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.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.get("items")[0].item_code = "_Test Serialized Item" + se.get("items")[0].qty = 2 + se.get("items")[0].serial_no = "ABCD\nEFGH" + se.get("items")[0].transfer_qty = 2 se.insert() se.submit() @@ -738,12 +738,12 @@ class TestStockEntry(unittest.TestCase): make_serialized_item(target_warehouse="_Test Warehouse 1 - _TC") se = frappe.copy_doc(test_records[0]) se.purpose = "Material Issue" - se.get("mtn_details")[0].item_code = "_Test Serialized Item With Series" - 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.get("items")[0].item_code = "_Test Serialized Item With Series" + se.get("items")[0].qty = 2 + se.get("items")[0].s_warehouse = "_Test Warehouse 1 - _TC" + se.get("items")[0].t_warehouse = None + se.get("items")[0].serial_no = "ABCD\nEFGH" + se.get("items")[0].transfer_qty = 2 se.insert() self.assertRaises(SerialNoNotExistsError, se.submit) @@ -753,10 +753,10 @@ class TestStockEntry(unittest.TestCase): se, serial_nos = self.test_serial_by_series() se = frappe.copy_doc(test_records[0]) - 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 = serial_nos[0] - se.get("mtn_details")[0].transfer_qty = 1 + se.get("items")[0].item_code = "_Test Serialized Item With Series" + se.get("items")[0].qty = 1 + se.get("items")[0].serial_no = serial_nos[0] + se.get("items")[0].transfer_qty = 1 se.insert() self.assertRaises(SerialNoDuplicateError, se.submit) @@ -764,7 +764,7 @@ class TestStockEntry(unittest.TestCase): self._clear_stock_account_balance() se = make_serialized_item() - serial_nos = get_serial_nos(se.get("mtn_details")[0].serial_no) + serial_nos = get_serial_nos(se.get("items")[0].serial_no) self.assertTrue(frappe.db.exists("Serial No", serial_nos[0])) self.assertTrue(frappe.db.exists("Serial No", serial_nos[1])) @@ -777,28 +777,28 @@ class TestStockEntry(unittest.TestCase): se = frappe.copy_doc(test_records[0]) se.purpose = "Material Transfer" - 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 = serial_nos[0] - se.get("mtn_details")[0].s_warehouse = "_Test Warehouse - _TC" - se.get("mtn_details")[0].t_warehouse = "_Test Warehouse 1 - _TC" + se.get("items")[0].item_code = "_Test Serialized Item" + se.get("items")[0].qty = 1 + se.get("items")[0].transfer_qty = 1 + se.get("items")[0].serial_no = serial_nos[0] + se.get("items")[0].s_warehouse = "_Test Warehouse - _TC" + se.get("items")[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.get("mtn_details")[0].serial_no)[0] + serial_no = get_serial_nos(se.get("items")[0].serial_no)[0] se = frappe.copy_doc(test_records[0]) se.purpose = "Material Transfer" - 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.get("items")[0].item_code = "_Test Serialized Item With Series" + se.get("items")[0].qty = 1 + se.get("items")[0].transfer_qty = 1 + se.get("items")[0].serial_no = serial_no + se.get("items")[0].s_warehouse = "_Test Warehouse - _TC" + se.get("items")[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") @@ -811,16 +811,16 @@ class TestStockEntry(unittest.TestCase): make_serialized_item(target_warehouse="_Test Warehouse 1 - _TC") t = make_serialized_item() - serial_nos = get_serial_nos(t.get("mtn_details")[0].serial_no) + serial_nos = get_serial_nos(t.get("items")[0].serial_no) se = frappe.copy_doc(test_records[0]) se.purpose = "Material Transfer" - 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_nos[0] - se.get("mtn_details")[0].s_warehouse = "_Test Warehouse 1 - _TC" - se.get("mtn_details")[0].t_warehouse = "_Test Warehouse - _TC" + se.get("items")[0].item_code = "_Test Serialized Item With Series" + se.get("items")[0].qty = 1 + se.get("items")[0].transfer_qty = 1 + se.get("items")[0].serial_no = serial_nos[0] + se.get("items")[0].s_warehouse = "_Test Warehouse 1 - _TC" + se.get("items")[0].t_warehouse = "_Test Warehouse - _TC" se.insert() self.assertRaises(SerialNoWarehouseError, se.submit) @@ -829,7 +829,7 @@ class TestStockEntry(unittest.TestCase): se, serial_nos = self.test_serial_by_series() se.cancel() - serial_no = get_serial_nos(se.get("mtn_details")[0].serial_no)[0] + serial_no = get_serial_nos(se.get("items")[0].serial_no)[0] self.assertFalse(frappe.db.get_value("Serial No", serial_no, "warehouse")) def test_warehouse_company_validation(self): @@ -841,7 +841,7 @@ class TestStockEntry(unittest.TestCase): from erpnext.stock.utils import InvalidWarehouseCompany st1 = frappe.copy_doc(test_records[0]) - st1.get("mtn_details")[0].t_warehouse="_Test Warehouse 2 - _TC1" + st1.get("items")[0].t_warehouse="_Test Warehouse 2 - _TC1" st1.insert() self.assertRaises(InvalidWarehouseCompany, st1.submit) @@ -861,13 +861,13 @@ class TestStockEntry(unittest.TestCase): frappe.set_user("test@example.com") st1 = frappe.copy_doc(test_records[0]) st1.company = "_Test Company 1" - st1.get("mtn_details")[0].t_warehouse="_Test Warehouse 2 - _TC1" + st1.get("items")[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.get("mtn_details")[0].t_warehouse="_Test Warehouse 2 - _TC1" + st1.get("items")[0].t_warehouse="_Test Warehouse 2 - _TC1" st1.insert() st1.submit() @@ -922,9 +922,9 @@ class TestStockEntry(unittest.TestCase): }) stock_entry.get_items() - fg_rate = [d.amount for d in stock_entry.get("mtn_details") if d.item_code=="_Test FG Item 2"][0] + fg_rate = [d.amount for d in stock_entry.get("items") if d.item_code=="_Test FG Item 2"][0] self.assertEqual(fg_rate, 1200.00) - fg_rate = [d.amount for d in stock_entry.get("mtn_details") if d.item_code=="_Test Item"][0] + fg_rate = [d.amount for d in stock_entry.get("items") if d.item_code=="_Test Item"][0] self.assertEqual(fg_rate, 100.00) def test_variant_production_order(self): @@ -948,17 +948,17 @@ class TestStockEntry(unittest.TestCase): stock_entry = frappe.get_doc(make_stock_entry(production_order.name, "Manufacture", 1)) stock_entry.insert() - self.assertTrue("_Test Variant Item-S" in [d.item_code for d in stock_entry.mtn_details]) + self.assertTrue("_Test Variant Item-S" in [d.item_code for d in stock_entry.items]) def make_serialized_item(item_code=None, serial_no=None, target_warehouse=None): se = frappe.copy_doc(test_records[0]) - se.get("mtn_details")[0].item_code = item_code or "_Test Serialized Item With Series" - se.get("mtn_details")[0].serial_no = serial_no - se.get("mtn_details")[0].qty = 2 - se.get("mtn_details")[0].transfer_qty = 2 + se.get("items")[0].item_code = item_code or "_Test Serialized Item With Series" + se.get("items")[0].serial_no = serial_no + se.get("items")[0].qty = 2 + se.get("items")[0].transfer_qty = 2 if target_warehouse: - se.get("mtn_details")[0].t_warehouse = target_warehouse + se.get("items")[0].t_warehouse = target_warehouse se.insert() se.submit() @@ -979,7 +979,7 @@ def make_stock_entry(**args): else: s.purpose = "Material Receipt" s.company = args.company or "_Test Company" - s.append("mtn_details", { + s.append("items", { "item_code": args.item or args.item_code, "s_warehouse": args.from_warehouse or args.source, "t_warehouse": args.to_warehouse or args.target, diff --git a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py index ed62d2fea7..d36d756ae2 100644 --- a/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py +++ b/erpnext/stock/doctype/stock_reconciliation/test_stock_reconciliation.py @@ -204,12 +204,12 @@ class TestStockReconciliation(unittest.TestCase): "posting_time": "01:00", "purpose": "Material Receipt", "fiscal_year": "_Test Fiscal Year 2012", - "mtn_details": [ + "items": [ { "conversion_factor": 1.0, "doctype": "Stock Entry Detail", "item_code": "_Test Item", - "parentfield": "mtn_details", + "parentfield": "items", "incoming_rate": 1000, "qty": 20.0, "stock_uom": "_Test UOM", @@ -229,9 +229,9 @@ class TestStockReconciliation(unittest.TestCase): pr1 = frappe.copy_doc(stock_entry) pr1.posting_date = "2012-12-15" pr1.posting_time = "02:00" - pr1.get("mtn_details")[0].qty = 10 - pr1.get("mtn_details")[0].transfer_qty = 10 - pr1.get("mtn_details")[0].incoming_rate = 700 + pr1.get("items")[0].qty = 10 + pr1.get("items")[0].transfer_qty = 10 + pr1.get("items")[0].incoming_rate = 700 pr1.insert() pr1.submit() @@ -239,11 +239,11 @@ class TestStockReconciliation(unittest.TestCase): pr2.posting_date = "2012-12-25" pr2.posting_time = "03:00" pr2.purpose = "Material Issue" - 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.get("items")[0].s_warehouse = "_Test Warehouse - _TC" + pr2.get("items")[0].t_warehouse = None + pr2.get("items")[0].qty = 15 + pr2.get("items")[0].transfer_qty = 15 + pr2.get("items")[0].incoming_rate = 0 pr2.insert() pr2.submit() @@ -251,11 +251,11 @@ class TestStockReconciliation(unittest.TestCase): pr3.posting_date = "2012-12-31" pr3.posting_time = "08:00" pr3.purpose = "Material Issue" - 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.get("items")[0].s_warehouse = "_Test Warehouse - _TC" + pr3.get("items")[0].t_warehouse = None + pr3.get("items")[0].qty = 20 + pr3.get("items")[0].transfer_qty = 20 + pr3.get("items")[0].incoming_rate = 0 pr3.insert() pr3.submit() @@ -264,9 +264,9 @@ class TestStockReconciliation(unittest.TestCase): pr4.posting_date = "2013-01-05" pr4.fiscal_year = "_Test Fiscal Year 2013" pr4.posting_time = "07:00" - pr4.get("mtn_details")[0].qty = 15 - pr4.get("mtn_details")[0].transfer_qty = 15 - pr4.get("mtn_details")[0].incoming_rate = 1200 + pr4.get("items")[0].qty = 15 + pr4.get("items")[0].transfer_qty = 15 + pr4.get("items")[0].incoming_rate = 1200 pr4.insert() pr4.submit() diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index 5fe8b14b9c..31860e0736 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -154,7 +154,7 @@ def get_basic_details(args, item): "cost_center": get_default_cost_center(args, item), "batch_no": None, "item_tax_rate": json.dumps(dict(([d.tax_type, d.tax_rate] for d in - item.get("item_tax")))), + item.get("taxes")))), "uom": item.stock_uom, "min_order_qty": flt(item.min_order_qty) if args.parenttype == "Material Request" else "", "conversion_factor": 1.0, @@ -251,10 +251,10 @@ def validate_conversion_rate(args, meta): def get_party_item_code(args, item_doc, out): if args.transaction_type == "selling": - customer_item_code = item_doc.get("item_customer_details", {"customer_name": args.customer}) + customer_item_code = item_doc.get("customer_item_codes", {"customer_name": args.customer}) out.customer_item_code = customer_item_code[0].ref_code if customer_item_code else None else: - item_supplier = item_doc.get("item_supplier_details", {"supplier": args.supplier}) + item_supplier = item_doc.get("supplier_item_codes", {"supplier": args.supplier}) out.supplier_part_no = item_supplier[0].supplier_part_no if item_supplier else None def get_pos_settings_item_details(company, args, pos_settings=None): diff --git a/erpnext/stock/reorder_item.py b/erpnext/stock/reorder_item.py index e9294f8dc5..9f29f1fbf2 100644 --- a/erpnext/stock/reorder_item.py +++ b/erpnext/stock/reorder_item.py @@ -51,11 +51,11 @@ def _reorder_item(): for item_code in item_warehouse_projected_qty: item = frappe.get_doc("Item", item_code) - if item.variant_of and not item.get("item_reorder"): + if item.variant_of and not item.get("reorder_levels"): item.update_template_tables() - if item.get("item_reorder"): - for d in item.get("item_reorder"): + if item.get("reorder_levels"): + for d in item.get("reorder_levels"): add_to_material_request(item_code, d.warehouse, d.warehouse_reorder_level, d.warehouse_reorder_qty, d.material_request_type) @@ -122,7 +122,7 @@ def create_material_request(material_requests): for d in items: d = frappe._dict(d) item = frappe.get_doc("Item", d.item_code) - mr.append("indent_details", { + mr.append("items", { "doctype": "Material Request Item", "item_code": d.item_code, "schedule_date": add_days(nowdate(),cint(item.lead_time_days)), @@ -169,7 +169,7 @@ def send_email_notification(mr_list): for mr in mr_list: msg += "

" + mr.name + """

""" - for item in mr.get("indent_details"): + for item in mr.get("items"): msg += "" msg += "
Item CodeWarehouseQtyUOM
" + item.item_code + "" + item.warehouse + "" + \ cstr(item.qty) + "" + cstr(item.uom) + "
" diff --git a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js index a31dfa6e58..cf5d1712b9 100644 --- a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js +++ b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.js @@ -100,7 +100,7 @@ cur_frm.fields_dict['contact_person'].get_query = function(doc, cdt, cdn) { } -cur_frm.fields_dict['item_maintenance_detail'].grid.get_field('item_code').get_query = function(doc, cdt, cdn) { +cur_frm.fields_dict['items'].grid.get_field('item_code').get_query = function(doc, cdt, cdn) { return { filters:{ 'is_service_item': "Yes" } } @@ -110,7 +110,7 @@ cur_frm.cscript.item_code = function(doc, cdt, cdn) { var fname = cur_frm.cscript.fname; var d = locals[cdt][cdn]; if (d.item_code) { - return get_server_fields('get_item_details', d.item_code, 'item_maintenance_detail', + return get_server_fields('get_item_details', d.item_code, 'items', doc, cdt, cdn, 1); } } @@ -119,7 +119,7 @@ cur_frm.cscript.generate_schedule = function(doc, cdt, cdn) { if (!doc.__islocal) { return $c('runserverobj', args={'method':'generate_schedule', 'docs':doc}, function(r, rt) { - refresh_field('maintenance_schedule_detail'); + refresh_field('schedules'); }); } else { msgprint(__("Please save the document before generating maintenance schedule")); diff --git a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.json b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.json index a80c497e7d..870912bb66 100644 --- a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.json +++ b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.json @@ -94,7 +94,7 @@ "fieldname": "schedules", "fieldtype": "Table", "label": "Schedules", - "oldfieldname": "maintenance_schedule_detail", + "oldfieldname": "schedules", "oldfieldtype": "Table", "options": "Maintenance Schedule Detail", "permlevel": 0, diff --git a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py index a739651529..349ff4b7be 100644 --- a/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py +++ b/erpnext/support/doctype/maintenance_schedule/maintenance_schedule.py @@ -22,16 +22,16 @@ class MaintenanceSchedule(TransactionBase): return ret def generate_schedule(self): - self.set('maintenance_schedule_detail', []) + self.set('schedules', []) frappe.db.sql("""delete from `tabMaintenance Schedule Detail` where parent=%s""", (self.name)) count = 1 - for d in self.get('item_maintenance_detail'): + for d in self.get('items'): 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 = self.append('maintenance_schedule_detail') + child = self.append('schedules') child.item_code = d.item_code child.item_name = d.item_name child.scheduled_date = s_list[i].strftime('%Y-%m-%d') @@ -44,13 +44,13 @@ class MaintenanceSchedule(TransactionBase): self.save() def on_submit(self): - if not self.get('maintenance_schedule_detail'): + if not self.get('schedules'): throw(_("Please click on 'Generate Schedule' to get schedule")) self.check_serial_no_added() self.validate_schedule() email_map = {} - for d in self.get('item_maintenance_detail'): + for d in self.get('items'): if d.serial_no: serial_nos = get_valid_serial_nos(d.serial_no) self.validate_serial_no(serial_nos, d.start_date) @@ -133,7 +133,7 @@ class MaintenanceSchedule(TransactionBase): return schedule_date def validate_dates_with_periodicity(self): - for d in self.get("item_maintenance_detail"): + for d in self.get("items"): if d.start_date and d.end_date and d.periodicity and d.periodicity!="Random": date_diff = (getdate(d.end_date) - getdate(d.start_date)).days + 1 days_in_period = { @@ -150,10 +150,10 @@ class MaintenanceSchedule(TransactionBase): .format(d.idx, d.periodicity, days_in_period[d.periodicity])) def validate_maintenance_detail(self): - if not self.get('item_maintenance_detail'): + if not self.get('items'): throw(_("Please enter Maintaince Details first")) - for d in self.get('item_maintenance_detail'): + for d in self.get('items'): if not d.item_code: throw(_("Please select item code")) elif not d.start_date or not d.end_date: @@ -167,7 +167,7 @@ class MaintenanceSchedule(TransactionBase): throw(_("Start date should be less than end date for Item {0}").format(d.item_code)) def validate_sales_order(self): - for d in self.get('item_maintenance_detail'): + for d in self.get('items'): 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 @@ -210,11 +210,11 @@ class MaintenanceSchedule(TransactionBase): def validate_schedule(self): item_lst1 =[] item_lst2 =[] - for d in self.get('item_maintenance_detail'): + for d in self.get('items'): if d.item_code not in item_lst1: item_lst1.append(d.item_code) - for m in self.get('maintenance_schedule_detail'): + for m in self.get('schedules'): if m.item_code not in item_lst2: item_lst2.append(m.item_code) @@ -227,17 +227,17 @@ class MaintenanceSchedule(TransactionBase): def check_serial_no_added(self): serial_present =[] - for d in self.get('item_maintenance_detail'): + for d in self.get('items'): if d.serial_no: serial_present.append(d.item_code) - for m in self.get('maintenance_schedule_detail'): + for m in self.get('schedules'): 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 {0}").format(m.item_code)) def on_cancel(self): - for d in self.get('item_maintenance_detail'): + for d in self.get('items'): 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_visit/maintenance_visit.js b/erpnext/support/doctype/maintenance_visit/maintenance_visit.js index ffdcb3ea75..675ecd3822 100644 --- a/erpnext/support/doctype/maintenance_visit/maintenance_visit.js +++ b/erpnext/support/doctype/maintenance_visit/maintenance_visit.js @@ -75,7 +75,7 @@ cur_frm.fields_dict['contact_person'].get_query = function(doc, cdt, cdn) { } } -cur_frm.fields_dict['maintenance_visit_details'].grid.get_field('item_code').get_query = function(doc, cdt, cdn) { +cur_frm.fields_dict['purposes'].grid.get_field('item_code').get_query = function(doc, cdt, cdn) { return{ filters:{ 'is_service_item': "Yes"} } @@ -85,7 +85,7 @@ cur_frm.cscript.item_code = function(doc, cdt, cdn) { var fname = cur_frm.cscript.fname; var d = locals[cdt][cdn]; if (d.item_code) { - return get_server_fields('get_item_details',d.item_code, 'maintenance_visit_details',doc,cdt,cdn,1); + return get_server_fields('get_item_details',d.item_code, 'purposes',doc,cdt,cdn,1); } } diff --git a/erpnext/support/doctype/maintenance_visit/maintenance_visit.py b/erpnext/support/doctype/maintenance_visit/maintenance_visit.py index ef2fb41a29..fb42548566 100644 --- a/erpnext/support/doctype/maintenance_visit/maintenance_visit.py +++ b/erpnext/support/doctype/maintenance_visit/maintenance_visit.py @@ -15,7 +15,7 @@ class MaintenanceVisit(TransactionBase): return frappe.db.get_value("Item", item_code, ["item_name", "description"], as_dict=1) def validate_serial_no(self): - for d in self.get('maintenance_visit_details'): + for d in self.get('purposes'): if d.serial_no and not frappe.db.exists("Serial No", d.serial_no): frappe.throw(_("Serial No {0} does not exist").format(d.serial_no)) @@ -23,7 +23,7 @@ class MaintenanceVisit(TransactionBase): self.validate_serial_no() def update_customer_issue(self, flag): - for d in self.get('maintenance_visit_details'): + for d in self.get('purposes'): if d.prevdoc_docname and d.prevdoc_doctype == 'Customer Issue' : if flag==1: mntc_date = self.mntc_date @@ -53,7 +53,7 @@ class MaintenanceVisit(TransactionBase): def check_if_last_visit(self): """check if last maintenance visit against same sales order/ customer issue""" check_for_docname = None - for d in self.get('maintenance_visit_details'): + for d in self.get('purposes'): if d.prevdoc_docname: check_for_docname = d.prevdoc_docname #check_for_doctype = d.prevdoc_doctype diff --git a/erpnext/templates/includes/cart.js b/erpnext/templates/includes/cart.js index 90cfea59da..fff0a329b4 100644 --- a/erpnext/templates/includes/cart.js +++ b/erpnext/templates/includes/cart.js @@ -53,7 +53,7 @@ $.extend(shopping_cart, { var $cart_billing_address = $("#cart-billing-address").empty(); var $cart_shipping_address = $("#cart-shipping-address").empty(); - var no_items = $.map(doc.quotation_details || [], + var no_items = $.map(doc.items || [], function(d) { return d.item_code || null;}).length===0; if(no_items) { shopping_cart.show_error("Empty :-(", frappe._("Go ahead and add something to your cart.")); @@ -65,11 +65,11 @@ $.extend(shopping_cart, { var taxes_exist = false; var shipping_rule_labels = $.map(out.shipping_rules || [], function(rule) { return rule[1]; }); - $.each(doc.quotation_details || [], function(i, d) { + $.each(doc.items || [], function(i, d) { shopping_cart.render_item_row($cart_items, d); }); - $.each(doc.other_charges || [], function(i, d) { + $.each(doc.taxes || [], function(i, d) { if(out.shipping_rules && out.shipping_rules.length && shipping_rule_labels.indexOf(d.description)!==-1) { shipping_rule_added = true; diff --git a/erpnext/translations/ar.csv b/erpnext/translations/ar.csv index 0090f9fb48..429c02ea8e 100644 --- a/erpnext/translations/ar.csv +++ b/erpnext/translations/ar.csv @@ -1457,8 +1457,8 @@ Jobs Email Settings,إعدادات البريد الإلكتروني وظائف Journal Entries,مجلة مقالات Journal Entry,إدخال دفتر اليومية Journal Voucher,مجلة قسيمة -Journal Voucher Detail,مجلة قسيمة التفاصيل -Journal Voucher Detail No,مجلة التفاصيل قسيمة لا +Journal Entry Account,مجلة قسيمة التفاصيل +Journal Entry Account No,مجلة التفاصيل قسيمة لا Journal Voucher {0} does not have account {1} or already matched,مجلة قسيمة {0} لا يملك حساب {1} أو بالفعل المتطابقة Journal Vouchers {0} are un-linked,مجلة قسائم {0} ترتبط الامم المتحدة و Keep a track of communication related to this enquiry which will help for future reference.,الحفاظ على مسار الاتصالات المتعلقة بهذا التحقيق والتي سوف تساعد للرجوع إليها مستقبلا. diff --git a/erpnext/translations/de.csv b/erpnext/translations/de.csv index 3cf0a6ab91..9c38ba097d 100644 --- a/erpnext/translations/de.csv +++ b/erpnext/translations/de.csv @@ -1513,8 +1513,8 @@ Jobs Email Settings,Stellen-E-Mail-Einstellungen Journal Entries,Journaleinträge Journal Entry,Journaleintrag Journal Voucher,Journal -Journal Voucher Detail,Detailansicht Beleg -Journal Voucher Detail No,Journalnummer +Journal Entry Account,Detailansicht Beleg +Journal Entry Account No,Journalnummer Journal Voucher {0} does not have account {1} or already matched,Blatt Gutschein {0} ist nicht Konto haben {1} oder bereits abgestimmt Journal Vouchers {0} are un-linked,Blatt Gutscheine {0} sind un -linked "Keep Track of Sales Campaigns. Keep track of Leads, Quotations, Sales Order etc from Campaigns to gauge Return on Investment. ","Keep Track of Sales Campaigns. Keep track of Leads, Quotations, Sales Order etc from Campaigns to gauge Return on Investment. " diff --git a/erpnext/translations/el.csv b/erpnext/translations/el.csv index 1fa2d15ebf..d43706c275 100644 --- a/erpnext/translations/el.csv +++ b/erpnext/translations/el.csv @@ -1458,8 +1458,8 @@ Jobs Email Settings,Εργασία Ρυθμίσεις Email Journal Entries,Εφημερίδα Καταχωρήσεις Journal Entry,Journal Entry Journal Voucher,Εφημερίδα Voucher -Journal Voucher Detail,Εφημερίδα Λεπτομέρεια Voucher -Journal Voucher Detail No,Εφημερίδα Λεπτομέρεια φύλλου αριθ. +Journal Entry Account,Εφημερίδα Λεπτομέρεια Voucher +Journal Entry Account No,Εφημερίδα Λεπτομέρεια φύλλου αριθ. Journal Voucher {0} does not have account {1} or already matched,Εφημερίδα Voucher {0} δεν έχει λογαριασμό {1} ή έχουν ήδη συμφωνημένα Journal Vouchers {0} are un-linked,Εφημερίδα Κουπόνια {0} είναι μη συνδεδεμένο Keep a track of communication related to this enquiry which will help for future reference.,Κρατήστε ένα κομμάτι της επικοινωνίας που σχετίζονται με την έρευνα αυτή που θα βοηθήσει για μελλοντική αναφορά. diff --git a/erpnext/translations/es.csv b/erpnext/translations/es.csv index 452a643e6f..3086b29eb4 100644 --- a/erpnext/translations/es.csv +++ b/erpnext/translations/es.csv @@ -1461,8 +1461,8 @@ Jobs Email Settings,Trabajos Email Journal Entries,entradas de diario Journal Entry,Entrada de diario Journal Voucher,Comprobante de Diario -Journal Voucher Detail,Detalle del Asiento de Diario -Journal Voucher Detail No,Detalle del Asiento de Diario No +Journal Entry Account,Detalle del Asiento de Diario +Journal Entry Account No,Detalle del Asiento de Diario No Journal Voucher {0} does not have account {1} or already matched,Comprobante de Diario {0} no tiene cuenta {1} o ya emparejado Journal Vouchers {0} are un-linked,Asientos de Diario {0} no están vinculados. Keep a track of communication related to this enquiry which will help for future reference.,Mantenga un registro de la comunicación en relación con esta consulta que ayudará para futuras consultas. diff --git a/erpnext/translations/fr.csv b/erpnext/translations/fr.csv index 6ec6513258..804e5ce609 100644 --- a/erpnext/translations/fr.csv +++ b/erpnext/translations/fr.csv @@ -1459,8 +1459,8 @@ Jobs Email Settings,Paramètres de messagerie Emploi Journal Entries,Journal Entries Journal Entry,Journal Entry Journal Voucher,Bon Journal -Journal Voucher Detail,Détail pièce de journal -Journal Voucher Detail No,Détail Bon Journal No +Journal Entry Account,Détail pièce de journal +Journal Entry Account No,Détail Bon Journal No Journal Voucher {0} does not have account {1} or already matched,Journal Bon {0} n'a pas encore compte {1} ou déjà identifié Journal Vouchers {0} are un-linked,Date de livraison prévue ne peut pas être avant ventes Date de commande Keep a track of communication related to this enquiry which will help for future reference.,Gardez une trace de la communication liée à cette enquête qui aidera pour référence future. diff --git a/erpnext/translations/hi.csv b/erpnext/translations/hi.csv index 68be3cd4a5..df43d8506f 100644 --- a/erpnext/translations/hi.csv +++ b/erpnext/translations/hi.csv @@ -1458,8 +1458,8 @@ Jobs Email Settings,नौकरियां ईमेल सेटिंग Journal Entries,जर्नल प्रविष्टियां Journal Entry,जर्नल प्रविष्टि Journal Voucher,जर्नल वाउचर -Journal Voucher Detail,जर्नल वाउचर विस्तार -Journal Voucher Detail No,जर्नल वाउचर विस्तार नहीं +Journal Entry Account,जर्नल वाउचर विस्तार +Journal Entry Account No,जर्नल वाउचर विस्तार नहीं Journal Voucher {0} does not have account {1} or already matched,जर्नल वाउचर {0} खाता नहीं है {1} या पहले से ही मेल नहीं खाते Journal Vouchers {0} are un-linked,जर्नल वाउचर {0} संयुक्त राष्ट्र से जुड़े हुए हैं Keep a track of communication related to this enquiry which will help for future reference.,जांच है जो भविष्य में संदर्भ के लिए मदद करने के लिए संबंधित संचार का ट्रैक रखें. diff --git a/erpnext/translations/hr.csv b/erpnext/translations/hr.csv index a52d4f9cd8..550eb0d094 100644 --- a/erpnext/translations/hr.csv +++ b/erpnext/translations/hr.csv @@ -1458,8 +1458,8 @@ Jobs Email Settings,Poslovi Postavke e-pošte Journal Entries,Časopis upisi Journal Entry,Časopis Stupanje Journal Voucher,Časopis bon -Journal Voucher Detail,Časopis bon Detalj -Journal Voucher Detail No,Časopis bon Detalj Ne +Journal Entry Account,Časopis bon Detalj +Journal Entry Account No,Časopis bon Detalj Ne Journal Voucher {0} does not have account {1} or already matched,Časopis bon {0} nema račun {1} ili već usklađeni Journal Vouchers {0} are un-linked,Časopis bon {0} su UN -linked Keep a track of communication related to this enquiry which will help for future reference.,Držite pratiti komunikacije vezane uz ovaj upit koji će vam pomoći za buduću referencu. diff --git a/erpnext/translations/id.csv b/erpnext/translations/id.csv index eaf6e197d4..658fa42e41 100644 --- a/erpnext/translations/id.csv +++ b/erpnext/translations/id.csv @@ -1327,7 +1327,7 @@ Invoice Period From,Faktur Periode Dari Invoice Period From and Invoice Period To dates mandatory for recurring invoice,Faktur Periode Dari dan Faktur Period Untuk tanggal wajib untuk berulang faktur Invoice Period To,Periode Faktur Untuk Invoice Type,Invoice Type -Invoice/Journal Voucher Details,Invoice / Journal Voucher Detail +Invoice/Journal Voucher Details,Invoice / Journal Entry Account Invoiced Amount (Exculsive Tax),Faktur Jumlah (Pajak exculsive) Is Active,Aktif Is Advance,Apakah Muka @@ -1458,8 +1458,8 @@ Jobs Email Settings,Pengaturan Jobs Email Journal Entries,Entries Journal Journal Entry,Jurnal Entri Journal Voucher,Journal Voucher -Journal Voucher Detail,Journal Voucher Detil -Journal Voucher Detail No,Journal Voucher Detil ada +Journal Entry Account,Journal Voucher Detil +Journal Entry Account No,Journal Voucher Detil ada Journal Voucher {0} does not have account {1} or already matched,Journal Voucher {0} tidak memiliki akun {1} atau sudah cocok Journal Vouchers {0} are un-linked,Journal Voucher {0} yang un-linked Keep a track of communication related to this enquiry which will help for future reference.,Menyimpan melacak komunikasi yang berkaitan dengan penyelidikan ini yang akan membantu untuk referensi di masa mendatang. diff --git a/erpnext/translations/it.csv b/erpnext/translations/it.csv index 0e02b0473e..488423a164 100644 --- a/erpnext/translations/it.csv +++ b/erpnext/translations/it.csv @@ -1458,8 +1458,8 @@ Jobs Email Settings,Impostazioni email Lavoro Journal Entries,Prime note Journal Entry,Journal Entry Journal Voucher,Journal Voucher -Journal Voucher Detail,Journal Voucher Detail -Journal Voucher Detail No,Journal Voucher Detail No +Journal Entry Account,Journal Entry Account +Journal Entry Account No,Journal Entry Account No Journal Voucher {0} does not have account {1} or already matched,Journal Voucher {0} non ha conto {1} o già abbinate Journal Vouchers {0} are un-linked,Diario Buoni {0} sono non- linked Keep a track of communication related to this enquiry which will help for future reference.,Tenere una traccia delle comunicazioni relative a questa indagine che contribuirà per riferimento futuro. diff --git a/erpnext/translations/ja.csv b/erpnext/translations/ja.csv index 3349c80269..6585666c62 100644 --- a/erpnext/translations/ja.csv +++ b/erpnext/translations/ja.csv @@ -1460,8 +1460,8 @@ Jobs Email Settings,仕事のメール設定 Journal Entries,仕訳 Journal Entry,仕訳 Journal Voucher,伝票 -Journal Voucher Detail,伝票の詳細 -Journal Voucher Detail No,伝票の詳細番号 +Journal Entry Account,伝票の詳細 +Journal Entry Account No,伝票の詳細番号 Journal Voucher {0} does not have account {1} or already matched,伝票は{0}アカウントを持っていない{1}、またはすでに一致 Journal Vouchers {0} are un-linked,ジャーナルバウチャー{0}アンリンクされている Keep a track of communication related to this enquiry which will help for future reference.,今後の参考のために役立ちます。この照会に関連した通信を追跡する。 diff --git a/erpnext/translations/kn.csv b/erpnext/translations/kn.csv index 3da26a1709..b987788ec9 100644 --- a/erpnext/translations/kn.csv +++ b/erpnext/translations/kn.csv @@ -1458,8 +1458,8 @@ Jobs Email Settings,ಕೆಲಸ ಇಮೇಲ್ ಸೆಟ್ಟಿಂಗ್ Journal Entries,ಜರ್ನಲ್ ನಮೂದುಗಳು Journal Entry,ಜರ್ನಲ್ ಎಂಟ್ರಿ Journal Voucher,ಜರ್ನಲ್ ಚೀಟಿ -Journal Voucher Detail,ಜರ್ನಲ್ ಚೀಟಿ ವಿವರ -Journal Voucher Detail No,ಜರ್ನಲ್ ಚೀಟಿ ವಿವರ ನಂ +Journal Entry Account,ಜರ್ನಲ್ ಚೀಟಿ ವಿವರ +Journal Entry Account No,ಜರ್ನಲ್ ಚೀಟಿ ವಿವರ ನಂ Journal Voucher {0} does not have account {1} or already matched,ಜರ್ನಲ್ ಚೀಟಿ {0} {1} ಖಾತೆಯನ್ನು ಅಥವಾ ಈಗಾಗಲೇ ದಾಖಲೆಗಳುಸರಿಹೊಂದಿವೆ ಇಲ್ಲ Journal Vouchers {0} are un-linked,ಜರ್ನಲ್ ರಶೀದಿ {0} UN- ಲಿಂಕ್ Keep a track of communication related to this enquiry which will help for future reference.,ಭವಿಷ್ಯದ ಉಲ್ಲೇಖಕ್ಕಾಗಿ ಸಹಾಯ whichwill ಈ ವಿಚಾರಣೆ ಸಂಬಂಧಿಸಿದ ಸಂವಹನದ ಒಂದು ಜಾಡನ್ನು ಇರಿಸಿ. diff --git a/erpnext/translations/ko.csv b/erpnext/translations/ko.csv index c0c201d6ad..9a6dc52b5e 100644 --- a/erpnext/translations/ko.csv +++ b/erpnext/translations/ko.csv @@ -1458,8 +1458,8 @@ Jobs Email Settings,채용 정보 이메일 설정 Journal Entries,저널 항목 Journal Entry,분개 Journal Voucher,분개장 -Journal Voucher Detail,분개장 세부 정보 -Journal Voucher Detail No,분개장 세부 사항 없음 +Journal Entry Account,분개장 세부 정보 +Journal Entry Account No,분개장 세부 사항 없음 Journal Voucher {0} does not have account {1} or already matched,분개장 {0} 계정이없는 {1} 또는 이미 일치 Journal Vouchers {0} are un-linked,분개장 {0} 않은 연결되어 Keep a track of communication related to this enquiry which will help for future reference.,향후 참조를 위해 도움이 될 것입니다이 문의와 관련된 통신을 확인합니다. diff --git a/erpnext/translations/nl.csv b/erpnext/translations/nl.csv index e5a9e1054e..aed452ea53 100644 --- a/erpnext/translations/nl.csv +++ b/erpnext/translations/nl.csv @@ -1458,8 +1458,8 @@ Jobs Email Settings,Vacatures E-mailinstellingen Journal Entries,Journaalposten Journal Entry,Journal Entry Journal Voucher,Journal Voucher -Journal Voucher Detail,Journal Voucher Detail -Journal Voucher Detail No,Journal Voucher Detail Geen +Journal Entry Account,Journal Entry Account +Journal Entry Account No,Journal Entry Account Geen Journal Voucher {0} does not have account {1} or already matched,Journal Voucher {0} heeft geen rekening {1} of al geëvenaard Journal Vouchers {0} are un-linked,Dagboek Vouchers {0} zijn niet- verbonden Keep a track of communication related to this enquiry which will help for future reference.,Houd een spoor van communicatie met betrekking tot dit onderzoek dat zal helpen voor toekomstig gebruik. diff --git a/erpnext/translations/pl.csv b/erpnext/translations/pl.csv index bf0c0d315b..0e956102db 100644 --- a/erpnext/translations/pl.csv +++ b/erpnext/translations/pl.csv @@ -1402,8 +1402,8 @@ Jobs Email Settings,Jobs Email Settings Journal Entries,Journal Entries Journal Entry,Journal Entry Journal Voucher,Journal Voucher -Journal Voucher Detail,Journal Voucher Detail -Journal Voucher Detail No,Journal Voucher Detail No +Journal Entry Account,Journal Entry Account +Journal Entry Account No,Journal Entry Account No Journal Voucher {0} does not have account {1} or already matched,Journal Voucher {0} does not have account {1} or already matched Journal Vouchers {0} are un-linked,Journal Vouchers {0} are un-linked Keep a track of communication related to this enquiry which will help for future reference.,Keep a track of communication related to this enquiry which will help for future reference. diff --git a/erpnext/translations/pt-BR.csv b/erpnext/translations/pt-BR.csv index 77968420af..b6c64db60d 100644 --- a/erpnext/translations/pt-BR.csv +++ b/erpnext/translations/pt-BR.csv @@ -1490,8 +1490,8 @@ Jobs Email Settings,Configurações do e-mail de empregos Journal Entries,Lançamentos do livro Diário Journal Entry,Lançamento do livro Diário Journal Voucher,Comprovante do livro Diário -Journal Voucher Detail,Detalhe do Comprovante do livro Diário -Journal Voucher Detail No,Nº do Detalhe do Comprovante do livro Diário +Journal Entry Account,Detalhe do Comprovante do livro Diário +Journal Entry Account No,Nº do Detalhe do Comprovante do livro Diário Journal Voucher {0} does not have account {1} or already matched,Jornal Vale {0} não tem conta {1} ou já combinava Journal Vouchers {0} are un-linked,Jornal Vouchers {0} são não- ligado Keep a track of communication related to this enquiry which will help for future reference.,"Mantenha o controle de comunicações relacionadas a esta consulta, o que irá ajudar para futuras referências." diff --git a/erpnext/translations/pt.csv b/erpnext/translations/pt.csv index 3b2ae59e49..501d4766a1 100644 --- a/erpnext/translations/pt.csv +++ b/erpnext/translations/pt.csv @@ -1458,8 +1458,8 @@ Jobs Email Settings,E-mail Configurações de empregos Journal Entries,Jornal entradas Journal Entry,Journal Entry Journal Voucher,Vale Jornal -Journal Voucher Detail,Jornal Detalhe Vale -Journal Voucher Detail No,Jornal Detalhe folha no +Journal Entry Account,Jornal Detalhe Vale +Journal Entry Account No,Jornal Detalhe folha no Journal Voucher {0} does not have account {1} or already matched,Jornal Vale {0} não tem conta {1} ou já combinava Journal Vouchers {0} are un-linked,Jornal Vouchers {0} são não- ligado Keep a track of communication related to this enquiry which will help for future reference.,Mantenha uma faixa de comunicação relacionada a este inquérito que irá ajudar para referência futura. diff --git a/erpnext/translations/ro.csv b/erpnext/translations/ro.csv index 5bd319d10f..d3e2b7b81b 100644 --- a/erpnext/translations/ro.csv +++ b/erpnext/translations/ro.csv @@ -1458,8 +1458,8 @@ Jobs Email Settings,Setări de locuri de muncă de e-mail Journal Entries,Intrari in jurnal Journal Entry,Jurnal de intrare Journal Voucher,Jurnalul Voucher -Journal Voucher Detail,Jurnalul Voucher Detaliu -Journal Voucher Detail No,Jurnalul Voucher Detaliu Nu +Journal Entry Account,Jurnalul Voucher Detaliu +Journal Entry Account No,Jurnalul Voucher Detaliu Nu Journal Voucher {0} does not have account {1} or already matched,Jurnalul Voucher {0} nu are cont {1} sau deja potrivire Journal Vouchers {0} are un-linked,Jurnalul Tichete {0} sunt ne-legate de Keep a track of communication related to this enquiry which will help for future reference.,"Păstra o pistă de comunicare legate de această anchetă, care va ajuta de referință pentru viitor." diff --git a/erpnext/translations/ru.csv b/erpnext/translations/ru.csv index e2b6fe7ea6..91102d2b63 100644 --- a/erpnext/translations/ru.csv +++ b/erpnext/translations/ru.csv @@ -1459,8 +1459,8 @@ Jobs Email Settings,Настройки Вакансии Email Journal Entries,Записи в журнале Journal Entry,Запись в дневнике Journal Voucher,Журнал Ваучер -Journal Voucher Detail,Журнал Ваучер Подробно -Journal Voucher Detail No,Журнал Ваучер Подробно Нет +Journal Entry Account,Журнал Ваучер Подробно +Journal Entry Account No,Журнал Ваучер Подробно Нет Journal Voucher {0} does not have account {1} or already matched,Журнал Ваучер {0} не имеет учетной записи {1} или уже согласованы Journal Vouchers {0} are un-linked,Журнал Ваучеры {0} являются не-связаны Keep a track of communication related to this enquiry which will help for future reference.,"Постоянно отслеживать коммуникации, связанные на этот запрос, который поможет в будущем." diff --git a/erpnext/translations/sr.csv b/erpnext/translations/sr.csv index fd0e50a532..f39e98c383 100644 --- a/erpnext/translations/sr.csv +++ b/erpnext/translations/sr.csv @@ -1458,8 +1458,8 @@ Jobs Email Settings,Послови Емаил подешавања Journal Entries,Часопис Ентриес Journal Entry,Јоурнал Ентри Journal Voucher,Часопис ваучера -Journal Voucher Detail,Часопис Ваучер Детаљ -Journal Voucher Detail No,Часопис Ваучер Детаљ Нема +Journal Entry Account,Часопис Ваучер Детаљ +Journal Entry Account No,Часопис Ваучер Детаљ Нема Journal Voucher {0} does not have account {1} or already matched,Часопис Ваучер {0} нема рачун {1} или већ упарен Journal Vouchers {0} are un-linked,Журнал Ваучеры {0} являются не- связаны Keep a track of communication related to this enquiry which will help for future reference.,Водите евиденцију о комуникацији у вези са овом истрагу која ће помоћи за будућу референцу. diff --git a/erpnext/translations/ta.csv b/erpnext/translations/ta.csv index d87d64ab65..931353dc60 100644 --- a/erpnext/translations/ta.csv +++ b/erpnext/translations/ta.csv @@ -1458,8 +1458,8 @@ Jobs Email Settings,வேலைகள் மின்னஞ்சல் அம Journal Entries,ஜர்னல் பதிவுகள் Journal Entry,பத்திரிகை நுழைவு Journal Voucher,பத்திரிகை வவுச்சர் -Journal Voucher Detail,பத்திரிகை வவுச்சர் விரிவாக -Journal Voucher Detail No,பத்திரிகை வவுச்சர் விரிவாக இல்லை +Journal Entry Account,பத்திரிகை வவுச்சர் விரிவாக +Journal Entry Account No,பத்திரிகை வவுச்சர் விரிவாக இல்லை Journal Voucher {0} does not have account {1} or already matched,ஜர்னல் வவுச்சர் {0} கணக்கு இல்லை {1} அல்லது ஏற்கனவே பொருந்தியது Journal Vouchers {0} are un-linked,ஜர்னல் கே {0} ஐ.நா. இணைக்கப்பட்ட Keep a track of communication related to this enquiry which will help for future reference.,எதிர்கால உதவும் இந்த விசாரணை தொடர்பான தகவல் ஒரு கண்காணிக்க. diff --git a/erpnext/translations/th.csv b/erpnext/translations/th.csv index 4e1a1859be..b1b0ebd66d 100644 --- a/erpnext/translations/th.csv +++ b/erpnext/translations/th.csv @@ -1458,8 +1458,8 @@ Jobs Email Settings,งานการตั้งค่าอีเมล Journal Entries,บันทึกรายการแบบรวม Journal Entry,บันทึกรายการค้า Journal Voucher,บัตรกำนัลวารสาร -Journal Voucher Detail,รายละเอียดใบสำคัญรายวันทั่วไป -Journal Voucher Detail No,รายละเอียดใบสำคัญรายวันทั่วไปไม่มี +Journal Entry Account,รายละเอียดใบสำคัญรายวันทั่วไป +Journal Entry Account No,รายละเอียดใบสำคัญรายวันทั่วไปไม่มี Journal Voucher {0} does not have account {1} or already matched,ใบสำคัญรายวันทั่วไป {0} ไม่ได้มี บัญชี {1} หรือ การจับคู่ แล้ว Journal Vouchers {0} are un-linked,ใบสำคัญรายวันทั่วไป {0} จะ ยกเลิกการ เชื่อมโยง Keep a track of communication related to this enquiry which will help for future reference.,ติดตามของการสื่อสารที่เกี่ยวข้องกับการสืบสวนเรื่องนี้ซึ่งจะช่วยให้สำหรับการอ้างอิงในอนาคต diff --git a/erpnext/translations/tr.csv b/erpnext/translations/tr.csv index e3ed446347..a2d444343e 100644 --- a/erpnext/translations/tr.csv +++ b/erpnext/translations/tr.csv @@ -1458,8 +1458,8 @@ Jobs Email Settings,İş E-posta Ayarları Journal Entries,Alacak/Borç Girişleri Journal Entry,Alacak/Borç Girişleri Journal Voucher,Alacak/Borç Çeki -Journal Voucher Detail,Alacak/Borç Fiş Detay -Journal Voucher Detail No,Alacak/Borç Fiş Detay No +Journal Entry Account,Alacak/Borç Fiş Detay +Journal Entry Account No,Alacak/Borç Fiş Detay No Journal Voucher {0} does not have account {1} or already matched,Dergi Çeki {0} hesabı yok {1} ya da zaten eşleşti Journal Vouchers {0} are un-linked,Dergi Fişler {0} un-bağlantılı Keep a track of communication related to this enquiry which will help for future reference.,Gelecekte başvurulara yardımcı olmak için bu soruşturma ile ilgili bir iletişim takip edin. diff --git a/erpnext/translations/vi.csv b/erpnext/translations/vi.csv index 8a6de8c541..0fb6f524b9 100644 --- a/erpnext/translations/vi.csv +++ b/erpnext/translations/vi.csv @@ -1458,8 +1458,8 @@ Jobs Email Settings,Thiết lập việc làm Email Journal Entries,Tạp chí Entries Journal Entry,Tạp chí nhập Journal Voucher,Tạp chí Voucher -Journal Voucher Detail,Tạp chí Chứng từ chi tiết -Journal Voucher Detail No,Tạp chí Chứng từ chi tiết Không +Journal Entry Account,Tạp chí Chứng từ chi tiết +Journal Entry Account No,Tạp chí Chứng từ chi tiết Không Journal Voucher {0} does not have account {1} or already matched,Tạp chí Chứng từ {0} không có tài khoản {1} hoặc đã khớp Journal Vouchers {0} are un-linked,Tạp chí Chứng từ {0} được bỏ liên kết Keep a track of communication related to this enquiry which will help for future reference.,Giữ một ca khúc của truyền thông liên quan đến cuộc điều tra này sẽ giúp cho tài liệu tham khảo trong tương lai. diff --git a/erpnext/translations/zh-cn.csv b/erpnext/translations/zh-cn.csv index 36a4473be0..de66f9046f 100644 --- a/erpnext/translations/zh-cn.csv +++ b/erpnext/translations/zh-cn.csv @@ -1490,8 +1490,8 @@ Jobs Email Settings,乔布斯邮件设置 Journal Entries,日记帐分录 Journal Entry,日记帐分录 Journal Voucher,期刊券 -Journal Voucher Detail,日记帐凭证详细信息 -Journal Voucher Detail No,日记帐凭证详细说明暂无 +Journal Entry Account,日记帐凭证详细信息 +Journal Entry Account No,日记帐凭证详细说明暂无 Journal Voucher {0} does not have account {1} or already matched,记账凭单{0}没有帐号{1}或已经匹配 Journal Vouchers {0} are un-linked,日记帐凭单{0}被取消链接 Keep a track of communication related to this enquiry which will help for future reference.,保持跟踪的沟通与此相关的调查,这将有助于以供将来参考。 diff --git a/erpnext/translations/zh-tw.csv b/erpnext/translations/zh-tw.csv index 609806b417..92936a4e40 100644 --- a/erpnext/translations/zh-tw.csv +++ b/erpnext/translations/zh-tw.csv @@ -1490,8 +1490,8 @@ Jobs Email Settings,喬布斯郵件設置 Journal Entries,日記帳分錄 Journal Entry,日記帳分錄 Journal Voucher,期刊券 -Journal Voucher Detail,日記帳憑證詳細信息 -Journal Voucher Detail No,日記帳憑證詳細說明暫無 +Journal Entry Account,日記帳憑證詳細信息 +Journal Entry Account No,日記帳憑證詳細說明暫無 Journal Voucher {0} does not have account {1} or already matched,記賬憑單{0}沒有帳號{1}或已經匹配 Journal Vouchers {0} are un-linked,日記帳憑單{0}被取消鏈接 Keep a track of communication related to this enquiry which will help for future reference.,保持跟踪的溝通與此相關的調查,這將有助於以供將來參考。 diff --git a/erpnext/utilities/transaction_base.py b/erpnext/utilities/transaction_base.py index 4ba162790c..8306eacb06 100644 --- a/erpnext/utilities/transaction_base.py +++ b/erpnext/utilities/transaction_base.py @@ -48,7 +48,7 @@ class TransactionBase(StatusUpdater): }) if frappe.db.exists("User", self.contact_by): - event_doclist.append("event_individuals", { + event_doclist.append("users", { "doctype": "Event User", "person": self.contact_by })