Thursday, August 17, 2023
24 changes · master
Enhancements to existing features
This update removes redundant JavaScript strict mode declarations from several Odoo Enterprise modules. The behavior of the applications is unchanged because Odoo already applies strict mode automatically, making the codebase cleaner and easier to maintain.
Original PR description
According to the [ECMAScript 2023 Language Specification](https://tc39.es/ecma262/2023/#sec-strict-mode-code): > Module code is always strict mode code. [Odoo Modules mimic this behavior and automatically add “use strict“ at the top of the file](https://github.com/odoo/odoo/blob/9eb5ea9746cf277f09f5258dbc276162280b275b/odoo/tools/js_transpiler.py#L104), so there's no need to do it yourself. This commit removes all the useless occurrences of use strict. \*: account_online_synchronization, knowledge, sign Community: https://github.com/odoo/odoo/pull/132235
The Knowledge app now uses a newer built-in copy action for templates instead of an older clipboard library. This keeps the feature simpler to maintain while preserving the same copy-to-clipboard experience for users.
Original PR description
This commit removes the usage of ClipboardJS in the TemplateBehavior component. Instead, the CopyButton component using the native clipboard API has been used.
Resolved issues and error corrections
This change ensures the Accounting-related bank statement import feature correctly declares a required dependency. It prevents an installation error when Accounting is installed after the import component has been removed.
Original PR description
To reproduce ============= - uninstall `base_import` - install Accounting an error is raised Problem ======= `account_bank_statement_import` depends on `base_import` but it's not added in `__manifest__` Solution ======== add `base_import` opw-3417157
Features or functions removed from Odoo
An old Studio promotion dialog was removed because it has already been replaced by a newer version. This is a low-risk cleanup that reduces unused code without changing the current user experience.
Original PR description
This dialog has been replaced by its new OWL implementation and can be safely removed. The template has been already removed in [1]. [1] https://github.com/odoo/enterprise/pull/45484
Code cleanup and technical improvements
The VoIP-related modules were reformatted to follow a consistent Python code style. This makes the code easier to maintain and review, with no expected change to business functionality.
Original PR description
Split from #38339 to ease the diff.
Miscellaneous changes
When creatinga sale withhold for two invoices, only one invoice is mark as paid (partial), even when having withhold lines belonging to both invoices. Steps: - Install l10n_ec_edi - Go to EC Company - Crete 2 Customer Invoices to the same Customer - Go to the list view and select the 2 invoices created > Action > Create Withholding - Add a withholding to the first invoice and another WTH to the second invoice created and click on Create and Post - The WTH total is reconciled only to 1 IN
Original PR description
When creatinga sale withhold for two invoices, only one invoice is mark as paid (partial), even when having withhold lines belonging to both invoices. Steps: - Install l10n_ec_edi - Go to EC Company - Crete 2 Customer Invoices to the same Customer - Go to the list view and select the 2 invoices created > Action > Create Withholding - Add a withholding to the first invoice and another WTH to the second invoice created and click on Create and Post - The WTH total is reconciled only to 1 INV and should be split it as it was split it in the wizard. opw-3455655 Forward-Port-Of: odoo/enterprise#45388
The India tax reporting tests were adjusted to align with updated default tax settings. This helps ensure reporting checks remain accurate after the tax configuration change.
Original PR description
see https://github.com/odoo/odoo/pull/130733 Update l10n_in_reports tests to match the accopanying change to India's default taxes in the l10n_in. task-3453997
The Manage Booking button in the restaurant appointment dropdown now lines up correctly. This improves the point-of-sale interface by making the menu look cleaner and easier to use for staff.
Original PR description
The `Manage Booking` button in the dropdown menu is not properly aligned. This commit fixes the issue. Task: 3458435
The Manage Bookings option in the restaurant POS navigation bar now lines up correctly with the other navigation items. This improves the visual consistency of the table booking workflow and makes the interface look cleaner for users.
Original PR description
before this commit, manage bookings in the pos navbar is not aligned properly with other content in the navbar. * open a session with table booking enabled * click on navbar after this commit, manage bookings will align properly with other contents in the navbar Before:  After: 
This fix ensures planning slot dates are shown as properly formatted dates instead of raw date format text. It also restores a missing localization dependency, improving date display consistency for users across languages and regions.
Original PR description
[FIX] planning: missing import and not formatted dates Before this commit: - import localization was missing in planning/static/src/js/planning_calendar_front.js - the format is diplayed instead of the formatted date for planning slots After this commit: - localization imported - moment and time were replaced by luxon and dates are well formatted X-original-commit: https://github.com/odoo/enterprise/commit/9c42c4cd8ffa1066980777cba865964471715486
When the user opens Social Marketing app and `facebook_account_id` is set to `False` the following error will be generated. Traceback on sentry: ``` TypeError: Cannot mix str and bytes arguments (got ('https://graph.facebook.com/v17.0/', False)) File "odoo/http.py", line 2123, in __call__ response = request._serve_db() File "odoo/http.py", line 1699, in _serve_db return service_model.retrying(self._serve_ir_http, self.env) File "odoo/service/model.py", line 133, in re
Original PR description
When the user opens Social Marketing app and `facebook_account_id` is set to `False` the following error will be generated. Traceback on sentry: ``` TypeError: Cannot mix str and bytes arguments (got…
When the user opens Social Marketing app and `facebook_account_id` is set to
`False` the following error will be generated.
Traceback on sentry:
```
TypeError: Cannot mix str and bytes arguments (got ('https://graph.facebook.com/v17.0/', False))
File "odoo/http.py", line 2123, in __call__
response = request._serve_db()
File "odoo/http.py", line 1699, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "odoo/service/model.py", line 133, in retrying
result = func()
File "odoo/http.py", line 1726, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "odoo/http.py", line 1927, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "addons/website/models/ir_http.py", line 234, in _dispatch
response = super()._dispatch(endpoint)
File "odoo/addons/base/models/ir_http.py", line 190, in _dispatch
result = endpoint(**request.params)
File "odoo/http.py", line 716, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "addons/web/controllers/dataset.py", line 30, in call_kw
return self._call_kw(model, method, args, kwargs)
File "addons/web/controllers/dataset.py", line 26, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "odoo/api.py", line 457, in call_kw
result = _call_kw_model(method, model, args, kwargs)
File "odoo/api.py", line 430, in _call_kw_model
result = method(recs, *args, **kwargs)
File "home/odoo/src/enterprise/saas-16.3/social/models/social_account.py", line 141, in refresh_statistics
all_accounts._compute_statistics()
File "home/odoo/src/enterprise/saas-16.3/social_twitter/models/social_account.py", line 26, in _compute_statistics
super(SocialAccountTwitter, (self - twitter_accounts))._compute_statistics()
File "home/odoo/src/enterprise/saas-16.3/social_linkedin/models/social_account.py", line 41, in _compute_statistics
super(SocialAccountLinkedin, (self - linkedin_accounts))._compute_statistics()
File "home/odoo/src/enterprise/saas-16.3/social_instagram/models/social_account.py", line 41, in _compute_statistics
super(SocialAccountInstagram, (self - instagram_accounts))._compute_statistics()
File "home/odoo/src/enterprise/saas-16.3/social_facebook/models/social_account.py", line 49, in _compute_statistics
page_global_stats = requests.get(url_join(self.env['social.media']._FACEBOOK_ENDPOINT_VERSIONED, account.facebook_account_id),
File "werkzeug/urls.py", line 1054, in url_join
_check_str_tuple((base, url))
File "werkzeug/_internal.py", line 90, in _check_str_tuple
raise TypeError(f"Cannot mix str and bytes arguments (got {value!r})")
```
In the neutralized database, a SQL query is fired which is setting
`facebook_account_id` to NULL. The compute method `_compute_statistics` is using
`url_join` which is joining the Graph API of Facebook with
`facebook_account_id` but as `facebook_account_id` is NULL so `url_join` is
throwing a `TypeError`.
To resolve this issue, the old code loops through all the `facebook_accounts`
without any specific criteria. The new code filters the `facebook_accounts`
collection and only iterates over the accounts that have a non-empty
`facebook_account_id`.
Sentry-4312545705
Forward-Port-Of: odoo/enterprise#44253The search bar was not working properly. The old implementation was really weird so it needed to be rewritten. How it works: - When something is typed in the search bar the 'search()' function in the 'AccountReportSearchBar' will loop over the lines to see if a part of the line name matches what is being typed. If there is a match, it will add the line id in 'search_matches' on the controller. - The 'AccountReportLine' will check if it needs to be hidden with the 'hiddenBySearchFilter' f
Original PR description
The search bar was not working properly. The old implementation was really weird so it needed to be rewritten. How it works: - When something is typed in the search bar the 'search()' function in the 'AccountReportSearchBar' will loop over the lines to see if a part of the line name matches what is being typed. If there is a match, it will add the line id in 'search_matches' on the controller. - The 'AccountReportLine' will check if it needs to be hidden with the 'hiddenBySearchFilter' function. - The 'hiddenBySearchFilter' hides the line by default except if there is a key 'search_matches' and the current line is related (children or ancestor) to any 'search_matches' line or if it is the line. Forward-Port-Of: odoo/enterprise#45719 Forward-Port-Of: odoo/enterprise#45602
This commit fixes some bad behaviours introduced by the refactoring taskId:3179166. The behaviours to correct were the following: - The visual hover effect on the bottom of each page is deleted, keeping only the pointer change. - Selection and Activation are no longer different. This commit mixes the 2 behaviours. - The rules actions are corrected to be the same as in 16.0. The expected behaviour is the following : - When a rule is applied on some pages (
Original PR description
This commit fixes some bad behaviours introduced by the refactoring taskId:3179166. The behaviours to correct were the following: - The visual hover effect on the bottom of each page is deleted,…
This commit fixes some bad behaviours introduced by the refactoring taskId:3179166. The behaviours to correct were the following:
- The visual hover effect on the bottom of each page is deleted,
keeping only the pointer change.
- Selection and Activation are no longer different. This commit
mixes the 2 behaviours.
- The rules actions are corrected to be the same as in 16.0. The
expected behaviour is the following :
- When a rule is applied on some pages (not all) and that this
action leads to another model (i.e. project.task for the action
'Create Task'), then the pages are transformed into a document
and linked to the corresponding model AND the user stays into
the split tools.
- When the rule is applied on all the pages and that this
action leads to another model then the pages are transformed
into a document and linked to the corresponding model AND split
tools is closed and the model record view is loaded.
- When a rule is applied on some pages (not all) and that the
action does not link to another model, the page is transformed
into a document AND the user stays into the split tools.
- When a rule is applied on all the pages and that the action
does not link to another model, the page is transformed
into a document AND split tools is closed.
- The keyboard shortcuts are deactivated when renaming a group name
- The display of the pages is corrected so the pages are always
aligned vertically on many rows.
taskid:3438720
Forward-Port-Of: odoo/enterprise#44769Forward-Port-Of: odoo/enterprise#45770
Original PR description
Forward-Port-Of: odoo/enterprise#45770
When you apply a saved filter (with order) on graph and then change its measure or order, the new changes are discarded and data is inserted as per filter in spreadsheet since order and measure of context take precedence over applied changes stored in metadata. This PR omits graph order and measure from context while inserting the graph to ensure that latest changes are applied. Task: 3373768 Forward-Port-Of: odoo/enterprise#45393 Forward-Port-Of: odoo/enterprise#45017
Original PR description
When you apply a saved filter (with order) on graph and then change its measure or order, the new changes are discarded and data is inserted as per filter in spreadsheet since order and measure of context take precedence over applied changes stored in metadata. This PR omits graph order and measure from context while inserting the graph to ensure that latest changes are applied. Task: 3373768 Forward-Port-Of: odoo/enterprise#45393 Forward-Port-Of: odoo/enterprise#45017
Be inside studio, on the HomeMenu. Open the command palette and click on an item to open the corresponding action. Before this commit, the action opened outside studio. This was because the command provider for menus triggered the selectMenu method of the menuService directly which bypasses the studio mechanism. This had a huge side effect: studio was never really exited, meaning that the user context was dirty. After this commit, the studio service does the necessary override to redirect
Original PR description
Be inside studio, on the HomeMenu. Open the command palette and click on an item to open the corresponding action. Before this commit, the action opened outside studio. This was because the command provider for menus triggered the selectMenu method of the menuService directly which bypasses the studio mechanism. This had a huge side effect: studio was never really exited, meaning that the user context was dirty. After this commit, the studio service does the necessary override to redirect the selection of a menu to within studio. Forward-Port-Of: odoo/enterprise#45486 Forward-Port-Of: odoo/enterprise#45136
In [this fix]( https://github.com/odoo/enterprise/commit/ef9c696f825e763f450c7f02a239c79f50ead378#diff-774514eeaaf87c6b1c768b97ea72742739012968378e2b17874f2e37893abe5fR22 ), the company is not retreived properly, which returns an user error in the mps app because the warehouse is not set properly (as in the _default warehouse, the company is not correct => the warehouse is None). Forward-Port-Of: odoo/enterprise#45765
Original PR description
In [this fix]( https://github.com/odoo/enterprise/commit/ef9c696f825e763f450c7f02a239c79f50ead378#diff-774514eeaaf87c6b1c768b97ea72742739012968378e2b17874f2e37893abe5fR22 ), the company is not retreived properly, which returns an user error in the mps app because the warehouse is not set properly (as in the _default warehouse, the company is not correct => the warehouse is None). Forward-Port-Of: odoo/enterprise#45765
For the commit of the 72544175e8cfc23311aae02bd7a0b660c3b8b3ed also for the SEPA files not corresponding to the new version of SEPA introduced, we changed the elements we put in the address. Sadly, some banks reject it because of this. Before the zip and the city were in one tag and with that commit, they were in 2. opw-3467224 Forward-Port-Of: odoo/enterprise#45810
Original PR description
For the commit of the 72544175e8cfc23311aae02bd7a0b660c3b8b3ed also for the SEPA files not corresponding to the new version of SEPA introduced, we changed the elements we put in the address. Sadly, some banks reject it because of this. Before the zip and the city were in one tag and with that commit, they were in 2. opw-3467224 Forward-Port-Of: odoo/enterprise#45810
Property fields are not supported in spreadsheet. In saas-16.2, it even completely ruins the entire list if it contains one property field. With this commit, until we support properly property fields[1], we ignores property field when the list view is inserted in spreadsheet [1] in master, see task 3329490 opw-3284273 opw-3465243 Task: 3329490 Forward-Port-Of: odoo/enterprise#45790
Original PR description
Property fields are not supported in spreadsheet. In saas-16.2, it even completely ruins the entire list if it contains one property field. With this commit, until we support properly property fields[1], we ignores property field when the list view is inserted in spreadsheet [1] in master, see task 3329490 opw-3284273 opw-3465243 Task: 3329490 Forward-Port-Of: odoo/enterprise#45790
Forward-Port-Of: odoo/enterprise#45775
Original PR description
Forward-Port-Of: odoo/enterprise#45775
Steps to reproduce: - Go to Consolidation / Configuration / Consolidation - Create a new chart (e.g. Chart X) - For Chart X, create the following groups and subgroups: * Group A * Group AA (Parent: Group A) * Group AAA (Parent: Group AA) - For Chart X, create the following accounts: * Account A (Group: Group AAA) * Account B (Group: None) - Duplicate Chart X The copied chart is correctly linked to the copied root group (i.e. Group A (copy)) and its direct child (i.e. Group AA
Original PR description
Steps to reproduce: - Go to Consolidation / Configuration / Consolidation - Create a new chart (e.g. Chart X) - For Chart X, create the following groups and subgroups: * Group A * Group AA (Parent: Group A) * Group AAA (Parent: Group AA) - For Chart X, create the following accounts: * Account A (Group: Group AAA) * Account B (Group: None) - Duplicate Chart X The copied chart is correctly linked to the copied root group (i.e. Group A (copy)) and its direct child (i.e. Group AA (copy)), but subgroups on a deeper level (i.e. Group AAA(copy)) is linked to the original chart. Also, only accounts linked to a group is copied (i.e. Account A). Solution: Recursively set the chart of copied groups and subgroups to the id of the copied chart and include accounts with no group in the copy. opw-3381529 Forward-Port-Of: odoo/enterprise#45749 Forward-Port-Of: odoo/enterprise#45556
Improve the styling of analytic and analytic group by filters. Forward-Port-Of: odoo/enterprise#45031
Original PR description
Improve the styling of analytic and analytic group by filters. Forward-Port-Of: odoo/enterprise#45031
Backport in saas-16.4 of odoo/enterprise#39037 Forward-Port-Of: odoo/enterprise#45465
Original PR description
Backport in saas-16.4 of odoo/enterprise#39037 Forward-Port-Of: odoo/enterprise#45465
When trying to create a withhold for an invoice/bill that is partially paid, we get an error. Steps: - Install l10n_ec_edi - Create a Vendor Bill/Customer INV with a payment term that split the account receivable/payable (30% now and 60% later) - Register a Payment for the first 30% - Add a withholding (any WTH) -> Error: "You are trying to reconcile some entries that are already reconciled" opw-3455646 Forward-Port-Of: odoo/enterprise#45475
Original PR description
When trying to create a withhold for an invoice/bill that is partially paid, we get an error. Steps: - Install l10n_ec_edi - Create a Vendor Bill/Customer INV with a payment term that split the account receivable/payable (30% now and 60% later) - Register a Payment for the first 30% - Add a withholding (any WTH) -> Error: "You are trying to reconcile some entries that are already reconciled" opw-3455646 Forward-Port-Of: odoo/enterprise#45475