summaryrefslogtreecommitdiff
path: root/addons/account/static/src/js
diff options
context:
space:
mode:
authorCedric Snauwaert <csn@openerp.com>2019-09-13 14:25:34 +0000
committerCedric Snauwaert <csn@openerp.com>2019-09-16 14:36:02 +0000
commit35cbb430ce79ce26d8cd1b7c2f9f112b35d1e6a1 (patch)
tree2b8ae2fe4b46c3513c96416dd9b662397604caea /addons/account/static/src/js
parent545b00ee79348a7f88eb074435918911b840134e (diff)
[FIX] account: fix focus problem in manual reconciliation
Previously when opening the manual reconciliation widget with several lines, trying to put the focus on another line by clicking on the grey line was not working due to a o_field_widget with the partner name taking all the line and there is an event on that o_field_widget that stop the propagation of the event. Also changing the partner value was only changing the value in the grey zone and not in the other field. Therefore as it was strange to have twice the name of the partner display one above another and that it was causing problem for the focus of the widget. We removed the name of the partner that was readonly (leaving the editable field where we can change it) and we replaced it with the name of the account which makes more sense. closes odoo/odoo#36881 Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
Diffstat (limited to 'addons/account/static/src/js')
-rw-r--r--addons/account/static/src/js/reconciliation/reconciliation_renderer.js47
1 files changed, 13 insertions, 34 deletions
diff --git a/addons/account/static/src/js/reconciliation/reconciliation_renderer.js b/addons/account/static/src/js/reconciliation/reconciliation_renderer.js
index 207a00e948e..a9d0c0d9566 100644
--- a/addons/account/static/src/js/reconciliation/reconciliation_renderer.js
+++ b/addons/account/static/src/js/reconciliation/reconciliation_renderer.js
@@ -893,40 +893,19 @@ var ManualLineRenderer = LineRenderer.extend({
start: function () {
var self = this;
return this._super.apply(this, arguments).then(function () {
- var defs = [];
- var def;
- if (self._initialState.partner_id) {
- def = self._makePartnerRecord(self._initialState.partner_id, self._initialState.partner_name).then(function (recordID) {
- self.fields.partner_id = new relational_fields.FieldMany2One(self,
- 'partner_id',
- self.model.get(recordID),
- {mode: 'readonly'}
- );
- });
- defs.push(def);
- } else {
- def = self.model.makeRecord('account.move.line', [{
- relation: 'account.account',
- type: 'many2one',
- name: 'account_id',
- value: [self._initialState.account_id.id, self._initialState.account_id.display_name],
- }]).then(function (recordID) {
- self.fields.title_account_id = new relational_fields.FieldMany2One(self,
- 'account_id',
- self.model.get(recordID),
- {mode: 'readonly'}
- );
- });
- defs.push(def);
- }
-
- return Promise.all(defs).then(function () {
- if (!self.fields.title_account_id) {
- return self.fields.partner_id.prependTo(self.$('.accounting_view thead td:eq(0) span:first'));
- } else {
- self.fields.partner_id.destroy();
- return self.fields.title_account_id.appendTo(self.$('.accounting_view thead td:eq(0) span:first'));
- }
+ return self.model.makeRecord('account.move.line', [{
+ relation: 'account.account',
+ type: 'many2one',
+ name: 'account_id',
+ value: [self._initialState.account_id.id, self._initialState.account_id.display_name],
+ }]).then(function (recordID) {
+ self.fields.title_account_id = new relational_fields.FieldMany2One(self,
+ 'account_id',
+ self.model.get(recordID),
+ {mode: 'readonly'}
+ );
+ }).then(function () {
+ return self.fields.title_account_id.appendTo(self.$('.accounting_view thead td:eq(0) span:first'));
});
});
},