Tuesday, February 15, 2022
40 changes · master
Enhancements to existing features
This update reorganizes JavaScript quality checks so future rules are easier to add and maintain. It also enables new checks that reduce duplicate code and risky expressions across several web-related areas, helping make future changes safer and more reliable.
Original PR description
The commits contained in this PR make it easier to add new eslint rules by breaking the eslint config into an eslintrc file, and enables some rules. Some work was done to allow some of these rules to be enabled, and offending code was adapted.
This update improves how on-screen popovers are positioned and styled in Odoo. It helps make contextual panels more reliable and consistent across the interface, with a small internal impact for users.
Original PR description
Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
The app launcher search now waits briefly before processing typed input, which helps avoid unnecessary work while users are still typing. This should make the command palette feel smoother and reduce small performance hiccups in the home menu.
This update removes repeated code imports across several Odoo Enterprise apps. It reduces internal duplication, making future maintenance and refactoring easier without changing how users work with the system.
Original PR description
*: documents_spreadsheet_bundle, mail_enterprise, planning, project_enterprise, sign, web_cohort, web_enterprise, web_studio Previously, some modules were imported twice, this increases duplication and can make refactoring more difficult. A commit in community enables the no-duplicate-imports eslint rule, this commit fixes offending modules to remove duplicates.
Resolved issues and error corrections
Fixed an issue where the real-time communication control options could open as an empty popover. Users can now see and use the available options as intended, reducing confusion during messaging or calls.
Original PR description
Before this commit, the popover containing the options of the rtc controller was rendered empty. This was because the `t-set` was used instead of `t-set-slot`. This commit fixes this issue.
Miscellaneous changes
Steps to reproduce: - Install the module web_enterprise - Activate Debug mode - Go to Settings -> Companies - Create company A and B - Upload new **pictures** and use them as Favicon for each company - Refresh the page or switch company Issue: The favicon is not the right one. Cause: When starting the webclient, the main favicon in the header is updated (with the correct current company id from cookies) in JS. Since the current company favicon is a picture, th
Original PR description
Steps to reproduce: - Install the module web_enterprise - Activate Debug mode - Go to Settings -> Companies - Create company A and B - Upload new **pictures** and use them as Favicon for each company - Refresh the page or switch company Issue: The favicon is not the right one. Cause: When starting the webclient, the main favicon in the header is updated (with the correct current company id from cookies) in JS. Since the current company favicon is a picture, the browser fallback on the next favicon available (not the first one since the favicon is a picture), who, if web_enterprise is installed, is the static mobile (android) icon. Solution: Update all icons with JS so it will fallback on the first declared icon (even though it's a picture) and also fix the issue of having a static mobile icon in enterprise. opw-2664525 Forward-Port-Of: odoo/odoo#80113
This fixes an issue where automatic focus behavior did not work correctly in mobile mode after a previous API change. Mobile users should see more reliable cursor placement and smoother form interaction without any change to their workflow.
Original PR description
In https://github.com/odoo/odoo/commit/4308de6aab93630c2c24a2d1d2ffd2db4e1d4b6b, the API of useAutofocus was modified but only partly leading to problems in mobile mode. We make the appropriate correction.
This update adds coverage to ensure the mobile control panel search bar works correctly after a related autofocus change. It helps prevent mobile users from encountering search input issues in the Odoo web interface.
Original PR description
In https://github.com/odoo/odoo/commit/4308de6aab93630c2c24a2d1d2ffd2db4e1d4b6b, the API of useAutofocus was modified but only partly leading to problems in mobile mode. The correction is brought in https://github.com/odoo/odoo/pull/84541. Here we add a test of the control panel in mobile mode to make sure that the search bar in which the problem did occur is tested.
Forward-Port-Of: odoo/odoo#84458
Original PR description
Forward-Port-Of: odoo/odoo#84458
Though `create` actually accepts taking a `dict`, and this is stated in the details description in the docstring, because the param type is currently only `list`, when you do pass a `dict` into `create`, your IDE (such as PyCharm) might warn you on this: <img width="677" alt="image" src="https://user-images.githubusercontent.com/6933071/153350475-70fd466a-b12c-4cf5-8256-0b400bb756b8.png"> With this change IDE would understands both types are allow and stops complaining. <img width="65
Original PR description
Though `create` actually accepts taking a `dict`, and this is stated in the details description in the docstring, because the param type is currently only `list`, when you do pass a `dict` into `create`, your IDE (such as PyCharm) might warn you on this: <img width="677" alt="image" src="https://user-images.githubusercontent.com/6933071/153350475-70fd466a-b12c-4cf5-8256-0b400bb756b8.png"> With this change IDE would understands both types are allow and stops complaining. <img width="659" alt="image" src="https://user-images.githubusercontent.com/6933071/153350522-77e06e7c-4ed7-4217-8bff-bd7b4e20d049.png"> -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#84300
Adding a test to verify if `send_payment_request` is used once and only once, and under the right conditions. See also: - https://github.com/odoo/enterprise/pull/22854 task-2659750 Forward-Port-Of: odoo/odoo#84511 Forward-Port-Of: odoo/odoo#80590
Original PR description
Adding a test to verify if `send_payment_request` is used once and only once, and under the right conditions. See also: - https://github.com/odoo/enterprise/pull/22854 task-2659750 Forward-Port-Of: odoo/odoo#84511 Forward-Port-Of: odoo/odoo#80590
Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#84509
Original PR description
Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#84509
Only show the leaves taken by the current employee when using the Leaves stat button on an employee's form. TaskID: 2764912 Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#84579 Forward-Port-Of: odoo/odoo#84553
Original PR description
Only show the leaves taken by the current employee when using the Leaves stat button on an employee's form. TaskID: 2764912 Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#84579 Forward-Port-Of: odoo/odoo#84553
Previous implementation was generating an unoptimised query which lead to unacceptable loading time on large databases. task-2764954 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#84572
Original PR description
Previous implementation was generating an unoptimised query which lead to unacceptable loading time on large databases. task-2764954 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#84572
Bug === If we 1. Open a lead with an email but without partner 2. Set a partner without email on the lead 3. The warning "The email will be propagated" is visible 4. When saving the form, the email is not propagated even if the warning message was visible Solution ======== The reason is that, as the email was not changed, the inverse method of this field was not called and so the email was not propagated. The best solution would be to use "force_save" on those fields. But thi
Original PR description
Bug === If we 1. Open a lead with an email but without partner 2. Set a partner without email on the lead 3. The warning "The email will be propagated" is visible 4. When saving the form, the email is not propagated even if the warning message was visible Solution ======== The reason is that, as the email was not changed, the inverse method of this field was not called and so the email was not propagated. The best solution would be to use "force_save" on those fields. But this feature only works on readonly fields. So, we simulate a real "force_save" on the email / phone, directly in JS. That way the inverse will be called, and if necessary, the email / phone will be propagated. Task-2704904 Co-authored-by: flch-odoo <flch@odoo.com> Forward-Port-Of: odoo/odoo#84426 Forward-Port-Of: odoo/odoo#83934
export_icon_to_png sometimes failed because PIL's getbbox returned None. This fixes it by not using a default color of (0, 0, 0, 0) when creating the image but using the actual color of the image instead. Also, the size of the image was wrong because of using the default size when width and height are defined. task-2761098 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#84565
Original PR description
export_icon_to_png sometimes failed because PIL's getbbox returned None. This fixes it by not using a default color of (0, 0, 0, 0) when creating the image but using the actual color of the image instead. Also, the size of the image was wrong because of using the default size when width and height are defined. task-2761098 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#84565
For the moment we cannot groupby an inherited field (which is therefore related), so it is counted as being non-stored. Because in the `_normalize` function we do not process fields that are not stored, whereas like here https://github.com/odoo/odoo/blob/d679cd0d8ba9a2420e81a42a698763e9be2327e1/addons/web/static/src/legacy/js/control_panel/groupby_menu.js#L45-L49. Typically when a field is non-stored but sortable it is inherited from a stored field, so it can be sortable So we have to
Original PR description
For the moment we cannot groupby an inherited field (which is therefore related), so it is counted as being non-stored. Because in the `_normalize` function we do not process fields that are not stored, whereas like here https://github.com/odoo/odoo/blob/d679cd0d8ba9a2420e81a42a698763e9be2327e1/addons/web/static/src/legacy/js/control_panel/groupby_menu.js#L45-L49. Typically when a field is non-stored but sortable it is inherited from a stored field, so it can be sortable So we have to use `sortable` instead of `sort` to make it consistent. opw-2733133 Forward-Port-Of: odoo/odoo#83390
To reproduce the issue: (Need purchase,sale_management) 1. Create a product category PC: - Costing Method: FIFO 2. Create a product P - Type: Storable - Category: PC 3. Create a PO with 1 x P @ 10 + Receive P 4. Create a PO with 1 x P @ 0 + Receive P 5. Create a SO with 1 x P + Deliver P 6. Create a SO with 1 x P + Deliver P 7. Process a return for sold P at step 6 8. Open the valuation of the return Error: The value is 10, should be 0 In `_get_price_unit`, `price_u
Original PR description
To reproduce the issue:
(Need purchase,sale_management)
1. Create a product category PC:
- Costing Method: FIFO
2. Create a product P
- Type: Storable
- Category: PC
3. Create a PO with 1 x P @ 10 + Receive P
4. Create a PO with 1 x P @ 0 + Receive P
5. Create a SO with 1 x P + Deliver P
6. Create a SO with 1 x P + Deliver P
7. Process a return for sold P at step 6
8. Open the valuation of the return
Error: The value is 10, should be 0
In `_get_price_unit`, `price_unit` is defined with the correct value
(i.e., `0`), but the if-condition of the `return` is not respected, so
another value is used
OPW-2735502
Forward-Port-Of: odoo/odoo#84590
Forward-Port-Of: odoo/odoo#84274Description of the issue/feature this PR addresses: Odoo task-id: 2715227 Current behavior before PR: When the snailmail API-call timed out, the SnailmailLetter.state and SnailmailLetter.error_code were not changed, which resulted in an infinite loop of retries via the "Snailmail: process letters queue" cron job. Desired behavior after PR is merged: On a timeout the SnailmailLetter.state and SnailmailLetter.error_code is changed such that no retry happens. Following stable policy, no t
Original PR description
Description of the issue/feature this PR addresses: Odoo task-id: 2715227 Current behavior before PR: When the snailmail API-call timed out, the SnailmailLetter.state and SnailmailLetter.error_code were not changed, which resulted in an infinite loop of retries via the "Snailmail: process letters queue" cron job. Desired behavior after PR is merged: On a timeout the SnailmailLetter.state and SnailmailLetter.error_code is changed such that no retry happens. Following stable policy, no timeout error is added, but 'unknown error' will be used. Preventing retries on timeout is mandatory as timed-out request are indeed processed by IAP and customers are credited. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#84202 Forward-Port-Of: odoo/odoo#81659
Purpose ======= Help users easily onboard with Stripe by using the Stripe Connect API. Specifications ============== During the payment onboarding, if the user selects Stripe, they will start the Stripe Onboarding. (NB: The process uses a proxy that handles the Stripe Onboarding calls and signs them with the Stripe Connect key) 1) A call is made through the proxy to get the Stripe account token; 2) A call is made through the proxy to get the Stripe account link which contains the
Original PR description
Purpose ======= Help users easily onboard with Stripe by using the Stripe Connect API. Specifications ============== During the payment onboarding, if the user selects Stripe, they will start the…
Purpose ======= Help users easily onboard with Stripe by using the Stripe Connect API. Specifications ============== During the payment onboarding, if the user selects Stripe, they will start the Stripe Onboarding. (NB: The process uses a proxy that handles the Stripe Onboarding calls and signs them with the Stripe Connect key) 1) A call is made through the proxy to get the Stripe account token; 2) A call is made through the proxy to get the Stripe account link which contains the URL of the Onboarding; 3) The user is redirected to the Stripe Onboarding; 4) The user completes the Stripe Onboarding; 5) The user comes back to the acquirer form of Stripe and is able to get their keys. 6) The user can directly create their webhook after having copied/pasted their API keys. Note that the Onboarding status isn't stored in the database so there is no call to Stripe API to validate the account status. API Documentation : - Connect Onboarding: https://stripe.com/docs/connect/standard-accounts - Webhook creation: https://stripe.com/docs/api/webhook_endpoints/create task-2685160 task-2691213 See also: - Enterprise: https://github.com/odoo/enterprise/pull/23060 - IAP: https://github.com/odoo/iap-apps/pull/450 - Internal: https://github.com/odoo/internal/pull/1493 Forward-Port-Of: odoo/odoo#84538 Forward-Port-Of: odoo/odoo#79621
Right now, if we try to merge crm leads and few of the details are not available, traceback was thrown. For ex- - When lead does not have a company or the company does not have currency set - When the visitor name is not set This PR fixes both of the tracebacks and thus allows users to merge the leads in these cases. taskID-2745017 Forward-Port-Of: odoo/odoo#84052
Original PR description
Right now, if we try to merge crm leads and few of the details are not available, traceback was thrown. For ex- - When lead does not have a company or the company does not have currency set - When the visitor name is not set This PR fixes both of the tracebacks and thus allows users to merge the leads in these cases. taskID-2745017 Forward-Port-Of: odoo/odoo#84052
Steps to reproduce: - Set a language which use ',' (comma) as decimal separator (eg French) - Make a Vendor Bill for any product at any price. If the partner's language use '.' (period) as decimal separator (eg English), the field amount_by_group is formated whit period, while others are formated with comma. They should all be formated with comma. - Now print the Vendor Bill The same issue is occuring. With Customer Invoices, the issue is the same on the form view, but no
Original PR description
Steps to reproduce: - Set a language which use ',' (comma) as decimal separator (eg French) - Make a Vendor Bill for any product at any price. If the partner's language use '.' (period) as decimal…
Steps to reproduce: - Set a language which use ',' (comma) as decimal separator (eg French) - Make a Vendor Bill for any product at any price. If the partner's language use '.' (period) as decimal separator (eg English), the field amount_by_group is formated whit period, while others are formated with comma. They should all be formated with comma. - Now print the Vendor Bill The same issue is occuring. With Customer Invoices, the issue is the same on the form view, but not on the printing, where all the fields are formated with period, as set in the partner's language. After this commit, we format all the fields regarding the environment's language on the view form, either in Vendor Bills and Customer Invoices, and we formating the printed bill/invoice regarding the partner's language opw-2735698 Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#84622 Forward-Port-Of: odoo/odoo#84284
Based on the po/pot files generated from odoo, reorder the translations + remove the unused one. Solve the issue raised in: https://github.com/odoo/odoo/commit/51e969c6e04d7a8d699e355dda951b44c53da9dd#r66715214 Forward-Port-Of: odoo/odoo#84625
Original PR description
Based on the po/pot files generated from odoo, reorder the translations + remove the unused one. Solve the issue raised in: https://github.com/odoo/odoo/commit/51e969c6e04d7a8d699e355dda951b44c53da9dd#r66715214 Forward-Port-Of: odoo/odoo#84625
Prior to this commit, the onboarding took the wrong onboarding state regarding the payment onboarding step. This commit removes the override in order to use the default (correct) one. task-2685160 See also: - Community: https://github.com/odoo/odoo/pull/79621 - IAP: https://github.com/odoo/iap-apps/pull/450 - Internal: https://github.com/odoo/internal/pull/1493 Forward-Port-Of: odoo/enterprise#24323 Forward-Port-Of: odoo/enterprise#23060
Original PR description
Prior to this commit, the onboarding took the wrong onboarding state regarding the payment onboarding step. This commit removes the override in order to use the default (correct) one. task-2685160 See also: - Community: https://github.com/odoo/odoo/pull/79621 - IAP: https://github.com/odoo/iap-apps/pull/450 - Internal: https://github.com/odoo/internal/pull/1493 Forward-Port-Of: odoo/enterprise#24323 Forward-Port-Of: odoo/enterprise#23060
Current behavior: When trying to add a previously downloaded invoice as attachment to another invoice there is an error message. Steps to reproduce: - Go to an invoice and print it - Duplicate the invoice and remove the order lines - Try to add the previously downloaded pdf as attachment - You get an error saying the record doesn't exist opw-2741484 Forward-Port-Of: odoo/enterprise#23905
Original PR description
Current behavior: When trying to add a previously downloaded invoice as attachment to another invoice there is an error message. Steps to reproduce: - Go to an invoice and print it - Duplicate the invoice and remove the order lines - Try to add the previously downloaded pdf as attachment - You get an error saying the record doesn't exist opw-2741484 Forward-Port-Of: odoo/enterprise#23905
If a user has several connections and one is in error with the proxy, the manual_sync() will return an error that will stop the cron. That's why we add a try/except that allows to ignore the errors during the cron fetch. Forward-Port-Of: odoo/enterprise#24340
Original PR description
If a user has several connections and one is in error with the proxy, the manual_sync() will return an error that will stop the cron. That's why we add a try/except that allows to ignore the errors during the cron fetch. Forward-Port-Of: odoo/enterprise#24340
To reproduce (V15): 0. Set up an ebay account 1. Set up a product to be used in ebay -> make sure the "Description Template" is filled 2. (in debug) press the "List item on Ebay" button -> Error `ebaysdk: AddFixedPriceItem: Class: RequestError, Severity: Error, Code: 20170, Schema XML request error. Schema XML request error: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize..` Analysis: The issue happen because the `des
Original PR description
To reproduce (V15): 0. Set up an ebay account 1. Set up a product to be used in ebay -> make sure the "Description Template" is filled 2. (in debug) press the "List item on Ebay" button -> Error…
To reproduce (V15): 0. Set up an ebay account 1. Set up a product to be used in ebay -> make sure the "Description Template" is filled 2. (in debug) press the "List item on Ebay" button -> Error `ebaysdk: AddFixedPriceItem: Class: RequestError, Severity: Error, Code: 20170, Schema XML request error. Schema XML request error: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize..` Analysis: The issue happen because the `description` variable at: https://github.com/odoo/enterprise/blob/fa2b55dfdbe3c8e2b822ad103c28c91711b65014/sale_ebay/models/product.py#L146 is of type "Markup" (new library used in V15 for mail templates). When the variable is concatenated with the string underneath: https://github.com/odoo/enterprise/blob/fa2b55dfdbe3c8e2b822ad103c28c91711b65014/sale_ebay/models/product.py#L147 it does create a Markup object (instead of a String), which does have the side effect that it do escape some special characters like '<' or '>' (to `<` and `>`). For example, it does apply on the `< After : Hide all the domain so we don't show only half the domain. Forw
Original PR description
Steps to reproduce : if entries are made to accounts like 512% that don't have a parent in the french accounting, these accounts will never be shown in the report when unfolding. Before : With lines that had a sum and children, only the accounts that were part of the sum were shown when unfolding.  After : Hide all the domain so we don't show only half the domain. Forward-Port-Of: odoo/enterprise#24143 Forward-Port-Of: odoo/enterprise#23940
…h a newline Importing QIF file starting with a newline (\n) to create a bank statement will trigger an error "Could not decipher the QIF file.". This can cause issues because some banks (like "Chase Bank") start their file with a newline. This fix will strip the file data before process it to avoid this. opw-2739328 Forward-Port-Of: odoo/enterprise#23988
Original PR description
…h a newline Importing QIF file starting with a newline (\n) to create a bank statement will trigger an error "Could not decipher the QIF file.". This can cause issues because some banks (like "Chase Bank") start their file with a newline. This fix will strip the file data before process it to avoid this. opw-2739328 Forward-Port-Of: odoo/enterprise#23988
Forward-Port-Of: odoo/enterprise#24302
Original PR description
Forward-Port-Of: odoo/enterprise#24302
Forward-Port-Of: odoo/enterprise#24298
Original PR description
Forward-Port-Of: odoo/enterprise#24298
Formulas `PIVOT`and `PIVOT.HEADER` have a potential async behaviour since they require an RPC and a subsequent evaluation before they are properly updated. Since ea20394, we introduced a debounce and with it the necessity to run an additional nextTick to ensure that the cells are evaluated after the RPC promise is solved. In this commit, we use the helper `waitForEvaluation`that was added for that very purpose. task 2764761 Forward-Port-Of: odoo/enterprise#24339 Forward-Port-Of: odoo
Original PR description
Formulas `PIVOT`and `PIVOT.HEADER` have a potential async behaviour since they require an RPC and a subsequent evaluation before they are properly updated. Since ea20394, we introduced a debounce and with it the necessity to run an additional nextTick to ensure that the cells are evaluated after the RPC promise is solved. In this commit, we use the helper `waitForEvaluation`that was added for that very purpose. task 2764761 Forward-Port-Of: odoo/enterprise#24339 Forward-Port-Of: odoo/enterprise#24326
Adding a test to verify if `send_payment_request` is used once and only once in `_do_payment` See also: - https://github.com/odoo/odoo/pull/80590 task-2659750 Forward-Port-Of: odoo/enterprise#24304 Forward-Port-Of: odoo/enterprise#22854
Original PR description
Adding a test to verify if `send_payment_request` is used once and only once in `_do_payment` See also: - https://github.com/odoo/odoo/pull/80590 task-2659750 Forward-Port-Of: odoo/enterprise#24304 Forward-Port-Of: odoo/enterprise#22854
… not MX Forward-Port-Of: odoo/enterprise#24212
Original PR description
… not MX Forward-Port-Of: odoo/enterprise#24212
Forward-Port-Of: odoo/enterprise#24257 Forward-Port-Of: odoo/enterprise#24247
Original PR description
Forward-Port-Of: odoo/enterprise#24257 Forward-Port-Of: odoo/enterprise#24247
Steps : Create a Rental Order. Add a SOL with Product Meeting Room. In the wizard, as Dates : Tomorrow 10:00 - Tomorrow 12:00. Validate. Issue : See, in SOL Description : "Meeting Room 02/08/2022 10:00:00 to 13:00:00". Expected : "... to 12:00:00". Cause : In previous versions, user tz was not taken into account in format_time, so we used to first convert it to user tz before passing it to this method. Fix : Now, user tz is taken into account in format_time, so we don't convert
Original PR description
Steps : Create a Rental Order. Add a SOL with Product Meeting Room. In the wizard, as Dates : Tomorrow 10:00 - Tomorrow 12:00. Validate. Issue : See, in SOL Description : "Meeting Room 02/08/2022 10:00:00 to 13:00:00". Expected : "... to 12:00:00". Cause : In previous versions, user tz was not taken into account in format_time, so we used to first convert it to user tz before passing it to this method. Fix : Now, user tz is taken into account in format_time, so we don't convert it. opw: 2746372 Forward-Port-Of: odoo/enterprise#24205 Forward-Port-Of: odoo/enterprise#24056