Procházet zdrojové kódy

minimum width for fieldtype currency is 100px

version-14
Nabin Hait před 12 roky
rodič
revize
ebd7289723
2 změnil soubory, kde provedl 7 přidání a 3 odebrání
  1. +4
    -0
      core/doctype/doctype/doctype.py
  2. +3
    -3
      public/js/legacy/widgets/form/grid.js

+ 4
- 0
core/doctype/doctype/doctype.py Zobrazit soubor

@@ -206,6 +206,10 @@ def validate_fields(fields):
if d.hidden and d.reqd:
webnotes.msgprint("""#%(idx)s %(label)s: Cannot be hidden and mandatory (reqd)""" % d.fields,
raise_exception=True)
def check_width(d):
if d.fieldtype == "Currency" and cint(d.width) < 100:
webnotes.msgprint("Minimum width for FieldType 'Currency' is 100px", raise_exception=1)

for d in fields:
if not d.permlevel: d.permlevel = 0


+ 3
- 3
public/js/legacy/widgets/form/grid.js Zobrazit soubor

@@ -98,9 +98,9 @@ _f.Grid.prototype.insert_column = function(doctype, fieldname, fieldtype, label,
var idx = this.head_row.cells.length;
if(!width)width = '100px';
if((width+'').slice(-2)!='px') {
width= width + 'px';
}
if(fieldtype=="Currency" && cint(width) < 100) width = "100px";
width= cint(width) + 'px';
var col = this.head_row.insertCell(idx);
col.doctype = doctype; // for report (fields may be from diff doctypes)


Načítá se…
Zrušit
Uložit