commonified in_words function

This commit is contained in:
Nabin Hait
2013-01-22 11:12:02 +05:30
130 changed files with 2125 additions and 1833 deletions

View File

@@ -0,0 +1,21 @@
// ERPNext - web based ERP (http://erpnext.com)
// Copyright (C) 2012 Web Notes Technologies Pvt Ltd
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
cur_frm.fields_dict['item'].get_query = function(doc, cdt, cdn) {
return erpnext.queries.item({
'ifnull(tabItem.is_stock_item, "No")': 'Yes'
})
}

View File

@@ -9,13 +9,13 @@
{
"section_style": "Simple",
"module": "Stock",
"server_code_error": " ",
"allow_trash": 1,
"doctype": "DocType",
"autoname": "field:batch_id",
"allow_trash": 1,
"document_type": "Master",
"autoname": "field:batch_id",
"name": "__common__",
"colour": "White:FFF",
"server_code_error": " ",
"version": 12
},
{
@@ -43,6 +43,7 @@
"doctype": "DocPerm",
"write": 1,
"cancel": 1,
"report": 1,
"permlevel": 0
},
{
@@ -111,10 +112,10 @@
"doctype": "DocField",
"label": "Item",
"oldfieldname": "item",
"permlevel": 0,
"options": "Item",
"fieldname": "item",
"fieldtype": "Link",
"reqd": 1,
"options": "Item"
"permlevel": 0
}
]

View File

@@ -12,9 +12,9 @@
"search_fields": "item_code,warehouse",
"module": "Stock",
"server_code_error": " ",
"autoname": "BIN/.#######",
"read_only": 0,
"_last_update": "1322549701",
"autoname": "BIN/.#######",
"name": "__common__",
"colour": "White:FFF",
"doctype": "DocType",
@@ -36,6 +36,7 @@
"read": 1,
"doctype": "DocPerm",
"parenttype": "DocType",
"report": 1,
"permlevel": 0,
"parentfield": "permissions"
},

View File

@@ -88,10 +88,10 @@
"depends_on": "customer",
"doctype": "DocField",
"label": "Select Shipping Address",
"options": "Address",
"permlevel": 0,
"fieldname": "customer_address",
"fieldtype": "Link",
"permlevel": 0,
"options": "Address",
"in_filter": 1
},
{
@@ -149,8 +149,8 @@
"fieldtype": "Date",
"search_index": 1,
"reqd": 1,
"in_filter": 1,
"width": "100px"
"width": "100px",
"in_filter": 1
},
{
"print_hide": 1,
@@ -219,10 +219,10 @@
"doctype": "DocField",
"label": "Delivery Note Items",
"oldfieldname": "delivery_note_details",
"permlevel": 0,
"options": "Delivery Note Item",
"fieldname": "delivery_note_details",
"fieldtype": "Table",
"options": "Delivery Note Item"
"permlevel": 0
},
{
"print_hide": 1,
@@ -234,10 +234,10 @@
},
{
"doctype": "DocField",
"options": "Simple",
"permlevel": 0,
"fieldname": "section_break0",
"fieldtype": "Section Break",
"permlevel": 0
"options": "Simple"
},
{
"doctype": "DocField",
@@ -281,21 +281,21 @@
"doctype": "DocField",
"label": "Sales Order No",
"oldfieldname": "sales_order_no",
"permlevel": 0,
"options": "Sales Order",
"fieldname": "sales_order_no",
"fieldtype": "Link",
"options": "Sales Order"
"permlevel": 0
},
{
"print_hide": 1,
"oldfieldtype": "Button",
"doctype": "DocField",
"label": "Get Items",
"options": "pull_sales_order_details",
"permlevel": 0,
"fieldname": "get_items",
"fieldtype": "Button",
"hidden": 0,
"permlevel": 0
"options": "pull_sales_order_details"
},
{
"doctype": "DocField",
@@ -317,22 +317,22 @@
"doctype": "DocField",
"label": "Price List",
"oldfieldname": "price_list_name",
"permlevel": 0,
"options": "link:Price List",
"fieldname": "price_list_name",
"fieldtype": "Select",
"reqd": 1,
"options": "link:Price List"
"permlevel": 0
},
{
"print_hide": 1,
"description": "Select the currency in which price list is maintained",
"doctype": "DocField",
"label": "Price List Currency",
"options": "link:Currency",
"permlevel": 0,
"fieldname": "price_list_currency",
"fieldtype": "Select",
"reqd": 1,
"permlevel": 0
"options": "link:Currency"
},
{
"print_hide": 1,
@@ -359,11 +359,11 @@
"doctype": "DocField",
"label": "Currency",
"oldfieldname": "currency",
"permlevel": 0,
"options": "link:Currency",
"fieldname": "currency",
"fieldtype": "Select",
"reqd": 1,
"options": "link:Currency"
"permlevel": 0
},
{
"print_hide": 1,
@@ -394,10 +394,10 @@
"doctype": "DocField",
"label": "Taxes and Charges",
"oldfieldname": "charge",
"options": "Sales Taxes and Charges Master",
"permlevel": 0,
"fieldname": "charge",
"fieldtype": "Link",
"permlevel": 0
"options": "Sales Taxes and Charges Master"
},
{
"print_hide": 1,
@@ -414,10 +414,10 @@
"doctype": "DocField",
"label": "Sales Taxes and Charges",
"oldfieldname": "other_charges",
"options": "Sales Taxes and Charges",
"permlevel": 0,
"fieldname": "other_charges",
"fieldtype": "Table",
"permlevel": 0
"options": "Sales Taxes and Charges"
},
{
"print_hide": 1,
@@ -560,30 +560,30 @@
"doctype": "DocField",
"label": "Select Terms and Conditions",
"oldfieldname": "tc_name",
"options": "Terms and Conditions",
"permlevel": 0,
"fieldname": "tc_name",
"fieldtype": "Link",
"permlevel": 0
"options": "Terms and Conditions"
},
{
"print_hide": 1,
"oldfieldtype": "Button",
"doctype": "DocField",
"label": "Get Terms and Conditions",
"options": "get_tc_details",
"permlevel": 0,
"fieldname": "get_terms",
"fieldtype": "Button",
"permlevel": 0
"options": "get_tc_details"
},
{
"print_hide": 1,
"oldfieldtype": "HTML",
"doctype": "DocField",
"label": "Terms and Conditions HTML",
"options": "You can add Terms and Notes that will be printed in the Transaction",
"permlevel": 0,
"fieldname": "terms_html",
"fieldtype": "HTML",
"permlevel": 0
"options": "You can add Terms and Notes that will be printed in the Transaction"
},
{
"oldfieldtype": "Text Editor",
@@ -682,10 +682,10 @@
"print_hide": 1,
"doctype": "DocField",
"label": "Contact Person",
"options": "Contact",
"permlevel": 0,
"fieldname": "contact_person",
"fieldtype": "Link",
"permlevel": 0,
"options": "Contact",
"in_filter": 1
},
{
@@ -701,12 +701,12 @@
"search_index": 1,
"doctype": "DocField",
"label": "Territory",
"permlevel": 0,
"options": "Territory",
"fieldname": "territory",
"fieldtype": "Link",
"reqd": 1,
"hidden": 0,
"options": "Territory",
"permlevel": 0,
"in_filter": 1
},
{
@@ -714,10 +714,10 @@
"search_index": 1,
"doctype": "DocField",
"label": "Customer Group",
"options": "Customer Group",
"permlevel": 0,
"fieldname": "customer_group",
"fieldtype": "Link",
"permlevel": 0,
"options": "Customer Group",
"in_filter": 1
},
{
@@ -743,8 +743,8 @@
"fieldtype": "Time",
"search_index": 0,
"reqd": 1,
"in_filter": 0,
"permlevel": 0
"permlevel": 0,
"in_filter": 0
},
{
"print_hide": 1,
@@ -771,10 +771,10 @@
"doctype": "DocField",
"label": "Letter Head",
"oldfieldname": "letter_head",
"options": "link:Letter Head",
"permlevel": 0,
"fieldname": "letter_head",
"fieldtype": "Select",
"permlevel": 0
"options": "link:Letter Head"
},
{
"print_hide": 1,
@@ -796,12 +796,12 @@
"doctype": "DocField",
"label": "Project Name",
"oldfieldname": "project_name",
"permlevel": 0,
"options": "Project",
"fieldname": "project_name",
"fieldtype": "Link",
"search_index": 1,
"in_filter": 1,
"options": "Project"
"permlevel": 0,
"in_filter": 1
},
{
"print_hide": 1,
@@ -809,10 +809,10 @@
"doctype": "DocField",
"label": "Source",
"oldfieldname": "source",
"options": "\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign",
"permlevel": 0,
"fieldname": "source",
"fieldtype": "Select",
"permlevel": 0
"options": "\nExisting Customer\nReference\nAdvertisement\nCold Calling\nExhibition\nSupplier Reference\nMass Mailing\nCustomer's Vendor\nCampaign"
},
{
"print_hide": 1,
@@ -820,11 +820,11 @@
"doctype": "DocField",
"label": "Campaign",
"oldfieldname": "campaign",
"options": "Campaign",
"permlevel": 0,
"fieldname": "campaign",
"fieldtype": "Link",
"depends_on": "eval:doc.source == 'Campaign'",
"permlevel": 0
"options": "Campaign"
},
{
"print_hide": 1,
@@ -849,44 +849,44 @@
},
{
"print_hide": 1,
"depends_on": "eval:!doc.__islocal",
"doctype": "DocField",
"description": "% of materials billed against this Delivery Note",
"no_copy": 1,
"search_index": 1,
"doctype": "DocField",
"oldfieldtype": "Currency",
"label": "% Amount Billed",
"oldfieldname": "per_billed",
"fieldname": "per_billed",
"fieldtype": "Currency",
"oldfieldtype": "Currency",
"in_filter": 1,
"permlevel": 1
"depends_on": "eval:!doc.__islocal",
"permlevel": 1,
"in_filter": 1
},
{
"print_hide": 1,
"no_copy": 1,
"doctype": "DocField",
"label": "Billing Status",
"options": "\nNot Billed\nPartly Billed\nFully Billed",
"permlevel": 0,
"fieldname": "billing_status",
"fieldtype": "Select",
"hidden": 1,
"permlevel": 0
"options": "\nNot Billed\nPartly Billed\nFully Billed"
},
{
"print_hide": 1,
"depends_on": "eval:!doc.__islocal",
"doctype": "DocField",
"description": "% of materials delivered against this Delivery Note",
"no_copy": 1,
"search_index": 1,
"doctype": "DocField",
"oldfieldtype": "Currency",
"label": "% Installed",
"oldfieldname": "per_installed",
"fieldname": "per_installed",
"fieldtype": "Currency",
"oldfieldtype": "Currency",
"in_filter": 1,
"permlevel": 1
"depends_on": "eval:!doc.__islocal",
"permlevel": 1,
"in_filter": 1
},
{
"print_hide": 1,
@@ -973,8 +973,8 @@
"fieldtype": "Link",
"search_index": 1,
"reqd": 1,
"in_filter": 1,
"options": "Company"
"options": "Company",
"in_filter": 1
},
{
"print_hide": 1,
@@ -1020,10 +1020,10 @@
"doctype": "DocField",
"label": "Packing Details",
"oldfieldname": "packing_details",
"options": "Delivery Note Packing Item",
"permlevel": 1,
"fieldname": "packing_details",
"fieldtype": "Table",
"permlevel": 1
"options": "Delivery Note Packing Item"
},
{
"print_hide": 1,
@@ -1104,10 +1104,10 @@
"doctype": "DocField",
"label": "Sales Team1",
"oldfieldname": "sales_team",
"options": "Sales Team",
"permlevel": 0,
"fieldname": "sales_team",
"fieldtype": "Table",
"permlevel": 0
"options": "Sales Team"
},
{
"print_hide": 1,
@@ -1124,8 +1124,9 @@
"doctype": "DocPerm",
"submit": 0,
"write": 0,
"role": "Accounts User",
"cancel": 0,
"role": "Accounts User",
"report": 1,
"permlevel": 0
},
{
@@ -1143,6 +1144,7 @@
"doctype": "DocPerm",
"submit": 1,
"write": 1,
"report": 1,
"role": "Sales User",
"cancel": 1,
"permlevel": 0
@@ -1160,6 +1162,7 @@
{
"doctype": "DocPerm",
"role": "Customer",
"report": 1,
"permlevel": 0,
"match": "customer_name"
},
@@ -1189,6 +1192,7 @@
"doctype": "DocPerm",
"submit": 1,
"write": 1,
"report": 1,
"role": "Material Manager",
"cancel": 1,
"permlevel": 0
@@ -1209,6 +1213,7 @@
"doctype": "DocPerm",
"submit": 1,
"write": 1,
"report": 1,
"role": "Material User",
"cancel": 1,
"permlevel": 0

View File

@@ -36,20 +36,6 @@ cur_frm.cscript.item_code = function(doc) {
if(!doc.description) cur_frm.set_value("description", doc.item_code);
}
cur_frm.cscript.hide_website_fields = function(doc) {
var website_fields_list = ['page_name', 'website_image', 'web_short_description',
'web_long_description'];
if (doc && cint(doc.show_in_website)) {
unhide_field(website_fields_list);
} else {
hide_field(website_fields_list);
}
}
cur_frm.cscript.show_in_website = function(doc, dt, dn) {
cur_frm.cscript.hide_website_fields(doc);
}
cur_frm.fields_dict['default_bom'].get_query = function(doc) {
//var d = locals[this.doctype][this.docname];
return 'SELECT DISTINCT `tabBOM`.`name` FROM `tabBOM` WHERE `tabBOM`.`item` = "' + doc.item_code + '" AND ifnull(`tabBOM`.`is_active`, 0) = 0 and `tabBOM`.docstatus != 2 AND `tabBOM`.%(key)s LIKE "%s" ORDER BY `tabBOM`.`name` LIMIT 50'

View File

@@ -77,7 +77,12 @@ class DocType:
def update_website(self):
from website.utils import update_page_name
update_page_name(self.doc, self.doc.name + " " + self.doc.item_name)
if self.doc.name==self.doc.item_name:
page_name_from = self.doc.name
else:
page_name_from = self.doc.name + " " + self.doc.item_name
update_page_name(self.doc, page_name_from)
from website.helpers.product import invalidate_cache_for
invalidate_cache_for(self.doc.item_group)

View File

@@ -32,9 +32,10 @@
"read": 1,
"submit": 0,
"doctype": "DocPerm",
"amend": 0,
"parenttype": "DocType",
"report": 1,
"permlevel": 0,
"amend": 0,
"parentfield": "permissions"
},
{
@@ -423,6 +424,7 @@
"permlevel": 1
},
{
"read_only": 1,
"no_copy": 1,
"oldfieldtype": "Currency",
"doctype": "DocField",
@@ -431,7 +433,7 @@
"fieldname": "last_purchase_rate",
"fieldtype": "Currency",
"depends_on": "eval:doc.is_purchase_item==\"Yes\"",
"permlevel": 1
"permlevel": 0
},
{
"oldfieldtype": "Currency",
@@ -776,11 +778,12 @@
},
{
"description": "Products will be sorted by weight-age in default searches. More the weight-age, higher the product will appear in the list.",
"search_index": 1,
"depends_on": "show_in_website",
"doctype": "DocField",
"label": "Weightage",
"fieldname": "weightage",
"fieldtype": "Int",
"search_index": 1,
"permlevel": 0
},
{
@@ -863,36 +866,27 @@
"fieldtype": "Text Editor",
"permlevel": 0
},
{
"amend": 0,
"create": 0,
"doctype": "DocPerm",
"write": 0,
"role": "Material Manager",
"cancel": 0
},
{
"amend": 0,
"create": 0,
"doctype": "DocPerm",
"write": 0,
"role": "Material User",
"cancel": 0
},
{
"create": 1,
"doctype": "DocPerm",
"write": 1,
"cancel": 1,
"role": "Material Master Manager",
"permlevel": 0
},
{
"create": 0,
"doctype": "DocPerm",
"write": 0,
"cancel": 0,
"role": "Material User",
"permlevel": 0
},
{
"create": 0,
"doctype": "DocPerm",
"write": 0,
"cancel": 0,
"role": "Material Master Manager",
"permlevel": 1
},
{
"create": 0,
"doctype": "DocPerm",
"write": 0,
"cancel": 0,
"role": "Material User",
"permlevel": 1
"cancel": 1
}
]

View File

@@ -10,11 +10,11 @@
"section_style": "Simple",
"module": "Stock",
"doctype": "DocType",
"autoname": "field:title",
"document_type": "Master",
"_last_update": "1309508838",
"autoname": "field:title",
"name": "__common__",
"colour": "White:FFF",
"_last_update": "1309508838",
"server_code_error": " ",
"version": 1
},
@@ -68,16 +68,17 @@
"doctype": "DocField",
"label": "Landed Cost",
"oldfieldname": "landed_cost",
"permlevel": 0,
"options": "Landed Cost Master Detail",
"fieldname": "landed_cost",
"fieldtype": "Table",
"options": "Landed Cost Master Detail"
"permlevel": 0
},
{
"create": 1,
"doctype": "DocPerm",
"write": 1,
"role": "Purchase Manager",
"report": 1,
"permlevel": 0
},
{
@@ -85,6 +86,7 @@
"doctype": "DocPerm",
"write": 1,
"role": "System Manager",
"report": 1,
"permlevel": 0
},
{
@@ -92,6 +94,7 @@
"doctype": "DocPerm",
"write": 1,
"role": "Purchase User",
"report": 1,
"permlevel": 0
},
{

View File

@@ -8,19 +8,19 @@
},
{
"section_style": "Simple",
"description": "Generate packing slips for packages to be delivered. Used to notify package number, package contents and its weight.",
"is_submittable": 1,
"description": "Generate packing slips for packages to be delivered. Used to notify package number, package contents and its weight.",
"search_fields": "delivery_note",
"module": "Stock",
"doctype": "DocType",
"read_only_onload": 1,
"autoname": "PS.#######",
"document_type": "Transaction",
"subject": "[%(delivery_note)s] Case Nos: %(from_case_no)s - %(to_case_no)s | Net Weight: %(net_weight_pkg)s %(net_weight_uom)s | Gross Weight: %(gross_weight_pkg)s %(gross_weight_uom)s",
"autoname": "PS.#######",
"_last_update": "1328091392",
"name": "__common__",
"colour": "White:FFF",
"is_transaction_doc": 1,
"_last_update": "1328091392",
"doctype": "DocType",
"show_in_menu": 0,
"version": 1
},
@@ -49,6 +49,7 @@
"doctype": "DocPerm",
"submit": 1,
"write": 1,
"report": 1,
"role": "Material User",
"cancel": 1,
"permlevel": 0
@@ -59,6 +60,7 @@
"doctype": "DocPerm",
"submit": 1,
"write": 1,
"report": 1,
"role": "Sales User",
"cancel": 1,
"permlevel": 0
@@ -69,6 +71,7 @@
"doctype": "DocPerm",
"submit": 1,
"write": 1,
"report": 1,
"role": "Material Master Manager",
"cancel": 1,
"permlevel": 0
@@ -79,6 +82,7 @@
"doctype": "DocPerm",
"submit": 1,
"write": 1,
"report": 1,
"role": "Material Manager",
"cancel": 1,
"permlevel": 0
@@ -89,6 +93,7 @@
"doctype": "DocPerm",
"submit": 1,
"write": 1,
"report": 1,
"role": "Sales Manager",
"cancel": 1,
"permlevel": 0
@@ -116,11 +121,11 @@
"colour": "White:FFF",
"doctype": "DocField",
"label": "Delivery Note",
"permlevel": 0,
"options": "Delivery Note",
"fieldname": "delivery_note",
"fieldtype": "Link",
"reqd": 1,
"options": "Delivery Note"
"permlevel": 0
},
{
"doctype": "DocField",
@@ -133,11 +138,11 @@
"no_copy": 0,
"doctype": "DocField",
"label": "Series",
"permlevel": 0,
"options": "PS",
"fieldname": "naming_series",
"fieldtype": "Select",
"reqd": 1,
"options": "PS"
"permlevel": 0
},
{
"colour": "White:FFF",
@@ -243,10 +248,10 @@
"colour": "White:FFF",
"doctype": "DocField",
"label": "Gross Weight UOM",
"permlevel": 0,
"options": "UOM",
"fieldname": "gross_weight_uom",
"fieldtype": "Link",
"options": "UOM"
"permlevel": 0
},
{
"colour": "White:FFF",
@@ -261,10 +266,10 @@
"no_copy": 1,
"doctype": "DocField",
"label": "Amended From",
"permlevel": 1,
"options": "Packing Slip",
"fieldname": "amended_from",
"fieldtype": "Link",
"options": "Packing Slip"
"permlevel": 1
},
{
"print_hide": 1,

View File

@@ -7,14 +7,14 @@
"modified": "2013-01-18 13:25:36"
},
{
"autoname": "naming_series:",
"allow_attach": 1,
"document_type": "Transaction",
"is_submittable": 1,
"search_fields": "status, posting_date, supplier",
"allow_attach": 1,
"autoname": "naming_series:",
"module": "Stock",
"doctype": "DocType",
"read_only_onload": 1,
"document_type": "Transaction",
"search_fields": "status, posting_date, supplier",
"name": "__common__"
},
{
@@ -53,11 +53,11 @@
"doctype": "DocField",
"label": "Series",
"oldfieldname": "naming_series",
"permlevel": 0,
"options": "\nGRN",
"fieldname": "naming_series",
"fieldtype": "Select",
"reqd": 1,
"options": "\nGRN"
"permlevel": 0
},
{
"print_hide": 1,
@@ -140,8 +140,8 @@
"fieldtype": "Date",
"search_index": 1,
"reqd": 1,
"in_filter": 1,
"permlevel": 0
"permlevel": 0,
"in_filter": 1
},
{
"print_hide": 1,
@@ -157,8 +157,8 @@
"fieldtype": "Time",
"search_index": 0,
"reqd": 1,
"in_filter": 0,
"permlevel": 0
"permlevel": 0,
"in_filter": 0
},
{
"print_hide": 0,
@@ -205,11 +205,11 @@
"doctype": "DocField",
"label": "Purchase Receipt Items",
"oldfieldname": "purchase_receipt_details",
"options": "Purchase Receipt Item",
"permlevel": 0,
"fieldname": "purchase_receipt_details",
"fieldtype": "Table",
"reqd": 0,
"permlevel": 0
"options": "Purchase Receipt Item"
},
{
"oldfieldtype": "Section Break",
@@ -224,10 +224,10 @@
"oldfieldtype": "Button",
"doctype": "DocField",
"label": "Get Current Stock",
"options": "get_current_stock",
"permlevel": 0,
"fieldname": "get_current_stock",
"fieldtype": "Button",
"permlevel": 0
"options": "get_current_stock"
},
{
"doctype": "DocField",
@@ -257,20 +257,20 @@
"doctype": "DocField",
"label": "Purchase Order",
"oldfieldname": "purchase_order_no",
"options": "Purchase Order",
"permlevel": 0,
"fieldname": "purchase_order_no",
"fieldtype": "Link",
"permlevel": 0
"options": "Purchase Order"
},
{
"print_hide": 1,
"oldfieldtype": "Button",
"doctype": "DocField",
"label": "Pull Purchase Order Details",
"options": "get_po_details",
"permlevel": 0,
"fieldname": "pull_purchase_order_details",
"fieldtype": "Button",
"permlevel": 0
"options": "get_po_details"
},
{
"doctype": "DocField",
@@ -286,11 +286,11 @@
"doctype": "DocField",
"label": "Currency",
"oldfieldname": "currency",
"options": "link:Currency",
"permlevel": 0,
"fieldname": "currency",
"fieldtype": "Select",
"reqd": 1,
"permlevel": 0
"options": "link:Currency"
},
{
"print_hide": 1,
@@ -319,21 +319,21 @@
"description": "Consider this Price List for fetching rate. (only which have \"For Buying\" as checked)",
"doctype": "DocField",
"label": "Price List",
"options": "Price List",
"permlevel": 0,
"fieldname": "price_list_name",
"fieldtype": "Link",
"permlevel": 0
"options": "Price List"
},
{
"print_hide": 1,
"depends_on": "price_list_name",
"doctype": "DocField",
"label": "Price List Currency",
"options": "Currency",
"permlevel": 0,
"fieldname": "price_list_currency",
"fieldtype": "Link",
"hidden": 0,
"permlevel": 0
"options": "Currency"
},
{
"print_hide": 1,
@@ -360,30 +360,30 @@
"doctype": "DocField",
"label": "Purchase Taxes and Charges",
"oldfieldname": "purchase_other_charges",
"options": "Purchase Taxes and Charges Master",
"permlevel": 0,
"fieldname": "purchase_other_charges",
"fieldtype": "Link",
"permlevel": 0
"options": "Purchase Taxes and Charges Master"
},
{
"print_hide": 1,
"oldfieldtype": "Button",
"doctype": "DocField",
"label": "Get Tax Detail",
"options": "get_purchase_tax_details",
"permlevel": 0,
"fieldname": "get_tax_detail",
"fieldtype": "Button",
"permlevel": 0
"options": "get_purchase_tax_details"
},
{
"oldfieldtype": "Table",
"doctype": "DocField",
"label": "Purchase Taxes and Charges",
"oldfieldname": "purchase_tax_details",
"options": "Purchase Taxes and Charges",
"permlevel": 0,
"fieldname": "purchase_tax_details",
"fieldtype": "Table",
"permlevel": 0
"options": "Purchase Taxes and Charges"
},
{
"print_hide": 1,
@@ -559,29 +559,29 @@
"doctype": "DocField",
"label": "Select Terms and Conditions",
"oldfieldname": "tc_name",
"options": "Terms and Conditions",
"permlevel": 0,
"fieldname": "tc_name",
"fieldtype": "Link",
"permlevel": 0
"options": "Terms and Conditions"
},
{
"oldfieldtype": "Button",
"doctype": "DocField",
"label": "Get Terms and Conditions",
"options": "get_tc_details",
"permlevel": 0,
"fieldname": "get_terms",
"fieldtype": "Button",
"permlevel": 0
"options": "get_tc_details"
},
{
"print_hide": 1,
"oldfieldtype": "HTML",
"doctype": "DocField",
"label": "Terms and Conditions HTML",
"options": "You can add Terms and Notes that will be printed in the Transaction",
"permlevel": 0,
"fieldname": "terms_html",
"fieldtype": "HTML",
"permlevel": 0
"options": "You can add Terms and Notes that will be printed in the Transaction"
},
{
"oldfieldtype": "Text Editor",
@@ -603,10 +603,10 @@
"print_hide": 1,
"doctype": "DocField",
"label": "Supplier Address",
"options": "Address",
"permlevel": 0,
"fieldname": "supplier_address",
"fieldtype": "Link",
"permlevel": 0
"options": "Address"
},
{
"doctype": "DocField",
@@ -618,10 +618,10 @@
"print_hide": 1,
"doctype": "DocField",
"label": "Contact Person",
"options": "Contact",
"permlevel": 0,
"fieldname": "contact_person",
"fieldtype": "Link",
"permlevel": 0
"options": "Contact"
},
{
"description": "Filing in Additional Information about the Purchase Receipt will help you analyze your data better.",
@@ -670,10 +670,10 @@
"doctype": "DocField",
"label": "Is Subcontracted",
"oldfieldname": "is_subcontracted",
"options": "\nYes\nNo",
"permlevel": 0,
"fieldname": "is_subcontracted",
"fieldtype": "Select",
"permlevel": 0
"options": "\nYes\nNo"
},
{
"print_hide": 1,
@@ -731,10 +731,10 @@
"doctype": "DocField",
"label": "Select Print Heading",
"oldfieldname": "select_print_heading",
"permlevel": 0,
"options": "Print Heading",
"fieldname": "select_print_heading",
"fieldtype": "Link",
"options": "Print Heading",
"permlevel": 0,
"report_hide": 1
},
{
@@ -753,8 +753,8 @@
"search_index": 1,
"reqd": 1,
"hidden": 0,
"in_filter": 1,
"options": "Company"
"options": "Company",
"in_filter": 1
},
{
"print_hide": 1,
@@ -785,16 +785,16 @@
{
"print_hide": 1,
"print_width": "30%",
"permlevel": 0,
"oldfieldtype": "HTML",
"doctype": "DocField",
"label": "Other Details",
"width": "30%",
"options": "<div class='columnHeading'>Other Details</div>",
"fieldname": "other_details",
"fieldtype": "HTML",
"reqd": 0,
"hidden": 1,
"options": "<div class='columnHeading'>Other Details</div>"
"permlevel": 0
},
{
"print_hide": 1,
@@ -804,11 +804,11 @@
"doctype": "DocField",
"label": "Rejected Warehouse",
"oldfieldname": "rejected_warehouse",
"permlevel": 0,
"options": "Warehouse",
"fieldname": "rejected_warehouse",
"fieldtype": "Link",
"reqd": 0,
"options": "Warehouse"
"permlevel": 0
},
{
"print_hide": 1,
@@ -924,10 +924,10 @@
"doctype": "DocField",
"label": "Purchase Receipt Item Supplieds",
"oldfieldname": "pr_raw_material_details",
"options": "Purchase Receipt Item Supplied",
"permlevel": 1,
"fieldname": "pr_raw_material_details",
"fieldtype": "Table",
"permlevel": 1
"options": "Purchase Receipt Item Supplied"
},
{
"print_hide": 1,
@@ -945,26 +945,28 @@
"doctype": "DocPerm",
"submit": 1,
"write": 1,
"report": 1,
"role": "Purchase User",
"cancel": 1,
"permlevel": 0
},
{
"doctype": "DocPerm",
"role": "Purchase User",
"permlevel": 1
"permlevel": 1,
"doctype": "DocPerm"
},
{
"doctype": "DocPerm",
"role": "Supplier",
"report": 1,
"permlevel": 0,
"match": "supplier"
},
{
"doctype": "DocPerm",
"write": 1,
"role": "All",
"permlevel": 2
"permlevel": 2,
"doctype": "DocPerm"
},
{
"amend": 0,
@@ -982,6 +984,7 @@
"doctype": "DocPerm",
"submit": 1,
"write": 1,
"report": 1,
"role": "Material Manager",
"cancel": 1,
"permlevel": 0
@@ -1002,6 +1005,7 @@
"doctype": "DocPerm",
"submit": 1,
"write": 1,
"report": 1,
"role": "Material User",
"cancel": 1,
"permlevel": 0

View File

@@ -8,16 +8,16 @@
},
{
"section_style": "Simple",
"description": "Aggregate group of **Items** into another **Item**. This is useful if you are bundling a certain **Items** into a package and you maintain stock of the packed **Items** and not the aggregate **Item**. \n\nThe package **Item** will have \"Is Stock Item\" as \"No\" and \"Is Sales Item\" as \"Yes\".\n\nFor Example: If you are selling Laptops and Backpacks separately and have a special price if the customer buys both, then the Laptop + Backpack will be a new Sales BOM Item.\n\nNote: BOM = Bill of Materials",
"is_submittable": 0,
"description": "Aggregate group of **Items** into another **Item**. This is useful if you are bundling a certain **Items** into a package and you maintain stock of the packed **Items** and not the aggregate **Item**. \n\nThe package **Item** will have \"Is Stock Item\" as \"No\" and \"Is Sales Item\" as \"Yes\".\n\nFor Example: If you are selling Laptops and Backpacks separately and have a special price if the customer buys both, then the Laptop + Backpack will be a new Sales BOM Item.\n\nNote: BOM = Bill of Materials",
"module": "Stock",
"doctype": "DocType",
"allow_trash": 1,
"server_code_error": " ",
"allow_trash": 1,
"document_type": "Master",
"_last_update": "1322549701",
"name": "__common__",
"colour": "White:FFF",
"_last_update": "1322549701",
"doctype": "DocType",
"show_in_menu": 0,
"version": 1
},
@@ -33,8 +33,8 @@
"name": "__common__",
"parent": "Sales BOM",
"read": 1,
"doctype": "DocPerm",
"submit": 0,
"doctype": "DocPerm",
"amend": 0,
"parenttype": "DocType",
"parentfield": "permissions"
@@ -55,6 +55,7 @@
"create": 1,
"doctype": "DocPerm",
"write": 1,
"report": 1,
"role": "Material Manager",
"cancel": 1,
"permlevel": 0
@@ -71,6 +72,7 @@
"create": 0,
"doctype": "DocPerm",
"write": 0,
"report": 1,
"role": "Material User",
"cancel": 0,
"permlevel": 0
@@ -79,6 +81,7 @@
"create": 1,
"doctype": "DocPerm",
"write": 1,
"report": 1,
"role": "Sales User",
"cancel": 1,
"permlevel": 0

View File

@@ -7,15 +7,15 @@
"modified": "2012-12-03 11:39:34"
},
{
"allow_attach": 1,
"search_fields": "item_code,status",
"module": "Stock",
"document_type": "Master",
"description": "Distinct unit of an Item",
"autoname": "field:serial_no",
"name": "__common__",
"allow_rename": 1,
"doctype": "DocType"
"name": "__common__",
"module": "Stock",
"doctype": "DocType",
"search_fields": "item_code,status",
"allow_attach": 1
},
{
"name": "__common__",
@@ -123,12 +123,12 @@
"doctype": "DocField",
"label": "Item Group",
"oldfieldname": "item_group",
"options": "Item Group",
"permlevel": 1,
"fieldname": "item_group",
"fieldtype": "Link",
"search_index": 0,
"reqd": 1,
"permlevel": 1,
"options": "Item Group",
"in_filter": 0
},
{
@@ -136,12 +136,12 @@
"doctype": "DocField",
"label": "Brand",
"oldfieldname": "brand",
"options": "Brand",
"permlevel": 1,
"fieldname": "brand",
"fieldtype": "Link",
"search_index": 0,
"reqd": 0,
"permlevel": 1,
"options": "Brand",
"in_filter": 0
},
{
@@ -162,10 +162,10 @@
"no_copy": 1,
"doctype": "DocField",
"label": "Purchase Document Type",
"options": "\nPurchase Receipt\nStock Entry",
"permlevel": 0,
"fieldname": "purchase_document_type",
"fieldtype": "Select",
"permlevel": 0
"options": "\nPurchase Receipt\nStock Entry"
},
{
"no_copy": 1,
@@ -226,22 +226,22 @@
"doctype": "DocField",
"label": "Warehouse",
"oldfieldname": "warehouse",
"permlevel": 0,
"options": "Warehouse",
"fieldname": "warehouse",
"fieldtype": "Link",
"search_index": 1,
"reqd": 0,
"options": "Warehouse",
"permlevel": 0,
"in_filter": 1
},
{
"no_copy": 1,
"doctype": "DocField",
"label": "Supplier",
"options": "Supplier",
"permlevel": 0,
"fieldname": "supplier",
"fieldtype": "Link",
"permlevel": 0,
"options": "Supplier",
"in_filter": 1
},
{
@@ -280,10 +280,10 @@
"no_copy": 1,
"doctype": "DocField",
"label": "Delivery Document Type",
"options": "\nDelivery Note\nSales Invoice\nStock Entry",
"permlevel": 1,
"fieldname": "delivery_document_type",
"fieldtype": "Select",
"permlevel": 1,
"options": "\nDelivery Note\nSales Invoice\nStock Entry",
"in_filter": 1
},
{
@@ -328,11 +328,11 @@
"doctype": "DocField",
"label": "Is Cancelled",
"oldfieldname": "is_cancelled",
"options": "\nYes\nNo",
"permlevel": 0,
"fieldname": "is_cancelled",
"fieldtype": "Select",
"hidden": 1,
"permlevel": 0,
"options": "\nYes\nNo",
"report_hide": 1
},
{
@@ -385,10 +385,10 @@
"doctype": "DocField",
"label": "Territory",
"oldfieldname": "territory",
"permlevel": 1,
"options": "Territory",
"fieldname": "territory",
"fieldtype": "Link",
"options": "Territory",
"permlevel": 1,
"report_hide": 0,
"in_filter": 1
},
@@ -407,17 +407,17 @@
"permlevel": 0
},
{
"permlevel": 0,
"no_copy": 0,
"oldfieldtype": "Select",
"doctype": "DocField",
"label": "Maintenance Status",
"oldfieldname": "maintenance_status",
"width": "150px",
"options": "\nUnder Warranty\nOut of Warranty\nUnder AMC\nOut of AMC",
"fieldname": "maintenance_status",
"fieldtype": "Select",
"search_index": 1,
"options": "\nUnder Warranty\nOut of Warranty\nUnder AMC\nOut of AMC",
"permlevel": 0,
"in_filter": 1
},
{
@@ -480,22 +480,22 @@
"search_index": 1,
"doctype": "DocField",
"label": "Company",
"options": "link:Company",
"permlevel": 0,
"fieldname": "company",
"fieldtype": "Select",
"reqd": 1,
"permlevel": 0,
"options": "link:Company",
"in_filter": 1
},
{
"search_index": 1,
"doctype": "DocField",
"label": "Fiscal Year",
"options": "link:Fiscal Year",
"permlevel": 0,
"fieldname": "fiscal_year",
"fieldtype": "Select",
"reqd": 1,
"permlevel": 0,
"options": "link:Fiscal Year",
"in_filter": 1
},
{
@@ -544,6 +544,7 @@
"doctype": "DocPerm",
"submit": 0,
"write": 0,
"report": 1,
"role": "Material Manager",
"cancel": 0,
"permlevel": 0
@@ -564,6 +565,7 @@
"doctype": "DocPerm",
"submit": 0,
"write": 0,
"report": 1,
"role": "Material User",
"cancel": 0,
"permlevel": 0
@@ -572,26 +574,28 @@
"create": 1,
"doctype": "DocPerm",
"write": 1,
"role": "System Manager",
"cancel": 1,
"role": "System Manager",
"report": 1,
"permlevel": 0
},
{
"create": 1,
"doctype": "DocPerm",
"write": 1,
"role": "Material Master Manager",
"cancel": 1,
"role": "Material Master Manager",
"report": 1,
"permlevel": 0
},
{
"doctype": "DocPerm",
"role": "System Manager",
"permlevel": 1
"permlevel": 1,
"doctype": "DocPerm"
},
{
"doctype": "DocPerm",
"role": "Sales Master Manager",
"permlevel": 1
"permlevel": 1,
"doctype": "DocPerm"
}
]

View File

@@ -17,10 +17,9 @@
from __future__ import unicode_literals
import webnotes
from webnotes.utils import cstr, cint, flt, getdate, now, comma_or
from webnotes.model import db_exists, delete_doc
from webnotes.utils import cstr, cint, flt, comma_or
from webnotes.model.doc import Document, addchild
from webnotes.model.wrapper import getlist, copy_doclist
from webnotes.model.wrapper import getlist
from webnotes.model.code import get_obj
from webnotes import msgprint, _
from stock.utils import get_incoming_rate
@@ -51,6 +50,7 @@ class DocType(TransactionBase):
self.validate_incoming_rate()
self.validate_bom()
self.validate_finished_goods()
self.validate_return_reference_doc()
def on_submit(self):
self.update_serial_no(1)
@@ -85,6 +85,15 @@ class DocType(TransactionBase):
validate_for_manufacture_repack = any([d.bom_no for d in self.doclist.get(
{"parentfield": "mtn_details"})])
if self.doc.purpose in source_mandatory and self.doc.purpose not in target_mandatory:
self.doc.to_warehouse = None
for d in getlist(self.doclist, 'mtn_details'):
d.t_warehouse = None
elif self.doc.purpose in target_mandatory and self.doc.purpose not in source_mandatory:
self.doc.from_warehouse = None
for d in getlist(self.doclist, 'mtn_details'):
d.s_warehouse = None
for d in getlist(self.doclist, 'mtn_details'):
if not d.s_warehouse and not d.t_warehouse:
d.s_warehouse = self.doc.from_warehouse
@@ -93,21 +102,13 @@ class DocType(TransactionBase):
if not (d.s_warehouse or d.t_warehouse):
msgprint(_("Atleast one warehouse is mandatory"), raise_exception=1)
if self.doc.purpose in source_mandatory:
if not d.s_warehouse:
msgprint(_("Row # ") + "%s: " % cint(d.idx)
+ _("Source Warehouse") + _(" is mandatory"), raise_exception=1)
if self.doc.purpose not in target_mandatory:
d.t_warehouse = None
if self.doc.purpose in source_mandatory and not d.s_warehouse:
msgprint(_("Row # ") + "%s: " % cint(d.idx)
+ _("Source Warehouse") + _(" is mandatory"), raise_exception=1)
if self.doc.purpose in target_mandatory:
if not d.t_warehouse:
msgprint(_("Row # ") + "%s: " % cint(d.idx)
+ _("Target Warehouse") + _(" is mandatory"), raise_exception=1)
if self.doc.purpose not in source_mandatory:
d.s_warehouse = None
if self.doc.purpose in target_mandatory and not d.t_warehouse:
msgprint(_("Row # ") + "%s: " % cint(d.idx)
+ _("Target Warehouse") + _(" is mandatory"), raise_exception=1)
if self.doc.purpose == "Manufacture/Repack":
if validate_for_manufacture_repack:
@@ -225,7 +226,28 @@ class DocType(TransactionBase):
+ _("Quantity should be equal to Manufacturing Quantity. ")
+ _("To fetch items again, click on 'Get Items' button \
or update the Quantity manually."), raise_exception=1)
def validate_return_reference_doc(self):
""" validate item with reference doc"""
ref_doctype = ref_docname = ""
if self.doc.purpose == "Sales Return" and \
(self.doc.delivery_note_no or self.doc.sales_invoice_no):
ref_doctype = self.doc.delivery_note_no and "Delivery Note" or "Sales Invoice"
ref_docname = self.doc.delivery_note_no or self.doc.sales_invoice_no
elif self.doc.purpose == "Purchase Return" and self.doc.purchase_receipt_no:
ref_doctype = "Purchase Receipt"
ref_docname = self.doc.purchase_receipt_no
if ref_doctype and ref_docname:
for item in self.doclist.get({"parentfield": "mtn_details"}):
ref_exists = webnotes.conn.sql("""select name from `tab%s`
where parent = %s and item_code = %s and docstatus=1""" %
(ref_doctype + " Item", '%s', '%s'), (ref_docname, item.item_code))
if not ref_exists:
msgprint(_("Item: '") + item.item_code + _("' does not exists in ") +
ref_doctype + ": " + ref_docname, raise_exception=1)
def update_serial_no(self, is_submit):
"""Create / Update Serial No"""
from stock.utils import get_valid_serial_nos

View File

@@ -7,20 +7,20 @@
"modified": "2013-01-11 11:54:51"
},
{
"in_create": 0,
"is_submittable": 1,
"in_create": 0,
"allow_print": 0,
"search_fields": "transfer_date, from_warehouse, to_warehouse, purpose, remarks",
"module": "Stock",
"doctype": "DocType",
"autoname": "naming_series:",
"read_only_onload": 0,
"doctype": "DocType",
"in_dialog": 0,
"issingle": 0,
"allow_attach": 0,
"read_only": 0,
"allow_email": 0,
"hide_heading": 0,
"autoname": "naming_series:",
"issingle": 0,
"name": "__common__",
"allow_rename": 0,
"max_attachments": 0,
@@ -70,9 +70,9 @@
"search_index": 0,
"reqd": 1,
"hidden": 0,
"in_filter": 0,
"options": "\nSTE",
"report_hide": 0
"report_hide": 0,
"in_filter": 0
},
{
"print_hide": 0,
@@ -105,21 +105,21 @@
{
"print_hide": 1,
"description": "The date at which current entry will get or has actually executed.",
"default": "Today",
"no_copy": 1,
"oldfieldtype": "Date",
"allow_on_submit": 0,
"doctype": "DocField",
"label": "Posting Date",
"oldfieldname": "posting_date",
"no_copy": 1,
"default": "Today",
"fieldname": "posting_date",
"fieldtype": "Date",
"search_index": 1,
"reqd": 1,
"hidden": 0,
"in_filter": 1,
"permlevel": 0,
"report_hide": 0
"report_hide": 0,
"in_filter": 1
},
{
"print_hide": 1,
@@ -190,10 +190,10 @@
},
{
"doctype": "DocField",
"options": "Simple",
"permlevel": 0,
"fieldname": "sb0",
"fieldtype": "Section Break",
"permlevel": 0
"options": "Simple"
},
{
"print_hide": 0,
@@ -219,10 +219,10 @@
"oldfieldtype": "Button",
"doctype": "DocField",
"label": "Get Stock and Rate",
"options": "get_stock_and_rate",
"permlevel": 0,
"fieldname": "get_stock_and_rate",
"fieldtype": "Button",
"permlevel": 0
"options": "get_stock_and_rate"
},
{
"doctype": "DocField",
@@ -233,17 +233,17 @@
},
{
"print_hide": 1,
"depends_on": "eval:inList([\"Material Transfer\", \"Manufacture/Repack\"], doc.purpose)",
"doctype": "DocField",
"no_copy": 0,
"search_index": 1,
"allow_on_submit": 0,
"doctype": "DocField",
"oldfieldtype": "Link",
"label": "Production Order",
"oldfieldname": "production_order",
"permlevel": 0,
"fieldname": "production_order",
"fieldtype": "Link",
"oldfieldtype": "Link",
"depends_on": "eval:inList([\"Material Transfer\", \"Manufacture/Repack\"], doc.purpose)",
"reqd": 0,
"hidden": 1,
"options": "Production Order",
@@ -254,43 +254,43 @@
"depends_on": "eval:!inList([\"Sales Return\", \"Purchase Return\"], doc.purpose)",
"doctype": "DocField",
"label": "BOM No",
"options": "BOM",
"permlevel": 0,
"fieldname": "bom_no",
"fieldtype": "Link",
"permlevel": 0
"options": "BOM"
},
{
"print_hide": 1,
"depends_on": "eval:!inList([\"Sales Return\", \"Purchase Return\"], doc.purpose)",
"doctype": "DocField",
"description": "As per Stock UOM",
"no_copy": 0,
"search_index": 0,
"allow_on_submit": 0,
"doctype": "DocField",
"oldfieldtype": "Currency",
"label": "Manufacturing Quantity",
"oldfieldname": "fg_completed_qty",
"fieldname": "fg_completed_qty",
"fieldtype": "Currency",
"oldfieldtype": "Currency",
"depends_on": "eval:!inList([\"Sales Return\", \"Purchase Return\"], doc.purpose)",
"reqd": 0,
"hidden": 0,
"in_filter": 0,
"permlevel": 0,
"report_hide": 0
"report_hide": 0,
"in_filter": 0
},
{
"print_hide": 1,
"depends_on": "eval:doc.purpose==\"Sales Return\"",
"doctype": "DocField",
"no_copy": 1,
"search_index": 1,
"allow_on_submit": 0,
"doctype": "DocField",
"oldfieldtype": "Link",
"label": "Delivery Note No",
"oldfieldname": "delivery_note_no",
"permlevel": 0,
"fieldname": "delivery_note_no",
"fieldtype": "Link",
"oldfieldtype": "Link",
"depends_on": "eval:doc.purpose==\"Sales Return\"",
"reqd": 0,
"hidden": 1,
"options": "Delivery Note",
@@ -299,17 +299,17 @@
},
{
"print_hide": 1,
"depends_on": "eval:doc.purpose==\"Purchase Return\"",
"doctype": "DocField",
"no_copy": 1,
"search_index": 1,
"allow_on_submit": 0,
"doctype": "DocField",
"oldfieldtype": "Link",
"label": "Purchase Receipt No",
"oldfieldname": "purchase_receipt_no",
"permlevel": 0,
"fieldname": "purchase_receipt_no",
"fieldtype": "Link",
"oldfieldtype": "Link",
"depends_on": "eval:doc.purpose==\"Purchase Return\"",
"reqd": 0,
"hidden": 1,
"options": "Purchase Receipt",
@@ -334,15 +334,15 @@
},
{
"print_hide": 1,
"depends_on": "eval:!inList([\"Sales Return\", \"Purchase Return\"], doc.purpose)",
"doctype": "DocField",
"no_copy": 0,
"search_index": 0,
"allow_on_submit": 0,
"doctype": "DocField",
"oldfieldtype": "Button",
"label": "Get Items",
"fieldname": "get_items",
"fieldtype": "Button",
"oldfieldtype": "Button",
"depends_on": "eval:!inList([\"Sales Return\", \"Purchase Return\"], doc.purpose)",
"reqd": 0,
"hidden": 0,
"permlevel": 0,
@@ -355,11 +355,11 @@
"depends_on": "eval:doc.purpose==\"Sales Return\"",
"doctype": "DocField",
"label": "Sales Invoice No",
"options": "Sales Invoice",
"permlevel": 0,
"fieldname": "sales_invoice_no",
"fieldtype": "Link",
"hidden": 1,
"permlevel": 0
"options": "Sales Invoice"
},
{
"depends_on": "eval:(doc.purpose==\"Sales Return\" || doc.purpose==\"Purchase Return\")",
@@ -371,17 +371,17 @@
},
{
"print_hide": 1,
"depends_on": "eval:doc.purpose==\"Purchase Return\"",
"doctype": "DocField",
"no_copy": 1,
"search_index": 0,
"allow_on_submit": 0,
"doctype": "DocField",
"oldfieldtype": "Link",
"label": "Supplier",
"oldfieldname": "supplier",
"permlevel": 0,
"fieldname": "supplier",
"fieldtype": "Link",
"oldfieldtype": "Link",
"depends_on": "eval:doc.purpose==\"Purchase Return\"",
"reqd": 0,
"hidden": 0,
"options": "Supplier",
@@ -390,16 +390,16 @@
},
{
"print_hide": 0,
"depends_on": "eval:doc.purpose==\"Purchase Return\"",
"doctype": "DocField",
"no_copy": 1,
"search_index": 0,
"allow_on_submit": 0,
"doctype": "DocField",
"oldfieldtype": "Data",
"label": "Supplier Name",
"oldfieldname": "supplier_name",
"fieldname": "supplier_name",
"fieldtype": "Data",
"oldfieldtype": "Data",
"depends_on": "eval:doc.purpose==\"Purchase Return\"",
"reqd": 0,
"hidden": 0,
"permlevel": 1,
@@ -408,16 +408,16 @@
},
{
"print_hide": 0,
"depends_on": "eval:doc.purpose==\"Purchase Return\"",
"doctype": "DocField",
"no_copy": 1,
"search_index": 0,
"allow_on_submit": 0,
"doctype": "DocField",
"oldfieldtype": "Small Text",
"label": "Supplier Address",
"oldfieldname": "supplier_address",
"fieldname": "supplier_address",
"fieldtype": "Small Text",
"oldfieldtype": "Small Text",
"depends_on": "eval:doc.purpose==\"Purchase Return\"",
"reqd": 0,
"hidden": 0,
"permlevel": 0,
@@ -426,17 +426,17 @@
},
{
"print_hide": 1,
"depends_on": "eval:doc.purpose==\"Sales Return\"",
"doctype": "DocField",
"no_copy": 1,
"search_index": 0,
"allow_on_submit": 0,
"doctype": "DocField",
"oldfieldtype": "Link",
"label": "Customer",
"oldfieldname": "customer",
"permlevel": 0,
"fieldname": "customer",
"fieldtype": "Link",
"oldfieldtype": "Link",
"depends_on": "eval:doc.purpose==\"Sales Return\"",
"reqd": 0,
"hidden": 0,
"options": "Customer",
@@ -445,16 +445,16 @@
},
{
"print_hide": 0,
"depends_on": "eval:doc.purpose==\"Sales Return\"",
"doctype": "DocField",
"no_copy": 1,
"search_index": 0,
"allow_on_submit": 0,
"doctype": "DocField",
"oldfieldtype": "Data",
"label": "Customer Name",
"oldfieldname": "customer_name",
"fieldname": "customer_name",
"fieldtype": "Data",
"oldfieldtype": "Data",
"depends_on": "eval:doc.purpose==\"Sales Return\"",
"reqd": 0,
"hidden": 0,
"permlevel": 1,
@@ -463,16 +463,16 @@
},
{
"print_hide": 0,
"depends_on": "eval:doc.purpose==\"Sales Return\"",
"doctype": "DocField",
"no_copy": 1,
"search_index": 0,
"allow_on_submit": 0,
"doctype": "DocField",
"oldfieldtype": "Small Text",
"label": "Customer Address",
"oldfieldname": "customer_address",
"fieldname": "customer_address",
"fieldtype": "Small Text",
"oldfieldtype": "Small Text",
"depends_on": "eval:doc.purpose==\"Sales Return\"",
"reqd": 0,
"hidden": 0,
"permlevel": 0,
@@ -500,10 +500,10 @@
"doctype": "DocField",
"label": "Project Name",
"oldfieldname": "project_name",
"options": "Project",
"permlevel": 0,
"fieldname": "project_name",
"fieldtype": "Link",
"permlevel": 0,
"options": "Project",
"in_filter": 1
},
{
@@ -591,6 +591,7 @@
"doctype": "DocPerm",
"submit": 1,
"write": 1,
"report": 1,
"role": "Material User",
"cancel": 1,
"permlevel": 0
@@ -631,6 +632,7 @@
"doctype": "DocPerm",
"submit": 1,
"write": 1,
"report": 1,
"role": "Manufacturing User",
"cancel": 1,
"permlevel": 0
@@ -650,6 +652,7 @@
"doctype": "DocPerm",
"submit": 1,
"write": 1,
"report": 1,
"role": "Manufacturing Manager",
"cancel": 1,
"permlevel": 0
@@ -679,6 +682,7 @@
"doctype": "DocPerm",
"submit": 1,
"write": 1,
"report": 1,
"role": "Material Manager",
"cancel": 1,
"permlevel": 0

View File

@@ -32,6 +32,7 @@
"parent": "Stock Ledger Entry",
"read": 1,
"doctype": "DocPerm",
"report": 1,
"parenttype": "DocType",
"permlevel": 0,
"parentfield": "permissions"
@@ -271,8 +272,8 @@
"doctype": "DocPerm",
"submit": 0,
"write": 0,
"cancel": 0,
"role": "Sales User"
"role": "Sales User",
"cancel": 0
},
{
"amend": 0,
@@ -280,8 +281,8 @@
"doctype": "DocPerm",
"submit": 0,
"write": 0,
"cancel": 0,
"role": "Material User"
"role": "Material User",
"cancel": 0
},
{
"role": "Accounts Manager",

View File

@@ -7,13 +7,13 @@
"modified": "2012-12-03 11:24:31"
},
{
"autoname": "field:warehouse_name",
"document_type": "Master",
"description": "A logical Warehouse against which stock entries are made.",
"autoname": "field:warehouse_name",
"allow_rename": 1,
"search_fields": "warehouse_type",
"module": "Stock",
"doctype": "DocType",
"document_type": "Master",
"search_fields": "warehouse_type",
"name": "__common__"
},
{
@@ -59,11 +59,11 @@
"doctype": "DocField",
"label": "Warehouse Type",
"oldfieldname": "warehouse_type",
"options": "Warehouse Type",
"permlevel": 0,
"fieldname": "warehouse_type",
"fieldtype": "Link",
"reqd": 1,
"permlevel": 0
"options": "Warehouse Type"
},
{
"oldfieldtype": "Link",
@@ -71,11 +71,11 @@
"doctype": "DocField",
"label": "Company",
"oldfieldname": "company",
"options": "Company",
"permlevel": 0,
"fieldname": "company",
"fieldtype": "Link",
"search_index": 1,
"permlevel": 0,
"options": "Company",
"in_filter": 1
},
{
@@ -103,20 +103,20 @@
"doctype": "DocField",
"label": "Phone No",
"oldfieldname": "phone_no",
"options": "Phone",
"permlevel": 0,
"fieldname": "phone_no",
"fieldtype": "Data",
"permlevel": 0
"options": "Phone"
},
{
"oldfieldtype": "Int",
"doctype": "DocField",
"label": "Mobile No",
"oldfieldname": "mobile_no",
"options": "Phone",
"permlevel": 0,
"fieldname": "mobile_no",
"fieldtype": "Data",
"permlevel": 0
"options": "Phone"
},
{
"oldfieldtype": "Column Break",
@@ -159,10 +159,10 @@
"doctype": "DocField",
"label": "State",
"oldfieldname": "state",
"options": "Suggest",
"permlevel": 0,
"fieldname": "state",
"fieldtype": "Data",
"permlevel": 0
"options": "Suggest"
},
{
"oldfieldtype": "Int",
@@ -184,10 +184,10 @@
},
{
"doctype": "DocField",
"label": "Merge With",
"options": "Warehouse",
"fieldname": "merge_with",
"fieldtype": "Link",
"label": "Merge With",
"permlevel": 2
},
{
@@ -203,8 +203,8 @@
"doctype": "DocPerm",
"submit": 0,
"write": 0,
"cancel": 0,
"role": "Material User",
"cancel": 0,
"permlevel": 2
},
{
@@ -213,8 +213,9 @@
"doctype": "DocPerm",
"submit": 0,
"write": 0,
"cancel": 0,
"report": 1,
"role": "Material User",
"cancel": 0,
"permlevel": 0
},
{
@@ -223,8 +224,8 @@
"doctype": "DocPerm",
"submit": 0,
"write": 0,
"cancel": 0,
"role": "Material User",
"cancel": 0,
"permlevel": 1
},
{
@@ -233,8 +234,8 @@
"doctype": "DocPerm",
"submit": 0,
"write": 0,
"cancel": 0,
"role": "Material Manager",
"cancel": 0,
"permlevel": 2
},
{
@@ -243,8 +244,9 @@
"doctype": "DocPerm",
"submit": 0,
"write": 0,
"cancel": 0,
"report": 1,
"role": "Material Manager",
"cancel": 0,
"permlevel": 0
},
{
@@ -253,14 +255,14 @@
"doctype": "DocPerm",
"submit": 0,
"write": 0,
"cancel": 0,
"role": "Material Manager",
"cancel": 0,
"permlevel": 1
},
{
"doctype": "DocPerm",
"role": "All",
"permlevel": 1
"permlevel": 1,
"doctype": "DocPerm"
},
{
"amend": 0,
@@ -268,21 +270,23 @@
"doctype": "DocPerm",
"submit": 0,
"write": 1,
"cancel": 1,
"report": 1,
"role": "Material Master Manager",
"cancel": 1,
"permlevel": 0
},
{
"doctype": "DocPerm",
"role": "Material Master Manager",
"permlevel": 1
"permlevel": 1,
"doctype": "DocPerm"
},
{
"create": 1,
"doctype": "DocPerm",
"write": 1,
"role": "System Manager",
"cancel": 1,
"role": "System Manager",
"report": 1,
"permlevel": 0
},
{

View File

@@ -79,9 +79,9 @@ erpnext.StockLedger = erpnext.StockGridReport.extend({
default_value: "Select Warehouse...", filter: function(val, item, opts) {
return item.warehouse == val || val == opts.default_value;
}},
{fieldtype:"Select", label: "Item Code", link:"Item", default_value: "Select Item...",
{fieldtype:"Link", label: "Item Code", link:"Item", default_value: "Select Item...",
filter: function(val, item, opts) {
return item.item_code == val || val == opts.default_value;
return item.item_code == val || !val;
}},
{fieldtype:"Select", label: "Brand", link:"Brand",
default_value: "Select Brand...", filter: function(val, item, opts) {

View File

@@ -98,9 +98,9 @@ erpnext.StockLevel = erpnext.StockGridReport.extend({
},
filters: [
{fieldtype:"Select", label: "Item Code", link:"Item", default_value: "Select Item...",
{fieldtype:"Link", label: "Item Code", link:"Item", default_value: "Select Item...",
filter: function(val, item, opts) {
return item.item_code == val || val == opts.default_value;
return item.item_code == val || !val;
}},
{fieldtype:"Select", label: "Warehouse", link:"Warehouse",
@@ -200,6 +200,7 @@ erpnext.StockLevel = erpnext.StockGridReport.extend({
var row = {
item_code: item_code,
warehouse: warehouse,
description: item.description,
brand: item.brand,
item_name: item.item_name || item.name,
uom: item.stock_uom,