-
- Downloads
[FIX] google_spreadsheet: fix parameters in spreadsheet pivot insertion
Observed Behaviour When opening a pivot view (in any of Odoo module) and trying to import it in a Google Spreadsheet, we get the following error: UncaughtPromiseError > TypeError Uncaught Promise > Cannot read properties of undefined (reading 'id') TypeError: Cannot read properties of undefined (reading 'id') at AddToGoogleSpreadsheet.addToGoogleSpreadsheet (...) at HTMLSpanElement.eval (eval at _compile (...) Expected Behaviour When trying to import the pivot in a spreadsheet, everything should work fine, openning a new tab with a Google spreadsheet. Reproducibility This issue can be reproduced following these steps: 1. Install the 'Google Spreadsheet" module 2. Go to 'Settings' > 'Google Drive' and set your credentials 3. Go to the Sales App 4. Select the pivot view 5. Click on 'Favorites' > 'Add To Google Spreadsheet' Fix Description The original issue was coming from the fact we try to access the ID of a null view, giving us the reported error. Moreover, after fixing this issue, we got another error coming from the fact the config method was called with a domain passed as a list, while it need a string. Both errors were corrected in the way it was already done in https://github.com/odoo/odoo/blob/2e5acb4b15422c1ee38c5630e4fdb929d7a24d3c/addons/google_spreadsheet/static/src/legacy/js/add_to_google_spreadsheet_menu.js#L25 Related Issues/PR opw-2794744 opw-2761065 opw-2752840 closes odoo/odoo#89967 Signed-off-by:Hendrickx Anthony (anhe) <anhe@odoo.com>
Showing
- addons/google_spreadsheet/__manifest__.py 3 additions, 0 deletionsaddons/google_spreadsheet/__manifest__.py
- addons/google_spreadsheet/static/src/add_to_google_spreadsheet/add_to_google_spreadsheet.js 4 additions, 1 deletion...rc/add_to_google_spreadsheet/add_to_google_spreadsheet.js
- addons/google_spreadsheet/static/tests/add_to_google_spreadsheet.js 83 additions, 0 deletions...gle_spreadsheet/static/tests/add_to_google_spreadsheet.js
Please register or sign in to comment