ソースを参照

do not allow mandatory and hidden and also bugfix in communication creation

version-14
Rushabh Mehta 12年前
コミット
d15271c27d
4個のファイルの変更16行の追加5行の削除
  1. +10
    -2
      core/doctype/doctype/doctype.py
  2. +1
    -0
      public/js/wn/ui/listing.js
  3. +1
    -0
      public/js/wn/views/doclistview.js
  4. +4
    -3
      webnotes/utils/email_lib/form_email.py

+ 10
- 2
core/doctype/doctype/doctype.py ファイルの表示

@@ -190,9 +190,16 @@ def validate_fields(fields):
def check_link_table_options(d):
if d.fieldtype in ("Link", "Table"):
if not d.options:
webnotes.msgprint("""#%(idx)s %(label)s: Options must be specified for Link and Table type fields""" % d.fields, raise_exception=1)
webnotes.msgprint("""#%(idx)s %(label)s: Options must be specified for Link and Table type fields""" % d.fields,
raise_exception=1)
if not webnotes.conn.exists("DocType", d.options):
webnotes.msgprint("""#%(idx)s %(label)s: Options %(options)s must be a valid "DocType" for Link and Table type fields""" % d.fields, raise_exception=1)
webnotes.msgprint("""#%(idx)s %(label)s: Options %(options)s must be a valid "DocType" for Link and Table type fields""" % d.fields,
raise_exception=1)

def check_hidden_and_mandatory(d):
if d.hidden and d.reqd:
webnotes.msgprint("""#%(idx)s %(label)s: Cannot be hidden and mandatory (reqd)""" % d.fields,
raise_exception=True)

for d in fields:
if not d.permlevel: d.permlevel = 0
@@ -202,4 +209,5 @@ def validate_fields(fields):
check_unique_fieldname(d.fieldname)
check_illegal_mandatory(d)
check_link_table_options(d)
check_hidden_and_mandatory(d)

+ 1
- 0
public/js/wn/ui/listing.js ファイルの表示

@@ -223,6 +223,7 @@ wn.ui.Listing = Class.extend({

if(!me.opts.no_loading)
me.set_working(true);
wn.call({
method: this.opts.method || 'webnotes.widgets.query_builder.runquery',
args: this.get_call_args(a0),


+ 1
- 0
public/js/wn/views/doclistview.js ファイルの表示

@@ -146,6 +146,7 @@ wn.views.DocListView = wn.ui.Listing.extend({
method: 'webnotes.widgets.doclistview.get',
get_args: this.get_args,
parent: this.wrapper,
freeze: true,
start: 0,
page_length: this.page_length,
show_filters: true,


+ 4
- 3
webnotes/utils/email_lib/form_email.py ファイルの表示

@@ -162,15 +162,16 @@ class FormEmail:
comm_cols = [c[0] for c in webnotes.conn.sql("""desc tabCommunication""")]
# tag to record
if self.dt in comm_cols:
comm.fields[self.dt] = self.dn
dt = self.dt.lower().replace(" ", "_")
if dt in comm_cols:
comm.fields[dt] = self.dn
# tag to customer, supplier (?)
if self.customer:
comm.customer = self.customer
if self.supplier:
comm.supplier = self.supplier
comm.save(1)
except Exception, e:
if e.args[0]!=1146: raise e


読み込み中…
キャンセル
保存