diff --git a/addons/edi/models/edi.py b/addons/edi/models/edi.py index 1b9e0c4df08..b85d41c9657 100644 --- a/addons/edi/models/edi.py +++ b/addons/edi/models/edi.py @@ -564,7 +564,7 @@ class EDIMixin(object): continue field = field_info.column # skip function/related fields - if isinstance(field, fields.function): + if isinstance(field, fields.function) and not field._fnct_inv: _logger.warning("Unexpected function field value is found in '%s' EDI document: '%s'." % (self._name, field_name)) continue relation_model = field._obj diff --git a/addons/mail/static/src/js/mail.js b/addons/mail/static/src/js/mail.js index 130aaa82d7c..33172fe5933 100644 --- a/addons/mail/static/src/js/mail.js +++ b/addons/mail/static/src/js/mail.js @@ -369,6 +369,16 @@ openerp.mail = function (session) { this.is_log = false; this.recipients = []; this.recipient_ids = []; + session.web.bus.on('clear_uncommitted_changes', this, function(e) { + if (this.show_composer && !e.isDefaultPrevented()){ + if (!confirm(_t("You are currently composing a message, your message will be discarded.\n\nAre you sure you want to leave this page ?"))) { + e.preventDefault(); + } + else{ + this.on_cancel(); + } + } + }); }, start: function () { diff --git a/openerp/addons/base/res/res_lang.py b/openerp/addons/base/res/res_lang.py index 11a115ba009..3fb58e901f6 100644 --- a/openerp/addons/base/res/res_lang.py +++ b/openerp/addons/base/res/res_lang.py @@ -123,6 +123,15 @@ class lang(osv.osv): return False return True + def _check_grouping(self, cr, uid, ids, context=None): + for lang in self.browse(cr, uid, ids, context=context): + try: + if not all(isinstance(x, int) for x in eval(lang.grouping)): + return False + except Exception: + return False + return True + def _get_default_date_format(self, cursor, user, context=None): return '%m/%d/%Y' @@ -158,7 +167,8 @@ class lang(osv.osv): ] _constraints = [ - (_check_format, 'Invalid date/time format directive specified. Please refer to the list of allowed directives, displayed when you edit a language.', ['time_format', 'date_format']) + (_check_format, 'Invalid date/time format directive specified. Please refer to the list of allowed directives, displayed when you edit a language.', ['time_format', 'date_format']), + (_check_grouping, "The Separator Format should be like [,n] where 0 < n :starting from Unit digit.-1 will end the separation. e.g. [3,2,-1] will represent 106500 to be 1,06,500;[1,2,-1] will represent it to be 106,50,0;[3] will represent it as 106,500. Provided ',' as the thousand separator in each case.", ['grouping']) ] @tools.ormcache(skiparg=3) diff --git a/openerp/tools/translate.py b/openerp/tools/translate.py index df4efb6654d..01d1a4a7ebf 100644 --- a/openerp/tools/translate.py +++ b/openerp/tools/translate.py @@ -345,6 +345,7 @@ class TinyPoFile(object): source = unquote(line[6:]) line = self.lines.pop(0).strip() if not source and self.first: + self.first = False # if the source is "" and it's the first msgid, it's the special # msgstr with the informations about the traduction and the # traductor; we skip it @@ -374,8 +375,6 @@ class TinyPoFile(object): if t == trans_type == 'code': continue self.extra_lines.append((t, n, r, source, trad, comments)) - self.first = False - if name is None: if not fuzzy: self.warn('Missing "#:" formated comment at line %d for the following source:\n\t%s',