mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-07 15:12:51 +00:00
Merge branch 'master' of github.com:webnotes/erpnext into production
This commit is contained in:
@@ -103,26 +103,19 @@ cur_frm.fields_dict['item_group'].get_query = function(doc,cdt,cdn) {
|
||||
// a table with both image and attachment in HTML
|
||||
// in the "alternate_description" field
|
||||
cur_frm.cscript.add_image = function(doc, dt, dn) {
|
||||
if(!doc.file_list) {
|
||||
msgprint('Please attach a file first!');
|
||||
if(!doc.image) {
|
||||
msgprint('Please select an "Image" first');
|
||||
return;
|
||||
}
|
||||
|
||||
var f = doc.file_list.split('\n')[0];
|
||||
var fname = f.split(',')[0];
|
||||
var fid = f.split(',')[1];
|
||||
if(!in_list(['jpg','jpeg','gif','png'], fname.split('.')[1].toLowerCase())) {
|
||||
msgprint('File must be of extension jpg, jpeg, gif or png'); return;
|
||||
}
|
||||
|
||||
doc.description_html = repl('<table style="width: 100%; table-layout: fixed;">'+
|
||||
'<tr><td style="width:110px"><img src="%(imgurl)s" width="100px"></td>'+
|
||||
'<td>%(desc)s</td></tr>'+
|
||||
'</table>', {imgurl: wn.urllib.get_file_url(fid), desc:doc.description});
|
||||
'</table>', {imgurl: wn.utils.get_file_link(doc.image), desc:doc.description});
|
||||
|
||||
refresh_field('description_html');
|
||||
}
|
||||
//===================== Quotation to validation - either customer or lead mandatory ====================
|
||||
// Quotation to validation - either customer or lead mandatory
|
||||
cur_frm.cscript.weight_to_validate = function(doc,cdt,cdn){
|
||||
|
||||
if((doc.nett_weight || doc.gross_weight) && !doc.weight_uom)
|
||||
@@ -131,13 +124,11 @@ cur_frm.cscript.weight_to_validate = function(doc,cdt,cdn){
|
||||
validated=0;
|
||||
}
|
||||
}
|
||||
//===================validation function =================================
|
||||
|
||||
cur_frm.cscript.validate = function(doc,cdt,cdn){
|
||||
cur_frm.cscript.weight_to_validate(doc,cdt,cdn);
|
||||
}
|
||||
|
||||
//===========Fill Default Currency in "Item Prices====================
|
||||
cur_frm.fields_dict['ref_rate_details'].grid.onrowadd = function(doc, cdt, cdn){
|
||||
locals[cdt][cdn].ref_currency = sys_defaults.currency;
|
||||
refresh_field('ref_currency',cdn,'ref_rate_details');
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
{
|
||||
"owner": "Administrator",
|
||||
"docstatus": 0,
|
||||
"creation": "2012-12-07 15:15:29",
|
||||
"creation": "2012-12-11 15:58:47",
|
||||
"modified_by": "Administrator",
|
||||
"modified": "2012-12-07 15:44:48"
|
||||
"modified": "2012-12-11 16:08:49"
|
||||
},
|
||||
{
|
||||
"allow_attach": 1,
|
||||
@@ -14,6 +14,7 @@
|
||||
"description": "A Product or a Service that is bought, sold or kept in stock.",
|
||||
"autoname": "field:item_code",
|
||||
"name": "__common__",
|
||||
"default_print_format": "Standard",
|
||||
"allow_rename": 1,
|
||||
"doctype": "DocType",
|
||||
"max_attachments": 1
|
||||
@@ -131,14 +132,29 @@
|
||||
"fieldtype": "Column Break",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"label": "Image",
|
||||
"options": "attach_files:",
|
||||
"fieldname": "image",
|
||||
"fieldtype": "Select",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"doctype": "DocField",
|
||||
"label": "Image View",
|
||||
"options": "image",
|
||||
"fieldname": "image_view",
|
||||
"fieldtype": "Image",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"oldfieldtype": "Text",
|
||||
"doctype": "DocField",
|
||||
"label": "Description",
|
||||
"oldfieldname": "description",
|
||||
"width": "300px",
|
||||
"fieldname": "description",
|
||||
"fieldtype": "Text",
|
||||
"fieldtype": "Small Text",
|
||||
"search_index": 0,
|
||||
"reqd": 1,
|
||||
"permlevel": 0,
|
||||
@@ -148,13 +164,13 @@
|
||||
"doctype": "DocField",
|
||||
"label": "Description HTML",
|
||||
"fieldname": "description_html",
|
||||
"fieldtype": "Text",
|
||||
"fieldtype": "Small Text",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"description": "Generates HTML to include image (1st attachment) in the description",
|
||||
"description": "Generates HTML to include selected image in the description",
|
||||
"doctype": "DocField",
|
||||
"label": "Add Image",
|
||||
"label": "Generate Description HTML",
|
||||
"fieldname": "add_image",
|
||||
"fieldtype": "Button",
|
||||
"permlevel": 0
|
||||
@@ -768,27 +784,18 @@
|
||||
"doctype": "DocField",
|
||||
"label": "Short Description",
|
||||
"fieldname": "web_short_description",
|
||||
"fieldtype": "Small Text",
|
||||
"fieldtype": "Text",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"depends_on": "show_in_website",
|
||||
"doctype": "DocField",
|
||||
"label": "Long Description",
|
||||
"options": "Markdown",
|
||||
"fieldname": "web_long_description",
|
||||
"fieldtype": "Text Editor",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"description": "These details will be shown in a formatted table the page for this product.",
|
||||
"depends_on": "show_in_website",
|
||||
"doctype": "DocField",
|
||||
"label": "Item Website Specifications",
|
||||
"options": "Item Website Specification",
|
||||
"fieldname": "item_website_specifications",
|
||||
"fieldtype": "Table",
|
||||
"permlevel": 0
|
||||
},
|
||||
{
|
||||
"amend": 0,
|
||||
"create": 0,
|
||||
|
||||
Reference in New Issue
Block a user