diff --git a/addons/email_template/email_template.py b/addons/email_template/email_template.py index d8b0f61f868..ed19efdd1a7 100644 --- a/addons/email_template/email_template.py +++ b/addons/email_template/email_template.py @@ -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( diff --git a/addons/point_of_sale/report/pos_lines.rml b/addons/point_of_sale/report/pos_lines.rml index 1ed8e33eede..1b6774578c0 100644 --- a/addons/point_of_sale/report/pos_lines.rml +++ b/addons/point_of_sale/report/pos_lines.rml @@ -202,7 +202,7 @@ Net Total : - [[ formatLang(o.amount_total, currency_obj=o.pricelist_id.currency_id) ]] + [[ formatLang(o.amount_total - o.amount_tax, currency_obj=o.pricelist_id.currency_id) ]] @@ -228,7 +228,7 @@ Total: - [[ formatLang(o.amount_total + o.amount_tax, currency_obj=o.pricelist_id.currency_id) ]] + [[ formatLang(o.amount_total, currency_obj=o.pricelist_id.currency_id) ]] diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index e93375c1d81..d0951b6537e 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -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([]); } },