[MERGE] forward port of branch 7.0 up to 6c55a4b

This commit is contained in:
Christophe Simonis 2015-01-19 12:09:48 +01:00
commit cdb48d39ba
4 changed files with 23 additions and 4 deletions

View File

@ -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

View File

@ -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 () {

View File

@ -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)

View File

@ -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',