summaryrefslogtreecommitdiff
path: root/addons/website/static/src
AgeCommit message (Collapse)Author
2021-05-31[FIX] website: remove "add image" button from the normal modeYounn Olivier
The "Add image" button was shown out of the editor mode when removing all images from a snippet. task-2469516 closes odoo/odoo#71424 X-original-commit: c1f4a39071c8f99499a7e1e5214362ac29df8881 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-05-27[FIX] website, web_editor: fix colorpicker previewxO-Tx
Issue: > Set bg color combination for a snippet... > Save > Edit mode > Select the snippet > Open color palette in bg option > Hover a color option > When a color button is left, the preview is cancelled but the color combination class is not applied anymore. In '_computeWidgetState' (for 'selectStyle' method), the right value ('o_cci') is not returned because we get empty "colorNames" (the "colorPalette" is not rendered on start). The goal of this commit is to fix this behaviour by rendering the colorPalette in start for snippet options, this way, the new code won't affect the speed fix added in [1] for 'OPTIONS' tab. [1]: https://github.com/odoo/odoo/pull/65223/commits/ce54c3f21293513673cb1fc6073ada5f0a2b5641 task-2538326 closes odoo/odoo#71174 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-05-18[FIX] website: correctly set accordion idsSébastien Mottet (oms)
data-parent fields were set on tab link and not on the tabpanel div. It prevented the accordion of having the right behavior: closing all the other tabs when a tab is clicked to be opened. closes odoo/odoo#70960 X-original-commit: 32b2c17eb7bec5293dfc0cfb4bb07d19dc2ec5c3 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-05-17[FIX] *: update documentation links Following the recent reorganisation of ↵Victor Feyens
the documentation in 12.0+, the majority of the documents have been moved and their old links are no longer valid. Some redirection rules will soon be deployed, but those rules might be dropped in some years and we want the links to still work, which is why we still replace the links to the new ones. FW-Port of odoo/odoo#70675 (13.0) closes odoo/odoo#70728 X-original-commit: 85c24961ab9ff5c1c79eb7415c97c46d9a77cca3 Related: odoo/enterprise#18283 Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2021-05-03[FIX] http_routing, website: prevent crash when using `fw` in urlRomain Derie
Before this commit, the routing map generated and used would be the one from the website the request is performed, instead of the one from the `fw` website ID which will be the one we redirect the user to. This issue was introduced with the routing map by website, be8fc2296b38 and is restricted to a single case: a publisher using the website switcher, and it won't happen on next page naviguation/refresh as the `fw` website id will be the same as the current website's ID. Thus there won't be any routing map mismatch. Step to reproduce: - Create a page on website 2, set it as homepage - Naviguate to website 1 on '/' url - Naviguate to website 2 on '/' url This will raise a werkzeug error about `EndPoint not iterable`. ----- Technical analysis ------ This is the current flow: 1. `_dispatch()` is setting `website_routing` to `get_current_website()` -> 2 2. `_dispatch()` is calling `_match()` 3. `_match()` is calling `routing_map()` with key = `website_routing`, which was set to 2 in step 1. 4. `routing_map()` is calling `_generate_routing_rules()` which generate the rules based on `website_routing`, which was set to 2 in step 1. 5. `_dispatch()` authenticate the user by calling `_authenticate()` 6. `_dispatch()` is calling `_add_dispatch_parameter()`, where URL param `fw` is forced in session, so `get_current_website()` now return the correct `website_id` -> 1 The issue: in order to handle the `fw` URL parameter (step 6.), we need to check the rights to ensure we can allow the website switch. To check rights, user need to be authenticated (step 5.), which is done after generating the routing map (2. & 3. & 4.). The routing map is generated based on the current website (step 1.) Step 6 depends of steps 5 which depends of steps 2/3/4 which depend of step 1, but step 1 should depend of step 6, which is an impossible cycle. closes odoo/odoo#70278 X-original-commit: 878e28f93a65756fa2002ef2af5b02a3e2c59b1b Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com> Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2021-04-29[FIX] website: hide cookie bar when entering edit modeArthur Detroux (ard)
Previously : Once a user enabled the cookie bar, it prevented him from dropping snippets in the main area of the page because the focus was on the cookie bar. Dropping snippets there has a confusing behavior and might make the user think the editor is broken. Reason : The cookie bar has an oe_structure class and takes over the body if it's not hidden or dismissed. The oe_structure allows to drop snippets. Fix : Hiding the cookie bar when user enters edit mode to avoid dropping snippets in it by mistake. task-2477430 closes odoo/odoo#68938 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-04-10[FIX] website: restore scroll effects in custom codeqsm-odoo
The website scroll effects using the `AnimationEffect` Odoo API were not working anymore if custom code enforces the html element as the scrolling element. Indeed in that case the scroll event handlers were now attached to the html element itself while it needs to be the window in that case. This may be something to fix at the source (the `getScrollingElement` method). This will be checked later. closes odoo/odoo#69083 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-04-06[FIX] website: add loader when installing a new module from frontendYounn Olivier
The eCommerce module installation is sometimes taking over 30 seconds, to manage the user wait a loader is now displayed during the process. Part of https://github.com/odoo/odoo/pull/65575 task-2446852
2021-04-06[FIX] website: decrease moving blocks speed by 35%Younn Olivier
When moving blocks up and down, the speed has been decreased by 35%, as it was too fast for the user before. Part of https://github.com/odoo/odoo/pull/65575 task-2446852
2021-04-06[FIX] website: fix share snippet icons vertical alignmentYounn Olivier
Icons were not centered in the share snippet. Part of https://github.com/odoo/odoo/pull/65575 task-2446852
2021-01-18[FIX] website: prevent navigation during load if new content menu openedBenoit Socias
Before this commit the new content menu only appeared once the page was fully loaded. Because of this users with slow connections could navigate elsewhere before noticing that the new option they enabled had appeared. After this commit a navigation-blocking overlay similar to the background of the menu is temporarily added to the page until the new content menu can be displayed. The div is put inside #wrapwrap in order to be later reused as the theme install loader blocking div which does not exist in 14.0. task-2439775 closes odoo/odoo#64554 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-03-18[FIX] web, web_editor, website: fix incorrectly translated template literalsSamuel Degueldre
closes odoo/odoo#68085 Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-03-15[FIX] website, website_sale: fix right corner ribbonBenjamin Vray
Before this commit, when ribbon was at the right corner of a product card, this ribbon hid the buttons in list view. After this commit, in list view, we place the ribbon on the left to avoid this bug. There was no better solution to fix this in stable. task-2466120 closes odoo/odoo#66618 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-03-09[IMP] website: make images wall editablexO-Tx
The goal of this commit is to make the Images Wall/Gallery snippet editable to be able to open the media dialog on "double-click" on images. Backport from https://github.com/odoo/odoo/pull/66544 closes odoo/odoo#67547 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-03-05[FIX] website: fix image gallery slider indexYounn Olivier
The gallery slider index was wrongly calculated when the gallery had no active element, as the jquery method .index() will still return -1 when no element is found. task-2472041 closes odoo/odoo#67389 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-03-04[FIX] website: typo in drop snippet tourJeremy Kersten
task-2466754 closes odoo/odoo#67317 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-03-04[FIX] website: state not saved for accordion snippetBenjamin Vray
Before this commit, the states (collapsed/not collapsed) of the tabs of the accordion snippet were not saved if it was the only changement in edit mode. After this commit, we trigger a content change when the states of the tabs is changed. task-2442237 closes odoo/odoo#67252 X-original-commit: 18af2ecade9482b5243059aefbfa79410ebf59a6 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-03-04[FIX] website: fix showcase snippet images stretchedBenjamin Vray
Before this commit, if we replaced an icon of the showcase snippet with an image, this image was streched depending on title size (if too long and on 2 lines). Its because the align-self default value of a flex item is strech. task-2447087 closes odoo/odoo#67234 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-02-25[FIX] website: o_cp_top_left class doesn't exist on mobileRomeo Fragomeli
Before this commit, the selector 'o_cp_top_left' was used to target a descendent element. The 'o_cp_top_left' class was added in this commit odoo/odoo@533db5991a5bb871198485cd71a63f75a8c6becf But 'o_cp_top_left' class is only available on desktop. On mobile the layout of the control panel is different. This produce a bug on Mobile. After this commit, we use a less restrictive querySelector to match the element in mobile too. Note: we remove the 'div' for clarity/consistency Steps to reproduce: * Open Odoo in "Mobile mode" (small screen) * Go to Apps * Install a module that need website or website it self * You are redirect to the "chose theme" => Bug closes odoo/odoo#66613 Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2021-02-24[FIX] website: hide block in mobile display modeOussama MESSAOUDI
Before this commit, display mode is changed to block after hiding it on mobile mode. After this commit, only change display mode for mobile and use inherited mode otherwise. task-2431659 closes odoo/odoo#65716 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-02-22[FIX] website: show thumbnails for img gallery in tabs snippetAndrea Grazioso (agr-odoo)
- Go to the website - Drag a "Tabs" block on the page, you will have 3 example tabs - Click on the tab "Contact" and drag in the block "Image Gallery" - Add multiple images to the image gallery - Click on one of the other tabs so that the image gallery is hidden - Save The image gallery do not have the thumbails anymore. This occurs because when the carousel-indicator is hidden, jquery is not able to fetch its real length, so no icons are added. opw-2438513 closes odoo/odoo#66197 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-02-15[FIX] website, web_editor: ensure the loader appears on click optionsBenoit Socias
Before this commit the loader did not always get displayed when switching to the options tab. After this commit the loader always gets displayed ASAP when switching to the options tab until the tab is ready and displayed. task-2439295 https://github.com/odoo/odoo/pull/65223 Co-authored-by: Samuel Degueldre <sad@odoo.com>
2021-02-12[FIX] website: open dropdown to right position for sidebar menu templateKrunal Trivedi
closes odoo/odoo#65548 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-02-11[FIX] website, web_editor : image gallery miniatures are not updatedYounn Olivier
Description of the task : Make the website ui as consistent as possible by making some layout quick wins. Behaviour before the PR is merged : When changing an image in the image gallery snippet, its miniature is not updated. Desired behaviour after PR is merged : The miniature of an image of the image gallery is updated when the image is changed. The snippet options listens to the 'image_changed' event triggered by the media widget. task-2438556
2021-01-29[IMP] website: add theme loader tipsxO-Tx
The goal of this commit is to add tips when theme is loaded to encourage users to follow the tour (in Edit mode). task-2440450 closes odoo/odoo#65153 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-02-04[FIX] website, web_editor: fix empty parallax snippet not being removedSamuel Degueldre
Previously, when removing all the content of a snippet, that snippet would get automatically deleted. This was not the case for parallax snippets because we previously intended the user to drop the parallax snippet, empty it, and drop other content inside of it. Recently, we added the parallax option on all snippets, rendering the previous workflow obsolete. There is now no longer any reason to keep empty parallax snippets. This commit fixes that. task-2446008 closes odoo/odoo#64907 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-02-03[FIX] website_mass_mailing, *: add fix for missing google_recaptchaqsm-odoo
*: website In 14.0, the website_mass_mailing now uses ReCaptcha. The problem is that we forgot to add the related module as a dependency. It thus works on runbot because it is indirectly installed by other apps but the newsletter popup does not work anymore if only website_mass_mailing is installed. In master, we simply fixed the dependency. For 14.0, we use this workaround as a fix: if the recaptcha is not installed as not found in the list of services in odoo.__DEBUG__, then we make sure the newsletter popup work without it. In edit mode, we now also display a warning which allows to fix the issue directly (by installing recaptcha). closes odoo/odoo#65263 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-01-28[FIX] website, website_sale: preconfigure Dynamic Products w/ 1st optionBenoit Socias
Before this commit the Dynamic Products snippet was displaying a message box instead of its content until its template and product category were selected. After this commit the Dynamic Products snippet is automatically configured on drop with the first available template and the first available product category. The message box only appears if no product category exists yet. Also an "All Products" category was added as first element of the list to make the snippet usable before categories are defined. task-2439295 https://github.com/odoo/odoo/pull/64982 closes odoo/odoo#64982 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-01-27[FIX] website: fix popup heightBenjamin Vray
- The modal content of the popup snippet had a maximum height of 100% because of a global rule on modals. But, here, the scrollable element is not the modal so we dont want this rule. - For the popup to be scrolled correctly we also had to remove the rule that adds a fixed 100% height on modal-dialog and we added a min-height of 100% to correctly display the popup in the middle position. Part of https://github.com/odoo/odoo/pull/61998 task-2312878
2021-01-27[FIX] website, *: reset header items colors to default when transparentqsm-odoo
*: web_editor Users can choose one of their color combination to apply on the header. If they then choose to make the header transparent over the content for a specific page, the color of buttons & other components in the header should be reset to the default website color combination's colors as the header component are now appearing over the default content. Part of https://github.com/odoo/odoo/pull/65139
2021-01-22[FIX] website: Warning message on website if dynamic snippet category deletedNasreddin (bon)
Issue - Install "Ecommerce" app - Go to 'Shop' page and edit it - Add a "Dynamic Products" block - Click on it to edit it : - Select any template - Select `Desks` as product category - Save - Go to "Website -> Configuration -> eCommerce Categories" - Delete the "Desks" category - Go back to Shop page Error : "Record does not exist or has been deleted". Cause The search domain is looking for child categories of dataset.productCategoryId (who does not exist anymore in the above case). `child_of` do a browse() to fetch the records, and therefore generate an error if category not found. Solution Log warning message if unexptected domain and return empty records set instead. This commit also reverts commit 0de069b8ca9fb005ba5b076984f5677de25889ee that generated the issue. opw-2440917 closes odoo/odoo#64847 Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
2021-01-21[FIX] website: stop messing up countdown snippets on undoqsm-odoo
Like any snippet creating dynamic elements on page load, we need to use a special class on those elements to mitigate the undo/redo system's imperfections. closes odoo/odoo#64876 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-01-19[FIX] website: an erroneous Google font makes website not editablenie
Steps: - Go to "Website" > "Go to Website" - Click Edit in the top right corner - Click Options - Select "Add a Google Font" in the Font Family field - Insert an erroneous Google Font link (e.g. https://fonts.google.com/specimen/Robotoj ) - Save & Reload - Click Edit again Bug: The Edit button is not responding anymore Explanation: We try to `@import` the link in multiple files. For example, here: https://github.com/odoo/odoo/blob/70eb39b0cf30c1acf9a7116e109874b60e27aa2c/addons/website/static/src/scss/website.scss#L10 An erroneous font family results in an error 400 from the Google Fonts server. This prevents parts of the JS to load and makes it impossible to enter the edition mode. `EditPageMenu` handles the behavior when clicking on the Edit button. This menu depends on `website.compiled_assets_wysiwyg` as seen here: https://github.com/odoo/odoo/blob/b02a99bec709b5a6dc4dabb6cb81435dadc24e7e/addons/website/static/src/js/menu/edit.js#L10-L14 Since there is an error generating the file, the Promise fails but the error is not handled: https://github.com/odoo/odoo/blob/70eb39b0cf30c1acf9a7116e109874b60e27aa2c/addons/web/static/src/js/core/ajax.js#L164-L168 This commit prevents CSS loading errors from silently failing. The crash screen will only show up if the user is logged in and has edition rights. This commit also prevents the user from posting the form if the font is not accessible. At the moment, querying an unknown Google font from a script will result in a CORS error. A valid one will pass just fine. In case Google changes the behavior of these queries and allows the 400 to be sent, the fix also checks if the query returned an `ok` status code. opw:2439073 closes odoo/odoo#64695 Signed-off-by: backspac <backspac@users.noreply.github.com>
2021-01-13[FIX] website: fix a typo in the js file of the snippet popupBenjamin Vray
We were using 'onExit' instead of 'mouseExit' as the value of the data-attribute 'display' in the .js code of the s_popup. task-2312878 closes odoo/odoo#64485 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-01-11[FIX] web_editor, website: prevent multiple click on saveRomain Derie
Clicking on save on html editor is taking quite some time. The user might think something is not happening and need to click again. If he does click again, 2 write RPC will be sent, making the COW business code being triggered twice, ultimately leading to create 2 COW. Instead of A / \ B B' It will be A / | \ B B' B' With as many B' than there is click on save. This commit adds a generic helper to make a button load/spin. closes odoo/odoo#63417 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-01-08[FIX] website: dynamic snippet products overflows on mobilenie
Steps: - Install eCommerce - Go to "Website" > "Go to Website" - Click Edit - Add the Dynamic Products block with a template and a category - Save - Switch to mobile view Bug: The right arrow of the block overflows and makes it possible to scroll the entire view sideways. Explanation: This commit puts back prev and next arrows onto the carousel. It also changes their design to be more visible over the content. The arrows are now smaller and displayed in clickable gray circles. opw:2415187 closes odoo/odoo#63911 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-01-06[FIX] website,website_sale: Dynamic products isn't visible if category deletedNasreddin (bon)
Issue - Install "Ecommerce" app - Go to 'Shop' page and edit it - Add a "Dynamic Products" block - Click on it to edit it : - Select any template - Select `Desks` as product category - Save - Go to "Website -> Configuration -> eCommerce Categories" - Delete the "Desks" category - Go back to Shop page Error : "Record does not exist or has been deleted". Cause The search domain is looking for child categories of dataset.productCategoryId (who does not exist anymore in the above case). `child_of` do a browse() to fetch the records, and therefore generate an error if category not found. Solution Check if dataset.productCategoryId exist before updating domain. opw-2416231 closes odoo/odoo#64090 Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
2020-12-31[FIX] website: fix blog post / event title colorSiddarth Gajjar
Before this commit, due to change in cover option refactoring at [1], class 'o_record_has_cover' was removed from default configuration and may not be saved properly. [1]: https://github.com/odoo/odoo/commit/da32bdb88a4726a0dcee73f2c505ef5ea68c72ef task-2387990 closes odoo/odoo#62004 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-12-29[FIX] website: fix edit mode shadow effect on imagesKrupa Patel
Fix box-shadow effect to fit perfectly on the product shop grid layout and product carousel. task-2206930 closes odoo/odoo#63514 X-original-commit: bc49bef467b4650a61d21ea09a17bb1eb520a1c9 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com> Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-10-02[FIX] website: fix top action buttons paddingBenjamin Vray
Before this commit, the padding of the top action buttons in the editor (save, discard and undo buttons) was related to the buttons padding options of the theme. After this commit, the padding of those buttons doesnt change with the theme padding value. task-2349723 closes odoo/odoo#58993 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-12-22[FIX] website: gallery cover img inside anchor is not well placednie
Steps: - Go to "Website" > "Go to Website" - Click Edit - Add an image gallery - Add an image to the gallery - Add the same image to the gallery - Click the first image - Click "Image Cover" in the side panel - Click on the Link button in the bottom-right of the side panel - Add a link and save Bug: The first image is not displayed in the same way as the second one. Explanation: The layout is not carried over to `img` when it's nested into an `a` tag. Redefining the layout on the `a` tag fixes the issue. opw:2394953 closes odoo/odoo#63675 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-12-18[FIX] website: dashboard: mounted called twiceAaron Bohy
Before this commit, the 'mounted' method of the ControlPanel in the website dashboard was called twice, when entering the dashboard. It happened because the dashboard updated the ControlPanel before being actually mounted, so mounted was called once when the dashboard was mounted, and once when the update was applied. Ideally, this should not be an issue (this isn't an issue with owl). However, in Odoo, we mix layers of Owl Components and legacy widgets. In these situations, the above scenario isn't properly handled (and can't be). As a consequence, in mobile (enterprise), it crashed because an handler bound in mounted (thus twice) was only unbound once. This commit avoids the issue by correctly setting the control panel props before rendering it (the update was actually useless). opw~2417307 closes odoo/odoo#63574 Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2020-12-04[IMP] website, web_tour: have steps to select shape or colorBenoit Socias
Before this commit the theme tours had no step during the shape or color selection After this commit the theme tours have an additional step during the shape or color selection task-2390579 https://github.com/odoo/odoo/pull/62176 https://github.com/odoo/design-themes/pull/428
2020-12-10[IMP] website: improve autocomplete dropdown UISiddarth Gajjar
- Before this commit, Autocomplete dropdown ui is not compatible with existing editor ui. - After this, Autocomplete dropdown UI for url and GMAP imrpoved. closes odoo/odoo#60735 Taskid: 2352870 Closes: https://github.com/odoo/odoo/pull/60735 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-11-20[IMP] website: update default theme tourxO-Tx
The goal of this commit is to update the default theme tour (steps, changes on snippets...) as in other themes tours. The url was changed in "registerThemeHomepageTour" function since the homepage tours are supposed to start in edit mode. task-2375011 closes odoo/odoo#61733 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-12-16[FIX] website: gallery img inside anchor is too largenie
Steps: - Go to "Website" > "Go to Website" - Click Edit - Add an image gallery - Add an image to the gallery - Click the image - Click on the Link button in the bottom-right of the side panel - Add a link and save Bug: The image is too large. Explanation: The flex layout is not carried over to `img` when it's nested into an `a` tag. Redefining the flex layout on the `a` tag fixes the issue. This fixes portrait images: ```css height: 100%; width: 100%; ``` And adding this also fixes landscape and smaller images: ```css display: flex; ``` opw:2394953 closes odoo/odoo#63364 Signed-off-by: backspac <backspac@users.noreply.github.com>
2020-12-11[IMP] website: support old fonts that have been renamed in themeJeremy Kersten
closes odoo/odoo#63241 Related: odoo/design-themes#429 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-12-08[FIX] website: fix trigger of website_url_chosenBenjamin Vray
Before this commit, website_url_chosen was triggered when the dropdown of the input closed instead of when an item was selected in the list. This caused the following issue: you lost focus in the input every time the list closed while typing. After this commit, website_url_chosen is only triggered when an item is selected in the results list of a urlpicker input. Part of #62971 task-2312878
2020-12-04[FIX] survey, web, web_editor, website, website_form: Prevent invalid date ↵Achraf (abz)
stock.picking What are the steps to reproduce your issue? 1. Install "stock" 2. Go to Inventory/Inventory Overview/Internal Transfer 3. Create new record and set manually a date with year < 1000 like "0008-10-10 18:35:00" 4. Save What is currently happening? An error arises when saving the record, and it is then no longer possible to reopen the records or any view containing it. This also prevents us from correcting the date to no longer have the error Why is this happening? The root cause is an inconsistency in `strftime` for years < 1000 [1, 2]. To take it into account, a zero-padding is needed in the DateTime parser. How to fix the bug? The missing padding is added. However, such dates lead to problematic behaviors in Python: ``` DT_FORMAT = "%Y-%m-%d %H:%M:%S" new_date = "0008-02-05 18:10:10" datetime.strptime( datetime.strptime( new_date, DT_FORMAT ).strftime(DT_FORMAT), DT_FORMAT ) ``` This raises: ``` ValueError: time data '8-02-05 18:10:10' does not match format '%Y-%m-%d %H:%M:%S' ``` As of today there was no reported business cases where dates with year < 1000 would be necessary. Therefore, we limit the range to years >= 1000. [1] https://bugs.python.org/issue13305 [2] https://docs.python.org/dev/library/datetime.html#strftime-strptime-behavior opw-2408260 closes odoo/odoo#62818 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-12-02[FIX] website: remove old codeRomain Derie
This code is a leftover of https://github.com/odoo/odoo/commit/2972976962617d4b8a0113bae58c640ab41cdff8#diff-70e782021bdfee46734a7fc7dbcad3104f7f985dd37f9320f1480d424581d67fL191 - We should not get info from the `err` and `data` parameters, those are not the same as the it was before the code got migrated, `data.data` never exists. - The fact that we handle the fail on this call is also a leftover of that refactoring where the error was done through a generic template. - We should not handle an error on publish action. We never handle that kind of error if the action should not fail by default. This is typically the case when loading the menu through "Edit Menu" or the page properties. - This is especially true with later version as error raised are already handled globaly Closes #60041 closes odoo/odoo#62532 X-original-commit: 4e089041252c25cc197a30f9e285d82f7162d809 Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>