[MERGE] Merged with trunk web.

bzr revid: tde@openerp.com-20120625083249-fbhhfhpi3jfsroau
This commit is contained in:
Thibault Delavallée
2012-06-25 10:32:49 +02:00
2 changed files with 15 additions and 3 deletions
+8 -3
View File
@@ -1814,15 +1814,20 @@ class Reports(View):
report = zlib.decompress(report)
report_mimetype = self.TYPES_MAPPING.get(
report_struct['format'], 'octet-stream')
file_name = None
if 'name' not in action:
reports = req.session.model('ir.actions.report.xml')
res_id = reports.search([('report_name', '=',action['report_name']),],
res_id = reports.search([('report_name', '=', action['report_name']),],
0, False, False, context)
action['name'] = reports.read(res_id, ['name'], context)[0]['name']
if len(res_id) > 0:
file_name = reports.read(res_id[0], ['name'], context)['name']
else:
file_name = action['report_name']
return req.make_response(report,
headers=[
('Content-Disposition', 'attachment; filename="%s.%s"' % (action['name'], report_struct['format'])),
# maybe we should take of what characters can appear in a file name?
('Content-Disposition', 'attachment; filename="%s.%s"' % (file_name, report_struct['format'])),
('Content-Type', report_mimetype),
('Content-Length', len(report))],
cookies={'fileToken': int(token)})
+7
View File
@@ -472,6 +472,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
return self.on_processed_onchange(response, processed);
} catch(e) {
console.error(e);
instance.webclient.crashmanager.on_javascript_exception(e);
return $.Deferred().reject();
}
@@ -509,6 +510,9 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
}
if (result.domain) {
function edit_domain(node) {
if (typeof node !== "object") {
return;
}
var new_domain = result.domain[node.attrs.name];
if (new_domain) {
node.attrs.domain = new_domain;
@@ -520,6 +524,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
return $.Deferred().resolve();
} catch(e) {
console.error(e);
instance.webclient.crashmanager.on_javascript_exception(e);
return $.Deferred().reject();
}
},
@@ -552,6 +557,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
on_button_cancel: function(event) {
if (this.can_be_discarded()) {
this.set({mode: "view"});
this.on_record_loaded(this.datarecord);
}
return false;
},
@@ -2023,6 +2029,7 @@ instance.web.DateTimeWidget = instance.web.OldWidget.extend({
this.$input_picker = this.$element.find('input.oe_datepicker_container');
this.$input.change(this.on_change);
this.picker({
onClose: this.on_picker_select,
onSelect: this.on_picker_select,
changeMonth: true,
changeYear: true,