Friday, February 14, 2020
16 changes · master
Enhancements to existing features
Users now see a setup message the first time they enable the Unsplash feature in settings. This makes the integration easier to configure by providing guidance where it was previously missing.
Original PR description
Before this commit, There was no Instruction to Setup this feature like other Integrations.  Now we display a message when we enable this feature for the First time from settings.  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
This update shares the Odoo edition information with the frontend so guided tours can follow the correct steps in both Community and Enterprise editions. It helps prevent tours from getting out of sync when users move between backend and frontend screens.
Original PR description
This information is necessary for tours going from the backend to the frontend (or the other way around) to run properly: Some tour steps may be flagged with 'community' or 'enterprise', meaning they must only be executed in the corresponding edition. The TourManager filters the steps according to the edition. When a tour is executed (either in test mode, automatically, or in an onboarding situation, manually), the index of the current step is stored in the local storage. So, the list of filtered steps must be the same in the backend and in the frontend, which couldn't be guaranteed as the frontend didn't have the information (thus always considered being in community). Part of task 2180175 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 unit of measure module now uses Odoo’s standard data grouping method instead of custom database queries. This fine tuning improves maintainability and keeps behavior aligned with the platform, with no expected change for everyday users.
Original PR description
Fine tuning of https://github.com/odoo/odoo/commit/e0ed50a724eb129451d98d93e7365b4b117cfd0a#diff-c8d70a21ea4a74ffd3d58edb1534ba61 @jem-odoo -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
The Accounting app now shows the read-only full accounting access group when it is installed. This makes it easier for businesses to assign auditor-style permissions without exposing the option in simpler invoicing-only setups.
Original PR description
We chose to hide the group "Show Full Accounting Features - Readonly" in invoicing but we need to show it when accounting is installed. Community PR: https://github.com/odoo/odoo/pull/43893
Miscellaneous changes
[FIX] stock: Alert should disappear when picking done cancelled In this commit, added a restriction on "json_popover" field so, Alert should disappear when picking is done or cancelled state on list, kanban and form views. [IMP] stock,mrp: change icon of json popover The icon of the json popover become a warning icon when there is a issue. task-2178494 Forward-Port-Of: odoo/odoo#44543
Original PR description
[FIX] stock: Alert should disappear when picking done cancelled In this commit, added a restriction on "json_popover" field so, Alert should disappear when picking is done or cancelled state on list, kanban and form views. [IMP] stock,mrp: change icon of json popover The icon of the json popover become a warning icon when there is a issue. task-2178494 Forward-Port-Of: odoo/odoo#44543
The recently added group "Show Full Accounting Features - Readonly" was shown in the selection of groups of accounting, but the "Show Full Accounting Feature" wasn't. It was inconsistent and allowed to see the features too easily (not debug mode needed) -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#43893
Original PR description
The recently added group "Show Full Accounting Features - Readonly" was shown in the selection of groups of accounting, but the "Show Full Accounting Feature" wasn't. It was inconsistent and allowed to see the features too easily (not debug mode needed) -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#43893
We don't want a next activity for an invoice to be created for OdooBot if he is the Salesperson. We also don't want a traceback if the salesperson and the next activity user are not set. 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#44974
Original PR description
We don't want a next activity for an invoice to be created for OdooBot if he is the Salesperson. We also don't want a traceback if the salesperson and the next activity user are not set. 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#44974
When you read a record with the document viewer on the right side that you don't have write access to this record and the message_main_attachment_id was not yet set on the record the document viewer try to set a value for message_main_attachment_id that raise an access error Set the value is not important but the popup Access error can be really annoying -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#45010 Forwa
Original PR description
When you read a record with the document viewer on the right side that you don't have write access to this record and the message_main_attachment_id was not yet set on the record the document viewer try to set a value for message_main_attachment_id that raise an access error Set the value is not important but the popup Access error can be really annoying -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#45010 Forward-Port-Of: odoo/odoo#44722
2 lasts steps are: - Click on go to checkout - Ensure checkout total is correct But the last condition was already true before landing to the checkout, thus the last step would succeed while the page is transitionning to the checkout. The following would happen every time: - Click on go to checkout - Last step succeed directly after the previous step click on Go to checkout Then, the following would happen rarely: - The tour is considered successful - The checkout page
Original PR description
2 lasts steps are: - Click on go to checkout - Ensure checkout total is correct But the last condition was already true before landing to the checkout, thus the last step would succeed while the page…
2 lasts steps are:
- Click on go to checkout
- Ensure checkout total is correct
But the last condition was already true before landing to the checkout, thus
the last step would succeed while the page is transitionning to the checkout.
The following would happen every time:
- Click on go to checkout
- Last step succeed directly after the previous step click on Go to checkout
Then, the following would happen rarely:
- The tour is considered successful
- The checkout page is loaded
- Some GET requests are performed
- The tour is killed (cookies & local storage)
- Some other GET requests are crashing, such as:
`Error loading file http://127.0.0.1:8069/web/webclient/locale/en_US`
The fix simply wait for the checkout page to be loaded as it was supposed to at
first, before checking the last step.
Forward-port of https://github.com/odoo/enterprise/pull/8322
X-original-commit: https://github.com/odoo/enterprise/commit/67686b697c866a5e5ad141a85b3589f1f1598d73
(coupon was moved from enterprise to community in Odoo saas-12.3)
Forward-Port-Of: odoo/odoo#45356
Forward-Port-Of: odoo/odoo#45097### Issue - Remove ~/.odoorc - Launch a server - Try to dump the db in db manager Ok - Restart the server - Retry pg_dump not found ### Cause When the .odoorc file is not there, the pg_path option is not present so the normalize method set it to None When the server is restarted, it re-checks the options (which are strings) and in the normalize method we check "if not pg_path" but 'None' is truthy so it thinks this is a real path. ### Solution
Original PR description
### Issue - Remove ~/.odoorc - Launch a server - Try to dump the db in db manager Ok - Restart the server - Retry pg_dump not found ### Cause When the .odoorc file is not there, the pg_path option is not present so the normalize method set it to None When the server is restarted, it re-checks the options (which are strings) and in the normalize method we check "if not pg_path" but 'None' is truthy so it thinks this is a real path. ### Solution Check if not pg_path or if pg_path string is None **OPW-2189789** -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#45354
Since wizards shall not be unlinked by anyone, but as we want to get rid of this specific one immediately to get rid of eventual credentials, do it with elevated privileges. Before this commit, the behavior was an authorization error when trying to applying the payment method, in a fresh invoicing configuration. Forward-Port-Of: odoo/odoo#45327
Original PR description
Since wizards shall not be unlinked by anyone, but as we want to get rid of this specific one immediately to get rid of eventual credentials, do it with elevated privileges. Before this commit, the behavior was an authorization error when trying to applying the payment method, in a fresh invoicing configuration. Forward-Port-Of: odoo/odoo#45327
We cannot assume reading the value of a monetary field has the decimals specified by the currency in decimal_places. Right after creating a record with a monetary field it may have a different amount of decimals. To reproduce this: ``` >>> tx = env['payment.transaction'].create({ 'amount': 10.87, 'acquirer_id': env['payment.acquirer'].search([], limit=1).id, 'currency_id': env.ref('base.USD').id, 'reference': 'test' }) >>> tx.id 130 >>> tx.amount 10.8700000000000
Original PR description
We cannot assume reading the value of a monetary field has the decimals specified by the currency in decimal_places. Right after creating a record with a monetary field it may have a different amount…
We cannot assume reading the value of a monetary field has the
decimals specified by the currency in decimal_places.
Right after creating a record with a monetary field it may have a
different amount of decimals.
To reproduce this:
```
>>> tx = env['payment.transaction'].create({
'amount': 10.87,
'acquirer_id': env['payment.acquirer'].search([], limit=1).id,
'currency_id': env.ref('base.USD').id,
'reference': 'test'
})
>>> tx.id
130
>>> tx.amount
10.870000000000001
<Restart odoo>
>>> env['payment.transaction'].browse(130).amount
10.87
```
Authorize requires us to send a correctly rounded amount. The
following response is returned when sending 10.870000000000001:
```
{'messages': {'message': [{'code': 'E00027',
'text': 'The transaction was unsuccessful.'}],
'resultCode': 'Error'},
'transactionResponse': {'SupplementalDataQualificationIndicator': 0,
'accountNumber': '',
'accountType': '',
'authCode': '',
'avsResultCode': 'P',
'cavvResultCode': '',
'cvvResultCode': '',
'errors': [{'errorCode': '5',
'errorText': 'A valid amount is '
'required.'}],
'refTransID': '',
'responseCode': '3',
'testRequest': '0',
'transHash': '',
'transHashSha2': '',
'transId': '0'}}
```
To work around the issue always round when we read amount.
Lower level solutions were considered in #45248 but for now we'll
stick with this higher level and lower risk patch.
opw-2188889
Forward-Port-Of: odoo/odoo#45345Stock introduces the option 'product' for the field `type` of the `product.template` model. If there exists records for this model with the aforementioned option selected when the stock module is uninstalled, the records will remain in the database for an indefinite amount of time, all while pointing to an option that does no longer exist (except if the record was created by the stock module itself), making the registry inconsistent and eventually leading to a crash. This is a known
Original PR description
Stock introduces the option 'product' for the field `type` of the `product.template` model. If there exists records for this model with the aforementioned option selected when the stock module is…
Stock introduces the option 'product' for the field `type` of the
`product.template` model.
If there exists records for this model with the aforementioned option
selected when the stock module is uninstalled, the records will remain
in the database for an indefinite amount of time, all while pointing to
an option that does no longer exist (except if the record was created by
the stock module itself), making the registry inconsistent and
eventually leading to a crash.
This is a known limitation of the ORM regarding Selection fields and
more specifically the `selection_add` mechanism, no "generic" solution
has been chosen thus far because it is not always clear which approach
should be taken:
1) Delete the record?
2) Set the option to a fallback, base option?
3) Something else handled by the module itself?
...
In this case the second approach has been chosen and whenever the module
stock is uninstalled, all remaining product.template records of `type`
'product' will be reset to the default option defined by the field,
which as of this commit is 'consu'.
See opw#2193814
Forward-Port-Of: odoo/odoo#45276
Forward-Port-Of: odoo/odoo#45180We recently transitioned to async option methods, this allows us to have better control on the order of execution in the edition workflow, and among other things, keep the editor's UI in sync with the current state of the DOM. However, some snippet options (such as the number of columns option) need to remove or clone portions of the DOM, and as such, trigger the onClone or onRemove methods of the snippets contained in that portion if applicable. Because these methods are defined on oth
Original PR description
We recently transitioned to async option methods, this allows us to have better control on the order of execution in the edition workflow, and among other things, keep the editor's UI in sync with…
We recently transitioned to async option methods, this allows us to have better control on the order of execution in the edition workflow, and among other things, keep the editor's UI in sync with the current state of the DOM. However, some snippet options (such as the number of columns option) need to remove or clone portions of the DOM, and as such, trigger the onClone or onRemove methods of the snippets contained in that portion if applicable. Because these methods are defined on other options, we first need to make sure all the snippetEditors for this portion are created, which is asynchronous. This commit adds support for an onSuccess callback to the 'clone_snippet' and 'remove_snippet' event handlers, such that options can choose to be notified when the work has been done, allowing them to wait for it before proceeding. This commit also adapts the layout_column snippet option to make use of that new feature, and remove code that was used as a workaround before, ie: precomputing the expected number of columns after the clone/remove, and using that number to adjust the width of the columns and update the UI. We can now just wait for the clone/remove, and use the real number of columns currently in the DOM. Forward-Port-Of: odoo/odoo#44951
Steps to reproduce: - install accounting - go to the accounting main view and hover some of the graphs Previous behavior: rounding was inconsistent and would lead to weird js floats like 65.00000000000001 Current behavior: floats are rounded to 2 digits after opw-2172686 Forward-Port-Of: odoo/odoo#44987
Original PR description
Steps to reproduce: - install accounting - go to the accounting main view and hover some of the graphs Previous behavior: rounding was inconsistent and would lead to weird js floats like 65.00000000000001 Current behavior: floats are rounded to 2 digits after opw-2172686 Forward-Port-Of: odoo/odoo#44987
### Issue - Install Sales, Dashboard - Sales > Reporting > Sales - Add to my dashboard - Dashboard > Click on any filter below Traceback (updateFilters does not exist on undefined) ### Cause This is caused by the absence of control panel. Filters can't be applied. ### Solution With the actual dashboard, it is not possible to have a control panel. So, I display an error notification instead of a traceback. **OPW-2183631** Forward-Port-Of: odoo/enterprise#8425
Original PR description
### Issue - Install Sales, Dashboard - Sales > Reporting > Sales - Add to my dashboard - Dashboard > Click on any filter below Traceback (updateFilters does not exist on undefined) ### Cause This is caused by the absence of control panel. Filters can't be applied. ### Solution With the actual dashboard, it is not possible to have a control panel. So, I display an error notification instead of a traceback. **OPW-2183631** Forward-Port-Of: odoo/enterprise#8425