Saving any Settings->Configuration opens a new tab with Bad Request error - odoo

Under developer mode, when I open any tab -> Settings/ Configuration and press the Apply button, it waits for some time and then opens a new tab with the following URL
/report/preview?data=%5B"%2Freport%2Fpdf%2Fpoint_of_sale.report_saledetails"%2C"qweb-pdf"%5D&token=1665039097069
which is /report/preview?data=["/report/pdf/point_of_sale.report_saledetails","qweb-pdf"]&token=1665039097069 when decoded.
The page displays the following content.
Bad Request
The browser (or proxy) sent a request that this server could not understand.
The original page displays the top header and the logo after when it's loaded.
There's nothing new getting added to the odoo.log
Any clues?
Thanks.

Related

Uploading a file with webdriverio and open modal

I'm having this problem:
At the website I'm trying to test with webdriverio, it has this functionality:
You click a button to upload a file (a window opens to choose your local file)
You select your file and click Accept.
When you click Accept, a modal opens and gives you a progress bar and also some mandatory inputs to continue the process and the test.
In other cases, uploading the file with this:
https://webdriver.io/blog/2019/06/25/file-upload/
it works fine!
But in this case, I need to open the modal after you click Accept at the window (anyway I'm not really clicking on Accept button at the locals file window, so probably this should be solve before, but I don't know how to do it)… and its not happening.
Thanks for the help!

How to click Browser back button in Safari using selenium/javascript

I am using selenium automation in Safari. It seems there is an issue in using driver.navigate.back()
So I used:
((JavascriptExecutor)driver).executeScript("history.back")
((JavascriptExecutor)driver).executeScript("history.go(-1)")
But this code is going to the previous page and not actually clicking the browser back button. I confirmed by doing manually. If I do manually in my application, it will pop up a dialog saying "do you want to leave this page?" But with this code it's not happening.
Based on this open issue, it seems Safari reloads an old page. It doesn't fully initialize the extension for the page.
Hence Selenium does not support it:
safaridriver.inject.commands.unsupportedHistoryNavigation = function() {
throw Error('Yikes! Safari history navigation does not work. We can ' +
'go forward or back, but once we do, we can no longer ' +
'communicate with the page...');
};

Redirect URI in Google Cloud Console doesn't save

I have an old OAUTH1 project with a cliend id for web application. The problem is that I can't set redirect URIs. If I update them at https://console.developers.google.com/project/myprojectid/apiui/credential everything seems to be fine. But when I press F5, all the settings are gone. It seems as if Google doesn't store my settings. I have tried it with various browsers but still didn't work.
Has anyone else encountered this problem? Help is highly appreciated.
Actually pressing Save twice don't work (at least for me).
Instead, I have to hit enter into textbox. This adds entry into the list.
And only after that clicking Save will save the changes.
Type the redirect URL and press ENTER.
It will get added as a row.
Then click save.
Bad UI Google :( wasted some time trying to figure this out.
I think this is just an example of poor UX design. I was having the same problem, I would add a redirect URI, click the 'Save' button, see it add a new line, and assume it was saved.
I discovered that the first click of the 'Save' button only creates a new line. You have to click the 'Save' button a second time (where it will briefly change the text and color to 'Saving...'), which will save your updates and return you to the previous screen.
Step 1: Enter the URI
Step 2: click 'Save'
Step 3: Click 'Save' again
Authorized redirect URIs not saving. Because of the browser. Please change browser to Google chrome or chromium which developed by google so we can save it. I faced this problem it has eat the time for my whole day.If changed browser still not working fine, then try to clear everything(history, cache, .....) from the browser.

What is going wrong with kendo upload cancel?

I am seeing a very odd thing happen with kendo UI's kendoUpload. I have implemented a custom UI for displaying the files being uploaded, along with a progress bar and a cancel button. Kendo does not offer an API for cancelling uploads, but I read here that you can tap into kendo's default upload progress display to cancel an upload. That is exactly what I did, with the following javascript function attached to my custom cancel button:
var fileName = _getFileNameForThisCancelButton();
var kendoUpload = $('#file_upload').data('kendoUpload');
if (kendoUpload) {
var cancelButton = kendoUpload.wrapper.find('ul.k-upload-files')
.find('.k-file:has([title="' + fileName + '"]) .k-cancel');
cancelButton.click();
}
This little function works as far as it does fire the kendoUpload's cancel event, and the network traffic stops, so data is apparently no longer being sent from the browser to the server.
However, as soon as one cancel button is clicked, any subsequent requests to the site from the browser where the cancel button was clicked hang forever. Note this is for the entire site, not just the file upload page, and only for the browser in question -- the site still loads in other browsers where upload cancel buttons have not been clicked. This goes for Chrome 30.0.1599.69 m, Firefox 20.0, and IE8.
With Firefox and IE, simply closing and restarting the browser causes the hanging to stop, and the site loads again. With Chrome I have found this doesn't work, and neither does logging out of my local machine -- I have to do a full reboot to get the site to load again in Chrome. I think this may have something to do with my Chrome settings though. I have it set up to load all of my last tabs when re-opening, and I have noticed that closing and re-opening Chrome also does not delete my login cookie for the site. Either way, It's the same issue even if it is harder to reset in Chrome.
So... any ideas what is going on here? It seems almost as if the browsers are still waiting for a response from the server for the cancelled upload and blocking on the entire site waiting for a response that will never be delivered.
Updates
Turns out I was right about Chrome. After disabling the "Continue where I left off" startup option, Chrome now behaves the same as FF and IE -- need to close and reopen the browser to get the site to load again.
I have also tried this without the custom UI, meaning I turned off showFileList: false when creating the widget and clicked the actual cancel button. Starting to wonder if this has anything to do with the POST method on the server...?

Capturing a newly opened window with Selenium

I'm using the Selenium Client drivers to run tests built in C#. I'm having a problem where the test navigates to a page and clicks on a button in a form with its target set to _blank causing it to open a new window. However the new page being opened returns an XML document and not a typical webpage. Selenium seems to have trouble with this because it hangs when the button is click and the new window opens. No instructions after the click method are executed. The test eventually fails with the error Timed out running command.
Any help/guidance would be appreciated. I've scoured the net but haven't seen anyone running into this particular issue of the page being opened not being a typical webpage which I think is the core of the problem as Selenium can't really manipulate this new opened window. I would post code except that literally all I'm doing is calling the click method on a button which causes a new window to open. Thanks in advance.
To tackle the issue of opening in new window. I typically get url of the link which is to be opened and instead of using selenium.click(), I use:
selenium.open("http://yourwebsite/yourlink")
This helps me to be on the same window only(which avoids opening new window or tab) and when the testing is finished on this page and you want to switch back to original page you can again use:
selenium.open("http://whatever/")