[MERGE] forward port of branch 7.0 up to 75d3ea6

This commit is contained in:
Christophe Simonis 2014-10-14 14:36:45 +02:00
commit db759948ff
3 changed files with 13 additions and 8 deletions

View File

@ -451,7 +451,8 @@ class email_template(osv.osv):
values = results[res_id]
if 'body_html' in fields and template.user_signature:
signature = self.pool.get('res.users').browse(cr, uid, uid, context).signature
values['body_html'] = tools.append_content_to_html(values['body_html'], signature)
if signature:
values['body_html'] = tools.append_content_to_html(values['body_html'], signature)
if values.get('body_html'):
values['body'] = tools.html_sanitize(values['body_html'])
values.update(

View File

@ -202,7 +202,7 @@
<para style="terp_default_9">Net Total :</para>
</td>
<td>
<para style="terp_default_Right_9">[[ formatLang(o.amount_total, currency_obj=o.pricelist_id.currency_id) ]]</para>
<para style="terp_default_Right_9">[[ formatLang(o.amount_total - o.amount_tax, currency_obj=o.pricelist_id.currency_id) ]]</para>
</td>
</tr>
<tr>
@ -228,7 +228,7 @@
<para style="terp_default_Bold_9">Total:</para>
</td>
<td>
<para style="terp_default_Right_9_Bold">[[ formatLang(o.amount_total + o.amount_tax, currency_obj=o.pricelist_id.currency_id) ]]</para>
<para style="terp_default_Right_9_Bold">[[ formatLang(o.amount_total, currency_obj=o.pricelist_id.currency_id) ]]</para>
</td>
</tr>
</blockTable>

View File

@ -119,6 +119,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
this.mutating_mutex = new $.Mutex();
this.on_change_list = [];
this.save_list = [];
this.render_value_defs = [];
this.reload_mutex = new $.Mutex();
this.__clicked_inside = false;
this.__blur_timeout = null;
@ -697,6 +698,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
} else if (mode === "create") {
mode = "edit";
}
this.render_value_defs = [];
this.set({actual_mode: mode});
},
check_actual_mode: function(source, options) {
@ -747,12 +749,15 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
});
},
on_button_cancel: function(event) {
var self = this;
if (this.can_be_discarded()) {
if (this.get('actual_mode') === 'create') {
this.trigger('history_back');
} else {
this.to_view_mode();
this.trigger('load_record', this.datarecord);
$.when.apply(null, this.render_value_defs).then(function(){
self.trigger('load_record', self.datarecord);
});
}
}
this.trigger('on_button_cancel');
@ -2257,7 +2262,7 @@ instance.web.form.ReinitializeWidgetMixin = {
instance.web.form.ReinitializeFieldMixin = _.extend({}, instance.web.form.ReinitializeWidgetMixin, {
reinitialize: function() {
instance.web.form.ReinitializeWidgetMixin.reinitialize.call(this);
this.render_value();
this.view.render_value_defs.push(this.render_value());
},
});
@ -4452,9 +4457,8 @@ instance.web.form.FieldMany2ManyTags = instance.web.form.AbstractField.extend(in
self.render_tag(data);
}
if (! values || values.length > 0) {
this._display_orderer.add(self.get_render_data(values)).done(handle_names);
}
else{
return this._display_orderer.add(self.get_render_data(values)).done(handle_names);
} else {
handle_names([]);
}
},