diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2018-09-20 08:12:12 +0200 |
|---|---|---|
| committer | Nicolas Martinelli <nim-odoo@users.noreply.github.com> | 2018-09-21 08:45:17 +0200 |
| commit | 84aea12bac90e1ba8ea0a41fcbcff53cec69d229 (patch) | |
| tree | 06f734bf0c02d69722f5715e4f456f2ed3e44519 /addons/google_drive/static/src | |
| parent | 60e9e1f738cb04e9d76fed05dda4caa1293963c4 (diff) | |
[FIX] google_drive: current record
- Open a partner view, click on Action > Partner Review
- Switch to another partner
- Click again on Action > Partner Review
The Google Doc file of the second partner is the same than the first
partner.
This is due to `_onGoogleDocItemClicked` which is always called with the
same `resID`, i.e. the `resID` used at `start`.
We retrieve the active ID at each click instead.
opw-1882068
Diffstat (limited to 'addons/google_drive/static/src')
| -rw-r--r-- | addons/google_drive/static/src/js/gdrive.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/addons/google_drive/static/src/js/gdrive.js b/addons/google_drive/static/src/js/gdrive.js index def3e0d76a4..5855e056161 100644 --- a/addons/google_drive/static/src/js/gdrive.js +++ b/addons/google_drive/static/src/js/gdrive.js @@ -59,7 +59,7 @@ Sidebar.include({ } if (!already_there) { self._addItems('other', [{ - callback: self._onGoogleDocItemClicked.bind(self, res.id, resID), + callback: self._onGoogleDocItemClicked.bind(self, res.id), classname: 'oe_share_gdoc', config_id: res.id, label: res.name, @@ -81,8 +81,9 @@ Sidebar.include({ * @param {integer} configID * @param {integer} resID */ - _onGoogleDocItemClicked: function (configID, resID) { + _onGoogleDocItemClicked: function (configID) { var self = this; + var resID = this.env.activeIds[0]; var domain = [['id', '=', configID]]; var fields = ['google_drive_resource_id', 'google_drive_client_id']; this._rpc({ |
