[fix] minor for quick-entry

This commit is contained in:
Rushabh Mehta 2016-03-29 11:53:07 +05:30
parent 9904c5acf4
commit 3117b4b8d6
10 changed files with 61 additions and 16 deletions

View File

@ -39,7 +39,7 @@ erpnext.hr.ExpenseClaimController = frappe.ui.form.Controller.extend({
d1.account_type = r.message.account_type; d1.account_type = r.message.account_type;
} }
loaddoc('Journal Entry', jv.name); frappe.set_route('Form', 'Journal Entry', jv.name);
} }
}); });
} }

View File

@ -37,7 +37,7 @@
}, },
{ {
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 1,
"collapsible": 0, "collapsible": 0,
"fieldname": "project", "fieldname": "project",
"fieldtype": "Link", "fieldtype": "Link",
@ -770,7 +770,7 @@
"istable": 0, "istable": 0,
"max_attachments": 5, "max_attachments": 5,
"menu_index": 0, "menu_index": 0,
"modified": "2016-03-25 05:27:03.346334", "modified": "2016-03-29 01:01:50.074252",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Projects", "module": "Projects",
"name": "Task", "name": "Task",

View File

@ -216,7 +216,7 @@ cur_frm.cscript.new_contact = function(){
tn = frappe.model.make_new_doc_and_get_name('Contact'); tn = frappe.model.make_new_doc_and_get_name('Contact');
locals['Contact'][tn].is_customer = 1; locals['Contact'][tn].is_customer = 1;
if(doc.customer) locals['Contact'][tn].customer = doc.customer; if(doc.customer) locals['Contact'][tn].customer = doc.customer;
loaddoc('Contact', tn); frappe.set_route('Form', 'Contact', tn);
} }
cur_frm.fields_dict['project'].get_query = function(doc, cdt, cdn) { cur_frm.fields_dict['project'].get_query = function(doc, cdt, cdn) {

View File

@ -18,6 +18,7 @@
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0, "hidden": 0,
"ignore_user_permissions": 0, "ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"label": "General Settings", "label": "General Settings",
@ -25,6 +26,7 @@
"no_copy": 0, "no_copy": 0,
"permlevel": 0, "permlevel": 0,
"print_hide": 0, "print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0, "read_only": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 0, "reqd": 0,
@ -40,6 +42,7 @@
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 0, "hidden": 0,
"ignore_user_permissions": 0, "ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 1, "in_list_view": 1,
"label": "Item Group Name", "label": "Item Group Name",
@ -49,6 +52,7 @@
"oldfieldtype": "Data", "oldfieldtype": "Data",
"permlevel": 0, "permlevel": 0,
"print_hide": 0, "print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0, "read_only": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 1, "reqd": 1,
@ -58,13 +62,14 @@
}, },
{ {
"allow_on_submit": 0, "allow_on_submit": 0,
"bold": 0, "bold": 1,
"collapsible": 0, "collapsible": 0,
"description": "", "description": "",
"fieldname": "parent_item_group", "fieldname": "parent_item_group",
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0, "hidden": 0,
"ignore_user_permissions": 1, "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 1, "in_list_view": 1,
"label": "Parent Item Group", "label": "Parent Item Group",
@ -75,6 +80,7 @@
"options": "Item Group", "options": "Item Group",
"permlevel": 0, "permlevel": 0,
"print_hide": 0, "print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0, "read_only": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 0, "reqd": 0,
@ -91,6 +97,7 @@
"fieldtype": "Select", "fieldtype": "Select",
"hidden": 0, "hidden": 0,
"ignore_user_permissions": 0, "ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 1, "in_list_view": 1,
"label": "Has Child Node", "label": "Has Child Node",
@ -101,6 +108,7 @@
"options": "\nYes\nNo", "options": "\nYes\nNo",
"permlevel": 0, "permlevel": 0,
"print_hide": 0, "print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0, "read_only": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 1, "reqd": 1,
@ -116,12 +124,14 @@
"fieldtype": "Column Break", "fieldtype": "Column Break",
"hidden": 0, "hidden": 0,
"ignore_user_permissions": 0, "ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"length": 0, "length": 0,
"no_copy": 0, "no_copy": 0,
"permlevel": 0, "permlevel": 0,
"print_hide": 0, "print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0, "read_only": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 0, "reqd": 0,
@ -137,6 +147,7 @@
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0, "hidden": 0,
"ignore_user_permissions": 0, "ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"label": "Default Income Account", "label": "Default Income Account",
@ -145,6 +156,7 @@
"options": "Account", "options": "Account",
"permlevel": 0, "permlevel": 0,
"print_hide": 0, "print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0, "read_only": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 0, "reqd": 0,
@ -160,6 +172,7 @@
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0, "hidden": 0,
"ignore_user_permissions": 0, "ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"label": "Default Expense Account", "label": "Default Expense Account",
@ -168,6 +181,7 @@
"options": "Account", "options": "Account",
"permlevel": 0, "permlevel": 0,
"print_hide": 0, "print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0, "read_only": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 0, "reqd": 0,
@ -183,6 +197,7 @@
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0, "hidden": 0,
"ignore_user_permissions": 0, "ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"label": "Default Cost Center", "label": "Default Cost Center",
@ -191,6 +206,7 @@
"options": "Cost Center", "options": "Cost Center",
"permlevel": 0, "permlevel": 0,
"print_hide": 0, "print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0, "read_only": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 0, "reqd": 0,
@ -206,6 +222,7 @@
"fieldtype": "Section Break", "fieldtype": "Section Break",
"hidden": 0, "hidden": 0,
"ignore_user_permissions": 0, "ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"label": "Website Settings", "label": "Website Settings",
@ -213,6 +230,7 @@
"no_copy": 0, "no_copy": 0,
"permlevel": 0, "permlevel": 0,
"print_hide": 0, "print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0, "read_only": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 0, "reqd": 0,
@ -229,6 +247,7 @@
"fieldtype": "Check", "fieldtype": "Check",
"hidden": 0, "hidden": 0,
"ignore_user_permissions": 0, "ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"label": "Show in Website", "label": "Show in Website",
@ -236,6 +255,7 @@
"no_copy": 0, "no_copy": 0,
"permlevel": 0, "permlevel": 0,
"print_hide": 0, "print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0, "read_only": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 0, "reqd": 0,
@ -252,6 +272,7 @@
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 0, "hidden": 0,
"ignore_user_permissions": 0, "ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"label": "Page Name", "label": "Page Name",
@ -259,6 +280,7 @@
"no_copy": 0, "no_copy": 0,
"permlevel": 0, "permlevel": 0,
"print_hide": 0, "print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0, "read_only": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 0, "reqd": 0,
@ -275,6 +297,7 @@
"fieldtype": "Read Only", "fieldtype": "Read Only",
"hidden": 0, "hidden": 0,
"ignore_user_permissions": 0, "ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"label": "Parent Website Route", "label": "Parent Website Route",
@ -283,6 +306,7 @@
"options": "", "options": "",
"permlevel": 0, "permlevel": 0,
"print_hide": 0, "print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 1, "read_only": 1,
"report_hide": 0, "report_hide": 0,
"reqd": 0, "reqd": 0,
@ -300,6 +324,7 @@
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 0, "hidden": 0,
"ignore_user_permissions": 0, "ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"label": "Slideshow", "label": "Slideshow",
@ -308,6 +333,7 @@
"options": "Website Slideshow", "options": "Website Slideshow",
"permlevel": 0, "permlevel": 0,
"print_hide": 0, "print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0, "read_only": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 0, "reqd": 0,
@ -325,6 +351,7 @@
"fieldtype": "Text Editor", "fieldtype": "Text Editor",
"hidden": 0, "hidden": 0,
"ignore_user_permissions": 0, "ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"label": "Description", "label": "Description",
@ -332,6 +359,7 @@
"no_copy": 0, "no_copy": 0,
"permlevel": 0, "permlevel": 0,
"print_hide": 0, "print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0, "read_only": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 0, "reqd": 0,
@ -348,6 +376,7 @@
"fieldtype": "Table", "fieldtype": "Table",
"hidden": 0, "hidden": 0,
"ignore_user_permissions": 0, "ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"label": "Website Specifications", "label": "Website Specifications",
@ -356,6 +385,7 @@
"options": "Item Website Specification", "options": "Item Website Specification",
"permlevel": 0, "permlevel": 0,
"print_hide": 0, "print_hide": 0,
"print_hide_if_no_value": 0,
"read_only": 0, "read_only": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 0, "reqd": 0,
@ -371,6 +401,7 @@
"fieldtype": "Int", "fieldtype": "Int",
"hidden": 1, "hidden": 1,
"ignore_user_permissions": 0, "ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 1, "in_filter": 1,
"in_list_view": 0, "in_list_view": 0,
"label": "lft", "label": "lft",
@ -380,6 +411,7 @@
"oldfieldtype": "Int", "oldfieldtype": "Int",
"permlevel": 0, "permlevel": 0,
"print_hide": 1, "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0, "read_only": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 0, "reqd": 0,
@ -395,6 +427,7 @@
"fieldtype": "Int", "fieldtype": "Int",
"hidden": 1, "hidden": 1,
"ignore_user_permissions": 0, "ignore_user_permissions": 0,
"ignore_xss_filter": 0,
"in_filter": 1, "in_filter": 1,
"in_list_view": 0, "in_list_view": 0,
"label": "rgt", "label": "rgt",
@ -404,6 +437,7 @@
"oldfieldtype": "Int", "oldfieldtype": "Int",
"permlevel": 0, "permlevel": 0,
"print_hide": 1, "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0, "read_only": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 0, "reqd": 0,
@ -420,6 +454,7 @@
"fieldtype": "Link", "fieldtype": "Link",
"hidden": 1, "hidden": 1,
"ignore_user_permissions": 1, "ignore_user_permissions": 1,
"ignore_xss_filter": 0,
"in_filter": 0, "in_filter": 0,
"in_list_view": 0, "in_list_view": 0,
"label": "old_parent", "label": "old_parent",
@ -430,6 +465,7 @@
"options": "Item Group", "options": "Item Group",
"permlevel": 0, "permlevel": 0,
"print_hide": 1, "print_hide": 1,
"print_hide_if_no_value": 0,
"read_only": 0, "read_only": 0,
"report_hide": 1, "report_hide": 1,
"reqd": 0, "reqd": 0,
@ -448,7 +484,7 @@
"issingle": 0, "issingle": 0,
"istable": 0, "istable": 0,
"max_attachments": 3, "max_attachments": 3,
"modified": "2015-11-16 06:29:48.316308", "modified": "2016-03-28 08:38:30.868523",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Setup", "module": "Setup",
"name": "Item Group", "name": "Item Group",
@ -577,5 +613,7 @@
], ],
"read_only": 0, "read_only": 0,
"read_only_onload": 0, "read_only_onload": 0,
"search_fields": "parent_item_group" "search_fields": "parent_item_group",
"sort_order": "DESC",
"track_seen": 0
} }

View File

@ -122,7 +122,7 @@ cur_frm.cscript.new_contact = function(){
tn = frappe.model.make_new_doc_and_get_name('Contact'); tn = frappe.model.make_new_doc_and_get_name('Contact');
locals['Contact'][tn].is_customer = 1; locals['Contact'][tn].is_customer = 1;
if(doc.customer) locals['Contact'][tn].customer = doc.customer; if(doc.customer) locals['Contact'][tn].customer = doc.customer;
loaddoc('Contact', tn); frappe.set_route('Form', 'Contact', tn);
} }

View File

@ -246,7 +246,7 @@
"print_hide_if_no_value": 0, "print_hide_if_no_value": 0,
"read_only": 0, "read_only": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 0, "reqd": 1,
"search_index": 0, "search_index": 0,
"set_only_once": 0, "set_only_once": 0,
"unique": 0 "unique": 0
@ -425,7 +425,7 @@
"print_hide_if_no_value": 0, "print_hide_if_no_value": 0,
"read_only": 0, "read_only": 0,
"report_hide": 0, "report_hide": 0,
"reqd": 1, "reqd": 0,
"search_index": 0, "search_index": 0,
"set_only_once": 0, "set_only_once": 0,
"unique": 0 "unique": 0
@ -2323,7 +2323,7 @@
"issingle": 0, "issingle": 0,
"istable": 0, "istable": 0,
"max_attachments": 1, "max_attachments": 1,
"modified": "2016-03-10 05:15:41.190950", "modified": "2016-03-28 08:29:07.922559",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Stock", "module": "Stock",
"name": "Item", "name": "Item",
@ -2494,5 +2494,6 @@
"read_only_onload": 0, "read_only_onload": 0,
"search_fields": "item_name,description,item_group,customer_code", "search_fields": "item_name,description,item_group,customer_code",
"sort_order": "DESC", "sort_order": "DESC",
"title_field": "item_name" "title_field": "item_name",
"track_seen": 0
} }

View File

@ -52,11 +52,14 @@ class Item(WebsiteGenerator):
if self.is_sales_item=="Yes": if self.is_sales_item=="Yes":
self.publish_in_hub = 1 self.publish_in_hub = 1
if not self.description:
self.description = self.item_name
def validate(self): def validate(self):
super(Item, self).validate() super(Item, self).validate()
if not self.stock_uom: if not self.description:
msgprint(_("Please enter default Unit of Measure"), raise_exception=1) self.description = self.item_name
self.validate_uom() self.validate_uom()
self.add_default_uom_in_conversion_factor_table() self.add_default_uom_in_conversion_factor_table()

View File

@ -181,7 +181,7 @@ cur_frm.cscript.new_contact = function() {
locals['Contact'][tn].is_supplier = 1; locals['Contact'][tn].is_supplier = 1;
if(doc.supplier) if(doc.supplier)
locals['Contact'][tn].supplier = doc.supplier; locals['Contact'][tn].supplier = doc.supplier;
loaddoc('Contact', tn); frappe.set_route('Form', 'Contact', tn);
} }
cur_frm.fields_dict['items'].grid.get_field('project').get_query = function(doc, cdt, cdn) { cur_frm.fields_dict['items'].grid.get_field('project').get_query = function(doc, cdt, cdn) {

View File

@ -180,7 +180,7 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({
var excise = frappe.model.make_new_doc_and_get_name('Journal Entry'); var excise = frappe.model.make_new_doc_and_get_name('Journal Entry');
excise = locals['Journal Entry'][excise]; excise = locals['Journal Entry'][excise];
excise.voucher_type = 'Excise Entry'; excise.voucher_type = 'Excise Entry';
loaddoc('Journal Entry', excise.name); frappe.set_route('Form', 'Journal Entry', excise.name);
}, __("Make")); }, __("Make"));
cur_frm.page.set_inner_btn_group_as_primary(__("Make")); cur_frm.page.set_inner_btn_group_as_primary(__("Make"));
}, },

View File

@ -11,6 +11,9 @@ from frappe import _
class FindItemBot(BotParser): class FindItemBot(BotParser):
def get_reply(self): def get_reply(self):
if self.startswith('where is', 'find item', 'locate'): if self.startswith('where is', 'find item', 'locate'):
if not frappe.has_permission('Warehouse'):
raise frappe.PermissionError
item = '%{0}%'.format(self.strip_words(self.query, 'where is', 'find item', 'locate')) item = '%{0}%'.format(self.strip_words(self.query, 'where is', 'find item', 'locate'))
items = frappe.db.sql('''select name from `tabItem` where item_code like %(txt)s items = frappe.db.sql('''select name from `tabItem` where item_code like %(txt)s
or item_name like %(txt)s or description like %(txt)s''', dict(txt=item)) or item_name like %(txt)s or description like %(txt)s''', dict(txt=item))