-
- Journal :
-
- Period :
-
From 30ea1678309f9ee5f0c62c977634367209b5d881 Mon Sep 17 00:00:00 2001
From: "Denis Ledoux dle@openerp.com" <>
Date: Mon, 19 Nov 2012 12:19:07 +0100
Subject: [PATCH 15/18] Select boxes disabled when editing : )
bzr revid: dle@openerp.com-20121119111907-x59ovkghvjpzh33n
---
.../src/js/account_move_line_quickadd.js | 28 +++++++++++++------
1 file changed, 19 insertions(+), 9 deletions(-)
diff --git a/addons/account/static/src/js/account_move_line_quickadd.js b/addons/account/static/src/js/account_move_line_quickadd.js
index d36565d2ecf..1cc8942cb72 100644
--- a/addons/account/static/src/js/account_move_line_quickadd.js
+++ b/addons/account/static/src/js/account_move_line_quickadd.js
@@ -99,17 +99,27 @@ openerp.account.quickadd = function (instance) {
var compoundContext = self.last_context;
return self.old_search(compoundDomain, compoundContext, self.last_group_by);
},
- /*_next: function (next_record, options) {
- next_record = next_record || 'succ';
+ start_edition: function (record, options) {
+ this.$el.parent().find('.oe_account_select_journal').attr('disabled', 'disabled');
+ this.$el.parent().find('.oe_account_select_period').attr('disabled', 'disabled');
+ return this._super.apply(this, arguments);
+ },
+ cancel_edition: function (force) {
+ this.$el.parent().find('.oe_account_select_journal').removeAttr('disabled');
+ this.$el.parent().find('.oe_account_select_period').removeAttr('disabled');
+ return this._super.apply(this, arguments);
+ },
+ save_edition: function () {
+ var tmp = this._super.apply(this, arguments);
var self = this;
- return this.save_edition().then(function (saveInfo) {
- if (saveInfo.created || self.records.at(self.records.length-1).get("id") === saveInfo.record.get("id")) {
- return self.start_edition();
+ tmp.then(function (saveInfo){
+ console.log(saveInfo);
+ if (saveInfo) {
+ self.$el.parent().find('.oe_account_select_journal').removeAttr('disabled');
+ self.$el.parent().find('.oe_account_select_period').removeAttr('disabled');
}
- var record = self.records[next_record](
- saveInfo.record, {wraparound: true});
- return self.start_edition(record, options);
});
- },*/
+ return tmp;
+ }
});
};
From d831d5bd7c2c4b3cdd39394d5d40cde29c8960f7 Mon Sep 17 00:00:00 2001
From: "Denis Ledoux dle@openerp.com" <>
Date: Mon, 19 Nov 2012 13:32:54 +0100
Subject: [PATCH 16/18] [FIX]Select boxes disabled when editing : ) : Better
implement way
bzr revid: dle@openerp.com-20121119123254-9rb4uxr97ux5iatv
---
.../src/js/account_move_line_quickadd.js | 30 +++++--------------
1 file changed, 8 insertions(+), 22 deletions(-)
diff --git a/addons/account/static/src/js/account_move_line_quickadd.js b/addons/account/static/src/js/account_move_line_quickadd.js
index 1cc8942cb72..5a66e311261 100644
--- a/addons/account/static/src/js/account_move_line_quickadd.js
+++ b/addons/account/static/src/js/account_move_line_quickadd.js
@@ -33,6 +33,14 @@ openerp.account.quickadd = function (instance) {
self.current_period = parseInt(this.value);
self.do_search(self.last_domain, self.last_context, self.last_group_by);
});
+ this.on('edit:after', this, function () {
+ self.$el.parent().find('.oe_account_select_journal').attr('disabled', 'disabled');
+ self.$el.parent().find('.oe_account_select_period').attr('disabled', 'disabled');
+ });
+ this.on('save:after cancel:after', this, function () {
+ self.$el.parent().find('.oe_account_select_journal').removeAttr('disabled');
+ self.$el.parent().find('.oe_account_select_period').removeAttr('disabled');
+ });
return tmp;
},
do_search: function(domain, context, group_by) {
@@ -99,27 +107,5 @@ openerp.account.quickadd = function (instance) {
var compoundContext = self.last_context;
return self.old_search(compoundDomain, compoundContext, self.last_group_by);
},
- start_edition: function (record, options) {
- this.$el.parent().find('.oe_account_select_journal').attr('disabled', 'disabled');
- this.$el.parent().find('.oe_account_select_period').attr('disabled', 'disabled');
- return this._super.apply(this, arguments);
- },
- cancel_edition: function (force) {
- this.$el.parent().find('.oe_account_select_journal').removeAttr('disabled');
- this.$el.parent().find('.oe_account_select_period').removeAttr('disabled');
- return this._super.apply(this, arguments);
- },
- save_edition: function () {
- var tmp = this._super.apply(this, arguments);
- var self = this;
- tmp.then(function (saveInfo){
- console.log(saveInfo);
- if (saveInfo) {
- self.$el.parent().find('.oe_account_select_journal').removeAttr('disabled');
- self.$el.parent().find('.oe_account_select_period').removeAttr('disabled');
- }
- });
- return tmp;
- }
});
};
From ad2c5376b0613f811141f7cc74730af5e5fd906a Mon Sep 17 00:00:00 2001
From: "Denis Ledoux dle@openerp.com" <>
Date: Mon, 19 Nov 2012 13:42:14 +0100
Subject: [PATCH 17/18] [ADD]Period and journal field in tree view with
invisible = 1
bzr revid: dle@openerp.com-20121119124214-0hnx1gg5iksi2gpf
---
addons/account/account_view.xml | 2 ++
1 file changed, 2 insertions(+)
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index d3ec35cbea2..f5b21bfcdee 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -1069,6 +1069,8 @@
+
+
From f80d9e61003428021b493691d5db2ef8193e58a5 Mon Sep 17 00:00:00 2001
From: "Denis Ledoux dle@openerp.com" <>
Date: Mon, 19 Nov 2012 14:22:32 +0100
Subject: [PATCH 18/18] [ADD]On_change partner_id and remove useless comments
bzr revid: dle@openerp.com-20121119132232-2ac4n7hodno1r7ju
---
addons/account/account_view.xml | 4 ++--
.../static/src/js/account_move_line_quickadd.js | 17 -----------------
2 files changed, 2 insertions(+), 19 deletions(-)
diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml
index f5b21bfcdee..34e7d3688c2 100644
--- a/addons/account/account_view.xml
+++ b/addons/account/account_view.xml
@@ -1070,13 +1070,13 @@
-
+
-
+
diff --git a/addons/account/static/src/js/account_move_line_quickadd.js b/addons/account/static/src/js/account_move_line_quickadd.js
index 5a66e311261..a40774b346f 100644
--- a/addons/account/static/src/js/account_move_line_quickadd.js
+++ b/addons/account/static/src/js/account_move_line_quickadd.js
@@ -85,23 +85,6 @@ openerp.account.quickadd = function (instance) {
["journal_id", "=", self.current_journal],
["period_id", "=", self.current_period]
]);
- //1
- /*var ncontext = {
- "journal_id": self.current_journal,
- "period_id" :self.current_period,
- };
- var new instance.web.CompoundDomain(self.last_domain = new instance.web.CompoundContext(this.last_context, ncontext);
-
- _.extend(this.dataset.context, ncontext);
- */
- //2
- /*
- var compoundContext = new instance.web.CompoundContext(self.last_context,{
- "journal_id": self.current_journal,
- "period_id" :self.current_period,
- });
- */
- //3
self.last_context["journal_id"] = self.current_journal;
self.last_context["period_id"] = self.current_period;
var compoundContext = self.last_context;