Friday, May 7, 2021
3 changes · master
Resolved issues and error corrections
Odoo now hides PDF viewer buttons for printing, downloading, and opening files when they do not work properly inside mobile app webviews. This prevents users from seeing options that fail or do not make sense, while keeping other ways to access files available.
Original PR description
Some features of the PDF.js library doesn't work in the webview of the mobile apps. Initially 'window.print' is defined as an empty function in webviews unlike browsers where it is already ready.…
Some features of the PDF.js library doesn't work in the webview of the mobile apps. Initially 'window.print' is defined as an empty function in webviews unlike browsers where it is already ready. After that, PDF.js needs to monkey patch 'window.print' and saves a reference to the original definition, which is not yet fulfilled in by the mobile app (Java part). So the print of PDF.js doesn't work in webviews and end users will need to download the file before printing it. Regarding the Download button, the 'download' attribute is not supported by the webview as you can see in: https://bugs.chromium.org/p/chromium/issues/detail?id=432414 As there's many ways to download a file in Odoo it's not a big deal to simply hide it in PDF.js. Because it's quite complicated to fix this, we decided to hide the features that don't work (Download / Print) or don't make sense (Open file). Task-id: 2200168 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Manufacturing bills of materials now show only relevant units of measure for by-products, based on the selected product’s unit category. This helps users avoid choosing incompatible units and reduces data entry mistakes in manufacturing setup.
Original PR description
Before this commit, It was always showing all Unit of Measures in By Product lines. With this commit, We are showing UoMs based on Category of Selected Product's UoM. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
The PDF viewer in Odoo mobile app webviews now hides actions that do not work reliably there, including print, download, and open file. This avoids showing users buttons that fail or are not meaningful in the mobile app context, while keeping other ways to access or download files available.
Original PR description
Some features of the PDF.js library doesn't work in the webview of the mobile apps. Initially 'window.print' is defined as an empty function in webviews unlike browsers where it is already ready. After that, PDF.js needs to monkey patch 'window.print' and saves a reference to the original definition, which is not yet fulfilled in by the mobile app (Java part). So the print of PDF.js doesn't work in webviews and end users will need to download the file before printing it. Regarding the Download button, the 'download' attribute is not supported by the webview as you can see in: https://bugs.chromium.org/p/chromium/issues/detail?id=432414 As there's many ways to download a file in Odoo it's not a big deal to simply hide it in PDF.js. Because it's quite complicated to fix this, we decided to hide the features that don't work (Download / Print) or don't make sense (Open file). Task-id: 2200168