fixes to language

This commit is contained in:
Rushabh Mehta 2013-01-24 15:22:06 +05:30
parent ab6d28ef4f
commit 46e8084aea
2 changed files with 22 additions and 37 deletions

View File

@ -8,28 +8,27 @@
// //
// This program is distributed in the hope that it will be useful, // This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details. // GNU General Public License for more details.
// //
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>. // along with this program. If not, see <http://www.gnu.org/licenses/>.
cur_frm.cscript.onload = function(doc, cdt, cdn) { cur_frm.cscript.onload = function(doc, cdt, cdn) {
if(!doc.status) set_multiple(cdt, cdn, {status:'In Store'}); if(!doc.status) set_multiple(cdt, cdn, {status:'In Store'});
if(doc.__islocal) hide_field(['supplier_name','address_display']) if(doc.__islocal) hide_field(['supplier_name','address_display'])
} }
cur_frm.cscript.refresh = function(doc, cdt, cdn) { cur_frm.cscript.refresh = function(doc, cdt, cdn) {
if(!doc.__islocal) { flds = ['status', 'item_code', 'warehouse', 'purchase_document_type',
flds = ['item_code', 'warehouse', 'purchase_document_type', 'purchase_document_no', 'purchase_date', 'purchase_time', 'purchase_rate', 'supplier'] 'purchase_document_no', 'purchase_date', 'purchase_time', 'purchase_rate',
for(i=0;i<flds.length;i++) 'supplier']
cur_frm.set_df_property(flds[i], 'read_only', 1); for(i=0;i<flds.length;i++) {
} cur_frm.set_df_property(flds[i], 'read_only', doc.__islocal ? 0 : 1);
}
} }
// item details // item details
// ------------- // -------------
cur_frm.add_fetch('item_code', 'item_name', 'item_name') cur_frm.add_fetch('item_code', 'item_name', 'item_name')
@ -47,14 +46,14 @@ cur_frm.add_fetch('customer', 'territory', 'territory')
// territory // territory
// ---------- // ----------
cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) { cur_frm.fields_dict['territory'].get_query = function(doc,cdt,cdn) {
return 'SELECT `tabTerritory`.`name`,`tabTerritory`.`parent_territory` FROM `tabTerritory` WHERE `tabTerritory`.`is_group` = "No" AND `tabTerritory`.`docstatus`!= 2 AND `tabTerritory`.%(key)s LIKE "%s" ORDER BY `tabTerritory`.`name` ASC LIMIT 50'; return 'SELECT `tabTerritory`.`name`,`tabTerritory`.`parent_territory` FROM `tabTerritory` WHERE `tabTerritory`.`is_group` = "No" AND `tabTerritory`.`docstatus`!= 2 AND `tabTerritory`.%(key)s LIKE "%s" ORDER BY `tabTerritory`.`name` ASC LIMIT 50';
} }
// Supplier // Supplier
//------------- //-------------
cur_frm.cscript.supplier = function(doc,dt,dn) { cur_frm.cscript.supplier = function(doc,dt,dn) {
if(doc.supplier) get_server_fields('get_default_supplier_address', JSON.stringify({supplier: doc.supplier}),'', doc, dt, dn, 1); if(doc.supplier) get_server_fields('get_default_supplier_address', JSON.stringify({supplier: doc.supplier}),'', doc, dt, dn, 1);
if(doc.supplier) unhide_field(['supplier_name','address_display']); if(doc.supplier) unhide_field(['supplier_name','address_display']);
} }
//item code //item code

View File

@ -2,7 +2,7 @@
{ {
"creation": "2013-01-10 16:34:31", "creation": "2013-01-10 16:34:31",
"docstatus": 0, "docstatus": 0,
"modified": "2013-01-22 14:57:25", "modified": "2013-01-24 14:29:22",
"modified_by": "Administrator", "modified_by": "Administrator",
"owner": "Administrator" "owner": "Administrator"
}, },
@ -24,14 +24,17 @@
}, },
{ {
"amend": 0, "amend": 0,
"create": 1,
"doctype": "DocPerm", "doctype": "DocPerm",
"name": "__common__", "name": "__common__",
"parent": "Support Ticket", "parent": "Support Ticket",
"parentfield": "permissions", "parentfield": "permissions",
"parenttype": "DocType", "parenttype": "DocType",
"permlevel": 0,
"read": 1, "read": 1,
"report": 1, "report": 1,
"submit": 0 "submit": 0,
"write": 1
}, },
{ {
"doctype": "DocType", "doctype": "DocType",
@ -60,7 +63,7 @@
"oldfieldname": "status", "oldfieldname": "status",
"oldfieldtype": "Select", "oldfieldtype": "Select",
"options": "\nOpen\nTo Reply\nWaiting for Customer\nHold\nClosed", "options": "\nOpen\nTo Reply\nWaiting for Customer\nHold\nClosed",
"read_only": 1, "read_only": 0,
"reqd": 0, "reqd": 0,
"search_index": 1 "search_index": 1
}, },
@ -244,34 +247,17 @@
}, },
{ {
"cancel": 0, "cancel": 0,
"create": 1,
"doctype": "DocPerm", "doctype": "DocPerm",
"permlevel": 0, "role": "Guest"
"role": "Guest",
"write": 1
}, },
{ {
"cancel": 0, "cancel": 0,
"create": 1,
"doctype": "DocPerm", "doctype": "DocPerm",
"permlevel": 0, "role": "Customer"
"role": "Customer",
"write": 1
}, },
{ {
"cancel": 1, "cancel": 1,
"create": 1,
"doctype": "DocPerm", "doctype": "DocPerm",
"permlevel": 0, "role": "Support Team"
"role": "Support Team",
"write": 1
},
{
"cancel": 0,
"create": 0,
"doctype": "DocPerm",
"permlevel": 2,
"role": "Support Team",
"write": 0
} }
] ]