From 42a738d8bd29a2077cdfc2f67b7989dc3bf9ad0f Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 13 Dec 2012 15:44:32 +0530 Subject: [PATCH 1/4] fixed brand css --- public/css/ui/common.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/public/css/ui/common.css b/public/css/ui/common.css index 76c6ad9be0..40daab5f59 100644 --- a/public/css/ui/common.css +++ b/public/css/ui/common.css @@ -16,6 +16,10 @@ a { Filter:alpha(opacity=100); /* For IE8 and earlier */ } +.navbar .brand { + max-height: 15px; +} + .navbar #spinner { display: block; float: right; From a91f5bbc228f7350593e54ad7c9303859cfc191e Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 14 Dec 2012 13:13:47 +0530 Subject: [PATCH 2/4] fixes related to auto_email_id --- conf/conf.py | 1 + webnotes/utils/email_lib/smtp.py | 10 ++++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/conf/conf.py b/conf/conf.py index 691d729f56..8025ea17f1 100644 --- a/conf/conf.py +++ b/conf/conf.py @@ -32,6 +32,7 @@ mail_login = None mail_password = None mail_port = None use_ssl = None +auto_email_id = None # logging settings log_file_name = 'logs/error_log.txt' diff --git a/webnotes/utils/email_lib/smtp.py b/webnotes/utils/email_lib/smtp.py index 4ec172448d..ff6e9ac698 100644 --- a/webnotes/utils/email_lib/smtp.py +++ b/webnotes/utils/email_lib/smtp.py @@ -199,9 +199,15 @@ class EMail: return email if not self.sender: - # TODO: remove erpnext id self.sender = webnotes.conn.get_value('Email Settings', None, - 'auto_email_id') or getattr(conf, 'auto_email_id') + 'auto_email_id') or getattr(conf, 'auto_email_id', None) + if not self.sender: + webnotes.msgprint("""Please specify 'Auto Email Id' \ + in Setup > Email Settings""") + if not hasattr(conf, "expires_on"): + webnotes.msgprint("""Alternatively, \ + you can also specify 'auto_email_id' in conf.py""") + raise webnotes.ValidationError self.sender = _validate(self.sender) self.reply_to = _validate(self.reply_to) From ca7fbf44ad6567e559ef2282eaedab9398d5840d Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 14 Dec 2012 13:14:03 +0530 Subject: [PATCH 3/4] make a grid column required --- public/js/legacy/widgets/form/grid.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/public/js/legacy/widgets/form/grid.js b/public/js/legacy/widgets/form/grid.js index 6bac4513d5..946bc9cc93 100644 --- a/public/js/legacy/widgets/form/grid.js +++ b/public/js/legacy/widgets/form/grid.js @@ -151,6 +151,16 @@ _f.Grid.prototype.set_column_disp = function(fieldname, show) { this.reset_table_width(); } +_f.Grid.prototype.toggle_reqd = function(fieldname, reqd) { + // IMPORTANT: this should be called in refresh event + var grid_field = this.get_field(fieldname); + grid_field.df.reqd = reqd ? true : false; + grid_field.refresh(); + + $(grid_field.grid.head_row).find('[data-grid-fieldname="' + grid_field.grid.doctype + + '-' + fieldname + '"]').css({ color: reqd ? "#D22" : "black" }); +} + _f.Grid.prototype.append_row = function(idx, docname) { if(!idx)idx = this.tab.rows.length; var row = this.tab.insertRow(idx); From 00e15bf945ee8312542cbf0d5984e933b164ceea Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 14 Dec 2012 13:14:13 +0530 Subject: [PATCH 4/4] disable save in a form --- public/js/legacy/widgets/form/form.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/public/js/legacy/widgets/form/form.js b/public/js/legacy/widgets/form/form.js index 72036aac5d..90ef5a4de1 100644 --- a/public/js/legacy/widgets/form/form.js +++ b/public/js/legacy/widgets/form/form.js @@ -931,7 +931,7 @@ _f.Frm.prototype.savesubmit = function(btn) { if(!r.exc && me.cscript.on_submit) { me.runclientscript('on_submit', me.doctype, me.docname); } - }, btn); + }, btn); }); } @@ -966,6 +966,12 @@ _f.Frm.prototype.amend_doc = function() { this.copy_doc(fn, 1); } +_f.Frm.prototype.disable_save = function() { + cur_frm.save_disabled = true; + cur_frm.page_layout.footer.hide_save(); + cur_frm.frm_head.appframe.buttons.Save.toggle(false); +} + _f.get_value = function(dt, dn, fn) { if(locals[dt] && locals[dt][dn]) return locals[dt][dn][fn];