From 6e343e23d912617a9c30c370328808f695a94efd Mon Sep 17 00:00:00 2001 From: Neil Trini Lasrado Date: Wed, 9 Mar 2016 17:02:59 +0530 Subject: [PATCH] Renamed project_name to project --- .../purchase_invoice/purchase_invoice.js | 4 +- .../purchase_invoice/purchase_invoice.py | 10 +-- .../purchase_invoice/test_purchase_invoice.py | 8 +- .../purchase_invoice_item.json | 7 +- .../doctype/sales_invoice/sales_invoice.js | 6 +- .../doctype/sales_invoice/sales_invoice.json | 6 +- .../doctype/sales_invoice/sales_invoice.py | 10 +-- .../delivered_items_to_be_billed.json | 2 +- .../report/gross_profit/gross_profit.py | 8 +- .../item_wise_purchase_register.py | 4 +- .../item_wise_sales_register.py | 4 +- .../ordered_items_to_be_billed.json | 2 +- .../purchase_order_items_to_be_billed.json | 2 +- .../purchase_register/purchase_register.py | 10 +-- .../received_items_to_be_billed.json | 2 +- .../report/sales_register/sales_register.py | 4 +- .../purchase_common/purchase_common.js | 12 +-- .../doctype/purchase_order/purchase_order.js | 2 +- .../doctype/purchase_order/purchase_order.py | 2 +- .../purchase_order_item.json | 6 +- .../supplier_quotation/supplier_quotation.js | 2 +- .../supplier_quotation_item.json | 6 +- .../item_wise_purchase_history.json | 2 +- erpnext/controllers/stock_controller.py | 2 +- erpnext/controllers/trends.py | 10 +-- erpnext/manufacturing/doctype/bom/bom.js | 2 +- erpnext/manufacturing/doctype/bom/bom.json | 70 ++++++++++++++- .../production_order/production_order.js | 2 +- .../production_order/production_order.json | 48 +++++++++- .../production_order/production_order.py | 2 +- erpnext/patches.txt | 1 + .../v5_0/index_on_account_and_gl_entry.py | 2 +- .../update_purchase_cost_against_project.py | 2 +- .../v6_20x/rename_project_name_to_project.py | 17 ++++ erpnext/projects/doctype/project/project.js | 2 +- erpnext/projects/doctype/project/project.json | 38 +++++++- erpnext/projects/doctype/project/project.py | 6 +- .../doctype/time_log/test_time_log.py | 8 +- .../project_wise_stock_tracking.py | 30 +++---- erpnext/public/js/controllers/transaction.js | 2 +- erpnext/public/js/feature_setup.js | 24 ++--- .../doctype/sales_order/sales_order.js | 4 +- .../doctype/sales_order/sales_order.json | 8 +- .../doctype/sales_order/sales_order.py | 6 +- .../item_wise_sales_history.json | 2 +- erpnext/selling/sales_common.js | 4 +- .../doctype/delivery_note/delivery_note.js | 6 +- .../doctype/delivery_note/delivery_note.json | 8 +- .../doctype/delivery_note/delivery_note.py | 8 +- erpnext/stock/doctype/item/item.json | 88 ++++++++++++++++++- .../purchase_receipt/purchase_receipt.js | 2 +- .../purchase_receipt/purchase_receipt.py | 2 +- .../purchase_receipt_item.json | 6 +- .../doctype/stock_entry/stock_entry.json | 8 +- .../stock/doctype/stock_entry/stock_entry.py | 2 +- erpnext/stock/get_item_details.py | 4 +- .../ordered_items_to_be_delivered.json | 2 +- .../purchase_order_items_to_be_received.json | 2 +- 58 files changed, 396 insertions(+), 155 deletions(-) create mode 100644 erpnext/patches/v6_20x/rename_project_name_to_project.py diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js index 50a50d9042..4d865b8de8 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.js @@ -118,7 +118,7 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({ items_add: function(doc, cdt, cdn) { var row = frappe.get_doc(cdt, cdn); this.frm.script_manager.copy_from_first_row("items", row, - ["expense_account", "cost_center", "project_name"]); + ["expense_account", "cost_center", "project"]); }, on_submit: function() { @@ -242,7 +242,7 @@ cur_frm.cscript.cost_center = function(doc, cdt, cdn){ refresh_field('items'); } -cur_frm.fields_dict['items'].grid.get_field('project_name').get_query = function(doc, cdt, cdn) { +cur_frm.fields_dict['items'].grid.get_field('project').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 7e18f7ee1d..bbb0cf73ab 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice.py @@ -121,7 +121,7 @@ class PurchaseInvoice(BuyingController): }, "Purchase Order Item": { "ref_dn_field": "po_detail", - "compare_fields": [["project_name", "="], ["item_code", "="], ["uom", "="]], + "compare_fields": [["project", "="], ["item_code", "="], ["uom", "="]], "is_child_table": True, "allow_duplicate_prev_row_id": True }, @@ -131,7 +131,7 @@ class PurchaseInvoice(BuyingController): }, "Purchase Receipt Item": { "ref_dn_field": "pr_detail", - "compare_fields": [["project_name", "="], ["item_code", "="], ["uom", "="]], + "compare_fields": [["project", "="], ["item_code", "="], ["uom", "="]], "is_child_table": True } }) @@ -421,12 +421,12 @@ class PurchaseInvoice(BuyingController): def update_project(self): project_list = [] for d in self.items: - if d.project_name and d.project_name not in project_list: - project = frappe.get_doc("Project", d.project_name) + if d.project and d.project not in project_list: + project = frappe.get_doc("Project", d.project) project.flags.dont_sync_tasks = True project.update_purchase_costing() project.save() - project_list.append(d.project_name) + project_list.append(d.project) def validate_supplier_invoice(self): if self.bill_date: diff --git a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py index d2de9646c3..b0ac627f5f 100644 --- a/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py +++ b/erpnext/accounts/doctype/purchase_invoice/test_purchase_invoice.py @@ -222,14 +222,14 @@ class TestPurchaseInvoice(unittest.TestCase): def test_total_purchase_cost_for_project(self): existing_purchase_cost = frappe.db.sql("""select sum(base_net_amount) - from `tabPurchase Invoice Item` where project_name = '_Test Project' and docstatus=1""") + from `tabPurchase Invoice Item` where project = '_Test Project' and docstatus=1""") existing_purchase_cost = existing_purchase_cost and existing_purchase_cost[0][0] or 0 - pi = make_purchase_invoice(currency="USD", conversion_rate=60, project_name="_Test Project") + pi = make_purchase_invoice(currency="USD", conversion_rate=60, project="_Test Project") self.assertEqual(frappe.db.get_value("Project", "_Test Project", "total_purchase_cost"), existing_purchase_cost + 15000) - pi1 = make_purchase_invoice(qty=10, project_name="_Test Project") + pi1 = make_purchase_invoice(qty=10, project="_Test Project") self.assertEqual(frappe.db.get_value("Project", "_Test Project", "total_purchase_cost"), existing_purchase_cost + 15500) @@ -338,7 +338,7 @@ def make_purchase_invoice(**args): "serial_no": args.serial_no, "stock_uom": "_Test UOM", "cost_center": "_Test Cost Center - _TC", - "project_name": args.project_name + "project": args.project }) if not args.do_not_save: pi.insert() diff --git a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json index bccecb9162..687b84bba5 100755 --- a/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json +++ b/erpnext/accounts/doctype/purchase_invoice_item/purchase_invoice_item.json @@ -7,6 +7,7 @@ "custom": 0, "docstatus": 0, "doctype": "DocType", + "document_type": "Document", "fields": [ { "allow_on_submit": 0, @@ -842,14 +843,14 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, - "fieldname": "project_name", + "fieldname": "project", "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 0, - "label": "Project Name", + "label": "Project", "length": 0, "no_copy": 0, "options": "Project", @@ -1238,7 +1239,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2016-02-22 09:32:17.205040", + "modified": "2016-03-10 05:05:27.752823", "modified_by": "Administrator", "module": "Accounts", "name": "Purchase Invoice Item", diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js index d4d00ffec8..29461842e7 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.js @@ -278,7 +278,7 @@ $.extend(cur_frm.cscript, new erpnext.accounts.SalesInvoiceController({frm: cur_ // Hide Fields // ------------ cur_frm.cscript.hide_fields = function(doc) { - par_flds = ['project_name', 'due_date', 'is_opening', 'source', 'total_advance', 'get_advances_received', + par_flds = ['project', 'due_date', 'is_opening', 'source', 'total_advance', 'get_advances_received', 'advances', 'sales_partner', 'commission_rate', 'total_commission', 'advances', 'from_date', 'to_date']; if(cint(doc.is_pos) == 1) { @@ -381,9 +381,9 @@ cur_frm.fields_dict.write_off_cost_center.get_query = function(doc) { //project name //-------------------------- -cur_frm.fields_dict['project_name'].get_query = function(doc, cdt, cdn) { +cur_frm.fields_dict['project'].get_query = function(doc, cdt, cdn) { return{ - query: "erpnext.controllers.queries.get_project_name", + query: "erpnext.controllers.queries.get_project", filters: {'customer': doc.customer} } } diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json index 6f57a349b6..e640ad21be 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.json +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.json @@ -2363,14 +2363,14 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, - "fieldname": "project_name", + "fieldname": "project", "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 0, - "label": "Project Name", + "label": "Project", "length": 0, "no_copy": 0, "oldfieldname": "project_name", @@ -3418,7 +3418,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2016-03-14 19:02:25.882750", + "modified": "2016-03-15 19:02:25.882750", "modified_by": "Administrator", "module": "Accounts", "name": "Sales Invoice", diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index e120f18b3a..5a294247f3 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -323,12 +323,12 @@ class SalesInvoice(SellingController): super(SalesInvoice, self).validate_with_previous_doc({ "Sales Order": { "ref_dn_field": "sales_order", - "compare_fields": [["customer", "="], ["company", "="], ["project_name", "="], + "compare_fields": [["customer", "="], ["company", "="], ["project", "="], ["currency", "="]], }, "Delivery Note": { "ref_dn_field": "delivery_note", - "compare_fields": [["customer", "="], ["company", "="], ["project_name", "="], + "compare_fields": [["customer", "="], ["company", "="], ["project", "="], ["currency", "="]], }, }) @@ -365,12 +365,12 @@ class SalesInvoice(SellingController): def validate_proj_cust(self): """check for does customer belong to same project as entered..""" - if self.project_name and self.customer: + if self.project and self.customer: res = frappe.db.sql("""select name from `tabProject` where name = %s and (customer = %s or customer is null or customer = '')""", - (self.project_name, self.customer)) + (self.project, self.customer)) if not res: - throw(_("Customer {0} does not belong to project {1}").format(self.customer,self.project_name)) + throw(_("Customer {0} does not belong to project {1}").format(self.customer,self.project)) def validate_pos(self): if not self.cash_bank_account and flt(self.paid_amount): diff --git a/erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.json b/erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.json index 41e42f7394..41b7dd1544 100644 --- a/erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.json +++ b/erpnext/accounts/report/delivered_items_to_be_billed/delivered_items_to_be_billed.json @@ -12,7 +12,7 @@ "module": "Accounts", "name": "Delivered Items To Be Billed", "owner": "Administrator", - "query": "select\n `tabDelivery Note`.`name` as \"Delivery Note:Link/Delivery Note:120\",\n\t`tabDelivery Note`.`customer` as \"Customer:Link/Customer:120\",\n\t`tabDelivery Note`.`posting_date` as \"Date:Date\",\n\t`tabDelivery Note`.`project_name` as \"Project\",\n\t`tabDelivery Note Item`.`item_code` as \"Item:Link/Item:120\",\n\t(`tabDelivery Note Item`.`qty` - ifnull((select sum(qty) from `tabSales Invoice Item` \n\t where `tabSales Invoice Item`.docstatus=1 and \n `tabSales Invoice Item`.delivery_note = `tabDelivery Note`.name and\n\t `tabSales Invoice Item`.dn_detail = `tabDelivery Note Item`.name), 0))\n\t\tas \"Qty:Float:110\",\n\t(`tabDelivery Note Item`.`base_amount` - ifnull((select sum(base_amount) from `tabSales Invoice Item` \n where `tabSales Invoice Item`.docstatus=1 and \n `tabSales Invoice Item`.delivery_note = `tabDelivery Note`.name and\n `tabSales Invoice Item`.dn_detail = `tabDelivery Note Item`.name), 0))\n\t\tas \"Amount:Currency:110\",\n\t`tabDelivery Note Item`.`item_name` as \"Item Name::150\",\n\t`tabDelivery Note Item`.`description` as \"Description::200\",\n\t`tabDelivery Note`.`company` as \"Company:Link/Company:\"\nfrom `tabDelivery Note`, `tabDelivery Note Item`\nwhere\n `tabDelivery Note`.docstatus = 1 and\n\t`tabDelivery Note`.`status` not in (\"Stopped\", \"Closed\") and\n `tabDelivery Note`.name = `tabDelivery Note Item`.parent and\n (`tabDelivery Note Item`.qty > ifnull((select sum(qty) from `tabSales Invoice Item` \n where `tabSales Invoice Item`.docstatus=1 and \n `tabSales Invoice Item`.delivery_note = `tabDelivery Note`.name and\n `tabSales Invoice Item`.dn_detail = `tabDelivery Note Item`.name), 0))\norder by `tabDelivery Note`.`name` desc", + "query": "select\n `tabDelivery Note`.`name` as \"Delivery Note:Link/Delivery Note:120\",\n\t`tabDelivery Note`.`customer` as \"Customer:Link/Customer:120\",\n\t`tabDelivery Note`.`posting_date` as \"Date:Date\",\n\t`tabDelivery Note`.`project` as \"Project\",\n\t`tabDelivery Note Item`.`item_code` as \"Item:Link/Item:120\",\n\t(`tabDelivery Note Item`.`qty` - ifnull((select sum(qty) from `tabSales Invoice Item` \n\t where `tabSales Invoice Item`.docstatus=1 and \n `tabSales Invoice Item`.delivery_note = `tabDelivery Note`.name and\n\t `tabSales Invoice Item`.dn_detail = `tabDelivery Note Item`.name), 0))\n\t\tas \"Qty:Float:110\",\n\t(`tabDelivery Note Item`.`base_amount` - ifnull((select sum(base_amount) from `tabSales Invoice Item` \n where `tabSales Invoice Item`.docstatus=1 and \n `tabSales Invoice Item`.delivery_note = `tabDelivery Note`.name and\n `tabSales Invoice Item`.dn_detail = `tabDelivery Note Item`.name), 0))\n\t\tas \"Amount:Currency:110\",\n\t`tabDelivery Note Item`.`item_name` as \"Item Name::150\",\n\t`tabDelivery Note Item`.`description` as \"Description::200\",\n\t`tabDelivery Note`.`company` as \"Company:Link/Company:\"\nfrom `tabDelivery Note`, `tabDelivery Note Item`\nwhere\n `tabDelivery Note`.docstatus = 1 and\n\t`tabDelivery Note`.`status` not in (\"Stopped\", \"Closed\") and\n `tabDelivery Note`.name = `tabDelivery Note Item`.parent and\n (`tabDelivery Note Item`.qty > ifnull((select sum(qty) from `tabSales Invoice Item` \n where `tabSales Invoice Item`.docstatus=1 and \n `tabSales Invoice Item`.delivery_note = `tabDelivery Note`.name and\n `tabSales Invoice Item`.dn_detail = `tabDelivery Note Item`.name), 0))\norder by `tabDelivery Note`.`name` desc", "ref_doctype": "Sales Invoice", "report_name": "Delivered Items To Be Billed", "report_type": "Query Report" diff --git a/erpnext/accounts/report/gross_profit/gross_profit.py b/erpnext/accounts/report/gross_profit/gross_profit.py index 7185acd920..ba87cf1c14 100644 --- a/erpnext/accounts/report/gross_profit/gross_profit.py +++ b/erpnext/accounts/report/gross_profit/gross_profit.py @@ -18,7 +18,7 @@ def execute(filters=None): group_wise_columns = frappe._dict({ "invoice": ["parent", "customer", "posting_date","item_code", "item_name","item_group", "brand", "description", \ "warehouse", "qty", "base_rate", "buying_rate", "base_amount", - "buying_amount", "gross_profit", "gross_profit_percent", "project_name"], + "buying_amount", "gross_profit", "gross_profit_percent", "project"], "item_code": ["item_code", "item_name", "brand", "description", "qty", "base_rate", "buying_rate", "base_amount", "buying_amount", "gross_profit", "gross_profit_percent"], "warehouse": ["warehouse", "qty", "base_rate", "buying_rate", "base_amount", "buying_amount", @@ -35,7 +35,7 @@ def execute(filters=None): "gross_profit", "gross_profit_percent"], "sales_person": ["sales_person", "allocated_amount", "qty", "base_rate", "buying_rate", "base_amount", "buying_amount", "gross_profit", "gross_profit_percent"], - "project": ["project_name", "base_amount", "buying_amount", "gross_profit", "gross_profit_percent"], + "project": ["project", "base_amount", "buying_amount", "gross_profit", "gross_profit_percent"], "territory": ["territory", "base_amount", "buying_amount", "gross_profit", "gross_profit_percent"] }) @@ -70,7 +70,7 @@ def get_columns(group_wise_columns, filters): "buying_amount": _("Buying Amount") + ":Currency/currency", "gross_profit": _("Gross Profit") + ":Currency/currency", "gross_profit_percent": _("Gross Profit %") + ":Percent", - "project_name": _("Project") + ":Link/Project", + "project": _("Project") + ":Link/Project", "sales_person": _("Sales person"), "allocated_amount": _("Allocated Amount") + ":Currency/currency", "customer": _("Customer") + ":Link/Customer", @@ -233,7 +233,7 @@ class GrossProfitGenerator(object): conditions += " and posting_date <= %(to_date)s" self.si_list = frappe.db.sql("""select item.parenttype, item.parent, - si.posting_date, si.posting_time, si.project_name, si.update_stock, + si.posting_date, si.posting_time, si.project, si.update_stock, si.customer, si.customer_group, si.territory, item.item_code, item.item_name, item.description, item.warehouse, item.item_group, item.brand, item.dn_detail, item.delivery_note, diff --git a/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py b/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py index 122b2396eb..7be5649aa2 100644 --- a/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py +++ b/erpnext/accounts/report/item_wise_purchase_register/item_wise_purchase_register.py @@ -27,7 +27,7 @@ def execute(filters=None): expense_account = d.expense_account or aii_account_map.get(d.company) row = [d.item_code, d.item_name, d.item_group, d.parent, d.posting_date, d.supplier, - d.supplier_name, d.credit_to, d.project_name, d.company, d.purchase_order, + d.supplier_name, d.credit_to, d.project, d.company, d.purchase_order, purchase_receipt, expense_account, d.qty, d.base_net_rate, d.base_net_amount] for tax in tax_accounts: @@ -69,7 +69,7 @@ def get_items(filters): return frappe.db.sql("""select pi_item.parent, pi.posting_date, pi.credit_to, pi.company, pi.supplier, pi.remarks, pi.base_net_total, pi_item.item_code, pi_item.item_name, pi_item.item_group, - pi_item.project_name, pi_item.purchase_order, pi_item.purchase_receipt, pi_item.po_detail, + pi_item.project, pi_item.purchase_order, pi_item.purchase_receipt, pi_item.po_detail, pi_item.expense_account, pi_item.qty, pi_item.base_net_rate, pi_item.base_net_amount, pi.supplier_name from `tabPurchase Invoice` pi, `tabPurchase Invoice Item` pi_item where pi.name = pi_item.parent and pi.docstatus = 1 %s %s diff --git a/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py b/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py index b8afa9f915..e3c475303e 100644 --- a/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py +++ b/erpnext/accounts/report/item_wise_sales_register/item_wise_sales_register.py @@ -25,7 +25,7 @@ def execute(filters=None): from `tabDelivery Note Item` where docstatus=1 and so_detail=%s""", d.so_detail)) row = [d.item_code, d.item_name, d.item_group, d.parent, d.posting_date, d.customer, d.customer_name, - d.customer_group, d.debit_to, d.territory, d.project_name, d.company, d.sales_order, + d.customer_group, d.debit_to, d.territory, d.project, d.company, d.sales_order, delivery_note, d.income_account, d.qty, d.base_net_rate, d.base_net_amount] for tax in tax_accounts: @@ -66,7 +66,7 @@ def get_conditions(filters): def get_items(filters): conditions = get_conditions(filters) - return frappe.db.sql("""select si_item.parent, si.posting_date, si.debit_to, si.project_name, + return frappe.db.sql("""select si_item.parent, si.posting_date, si.debit_to, si.project, si.customer, si.remarks, si.territory, si.company, si.base_net_total, si_item.item_code, si_item.item_name, si_item.item_group, si_item.sales_order, si_item.delivery_note, si_item.income_account, si_item.qty, si_item.base_net_rate, si_item.base_net_amount, si.customer_name, diff --git a/erpnext/accounts/report/ordered_items_to_be_billed/ordered_items_to_be_billed.json b/erpnext/accounts/report/ordered_items_to_be_billed/ordered_items_to_be_billed.json index a0be2571f2..8f41ac45f0 100644 --- a/erpnext/accounts/report/ordered_items_to_be_billed/ordered_items_to_be_billed.json +++ b/erpnext/accounts/report/ordered_items_to_be_billed/ordered_items_to_be_billed.json @@ -12,7 +12,7 @@ "module": "Accounts", "name": "Ordered Items To Be Billed", "owner": "Administrator", - "query": "select \n `tabSales Order`.`name` as \"Sales Order:Link/Sales Order:120\",\n `tabSales Order`.`customer` as \"Customer:Link/Customer:120\",\n `tabSales Order`.`status` as \"Status\",\n `tabSales Order`.`transaction_date` as \"Date:Date\",\n `tabSales Order`.`project_name` as \"Project\",\n `tabSales Order Item`.item_code as \"Item:Link/Item:120\",\n `tabSales Order Item`.base_amount as \"Amount:Currency:110\",\n (`tabSales Order Item`.billed_amt * ifnull(`tabSales Order`.conversion_rate, 1)) as \"Billed Amount:Currency:110\",\n (ifnull(`tabSales Order Item`.base_amount, 0) - (ifnull(`tabSales Order Item`.billed_amt, 0) * ifnull(`tabSales Order`.conversion_rate, 1))) as \"Pending Amount:Currency:120\",\n `tabSales Order Item`.item_name as \"Item Name::150\",\n `tabSales Order Item`.description as \"Description::200\",\n `tabSales Order`.`company` as \"Company:Link/Company:\"\nfrom\n `tabSales Order`, `tabSales Order Item`\nwhere\n `tabSales Order Item`.`parent` = `tabSales Order`.`name`\n and `tabSales Order`.docstatus = 1\n and `tabSales Order`.status != \"Closed\"\n and ifnull(`tabSales Order Item`.billed_amt,0) < ifnull(`tabSales Order Item`.amount,0)\norder by `tabSales Order`.transaction_date asc", + "query": "select \n `tabSales Order`.`name` as \"Sales Order:Link/Sales Order:120\",\n `tabSales Order`.`customer` as \"Customer:Link/Customer:120\",\n `tabSales Order`.`status` as \"Status\",\n `tabSales Order`.`transaction_date` as \"Date:Date\",\n `tabSales Order`.`project` as \"Project\",\n `tabSales Order Item`.item_code as \"Item:Link/Item:120\",\n `tabSales Order Item`.base_amount as \"Amount:Currency:110\",\n (`tabSales Order Item`.billed_amt * ifnull(`tabSales Order`.conversion_rate, 1)) as \"Billed Amount:Currency:110\",\n (ifnull(`tabSales Order Item`.base_amount, 0) - (ifnull(`tabSales Order Item`.billed_amt, 0) * ifnull(`tabSales Order`.conversion_rate, 1))) as \"Pending Amount:Currency:120\",\n `tabSales Order Item`.item_name as \"Item Name::150\",\n `tabSales Order Item`.description as \"Description::200\",\n `tabSales Order`.`company` as \"Company:Link/Company:\"\nfrom\n `tabSales Order`, `tabSales Order Item`\nwhere\n `tabSales Order Item`.`parent` = `tabSales Order`.`name`\n and `tabSales Order`.docstatus = 1\n and `tabSales Order`.status != \"Closed\"\n and ifnull(`tabSales Order Item`.billed_amt,0) < ifnull(`tabSales Order Item`.amount,0)\norder by `tabSales Order`.transaction_date asc", "ref_doctype": "Sales Invoice", "report_name": "Ordered Items To Be Billed", "report_type": "Query Report" diff --git a/erpnext/accounts/report/purchase_order_items_to_be_billed/purchase_order_items_to_be_billed.json b/erpnext/accounts/report/purchase_order_items_to_be_billed/purchase_order_items_to_be_billed.json index 5f67309db4..c5314e60a8 100644 --- a/erpnext/accounts/report/purchase_order_items_to_be_billed/purchase_order_items_to_be_billed.json +++ b/erpnext/accounts/report/purchase_order_items_to_be_billed/purchase_order_items_to_be_billed.json @@ -12,7 +12,7 @@ "module": "Accounts", "name": "Purchase Order Items To Be Billed", "owner": "Administrator", - "query": "select \n `tabPurchase Order`.`name` as \"Purchase Order:Link/Purchase Order:120\",\n `tabPurchase Order`.`transaction_date` as \"Date:Date:100\",\n\t`tabPurchase Order`.`supplier` as \"Supplier:Link/Supplier:120\",\n\t`tabPurchase Order Item`.`project_name` as \"Project\",\n\t`tabPurchase Order Item`.item_code as \"Item Code:Link/Item:120\",\n\t`tabPurchase Order Item`.base_amount as \"Amount:Currency:100\",\n\t(`tabPurchase Order Item`.billed_amt * ifnull(`tabPurchase Order`.conversion_rate, 1)) as \"Billed Amount:Currency:100\", \n\t(`tabPurchase Order Item`.base_amount - (ifnull(`tabPurchase Order Item`.billed_amt, 0) * ifnull(`tabPurchase Order`.conversion_rate, 1))) as \"Amount to Bill:Currency:100\",\n\t`tabPurchase Order Item`.item_name as \"Item Name::150\",\n\t`tabPurchase Order Item`.description as \"Description::200\",\n\t`tabPurchase Order`.company as \"Company:Link/Company:\"\nfrom\n\t`tabPurchase Order`, `tabPurchase Order Item`\nwhere\n\t`tabPurchase Order Item`.`parent` = `tabPurchase Order`.`name`\n\tand `tabPurchase Order`.docstatus = 1\n\tand `tabPurchase Order`.status != \"Closed\"\n\tand (ifnull(`tabPurchase Order Item`.billed_amt, 0) * ifnull(`tabPurchase Order`.conversion_rate, 1)) < ifnull(`tabPurchase Order Item`.base_amount, 0)\norder by `tabPurchase Order`.transaction_date asc", + "query": "select \n `tabPurchase Order`.`name` as \"Purchase Order:Link/Purchase Order:120\",\n `tabPurchase Order`.`transaction_date` as \"Date:Date:100\",\n\t`tabPurchase Order`.`supplier` as \"Supplier:Link/Supplier:120\",\n\t`tabPurchase Order Item`.`project` as \"Project\",\n\t`tabPurchase Order Item`.item_code as \"Item Code:Link/Item:120\",\n\t`tabPurchase Order Item`.base_amount as \"Amount:Currency:100\",\n\t(`tabPurchase Order Item`.billed_amt * ifnull(`tabPurchase Order`.conversion_rate, 1)) as \"Billed Amount:Currency:100\", \n\t(`tabPurchase Order Item`.base_amount - (ifnull(`tabPurchase Order Item`.billed_amt, 0) * ifnull(`tabPurchase Order`.conversion_rate, 1))) as \"Amount to Bill:Currency:100\",\n\t`tabPurchase Order Item`.item_name as \"Item Name::150\",\n\t`tabPurchase Order Item`.description as \"Description::200\",\n\t`tabPurchase Order`.company as \"Company:Link/Company:\"\nfrom\n\t`tabPurchase Order`, `tabPurchase Order Item`\nwhere\n\t`tabPurchase Order Item`.`parent` = `tabPurchase Order`.`name`\n\tand `tabPurchase Order`.docstatus = 1\n\tand `tabPurchase Order`.status != \"Closed\"\n\tand (ifnull(`tabPurchase Order Item`.billed_amt, 0) * ifnull(`tabPurchase Order`.conversion_rate, 1)) < ifnull(`tabPurchase Order Item`.base_amount, 0)\norder by `tabPurchase Order`.transaction_date asc", "ref_doctype": "Purchase Invoice", "report_name": "Purchase Order Items To Be Billed", "report_type": "Query Report" diff --git a/erpnext/accounts/report/purchase_register/purchase_register.py b/erpnext/accounts/report/purchase_register/purchase_register.py index cad1f1997f..c8698030e7 100644 --- a/erpnext/accounts/report/purchase_register/purchase_register.py +++ b/erpnext/accounts/report/purchase_register/purchase_register.py @@ -27,11 +27,11 @@ def execute(filters=None): # invoice details purchase_order = list(set(invoice_po_pr_map.get(inv.name, {}).get("purchase_order", []))) purchase_receipt = list(set(invoice_po_pr_map.get(inv.name, {}).get("purchase_receipt", []))) - project_name = list(set(invoice_po_pr_map.get(inv.name, {}).get("project_name", []))) + project = list(set(invoice_po_pr_map.get(inv.name, {}).get("project", []))) row = [inv.name, inv.posting_date, inv.supplier, inv.supplier_name, supplier_details.get(inv.supplier), - inv.credit_to, ", ".join(project_name), inv.bill_no, inv.bill_date, inv.remarks, + inv.credit_to, ", ".join(project), inv.bill_no, inv.bill_date, inv.remarks, ", ".join(purchase_order), ", ".join(purchase_receipt)] # map expense values @@ -146,7 +146,7 @@ def get_invoice_tax_map(invoice_list, invoice_expense_map, expense_accounts): def get_invoice_po_pr_map(invoice_list): pi_items = frappe.db.sql("""select parent, purchase_order, purchase_receipt, po_detail, - project_name from `tabPurchase Invoice Item` where parent in (%s) + project from `tabPurchase Invoice Item` where parent in (%s) and (ifnull(purchase_order, '') != '' or ifnull(purchase_receipt, '') != '')""" % ', '.join(['%s']*len(invoice_list)), tuple([inv.name for inv in invoice_list]), as_dict=1) @@ -166,9 +166,9 @@ def get_invoice_po_pr_map(invoice_list): if pr_list: invoice_po_pr_map.setdefault(d.parent, frappe._dict()).setdefault("purchase_receipt", pr_list) - if d.project_name: + if d.project: invoice_po_pr_map.setdefault(d.parent, frappe._dict()).setdefault( - "project_name", []).append(d.project_name) + "project", []).append(d.project) return invoice_po_pr_map diff --git a/erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.json b/erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.json index 97b0985cca..0b8597d204 100644 --- a/erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.json +++ b/erpnext/accounts/report/received_items_to_be_billed/received_items_to_be_billed.json @@ -12,7 +12,7 @@ "module": "Accounts", "name": "Received Items To Be Billed", "owner": "Administrator", - "query": "select\n `tabPurchase Receipt`.`name` as \"Purchase Receipt:Link/Purchase Receipt:120\",\n `tabPurchase Receipt`.`supplier` as \"Supplier:Link/Supplier:120\",\n\t`tabPurchase Receipt`.`posting_date` as \"Date:Date\",\n\t`tabPurchase Receipt Item`.`project_name` as \"Project\",\n\t`tabPurchase Receipt Item`.`item_code` as \"Item:Link/Item:120\",\n\t(`tabPurchase Receipt Item`.`qty` - ifnull((select sum(qty) from `tabPurchase Invoice Item` \n\t where `tabPurchase Invoice Item`.purchase_receipt = `tabPurchase Receipt`.name and\n `tabPurchase Invoice Item`.docstatus = 1 and\n\t `tabPurchase Invoice Item`.pr_detail = `tabPurchase Receipt Item`.name), 0))\n\t as \"Qty:Float:110\",\n\t(`tabPurchase Receipt Item`.`base_amount` - ifnull((select sum(base_amount) \n from `tabPurchase Invoice Item` \n where `tabPurchase Invoice Item`.purchase_receipt = `tabPurchase Receipt`.name and\n `tabPurchase Invoice Item`.docstatus = 1 and\n `tabPurchase Invoice Item`.pr_detail = `tabPurchase Receipt Item`.name), 0))\n\t as \"Amount:Currency:110\",\n\t`tabPurchase Receipt Item`.`item_name` as \"Item Name::150\",\n\t`tabPurchase Receipt Item`.`description` as \"Description::200\",\n\t`tabPurchase Receipt`.`company` as \"Company:Link/Company:\"\nfrom `tabPurchase Receipt`, `tabPurchase Receipt Item`\nwhere\n `tabPurchase Receipt`.docstatus = 1 and `tabPurchase Receipt`.status != \"Closed\" and \n `tabPurchase Receipt`.name = `tabPurchase Receipt Item`.parent and\n (`tabPurchase Receipt Item`.qty > ifnull((select sum(qty) from `tabPurchase Invoice Item` \n where `tabPurchase Invoice Item`.purchase_receipt = `tabPurchase Receipt`.name and\n `tabPurchase Invoice Item`.docstatus=1 and \n `tabPurchase Invoice Item`.pr_detail = `tabPurchase Receipt Item`.name), 0))\norder by `tabPurchase Receipt`.`name` desc", + "query": "select\n `tabPurchase Receipt`.`name` as \"Purchase Receipt:Link/Purchase Receipt:120\",\n `tabPurchase Receipt`.`supplier` as \"Supplier:Link/Supplier:120\",\n\t`tabPurchase Receipt`.`posting_date` as \"Date:Date\",\n\t`tabPurchase Receipt Item`.`project` as \"Project\",\n\t`tabPurchase Receipt Item`.`item_code` as \"Item:Link/Item:120\",\n\t(`tabPurchase Receipt Item`.`qty` - ifnull((select sum(qty) from `tabPurchase Invoice Item` \n\t where `tabPurchase Invoice Item`.purchase_receipt = `tabPurchase Receipt`.name and\n `tabPurchase Invoice Item`.docstatus = 1 and\n\t `tabPurchase Invoice Item`.pr_detail = `tabPurchase Receipt Item`.name), 0))\n\t as \"Qty:Float:110\",\n\t(`tabPurchase Receipt Item`.`base_amount` - ifnull((select sum(base_amount) \n from `tabPurchase Invoice Item` \n where `tabPurchase Invoice Item`.purchase_receipt = `tabPurchase Receipt`.name and\n `tabPurchase Invoice Item`.docstatus = 1 and\n `tabPurchase Invoice Item`.pr_detail = `tabPurchase Receipt Item`.name), 0))\n\t as \"Amount:Currency:110\",\n\t`tabPurchase Receipt Item`.`item_name` as \"Item Name::150\",\n\t`tabPurchase Receipt Item`.`description` as \"Description::200\",\n\t`tabPurchase Receipt`.`company` as \"Company:Link/Company:\"\nfrom `tabPurchase Receipt`, `tabPurchase Receipt Item`\nwhere\n `tabPurchase Receipt`.docstatus = 1 and `tabPurchase Receipt`.status != \"Closed\" and \n `tabPurchase Receipt`.name = `tabPurchase Receipt Item`.parent and\n (`tabPurchase Receipt Item`.qty > ifnull((select sum(qty) from `tabPurchase Invoice Item` \n where `tabPurchase Invoice Item`.purchase_receipt = `tabPurchase Receipt`.name and\n `tabPurchase Invoice Item`.docstatus=1 and \n `tabPurchase Invoice Item`.pr_detail = `tabPurchase Receipt Item`.name), 0))\norder by `tabPurchase Receipt`.`name` desc", "ref_doctype": "Purchase Invoice", "report_name": "Received Items To Be Billed", "report_type": "Query Report" diff --git a/erpnext/accounts/report/sales_register/sales_register.py b/erpnext/accounts/report/sales_register/sales_register.py index d202cf3876..f68adad7d9 100644 --- a/erpnext/accounts/report/sales_register/sales_register.py +++ b/erpnext/accounts/report/sales_register/sales_register.py @@ -32,7 +32,7 @@ def execute(filters=None): row = [inv.name, inv.posting_date, inv.customer, inv.customer_name, customer_map.get(inv.customer, {}).get("customer_group"), customer_map.get(inv.customer, {}).get("territory"), - inv.debit_to, inv.project_name, inv.remarks, ", ".join(sales_order), ", ".join(delivery_note)] + inv.debit_to, inv.project, inv.remarks, ", ".join(sales_order), ", ".join(delivery_note)] # map income values base_net_total = 0 @@ -107,7 +107,7 @@ def get_conditions(filters): def get_invoices(filters): conditions = get_conditions(filters) - return frappe.db.sql("""select name, posting_date, debit_to, project_name, customer, + return frappe.db.sql("""select name, posting_date, debit_to, project, customer, customer_name, remarks, base_net_total, base_grand_total, base_rounded_total, outstanding_amount from `tabSales Invoice` where docstatus = 1 %s order by posting_date desc, name desc""" % diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.js b/erpnext/buying/doctype/purchase_common/purchase_common.js index c856e28edd..213dba4db9 100644 --- a/erpnext/buying/doctype/purchase_common/purchase_common.js +++ b/erpnext/buying/doctype/purchase_common/purchase_common.js @@ -142,14 +142,14 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({ } }, - project_name: function(doc, cdt, cdn) { + project: function(doc, cdt, cdn) { var item = frappe.get_doc(cdt, cdn); - if(item.project_name) { + if(item.project) { $.each(this.frm.doc["items"] || [], function(i, other_item) { - if(!other_item.project_name) { - other_item.project_name = item.project_name; - refresh_field("project_name", other_item.name, other_item.parentfield); + if(!other_item.project) { + other_item.project = item.project; + refresh_field("project", other_item.name, other_item.parentfield); } }); } @@ -173,7 +173,7 @@ erpnext.buying.BuyingController = erpnext.TransactionController.extend({ } }); -cur_frm.add_fetch('project_name', 'cost_center', 'cost_center'); +cur_frm.add_fetch('project', 'cost_center', 'cost_center'); erpnext.buying.get_default_bom = function(frm) { $.each(frm.doc["items"] || [], function(i, d) { diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js index 40a1c8bd9e..cf2aecce94 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.js +++ b/erpnext/buying/doctype/purchase_order/purchase_order.js @@ -243,7 +243,7 @@ cur_frm.fields_dict['contact_person'].get_query = function(doc, cdt, cdn) { } } -cur_frm.fields_dict['items'].grid.get_field('project_name').get_query = function(doc, cdt, cdn) { +cur_frm.fields_dict['items'].grid.get_field('project').get_query = function(doc, cdt, cdn) { return { filters:[ ['Project', 'status', 'not in', 'Completed, Cancelled'] diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index 06d3932458..47b592278f 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -58,7 +58,7 @@ class PurchaseOrder(BuyingController): }, "Supplier Quotation Item": { "ref_dn_field": "supplier_quotation_item", - "compare_fields": [["rate", "="], ["project_name", "="], ["item_code", "="]], + "compare_fields": [["rate", "="], ["project", "="], ["item_code", "="]], "is_child_table": True } }) diff --git a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json index c8055fdabc..c481e01bcc 100755 --- a/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json +++ b/erpnext/buying/doctype/purchase_order_item/purchase_order_item.json @@ -934,14 +934,14 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, - "fieldname": "project_name", + "fieldname": "project", "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 0, - "label": "Project Name", + "label": "Project", "length": 0, "no_copy": 0, "options": "Project", @@ -1384,7 +1384,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2016-02-22 09:33:02.405537", + "modified": "2016-03-10 05:08:54.505417", "modified_by": "Administrator", "module": "Buying", "name": "Purchase Order Item", diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js index 2e314e0ce8..96d69115e0 100644 --- a/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation.js @@ -46,7 +46,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['items'].grid.get_field('project_name').get_query = +cur_frm.fields_dict['items'].grid.get_field('project').get_query = function(doc, cdt, cdn) { return{ filters:[ diff --git a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json index 874a1f6e3c..04a31f4bc1 100644 --- a/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json +++ b/erpnext/buying/doctype/supplier_quotation_item/supplier_quotation_item.json @@ -803,14 +803,14 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, - "fieldname": "project_name", + "fieldname": "project", "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 0, - "label": "Project Name", + "label": "Project", "length": 0, "no_copy": 0, "options": "Project", @@ -1046,7 +1046,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2016-02-22 09:36:18.864207", + "modified": "2016-03-10 05:15:03.936587", "modified_by": "Administrator", "module": "Buying", "name": "Supplier Quotation Item", diff --git a/erpnext/buying/report/item_wise_purchase_history/item_wise_purchase_history.json b/erpnext/buying/report/item_wise_purchase_history/item_wise_purchase_history.json index 4659b36bca..c06d33d0b8 100644 --- a/erpnext/buying/report/item_wise_purchase_history/item_wise_purchase_history.json +++ b/erpnext/buying/report/item_wise_purchase_history/item_wise_purchase_history.json @@ -12,7 +12,7 @@ "module": "Buying", "name": "Item-wise Purchase History", "owner": "Administrator", - "query": "select\n po_item.item_code as \"Item Code:Link/Item:120\",\n\tpo_item.item_name as \"Item Name::120\",\n po_item.item_group as \"Item Group:Link/Item Group:120\",\n\tpo_item.description as \"Description::150\",\n\tpo_item.qty as \"Qty:Float:100\",\n\tpo_item.uom as \"UOM:Link/UOM:80\",\n\tpo_item.base_rate as \"Rate:Currency:120\",\n\tpo_item.base_amount as \"Amount:Currency:120\",\n\tpo.name as \"Purchase Order:Link/Purchase Order:120\",\n\tpo.transaction_date as \"Transaction Date:Date:140\",\n\tpo.supplier as \"Supplier:Link/Supplier:130\",\n sup.supplier_name as \"Supplier Name::150\",\n\tpo_item.project_name as \"Project:Link/Project:130\",\n\tifnull(po_item.received_qty, 0) as \"Received Qty:Float:120\",\n\tpo.company as \"Company:Link/Company:\"\nfrom\n\t`tabPurchase Order` po, `tabPurchase Order Item` po_item, `tabSupplier` sup\nwhere\n\tpo.name = po_item.parent and po.supplier = sup.name and po.docstatus = 1\norder by po.name desc", + "query": "select\n po_item.item_code as \"Item Code:Link/Item:120\",\n\tpo_item.item_name as \"Item Name::120\",\n po_item.item_group as \"Item Group:Link/Item Group:120\",\n\tpo_item.description as \"Description::150\",\n\tpo_item.qty as \"Qty:Float:100\",\n\tpo_item.uom as \"UOM:Link/UOM:80\",\n\tpo_item.base_rate as \"Rate:Currency:120\",\n\tpo_item.base_amount as \"Amount:Currency:120\",\n\tpo.name as \"Purchase Order:Link/Purchase Order:120\",\n\tpo.transaction_date as \"Transaction Date:Date:140\",\n\tpo.supplier as \"Supplier:Link/Supplier:130\",\n sup.supplier_name as \"Supplier Name::150\",\n\tpo_item.project as \"Project:Link/Project:130\",\n\tifnull(po_item.received_qty, 0) as \"Received Qty:Float:120\",\n\tpo.company as \"Company:Link/Company:\"\nfrom\n\t`tabPurchase Order` po, `tabPurchase Order Item` po_item, `tabSupplier` sup\nwhere\n\tpo.name = po_item.parent and po.supplier = sup.name and po.docstatus = 1\norder by po.name desc", "ref_doctype": "Purchase Order", "report_name": "Item-wise Purchase History", "report_type": "Query Report" diff --git a/erpnext/controllers/stock_controller.py b/erpnext/controllers/stock_controller.py index 83c3b6fe6e..a832ab771f 100644 --- a/erpnext/controllers/stock_controller.py +++ b/erpnext/controllers/stock_controller.py @@ -192,7 +192,7 @@ class StockController(AccountsController): "company": self.company, "batch_no": cstr(d.get("batch_no")).strip(), "serial_no": d.get("serial_no"), - "project": d.get("project_name"), + "project": d.get("project"), "is_cancelled": self.docstatus==2 and "Yes" or "No" }) diff --git a/erpnext/controllers/trends.py b/erpnext/controllers/trends.py index 6be8d96ad1..7d1b96ba80 100644 --- a/erpnext/controllers/trends.py +++ b/erpnext/controllers/trends.py @@ -43,7 +43,7 @@ def get_data(filters, conditions): inc, cond= '','' query_details = conditions["based_on_select"] + conditions["period_wise_select"] - if conditions["based_on_select"] in ["t1.project_name,", "t2.project_name,"]: + if conditions["based_on_select"] in ["t1.project,", "t2.project,"]: cond = 'and '+ conditions["based_on_select"][:-1] +' IS Not NULL' if filters.get("group_by"): @@ -246,13 +246,13 @@ def based_wise_columns_query(based_on, trans): elif based_on == "Project": if trans in ['Sales Invoice', 'Delivery Note', 'Sales Order']: based_on_details["based_on_cols"] = ["Project:Link/Project:120"] - based_on_details["based_on_select"] = "t1.project_name," - based_on_details["based_on_group_by"] = 't1.project_name' + based_on_details["based_on_select"] = "t1.project," + based_on_details["based_on_group_by"] = 't1.project' based_on_details["addl_tables"] = '' elif trans in ['Purchase Order', 'Purchase Invoice', 'Purchase Receipt']: based_on_details["based_on_cols"] = ["Project:Link/Project:120"] - based_on_details["based_on_select"] = "t2.project_name," - based_on_details["based_on_group_by"] = 't2.project_name' + based_on_details["based_on_select"] = "t2.project," + based_on_details["based_on_group_by"] = 't2.project' based_on_details["addl_tables"] = '' else: frappe.throw(_("Project-wise data is not available for Quotation")) diff --git a/erpnext/manufacturing/doctype/bom/bom.js b/erpnext/manufacturing/doctype/bom/bom.js index 84f217582e..aeacf11271 100644 --- a/erpnext/manufacturing/doctype/bom/bom.js +++ b/erpnext/manufacturing/doctype/bom/bom.js @@ -144,7 +144,7 @@ cur_frm.fields_dict['item'].get_query = function(doc) { } } -cur_frm.fields_dict['project_name'].get_query = function(doc, dt, dn) { +cur_frm.fields_dict['project'].get_query = function(doc, dt, dn) { return{ filters:[ ['Project', 'status', 'not in', 'Completed, Cancelled'] diff --git a/erpnext/manufacturing/doctype/bom/bom.json b/erpnext/manufacturing/doctype/bom/bom.json index bb74e1dcac..bf8c67ca34 100644 --- a/erpnext/manufacturing/doctype/bom/bom.json +++ b/erpnext/manufacturing/doctype/bom/bom.json @@ -17,6 +17,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 1, "label": "Item", @@ -27,6 +28,7 @@ "options": "Item", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 1, @@ -42,6 +44,7 @@ "fieldtype": "Data", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Item Name", @@ -50,6 +53,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -65,6 +69,7 @@ "fieldtype": "Select", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Rate Of Materials Based On", @@ -73,6 +78,7 @@ "options": "Valuation Rate\nLast Purchase Rate\nPrice List", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -89,6 +95,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Price List", @@ -97,6 +104,7 @@ "options": "Price List", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -112,12 +120,14 @@ "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "length": 0, "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -134,6 +144,7 @@ "fieldtype": "Check", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 1, "label": "Is Active", @@ -143,6 +154,7 @@ "oldfieldtype": "Select", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -159,6 +171,7 @@ "fieldtype": "Check", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 1, "label": "Is Default", @@ -168,6 +181,7 @@ "oldfieldtype": "Check", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -184,6 +198,7 @@ "fieldtype": "Check", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "With Operations", @@ -191,6 +206,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -208,6 +224,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Operations", @@ -216,6 +233,7 @@ "oldfieldtype": "Section Break", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -231,6 +249,7 @@ "fieldtype": "Table", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Operations", @@ -241,6 +260,7 @@ "options": "BOM Operation", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -256,6 +276,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Materials", @@ -264,6 +285,7 @@ "oldfieldtype": "Section Break", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -279,6 +301,7 @@ "fieldtype": "Table", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Items", @@ -289,6 +312,7 @@ "options": "BOM Item", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -306,6 +330,7 @@ "fieldtype": "Float", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Quantity", @@ -315,6 +340,7 @@ "oldfieldtype": "Currency", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 1, @@ -330,6 +356,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Costing", @@ -338,6 +365,7 @@ "oldfieldtype": "Section Break", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -353,6 +381,7 @@ "fieldtype": "Currency", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Operating Cost", @@ -361,6 +390,7 @@ "options": "Company:company:default_currency", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -376,6 +406,7 @@ "fieldtype": "Currency", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Raw Material Cost", @@ -384,6 +415,7 @@ "options": "Company:company:default_currency", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -399,12 +431,14 @@ "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "length": 0, "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -420,6 +454,7 @@ "fieldtype": "Currency", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 1, "label": "Total Cost", @@ -428,6 +463,7 @@ "options": "Company:company:default_currency", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -443,6 +479,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "", @@ -450,6 +487,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -461,20 +499,22 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, - "fieldname": "project_name", + "fieldname": "project", "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 0, - "label": "Project Name", + "label": "Project", "length": 0, "no_copy": 0, - "oldfieldname": "project_name", + "oldfieldname": "project", "oldfieldtype": "Link", "options": "Project", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -490,6 +530,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Company", @@ -499,6 +540,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -514,6 +556,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 1, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Amended From", @@ -522,6 +565,7 @@ "options": "BOM", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -537,12 +581,14 @@ "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "length": 0, "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -558,6 +604,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Item UOM", @@ -566,6 +613,7 @@ "options": "UOM", "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -581,6 +629,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "length": 0, @@ -588,6 +637,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -603,6 +653,7 @@ "fieldtype": "Small Text", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Item Desription", @@ -610,6 +661,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -625,6 +677,7 @@ "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "length": 0, @@ -632,6 +685,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -647,6 +701,7 @@ "fieldtype": "Attach", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Image", @@ -655,6 +710,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -670,6 +726,7 @@ "fieldtype": "Image", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Image View", @@ -679,6 +736,7 @@ "permlevel": 0, "precision": "", "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -695,6 +753,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Materials Required (Exploded)", @@ -702,6 +761,7 @@ "no_copy": 0, "permlevel": 0, "print_hide": 0, + "print_hide_if_no_value": 0, "read_only": 0, "report_hide": 0, "reqd": 0, @@ -717,6 +777,7 @@ "fieldtype": "Table", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Exploded_items", @@ -727,6 +788,7 @@ "options": "BOM Explosion Item", "permlevel": 0, "print_hide": 1, + "print_hide_if_no_value": 0, "read_only": 1, "report_hide": 0, "reqd": 0, @@ -745,7 +807,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2015-11-16 06:29:42.637983", + "modified": "2016-03-10 05:09:50.749754", "modified_by": "Administrator", "module": "Manufacturing", "name": "BOM", diff --git a/erpnext/manufacturing/doctype/production_order/production_order.js b/erpnext/manufacturing/doctype/production_order/production_order.js index 399d576a6b..d2e95faf49 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.js +++ b/erpnext/manufacturing/doctype/production_order/production_order.js @@ -262,7 +262,7 @@ cur_frm.fields_dict['production_item'].get_query = function(doc) { } } -cur_frm.fields_dict['project_name'].get_query = function(doc, dt, dn) { +cur_frm.fields_dict['project'].get_query = function(doc, dt, dn) { return{ filters:[ ['Project', 'status', 'not in', 'Completed, Cancelled'] diff --git a/erpnext/manufacturing/doctype/production_order/production_order.json b/erpnext/manufacturing/doctype/production_order/production_order.json index 4a809cf439..35196de0d3 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.json +++ b/erpnext/manufacturing/doctype/production_order/production_order.json @@ -7,6 +7,7 @@ "custom": 0, "docstatus": 0, "doctype": "DocType", + "document_type": "Setup", "fields": [ { "allow_on_submit": 0, @@ -16,6 +17,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "", @@ -41,6 +43,7 @@ "fieldtype": "Select", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Series", @@ -67,6 +70,7 @@ "fieldtype": "Select", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 0, "label": "Status", @@ -93,6 +97,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 1, "label": "Item To Manufacture", @@ -121,6 +126,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "BOM No", @@ -149,6 +155,7 @@ "fieldtype": "Check", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Use Multi-Level BOM", @@ -172,6 +179,7 @@ "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "length": 0, @@ -197,6 +205,7 @@ "fieldtype": "Float", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Qty To Manufacture", @@ -225,6 +234,7 @@ "fieldtype": "Float", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Material Transferred for Manufacturing", @@ -252,6 +262,7 @@ "fieldtype": "Float", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Manufactured Qty", @@ -277,6 +288,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Warehouses", @@ -301,6 +313,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Work-in-Progress Warehouse", @@ -325,6 +338,7 @@ "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "length": 0, @@ -349,6 +363,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Target Warehouse", @@ -373,6 +388,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Time", @@ -399,6 +415,7 @@ "fieldtype": "Date", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Expected Delivery Date", @@ -423,6 +440,7 @@ "fieldtype": "Datetime", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Planned Start Date", @@ -447,6 +465,7 @@ "fieldtype": "Datetime", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Planned End Date", @@ -471,6 +490,7 @@ "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "length": 0, @@ -494,6 +514,7 @@ "fieldtype": "Datetime", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Actual Start Date", @@ -518,6 +539,7 @@ "fieldtype": "Datetime", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Actual End Date", @@ -543,6 +565,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Operations", @@ -569,6 +592,7 @@ "fieldtype": "Table", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Operations", @@ -595,6 +619,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Operation Cost", @@ -620,6 +645,7 @@ "fieldtype": "Currency", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Planned Operating Cost", @@ -645,6 +671,7 @@ "fieldtype": "Currency", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Actual Operating Cost", @@ -670,6 +697,7 @@ "fieldtype": "Currency", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Additional Operating Cost", @@ -695,6 +723,7 @@ "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "length": 0, @@ -718,6 +747,7 @@ "fieldtype": "Currency", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Total Operating Cost", @@ -743,6 +773,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "More Information", @@ -767,6 +798,7 @@ "fieldtype": "Small Text", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Item Description", @@ -791,6 +823,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Stock UOM", @@ -817,6 +850,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Company", @@ -843,6 +877,7 @@ "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "length": 0, @@ -862,16 +897,17 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, - "fieldname": "project_name", + "fieldname": "project", "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 0, - "label": "Project Name", + "label": "Project", "length": 0, "no_copy": 0, - "oldfieldname": "project_name", + "oldfieldname": "project", "oldfieldtype": "Link", "options": "Project", "permlevel": 0, @@ -893,6 +929,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Sales Order", @@ -918,6 +955,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Material Request", @@ -943,6 +981,7 @@ "fieldtype": "Data", "hidden": 1, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Material Request Item", @@ -967,6 +1006,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 1, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Amended From", @@ -996,7 +1036,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2016-02-23 07:29:38.091748", + "modified": "2016-03-10 05:10:07.951138", "modified_by": "Administrator", "module": "Manufacturing", "name": "Production Order", diff --git a/erpnext/manufacturing/doctype/production_order/production_order.py b/erpnext/manufacturing/doctype/production_order/production_order.py index 210597ee98..5614f37d63 100644 --- a/erpnext/manufacturing/doctype/production_order/production_order.py +++ b/erpnext/manufacturing/doctype/production_order/production_order.py @@ -236,7 +236,7 @@ class ProductionOrder(Document): self.set_operation_start_end_time(i, d) time_log = make_time_log(self.name, d.operation, d.planned_start_time, d.planned_end_time, - flt(self.qty) - flt(d.completed_qty), self.project_name, d.workstation, operation_id=d.name) + flt(self.qty) - flt(d.completed_qty), self.project, d.workstation, operation_id=d.name) if d.workstation: # validate operating hours if workstation [not mandatory] is specified diff --git a/erpnext/patches.txt b/erpnext/patches.txt index e53a506ac4..8872ca90a5 100644 --- a/erpnext/patches.txt +++ b/erpnext/patches.txt @@ -54,6 +54,7 @@ erpnext.patches.v4_0.fix_address_template # WATCHOUT: This patch reload's documents erpnext.patches.v4_0.reset_permissions_for_masters +erpnext.patches.v6_20x.rename_project_name_to_project #2016-03-14 erpnext.patches.v4_0.update_tax_amount_after_discount execute:frappe.permissions.reset_perms("GL Entry") #2014-06-09 diff --git a/erpnext/patches/v5_0/index_on_account_and_gl_entry.py b/erpnext/patches/v5_0/index_on_account_and_gl_entry.py index 16e43d64a0..2920e9293d 100644 --- a/erpnext/patches/v5_0/index_on_account_and_gl_entry.py +++ b/erpnext/patches/v5_0/index_on_account_and_gl_entry.py @@ -16,7 +16,7 @@ def execute(): for old, column in existing_indexes: if column in ("parent", "group_or_ledger", "is_group", "is_pl_account", "debit_or_credit", - "account_name", "company", "project_name", "voucher_date", "due_date", "bill_no", + "account_name", "company", "project", "voucher_date", "due_date", "bill_no", "bill_date", "is_opening", "fiscal_year", "outstanding_amount"): frappe.db.sql("alter table `tab{0}` drop index {1}".format(dt, old)) diff --git a/erpnext/patches/v5_4/update_purchase_cost_against_project.py b/erpnext/patches/v5_4/update_purchase_cost_against_project.py index 3a02eb76f9..1b917c83c4 100644 --- a/erpnext/patches/v5_4/update_purchase_cost_against_project.py +++ b/erpnext/patches/v5_4/update_purchase_cost_against_project.py @@ -7,7 +7,7 @@ import frappe def execute(): for p in frappe.get_all("Project"): purchase_cost = frappe.db.sql("""select sum(ifnull(base_net_amount, 0)) - from `tabPurchase Invoice Item` where project_name = %s and docstatus=1""", p.name) + from `tabPurchase Invoice Item` where project = %s and docstatus=1""", p.name) purchase_cost = purchase_cost and purchase_cost[0][0] or 0 frappe.db.set_value("Project", p.name, "total_purchase_cost", purchase_cost) \ No newline at end of file diff --git a/erpnext/patches/v6_20x/rename_project_name_to_project.py b/erpnext/patches/v6_20x/rename_project_name_to_project.py new file mode 100644 index 0000000000..b420ce9013 --- /dev/null +++ b/erpnext/patches/v6_20x/rename_project_name_to_project.py @@ -0,0 +1,17 @@ +# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors +# License: GNU General Public License v3. See license.txt + +from __future__ import unicode_literals +import frappe +from frappe.model.utils.rename_field import rename_field + +def execute(): + + doc_list = ["Production Order", "BOM", "Purchase Invoice Item", "Sales Invoice", + "Purchase Order Item", "Stock Entry", "Delivery Note", "Sales Order", + "Purchase Receipt Item", "Supplier Quotation Item"] + + for doctype in doc_list: + frappe.reload_doctype(doctype) + rename_field(doctype, "project_name", "project") + \ No newline at end of file diff --git a/erpnext/projects/doctype/project/project.js b/erpnext/projects/doctype/project/project.js index b33386b862..d190f348b1 100644 --- a/erpnext/projects/doctype/project/project.js +++ b/erpnext/projects/doctype/project/project.js @@ -60,7 +60,7 @@ cur_frm.fields_dict.customer.get_query = function(doc,cdt,cdn) { cur_frm.fields_dict['sales_order'].get_query = function(doc) { var filters = { - 'project_name': ["in", doc.__islocal ? [""] : [doc.name, ""]] + 'project': ["in", doc.__islocal ? [""] : [doc.name, ""]] }; if (doc.customer) { diff --git a/erpnext/projects/doctype/project/project.json b/erpnext/projects/doctype/project/project.json index af2d71edc6..1f1943c85a 100644 --- a/erpnext/projects/doctype/project/project.json +++ b/erpnext/projects/doctype/project/project.json @@ -18,12 +18,12 @@ "fieldtype": "Data", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Project Name", "length": 0, "no_copy": 0, - "oldfieldname": "project_name", "oldfieldtype": "Data", "permlevel": 0, "print_hide": 0, @@ -44,6 +44,7 @@ "fieldtype": "Select", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 0, "label": "Status", @@ -70,6 +71,7 @@ "fieldtype": "Select", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Project Type", @@ -96,6 +98,7 @@ "fieldtype": "Select", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Is Active", @@ -122,6 +125,7 @@ "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "length": 0, @@ -145,6 +149,7 @@ "fieldtype": "Select", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Priority", @@ -171,6 +176,7 @@ "fieldtype": "Date", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 0, "label": "Expected Start Date", @@ -196,6 +202,7 @@ "fieldtype": "Date", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Expected End Date", @@ -221,6 +228,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Customer Details", @@ -246,6 +254,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 0, "label": "Customer", @@ -272,6 +281,7 @@ "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "length": 0, @@ -295,6 +305,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Sales Order", @@ -320,6 +331,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Tasks", @@ -345,6 +357,7 @@ "fieldtype": "Table", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Tasks", @@ -370,6 +383,7 @@ "fieldtype": "Percent", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "% Tasks Completed", @@ -393,6 +407,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Notes", @@ -418,6 +433,7 @@ "fieldtype": "Text Editor", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Notes", @@ -443,6 +459,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Start and End Dates", @@ -467,6 +484,7 @@ "fieldtype": "Data", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Actual Start Date", @@ -491,6 +509,7 @@ "fieldtype": "Float", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Actual Time (in Hours)", @@ -515,6 +534,7 @@ "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "length": 0, @@ -538,6 +558,7 @@ "fieldtype": "Date", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Actual End Date", @@ -563,6 +584,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Costing and Billing", @@ -588,6 +610,7 @@ "fieldtype": "Currency", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 1, "label": "Estimated Cost", @@ -615,6 +638,7 @@ "fieldtype": "Currency", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Total Costing Amount (via Time Logs)", @@ -640,6 +664,7 @@ "fieldtype": "Currency", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Total Expense Claim (via Expense Claims)", @@ -664,6 +689,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Company", @@ -688,6 +714,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Default Cost Center", @@ -712,6 +739,7 @@ "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "length": 0, @@ -736,6 +764,7 @@ "fieldtype": "Currency", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Total Billing Amount (via Time Logs)", @@ -760,6 +789,7 @@ "fieldtype": "Currency", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Total Purchase Cost (via Purchase Invoice)", @@ -784,6 +814,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Margin", @@ -809,6 +840,7 @@ "fieldtype": "Currency", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Gross Margin", @@ -835,6 +867,7 @@ "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "length": 0, @@ -858,6 +891,7 @@ "fieldtype": "Percent", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Gross Margin %", @@ -887,7 +921,7 @@ "issingle": 0, "istable": 0, "max_attachments": 4, - "modified": "2016-02-19 05:44:20.345170", + "modified": "2016-03-10 05:10:21.779365", "modified_by": "Administrator", "module": "Projects", "name": "Project", diff --git a/erpnext/projects/doctype/project/project.py b/erpnext/projects/doctype/project/project.py index 0e1cdb402f..ec4f523b47 100644 --- a/erpnext/projects/doctype/project/project.py +++ b/erpnext/projects/doctype/project/project.py @@ -120,10 +120,10 @@ class Project(Document): def update_purchase_costing(self): total_purchase_cost = frappe.db.sql("""select sum(base_net_amount) - from `tabPurchase Invoice Item` where project_name = %s and docstatus=1""", self.name) + from `tabPurchase Invoice Item` where project = %s and docstatus=1""", self.name) self.total_purchase_cost = total_purchase_cost and total_purchase_cost[0][0] or 0 @frappe.whitelist() -def get_cost_center_name(project_name): - return frappe.db.get_value("Project", project_name, "cost_center") +def get_cost_center_name(project): + return frappe.db.get_value("Project", project, "cost_center") diff --git a/erpnext/projects/doctype/time_log/test_time_log.py b/erpnext/projects/doctype/time_log/test_time_log.py index 81a352f2c8..591316bfe7 100644 --- a/erpnext/projects/doctype/time_log/test_time_log.py +++ b/erpnext/projects/doctype/time_log/test_time_log.py @@ -83,11 +83,11 @@ class TestTimeLog(unittest.TestCase): activity_type.costing_rate = 15 activity_type.save() - project_name = "_Test Project for Activity Type" + project = "_Test Project for Activity Type" - frappe.db.sql("delete from `tabTime Log` where project=%s or employee='_T-Employee-0002'", project_name) - frappe.delete_doc("Project", project_name) - project = frappe.get_doc({"doctype": "Project", "project_name": project_name}).insert() + frappe.db.sql("delete from `tabTime Log` where project=%s or employee='_T-Employee-0002'", project) + frappe.delete_doc("Project", project) + project = frappe.get_doc({"doctype": "Project", "project_name": project}).insert() make_time_log_test_record(employee="_T-Employee-0002", hours=2, activity_type = "_Test Activity Type", project = project.name) diff --git a/erpnext/projects/report/project_wise_stock_tracking/project_wise_stock_tracking.py b/erpnext/projects/report/project_wise_stock_tracking/project_wise_stock_tracking.py index 559b02d69a..c13d7cf334 100644 --- a/erpnext/projects/report/project_wise_stock_tracking/project_wise_stock_tracking.py +++ b/erpnext/projects/report/project_wise_stock_tracking/project_wise_stock_tracking.py @@ -34,46 +34,46 @@ def get_project_details(): expected_start_date, expected_end_date from tabProject where docstatus < 2""", as_dict=1) def get_purchased_items_cost(): - pr_items = frappe.db.sql("""select project_name, sum(base_net_amount) as amount - from `tabPurchase Receipt Item` where ifnull(project_name, '') != '' - and docstatus = 1 group by project_name""", as_dict=1) + pr_items = frappe.db.sql("""select project, sum(base_net_amount) as amount + from `tabPurchase Receipt Item` where ifnull(project, '') != '' + and docstatus = 1 group by project""", as_dict=1) pr_item_map = {} for item in pr_items: - pr_item_map.setdefault(item.project_name, item.amount) + pr_item_map.setdefault(item.project, item.amount) return pr_item_map def get_issued_items_cost(): - se_items = frappe.db.sql("""select se.project_name, sum(se_item.amount) as amount + se_items = frappe.db.sql("""select se.project, sum(se_item.amount) as amount from `tabStock Entry` se, `tabStock Entry Detail` se_item where se.name = se_item.parent and se.docstatus = 1 and ifnull(se_item.t_warehouse, '') = '' - and ifnull(se.project_name, '') != '' group by se.project_name""", as_dict=1) + and ifnull(se.project, '') != '' group by se.project""", as_dict=1) se_item_map = {} for item in se_items: - se_item_map.setdefault(item.project_name, item.amount) + se_item_map.setdefault(item.project, item.amount) return se_item_map def get_delivered_items_cost(): - dn_items = frappe.db.sql("""select dn.project_name, sum(dn_item.base_net_amount) as amount + dn_items = frappe.db.sql("""select dn.project, sum(dn_item.base_net_amount) as amount from `tabDelivery Note` dn, `tabDelivery Note Item` dn_item - where dn.name = dn_item.parent and dn.docstatus = 1 and ifnull(dn.project_name, '') != '' - group by dn.project_name""", as_dict=1) + where dn.name = dn_item.parent and dn.docstatus = 1 and ifnull(dn.project, '') != '' + group by dn.project""", as_dict=1) - si_items = frappe.db.sql("""select si.project_name, sum(si_item.base_net_amount) as amount + si_items = frappe.db.sql("""select si.project, sum(si_item.base_net_amount) as amount from `tabSales Invoice` si, `tabSales Invoice Item` si_item where si.name = si_item.parent and si.docstatus = 1 and si.update_stock = 1 - and si.is_pos = 1 and ifnull(si.project_name, '') != '' - group by si.project_name""", as_dict=1) + and si.is_pos = 1 and ifnull(si.project, '') != '' + group by si.project""", as_dict=1) dn_item_map = {} for item in dn_items: - dn_item_map.setdefault(item.project_name, item.amount) + dn_item_map.setdefault(item.project, item.amount) for item in si_items: - dn_item_map.setdefault(item.project_name, item.amount) + dn_item_map.setdefault(item.project, item.amount) return dn_item_map diff --git a/erpnext/public/js/controllers/transaction.js b/erpnext/public/js/controllers/transaction.js index 7f563ddd26..9ca4351519 100644 --- a/erpnext/public/js/controllers/transaction.js +++ b/erpnext/public/js/controllers/transaction.js @@ -186,7 +186,7 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({ ignore_pricing_rule: me.frm.doc.ignore_pricing_rule, doctype: me.frm.doc.doctype, name: me.frm.doc.name, - project_name: item.project_name || me.frm.doc.project_name, + project: item.project || me.frm.doc.project, qty: item.qty } }, diff --git a/erpnext/public/js/feature_setup.js b/erpnext/public/js/feature_setup.js index d43ffc5d59..6dfc962059 100644 --- a/erpnext/public/js/feature_setup.js +++ b/erpnext/public/js/feature_setup.js @@ -5,27 +5,27 @@ Dictionary Format 'projects': { 'Sales Order': { - 'fields':['project_name'], + 'fields':['project'], 'items':['projected_qty'] }, 'Purchase Order': { - 'fields':['project_name'] + 'fields':['project'] } } // ====================================================================*/ frappe.provide("erpnext.feature_setup"); erpnext.feature_setup.feature_dict = { 'fs_projects': { - 'BOM': {'fields':['project_name']}, - 'Delivery Note': {'fields':['project_name']}, - 'Purchase Invoice': {'items':['project_name']}, - 'Production Order': {'fields':['project_name']}, - 'Purchase Order': {'items':['project_name']}, - 'Purchase Receipt': {'items':['project_name']}, - 'Sales Invoice': {'fields':['project_name']}, - 'Sales Order': {'fields':['project_name']}, - 'Stock Entry': {'fields':['project_name']}, - 'Timesheet': {'timesheet_details':['project_name']} + 'BOM': {'fields':['project']}, + 'Delivery Note': {'fields':['project']}, + 'Purchase Invoice': {'items':['project']}, + 'Production Order': {'fields':['project']}, + 'Purchase Order': {'items':['project']}, + 'Purchase Receipt': {'items':['project']}, + 'Sales Invoice': {'fields':['project']}, + 'Sales Order': {'fields':['project']}, + 'Stock Entry': {'fields':['project']}, + 'Timesheet': {'timesheet_details':['project']} }, 'fs_discounts': { 'Delivery Note': {'items':['discount_percentage']}, diff --git a/erpnext/selling/doctype/sales_order/sales_order.js b/erpnext/selling/doctype/sales_order/sales_order.js index fed5a63b21..560cdc86e6 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.js +++ b/erpnext/selling/doctype/sales_order/sales_order.js @@ -219,9 +219,9 @@ cur_frm.cscript.new_contact = function(){ loaddoc('Contact', tn); } -cur_frm.fields_dict['project_name'].get_query = function(doc, cdt, cdn) { +cur_frm.fields_dict['project'].get_query = function(doc, cdt, cdn) { return { - query: "erpnext.controllers.queries.get_project_name", + query: "erpnext.controllers.queries.get_project", filters: { 'customer': doc.customer } diff --git a/erpnext/selling/doctype/sales_order/sales_order.json b/erpnext/selling/doctype/sales_order/sales_order.json index 8d7ab5b126..e6e0cd22d8 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.json +++ b/erpnext/selling/doctype/sales_order/sales_order.json @@ -1959,7 +1959,7 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 1, - "collapsible_depends_on": "project_name", + "collapsible_depends_on": "project", "fieldname": "more_info", "fieldtype": "Section Break", "hidden": 0, @@ -1987,17 +1987,17 @@ "bold": 0, "collapsible": 0, "description": "Track this Sales Order against any Project", - "fieldname": "project_name", + "fieldname": "project", "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 0, - "label": "Project Name", + "label": "Project", "length": 0, "no_copy": 0, - "oldfieldname": "project_name", + "oldfieldname": "project", "oldfieldtype": "Link", "options": "Project", "permlevel": 0, diff --git a/erpnext/selling/doctype/sales_order/sales_order.py b/erpnext/selling/doctype/sales_order/sales_order.py index 590f749201..5cd7f731bc 100644 --- a/erpnext/selling/doctype/sales_order/sales_order.py +++ b/erpnext/selling/doctype/sales_order/sales_order.py @@ -103,12 +103,12 @@ class SalesOrder(SellingController): self.validate_sales_mntc_quotation() def validate_proj_cust(self): - if self.project_name and self.customer_name: + if self.project and self.customer_name: res = frappe.db.sql("""select name from `tabProject` where name = %s and (customer = %s or ifnull(customer,'')='')""", - (self.project_name, self.customer)) + (self.project, self.customer)) if not res: - frappe.throw(_("Customer {0} does not belong to project {1}").format(self.customer, self.project_name)) + frappe.throw(_("Customer {0} does not belong to project {1}").format(self.customer, self.project)) def validate_warehouse(self): super(SalesOrder, self).validate_warehouse() diff --git a/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.json b/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.json index 90415bd828..4116568ef6 100644 --- a/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.json +++ b/erpnext/selling/report/item_wise_sales_history/item_wise_sales_history.json @@ -12,7 +12,7 @@ "module": "Selling", "name": "Item-wise Sales History", "owner": "Administrator", - "query": "select\n so_item.item_code as \"Item Code:Link/Item:120\",\n\tso_item.item_name as \"Item Name::120\",\n so_item.item_group as \"Item Group:Link/Item Group:120\",\n\tso_item.description as \"Description::150\",\n\tso_item.qty as \"Qty:Float:100\",\n\tso_item.stock_uom as \"UOM:Link/UOM:80\",\n\tso_item.base_rate as \"Rate:Currency:120\",\n\tso_item.base_amount as \"Amount:Currency:120\",\n\tso.name as \"Sales Order:Link/Sales Order:120\",\n\tso.transaction_date as \"Transaction Date:Date:140\",\n\tso.customer as \"Customer:Link/Customer:130\",\n cu.customer_name as \"Customer Name::150\",\n\tso.territory as \"Territory:Link/Territory:130\",\n so.project_name as \"Project:Link/Project:130\",\n\tifnull(so_item.delivered_qty, 0) as \"Delivered Qty:Float:120\",\n\tifnull(so_item.billed_amt, 0) as \"Billed Amount:Currency:120\",\n\tso.company as \"Company:Link/Company:\"\nfrom\n\t`tabSales Order` so, `tabSales Order Item` so_item, `tabCustomer` cu\nwhere\n\tso.name = so_item.parent and so.customer=cu.name\n\tand so.docstatus = 1\norder by so.name desc", + "query": "select\n so_item.item_code as \"Item Code:Link/Item:120\",\n\tso_item.item_name as \"Item Name::120\",\n so_item.item_group as \"Item Group:Link/Item Group:120\",\n\tso_item.description as \"Description::150\",\n\tso_item.qty as \"Qty:Float:100\",\n\tso_item.stock_uom as \"UOM:Link/UOM:80\",\n\tso_item.base_rate as \"Rate:Currency:120\",\n\tso_item.base_amount as \"Amount:Currency:120\",\n\tso.name as \"Sales Order:Link/Sales Order:120\",\n\tso.transaction_date as \"Transaction Date:Date:140\",\n\tso.customer as \"Customer:Link/Customer:130\",\n cu.customer_name as \"Customer Name::150\",\n\tso.territory as \"Territory:Link/Territory:130\",\n so.project as \"Project:Link/Project:130\",\n\tifnull(so_item.delivered_qty, 0) as \"Delivered Qty:Float:120\",\n\tifnull(so_item.billed_amt, 0) as \"Billed Amount:Currency:120\",\n\tso.company as \"Company:Link/Company:\"\nfrom\n\t`tabSales Order` so, `tabSales Order Item` so_item, `tabCustomer` cu\nwhere\n\tso.name = so_item.parent and so.customer=cu.name\n\tand so.docstatus = 1\norder by so.name desc", "ref_doctype": "Sales Order", "report_name": "Item-wise Sales History", "report_type": "Query Report" diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js index 05a53877fd..25045fa98c 100644 --- a/erpnext/selling/sales_common.js +++ b/erpnext/selling/sales_common.js @@ -310,11 +310,11 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ } }); -frappe.ui.form.on(cur_frm.doctype,"project_name", function(frm) { +frappe.ui.form.on(cur_frm.doctype,"project", function(frm) { if(in_list(["Delivery Note", "Sales Invoice"], frm.doc.doctype)) { frappe.call({ method:'erpnext.projects.doctype.project.project.get_cost_center_name' , - args: { project_name: frm.doc.project_name }, + args: { project: frm.doc.project }, callback: function(r, rt) { if(!r.exc) { $.each(frm.doc["items"] || [], function(i, row) { diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.js b/erpnext/stock/doctype/delivery_note/delivery_note.js index 7407975a60..c14bb9d04c 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.js +++ b/erpnext/stock/doctype/delivery_note/delivery_note.js @@ -36,7 +36,7 @@ erpnext.stock.DeliveryNoteController = erpnext.selling.SellingController.extend( docstatus: 1, status: ["!=", "Closed"], per_delivered: ["<", 99.99], - project_name: cur_frm.doc.project_name || undefined, + project: cur_frm.doc.project || undefined, customer: cur_frm.doc.customer || undefined, company: cur_frm.doc.company } @@ -142,9 +142,9 @@ cur_frm.cscript.update_status = function(status) { } // ***************** Get project name ***************** -cur_frm.fields_dict['project_name'].get_query = function(doc, cdt, cdn) { +cur_frm.fields_dict['project'].get_query = function(doc, cdt, cdn) { return { - query: "erpnext.controllers.queries.get_project_name", + query: "erpnext.controllers.queries.get_project", filters: { 'customer': doc.customer } diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.json b/erpnext/stock/doctype/delivery_note/delivery_note.json index b10c90d330..7fb5421c7d 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.json +++ b/erpnext/stock/doctype/delivery_note/delivery_note.json @@ -2078,17 +2078,17 @@ "bold": 0, "collapsible": 0, "description": "Track this Delivery Note against any Project", - "fieldname": "project_name", + "fieldname": "project", "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 0, - "label": "Project Name", + "label": "Project", "length": 0, "no_copy": 0, - "oldfieldname": "project_name", + "oldfieldname": "project", "oldfieldtype": "Link", "options": "Project", "permlevel": 0, @@ -2799,7 +2799,7 @@ "istable": 0, "max_attachments": 0, "menu_index": 0, - "modified": "2016-03-04 02:11:17.177846", + "modified": "2016-03-10 05:10:56.813113", "modified_by": "Administrator", "module": "Stock", "name": "Delivery Note", diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index 2db350974c..63abaa5a34 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -118,7 +118,7 @@ class DeliveryNote(SellingController): super(DeliveryNote, self).validate_with_previous_doc({ fn[0]: { "ref_dn_field": fn[1], - "compare_fields": [["customer", "="], ["company", "="], ["project_name", "="], + "compare_fields": [["customer", "="], ["company", "="], ["project", "="], ["currency", "="]], }, }) @@ -129,12 +129,12 @@ class DeliveryNote(SellingController): def validate_proj_cust(self): """check for does customer belong to same project as entered..""" - if self.project_name and self.customer: + if self.project and self.customer: res = frappe.db.sql("""select name from `tabProject` where name = %s and (customer = %s or - ifnull(customer,'')='')""", (self.project_name, self.customer)) + ifnull(customer,'')='')""", (self.project, self.customer)) if not res: - frappe.throw(_("Customer {0} does not belong to project {1}").format(self.customer, self.project_name)) + frappe.throw(_("Customer {0} does not belong to project {1}").format(self.customer, self.project)) def validate_for_items(self): check_list, chk_dupl_itm = [], [] diff --git a/erpnext/stock/doctype/item/item.json b/erpnext/stock/doctype/item/item.json index 96b4350918..ac889fb8c6 100644 --- a/erpnext/stock/doctype/item/item.json +++ b/erpnext/stock/doctype/item/item.json @@ -19,6 +19,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "", @@ -44,6 +45,7 @@ "fieldtype": "Select", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Series", @@ -69,6 +71,7 @@ "fieldtype": "Data", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Item Code", @@ -96,6 +99,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Variant Of", @@ -121,6 +125,7 @@ "fieldtype": "Data", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 0, "label": "Item Name", @@ -147,6 +152,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 1, "label": "Item Group", @@ -174,6 +180,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 1, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Default Unit of Measure", @@ -200,6 +207,7 @@ "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "length": 0, @@ -224,6 +232,7 @@ "fieldtype": "Check", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Maintain Stock", @@ -250,6 +259,7 @@ "fieldtype": "Check", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Disabled", @@ -274,6 +284,7 @@ "fieldtype": "Attach", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Image", @@ -299,6 +310,7 @@ "fieldtype": "Image", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Image View", @@ -324,6 +336,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Description", @@ -348,6 +361,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Brand", @@ -374,6 +388,7 @@ "fieldtype": "Data", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Barcode", @@ -397,6 +412,7 @@ "fieldtype": "Text Editor", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Description", @@ -424,6 +440,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Inventory", @@ -451,6 +468,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 1, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Default Warehouse", @@ -479,6 +497,7 @@ "fieldtype": "Date", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "End of Life", @@ -506,6 +525,7 @@ "fieldtype": "Check", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Has Batch No", @@ -535,6 +555,7 @@ "fieldtype": "Check", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 0, "label": "Has Serial No", @@ -563,6 +584,7 @@ "fieldtype": "Data", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Serial Number Series", @@ -589,6 +611,7 @@ "fieldtype": "Check", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Is Fixed Asset Item", @@ -616,6 +639,7 @@ "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "length": 0, @@ -642,6 +666,7 @@ "fieldtype": "Float", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Allow over delivery or receipt upto this percent", @@ -668,6 +693,7 @@ "fieldtype": "Select", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Valuation Method", @@ -693,6 +719,7 @@ "fieldtype": "Data", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Warranty Period (in days)", @@ -720,6 +747,7 @@ "fieldtype": "Float", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Net Weight", @@ -744,6 +772,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 1, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Weight UOM", @@ -770,6 +799,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Auto re-order", @@ -796,6 +826,7 @@ "fieldtype": "Table", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Reorder level based on Warehouse", @@ -822,6 +853,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Variants", @@ -849,6 +881,7 @@ "fieldtype": "Check", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Has Variants", @@ -875,6 +908,7 @@ "fieldtype": "Table", "hidden": 1, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Attributes", @@ -900,6 +934,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Purchase Details", @@ -927,6 +962,7 @@ "fieldtype": "Check", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Is Purchase Item", @@ -956,6 +992,7 @@ "fieldtype": "Float", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Minimum Order Qty", @@ -983,6 +1020,7 @@ "fieldtype": "Int", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Lead Time in days", @@ -1010,6 +1048,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 1, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Default Buying Cost Center", @@ -1038,6 +1077,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 1, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Default Expense Account", @@ -1065,6 +1105,7 @@ "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Unit of Measure Conversion", @@ -1091,6 +1132,7 @@ "fieldtype": "Table", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "UOMs", @@ -1118,6 +1160,7 @@ "fieldtype": "Float", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Last Purchase Rate", @@ -1144,6 +1187,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Supplier Details", @@ -1169,6 +1213,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 1, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Default Supplier", @@ -1193,6 +1238,7 @@ "fieldtype": "Check", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Delivered by Supplier (Drop Ship)", @@ -1218,6 +1264,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Manufacturer", @@ -1243,6 +1290,7 @@ "fieldtype": "Data", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Manufacturer Part Number", @@ -1267,6 +1315,7 @@ "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Item Code for Suppliers", @@ -1293,6 +1342,7 @@ "fieldtype": "Table", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Supplier Items", @@ -1317,6 +1367,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Sales Details", @@ -1344,6 +1395,7 @@ "fieldtype": "Check", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 0, "label": "Is Sales Item", @@ -1373,6 +1425,7 @@ "fieldtype": "Check", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 0, "label": "Is Service Item", @@ -1401,6 +1454,7 @@ "fieldtype": "Check", "hidden": 1, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Publish in Hub", @@ -1426,6 +1480,7 @@ "fieldtype": "Check", "hidden": 1, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Synced With Hub", @@ -1451,6 +1506,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 1, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Default Income Account", @@ -1476,6 +1532,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 1, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Default Selling Cost Center", @@ -1501,6 +1558,7 @@ "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Customer Item Codes", @@ -1528,6 +1586,7 @@ "fieldtype": "Table", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Customer Items", @@ -1553,6 +1612,7 @@ "fieldtype": "Float", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Max Discount (%)", @@ -1578,6 +1638,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Item Tax", @@ -1604,6 +1665,7 @@ "fieldtype": "Table", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Taxes", @@ -1630,6 +1692,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Inspection Criteria", @@ -1656,6 +1719,7 @@ "fieldtype": "Check", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Inspection Required", @@ -1684,6 +1748,7 @@ "fieldtype": "Table", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Quality Parameters", @@ -1710,6 +1775,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Manufacturing", @@ -1738,6 +1804,7 @@ "fieldtype": "Check", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Allow Production Order", @@ -1766,6 +1833,7 @@ "fieldtype": "Check", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Supply Raw Materials for Purchase", @@ -1792,6 +1860,7 @@ "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "length": 0, @@ -1816,6 +1885,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 1, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Default BOM", @@ -1842,6 +1912,7 @@ "fieldtype": "Data", "hidden": 1, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 0, "label": "Customer Code", @@ -1865,6 +1936,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Website", @@ -1889,6 +1961,7 @@ "fieldtype": "Check", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Show in Website", @@ -1914,6 +1987,7 @@ "fieldtype": "Data", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Page Name", @@ -1939,6 +2013,7 @@ "fieldtype": "Int", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Weightage", @@ -1964,6 +2039,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Slideshow", @@ -1990,6 +2066,7 @@ "fieldtype": "Attach", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Image", @@ -2014,6 +2091,7 @@ "fieldtype": "Data", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Thumbnail", @@ -2038,6 +2116,7 @@ "fieldtype": "Column Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "length": 0, @@ -2062,6 +2141,7 @@ "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 1, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Website Warehouse", @@ -2088,6 +2168,7 @@ "fieldtype": "Table", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Website Item Groups", @@ -2114,6 +2195,7 @@ "fieldtype": "Section Break", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Website Specifications", @@ -2138,6 +2220,7 @@ "fieldtype": "Button", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Copy From Item Group", @@ -2162,6 +2245,7 @@ "fieldtype": "Table", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Website Specifications", @@ -2187,6 +2271,7 @@ "fieldtype": "Text Editor", "hidden": 0, "ignore_user_permissions": 0, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Website Description", @@ -2210,6 +2295,7 @@ "fieldtype": "Read Only", "hidden": 0, "ignore_user_permissions": 1, + "ignore_xss_filter": 0, "in_filter": 0, "in_list_view": 0, "label": "Parent Website Route", @@ -2237,7 +2323,7 @@ "issingle": 0, "istable": 0, "max_attachments": 1, - "modified": "2016-02-08 01:15:52.177625", + "modified": "2016-03-10 05:15:41.190950", "modified_by": "Administrator", "module": "Stock", "name": "Item", diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js index a4df2d8c76..fac8555456 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js @@ -184,7 +184,7 @@ cur_frm.cscript.new_contact = function() { loaddoc('Contact', tn); } -cur_frm.fields_dict['items'].grid.get_field('project_name').get_query = function(doc, cdt, cdn) { +cur_frm.fields_dict['items'].grid.get_field('project').get_query = function(doc, cdt, cdn) { return { filters: [ ['Project', 'status', 'not in', 'Completed, Cancelled'] diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py index 454b386948..8ee6de9d0e 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py @@ -116,7 +116,7 @@ class PurchaseReceipt(BuyingController): }, "Purchase Order Item": { "ref_dn_field": "prevdoc_detail_docname", - "compare_fields": [["project_name", "="], ["uom", "="], ["item_code", "="]], + "compare_fields": [["project", "="], ["uom", "="], ["item_code", "="]], "is_child_table": True } }) diff --git a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json index 106bba2a8d..678ee5afa1 100755 --- a/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json +++ b/erpnext/stock/doctype/purchase_receipt_item/purchase_receipt_item.json @@ -1310,14 +1310,14 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, - "fieldname": "project_name", + "fieldname": "project", "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 0, - "label": "Project Name", + "label": "Project", "length": 0, "no_copy": 0, "options": "Project", @@ -1715,7 +1715,7 @@ "issingle": 0, "istable": 1, "max_attachments": 0, - "modified": "2016-02-22 09:33:38.187041", + "modified": "2016-03-10 05:11:15.937267", "modified_by": "Administrator", "module": "Stock", "name": "Purchase Receipt Item", diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.json b/erpnext/stock/doctype/stock_entry/stock_entry.json index 289b6fe6f1..495900f08f 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.json +++ b/erpnext/stock/doctype/stock_entry/stock_entry.json @@ -7,6 +7,7 @@ "custom": 0, "docstatus": 0, "doctype": "DocType", + "document_type": "Document", "fields": [ { "allow_on_submit": 0, @@ -1241,17 +1242,16 @@ "allow_on_submit": 0, "bold": 0, "collapsible": 0, - "fieldname": "project_name", + "fieldname": "project", "fieldtype": "Link", "hidden": 0, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_filter": 1, "in_list_view": 0, - "label": "Project Name", + "label": "Project", "length": 0, "no_copy": 0, - "oldfieldname": "project_name", "oldfieldtype": "Link", "options": "Project", "permlevel": 0, @@ -1431,7 +1431,7 @@ "issingle": 0, "istable": 0, "max_attachments": 0, - "modified": "2016-03-03 05:11:33.716402", + "modified": "2016-03-07 08:37:08.747493", "modified_by": "Administrator", "module": "Stock", "name": "Stock Entry", diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index 9fbde8d31c..0c0b582856 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -91,7 +91,7 @@ class StockEntry(StockController): frappe.throw(_("{0} is not a stock Item").format(item.item_code)) item_details = self.get_item_details(frappe._dict({"item_code": item.item_code, - "company": self.company, "project_name": self.project_name, "uom": item.uom}), for_update=True) + "company": self.company, "project": self.project, "uom": item.uom}), for_update=True) for f in ("uom", "stock_uom", "description", "item_name", "expense_account", "cost_center", "conversion_factor"): diff --git a/erpnext/stock/get_item_details.py b/erpnext/stock/get_item_details.py index 8f35de54ac..7808e5006c 100644 --- a/erpnext/stock/get_item_details.py +++ b/erpnext/stock/get_item_details.py @@ -29,7 +29,7 @@ def get_item_details(args): "buying_price_list": None, "is_subcontracted": "Yes" / "No", "ignore_pricing_rule": 0/1 - "project_name": "" + "project": "" } """ args = process_args(args) @@ -210,7 +210,7 @@ def get_default_expense_account(args, item): or frappe.db.get_value("Item Group", item.item_group, "default_expense_account")) def get_default_cost_center(args, item): - return (frappe.db.get_value("Project", args.get("project_name"), "cost_center") + return (frappe.db.get_value("Project", args.get("project"), "cost_center") or (item.selling_cost_center if args.get("customer") else item.buying_cost_center) or frappe.db.get_value("Item Group", item.item_group, "default_cost_center") or args.get("cost_center")) diff --git a/erpnext/stock/report/ordered_items_to_be_delivered/ordered_items_to_be_delivered.json b/erpnext/stock/report/ordered_items_to_be_delivered/ordered_items_to_be_delivered.json index f6c847758b..6f857a0b83 100644 --- a/erpnext/stock/report/ordered_items_to_be_delivered/ordered_items_to_be_delivered.json +++ b/erpnext/stock/report/ordered_items_to_be_delivered/ordered_items_to_be_delivered.json @@ -12,7 +12,7 @@ "module": "Stock", "name": "Ordered Items To Be Delivered", "owner": "Administrator", - "query": "select \n `tabSales Order`.`name` as \"Sales Order:Link/Sales Order:120\",\n `tabSales Order`.`customer` as \"Customer:Link/Customer:120\",\n `tabSales Order`.`transaction_date` as \"Date:Date\",\n `tabSales Order`.`project_name` as \"Project\",\n `tabSales Order Item`.item_code as \"Item:Link/Item:120\",\n `tabSales Order Item`.qty as \"Qty:Float:140\",\n `tabSales Order Item`.delivered_qty as \"Delivered Qty:Float:140\",\n (`tabSales Order Item`.qty - ifnull(`tabSales Order Item`.delivered_qty, 0)) as \"Qty to Deliver:Float:140\",\n `tabSales Order Item`.base_rate as \"Rate:Float:140\",\n `tabSales Order Item`.base_amount as \"Amount:Float:140\",\n ((`tabSales Order Item`.qty - ifnull(`tabSales Order Item`.delivered_qty, 0))*`tabSales Order Item`.base_rate) as \"Amount to Deliver:Float:140\",\n `tabBin`.actual_qty as \"Available Qty:Float:120\",\n `tabBin`.projected_qty as \"Projected Qty:Float:120\",\n `tabSales Order`.`delivery_date` as \"Expected Delivery Date:Date:120\",\n `tabSales Order Item`.item_name as \"Item Name::150\",\n `tabSales Order Item`.description as \"Description::200\",\n `tabSales Order Item`.item_group as \"Item Group:Link/Item Group:120\",\n `tabSales Order Item`.warehouse as \"Warehouse:Link/Warehouse:200\"\nfrom\n `tabSales Order` JOIN `tabSales Order Item` \n LEFT JOIN `tabBin` ON (`tabBin`.item_code = `tabSales Order Item`.item_code\n and `tabBin`.warehouse = `tabSales Order Item`.warehouse)\nwhere\n `tabSales Order Item`.`parent` = `tabSales Order`.`name`\n and `tabSales Order`.docstatus = 1\n and `tabSales Order`.status not in (\"Stopped\", \"Closed\")\n and ifnull(`tabSales Order Item`.delivered_qty,0) < ifnull(`tabSales Order Item`.qty,0)\norder by `tabSales Order`.transaction_date asc", + "query": "select \n `tabSales Order`.`name` as \"Sales Order:Link/Sales Order:120\",\n `tabSales Order`.`customer` as \"Customer:Link/Customer:120\",\n `tabSales Order`.`transaction_date` as \"Date:Date\",\n `tabSales Order`.`project` as \"Project\",\n `tabSales Order Item`.item_code as \"Item:Link/Item:120\",\n `tabSales Order Item`.qty as \"Qty:Float:140\",\n `tabSales Order Item`.delivered_qty as \"Delivered Qty:Float:140\",\n (`tabSales Order Item`.qty - ifnull(`tabSales Order Item`.delivered_qty, 0)) as \"Qty to Deliver:Float:140\",\n `tabSales Order Item`.base_rate as \"Rate:Float:140\",\n `tabSales Order Item`.base_amount as \"Amount:Float:140\",\n ((`tabSales Order Item`.qty - ifnull(`tabSales Order Item`.delivered_qty, 0))*`tabSales Order Item`.base_rate) as \"Amount to Deliver:Float:140\",\n `tabBin`.actual_qty as \"Available Qty:Float:120\",\n `tabBin`.projected_qty as \"Projected Qty:Float:120\",\n `tabSales Order`.`delivery_date` as \"Expected Delivery Date:Date:120\",\n `tabSales Order Item`.item_name as \"Item Name::150\",\n `tabSales Order Item`.description as \"Description::200\",\n `tabSales Order Item`.item_group as \"Item Group:Link/Item Group:120\",\n `tabSales Order Item`.warehouse as \"Warehouse:Link/Warehouse:200\"\nfrom\n `tabSales Order` JOIN `tabSales Order Item` \n LEFT JOIN `tabBin` ON (`tabBin`.item_code = `tabSales Order Item`.item_code\n and `tabBin`.warehouse = `tabSales Order Item`.warehouse)\nwhere\n `tabSales Order Item`.`parent` = `tabSales Order`.`name`\n and `tabSales Order`.docstatus = 1\n and `tabSales Order`.status not in (\"Stopped\", \"Closed\")\n and ifnull(`tabSales Order Item`.delivered_qty,0) < ifnull(`tabSales Order Item`.qty,0)\norder by `tabSales Order`.transaction_date asc", "ref_doctype": "Delivery Note", "report_name": "Ordered Items To Be Delivered", "report_type": "Query Report" diff --git a/erpnext/stock/report/purchase_order_items_to_be_received/purchase_order_items_to_be_received.json b/erpnext/stock/report/purchase_order_items_to_be_received/purchase_order_items_to_be_received.json index bca9a20fd7..d62bf76a57 100644 --- a/erpnext/stock/report/purchase_order_items_to_be_received/purchase_order_items_to_be_received.json +++ b/erpnext/stock/report/purchase_order_items_to_be_received/purchase_order_items_to_be_received.json @@ -12,7 +12,7 @@ "module": "Stock", "name": "Purchase Order Items To Be Received", "owner": "Administrator", - "query": "select \n `tabPurchase Order`.`name` as \"Purchase Order:Link/Purchase Order:120\",\n\t`tabPurchase Order`.`transaction_date` as \"Date:Date:100\",\n\t`tabPurchase Order Item`.`schedule_date` as \"Reqd by Date:Date:110\",\n\t`tabPurchase Order`.`supplier` as \"Supplier:Link/Supplier:120\",\n\t`tabPurchase Order Item`.`project_name` as \"Project\",\n\t`tabPurchase Order Item`.item_code as \"Item Code:Link/Item:120\",\n\t`tabPurchase Order Item`.qty as \"Qty:Float:100\",\n\t`tabPurchase Order Item`.received_qty as \"Received Qty:Float:100\", \n\t(`tabPurchase Order Item`.qty - ifnull(`tabPurchase Order Item`.received_qty, 0)) as \"Qty to Receive:Float:100\",\n `tabPurchase Order Item`.warehouse as \"Warehouse:Link/Warehouse:150\",\n\t`tabPurchase Order Item`.item_name as \"Item Name::150\",\n\t`tabPurchase Order Item`.description as \"Description::200\",\n `tabPurchase Order Item`.brand as \"Brand::100\",\n\t`tabPurchase Order`.`company` as \"Company:Link/Company:\"\nfrom\n\t`tabPurchase Order`, `tabPurchase Order Item`\nwhere\n\t`tabPurchase Order Item`.`parent` = `tabPurchase Order`.`name`\n\tand `tabPurchase Order`.docstatus = 1\n\tand `tabPurchase Order`.status not in (\"Stopped\", \"Closed\")\n\tand ifnull(`tabPurchase Order Item`.received_qty, 0) < ifnull(`tabPurchase Order Item`.qty, 0)\norder by `tabPurchase Order`.transaction_date asc", + "query": "select \n `tabPurchase Order`.`name` as \"Purchase Order:Link/Purchase Order:120\",\n\t`tabPurchase Order`.`transaction_date` as \"Date:Date:100\",\n\t`tabPurchase Order Item`.`schedule_date` as \"Reqd by Date:Date:110\",\n\t`tabPurchase Order`.`supplier` as \"Supplier:Link/Supplier:120\",\n\t`tabPurchase Order Item`.`project` as \"Project\",\n\t`tabPurchase Order Item`.item_code as \"Item Code:Link/Item:120\",\n\t`tabPurchase Order Item`.qty as \"Qty:Float:100\",\n\t`tabPurchase Order Item`.received_qty as \"Received Qty:Float:100\", \n\t(`tabPurchase Order Item`.qty - ifnull(`tabPurchase Order Item`.received_qty, 0)) as \"Qty to Receive:Float:100\",\n `tabPurchase Order Item`.warehouse as \"Warehouse:Link/Warehouse:150\",\n\t`tabPurchase Order Item`.item_name as \"Item Name::150\",\n\t`tabPurchase Order Item`.description as \"Description::200\",\n `tabPurchase Order Item`.brand as \"Brand::100\",\n\t`tabPurchase Order`.`company` as \"Company:Link/Company:\"\nfrom\n\t`tabPurchase Order`, `tabPurchase Order Item`\nwhere\n\t`tabPurchase Order Item`.`parent` = `tabPurchase Order`.`name`\n\tand `tabPurchase Order`.docstatus = 1\n\tand `tabPurchase Order`.status not in (\"Stopped\", \"Closed\")\n\tand ifnull(`tabPurchase Order Item`.received_qty, 0) < ifnull(`tabPurchase Order Item`.qty, 0)\norder by `tabPurchase Order`.transaction_date asc", "ref_doctype": "Purchase Receipt", "report_name": "Purchase Order Items To Be Received", "report_type": "Query Report"