From 0195eb407d8f71b7adc878f9bc39d14de8bde38b Mon Sep 17 00:00:00 2001 From: "Amit (OpenERP)" Date: Wed, 22 Aug 2012 11:55:55 +0530 Subject: [PATCH 1/8] [FIX] mail_template : Fixes the duplication problem on email template lp bug: https://launchpad.net/bugs/1039645 fixed bzr revid: amp@tinyerp.com-20120822062555-d7thh474wn5lisnv --- addons/email_template/email_template.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/addons/email_template/email_template.py b/addons/email_template/email_template.py index b43b7d19b85..6f48d37c714 100644 --- a/addons/email_template/email_template.py +++ b/addons/email_template/email_template.py @@ -236,6 +236,10 @@ class email_template(osv.osv): default = {} default = default.copy() default['name'] = template.name + _('(copy)') + default.update({ + 'ref_ir_act_window': False, + 'ref_ir_value': False, + }) return super(email_template, self).copy(cr, uid, id, default, context) def build_expression(self, field_name, sub_field_name, null_value): From b3027a371cef466856307b5ac88c1fcc69a0be81 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Mon, 24 Sep 2012 15:45:33 +0200 Subject: [PATCH 2/8] [IMP] account: improved demo data to add a second bank journal, in foreign currency bzr revid: qdp-launchpad@openerp.com-20120924134533-s1j8mmqou9uw2mdt --- addons/account/demo/account_minimal.xml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/addons/account/demo/account_minimal.xml b/addons/account/demo/account_minimal.xml index 53f2b54e0ef..2647364597b 100644 --- a/addons/account/demo/account_minimal.xml +++ b/addons/account/demo/account_minimal.xml @@ -122,6 +122,14 @@ other + + X11007 + USD Bank Account - (test) + + liquidity + + + Liabilities - (test) @@ -360,8 +368,8 @@ bank - - + + @@ -412,6 +420,17 @@ + + + USD Bank Journal - (test) + TUBK + bank + + + + + + From 247752851272d5bb3e222d31fcde81e1259e9f17 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Mon, 24 Sep 2012 15:49:10 +0200 Subject: [PATCH 3/8] [FIX] l10n_ch: linked the demo journal of BANK CHF JOURNAL to the CHF currency bzr revid: qdp-launchpad@openerp.com-20120924134910-5yye9t2m7yrqhhu7 --- addons/l10n_ch/journal_data.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/l10n_ch/journal_data.xml b/addons/l10n_ch/journal_data.xml index 04870ca936b..ede9136c3d2 100644 --- a/addons/l10n_ch/journal_data.xml +++ b/addons/l10n_ch/journal_data.xml @@ -19,6 +19,7 @@ + From edb74f79b1d502921dbf58c179d67f624b5a9879 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Mon, 24 Sep 2012 16:06:17 +0200 Subject: [PATCH 4/8] [IMP] base: added a new rate for USD, for demo transactions in multi currency bzr revid: qdp-launchpad@openerp.com-20120924140617-e0mlvtz2pf7icqo2 --- openerp/addons/base/base_demo.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/openerp/addons/base/base_demo.xml b/openerp/addons/base/base_demo.xml index 064b1f49e69..ce675ebb99e 100644 --- a/openerp/addons/base/base_demo.xml +++ b/openerp/addons/base/base_demo.xml @@ -14,5 +14,12 @@ + + + + 1.5289 + + + From 9aa98a03d1ff0ca456e67041a7b73d436a44d358 Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Mon, 24 Sep 2012 16:40:27 +0200 Subject: [PATCH 5/8] [FIX] account: fixed missing reference to sequence in demo journal bzr revid: qdp-launchpad@openerp.com-20120924144027-jxj61tt3cg0vud5j --- addons/account/demo/account_minimal.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/account/demo/account_minimal.xml b/addons/account/demo/account_minimal.xml index 2647364597b..8f879d6b465 100644 --- a/addons/account/demo/account_minimal.xml +++ b/addons/account/demo/account_minimal.xml @@ -426,7 +426,6 @@ TUBK bank - From 7b6280243572f4e0c60772be23ba8fc154e541b2 Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Mon, 24 Sep 2012 17:34:30 +0200 Subject: [PATCH 6/8] [IMP] use kwargs instead of a new dict bzr revid: abo@openerp.com-20120924153430-0nb2gxker8v9is5p --- addons/email_template/email_template.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/addons/email_template/email_template.py b/addons/email_template/email_template.py index 6f48d37c714..cc4b52992a4 100644 --- a/addons/email_template/email_template.py +++ b/addons/email_template/email_template.py @@ -236,9 +236,7 @@ class email_template(osv.osv): default = {} default = default.copy() default['name'] = template.name + _('(copy)') - default.update({ - 'ref_ir_act_window': False, - 'ref_ir_value': False, + default.update(ref_ir_act_window=False, ref_ir_value=False) }) return super(email_template, self).copy(cr, uid, id, default, context) @@ -392,7 +390,7 @@ class email_template(osv.osv): :param bool force_send: if True, the generated mail.message is immediately sent after being created, as if the scheduler was executed for this message only. - :returns: id of the mail.message that was created + :returns: id of the mail.message that was created """ if context is None: context = {} mail_message = self.pool.get('mail.message') From f7b90af93ad6d97444d56ec81ee9d3ce959299e4 Mon Sep 17 00:00:00 2001 From: Antonin Bourguignon Date: Mon, 24 Sep 2012 17:56:00 +0200 Subject: [PATCH 7/8] [FIX] forgot to remove }) bzr revid: abo@openerp.com-20120924155600-dnaanyupa5jm0yre --- addons/email_template/email_template.py | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/email_template/email_template.py b/addons/email_template/email_template.py index 53d484bd92d..87bdfccbbcf 100644 --- a/addons/email_template/email_template.py +++ b/addons/email_template/email_template.py @@ -217,7 +217,6 @@ class email_template(osv.osv): default = default.copy() default['name'] = template.name + _('(copy)') default.update(ref_ir_act_window=False, ref_ir_value=False) - }) return super(email_template, self).copy(cr, uid, id, default, context) def build_expression(self, field_name, sub_field_name, null_value): From 70a1aac877933c591b3d807dbed541c92fc7a6fe Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Mon, 24 Sep 2012 18:07:21 +0200 Subject: [PATCH 8/8] [IMP] minor change in form view fields bzr revid: nicolas.vanhoren@openerp.com-20120924160721-hay0ar7ap22gjyk7 --- addons/web/static/src/js/view_form.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index e3b7bde1bfe..dff9df11140 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -331,7 +331,9 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM _(this.fields).each(function (field, f) { field._dirty_flag = false; + field._inhibit_on_change_flag = true; var result = field.set_value(self.datarecord[f] || false); + field._inhibit_on_change_flag = false; set_values.push(result); }); return $.when.apply(null, set_values).pipe(function() { @@ -580,7 +582,9 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM if (field) { var value_ = result.value[f]; if (field.get_value() != value_) { + field._inhibit_on_change_flag = true; field.set_value(value_); + field._inhibit_on_change_flag = false; field._dirty_flag = true; if (!_.contains(processed, field.name)) { this.do_onchange(field, processed); @@ -1052,6 +1056,9 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM this.translatable_fields.push(field); } field.on('changed_value', this, function() { + if (field._inhibit_on_change_flag) { + return; + } field._dirty_flag = true; if (field.is_syntax_valid()) { this.do_onchange(field); @@ -1948,8 +1955,7 @@ instance.web.form.AbstractField = instance.web.form.FormWidget.extend(instance.w this.on("change:force_readonly", this, test_effective_readonly); test_effective_readonly.call(this); this.on("change:value", this, function() { - if (! this._inhibit_on_change) - this.trigger('changed_value'); + this.trigger('changed_value'); this._check_css_flags(); }); }, @@ -1984,9 +1990,7 @@ instance.web.form.AbstractField = instance.web.form.FormWidget.extend(instance.w this.$el.toggleClass('oe_form_required', this.get("required")); }, set_value: function(value_) { - this._inhibit_on_change = true; this.set({'value': value_}); - this._inhibit_on_change = false; }, get_value: function() { return this.get('value'); @@ -3321,6 +3325,7 @@ instance.web.form.FieldOne2Many = instance.web.form.AbstractField.extend({ this.dataset.index = 0; } self.is_setted.resolve(); + this.trigger_on_change(); return self.reload_current_view(); }, get_value: function() {